| 1 |
/*!
|
| 2 |
* html2canvas 1.4.1 <https://html2canvas.hertzen.com>
|
| 3 |
* Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
|
| 4 |
* Released under MIT License
|
| 5 |
*/
|
| 6 |
(function (global, factory) {
|
| 7 |
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
| 8 |
typeof define === 'function' && define.amd ? define(factory) :
|
| 9 |
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.html2canvas = factory());
|
| 10 |
}(this, (function () { 'use strict';
|
| 11 |
|
| 12 |
/*! *****************************************************************************
|
| 13 |
Copyright (c) Microsoft Corporation.
|
| 14 |
|
| 15 |
Permission to use, copy, modify, and/or distribute this software for any
|
| 16 |
purpose with or without fee is hereby granted.
|
| 17 |
|
| 18 |
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
| 19 |
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
| 20 |
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
| 21 |
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
| 22 |
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
| 23 |
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
| 24 |
PERFORMANCE OF THIS SOFTWARE.
|
| 25 |
***************************************************************************** */
|
| 26 |
/* global Reflect, Promise */
|
| 27 |
|
| 28 |
var extendStatics = function(d, b) {
|
| 29 |
extendStatics = Object.setPrototypeOf ||
|
| 30 |
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
| 31 |
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
| 32 |
return extendStatics(d, b);
|
| 33 |
};
|
| 34 |
|
| 35 |
function __extends(d, b) {
|
| 36 |
if (typeof b !== "function" && b !== null)
|
| 37 |
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
| 38 |
extendStatics(d, b);
|
| 39 |
function __() { this.constructor = d; }
|
| 40 |
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
| 41 |
}
|
| 42 |
|
| 43 |
var __assign = function() {
|
| 44 |
__assign = Object.assign || function __assign(t) {
|
| 45 |
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
| 46 |
s = arguments[i];
|
| 47 |
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
| 48 |
}
|
| 49 |
return t;
|
| 50 |
};
|
| 51 |
return __assign.apply(this, arguments);
|
| 52 |
};
|
| 53 |
|
| 54 |
function __awaiter(thisArg, _arguments, P, generator) {
|
| 55 |
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
| 56 |
return new (P || (P = Promise))(function (resolve, reject) {
|
| 57 |
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
| 58 |
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
| 59 |
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
| 60 |
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
| 61 |
});
|
| 62 |
}
|
| 63 |
|
| 64 |
function __generator(thisArg, body) {
|
| 65 |
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
| 66 |
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
| 67 |
function verb(n) { return function (v) { return step([n, v]); }; }
|
| 68 |
function step(op) {
|
| 69 |
if (f) throw new TypeError("Generator is already executing.");
|
| 70 |
while (_) try {
|
| 71 |
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
| 72 |
if (y = 0, t) op = [op[0] & 2, t.value];
|
| 73 |
switch (op[0]) {
|
| 74 |
case 0: case 1: t = op; break;
|
| 75 |
case 4: _.label++; return { value: op[1], done: false };
|
| 76 |
case 5: _.label++; y = op[1]; op = [0]; continue;
|
| 77 |
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
| 78 |
default:
|
| 79 |
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
| 80 |
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
| 81 |
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
| 82 |
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
| 83 |
if (t[2]) _.ops.pop();
|
| 84 |
_.trys.pop(); continue;
|
| 85 |
}
|
| 86 |
op = body.call(thisArg, _);
|
| 87 |
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
| 88 |
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
| 89 |
}
|
| 90 |
}
|
| 91 |
|
| 92 |
function __spreadArray(to, from, pack) {
|
| 93 |
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
| 94 |
if (ar || !(i in from)) {
|
| 95 |
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
| 96 |
ar[i] = from[i];
|
| 97 |
}
|
| 98 |
}
|
| 99 |
return to.concat(ar || from);
|
| 100 |
}
|
| 101 |
|
| 102 |
var Bounds = /** @class */ (function () {
|
| 103 |
function Bounds(left, top, width, height) {
|
| 104 |
this.left = left;
|
| 105 |
this.top = top;
|
| 106 |
this.width = width;
|
| 107 |
this.height = height;
|
| 108 |
}
|
| 109 |
Bounds.prototype.add = function (x, y, w, h) {
|
| 110 |
return new Bounds(this.left + x, this.top + y, this.width + w, this.height + h);
|
| 111 |
};
|
| 112 |
Bounds.fromClientRect = function (context, clientRect) {
|
| 113 |
return new Bounds(clientRect.left + context.windowBounds.left, clientRect.top + context.windowBounds.top, clientRect.width, clientRect.height);
|
| 114 |
};
|
| 115 |
Bounds.fromDOMRectList = function (context, domRectList) {
|
| 116 |
var domRect = Array.from(domRectList).find(function (rect) { return rect.width !== 0; });
|
| 117 |
return domRect
|
| 118 |
? new Bounds(domRect.left + context.windowBounds.left, domRect.top + context.windowBounds.top, domRect.width, domRect.height)
|
| 119 |
: Bounds.EMPTY;
|
| 120 |
};
|
| 121 |
Bounds.EMPTY = new Bounds(0, 0, 0, 0);
|
| 122 |
return Bounds;
|
| 123 |
}());
|
| 124 |
var parseBounds = function (context, node) {
|
| 125 |
return Bounds.fromClientRect(context, node.getBoundingClientRect());
|
| 126 |
};
|
| 127 |
var parseDocumentSize = function (document) {
|
| 128 |
var body = document.body;
|
| 129 |
var documentElement = document.documentElement;
|
| 130 |
if (!body || !documentElement) {
|
| 131 |
throw new Error("Unable to get document size");
|
| 132 |
}
|
| 133 |
var width = Math.max(Math.max(body.scrollWidth, documentElement.scrollWidth), Math.max(body.offsetWidth, documentElement.offsetWidth), Math.max(body.clientWidth, documentElement.clientWidth));
|
| 134 |
var height = Math.max(Math.max(body.scrollHeight, documentElement.scrollHeight), Math.max(body.offsetHeight, documentElement.offsetHeight), Math.max(body.clientHeight, documentElement.clientHeight));
|
| 135 |
return new Bounds(0, 0, width, height);
|
| 136 |
};
|
| 137 |
|
| 138 |
/*
|
| 139 |
* css-line-break 2.1.0 <https://github.com/niklasvh/css-line-break#readme>
|
| 140 |
* Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
|
| 141 |
* Released under MIT License
|
| 142 |
*/
|
| 143 |
var toCodePoints$1 = function (str) {
|
| 144 |
var codePoints = [];
|
| 145 |
var i = 0;
|
| 146 |
var length = str.length;
|
| 147 |
while (i < length) {
|
| 148 |
var value = str.charCodeAt(i++);
|
| 149 |
if (value >= 0xd800 && value <= 0xdbff && i < length) {
|
| 150 |
var extra = str.charCodeAt(i++);
|
| 151 |
if ((extra & 0xfc00) === 0xdc00) {
|
| 152 |
codePoints.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000);
|
| 153 |
}
|
| 154 |
else {
|
| 155 |
codePoints.push(value);
|
| 156 |
i--;
|
| 157 |
}
|
| 158 |
}
|
| 159 |
else {
|
| 160 |
codePoints.push(value);
|
| 161 |
}
|
| 162 |
}
|
| 163 |
return codePoints;
|
| 164 |
};
|
| 165 |
var fromCodePoint$1 = function () {
|
| 166 |
var codePoints = [];
|
| 167 |
for (var _i = 0; _i < arguments.length; _i++) {
|
| 168 |
codePoints[_i] = arguments[_i];
|
| 169 |
}
|
| 170 |
if (String.fromCodePoint) {
|
| 171 |
return String.fromCodePoint.apply(String, codePoints);
|
| 172 |
}
|
| 173 |
var length = codePoints.length;
|
| 174 |
if (!length) {
|
| 175 |
return '';
|
| 176 |
}
|
| 177 |
var codeUnits = [];
|
| 178 |
var index = -1;
|
| 179 |
var result = '';
|
| 180 |
while (++index < length) {
|
| 181 |
var codePoint = codePoints[index];
|
| 182 |
if (codePoint <= 0xffff) {
|
| 183 |
codeUnits.push(codePoint);
|
| 184 |
}
|
| 185 |
else {
|
| 186 |
codePoint -= 0x10000;
|
| 187 |
codeUnits.push((codePoint >> 10) + 0xd800, (codePoint % 0x400) + 0xdc00);
|
| 188 |
}
|
| 189 |
if (index + 1 === length || codeUnits.length > 0x4000) {
|
| 190 |
result += String.fromCharCode.apply(String, codeUnits);
|
| 191 |
codeUnits.length = 0;
|
| 192 |
}
|
| 193 |
}
|
| 194 |
return result;
|
| 195 |
};
|
| 196 |
var chars$2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
| 197 |
// Use a lookup table to find the index.
|
| 198 |
var lookup$2 = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);
|
| 199 |
for (var i$2 = 0; i$2 < chars$2.length; i$2++) {
|
| 200 |
lookup$2[chars$2.charCodeAt(i$2)] = i$2;
|
| 201 |
}
|
| 202 |
|
| 203 |
/*
|
| 204 |
* utrie 1.0.2 <https://github.com/niklasvh/utrie>
|
| 205 |
* Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
|
| 206 |
* Released under MIT License
|
| 207 |
*/
|
| 208 |
var chars$1$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
| 209 |
// Use a lookup table to find the index.
|
| 210 |
var lookup$1$1 = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);
|
| 211 |
for (var i$1$1 = 0; i$1$1 < chars$1$1.length; i$1$1++) {
|
| 212 |
lookup$1$1[chars$1$1.charCodeAt(i$1$1)] = i$1$1;
|
| 213 |
}
|
| 214 |
var decode$1 = function (base64) {
|
| 215 |
var bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;
|
| 216 |
if (base64[base64.length - 1] === '=') {
|
| 217 |
bufferLength--;
|
| 218 |
if (base64[base64.length - 2] === '=') {
|
| 219 |
bufferLength--;
|
| 220 |
}
|
| 221 |
}
|
| 222 |
var buffer = typeof ArrayBuffer !== 'undefined' &&
|
| 223 |
typeof Uint8Array !== 'undefined' &&
|
| 224 |
typeof Uint8Array.prototype.slice !== 'undefined'
|
| 225 |
? new ArrayBuffer(bufferLength)
|
| 226 |
: new Array(bufferLength);
|
| 227 |
var bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);
|
| 228 |
for (i = 0; i < len; i += 4) {
|
| 229 |
encoded1 = lookup$1$1[base64.charCodeAt(i)];
|
| 230 |
encoded2 = lookup$1$1[base64.charCodeAt(i + 1)];
|
| 231 |
encoded3 = lookup$1$1[base64.charCodeAt(i + 2)];
|
| 232 |
encoded4 = lookup$1$1[base64.charCodeAt(i + 3)];
|
| 233 |
bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);
|
| 234 |
bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);
|
| 235 |
bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);
|
| 236 |
}
|
| 237 |
return buffer;
|
| 238 |
};
|
| 239 |
var polyUint16Array$1 = function (buffer) {
|
| 240 |
var length = buffer.length;
|
| 241 |
var bytes = [];
|
| 242 |
for (var i = 0; i < length; i += 2) {
|
| 243 |
bytes.push((buffer[i + 1] << 8) | buffer[i]);
|
| 244 |
}
|
| 245 |
return bytes;
|
| 246 |
};
|
| 247 |
var polyUint32Array$1 = function (buffer) {
|
| 248 |
var length = buffer.length;
|
| 249 |
var bytes = [];
|
| 250 |
for (var i = 0; i < length; i += 4) {
|
| 251 |
bytes.push((buffer[i + 3] << 24) | (buffer[i + 2] << 16) | (buffer[i + 1] << 8) | buffer[i]);
|
| 252 |
}
|
| 253 |
return bytes;
|
| 254 |
};
|
| 255 |
|
| 256 |
/** Shift size for getting the index-2 table offset. */
|
| 257 |
var UTRIE2_SHIFT_2$1 = 5;
|
| 258 |
/** Shift size for getting the index-1 table offset. */
|
| 259 |
var UTRIE2_SHIFT_1$1 = 6 + 5;
|
| 260 |
/**
|
| 261 |
* Shift size for shifting left the index array values.
|
| 262 |
* Increases possible data size with 16-bit index values at the cost
|
| 263 |
* of compactability.
|
| 264 |
* This requires data blocks to be aligned by UTRIE2_DATA_GRANULARITY.
|
| 265 |
*/
|
| 266 |
var UTRIE2_INDEX_SHIFT$1 = 2;
|
| 267 |
/**
|
| 268 |
* Difference between the two shift sizes,
|
| 269 |
* for getting an index-1 offset from an index-2 offset. 6=11-5
|
| 270 |
*/
|
| 271 |
var UTRIE2_SHIFT_1_2$1 = UTRIE2_SHIFT_1$1 - UTRIE2_SHIFT_2$1;
|
| 272 |
/**
|
| 273 |
* The part of the index-2 table for U+D800..U+DBFF stores values for
|
| 274 |
* lead surrogate code _units_ not code _points_.
|
| 275 |
* Values for lead surrogate code _points_ are indexed with this portion of the table.
|
| 276 |
* Length=32=0x20=0x400>>UTRIE2_SHIFT_2. (There are 1024=0x400 lead surrogates.)
|
| 277 |
*/
|
| 278 |
var UTRIE2_LSCP_INDEX_2_OFFSET$1 = 0x10000 >> UTRIE2_SHIFT_2$1;
|
| 279 |
/** Number of entries in a data block. 32=0x20 */
|
| 280 |
var UTRIE2_DATA_BLOCK_LENGTH$1 = 1 << UTRIE2_SHIFT_2$1;
|
| 281 |
/** Mask for getting the lower bits for the in-data-block offset. */
|
| 282 |
var UTRIE2_DATA_MASK$1 = UTRIE2_DATA_BLOCK_LENGTH$1 - 1;
|
| 283 |
var UTRIE2_LSCP_INDEX_2_LENGTH$1 = 0x400 >> UTRIE2_SHIFT_2$1;
|
| 284 |
/** Count the lengths of both BMP pieces. 2080=0x820 */
|
| 285 |
var UTRIE2_INDEX_2_BMP_LENGTH$1 = UTRIE2_LSCP_INDEX_2_OFFSET$1 + UTRIE2_LSCP_INDEX_2_LENGTH$1;
|
| 286 |
/**
|
| 287 |
* The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820.
|
| 288 |
* Length 32=0x20 for lead bytes C0..DF, regardless of UTRIE2_SHIFT_2.
|
| 289 |
*/
|
| 290 |
var UTRIE2_UTF8_2B_INDEX_2_OFFSET$1 = UTRIE2_INDEX_2_BMP_LENGTH$1;
|
| 291 |
var UTRIE2_UTF8_2B_INDEX_2_LENGTH$1 = 0x800 >> 6; /* U+0800 is the first code point after 2-byte UTF-8 */
|
| 292 |
/**
|
| 293 |
* The index-1 table, only used for supplementary code points, at offset 2112=0x840.
|
| 294 |
* Variable length, for code points up to highStart, where the last single-value range starts.
|
| 295 |
* Maximum length 512=0x200=0x100000>>UTRIE2_SHIFT_1.
|
| 296 |
* (For 0x100000 supplementary code points U+10000..U+10ffff.)
|
| 297 |
*
|
| 298 |
* The part of the index-2 table for supplementary code points starts
|
| 299 |
* after this index-1 table.
|
| 300 |
*
|
| 301 |
* Both the index-1 table and the following part of the index-2 table
|
| 302 |
* are omitted completely if there is only BMP data.
|
| 303 |
*/
|
| 304 |
var UTRIE2_INDEX_1_OFFSET$1 = UTRIE2_UTF8_2B_INDEX_2_OFFSET$1 + UTRIE2_UTF8_2B_INDEX_2_LENGTH$1;
|
| 305 |
/**
|
| 306 |
* Number of index-1 entries for the BMP. 32=0x20
|
| 307 |
* This part of the index-1 table is omitted from the serialized form.
|
| 308 |
*/
|
| 309 |
var UTRIE2_OMITTED_BMP_INDEX_1_LENGTH$1 = 0x10000 >> UTRIE2_SHIFT_1$1;
|
| 310 |
/** Number of entries in an index-2 block. 64=0x40 */
|
| 311 |
var UTRIE2_INDEX_2_BLOCK_LENGTH$1 = 1 << UTRIE2_SHIFT_1_2$1;
|
| 312 |
/** Mask for getting the lower bits for the in-index-2-block offset. */
|
| 313 |
var UTRIE2_INDEX_2_MASK$1 = UTRIE2_INDEX_2_BLOCK_LENGTH$1 - 1;
|
| 314 |
var slice16$1 = function (view, start, end) {
|
| 315 |
if (view.slice) {
|
| 316 |
return view.slice(start, end);
|
| 317 |
}
|
| 318 |
return new Uint16Array(Array.prototype.slice.call(view, start, end));
|
| 319 |
};
|
| 320 |
var slice32$1 = function (view, start, end) {
|
| 321 |
if (view.slice) {
|
| 322 |
return view.slice(start, end);
|
| 323 |
}
|
| 324 |
return new Uint32Array(Array.prototype.slice.call(view, start, end));
|
| 325 |
};
|
| 326 |
var createTrieFromBase64$1 = function (base64, _byteLength) {
|
| 327 |
var buffer = decode$1(base64);
|
| 328 |
var view32 = Array.isArray(buffer) ? polyUint32Array$1(buffer) : new Uint32Array(buffer);
|
| 329 |
var view16 = Array.isArray(buffer) ? polyUint16Array$1(buffer) : new Uint16Array(buffer);
|
| 330 |
var headerLength = 24;
|
| 331 |
var index = slice16$1(view16, headerLength / 2, view32[4] / 2);
|
| 332 |
var data = view32[5] === 2
|
| 333 |
? slice16$1(view16, (headerLength + view32[4]) / 2)
|
| 334 |
: slice32$1(view32, Math.ceil((headerLength + view32[4]) / 4));
|
| 335 |
return new Trie$1(view32[0], view32[1], view32[2], view32[3], index, data);
|
| 336 |
};
|
| 337 |
var Trie$1 = /** @class */ (function () {
|
| 338 |
function Trie(initialValue, errorValue, highStart, highValueIndex, index, data) {
|
| 339 |
this.initialValue = initialValue;
|
| 340 |
this.errorValue = errorValue;
|
| 341 |
this.highStart = highStart;
|
| 342 |
this.highValueIndex = highValueIndex;
|
| 343 |
this.index = index;
|
| 344 |
this.data = data;
|
| 345 |
}
|
| 346 |
/**
|
| 347 |
* Get the value for a code point as stored in the Trie.
|
| 348 |
*
|
| 349 |
* @param codePoint the code point
|
| 350 |
* @return the value
|
| 351 |
*/
|
| 352 |
Trie.prototype.get = function (codePoint) {
|
| 353 |
var ix;
|
| 354 |
if (codePoint >= 0) {
|
| 355 |
if (codePoint < 0x0d800 || (codePoint > 0x0dbff && codePoint <= 0x0ffff)) {
|
| 356 |
// Ordinary BMP code point, excluding leading surrogates.
|
| 357 |
// BMP uses a single level lookup. BMP index starts at offset 0 in the Trie2 index.
|
| 358 |
// 16 bit data is stored in the index array itself.
|
| 359 |
ix = this.index[codePoint >> UTRIE2_SHIFT_2$1];
|
| 360 |
ix = (ix << UTRIE2_INDEX_SHIFT$1) + (codePoint & UTRIE2_DATA_MASK$1);
|
| 361 |
return this.data[ix];
|
| 362 |
}
|
| 363 |
if (codePoint <= 0xffff) {
|
| 364 |
// Lead Surrogate Code Point. A Separate index section is stored for
|
| 365 |
// lead surrogate code units and code points.
|
| 366 |
// The main index has the code unit data.
|
| 367 |
// For this function, we need the code point data.
|
| 368 |
// Note: this expression could be refactored for slightly improved efficiency, but
|
| 369 |
// surrogate code points will be so rare in practice that it's not worth it.
|
| 370 |
ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET$1 + ((codePoint - 0xd800) >> UTRIE2_SHIFT_2$1)];
|
| 371 |
ix = (ix << UTRIE2_INDEX_SHIFT$1) + (codePoint & UTRIE2_DATA_MASK$1);
|
| 372 |
return this.data[ix];
|
| 373 |
}
|
| 374 |
if (codePoint < this.highStart) {
|
| 375 |
// Supplemental code point, use two-level lookup.
|
| 376 |
ix = UTRIE2_INDEX_1_OFFSET$1 - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH$1 + (codePoint >> UTRIE2_SHIFT_1$1);
|
| 377 |
ix = this.index[ix];
|
| 378 |
ix += (codePoint >> UTRIE2_SHIFT_2$1) & UTRIE2_INDEX_2_MASK$1;
|
| 379 |
ix = this.index[ix];
|
| 380 |
ix = (ix << UTRIE2_INDEX_SHIFT$1) + (codePoint & UTRIE2_DATA_MASK$1);
|
| 381 |
return this.data[ix];
|
| 382 |
}
|
| 383 |
if (codePoint <= 0x10ffff) {
|
| 384 |
return this.data[this.highValueIndex];
|
| 385 |
}
|
| 386 |
}
|
| 387 |
// Fall through. The code point is outside of the legal range of 0..0x10ffff.
|
| 388 |
return this.errorValue;
|
| 389 |
};
|
| 390 |
return Trie;
|
| 391 |
}());
|
| 392 |
|
| 393 |
/*
|
| 394 |
* base64-arraybuffer 1.0.2 <https://github.com/niklasvh/base64-arraybuffer>
|
| 395 |
* Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
|
| 396 |
* Released under MIT License
|
| 397 |
*/
|
| 398 |
var chars$3 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
| 399 |
// Use a lookup table to find the index.
|
| 400 |
var lookup$3 = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);
|
| 401 |
for (var i$3 = 0; i$3 < chars$3.length; i$3++) {
|
| 402 |
lookup$3[chars$3.charCodeAt(i$3)] = i$3;
|
| 403 |
}
|
| 404 |
|
| 405 |
var base64$1 = 'KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADG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BywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2k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GcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl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ADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAw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AEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA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AEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAC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AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlAC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ACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==';
|
| 406 |
|
| 407 |
var LETTER_NUMBER_MODIFIER = 50;
|
| 408 |
// Non-tailorable Line Breaking Classes
|
| 409 |
var BK = 1; // Cause a line break (after)
|
| 410 |
var CR$1 = 2; // Cause a line break (after), except between CR and LF
|
| 411 |
var LF$1 = 3; // Cause a line break (after)
|
| 412 |
var CM = 4; // Prohibit a line break between the character and the preceding character
|
| 413 |
var NL = 5; // Cause a line break (after)
|
| 414 |
var WJ = 7; // Prohibit line breaks before and after
|
| 415 |
var ZW = 8; // Provide a break opportunity
|
| 416 |
var GL = 9; // Prohibit line breaks before and after
|
| 417 |
var SP = 10; // Enable indirect line breaks
|
| 418 |
var ZWJ$1 = 11; // Prohibit line breaks within joiner sequences
|
| 419 |
// Break Opportunities
|
| 420 |
var B2 = 12; // Provide a line break opportunity before and after the character
|
| 421 |
var BA = 13; // Generally provide a line break opportunity after the character
|
| 422 |
var BB = 14; // Generally provide a line break opportunity before the character
|
| 423 |
var HY = 15; // Provide a line break opportunity after the character, except in numeric context
|
| 424 |
var CB = 16; // Provide a line break opportunity contingent on additional information
|
| 425 |
// Characters Prohibiting Certain Breaks
|
| 426 |
var CL = 17; // Prohibit line breaks before
|
| 427 |
var CP = 18; // Prohibit line breaks before
|
| 428 |
var EX = 19; // Prohibit line breaks before
|
| 429 |
var IN = 20; // Allow only indirect line breaks between pairs
|
| 430 |
var NS = 21; // Allow only indirect line breaks before
|
| 431 |
var OP = 22; // Prohibit line breaks after
|
| 432 |
var QU = 23; // Act like they are both opening and closing
|
| 433 |
// Numeric Context
|
| 434 |
var IS = 24; // Prevent breaks after any and before numeric
|
| 435 |
var NU = 25; // Form numeric expressions for line breaking purposes
|
| 436 |
var PO = 26; // Do not break following a numeric expression
|
| 437 |
var PR = 27; // Do not break in front of a numeric expression
|
| 438 |
var SY = 28; // Prevent a break before; and allow a break after
|
| 439 |
// Other Characters
|
| 440 |
var AI = 29; // Act like AL when the resolvedEAW is N; otherwise; act as ID
|
| 441 |
var AL = 30; // Are alphabetic characters or symbols that are used with alphabetic characters
|
| 442 |
var CJ = 31; // Treat as NS or ID for strict or normal breaking.
|
| 443 |
var EB = 32; // Do not break from following Emoji Modifier
|
| 444 |
var EM = 33; // Do not break from preceding Emoji Base
|
| 445 |
var H2 = 34; // Form Korean syllable blocks
|
| 446 |
var H3 = 35; // Form Korean syllable blocks
|
| 447 |
var HL = 36; // Do not break around a following hyphen; otherwise act as Alphabetic
|
| 448 |
var ID = 37; // Break before or after; except in some numeric context
|
| 449 |
var JL = 38; // Form Korean syllable blocks
|
| 450 |
var JV = 39; // Form Korean syllable blocks
|
| 451 |
var JT = 40; // Form Korean syllable blocks
|
| 452 |
var RI$1 = 41; // Keep pairs together. For pairs; break before and after other classes
|
| 453 |
var SA = 42; // Provide a line break opportunity contingent on additional, language-specific context analysis
|
| 454 |
var XX = 43; // Have as yet unknown line breaking behavior or unassigned code positions
|
| 455 |
var ea_OP = [0x2329, 0xff08];
|
| 456 |
var BREAK_MANDATORY = '!';
|
| 457 |
var BREAK_NOT_ALLOWED$1 = '×';
|
| 458 |
var BREAK_ALLOWED$1 = '÷';
|
| 459 |
var UnicodeTrie$1 = createTrieFromBase64$1(base64$1);
|
| 460 |
var ALPHABETICS = [AL, HL];
|
| 461 |
var HARD_LINE_BREAKS = [BK, CR$1, LF$1, NL];
|
| 462 |
var SPACE$1 = [SP, ZW];
|
| 463 |
var PREFIX_POSTFIX = [PR, PO];
|
| 464 |
var LINE_BREAKS = HARD_LINE_BREAKS.concat(SPACE$1);
|
| 465 |
var KOREAN_SYLLABLE_BLOCK = [JL, JV, JT, H2, H3];
|
| 466 |
var HYPHEN = [HY, BA];
|
| 467 |
var codePointsToCharacterClasses = function (codePoints, lineBreak) {
|
| 468 |
if (lineBreak === void 0) { lineBreak = 'strict'; }
|
| 469 |
var types = [];
|
| 470 |
var indices = [];
|
| 471 |
var categories = [];
|
| 472 |
codePoints.forEach(function (codePoint, index) {
|
| 473 |
var classType = UnicodeTrie$1.get(codePoint);
|
| 474 |
if (classType > LETTER_NUMBER_MODIFIER) {
|
| 475 |
categories.push(true);
|
| 476 |
classType -= LETTER_NUMBER_MODIFIER;
|
| 477 |
}
|
| 478 |
else {
|
| 479 |
categories.push(false);
|
| 480 |
}
|
| 481 |
if (['normal', 'auto', 'loose'].indexOf(lineBreak) !== -1) {
|
| 482 |
// U+2010, – U+2013, 〜 U+301C, ゠ U+30A0
|
| 483 |
if ([0x2010, 0x2013, 0x301c, 0x30a0].indexOf(codePoint) !== -1) {
|
| 484 |
indices.push(index);
|
| 485 |
return types.push(CB);
|
| 486 |
}
|
| 487 |
}
|
| 488 |
if (classType === CM || classType === ZWJ$1) {
|
| 489 |
// LB10 Treat any remaining combining mark or ZWJ as AL.
|
| 490 |
if (index === 0) {
|
| 491 |
indices.push(index);
|
| 492 |
return types.push(AL);
|
| 493 |
}
|
| 494 |
// LB9 Do not break a combining character sequence; treat it as if it has the line breaking class of
|
| 495 |
// the base character in all of the following rules. Treat ZWJ as if it were CM.
|
| 496 |
var prev = types[index - 1];
|
| 497 |
if (LINE_BREAKS.indexOf(prev) === -1) {
|
| 498 |
indices.push(indices[index - 1]);
|
| 499 |
return types.push(prev);
|
| 500 |
}
|
| 501 |
indices.push(index);
|
| 502 |
return types.push(AL);
|
| 503 |
}
|
| 504 |
indices.push(index);
|
| 505 |
if (classType === CJ) {
|
| 506 |
return types.push(lineBreak === 'strict' ? NS : ID);
|
| 507 |
}
|
| 508 |
if (classType === SA) {
|
| 509 |
return types.push(AL);
|
| 510 |
}
|
| 511 |
if (classType === AI) {
|
| 512 |
return types.push(AL);
|
| 513 |
}
|
| 514 |
// For supplementary characters, a useful default is to treat characters in the range 10000..1FFFD as AL
|
| 515 |
// and characters in the ranges 20000..2FFFD and 30000..3FFFD as ID, until the implementation can be revised
|
| 516 |
// to take into account the actual line breaking properties for these characters.
|
| 517 |
if (classType === XX) {
|
| 518 |
if ((codePoint >= 0x20000 && codePoint <= 0x2fffd) || (codePoint >= 0x30000 && codePoint <= 0x3fffd)) {
|
| 519 |
return types.push(ID);
|
| 520 |
}
|
| 521 |
else {
|
| 522 |
return types.push(AL);
|
| 523 |
}
|
| 524 |
}
|
| 525 |
types.push(classType);
|
| 526 |
});
|
| 527 |
return [indices, types, categories];
|
| 528 |
};
|
| 529 |
var isAdjacentWithSpaceIgnored = function (a, b, currentIndex, classTypes) {
|
| 530 |
var current = classTypes[currentIndex];
|
| 531 |
if (Array.isArray(a) ? a.indexOf(current) !== -1 : a === current) {
|
| 532 |
var i = currentIndex;
|
| 533 |
while (i <= classTypes.length) {
|
| 534 |
i++;
|
| 535 |
var next = classTypes[i];
|
| 536 |
if (next === b) {
|
| 537 |
return true;
|
| 538 |
}
|
| 539 |
if (next !== SP) {
|
| 540 |
break;
|
| 541 |
}
|
| 542 |
}
|
| 543 |
}
|
| 544 |
if (current === SP) {
|
| 545 |
var i = currentIndex;
|
| 546 |
while (i > 0) {
|
| 547 |
i--;
|
| 548 |
var prev = classTypes[i];
|
| 549 |
if (Array.isArray(a) ? a.indexOf(prev) !== -1 : a === prev) {
|
| 550 |
var n = currentIndex;
|
| 551 |
while (n <= classTypes.length) {
|
| 552 |
n++;
|
| 553 |
var next = classTypes[n];
|
| 554 |
if (next === b) {
|
| 555 |
return true;
|
| 556 |
}
|
| 557 |
if (next !== SP) {
|
| 558 |
break;
|
| 559 |
}
|
| 560 |
}
|
| 561 |
}
|
| 562 |
if (prev !== SP) {
|
| 563 |
break;
|
| 564 |
}
|
| 565 |
}
|
| 566 |
}
|
| 567 |
return false;
|
| 568 |
};
|
| 569 |
var previousNonSpaceClassType = function (currentIndex, classTypes) {
|
| 570 |
var i = currentIndex;
|
| 571 |
while (i >= 0) {
|
| 572 |
var type = classTypes[i];
|
| 573 |
if (type === SP) {
|
| 574 |
i--;
|
| 575 |
}
|
| 576 |
else {
|
| 577 |
return type;
|
| 578 |
}
|
| 579 |
}
|
| 580 |
return 0;
|
| 581 |
};
|
| 582 |
var _lineBreakAtIndex = function (codePoints, classTypes, indicies, index, forbiddenBreaks) {
|
| 583 |
if (indicies[index] === 0) {
|
| 584 |
return BREAK_NOT_ALLOWED$1;
|
| 585 |
}
|
| 586 |
var currentIndex = index - 1;
|
| 587 |
if (Array.isArray(forbiddenBreaks) && forbiddenBreaks[currentIndex] === true) {
|
| 588 |
return BREAK_NOT_ALLOWED$1;
|
| 589 |
}
|
| 590 |
var beforeIndex = currentIndex - 1;
|
| 591 |
var afterIndex = currentIndex + 1;
|
| 592 |
var current = classTypes[currentIndex];
|
| 593 |
// LB4 Always break after hard line breaks.
|
| 594 |
// LB5 Treat CR followed by LF, as well as CR, LF, and NL as hard line breaks.
|
| 595 |
var before = beforeIndex >= 0 ? classTypes[beforeIndex] : 0;
|
| 596 |
var next = classTypes[afterIndex];
|
| 597 |
if (current === CR$1 && next === LF$1) {
|
| 598 |
return BREAK_NOT_ALLOWED$1;
|
| 599 |
}
|
| 600 |
if (HARD_LINE_BREAKS.indexOf(current) !== -1) {
|
| 601 |
return BREAK_MANDATORY;
|
| 602 |
}
|
| 603 |
// LB6 Do not break before hard line breaks.
|
| 604 |
if (HARD_LINE_BREAKS.indexOf(next) !== -1) {
|
| 605 |
return BREAK_NOT_ALLOWED$1;
|
| 606 |
}
|
| 607 |
// LB7 Do not break before spaces or zero width space.
|
| 608 |
if (SPACE$1.indexOf(next) !== -1) {
|
| 609 |
return BREAK_NOT_ALLOWED$1;
|
| 610 |
}
|
| 611 |
// LB8 Break before any character following a zero-width space, even if one or more spaces intervene.
|
| 612 |
if (previousNonSpaceClassType(currentIndex, classTypes) === ZW) {
|
| 613 |
return BREAK_ALLOWED$1;
|
| 614 |
}
|
| 615 |
// LB8a Do not break after a zero width joiner.
|
| 616 |
if (UnicodeTrie$1.get(codePoints[currentIndex]) === ZWJ$1) {
|
| 617 |
return BREAK_NOT_ALLOWED$1;
|
| 618 |
}
|
| 619 |
// zwj emojis
|
| 620 |
if ((current === EB || current === EM) && UnicodeTrie$1.get(codePoints[afterIndex]) === ZWJ$1) {
|
| 621 |
return BREAK_NOT_ALLOWED$1;
|
| 622 |
}
|
| 623 |
// LB11 Do not break before or after Word joiner and related characters.
|
| 624 |
if (current === WJ || next === WJ) {
|
| 625 |
return BREAK_NOT_ALLOWED$1;
|
| 626 |
}
|
| 627 |
// LB12 Do not break after NBSP and related characters.
|
| 628 |
if (current === GL) {
|
| 629 |
return BREAK_NOT_ALLOWED$1;
|
| 630 |
}
|
| 631 |
// LB12a Do not break before NBSP and related characters, except after spaces and hyphens.
|
| 632 |
if ([SP, BA, HY].indexOf(current) === -1 && next === GL) {
|
| 633 |
return BREAK_NOT_ALLOWED$1;
|
| 634 |
}
|
| 635 |
// LB13 Do not break before ‘]’ or ‘!’ or ‘;’ or ‘/’, even after spaces.
|
| 636 |
if ([CL, CP, EX, IS, SY].indexOf(next) !== -1) {
|
| 637 |
return BREAK_NOT_ALLOWED$1;
|
| 638 |
}
|
| 639 |
// LB14 Do not break after ‘[’, even after spaces.
|
| 640 |
if (previousNonSpaceClassType(currentIndex, classTypes) === OP) {
|
| 641 |
return BREAK_NOT_ALLOWED$1;
|
| 642 |
}
|
| 643 |
// LB15 Do not break within ‘”[’, even with intervening spaces.
|
| 644 |
if (isAdjacentWithSpaceIgnored(QU, OP, currentIndex, classTypes)) {
|
| 645 |
return BREAK_NOT_ALLOWED$1;
|
| 646 |
}
|
| 647 |
// LB16 Do not break between closing punctuation and a nonstarter (lb=NS), even with intervening spaces.
|
| 648 |
if (isAdjacentWithSpaceIgnored([CL, CP], NS, currentIndex, classTypes)) {
|
| 649 |
return BREAK_NOT_ALLOWED$1;
|
| 650 |
}
|
| 651 |
// LB17 Do not break within ‘——’, even with intervening spaces.
|
| 652 |
if (isAdjacentWithSpaceIgnored(B2, B2, currentIndex, classTypes)) {
|
| 653 |
return BREAK_NOT_ALLOWED$1;
|
| 654 |
}
|
| 655 |
// LB18 Break after spaces.
|
| 656 |
if (current === SP) {
|
| 657 |
return BREAK_ALLOWED$1;
|
| 658 |
}
|
| 659 |
// LB19 Do not break before or after quotation marks, such as ‘ ” ’.
|
| 660 |
if (current === QU || next === QU) {
|
| 661 |
return BREAK_NOT_ALLOWED$1;
|
| 662 |
}
|
| 663 |
// LB20 Break before and after unresolved CB.
|
| 664 |
if (next === CB || current === CB) {
|
| 665 |
return BREAK_ALLOWED$1;
|
| 666 |
}
|
| 667 |
// LB21 Do not break before hyphen-minus, other hyphens, fixed-width spaces, small kana, and other non-starters, or after acute accents.
|
| 668 |
if ([BA, HY, NS].indexOf(next) !== -1 || current === BB) {
|
| 669 |
return BREAK_NOT_ALLOWED$1;
|
| 670 |
}
|
| 671 |
// LB21a Don't break after Hebrew + Hyphen.
|
| 672 |
if (before === HL && HYPHEN.indexOf(current) !== -1) {
|
| 673 |
return BREAK_NOT_ALLOWED$1;
|
| 674 |
}
|
| 675 |
// LB21b Don’t break between Solidus and Hebrew letters.
|
| 676 |
if (current === SY && next === HL) {
|
| 677 |
return BREAK_NOT_ALLOWED$1;
|
| 678 |
}
|
| 679 |
// LB22 Do not break before ellipsis.
|
| 680 |
if (next === IN) {
|
| 681 |
return BREAK_NOT_ALLOWED$1;
|
| 682 |
}
|
| 683 |
// LB23 Do not break between digits and letters.
|
| 684 |
if ((ALPHABETICS.indexOf(next) !== -1 && current === NU) || (ALPHABETICS.indexOf(current) !== -1 && next === NU)) {
|
| 685 |
return BREAK_NOT_ALLOWED$1;
|
| 686 |
}
|
| 687 |
// LB23a Do not break between numeric prefixes and ideographs, or between ideographs and numeric postfixes.
|
| 688 |
if ((current === PR && [ID, EB, EM].indexOf(next) !== -1) ||
|
| 689 |
([ID, EB, EM].indexOf(current) !== -1 && next === PO)) {
|
| 690 |
return BREAK_NOT_ALLOWED$1;
|
| 691 |
}
|
| 692 |
// LB24 Do not break between numeric prefix/postfix and letters, or between letters and prefix/postfix.
|
| 693 |
if ((ALPHABETICS.indexOf(current) !== -1 && PREFIX_POSTFIX.indexOf(next) !== -1) ||
|
| 694 |
(PREFIX_POSTFIX.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1)) {
|
| 695 |
return BREAK_NOT_ALLOWED$1;
|
| 696 |
}
|
| 697 |
// LB25 Do not break between the following pairs of classes relevant to numbers:
|
| 698 |
if (
|
| 699 |
// (PR | PO) × ( OP | HY )? NU
|
| 700 |
([PR, PO].indexOf(current) !== -1 &&
|
| 701 |
(next === NU || ([OP, HY].indexOf(next) !== -1 && classTypes[afterIndex + 1] === NU))) ||
|
| 702 |
// ( OP | HY ) × NU
|
| 703 |
([OP, HY].indexOf(current) !== -1 && next === NU) ||
|
| 704 |
// NU × (NU | SY | IS)
|
| 705 |
(current === NU && [NU, SY, IS].indexOf(next) !== -1)) {
|
| 706 |
return BREAK_NOT_ALLOWED$1;
|
| 707 |
}
|
| 708 |
// NU (NU | SY | IS)* × (NU | SY | IS | CL | CP)
|
| 709 |
if ([NU, SY, IS, CL, CP].indexOf(next) !== -1) {
|
| 710 |
var prevIndex = currentIndex;
|
| 711 |
while (prevIndex >= 0) {
|
| 712 |
var type = classTypes[prevIndex];
|
| 713 |
if (type === NU) {
|
| 714 |
return BREAK_NOT_ALLOWED$1;
|
| 715 |
}
|
| 716 |
else if ([SY, IS].indexOf(type) !== -1) {
|
| 717 |
prevIndex--;
|
| 718 |
}
|
| 719 |
else {
|
| 720 |
break;
|
| 721 |
}
|
| 722 |
}
|
| 723 |
}
|
| 724 |
// NU (NU | SY | IS)* (CL | CP)? × (PO | PR))
|
| 725 |
if ([PR, PO].indexOf(next) !== -1) {
|
| 726 |
var prevIndex = [CL, CP].indexOf(current) !== -1 ? beforeIndex : currentIndex;
|
| 727 |
while (prevIndex >= 0) {
|
| 728 |
var type = classTypes[prevIndex];
|
| 729 |
if (type === NU) {
|
| 730 |
return BREAK_NOT_ALLOWED$1;
|
| 731 |
}
|
| 732 |
else if ([SY, IS].indexOf(type) !== -1) {
|
| 733 |
prevIndex--;
|
| 734 |
}
|
| 735 |
else {
|
| 736 |
break;
|
| 737 |
}
|
| 738 |
}
|
| 739 |
}
|
| 740 |
// LB26 Do not break a Korean syllable.
|
| 741 |
if ((JL === current && [JL, JV, H2, H3].indexOf(next) !== -1) ||
|
| 742 |
([JV, H2].indexOf(current) !== -1 && [JV, JT].indexOf(next) !== -1) ||
|
| 743 |
([JT, H3].indexOf(current) !== -1 && next === JT)) {
|
| 744 |
return BREAK_NOT_ALLOWED$1;
|
| 745 |
}
|
| 746 |
// LB27 Treat a Korean Syllable Block the same as ID.
|
| 747 |
if ((KOREAN_SYLLABLE_BLOCK.indexOf(current) !== -1 && [IN, PO].indexOf(next) !== -1) ||
|
| 748 |
(KOREAN_SYLLABLE_BLOCK.indexOf(next) !== -1 && current === PR)) {
|
| 749 |
return BREAK_NOT_ALLOWED$1;
|
| 750 |
}
|
| 751 |
// LB28 Do not break between alphabetics (“at”).
|
| 752 |
if (ALPHABETICS.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {
|
| 753 |
return BREAK_NOT_ALLOWED$1;
|
| 754 |
}
|
| 755 |
// LB29 Do not break between numeric punctuation and alphabetics (“e.g.”).
|
| 756 |
if (current === IS && ALPHABETICS.indexOf(next) !== -1) {
|
| 757 |
return BREAK_NOT_ALLOWED$1;
|
| 758 |
}
|
| 759 |
// LB30 Do not break between letters, numbers, or ordinary symbols and opening or closing parentheses.
|
| 760 |
if ((ALPHABETICS.concat(NU).indexOf(current) !== -1 &&
|
| 761 |
next === OP &&
|
| 762 |
ea_OP.indexOf(codePoints[afterIndex]) === -1) ||
|
| 763 |
(ALPHABETICS.concat(NU).indexOf(next) !== -1 && current === CP)) {
|
| 764 |
return BREAK_NOT_ALLOWED$1;
|
| 765 |
}
|
| 766 |
// LB30a Break between two regional indicator symbols if and only if there are an even number of regional
|
| 767 |
// indicators preceding the position of the break.
|
| 768 |
if (current === RI$1 && next === RI$1) {
|
| 769 |
var i = indicies[currentIndex];
|
| 770 |
var count = 1;
|
| 771 |
while (i > 0) {
|
| 772 |
i--;
|
| 773 |
if (classTypes[i] === RI$1) {
|
| 774 |
count++;
|
| 775 |
}
|
| 776 |
else {
|
| 777 |
break;
|
| 778 |
}
|
| 779 |
}
|
| 780 |
if (count % 2 !== 0) {
|
| 781 |
return BREAK_NOT_ALLOWED$1;
|
| 782 |
}
|
| 783 |
}
|
| 784 |
// LB30b Do not break between an emoji base and an emoji modifier.
|
| 785 |
if (current === EB && next === EM) {
|
| 786 |
return BREAK_NOT_ALLOWED$1;
|
| 787 |
}
|
| 788 |
return BREAK_ALLOWED$1;
|
| 789 |
};
|
| 790 |
var cssFormattedClasses = function (codePoints, options) {
|
| 791 |
if (!options) {
|
| 792 |
options = { lineBreak: 'normal', wordBreak: 'normal' };
|
| 793 |
}
|
| 794 |
var _a = codePointsToCharacterClasses(codePoints, options.lineBreak), indicies = _a[0], classTypes = _a[1], isLetterNumber = _a[2];
|
| 795 |
if (options.wordBreak === 'break-all' || options.wordBreak === 'break-word') {
|
| 796 |
classTypes = classTypes.map(function (type) { return ([NU, AL, SA].indexOf(type) !== -1 ? ID : type); });
|
| 797 |
}
|
| 798 |
var forbiddenBreakpoints = options.wordBreak === 'keep-all'
|
| 799 |
? isLetterNumber.map(function (letterNumber, i) {
|
| 800 |
return letterNumber && codePoints[i] >= 0x4e00 && codePoints[i] <= 0x9fff;
|
| 801 |
})
|
| 802 |
: undefined;
|
| 803 |
return [indicies, classTypes, forbiddenBreakpoints];
|
| 804 |
};
|
| 805 |
var Break = /** @class */ (function () {
|
| 806 |
function Break(codePoints, lineBreak, start, end) {
|
| 807 |
this.codePoints = codePoints;
|
| 808 |
this.required = lineBreak === BREAK_MANDATORY;
|
| 809 |
this.start = start;
|
| 810 |
this.end = end;
|
| 811 |
}
|
| 812 |
Break.prototype.slice = function () {
|
| 813 |
return fromCodePoint$1.apply(void 0, this.codePoints.slice(this.start, this.end));
|
| 814 |
};
|
| 815 |
return Break;
|
| 816 |
}());
|
| 817 |
var LineBreaker = function (str, options) {
|
| 818 |
var codePoints = toCodePoints$1(str);
|
| 819 |
var _a = cssFormattedClasses(codePoints, options), indicies = _a[0], classTypes = _a[1], forbiddenBreakpoints = _a[2];
|
| 820 |
var length = codePoints.length;
|
| 821 |
var lastEnd = 0;
|
| 822 |
var nextIndex = 0;
|
| 823 |
return {
|
| 824 |
next: function () {
|
| 825 |
if (nextIndex >= length) {
|
| 826 |
return { done: true, value: null };
|
| 827 |
}
|
| 828 |
var lineBreak = BREAK_NOT_ALLOWED$1;
|
| 829 |
while (nextIndex < length &&
|
| 830 |
(lineBreak = _lineBreakAtIndex(codePoints, classTypes, indicies, ++nextIndex, forbiddenBreakpoints)) ===
|
| 831 |
BREAK_NOT_ALLOWED$1) { }
|
| 832 |
if (lineBreak !== BREAK_NOT_ALLOWED$1 || nextIndex === length) {
|
| 833 |
var value = new Break(codePoints, lineBreak, lastEnd, nextIndex);
|
| 834 |
lastEnd = nextIndex;
|
| 835 |
return { value: value, done: false };
|
| 836 |
}
|
| 837 |
return { done: true, value: null };
|
| 838 |
},
|
| 839 |
};
|
| 840 |
};
|
| 841 |
|
| 842 |
// https://www.w3.org/TR/css-syntax-3
|
| 843 |
var FLAG_UNRESTRICTED = 1 << 0;
|
| 844 |
var FLAG_ID = 1 << 1;
|
| 845 |
var FLAG_INTEGER = 1 << 2;
|
| 846 |
var FLAG_NUMBER = 1 << 3;
|
| 847 |
var LINE_FEED = 0x000a;
|
| 848 |
var SOLIDUS = 0x002f;
|
| 849 |
var REVERSE_SOLIDUS = 0x005c;
|
| 850 |
var CHARACTER_TABULATION = 0x0009;
|
| 851 |
var SPACE = 0x0020;
|
| 852 |
var QUOTATION_MARK = 0x0022;
|
| 853 |
var EQUALS_SIGN = 0x003d;
|
| 854 |
var NUMBER_SIGN = 0x0023;
|
| 855 |
var DOLLAR_SIGN = 0x0024;
|
| 856 |
var PERCENTAGE_SIGN = 0x0025;
|
| 857 |
var APOSTROPHE = 0x0027;
|
| 858 |
var LEFT_PARENTHESIS = 0x0028;
|
| 859 |
var RIGHT_PARENTHESIS = 0x0029;
|
| 860 |
var LOW_LINE = 0x005f;
|
| 861 |
var HYPHEN_MINUS = 0x002d;
|
| 862 |
var EXCLAMATION_MARK = 0x0021;
|
| 863 |
var LESS_THAN_SIGN = 0x003c;
|
| 864 |
var GREATER_THAN_SIGN = 0x003e;
|
| 865 |
var COMMERCIAL_AT = 0x0040;
|
| 866 |
var LEFT_SQUARE_BRACKET = 0x005b;
|
| 867 |
var RIGHT_SQUARE_BRACKET = 0x005d;
|
| 868 |
var CIRCUMFLEX_ACCENT = 0x003d;
|
| 869 |
var LEFT_CURLY_BRACKET = 0x007b;
|
| 870 |
var QUESTION_MARK = 0x003f;
|
| 871 |
var RIGHT_CURLY_BRACKET = 0x007d;
|
| 872 |
var VERTICAL_LINE = 0x007c;
|
| 873 |
var TILDE = 0x007e;
|
| 874 |
var CONTROL = 0x0080;
|
| 875 |
var REPLACEMENT_CHARACTER = 0xfffd;
|
| 876 |
var ASTERISK = 0x002a;
|
| 877 |
var PLUS_SIGN = 0x002b;
|
| 878 |
var COMMA = 0x002c;
|
| 879 |
var COLON = 0x003a;
|
| 880 |
var SEMICOLON = 0x003b;
|
| 881 |
var FULL_STOP = 0x002e;
|
| 882 |
var NULL = 0x0000;
|
| 883 |
var BACKSPACE = 0x0008;
|
| 884 |
var LINE_TABULATION = 0x000b;
|
| 885 |
var SHIFT_OUT = 0x000e;
|
| 886 |
var INFORMATION_SEPARATOR_ONE = 0x001f;
|
| 887 |
var DELETE = 0x007f;
|
| 888 |
var EOF = -1;
|
| 889 |
var ZERO = 0x0030;
|
| 890 |
var a = 0x0061;
|
| 891 |
var e = 0x0065;
|
| 892 |
var f = 0x0066;
|
| 893 |
var u = 0x0075;
|
| 894 |
var z = 0x007a;
|
| 895 |
var A = 0x0041;
|
| 896 |
var E = 0x0045;
|
| 897 |
var F = 0x0046;
|
| 898 |
var U = 0x0055;
|
| 899 |
var Z = 0x005a;
|
| 900 |
var isDigit = function (codePoint) { return codePoint >= ZERO && codePoint <= 0x0039; };
|
| 901 |
var isSurrogateCodePoint = function (codePoint) { return codePoint >= 0xd800 && codePoint <= 0xdfff; };
|
| 902 |
var isHex = function (codePoint) {
|
| 903 |
return isDigit(codePoint) || (codePoint >= A && codePoint <= F) || (codePoint >= a && codePoint <= f);
|
| 904 |
};
|
| 905 |
var isLowerCaseLetter = function (codePoint) { return codePoint >= a && codePoint <= z; };
|
| 906 |
var isUpperCaseLetter = function (codePoint) { return codePoint >= A && codePoint <= Z; };
|
| 907 |
var isLetter = function (codePoint) { return isLowerCaseLetter(codePoint) || isUpperCaseLetter(codePoint); };
|
| 908 |
var isNonASCIICodePoint = function (codePoint) { return codePoint >= CONTROL; };
|
| 909 |
var isWhiteSpace = function (codePoint) {
|
| 910 |
return codePoint === LINE_FEED || codePoint === CHARACTER_TABULATION || codePoint === SPACE;
|
| 911 |
};
|
| 912 |
var isNameStartCodePoint = function (codePoint) {
|
| 913 |
return isLetter(codePoint) || isNonASCIICodePoint(codePoint) || codePoint === LOW_LINE;
|
| 914 |
};
|
| 915 |
var isNameCodePoint = function (codePoint) {
|
| 916 |
return isNameStartCodePoint(codePoint) || isDigit(codePoint) || codePoint === HYPHEN_MINUS;
|
| 917 |
};
|
| 918 |
var isNonPrintableCodePoint = function (codePoint) {
|
| 919 |
return ((codePoint >= NULL && codePoint <= BACKSPACE) ||
|
| 920 |
codePoint === LINE_TABULATION ||
|
| 921 |
(codePoint >= SHIFT_OUT && codePoint <= INFORMATION_SEPARATOR_ONE) ||
|
| 922 |
codePoint === DELETE);
|
| 923 |
};
|
| 924 |
var isValidEscape = function (c1, c2) {
|
| 925 |
if (c1 !== REVERSE_SOLIDUS) {
|
| 926 |
return false;
|
| 927 |
}
|
| 928 |
return c2 !== LINE_FEED;
|
| 929 |
};
|
| 930 |
var isIdentifierStart = function (c1, c2, c3) {
|
| 931 |
if (c1 === HYPHEN_MINUS) {
|
| 932 |
return isNameStartCodePoint(c2) || isValidEscape(c2, c3);
|
| 933 |
}
|
| 934 |
else if (isNameStartCodePoint(c1)) {
|
| 935 |
return true;
|
| 936 |
}
|
| 937 |
else if (c1 === REVERSE_SOLIDUS && isValidEscape(c1, c2)) {
|
| 938 |
return true;
|
| 939 |
}
|
| 940 |
return false;
|
| 941 |
};
|
| 942 |
var isNumberStart = function (c1, c2, c3) {
|
| 943 |
if (c1 === PLUS_SIGN || c1 === HYPHEN_MINUS) {
|
| 944 |
if (isDigit(c2)) {
|
| 945 |
return true;
|
| 946 |
}
|
| 947 |
return c2 === FULL_STOP && isDigit(c3);
|
| 948 |
}
|
| 949 |
if (c1 === FULL_STOP) {
|
| 950 |
return isDigit(c2);
|
| 951 |
}
|
| 952 |
return isDigit(c1);
|
| 953 |
};
|
| 954 |
var stringToNumber = function (codePoints) {
|
| 955 |
var c = 0;
|
| 956 |
var sign = 1;
|
| 957 |
if (codePoints[c] === PLUS_SIGN || codePoints[c] === HYPHEN_MINUS) {
|
| 958 |
if (codePoints[c] === HYPHEN_MINUS) {
|
| 959 |
sign = -1;
|
| 960 |
}
|
| 961 |
c++;
|
| 962 |
}
|
| 963 |
var integers = [];
|
| 964 |
while (isDigit(codePoints[c])) {
|
| 965 |
integers.push(codePoints[c++]);
|
| 966 |
}
|
| 967 |
var int = integers.length ? parseInt(fromCodePoint$1.apply(void 0, integers), 10) : 0;
|
| 968 |
if (codePoints[c] === FULL_STOP) {
|
| 969 |
c++;
|
| 970 |
}
|
| 971 |
var fraction = [];
|
| 972 |
while (isDigit(codePoints[c])) {
|
| 973 |
fraction.push(codePoints[c++]);
|
| 974 |
}
|
| 975 |
var fracd = fraction.length;
|
| 976 |
var frac = fracd ? parseInt(fromCodePoint$1.apply(void 0, fraction), 10) : 0;
|
| 977 |
if (codePoints[c] === E || codePoints[c] === e) {
|
| 978 |
c++;
|
| 979 |
}
|
| 980 |
var expsign = 1;
|
| 981 |
if (codePoints[c] === PLUS_SIGN || codePoints[c] === HYPHEN_MINUS) {
|
| 982 |
if (codePoints[c] === HYPHEN_MINUS) {
|
| 983 |
expsign = -1;
|
| 984 |
}
|
| 985 |
c++;
|
| 986 |
}
|
| 987 |
var exponent = [];
|
| 988 |
while (isDigit(codePoints[c])) {
|
| 989 |
exponent.push(codePoints[c++]);
|
| 990 |
}
|
| 991 |
var exp = exponent.length ? parseInt(fromCodePoint$1.apply(void 0, exponent), 10) : 0;
|
| 992 |
return sign * (int + frac * Math.pow(10, -fracd)) * Math.pow(10, expsign * exp);
|
| 993 |
};
|
| 994 |
var LEFT_PARENTHESIS_TOKEN = {
|
| 995 |
type: 2 /* LEFT_PARENTHESIS_TOKEN */
|
| 996 |
};
|
| 997 |
var RIGHT_PARENTHESIS_TOKEN = {
|
| 998 |
type: 3 /* RIGHT_PARENTHESIS_TOKEN */
|
| 999 |
};
|
| 1000 |
var COMMA_TOKEN = { type: 4 /* COMMA_TOKEN */ };
|
| 1001 |
var SUFFIX_MATCH_TOKEN = { type: 13 /* SUFFIX_MATCH_TOKEN */ };
|
| 1002 |
var PREFIX_MATCH_TOKEN = { type: 8 /* PREFIX_MATCH_TOKEN */ };
|
| 1003 |
var COLUMN_TOKEN = { type: 21 /* COLUMN_TOKEN */ };
|
| 1004 |
var DASH_MATCH_TOKEN = { type: 9 /* DASH_MATCH_TOKEN */ };
|
| 1005 |
var INCLUDE_MATCH_TOKEN = { type: 10 /* INCLUDE_MATCH_TOKEN */ };
|
| 1006 |
var LEFT_CURLY_BRACKET_TOKEN = {
|
| 1007 |
type: 11 /* LEFT_CURLY_BRACKET_TOKEN */
|
| 1008 |
};
|
| 1009 |
var RIGHT_CURLY_BRACKET_TOKEN = {
|
| 1010 |
type: 12 /* RIGHT_CURLY_BRACKET_TOKEN */
|
| 1011 |
};
|
| 1012 |
var SUBSTRING_MATCH_TOKEN = { type: 14 /* SUBSTRING_MATCH_TOKEN */ };
|
| 1013 |
var BAD_URL_TOKEN = { type: 23 /* BAD_URL_TOKEN */ };
|
| 1014 |
var BAD_STRING_TOKEN = { type: 1 /* BAD_STRING_TOKEN */ };
|
| 1015 |
var CDO_TOKEN = { type: 25 /* CDO_TOKEN */ };
|
| 1016 |
var CDC_TOKEN = { type: 24 /* CDC_TOKEN */ };
|
| 1017 |
var COLON_TOKEN = { type: 26 /* COLON_TOKEN */ };
|
| 1018 |
var SEMICOLON_TOKEN = { type: 27 /* SEMICOLON_TOKEN */ };
|
| 1019 |
var LEFT_SQUARE_BRACKET_TOKEN = {
|
| 1020 |
type: 28 /* LEFT_SQUARE_BRACKET_TOKEN */
|
| 1021 |
};
|
| 1022 |
var RIGHT_SQUARE_BRACKET_TOKEN = {
|
| 1023 |
type: 29 /* RIGHT_SQUARE_BRACKET_TOKEN */
|
| 1024 |
};
|
| 1025 |
var WHITESPACE_TOKEN = { type: 31 /* WHITESPACE_TOKEN */ };
|
| 1026 |
var EOF_TOKEN = { type: 32 /* EOF_TOKEN */ };
|
| 1027 |
var Tokenizer = /** @class */ (function () {
|
| 1028 |
function Tokenizer() {
|
| 1029 |
this._value = [];
|
| 1030 |
}
|
| 1031 |
Tokenizer.prototype.write = function (chunk) {
|
| 1032 |
this._value = this._value.concat(toCodePoints$1(chunk));
|
| 1033 |
};
|
| 1034 |
Tokenizer.prototype.read = function () {
|
| 1035 |
var tokens = [];
|
| 1036 |
var token = this.consumeToken();
|
| 1037 |
while (token !== EOF_TOKEN) {
|
| 1038 |
tokens.push(token);
|
| 1039 |
token = this.consumeToken();
|
| 1040 |
}
|
| 1041 |
return tokens;
|
| 1042 |
};
|
| 1043 |
Tokenizer.prototype.consumeToken = function () {
|
| 1044 |
var codePoint = this.consumeCodePoint();
|
| 1045 |
switch (codePoint) {
|
| 1046 |
case QUOTATION_MARK:
|
| 1047 |
return this.consumeStringToken(QUOTATION_MARK);
|
| 1048 |
case NUMBER_SIGN:
|
| 1049 |
var c1 = this.peekCodePoint(0);
|
| 1050 |
var c2 = this.peekCodePoint(1);
|
| 1051 |
var c3 = this.peekCodePoint(2);
|
| 1052 |
if (isNameCodePoint(c1) || isValidEscape(c2, c3)) {
|
| 1053 |
var flags = isIdentifierStart(c1, c2, c3) ? FLAG_ID : FLAG_UNRESTRICTED;
|
| 1054 |
var value = this.consumeName();
|
| 1055 |
return { type: 5 /* HASH_TOKEN */, value: value, flags: flags };
|
| 1056 |
}
|
| 1057 |
break;
|
| 1058 |
case DOLLAR_SIGN:
|
| 1059 |
if (this.peekCodePoint(0) === EQUALS_SIGN) {
|
| 1060 |
this.consumeCodePoint();
|
| 1061 |
return SUFFIX_MATCH_TOKEN;
|
| 1062 |
}
|
| 1063 |
break;
|
| 1064 |
case APOSTROPHE:
|
| 1065 |
return this.consumeStringToken(APOSTROPHE);
|
| 1066 |
case LEFT_PARENTHESIS:
|
| 1067 |
return LEFT_PARENTHESIS_TOKEN;
|
| 1068 |
case RIGHT_PARENTHESIS:
|
| 1069 |
return RIGHT_PARENTHESIS_TOKEN;
|
| 1070 |
case ASTERISK:
|
| 1071 |
if (this.peekCodePoint(0) === EQUALS_SIGN) {
|
| 1072 |
this.consumeCodePoint();
|
| 1073 |
return SUBSTRING_MATCH_TOKEN;
|
| 1074 |
}
|
| 1075 |
break;
|
| 1076 |
case PLUS_SIGN:
|
| 1077 |
if (isNumberStart(codePoint, this.peekCodePoint(0), this.peekCodePoint(1))) {
|
| 1078 |
this.reconsumeCodePoint(codePoint);
|
| 1079 |
return this.consumeNumericToken();
|
| 1080 |
}
|
| 1081 |
break;
|
| 1082 |
case COMMA:
|
| 1083 |
return COMMA_TOKEN;
|
| 1084 |
case HYPHEN_MINUS:
|
| 1085 |
var e1 = codePoint;
|
| 1086 |
var e2 = this.peekCodePoint(0);
|
| 1087 |
var e3 = this.peekCodePoint(1);
|
| 1088 |
if (isNumberStart(e1, e2, e3)) {
|
| 1089 |
this.reconsumeCodePoint(codePoint);
|
| 1090 |
return this.consumeNumericToken();
|
| 1091 |
}
|
| 1092 |
if (isIdentifierStart(e1, e2, e3)) {
|
| 1093 |
this.reconsumeCodePoint(codePoint);
|
| 1094 |
return this.consumeIdentLikeToken();
|
| 1095 |
}
|
| 1096 |
if (e2 === HYPHEN_MINUS && e3 === GREATER_THAN_SIGN) {
|
| 1097 |
this.consumeCodePoint();
|
| 1098 |
this.consumeCodePoint();
|
| 1099 |
return CDC_TOKEN;
|
| 1100 |
}
|
| 1101 |
break;
|
| 1102 |
case FULL_STOP:
|
| 1103 |
if (isNumberStart(codePoint, this.peekCodePoint(0), this.peekCodePoint(1))) {
|
| 1104 |
this.reconsumeCodePoint(codePoint);
|
| 1105 |
return this.consumeNumericToken();
|
| 1106 |
}
|
| 1107 |
break;
|
| 1108 |
case SOLIDUS:
|
| 1109 |
if (this.peekCodePoint(0) === ASTERISK) {
|
| 1110 |
this.consumeCodePoint();
|
| 1111 |
while (true) {
|
| 1112 |
var c = this.consumeCodePoint();
|
| 1113 |
if (c === ASTERISK) {
|
| 1114 |
c = this.consumeCodePoint();
|
| 1115 |
if (c === SOLIDUS) {
|
| 1116 |
return this.consumeToken();
|
| 1117 |
}
|
| 1118 |
}
|
| 1119 |
if (c === EOF) {
|
| 1120 |
return this.consumeToken();
|
| 1121 |
}
|
| 1122 |
}
|
| 1123 |
}
|
| 1124 |
break;
|
| 1125 |
case COLON:
|
| 1126 |
return COLON_TOKEN;
|
| 1127 |
case SEMICOLON:
|
| 1128 |
return SEMICOLON_TOKEN;
|
| 1129 |
case LESS_THAN_SIGN:
|
| 1130 |
if (this.peekCodePoint(0) === EXCLAMATION_MARK &&
|
| 1131 |
this.peekCodePoint(1) === HYPHEN_MINUS &&
|
| 1132 |
this.peekCodePoint(2) === HYPHEN_MINUS) {
|
| 1133 |
this.consumeCodePoint();
|
| 1134 |
this.consumeCodePoint();
|
| 1135 |
return CDO_TOKEN;
|
| 1136 |
}
|
| 1137 |
break;
|
| 1138 |
case COMMERCIAL_AT:
|
| 1139 |
var a1 = this.peekCodePoint(0);
|
| 1140 |
var a2 = this.peekCodePoint(1);
|
| 1141 |
var a3 = this.peekCodePoint(2);
|
| 1142 |
if (isIdentifierStart(a1, a2, a3)) {
|
| 1143 |
var value = this.consumeName();
|
| 1144 |
return { type: 7 /* AT_KEYWORD_TOKEN */, value: value };
|
| 1145 |
}
|
| 1146 |
break;
|
| 1147 |
case LEFT_SQUARE_BRACKET:
|
| 1148 |
return LEFT_SQUARE_BRACKET_TOKEN;
|
| 1149 |
case REVERSE_SOLIDUS:
|
| 1150 |
if (isValidEscape(codePoint, this.peekCodePoint(0))) {
|
| 1151 |
this.reconsumeCodePoint(codePoint);
|
| 1152 |
return this.consumeIdentLikeToken();
|
| 1153 |
}
|
| 1154 |
break;
|
| 1155 |
case RIGHT_SQUARE_BRACKET:
|
| 1156 |
return RIGHT_SQUARE_BRACKET_TOKEN;
|
| 1157 |
case CIRCUMFLEX_ACCENT:
|
| 1158 |
if (this.peekCodePoint(0) === EQUALS_SIGN) {
|
| 1159 |
this.consumeCodePoint();
|
| 1160 |
return PREFIX_MATCH_TOKEN;
|
| 1161 |
}
|
| 1162 |
break;
|
| 1163 |
case LEFT_CURLY_BRACKET:
|
| 1164 |
return LEFT_CURLY_BRACKET_TOKEN;
|
| 1165 |
case RIGHT_CURLY_BRACKET:
|
| 1166 |
return RIGHT_CURLY_BRACKET_TOKEN;
|
| 1167 |
case u:
|
| 1168 |
case U:
|
| 1169 |
var u1 = this.peekCodePoint(0);
|
| 1170 |
var u2 = this.peekCodePoint(1);
|
| 1171 |
if (u1 === PLUS_SIGN && (isHex(u2) || u2 === QUESTION_MARK)) {
|
| 1172 |
this.consumeCodePoint();
|
| 1173 |
this.consumeUnicodeRangeToken();
|
| 1174 |
}
|
| 1175 |
this.reconsumeCodePoint(codePoint);
|
| 1176 |
return this.consumeIdentLikeToken();
|
| 1177 |
case VERTICAL_LINE:
|
| 1178 |
if (this.peekCodePoint(0) === EQUALS_SIGN) {
|
| 1179 |
this.consumeCodePoint();
|
| 1180 |
return DASH_MATCH_TOKEN;
|
| 1181 |
}
|
| 1182 |
if (this.peekCodePoint(0) === VERTICAL_LINE) {
|
| 1183 |
this.consumeCodePoint();
|
| 1184 |
return COLUMN_TOKEN;
|
| 1185 |
}
|
| 1186 |
break;
|
| 1187 |
case TILDE:
|
| 1188 |
if (this.peekCodePoint(0) === EQUALS_SIGN) {
|
| 1189 |
this.consumeCodePoint();
|
| 1190 |
return INCLUDE_MATCH_TOKEN;
|
| 1191 |
}
|
| 1192 |
break;
|
| 1193 |
case EOF:
|
| 1194 |
return EOF_TOKEN;
|
| 1195 |
}
|
| 1196 |
if (isWhiteSpace(codePoint)) {
|
| 1197 |
this.consumeWhiteSpace();
|
| 1198 |
return WHITESPACE_TOKEN;
|
| 1199 |
}
|
| 1200 |
if (isDigit(codePoint)) {
|
| 1201 |
this.reconsumeCodePoint(codePoint);
|
| 1202 |
return this.consumeNumericToken();
|
| 1203 |
}
|
| 1204 |
if (isNameStartCodePoint(codePoint)) {
|
| 1205 |
this.reconsumeCodePoint(codePoint);
|
| 1206 |
return this.consumeIdentLikeToken();
|
| 1207 |
}
|
| 1208 |
return { type: 6 /* DELIM_TOKEN */, value: fromCodePoint$1(codePoint) };
|
| 1209 |
};
|
| 1210 |
Tokenizer.prototype.consumeCodePoint = function () {
|
| 1211 |
var value = this._value.shift();
|
| 1212 |
return typeof value === 'undefined' ? -1 : value;
|
| 1213 |
};
|
| 1214 |
Tokenizer.prototype.reconsumeCodePoint = function (codePoint) {
|
| 1215 |
this._value.unshift(codePoint);
|
| 1216 |
};
|
| 1217 |
Tokenizer.prototype.peekCodePoint = function (delta) {
|
| 1218 |
if (delta >= this._value.length) {
|
| 1219 |
return -1;
|
| 1220 |
}
|
| 1221 |
return this._value[delta];
|
| 1222 |
};
|
| 1223 |
Tokenizer.prototype.consumeUnicodeRangeToken = function () {
|
| 1224 |
var digits = [];
|
| 1225 |
var codePoint = this.consumeCodePoint();
|
| 1226 |
while (isHex(codePoint) && digits.length < 6) {
|
| 1227 |
digits.push(codePoint);
|
| 1228 |
codePoint = this.consumeCodePoint();
|
| 1229 |
}
|
| 1230 |
var questionMarks = false;
|
| 1231 |
while (codePoint === QUESTION_MARK && digits.length < 6) {
|
| 1232 |
digits.push(codePoint);
|
| 1233 |
codePoint = this.consumeCodePoint();
|
| 1234 |
questionMarks = true;
|
| 1235 |
}
|
| 1236 |
if (questionMarks) {
|
| 1237 |
var start_1 = parseInt(fromCodePoint$1.apply(void 0, digits.map(function (digit) { return (digit === QUESTION_MARK ? ZERO : digit); })), 16);
|
| 1238 |
var end = parseInt(fromCodePoint$1.apply(void 0, digits.map(function (digit) { return (digit === QUESTION_MARK ? F : digit); })), 16);
|
| 1239 |
return { type: 30 /* UNICODE_RANGE_TOKEN */, start: start_1, end: end };
|
| 1240 |
}
|
| 1241 |
var start = parseInt(fromCodePoint$1.apply(void 0, digits), 16);
|
| 1242 |
if (this.peekCodePoint(0) === HYPHEN_MINUS && isHex(this.peekCodePoint(1))) {
|
| 1243 |
this.consumeCodePoint();
|
| 1244 |
codePoint = this.consumeCodePoint();
|
| 1245 |
var endDigits = [];
|
| 1246 |
while (isHex(codePoint) && endDigits.length < 6) {
|
| 1247 |
endDigits.push(codePoint);
|
| 1248 |
codePoint = this.consumeCodePoint();
|
| 1249 |
}
|
| 1250 |
var end = parseInt(fromCodePoint$1.apply(void 0, endDigits), 16);
|
| 1251 |
return { type: 30 /* UNICODE_RANGE_TOKEN */, start: start, end: end };
|
| 1252 |
}
|
| 1253 |
else {
|
| 1254 |
return { type: 30 /* UNICODE_RANGE_TOKEN */, start: start, end: start };
|
| 1255 |
}
|
| 1256 |
};
|
| 1257 |
Tokenizer.prototype.consumeIdentLikeToken = function () {
|
| 1258 |
var value = this.consumeName();
|
| 1259 |
if (value.toLowerCase() === 'url' && this.peekCodePoint(0) === LEFT_PARENTHESIS) {
|
| 1260 |
this.consumeCodePoint();
|
| 1261 |
return this.consumeUrlToken();
|
| 1262 |
}
|
| 1263 |
else if (this.peekCodePoint(0) === LEFT_PARENTHESIS) {
|
| 1264 |
this.consumeCodePoint();
|
| 1265 |
return { type: 19 /* FUNCTION_TOKEN */, value: value };
|
| 1266 |
}
|
| 1267 |
return { type: 20 /* IDENT_TOKEN */, value: value };
|
| 1268 |
};
|
| 1269 |
Tokenizer.prototype.consumeUrlToken = function () {
|
| 1270 |
var value = [];
|
| 1271 |
this.consumeWhiteSpace();
|
| 1272 |
if (this.peekCodePoint(0) === EOF) {
|
| 1273 |
return { type: 22 /* URL_TOKEN */, value: '' };
|
| 1274 |
}
|
| 1275 |
var next = this.peekCodePoint(0);
|
| 1276 |
if (next === APOSTROPHE || next === QUOTATION_MARK) {
|
| 1277 |
var stringToken = this.consumeStringToken(this.consumeCodePoint());
|
| 1278 |
if (stringToken.type === 0 /* STRING_TOKEN */) {
|
| 1279 |
this.consumeWhiteSpace();
|
| 1280 |
if (this.peekCodePoint(0) === EOF || this.peekCodePoint(0) === RIGHT_PARENTHESIS) {
|
| 1281 |
this.consumeCodePoint();
|
| 1282 |
return { type: 22 /* URL_TOKEN */, value: stringToken.value };
|
| 1283 |
}
|
| 1284 |
}
|
| 1285 |
this.consumeBadUrlRemnants();
|
| 1286 |
return BAD_URL_TOKEN;
|
| 1287 |
}
|
| 1288 |
while (true) {
|
| 1289 |
var codePoint = this.consumeCodePoint();
|
| 1290 |
if (codePoint === EOF || codePoint === RIGHT_PARENTHESIS) {
|
| 1291 |
return { type: 22 /* URL_TOKEN */, value: fromCodePoint$1.apply(void 0, value) };
|
| 1292 |
}
|
| 1293 |
else if (isWhiteSpace(codePoint)) {
|
| 1294 |
this.consumeWhiteSpace();
|
| 1295 |
if (this.peekCodePoint(0) === EOF || this.peekCodePoint(0) === RIGHT_PARENTHESIS) {
|
| 1296 |
this.consumeCodePoint();
|
| 1297 |
return { type: 22 /* URL_TOKEN */, value: fromCodePoint$1.apply(void 0, value) };
|
| 1298 |
}
|
| 1299 |
this.consumeBadUrlRemnants();
|
| 1300 |
return BAD_URL_TOKEN;
|
| 1301 |
}
|
| 1302 |
else if (codePoint === QUOTATION_MARK ||
|
| 1303 |
codePoint === APOSTROPHE ||
|
| 1304 |
codePoint === LEFT_PARENTHESIS ||
|
| 1305 |
isNonPrintableCodePoint(codePoint)) {
|
| 1306 |
this.consumeBadUrlRemnants();
|
| 1307 |
return BAD_URL_TOKEN;
|
| 1308 |
}
|
| 1309 |
else if (codePoint === REVERSE_SOLIDUS) {
|
| 1310 |
if (isValidEscape(codePoint, this.peekCodePoint(0))) {
|
| 1311 |
value.push(this.consumeEscapedCodePoint());
|
| 1312 |
}
|
| 1313 |
else {
|
| 1314 |
this.consumeBadUrlRemnants();
|
| 1315 |
return BAD_URL_TOKEN;
|
| 1316 |
}
|
| 1317 |
}
|
| 1318 |
else {
|
| 1319 |
value.push(codePoint);
|
| 1320 |
}
|
| 1321 |
}
|
| 1322 |
};
|
| 1323 |
Tokenizer.prototype.consumeWhiteSpace = function () {
|
| 1324 |
while (isWhiteSpace(this.peekCodePoint(0))) {
|
| 1325 |
this.consumeCodePoint();
|
| 1326 |
}
|
| 1327 |
};
|
| 1328 |
Tokenizer.prototype.consumeBadUrlRemnants = function () {
|
| 1329 |
while (true) {
|
| 1330 |
var codePoint = this.consumeCodePoint();
|
| 1331 |
if (codePoint === RIGHT_PARENTHESIS || codePoint === EOF) {
|
| 1332 |
return;
|
| 1333 |
}
|
| 1334 |
if (isValidEscape(codePoint, this.peekCodePoint(0))) {
|
| 1335 |
this.consumeEscapedCodePoint();
|
| 1336 |
}
|
| 1337 |
}
|
| 1338 |
};
|
| 1339 |
Tokenizer.prototype.consumeStringSlice = function (count) {
|
| 1340 |
var SLICE_STACK_SIZE = 50000;
|
| 1341 |
var value = '';
|
| 1342 |
while (count > 0) {
|
| 1343 |
var amount = Math.min(SLICE_STACK_SIZE, count);
|
| 1344 |
value += fromCodePoint$1.apply(void 0, this._value.splice(0, amount));
|
| 1345 |
count -= amount;
|
| 1346 |
}
|
| 1347 |
this._value.shift();
|
| 1348 |
return value;
|
| 1349 |
};
|
| 1350 |
Tokenizer.prototype.consumeStringToken = function (endingCodePoint) {
|
| 1351 |
var value = '';
|
| 1352 |
var i = 0;
|
| 1353 |
do {
|
| 1354 |
var codePoint = this._value[i];
|
| 1355 |
if (codePoint === EOF || codePoint === undefined || codePoint === endingCodePoint) {
|
| 1356 |
value += this.consumeStringSlice(i);
|
| 1357 |
return { type: 0 /* STRING_TOKEN */, value: value };
|
| 1358 |
}
|
| 1359 |
if (codePoint === LINE_FEED) {
|
| 1360 |
this._value.splice(0, i);
|
| 1361 |
return BAD_STRING_TOKEN;
|
| 1362 |
}
|
| 1363 |
if (codePoint === REVERSE_SOLIDUS) {
|
| 1364 |
var next = this._value[i + 1];
|
| 1365 |
if (next !== EOF && next !== undefined) {
|
| 1366 |
if (next === LINE_FEED) {
|
| 1367 |
value += this.consumeStringSlice(i);
|
| 1368 |
i = -1;
|
| 1369 |
this._value.shift();
|
| 1370 |
}
|
| 1371 |
else if (isValidEscape(codePoint, next)) {
|
| 1372 |
value += this.consumeStringSlice(i);
|
| 1373 |
value += fromCodePoint$1(this.consumeEscapedCodePoint());
|
| 1374 |
i = -1;
|
| 1375 |
}
|
| 1376 |
}
|
| 1377 |
}
|
| 1378 |
i++;
|
| 1379 |
} while (true);
|
| 1380 |
};
|
| 1381 |
Tokenizer.prototype.consumeNumber = function () {
|
| 1382 |
var repr = [];
|
| 1383 |
var type = FLAG_INTEGER;
|
| 1384 |
var c1 = this.peekCodePoint(0);
|
| 1385 |
if (c1 === PLUS_SIGN || c1 === HYPHEN_MINUS) {
|
| 1386 |
repr.push(this.consumeCodePoint());
|
| 1387 |
}
|
| 1388 |
while (isDigit(this.peekCodePoint(0))) {
|
| 1389 |
repr.push(this.consumeCodePoint());
|
| 1390 |
}
|
| 1391 |
c1 = this.peekCodePoint(0);
|
| 1392 |
var c2 = this.peekCodePoint(1);
|
| 1393 |
if (c1 === FULL_STOP && isDigit(c2)) {
|
| 1394 |
repr.push(this.consumeCodePoint(), this.consumeCodePoint());
|
| 1395 |
type = FLAG_NUMBER;
|
| 1396 |
while (isDigit(this.peekCodePoint(0))) {
|
| 1397 |
repr.push(this.consumeCodePoint());
|
| 1398 |
}
|
| 1399 |
}
|
| 1400 |
c1 = this.peekCodePoint(0);
|
| 1401 |
c2 = this.peekCodePoint(1);
|
| 1402 |
var c3 = this.peekCodePoint(2);
|
| 1403 |
if ((c1 === E || c1 === e) && (((c2 === PLUS_SIGN || c2 === HYPHEN_MINUS) && isDigit(c3)) || isDigit(c2))) {
|
| 1404 |
repr.push(this.consumeCodePoint(), this.consumeCodePoint());
|
| 1405 |
type = FLAG_NUMBER;
|
| 1406 |
while (isDigit(this.peekCodePoint(0))) {
|
| 1407 |
repr.push(this.consumeCodePoint());
|
| 1408 |
}
|
| 1409 |
}
|
| 1410 |
return [stringToNumber(repr), type];
|
| 1411 |
};
|
| 1412 |
Tokenizer.prototype.consumeNumericToken = function () {
|
| 1413 |
var _a = this.consumeNumber(), number = _a[0], flags = _a[1];
|
| 1414 |
var c1 = this.peekCodePoint(0);
|
| 1415 |
var c2 = this.peekCodePoint(1);
|
| 1416 |
var c3 = this.peekCodePoint(2);
|
| 1417 |
if (isIdentifierStart(c1, c2, c3)) {
|
| 1418 |
var unit = this.consumeName();
|
| 1419 |
return { type: 15 /* DIMENSION_TOKEN */, number: number, flags: flags, unit: unit };
|
| 1420 |
}
|
| 1421 |
if (c1 === PERCENTAGE_SIGN) {
|
| 1422 |
this.consumeCodePoint();
|
| 1423 |
return { type: 16 /* PERCENTAGE_TOKEN */, number: number, flags: flags };
|
| 1424 |
}
|
| 1425 |
return { type: 17 /* NUMBER_TOKEN */, number: number, flags: flags };
|
| 1426 |
};
|
| 1427 |
Tokenizer.prototype.consumeEscapedCodePoint = function () {
|
| 1428 |
var codePoint = this.consumeCodePoint();
|
| 1429 |
if (isHex(codePoint)) {
|
| 1430 |
var hex = fromCodePoint$1(codePoint);
|
| 1431 |
while (isHex(this.peekCodePoint(0)) && hex.length < 6) {
|
| 1432 |
hex += fromCodePoint$1(this.consumeCodePoint());
|
| 1433 |
}
|
| 1434 |
if (isWhiteSpace(this.peekCodePoint(0))) {
|
| 1435 |
this.consumeCodePoint();
|
| 1436 |
}
|
| 1437 |
var hexCodePoint = parseInt(hex, 16);
|
| 1438 |
if (hexCodePoint === 0 || isSurrogateCodePoint(hexCodePoint) || hexCodePoint > 0x10ffff) {
|
| 1439 |
return REPLACEMENT_CHARACTER;
|
| 1440 |
}
|
| 1441 |
return hexCodePoint;
|
| 1442 |
}
|
| 1443 |
if (codePoint === EOF) {
|
| 1444 |
return REPLACEMENT_CHARACTER;
|
| 1445 |
}
|
| 1446 |
return codePoint;
|
| 1447 |
};
|
| 1448 |
Tokenizer.prototype.consumeName = function () {
|
| 1449 |
var result = '';
|
| 1450 |
while (true) {
|
| 1451 |
var codePoint = this.consumeCodePoint();
|
| 1452 |
if (isNameCodePoint(codePoint)) {
|
| 1453 |
result += fromCodePoint$1(codePoint);
|
| 1454 |
}
|
| 1455 |
else if (isValidEscape(codePoint, this.peekCodePoint(0))) {
|
| 1456 |
result += fromCodePoint$1(this.consumeEscapedCodePoint());
|
| 1457 |
}
|
| 1458 |
else {
|
| 1459 |
this.reconsumeCodePoint(codePoint);
|
| 1460 |
return result;
|
| 1461 |
}
|
| 1462 |
}
|
| 1463 |
};
|
| 1464 |
return Tokenizer;
|
| 1465 |
}());
|
| 1466 |
|
| 1467 |
var Parser = /** @class */ (function () {
|
| 1468 |
function Parser(tokens) {
|
| 1469 |
this._tokens = tokens;
|
| 1470 |
}
|
| 1471 |
Parser.create = function (value) {
|
| 1472 |
var tokenizer = new Tokenizer();
|
| 1473 |
tokenizer.write(value);
|
| 1474 |
return new Parser(tokenizer.read());
|
| 1475 |
};
|
| 1476 |
Parser.parseValue = function (value) {
|
| 1477 |
return Parser.create(value).parseComponentValue();
|
| 1478 |
};
|
| 1479 |
Parser.parseValues = function (value) {
|
| 1480 |
return Parser.create(value).parseComponentValues();
|
| 1481 |
};
|
| 1482 |
Parser.prototype.parseComponentValue = function () {
|
| 1483 |
var token = this.consumeToken();
|
| 1484 |
while (token.type === 31 /* WHITESPACE_TOKEN */) {
|
| 1485 |
token = this.consumeToken();
|
| 1486 |
}
|
| 1487 |
if (token.type === 32 /* EOF_TOKEN */) {
|
| 1488 |
throw new SyntaxError("Error parsing CSS component value, unexpected EOF");
|
| 1489 |
}
|
| 1490 |
this.reconsumeToken(token);
|
| 1491 |
var value = this.consumeComponentValue();
|
| 1492 |
do {
|
| 1493 |
token = this.consumeToken();
|
| 1494 |
} while (token.type === 31 /* WHITESPACE_TOKEN */);
|
| 1495 |
if (token.type === 32 /* EOF_TOKEN */) {
|
| 1496 |
return value;
|
| 1497 |
}
|
| 1498 |
throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one");
|
| 1499 |
};
|
| 1500 |
Parser.prototype.parseComponentValues = function () {
|
| 1501 |
var values = [];
|
| 1502 |
while (true) {
|
| 1503 |
var value = this.consumeComponentValue();
|
| 1504 |
if (value.type === 32 /* EOF_TOKEN */) {
|
| 1505 |
return values;
|
| 1506 |
}
|
| 1507 |
values.push(value);
|
| 1508 |
values.push();
|
| 1509 |
}
|
| 1510 |
};
|
| 1511 |
Parser.prototype.consumeComponentValue = function () {
|
| 1512 |
var token = this.consumeToken();
|
| 1513 |
switch (token.type) {
|
| 1514 |
case 11 /* LEFT_CURLY_BRACKET_TOKEN */:
|
| 1515 |
case 28 /* LEFT_SQUARE_BRACKET_TOKEN */:
|
| 1516 |
case 2 /* LEFT_PARENTHESIS_TOKEN */:
|
| 1517 |
return this.consumeSimpleBlock(token.type);
|
| 1518 |
case 19 /* FUNCTION_TOKEN */:
|
| 1519 |
return this.consumeFunction(token);
|
| 1520 |
}
|
| 1521 |
return token;
|
| 1522 |
};
|
| 1523 |
Parser.prototype.consumeSimpleBlock = function (type) {
|
| 1524 |
var block = { type: type, values: [] };
|
| 1525 |
var token = this.consumeToken();
|
| 1526 |
while (true) {
|
| 1527 |
if (token.type === 32 /* EOF_TOKEN */ || isEndingTokenFor(token, type)) {
|
| 1528 |
return block;
|
| 1529 |
}
|
| 1530 |
this.reconsumeToken(token);
|
| 1531 |
block.values.push(this.consumeComponentValue());
|
| 1532 |
token = this.consumeToken();
|
| 1533 |
}
|
| 1534 |
};
|
| 1535 |
Parser.prototype.consumeFunction = function (functionToken) {
|
| 1536 |
var cssFunction = {
|
| 1537 |
name: functionToken.value,
|
| 1538 |
values: [],
|
| 1539 |
type: 18 /* FUNCTION */
|
| 1540 |
};
|
| 1541 |
while (true) {
|
| 1542 |
var token = this.consumeToken();
|
| 1543 |
if (token.type === 32 /* EOF_TOKEN */ || token.type === 3 /* RIGHT_PARENTHESIS_TOKEN */) {
|
| 1544 |
return cssFunction;
|
| 1545 |
}
|
| 1546 |
this.reconsumeToken(token);
|
| 1547 |
cssFunction.values.push(this.consumeComponentValue());
|
| 1548 |
}
|
| 1549 |
};
|
| 1550 |
Parser.prototype.consumeToken = function () {
|
| 1551 |
var token = this._tokens.shift();
|
| 1552 |
return typeof token === 'undefined' ? EOF_TOKEN : token;
|
| 1553 |
};
|
| 1554 |
Parser.prototype.reconsumeToken = function (token) {
|
| 1555 |
this._tokens.unshift(token);
|
| 1556 |
};
|
| 1557 |
return Parser;
|
| 1558 |
}());
|
| 1559 |
var isDimensionToken = function (token) { return token.type === 15 /* DIMENSION_TOKEN */; };
|
| 1560 |
var isNumberToken = function (token) { return token.type === 17 /* NUMBER_TOKEN */; };
|
| 1561 |
var isIdentToken = function (token) { return token.type === 20 /* IDENT_TOKEN */; };
|
| 1562 |
var isStringToken = function (token) { return token.type === 0 /* STRING_TOKEN */; };
|
| 1563 |
var isIdentWithValue = function (token, value) {
|
| 1564 |
return isIdentToken(token) && token.value === value;
|
| 1565 |
};
|
| 1566 |
var nonWhiteSpace = function (token) { return token.type !== 31 /* WHITESPACE_TOKEN */; };
|
| 1567 |
var nonFunctionArgSeparator = function (token) {
|
| 1568 |
return token.type !== 31 /* WHITESPACE_TOKEN */ && token.type !== 4 /* COMMA_TOKEN */;
|
| 1569 |
};
|
| 1570 |
var parseFunctionArgs = function (tokens) {
|
| 1571 |
var args = [];
|
| 1572 |
var arg = [];
|
| 1573 |
tokens.forEach(function (token) {
|
| 1574 |
if (token.type === 4 /* COMMA_TOKEN */) {
|
| 1575 |
if (arg.length === 0) {
|
| 1576 |
throw new Error("Error parsing function args, zero tokens for arg");
|
| 1577 |
}
|
| 1578 |
args.push(arg);
|
| 1579 |
arg = [];
|
| 1580 |
return;
|
| 1581 |
}
|
| 1582 |
if (token.type !== 31 /* WHITESPACE_TOKEN */) {
|
| 1583 |
arg.push(token);
|
| 1584 |
}
|
| 1585 |
});
|
| 1586 |
if (arg.length) {
|
| 1587 |
args.push(arg);
|
| 1588 |
}
|
| 1589 |
return args;
|
| 1590 |
};
|
| 1591 |
var isEndingTokenFor = function (token, type) {
|
| 1592 |
if (type === 11 /* LEFT_CURLY_BRACKET_TOKEN */ && token.type === 12 /* RIGHT_CURLY_BRACKET_TOKEN */) {
|
| 1593 |
return true;
|
| 1594 |
}
|
| 1595 |
if (type === 28 /* LEFT_SQUARE_BRACKET_TOKEN */ && token.type === 29 /* RIGHT_SQUARE_BRACKET_TOKEN */) {
|
| 1596 |
return true;
|
| 1597 |
}
|
| 1598 |
return type === 2 /* LEFT_PARENTHESIS_TOKEN */ && token.type === 3 /* RIGHT_PARENTHESIS_TOKEN */;
|
| 1599 |
};
|
| 1600 |
|
| 1601 |
var isLength = function (token) {
|
| 1602 |
return token.type === 17 /* NUMBER_TOKEN */ || token.type === 15 /* DIMENSION_TOKEN */;
|
| 1603 |
};
|
| 1604 |
|
| 1605 |
var isLengthPercentage = function (token) {
|
| 1606 |
return token.type === 16 /* PERCENTAGE_TOKEN */ || isLength(token);
|
| 1607 |
};
|
| 1608 |
var parseLengthPercentageTuple = function (tokens) {
|
| 1609 |
return tokens.length > 1 ? [tokens[0], tokens[1]] : [tokens[0]];
|
| 1610 |
};
|
| 1611 |
var ZERO_LENGTH = {
|
| 1612 |
type: 17 /* NUMBER_TOKEN */,
|
| 1613 |
number: 0,
|
| 1614 |
flags: FLAG_INTEGER
|
| 1615 |
};
|
| 1616 |
var FIFTY_PERCENT = {
|
| 1617 |
type: 16 /* PERCENTAGE_TOKEN */,
|
| 1618 |
number: 50,
|
| 1619 |
flags: FLAG_INTEGER
|
| 1620 |
};
|
| 1621 |
var HUNDRED_PERCENT = {
|
| 1622 |
type: 16 /* PERCENTAGE_TOKEN */,
|
| 1623 |
number: 100,
|
| 1624 |
flags: FLAG_INTEGER
|
| 1625 |
};
|
| 1626 |
var getAbsoluteValueForTuple = function (tuple, width, height) {
|
| 1627 |
var x = tuple[0], y = tuple[1];
|
| 1628 |
return [getAbsoluteValue(x, width), getAbsoluteValue(typeof y !== 'undefined' ? y : x, height)];
|
| 1629 |
};
|
| 1630 |
var getAbsoluteValue = function (token, parent) {
|
| 1631 |
if (token.type === 16 /* PERCENTAGE_TOKEN */) {
|
| 1632 |
return (token.number / 100) * parent;
|
| 1633 |
}
|
| 1634 |
if (isDimensionToken(token)) {
|
| 1635 |
switch (token.unit) {
|
| 1636 |
case 'rem':
|
| 1637 |
case 'em':
|
| 1638 |
return 16 * token.number; // TODO use correct font-size
|
| 1639 |
case 'px':
|
| 1640 |
default:
|
| 1641 |
return token.number;
|
| 1642 |
}
|
| 1643 |
}
|
| 1644 |
return token.number;
|
| 1645 |
};
|
| 1646 |
|
| 1647 |
var DEG = 'deg';
|
| 1648 |
var GRAD = 'grad';
|
| 1649 |
var RAD = 'rad';
|
| 1650 |
var TURN = 'turn';
|
| 1651 |
var angle = {
|
| 1652 |
name: 'angle',
|
| 1653 |
parse: function (_context, value) {
|
| 1654 |
if (value.type === 15 /* DIMENSION_TOKEN */) {
|
| 1655 |
switch (value.unit) {
|
| 1656 |
case DEG:
|
| 1657 |
return (Math.PI * value.number) / 180;
|
| 1658 |
case GRAD:
|
| 1659 |
return (Math.PI / 200) * value.number;
|
| 1660 |
case RAD:
|
| 1661 |
return value.number;
|
| 1662 |
case TURN:
|
| 1663 |
return Math.PI * 2 * value.number;
|
| 1664 |
}
|
| 1665 |
}
|
| 1666 |
throw new Error("Unsupported angle type");
|
| 1667 |
}
|
| 1668 |
};
|
| 1669 |
var isAngle = function (value) {
|
| 1670 |
if (value.type === 15 /* DIMENSION_TOKEN */) {
|
| 1671 |
if (value.unit === DEG || value.unit === GRAD || value.unit === RAD || value.unit === TURN) {
|
| 1672 |
return true;
|
| 1673 |
}
|
| 1674 |
}
|
| 1675 |
return false;
|
| 1676 |
};
|
| 1677 |
var parseNamedSide = function (tokens) {
|
| 1678 |
var sideOrCorner = tokens
|
| 1679 |
.filter(isIdentToken)
|
| 1680 |
.map(function (ident) { return ident.value; })
|
| 1681 |
.join(' ');
|
| 1682 |
switch (sideOrCorner) {
|
| 1683 |
case 'to bottom right':
|
| 1684 |
case 'to right bottom':
|
| 1685 |
case 'left top':
|
| 1686 |
case 'top left':
|
| 1687 |
return [ZERO_LENGTH, ZERO_LENGTH];
|
| 1688 |
case 'to top':
|
| 1689 |
case 'bottom':
|
| 1690 |
return deg(0);
|
| 1691 |
case 'to bottom left':
|
| 1692 |
case 'to left bottom':
|
| 1693 |
case 'right top':
|
| 1694 |
case 'top right':
|
| 1695 |
return [ZERO_LENGTH, HUNDRED_PERCENT];
|
| 1696 |
case 'to right':
|
| 1697 |
case 'left':
|
| 1698 |
return deg(90);
|
| 1699 |
case 'to top left':
|
| 1700 |
case 'to left top':
|
| 1701 |
case 'right bottom':
|
| 1702 |
case 'bottom right':
|
| 1703 |
return [HUNDRED_PERCENT, HUNDRED_PERCENT];
|
| 1704 |
case 'to bottom':
|
| 1705 |
case 'top':
|
| 1706 |
return deg(180);
|
| 1707 |
case 'to top right':
|
| 1708 |
case 'to right top':
|
| 1709 |
case 'left bottom':
|
| 1710 |
case 'bottom left':
|
| 1711 |
return [HUNDRED_PERCENT, ZERO_LENGTH];
|
| 1712 |
case 'to left':
|
| 1713 |
case 'right':
|
| 1714 |
return deg(270);
|
| 1715 |
}
|
| 1716 |
return 0;
|
| 1717 |
};
|
| 1718 |
var deg = function (deg) { return (Math.PI * deg) / 180; };
|
| 1719 |
|
| 1720 |
var color$1 = {
|
| 1721 |
name: 'color',
|
| 1722 |
parse: function (context, value) {
|
| 1723 |
if (value.type === 18 /* FUNCTION */) {
|
| 1724 |
var colorFunction = SUPPORTED_COLOR_FUNCTIONS[value.name];
|
| 1725 |
if (typeof colorFunction === 'undefined') {
|
| 1726 |
throw new Error("Attempting to parse an unsupported color function \"" + value.name + "\"");
|
| 1727 |
}
|
| 1728 |
return colorFunction(context, value.values);
|
| 1729 |
}
|
| 1730 |
if (value.type === 5 /* HASH_TOKEN */) {
|
| 1731 |
if (value.value.length === 3) {
|
| 1732 |
var r = value.value.substring(0, 1);
|
| 1733 |
var g = value.value.substring(1, 2);
|
| 1734 |
var b = value.value.substring(2, 3);
|
| 1735 |
return pack(parseInt(r + r, 16), parseInt(g + g, 16), parseInt(b + b, 16), 1);
|
| 1736 |
}
|
| 1737 |
if (value.value.length === 4) {
|
| 1738 |
var r = value.value.substring(0, 1);
|
| 1739 |
var g = value.value.substring(1, 2);
|
| 1740 |
var b = value.value.substring(2, 3);
|
| 1741 |
var a = value.value.substring(3, 4);
|
| 1742 |
return pack(parseInt(r + r, 16), parseInt(g + g, 16), parseInt(b + b, 16), parseInt(a + a, 16) / 255);
|
| 1743 |
}
|
| 1744 |
if (value.value.length === 6) {
|
| 1745 |
var r = value.value.substring(0, 2);
|
| 1746 |
var g = value.value.substring(2, 4);
|
| 1747 |
var b = value.value.substring(4, 6);
|
| 1748 |
return pack(parseInt(r, 16), parseInt(g, 16), parseInt(b, 16), 1);
|
| 1749 |
}
|
| 1750 |
if (value.value.length === 8) {
|
| 1751 |
var r = value.value.substring(0, 2);
|
| 1752 |
var g = value.value.substring(2, 4);
|
| 1753 |
var b = value.value.substring(4, 6);
|
| 1754 |
var a = value.value.substring(6, 8);
|
| 1755 |
return pack(parseInt(r, 16), parseInt(g, 16), parseInt(b, 16), parseInt(a, 16) / 255);
|
| 1756 |
}
|
| 1757 |
}
|
| 1758 |
if (value.type === 20 /* IDENT_TOKEN */) {
|
| 1759 |
var namedColor = COLORS[value.value.toUpperCase()];
|
| 1760 |
if (typeof namedColor !== 'undefined') {
|
| 1761 |
return namedColor;
|
| 1762 |
}
|
| 1763 |
}
|
| 1764 |
return COLORS.TRANSPARENT;
|
| 1765 |
}
|
| 1766 |
};
|
| 1767 |
var isTransparent = function (color) { return (0xff & color) === 0; };
|
| 1768 |
var asString = function (color) {
|
| 1769 |
var alpha = 0xff & color;
|
| 1770 |
var blue = 0xff & (color >> 8);
|
| 1771 |
var green = 0xff & (color >> 16);
|
| 1772 |
var red = 0xff & (color >> 24);
|
| 1773 |
return alpha < 255 ? "rgba(" + red + "," + green + "," + blue + "," + alpha / 255 + ")" : "rgb(" + red + "," + green + "," + blue + ")";
|
| 1774 |
};
|
| 1775 |
var pack = function (r, g, b, a) {
|
| 1776 |
return ((r << 24) | (g << 16) | (b << 8) | (Math.round(a * 255) << 0)) >>> 0;
|
| 1777 |
};
|
| 1778 |
var getTokenColorValue = function (token, i) {
|
| 1779 |
if (token.type === 17 /* NUMBER_TOKEN */) {
|
| 1780 |
return token.number;
|
| 1781 |
}
|
| 1782 |
if (token.type === 16 /* PERCENTAGE_TOKEN */) {
|
| 1783 |
var max = i === 3 ? 1 : 255;
|
| 1784 |
return i === 3 ? (token.number / 100) * max : Math.round((token.number / 100) * max);
|
| 1785 |
}
|
| 1786 |
return 0;
|
| 1787 |
};
|
| 1788 |
var rgb = function (_context, args) {
|
| 1789 |
var tokens = args.filter(nonFunctionArgSeparator);
|
| 1790 |
if (tokens.length === 3) {
|
| 1791 |
var _a = tokens.map(getTokenColorValue), r = _a[0], g = _a[1], b = _a[2];
|
| 1792 |
return pack(r, g, b, 1);
|
| 1793 |
}
|
| 1794 |
if (tokens.length === 4) {
|
| 1795 |
var _b = tokens.map(getTokenColorValue), r = _b[0], g = _b[1], b = _b[2], a = _b[3];
|
| 1796 |
return pack(r, g, b, a);
|
| 1797 |
}
|
| 1798 |
return 0;
|
| 1799 |
};
|
| 1800 |
function hue2rgb(t1, t2, hue) {
|
| 1801 |
if (hue < 0) {
|
| 1802 |
hue += 1;
|
| 1803 |
}
|
| 1804 |
if (hue >= 1) {
|
| 1805 |
hue -= 1;
|
| 1806 |
}
|
| 1807 |
if (hue < 1 / 6) {
|
| 1808 |
return (t2 - t1) * hue * 6 + t1;
|
| 1809 |
}
|
| 1810 |
else if (hue < 1 / 2) {
|
| 1811 |
return t2;
|
| 1812 |
}
|
| 1813 |
else if (hue < 2 / 3) {
|
| 1814 |
return (t2 - t1) * 6 * (2 / 3 - hue) + t1;
|
| 1815 |
}
|
| 1816 |
else {
|
| 1817 |
return t1;
|
| 1818 |
}
|
| 1819 |
}
|
| 1820 |
var hsl = function (context, args) {
|
| 1821 |
var tokens = args.filter(nonFunctionArgSeparator);
|
| 1822 |
var hue = tokens[0], saturation = tokens[1], lightness = tokens[2], alpha = tokens[3];
|
| 1823 |
var h = (hue.type === 17 /* NUMBER_TOKEN */ ? deg(hue.number) : angle.parse(context, hue)) / (Math.PI * 2);
|
| 1824 |
var s = isLengthPercentage(saturation) ? saturation.number / 100 : 0;
|
| 1825 |
var l = isLengthPercentage(lightness) ? lightness.number / 100 : 0;
|
| 1826 |
var a = typeof alpha !== 'undefined' && isLengthPercentage(alpha) ? getAbsoluteValue(alpha, 1) : 1;
|
| 1827 |
if (s === 0) {
|
| 1828 |
return pack(l * 255, l * 255, l * 255, 1);
|
| 1829 |
}
|
| 1830 |
var t2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;
|
| 1831 |
var t1 = l * 2 - t2;
|
| 1832 |
var r = hue2rgb(t1, t2, h + 1 / 3);
|
| 1833 |
var g = hue2rgb(t1, t2, h);
|
| 1834 |
var b = hue2rgb(t1, t2, h - 1 / 3);
|
| 1835 |
return pack(r * 255, g * 255, b * 255, a);
|
| 1836 |
};
|
| 1837 |
var SUPPORTED_COLOR_FUNCTIONS = {
|
| 1838 |
hsl: hsl,
|
| 1839 |
hsla: hsl,
|
| 1840 |
rgb: rgb,
|
| 1841 |
rgba: rgb
|
| 1842 |
};
|
| 1843 |
var parseColor = function (context, value) {
|
| 1844 |
return color$1.parse(context, Parser.create(value).parseComponentValue());
|
| 1845 |
};
|
| 1846 |
var COLORS = {
|
| 1847 |
ALICEBLUE: 0xf0f8ffff,
|
| 1848 |
ANTIQUEWHITE: 0xfaebd7ff,
|
| 1849 |
AQUA: 0x00ffffff,
|
| 1850 |
AQUAMARINE: 0x7fffd4ff,
|
| 1851 |
AZURE: 0xf0ffffff,
|
| 1852 |
BEIGE: 0xf5f5dcff,
|
| 1853 |
BISQUE: 0xffe4c4ff,
|
| 1854 |
BLACK: 0x000000ff,
|
| 1855 |
BLANCHEDALMOND: 0xffebcdff,
|
| 1856 |
BLUE: 0x0000ffff,
|
| 1857 |
BLUEVIOLET: 0x8a2be2ff,
|
| 1858 |
BROWN: 0xa52a2aff,
|
| 1859 |
BURLYWOOD: 0xdeb887ff,
|
| 1860 |
CADETBLUE: 0x5f9ea0ff,
|
| 1861 |
CHARTREUSE: 0x7fff00ff,
|
| 1862 |
CHOCOLATE: 0xd2691eff,
|
| 1863 |
CORAL: 0xff7f50ff,
|
| 1864 |
CORNFLOWERBLUE: 0x6495edff,
|
| 1865 |
CORNSILK: 0xfff8dcff,
|
| 1866 |
CRIMSON: 0xdc143cff,
|
| 1867 |
CYAN: 0x00ffffff,
|
| 1868 |
DARKBLUE: 0x00008bff,
|
| 1869 |
DARKCYAN: 0x008b8bff,
|
| 1870 |
DARKGOLDENROD: 0xb886bbff,
|
| 1871 |
DARKGRAY: 0xa9a9a9ff,
|
| 1872 |
DARKGREEN: 0x006400ff,
|
| 1873 |
DARKGREY: 0xa9a9a9ff,
|
| 1874 |
DARKKHAKI: 0xbdb76bff,
|
| 1875 |
DARKMAGENTA: 0x8b008bff,
|
| 1876 |
DARKOLIVEGREEN: 0x556b2fff,
|
| 1877 |
DARKORANGE: 0xff8c00ff,
|
| 1878 |
DARKORCHID: 0x9932ccff,
|
| 1879 |
DARKRED: 0x8b0000ff,
|
| 1880 |
DARKSALMON: 0xe9967aff,
|
| 1881 |
DARKSEAGREEN: 0x8fbc8fff,
|
| 1882 |
DARKSLATEBLUE: 0x483d8bff,
|
| 1883 |
DARKSLATEGRAY: 0x2f4f4fff,
|
| 1884 |
DARKSLATEGREY: 0x2f4f4fff,
|
| 1885 |
DARKTURQUOISE: 0x00ced1ff,
|
| 1886 |
DARKVIOLET: 0x9400d3ff,
|
| 1887 |
DEEPPINK: 0xff1493ff,
|
| 1888 |
DEEPSKYBLUE: 0x00bfffff,
|
| 1889 |
DIMGRAY: 0x696969ff,
|
| 1890 |
DIMGREY: 0x696969ff,
|
| 1891 |
DODGERBLUE: 0x1e90ffff,
|
| 1892 |
FIREBRICK: 0xb22222ff,
|
| 1893 |
FLORALWHITE: 0xfffaf0ff,
|
| 1894 |
FORESTGREEN: 0x228b22ff,
|
| 1895 |
FUCHSIA: 0xff00ffff,
|
| 1896 |
GAINSBORO: 0xdcdcdcff,
|
| 1897 |
GHOSTWHITE: 0xf8f8ffff,
|
| 1898 |
GOLD: 0xffd700ff,
|
| 1899 |
GOLDENROD: 0xdaa520ff,
|
| 1900 |
GRAY: 0x808080ff,
|
| 1901 |
GREEN: 0x008000ff,
|
| 1902 |
GREENYELLOW: 0xadff2fff,
|
| 1903 |
GREY: 0x808080ff,
|
| 1904 |
HONEYDEW: 0xf0fff0ff,
|
| 1905 |
HOTPINK: 0xff69b4ff,
|
| 1906 |
INDIANRED: 0xcd5c5cff,
|
| 1907 |
INDIGO: 0x4b0082ff,
|
| 1908 |
IVORY: 0xfffff0ff,
|
| 1909 |
KHAKI: 0xf0e68cff,
|
| 1910 |
LAVENDER: 0xe6e6faff,
|
| 1911 |
LAVENDERBLUSH: 0xfff0f5ff,
|
| 1912 |
LAWNGREEN: 0x7cfc00ff,
|
| 1913 |
LEMONCHIFFON: 0xfffacdff,
|
| 1914 |
LIGHTBLUE: 0xadd8e6ff,
|
| 1915 |
LIGHTCORAL: 0xf08080ff,
|
| 1916 |
LIGHTCYAN: 0xe0ffffff,
|
| 1917 |
LIGHTGOLDENRODYELLOW: 0xfafad2ff,
|
| 1918 |
LIGHTGRAY: 0xd3d3d3ff,
|
| 1919 |
LIGHTGREEN: 0x90ee90ff,
|
| 1920 |
LIGHTGREY: 0xd3d3d3ff,
|
| 1921 |
LIGHTPINK: 0xffb6c1ff,
|
| 1922 |
LIGHTSALMON: 0xffa07aff,
|
| 1923 |
LIGHTSEAGREEN: 0x20b2aaff,
|
| 1924 |
LIGHTSKYBLUE: 0x87cefaff,
|
| 1925 |
LIGHTSLATEGRAY: 0x778899ff,
|
| 1926 |
LIGHTSLATEGREY: 0x778899ff,
|
| 1927 |
LIGHTSTEELBLUE: 0xb0c4deff,
|
| 1928 |
LIGHTYELLOW: 0xffffe0ff,
|
| 1929 |
LIME: 0x00ff00ff,
|
| 1930 |
LIMEGREEN: 0x32cd32ff,
|
| 1931 |
LINEN: 0xfaf0e6ff,
|
| 1932 |
MAGENTA: 0xff00ffff,
|
| 1933 |
MAROON: 0x800000ff,
|
| 1934 |
MEDIUMAQUAMARINE: 0x66cdaaff,
|
| 1935 |
MEDIUMBLUE: 0x0000cdff,
|
| 1936 |
MEDIUMORCHID: 0xba55d3ff,
|
| 1937 |
MEDIUMPURPLE: 0x9370dbff,
|
| 1938 |
MEDIUMSEAGREEN: 0x3cb371ff,
|
| 1939 |
MEDIUMSLATEBLUE: 0x7b68eeff,
|
| 1940 |
MEDIUMSPRINGGREEN: 0x00fa9aff,
|
| 1941 |
MEDIUMTURQUOISE: 0x48d1ccff,
|
| 1942 |
MEDIUMVIOLETRED: 0xc71585ff,
|
| 1943 |
MIDNIGHTBLUE: 0x191970ff,
|
| 1944 |
MINTCREAM: 0xf5fffaff,
|
| 1945 |
MISTYROSE: 0xffe4e1ff,
|
| 1946 |
MOCCASIN: 0xffe4b5ff,
|
| 1947 |
NAVAJOWHITE: 0xffdeadff,
|
| 1948 |
NAVY: 0x000080ff,
|
| 1949 |
OLDLACE: 0xfdf5e6ff,
|
| 1950 |
OLIVE: 0x808000ff,
|
| 1951 |
OLIVEDRAB: 0x6b8e23ff,
|
| 1952 |
ORANGE: 0xffa500ff,
|
| 1953 |
ORANGERED: 0xff4500ff,
|
| 1954 |
ORCHID: 0xda70d6ff,
|
| 1955 |
PALEGOLDENROD: 0xeee8aaff,
|
| 1956 |
PALEGREEN: 0x98fb98ff,
|
| 1957 |
PALETURQUOISE: 0xafeeeeff,
|
| 1958 |
PALEVIOLETRED: 0xdb7093ff,
|
| 1959 |
PAPAYAWHIP: 0xffefd5ff,
|
| 1960 |
PEACHPUFF: 0xffdab9ff,
|
| 1961 |
PERU: 0xcd853fff,
|
| 1962 |
PINK: 0xffc0cbff,
|
| 1963 |
PLUM: 0xdda0ddff,
|
| 1964 |
POWDERBLUE: 0xb0e0e6ff,
|
| 1965 |
PURPLE: 0x800080ff,
|
| 1966 |
REBECCAPURPLE: 0x663399ff,
|
| 1967 |
RED: 0xff0000ff,
|
| 1968 |
ROSYBROWN: 0xbc8f8fff,
|
| 1969 |
ROYALBLUE: 0x4169e1ff,
|
| 1970 |
SADDLEBROWN: 0x8b4513ff,
|
| 1971 |
SALMON: 0xfa8072ff,
|
| 1972 |
SANDYBROWN: 0xf4a460ff,
|
| 1973 |
SEAGREEN: 0x2e8b57ff,
|
| 1974 |
SEASHELL: 0xfff5eeff,
|
| 1975 |
SIENNA: 0xa0522dff,
|
| 1976 |
SILVER: 0xc0c0c0ff,
|
| 1977 |
SKYBLUE: 0x87ceebff,
|
| 1978 |
SLATEBLUE: 0x6a5acdff,
|
| 1979 |
SLATEGRAY: 0x708090ff,
|
| 1980 |
SLATEGREY: 0x708090ff,
|
| 1981 |
SNOW: 0xfffafaff,
|
| 1982 |
SPRINGGREEN: 0x00ff7fff,
|
| 1983 |
STEELBLUE: 0x4682b4ff,
|
| 1984 |
TAN: 0xd2b48cff,
|
| 1985 |
TEAL: 0x008080ff,
|
| 1986 |
THISTLE: 0xd8bfd8ff,
|
| 1987 |
TOMATO: 0xff6347ff,
|
| 1988 |
TRANSPARENT: 0x00000000,
|
| 1989 |
TURQUOISE: 0x40e0d0ff,
|
| 1990 |
VIOLET: 0xee82eeff,
|
| 1991 |
WHEAT: 0xf5deb3ff,
|
| 1992 |
WHITE: 0xffffffff,
|
| 1993 |
WHITESMOKE: 0xf5f5f5ff,
|
| 1994 |
YELLOW: 0xffff00ff,
|
| 1995 |
YELLOWGREEN: 0x9acd32ff
|
| 1996 |
};
|
| 1997 |
|
| 1998 |
var backgroundClip = {
|
| 1999 |
name: 'background-clip',
|
| 2000 |
initialValue: 'border-box',
|
| 2001 |
prefix: false,
|
| 2002 |
type: 1 /* LIST */,
|
| 2003 |
parse: function (_context, tokens) {
|
| 2004 |
return tokens.map(function (token) {
|
| 2005 |
if (isIdentToken(token)) {
|
| 2006 |
switch (token.value) {
|
| 2007 |
case 'padding-box':
|
| 2008 |
return 1 /* PADDING_BOX */;
|
| 2009 |
case 'content-box':
|
| 2010 |
return 2 /* CONTENT_BOX */;
|
| 2011 |
}
|
| 2012 |
}
|
| 2013 |
return 0 /* BORDER_BOX */;
|
| 2014 |
});
|
| 2015 |
}
|
| 2016 |
};
|
| 2017 |
|
| 2018 |
var backgroundColor = {
|
| 2019 |
name: "background-color",
|
| 2020 |
initialValue: 'transparent',
|
| 2021 |
prefix: false,
|
| 2022 |
type: 3 /* TYPE_VALUE */,
|
| 2023 |
format: 'color'
|
| 2024 |
};
|
| 2025 |
|
| 2026 |
var parseColorStop = function (context, args) {
|
| 2027 |
var color = color$1.parse(context, args[0]);
|
| 2028 |
var stop = args[1];
|
| 2029 |
return stop && isLengthPercentage(stop) ? { color: color, stop: stop } : { color: color, stop: null };
|
| 2030 |
};
|
| 2031 |
var processColorStops = function (stops, lineLength) {
|
| 2032 |
var first = stops[0];
|
| 2033 |
var last = stops[stops.length - 1];
|
| 2034 |
if (first.stop === null) {
|
| 2035 |
first.stop = ZERO_LENGTH;
|
| 2036 |
}
|
| 2037 |
if (last.stop === null) {
|
| 2038 |
last.stop = HUNDRED_PERCENT;
|
| 2039 |
}
|
| 2040 |
var processStops = [];
|
| 2041 |
var previous = 0;
|
| 2042 |
for (var i = 0; i < stops.length; i++) {
|
| 2043 |
var stop_1 = stops[i].stop;
|
| 2044 |
if (stop_1 !== null) {
|
| 2045 |
var absoluteValue = getAbsoluteValue(stop_1, lineLength);
|
| 2046 |
if (absoluteValue > previous) {
|
| 2047 |
processStops.push(absoluteValue);
|
| 2048 |
}
|
| 2049 |
else {
|
| 2050 |
processStops.push(previous);
|
| 2051 |
}
|
| 2052 |
previous = absoluteValue;
|
| 2053 |
}
|
| 2054 |
else {
|
| 2055 |
processStops.push(null);
|
| 2056 |
}
|
| 2057 |
}
|
| 2058 |
var gapBegin = null;
|
| 2059 |
for (var i = 0; i < processStops.length; i++) {
|
| 2060 |
var stop_2 = processStops[i];
|
| 2061 |
if (stop_2 === null) {
|
| 2062 |
if (gapBegin === null) {
|
| 2063 |
gapBegin = i;
|
| 2064 |
}
|
| 2065 |
}
|
| 2066 |
else if (gapBegin !== null) {
|
| 2067 |
var gapLength = i - gapBegin;
|
| 2068 |
var beforeGap = processStops[gapBegin - 1];
|
| 2069 |
var gapValue = (stop_2 - beforeGap) / (gapLength + 1);
|
| 2070 |
for (var g = 1; g <= gapLength; g++) {
|
| 2071 |
processStops[gapBegin + g - 1] = gapValue * g;
|
| 2072 |
}
|
| 2073 |
gapBegin = null;
|
| 2074 |
}
|
| 2075 |
}
|
| 2076 |
return stops.map(function (_a, i) {
|
| 2077 |
var color = _a.color;
|
| 2078 |
return { color: color, stop: Math.max(Math.min(1, processStops[i] / lineLength), 0) };
|
| 2079 |
});
|
| 2080 |
};
|
| 2081 |
var getAngleFromCorner = function (corner, width, height) {
|
| 2082 |
var centerX = width / 2;
|
| 2083 |
var centerY = height / 2;
|
| 2084 |
var x = getAbsoluteValue(corner[0], width) - centerX;
|
| 2085 |
var y = centerY - getAbsoluteValue(corner[1], height);
|
| 2086 |
return (Math.atan2(y, x) + Math.PI * 2) % (Math.PI * 2);
|
| 2087 |
};
|
| 2088 |
var calculateGradientDirection = function (angle, width, height) {
|
| 2089 |
var radian = typeof angle === 'number' ? angle : getAngleFromCorner(angle, width, height);
|
| 2090 |
var lineLength = Math.abs(width * Math.sin(radian)) + Math.abs(height * Math.cos(radian));
|
| 2091 |
var halfWidth = width / 2;
|
| 2092 |
var halfHeight = height / 2;
|
| 2093 |
var halfLineLength = lineLength / 2;
|
| 2094 |
var yDiff = Math.sin(radian - Math.PI / 2) * halfLineLength;
|
| 2095 |
var xDiff = Math.cos(radian - Math.PI / 2) * halfLineLength;
|
| 2096 |
return [lineLength, halfWidth - xDiff, halfWidth + xDiff, halfHeight - yDiff, halfHeight + yDiff];
|
| 2097 |
};
|
| 2098 |
var distance = function (a, b) { return Math.sqrt(a * a + b * b); };
|
| 2099 |
var findCorner = function (width, height, x, y, closest) {
|
| 2100 |
var corners = [
|
| 2101 |
[0, 0],
|
| 2102 |
[0, height],
|
| 2103 |
[width, 0],
|
| 2104 |
[width, height]
|
| 2105 |
];
|
| 2106 |
return corners.reduce(function (stat, corner) {
|
| 2107 |
var cx = corner[0], cy = corner[1];
|
| 2108 |
var d = distance(x - cx, y - cy);
|
| 2109 |
if (closest ? d < stat.optimumDistance : d > stat.optimumDistance) {
|
| 2110 |
return {
|
| 2111 |
optimumCorner: corner,
|
| 2112 |
optimumDistance: d
|
| 2113 |
};
|
| 2114 |
}
|
| 2115 |
return stat;
|
| 2116 |
}, {
|
| 2117 |
optimumDistance: closest ? Infinity : -Infinity,
|
| 2118 |
optimumCorner: null
|
| 2119 |
}).optimumCorner;
|
| 2120 |
};
|
| 2121 |
var calculateRadius = function (gradient, x, y, width, height) {
|
| 2122 |
var rx = 0;
|
| 2123 |
var ry = 0;
|
| 2124 |
switch (gradient.size) {
|
| 2125 |
case 0 /* CLOSEST_SIDE */:
|
| 2126 |
// The ending shape is sized so that that it exactly meets the side of the gradient box closest to the gradient’s center.
|
| 2127 |
// If the shape is an ellipse, it exactly meets the closest side in each dimension.
|
| 2128 |
if (gradient.shape === 0 /* CIRCLE */) {
|
| 2129 |
rx = ry = Math.min(Math.abs(x), Math.abs(x - width), Math.abs(y), Math.abs(y - height));
|
| 2130 |
}
|
| 2131 |
else if (gradient.shape === 1 /* ELLIPSE */) {
|
| 2132 |
rx = Math.min(Math.abs(x), Math.abs(x - width));
|
| 2133 |
ry = Math.min(Math.abs(y), Math.abs(y - height));
|
| 2134 |
}
|
| 2135 |
break;
|
| 2136 |
case 2 /* CLOSEST_CORNER */:
|
| 2137 |
// The ending shape is sized so that that it passes through the corner of the gradient box closest to the gradient’s center.
|
| 2138 |
// If the shape is an ellipse, the ending shape is given the same aspect-ratio it would have if closest-side were specified.
|
| 2139 |
if (gradient.shape === 0 /* CIRCLE */) {
|
| 2140 |
rx = ry = Math.min(distance(x, y), distance(x, y - height), distance(x - width, y), distance(x - width, y - height));
|
| 2141 |
}
|
| 2142 |
else if (gradient.shape === 1 /* ELLIPSE */) {
|
| 2143 |
// Compute the ratio ry/rx (which is to be the same as for "closest-side")
|
| 2144 |
var c = Math.min(Math.abs(y), Math.abs(y - height)) / Math.min(Math.abs(x), Math.abs(x - width));
|
| 2145 |
var _a = findCorner(width, height, x, y, true), cx = _a[0], cy = _a[1];
|
| 2146 |
rx = distance(cx - x, (cy - y) / c);
|
| 2147 |
ry = c * rx;
|
| 2148 |
}
|
| 2149 |
break;
|
| 2150 |
case 1 /* FARTHEST_SIDE */:
|
| 2151 |
// Same as closest-side, except the ending shape is sized based on the farthest side(s)
|
| 2152 |
if (gradient.shape === 0 /* CIRCLE */) {
|
| 2153 |
rx = ry = Math.max(Math.abs(x), Math.abs(x - width), Math.abs(y), Math.abs(y - height));
|
| 2154 |
}
|
| 2155 |
else if (gradient.shape === 1 /* ELLIPSE */) {
|
| 2156 |
rx = Math.max(Math.abs(x), Math.abs(x - width));
|
| 2157 |
ry = Math.max(Math.abs(y), Math.abs(y - height));
|
| 2158 |
}
|
| 2159 |
break;
|
| 2160 |
case 3 /* FARTHEST_CORNER */:
|
| 2161 |
// Same as closest-corner, except the ending shape is sized based on the farthest corner.
|
| 2162 |
// If the shape is an ellipse, the ending shape is given the same aspect ratio it would have if farthest-side were specified.
|
| 2163 |
if (gradient.shape === 0 /* CIRCLE */) {
|
| 2164 |
rx = ry = Math.max(distance(x, y), distance(x, y - height), distance(x - width, y), distance(x - width, y - height));
|
| 2165 |
}
|
| 2166 |
else if (gradient.shape === 1 /* ELLIPSE */) {
|
| 2167 |
// Compute the ratio ry/rx (which is to be the same as for "farthest-side")
|
| 2168 |
var c = Math.max(Math.abs(y), Math.abs(y - height)) / Math.max(Math.abs(x), Math.abs(x - width));
|
| 2169 |
var _b = findCorner(width, height, x, y, false), cx = _b[0], cy = _b[1];
|
| 2170 |
rx = distance(cx - x, (cy - y) / c);
|
| 2171 |
ry = c * rx;
|
| 2172 |
}
|
| 2173 |
break;
|
| 2174 |
}
|
| 2175 |
if (Array.isArray(gradient.size)) {
|
| 2176 |
rx = getAbsoluteValue(gradient.size[0], width);
|
| 2177 |
ry = gradient.size.length === 2 ? getAbsoluteValue(gradient.size[1], height) : rx;
|
| 2178 |
}
|
| 2179 |
return [rx, ry];
|
| 2180 |
};
|
| 2181 |
|
| 2182 |
var linearGradient = function (context, tokens) {
|
| 2183 |
var angle$1 = deg(180);
|
| 2184 |
var stops = [];
|
| 2185 |
parseFunctionArgs(tokens).forEach(function (arg, i) {
|
| 2186 |
if (i === 0) {
|
| 2187 |
var firstToken = arg[0];
|
| 2188 |
if (firstToken.type === 20 /* IDENT_TOKEN */ && firstToken.value === 'to') {
|
| 2189 |
angle$1 = parseNamedSide(arg);
|
| 2190 |
return;
|
| 2191 |
}
|
| 2192 |
else if (isAngle(firstToken)) {
|
| 2193 |
angle$1 = angle.parse(context, firstToken);
|
| 2194 |
return;
|
| 2195 |
}
|
| 2196 |
}
|
| 2197 |
var colorStop = parseColorStop(context, arg);
|
| 2198 |
stops.push(colorStop);
|
| 2199 |
});
|
| 2200 |
return { angle: angle$1, stops: stops, type: 1 /* LINEAR_GRADIENT */ };
|
| 2201 |
};
|
| 2202 |
|
| 2203 |
var prefixLinearGradient = function (context, tokens) {
|
| 2204 |
var angle$1 = deg(180);
|
| 2205 |
var stops = [];
|
| 2206 |
parseFunctionArgs(tokens).forEach(function (arg, i) {
|
| 2207 |
if (i === 0) {
|
| 2208 |
var firstToken = arg[0];
|
| 2209 |
if (firstToken.type === 20 /* IDENT_TOKEN */ &&
|
| 2210 |
['top', 'left', 'right', 'bottom'].indexOf(firstToken.value) !== -1) {
|
| 2211 |
angle$1 = parseNamedSide(arg);
|
| 2212 |
return;
|
| 2213 |
}
|
| 2214 |
else if (isAngle(firstToken)) {
|
| 2215 |
angle$1 = (angle.parse(context, firstToken) + deg(270)) % deg(360);
|
| 2216 |
return;
|
| 2217 |
}
|
| 2218 |
}
|
| 2219 |
var colorStop = parseColorStop(context, arg);
|
| 2220 |
stops.push(colorStop);
|
| 2221 |
});
|
| 2222 |
return {
|
| 2223 |
angle: angle$1,
|
| 2224 |
stops: stops,
|
| 2225 |
type: 1 /* LINEAR_GRADIENT */
|
| 2226 |
};
|
| 2227 |
};
|
| 2228 |
|
| 2229 |
var webkitGradient = function (context, tokens) {
|
| 2230 |
var angle = deg(180);
|
| 2231 |
var stops = [];
|
| 2232 |
var type = 1 /* LINEAR_GRADIENT */;
|
| 2233 |
var shape = 0 /* CIRCLE */;
|
| 2234 |
var size = 3 /* FARTHEST_CORNER */;
|
| 2235 |
var position = [];
|
| 2236 |
parseFunctionArgs(tokens).forEach(function (arg, i) {
|
| 2237 |
var firstToken = arg[0];
|
| 2238 |
if (i === 0) {
|
| 2239 |
if (isIdentToken(firstToken) && firstToken.value === 'linear') {
|
| 2240 |
type = 1 /* LINEAR_GRADIENT */;
|
| 2241 |
return;
|
| 2242 |
}
|
| 2243 |
else if (isIdentToken(firstToken) && firstToken.value === 'radial') {
|
| 2244 |
type = 2 /* RADIAL_GRADIENT */;
|
| 2245 |
return;
|
| 2246 |
}
|
| 2247 |
}
|
| 2248 |
if (firstToken.type === 18 /* FUNCTION */) {
|
| 2249 |
if (firstToken.name === 'from') {
|
| 2250 |
var color = color$1.parse(context, firstToken.values[0]);
|
| 2251 |
stops.push({ stop: ZERO_LENGTH, color: color });
|
| 2252 |
}
|
| 2253 |
else if (firstToken.name === 'to') {
|
| 2254 |
var color = color$1.parse(context, firstToken.values[0]);
|
| 2255 |
stops.push({ stop: HUNDRED_PERCENT, color: color });
|
| 2256 |
}
|
| 2257 |
else if (firstToken.name === 'color-stop') {
|
| 2258 |
var values = firstToken.values.filter(nonFunctionArgSeparator);
|
| 2259 |
if (values.length === 2) {
|
| 2260 |
var color = color$1.parse(context, values[1]);
|
| 2261 |
var stop_1 = values[0];
|
| 2262 |
if (isNumberToken(stop_1)) {
|
| 2263 |
stops.push({
|
| 2264 |
stop: { type: 16 /* PERCENTAGE_TOKEN */, number: stop_1.number * 100, flags: stop_1.flags },
|
| 2265 |
color: color
|
| 2266 |
});
|
| 2267 |
}
|
| 2268 |
}
|
| 2269 |
}
|
| 2270 |
}
|
| 2271 |
});
|
| 2272 |
return type === 1 /* LINEAR_GRADIENT */
|
| 2273 |
? {
|
| 2274 |
angle: (angle + deg(180)) % deg(360),
|
| 2275 |
stops: stops,
|
| 2276 |
type: type
|
| 2277 |
}
|
| 2278 |
: { size: size, shape: shape, stops: stops, position: position, type: type };
|
| 2279 |
};
|
| 2280 |
|
| 2281 |
var CLOSEST_SIDE = 'closest-side';
|
| 2282 |
var FARTHEST_SIDE = 'farthest-side';
|
| 2283 |
var CLOSEST_CORNER = 'closest-corner';
|
| 2284 |
var FARTHEST_CORNER = 'farthest-corner';
|
| 2285 |
var CIRCLE = 'circle';
|
| 2286 |
var ELLIPSE = 'ellipse';
|
| 2287 |
var COVER = 'cover';
|
| 2288 |
var CONTAIN = 'contain';
|
| 2289 |
var radialGradient = function (context, tokens) {
|
| 2290 |
var shape = 0 /* CIRCLE */;
|
| 2291 |
var size = 3 /* FARTHEST_CORNER */;
|
| 2292 |
var stops = [];
|
| 2293 |
var position = [];
|
| 2294 |
parseFunctionArgs(tokens).forEach(function (arg, i) {
|
| 2295 |
var isColorStop = true;
|
| 2296 |
if (i === 0) {
|
| 2297 |
var isAtPosition_1 = false;
|
| 2298 |
isColorStop = arg.reduce(function (acc, token) {
|
| 2299 |
if (isAtPosition_1) {
|
| 2300 |
if (isIdentToken(token)) {
|
| 2301 |
switch (token.value) {
|
| 2302 |
case 'center':
|
| 2303 |
position.push(FIFTY_PERCENT);
|
| 2304 |
return acc;
|
| 2305 |
case 'top':
|
| 2306 |
case 'left':
|
| 2307 |
position.push(ZERO_LENGTH);
|
| 2308 |
return acc;
|
| 2309 |
case 'right':
|
| 2310 |
case 'bottom':
|
| 2311 |
position.push(HUNDRED_PERCENT);
|
| 2312 |
return acc;
|
| 2313 |
}
|
| 2314 |
}
|
| 2315 |
else if (isLengthPercentage(token) || isLength(token)) {
|
| 2316 |
position.push(token);
|
| 2317 |
}
|
| 2318 |
}
|
| 2319 |
else if (isIdentToken(token)) {
|
| 2320 |
switch (token.value) {
|
| 2321 |
case CIRCLE:
|
| 2322 |
shape = 0 /* CIRCLE */;
|
| 2323 |
return false;
|
| 2324 |
case ELLIPSE:
|
| 2325 |
shape = 1 /* ELLIPSE */;
|
| 2326 |
return false;
|
| 2327 |
case 'at':
|
| 2328 |
isAtPosition_1 = true;
|
| 2329 |
return false;
|
| 2330 |
case CLOSEST_SIDE:
|
| 2331 |
size = 0 /* CLOSEST_SIDE */;
|
| 2332 |
return false;
|
| 2333 |
case COVER:
|
| 2334 |
case FARTHEST_SIDE:
|
| 2335 |
size = 1 /* FARTHEST_SIDE */;
|
| 2336 |
return false;
|
| 2337 |
case CONTAIN:
|
| 2338 |
case CLOSEST_CORNER:
|
| 2339 |
size = 2 /* CLOSEST_CORNER */;
|
| 2340 |
return false;
|
| 2341 |
case FARTHEST_CORNER:
|
| 2342 |
size = 3 /* FARTHEST_CORNER */;
|
| 2343 |
return false;
|
| 2344 |
}
|
| 2345 |
}
|
| 2346 |
else if (isLength(token) || isLengthPercentage(token)) {
|
| 2347 |
if (!Array.isArray(size)) {
|
| 2348 |
size = [];
|
| 2349 |
}
|
| 2350 |
size.push(token);
|
| 2351 |
return false;
|
| 2352 |
}
|
| 2353 |
return acc;
|
| 2354 |
}, isColorStop);
|
| 2355 |
}
|
| 2356 |
if (isColorStop) {
|
| 2357 |
var colorStop = parseColorStop(context, arg);
|
| 2358 |
stops.push(colorStop);
|
| 2359 |
}
|
| 2360 |
});
|
| 2361 |
return { size: size, shape: shape, stops: stops, position: position, type: 2 /* RADIAL_GRADIENT */ };
|
| 2362 |
};
|
| 2363 |
|
| 2364 |
var prefixRadialGradient = function (context, tokens) {
|
| 2365 |
var shape = 0 /* CIRCLE */;
|
| 2366 |
var size = 3 /* FARTHEST_CORNER */;
|
| 2367 |
var stops = [];
|
| 2368 |
var position = [];
|
| 2369 |
parseFunctionArgs(tokens).forEach(function (arg, i) {
|
| 2370 |
var isColorStop = true;
|
| 2371 |
if (i === 0) {
|
| 2372 |
isColorStop = arg.reduce(function (acc, token) {
|
| 2373 |
if (isIdentToken(token)) {
|
| 2374 |
switch (token.value) {
|
| 2375 |
case 'center':
|
| 2376 |
position.push(FIFTY_PERCENT);
|
| 2377 |
return false;
|
| 2378 |
case 'top':
|
| 2379 |
case 'left':
|
| 2380 |
position.push(ZERO_LENGTH);
|
| 2381 |
return false;
|
| 2382 |
case 'right':
|
| 2383 |
case 'bottom':
|
| 2384 |
position.push(HUNDRED_PERCENT);
|
| 2385 |
return false;
|
| 2386 |
}
|
| 2387 |
}
|
| 2388 |
else if (isLengthPercentage(token) || isLength(token)) {
|
| 2389 |
position.push(token);
|
| 2390 |
return false;
|
| 2391 |
}
|
| 2392 |
return acc;
|
| 2393 |
}, isColorStop);
|
| 2394 |
}
|
| 2395 |
else if (i === 1) {
|
| 2396 |
isColorStop = arg.reduce(function (acc, token) {
|
| 2397 |
if (isIdentToken(token)) {
|
| 2398 |
switch (token.value) {
|
| 2399 |
case CIRCLE:
|
| 2400 |
shape = 0 /* CIRCLE */;
|
| 2401 |
return false;
|
| 2402 |
case ELLIPSE:
|
| 2403 |
shape = 1 /* ELLIPSE */;
|
| 2404 |
return false;
|
| 2405 |
case CONTAIN:
|
| 2406 |
case CLOSEST_SIDE:
|
| 2407 |
size = 0 /* CLOSEST_SIDE */;
|
| 2408 |
return false;
|
| 2409 |
case FARTHEST_SIDE:
|
| 2410 |
size = 1 /* FARTHEST_SIDE */;
|
| 2411 |
return false;
|
| 2412 |
case CLOSEST_CORNER:
|
| 2413 |
size = 2 /* CLOSEST_CORNER */;
|
| 2414 |
return false;
|
| 2415 |
case COVER:
|
| 2416 |
case FARTHEST_CORNER:
|
| 2417 |
size = 3 /* FARTHEST_CORNER */;
|
| 2418 |
return false;
|
| 2419 |
}
|
| 2420 |
}
|
| 2421 |
else if (isLength(token) || isLengthPercentage(token)) {
|
| 2422 |
if (!Array.isArray(size)) {
|
| 2423 |
size = [];
|
| 2424 |
}
|
| 2425 |
size.push(token);
|
| 2426 |
return false;
|
| 2427 |
}
|
| 2428 |
return acc;
|
| 2429 |
}, isColorStop);
|
| 2430 |
}
|
| 2431 |
if (isColorStop) {
|
| 2432 |
var colorStop = parseColorStop(context, arg);
|
| 2433 |
stops.push(colorStop);
|
| 2434 |
}
|
| 2435 |
});
|
| 2436 |
return { size: size, shape: shape, stops: stops, position: position, type: 2 /* RADIAL_GRADIENT */ };
|
| 2437 |
};
|
| 2438 |
|
| 2439 |
var isLinearGradient = function (background) {
|
| 2440 |
return background.type === 1 /* LINEAR_GRADIENT */;
|
| 2441 |
};
|
| 2442 |
var isRadialGradient = function (background) {
|
| 2443 |
return background.type === 2 /* RADIAL_GRADIENT */;
|
| 2444 |
};
|
| 2445 |
var image = {
|
| 2446 |
name: 'image',
|
| 2447 |
parse: function (context, value) {
|
| 2448 |
if (value.type === 22 /* URL_TOKEN */) {
|
| 2449 |
var image_1 = { url: value.value, type: 0 /* URL */ };
|
| 2450 |
context.cache.addImage(value.value);
|
| 2451 |
return image_1;
|
| 2452 |
}
|
| 2453 |
if (value.type === 18 /* FUNCTION */) {
|
| 2454 |
var imageFunction = SUPPORTED_IMAGE_FUNCTIONS[value.name];
|
| 2455 |
if (typeof imageFunction === 'undefined') {
|
| 2456 |
throw new Error("Attempting to parse an unsupported image function \"" + value.name + "\"");
|
| 2457 |
}
|
| 2458 |
return imageFunction(context, value.values);
|
| 2459 |
}
|
| 2460 |
throw new Error("Unsupported image type " + value.type);
|
| 2461 |
}
|
| 2462 |
};
|
| 2463 |
function isSupportedImage(value) {
|
| 2464 |
return (!(value.type === 20 /* IDENT_TOKEN */ && value.value === 'none') &&
|
| 2465 |
(value.type !== 18 /* FUNCTION */ || !!SUPPORTED_IMAGE_FUNCTIONS[value.name]));
|
| 2466 |
}
|
| 2467 |
var SUPPORTED_IMAGE_FUNCTIONS = {
|
| 2468 |
'linear-gradient': linearGradient,
|
| 2469 |
'-moz-linear-gradient': prefixLinearGradient,
|
| 2470 |
'-ms-linear-gradient': prefixLinearGradient,
|
| 2471 |
'-o-linear-gradient': prefixLinearGradient,
|
| 2472 |
'-webkit-linear-gradient': prefixLinearGradient,
|
| 2473 |
'radial-gradient': radialGradient,
|
| 2474 |
'-moz-radial-gradient': prefixRadialGradient,
|
| 2475 |
'-ms-radial-gradient': prefixRadialGradient,
|
| 2476 |
'-o-radial-gradient': prefixRadialGradient,
|
| 2477 |
'-webkit-radial-gradient': prefixRadialGradient,
|
| 2478 |
'-webkit-gradient': webkitGradient
|
| 2479 |
};
|
| 2480 |
|
| 2481 |
var backgroundImage = {
|
| 2482 |
name: 'background-image',
|
| 2483 |
initialValue: 'none',
|
| 2484 |
type: 1 /* LIST */,
|
| 2485 |
prefix: false,
|
| 2486 |
parse: function (context, tokens) {
|
| 2487 |
if (tokens.length === 0) {
|
| 2488 |
return [];
|
| 2489 |
}
|
| 2490 |
var first = tokens[0];
|
| 2491 |
if (first.type === 20 /* IDENT_TOKEN */ && first.value === 'none') {
|
| 2492 |
return [];
|
| 2493 |
}
|
| 2494 |
return tokens
|
| 2495 |
.filter(function (value) { return nonFunctionArgSeparator(value) && isSupportedImage(value); })
|
| 2496 |
.map(function (value) { return image.parse(context, value); });
|
| 2497 |
}
|
| 2498 |
};
|
| 2499 |
|
| 2500 |
var backgroundOrigin = {
|
| 2501 |
name: 'background-origin',
|
| 2502 |
initialValue: 'border-box',
|
| 2503 |
prefix: false,
|
| 2504 |
type: 1 /* LIST */,
|
| 2505 |
parse: function (_context, tokens) {
|
| 2506 |
return tokens.map(function (token) {
|
| 2507 |
if (isIdentToken(token)) {
|
| 2508 |
switch (token.value) {
|
| 2509 |
case 'padding-box':
|
| 2510 |
return 1 /* PADDING_BOX */;
|
| 2511 |
case 'content-box':
|
| 2512 |
return 2 /* CONTENT_BOX */;
|
| 2513 |
}
|
| 2514 |
}
|
| 2515 |
return 0 /* BORDER_BOX */;
|
| 2516 |
});
|
| 2517 |
}
|
| 2518 |
};
|
| 2519 |
|
| 2520 |
var backgroundPosition = {
|
| 2521 |
name: 'background-position',
|
| 2522 |
initialValue: '0% 0%',
|
| 2523 |
type: 1 /* LIST */,
|
| 2524 |
prefix: false,
|
| 2525 |
parse: function (_context, tokens) {
|
| 2526 |
return parseFunctionArgs(tokens)
|
| 2527 |
.map(function (values) { return values.filter(isLengthPercentage); })
|
| 2528 |
.map(parseLengthPercentageTuple);
|
| 2529 |
}
|
| 2530 |
};
|
| 2531 |
|
| 2532 |
var backgroundRepeat = {
|
| 2533 |
name: 'background-repeat',
|
| 2534 |
initialValue: 'repeat',
|
| 2535 |
prefix: false,
|
| 2536 |
type: 1 /* LIST */,
|
| 2537 |
parse: function (_context, tokens) {
|
| 2538 |
return parseFunctionArgs(tokens)
|
| 2539 |
.map(function (values) {
|
| 2540 |
return values
|
| 2541 |
.filter(isIdentToken)
|
| 2542 |
.map(function (token) { return token.value; })
|
| 2543 |
.join(' ');
|
| 2544 |
})
|
| 2545 |
.map(parseBackgroundRepeat);
|
| 2546 |
}
|
| 2547 |
};
|
| 2548 |
var parseBackgroundRepeat = function (value) {
|
| 2549 |
switch (value) {
|
| 2550 |
case 'no-repeat':
|
| 2551 |
return 1 /* NO_REPEAT */;
|
| 2552 |
case 'repeat-x':
|
| 2553 |
case 'repeat no-repeat':
|
| 2554 |
return 2 /* REPEAT_X */;
|
| 2555 |
case 'repeat-y':
|
| 2556 |
case 'no-repeat repeat':
|
| 2557 |
return 3 /* REPEAT_Y */;
|
| 2558 |
case 'repeat':
|
| 2559 |
default:
|
| 2560 |
return 0 /* REPEAT */;
|
| 2561 |
}
|
| 2562 |
};
|
| 2563 |
|
| 2564 |
var BACKGROUND_SIZE;
|
| 2565 |
(function (BACKGROUND_SIZE) {
|
| 2566 |
BACKGROUND_SIZE["AUTO"] = "auto";
|
| 2567 |
BACKGROUND_SIZE["CONTAIN"] = "contain";
|
| 2568 |
BACKGROUND_SIZE["COVER"] = "cover";
|
| 2569 |
})(BACKGROUND_SIZE || (BACKGROUND_SIZE = {}));
|
| 2570 |
var backgroundSize = {
|
| 2571 |
name: 'background-size',
|
| 2572 |
initialValue: '0',
|
| 2573 |
prefix: false,
|
| 2574 |
type: 1 /* LIST */,
|
| 2575 |
parse: function (_context, tokens) {
|
| 2576 |
return parseFunctionArgs(tokens).map(function (values) { return values.filter(isBackgroundSizeInfoToken); });
|
| 2577 |
}
|
| 2578 |
};
|
| 2579 |
var isBackgroundSizeInfoToken = function (value) {
|
| 2580 |
return isIdentToken(value) || isLengthPercentage(value);
|
| 2581 |
};
|
| 2582 |
|
| 2583 |
var borderColorForSide = function (side) { return ({
|
| 2584 |
name: "border-" + side + "-color",
|
| 2585 |
initialValue: 'transparent',
|
| 2586 |
prefix: false,
|
| 2587 |
type: 3 /* TYPE_VALUE */,
|
| 2588 |
format: 'color'
|
| 2589 |
}); };
|
| 2590 |
var borderTopColor = borderColorForSide('top');
|
| 2591 |
var borderRightColor = borderColorForSide('right');
|
| 2592 |
var borderBottomColor = borderColorForSide('bottom');
|
| 2593 |
var borderLeftColor = borderColorForSide('left');
|
| 2594 |
|
| 2595 |
var borderRadiusForSide = function (side) { return ({
|
| 2596 |
name: "border-radius-" + side,
|
| 2597 |
initialValue: '0 0',
|
| 2598 |
prefix: false,
|
| 2599 |
type: 1 /* LIST */,
|
| 2600 |
parse: function (_context, tokens) {
|
| 2601 |
return parseLengthPercentageTuple(tokens.filter(isLengthPercentage));
|
| 2602 |
}
|
| 2603 |
}); };
|
| 2604 |
var borderTopLeftRadius = borderRadiusForSide('top-left');
|
| 2605 |
var borderTopRightRadius = borderRadiusForSide('top-right');
|
| 2606 |
var borderBottomRightRadius = borderRadiusForSide('bottom-right');
|
| 2607 |
var borderBottomLeftRadius = borderRadiusForSide('bottom-left');
|
| 2608 |
|
| 2609 |
var borderStyleForSide = function (side) { return ({
|
| 2610 |
name: "border-" + side + "-style",
|
| 2611 |
initialValue: 'solid',
|
| 2612 |
prefix: false,
|
| 2613 |
type: 2 /* IDENT_VALUE */,
|
| 2614 |
parse: function (_context, style) {
|
| 2615 |
switch (style) {
|
| 2616 |
case 'none':
|
| 2617 |
return 0 /* NONE */;
|
| 2618 |
case 'dashed':
|
| 2619 |
return 2 /* DASHED */;
|
| 2620 |
case 'dotted':
|
| 2621 |
return 3 /* DOTTED */;
|
| 2622 |
case 'double':
|
| 2623 |
return 4 /* DOUBLE */;
|
| 2624 |
}
|
| 2625 |
return 1 /* SOLID */;
|
| 2626 |
}
|
| 2627 |
}); };
|
| 2628 |
var borderTopStyle = borderStyleForSide('top');
|
| 2629 |
var borderRightStyle = borderStyleForSide('right');
|
| 2630 |
var borderBottomStyle = borderStyleForSide('bottom');
|
| 2631 |
var borderLeftStyle = borderStyleForSide('left');
|
| 2632 |
|
| 2633 |
var borderWidthForSide = function (side) { return ({
|
| 2634 |
name: "border-" + side + "-width",
|
| 2635 |
initialValue: '0',
|
| 2636 |
type: 0 /* VALUE */,
|
| 2637 |
prefix: false,
|
| 2638 |
parse: function (_context, token) {
|
| 2639 |
if (isDimensionToken(token)) {
|
| 2640 |
return token.number;
|
| 2641 |
}
|
| 2642 |
return 0;
|
| 2643 |
}
|
| 2644 |
}); };
|
| 2645 |
var borderTopWidth = borderWidthForSide('top');
|
| 2646 |
var borderRightWidth = borderWidthForSide('right');
|
| 2647 |
var borderBottomWidth = borderWidthForSide('bottom');
|
| 2648 |
var borderLeftWidth = borderWidthForSide('left');
|
| 2649 |
|
| 2650 |
var color = {
|
| 2651 |
name: "color",
|
| 2652 |
initialValue: 'transparent',
|
| 2653 |
prefix: false,
|
| 2654 |
type: 3 /* TYPE_VALUE */,
|
| 2655 |
format: 'color'
|
| 2656 |
};
|
| 2657 |
|
| 2658 |
var direction = {
|
| 2659 |
name: 'direction',
|
| 2660 |
initialValue: 'ltr',
|
| 2661 |
prefix: false,
|
| 2662 |
type: 2 /* IDENT_VALUE */,
|
| 2663 |
parse: function (_context, direction) {
|
| 2664 |
switch (direction) {
|
| 2665 |
case 'rtl':
|
| 2666 |
return 1 /* RTL */;
|
| 2667 |
case 'ltr':
|
| 2668 |
default:
|
| 2669 |
return 0 /* LTR */;
|
| 2670 |
}
|
| 2671 |
}
|
| 2672 |
};
|
| 2673 |
|
| 2674 |
var display = {
|
| 2675 |
name: 'display',
|
| 2676 |
initialValue: 'inline-block',
|
| 2677 |
prefix: false,
|
| 2678 |
type: 1 /* LIST */,
|
| 2679 |
parse: function (_context, tokens) {
|
| 2680 |
return tokens.filter(isIdentToken).reduce(function (bit, token) {
|
| 2681 |
return bit | parseDisplayValue(token.value);
|
| 2682 |
}, 0 /* NONE */);
|
| 2683 |
}
|
| 2684 |
};
|
| 2685 |
var parseDisplayValue = function (display) {
|
| 2686 |
switch (display) {
|
| 2687 |
case 'block':
|
| 2688 |
case '-webkit-box':
|
| 2689 |
return 2 /* BLOCK */;
|
| 2690 |
case 'inline':
|
| 2691 |
return 4 /* INLINE */;
|
| 2692 |
case 'run-in':
|
| 2693 |
return 8 /* RUN_IN */;
|
| 2694 |
case 'flow':
|
| 2695 |
return 16 /* FLOW */;
|
| 2696 |
case 'flow-root':
|
| 2697 |
return 32 /* FLOW_ROOT */;
|
| 2698 |
case 'table':
|
| 2699 |
return 64 /* TABLE */;
|
| 2700 |
case 'flex':
|
| 2701 |
case '-webkit-flex':
|
| 2702 |
return 128 /* FLEX */;
|
| 2703 |
case 'grid':
|
| 2704 |
case '-ms-grid':
|
| 2705 |
return 256 /* GRID */;
|
| 2706 |
case 'ruby':
|
| 2707 |
return 512 /* RUBY */;
|
| 2708 |
case 'subgrid':
|
| 2709 |
return 1024 /* SUBGRID */;
|
| 2710 |
case 'list-item':
|
| 2711 |
return 2048 /* LIST_ITEM */;
|
| 2712 |
case 'table-row-group':
|
| 2713 |
return 4096 /* TABLE_ROW_GROUP */;
|
| 2714 |
case 'table-header-group':
|
| 2715 |
return 8192 /* TABLE_HEADER_GROUP */;
|
| 2716 |
case 'table-footer-group':
|
| 2717 |
return 16384 /* TABLE_FOOTER_GROUP */;
|
| 2718 |
case 'table-row':
|
| 2719 |
return 32768 /* TABLE_ROW */;
|
| 2720 |
case 'table-cell':
|
| 2721 |
return 65536 /* TABLE_CELL */;
|
| 2722 |
case 'table-column-group':
|
| 2723 |
return 131072 /* TABLE_COLUMN_GROUP */;
|
| 2724 |
case 'table-column':
|
| 2725 |
return 262144 /* TABLE_COLUMN */;
|
| 2726 |
case 'table-caption':
|
| 2727 |
return 524288 /* TABLE_CAPTION */;
|
| 2728 |
case 'ruby-base':
|
| 2729 |
return 1048576 /* RUBY_BASE */;
|
| 2730 |
case 'ruby-text':
|
| 2731 |
return 2097152 /* RUBY_TEXT */;
|
| 2732 |
case 'ruby-base-container':
|
| 2733 |
return 4194304 /* RUBY_BASE_CONTAINER */;
|
| 2734 |
case 'ruby-text-container':
|
| 2735 |
return 8388608 /* RUBY_TEXT_CONTAINER */;
|
| 2736 |
case 'contents':
|
| 2737 |
return 16777216 /* CONTENTS */;
|
| 2738 |
case 'inline-block':
|
| 2739 |
return 33554432 /* INLINE_BLOCK */;
|
| 2740 |
case 'inline-list-item':
|
| 2741 |
return 67108864 /* INLINE_LIST_ITEM */;
|
| 2742 |
case 'inline-table':
|
| 2743 |
return 134217728 /* INLINE_TABLE */;
|
| 2744 |
case 'inline-flex':
|
| 2745 |
return 268435456 /* INLINE_FLEX */;
|
| 2746 |
case 'inline-grid':
|
| 2747 |
return 536870912 /* INLINE_GRID */;
|
| 2748 |
}
|
| 2749 |
return 0 /* NONE */;
|
| 2750 |
};
|
| 2751 |
|
| 2752 |
var float = {
|
| 2753 |
name: 'float',
|
| 2754 |
initialValue: 'none',
|
| 2755 |
prefix: false,
|
| 2756 |
type: 2 /* IDENT_VALUE */,
|
| 2757 |
parse: function (_context, float) {
|
| 2758 |
switch (float) {
|
| 2759 |
case 'left':
|
| 2760 |
return 1 /* LEFT */;
|
| 2761 |
case 'right':
|
| 2762 |
return 2 /* RIGHT */;
|
| 2763 |
case 'inline-start':
|
| 2764 |
return 3 /* INLINE_START */;
|
| 2765 |
case 'inline-end':
|
| 2766 |
return 4 /* INLINE_END */;
|
| 2767 |
}
|
| 2768 |
return 0 /* NONE */;
|
| 2769 |
}
|
| 2770 |
};
|
| 2771 |
|
| 2772 |
var letterSpacing = {
|
| 2773 |
name: 'letter-spacing',
|
| 2774 |
initialValue: '0',
|
| 2775 |
prefix: false,
|
| 2776 |
type: 0 /* VALUE */,
|
| 2777 |
parse: function (_context, token) {
|
| 2778 |
if (token.type === 20 /* IDENT_TOKEN */ && token.value === 'normal') {
|
| 2779 |
return 0;
|
| 2780 |
}
|
| 2781 |
if (token.type === 17 /* NUMBER_TOKEN */) {
|
| 2782 |
return token.number;
|
| 2783 |
}
|
| 2784 |
if (token.type === 15 /* DIMENSION_TOKEN */) {
|
| 2785 |
return token.number;
|
| 2786 |
}
|
| 2787 |
return 0;
|
| 2788 |
}
|
| 2789 |
};
|
| 2790 |
|
| 2791 |
var LINE_BREAK;
|
| 2792 |
(function (LINE_BREAK) {
|
| 2793 |
LINE_BREAK["NORMAL"] = "normal";
|
| 2794 |
LINE_BREAK["STRICT"] = "strict";
|
| 2795 |
})(LINE_BREAK || (LINE_BREAK = {}));
|
| 2796 |
var lineBreak = {
|
| 2797 |
name: 'line-break',
|
| 2798 |
initialValue: 'normal',
|
| 2799 |
prefix: false,
|
| 2800 |
type: 2 /* IDENT_VALUE */,
|
| 2801 |
parse: function (_context, lineBreak) {
|
| 2802 |
switch (lineBreak) {
|
| 2803 |
case 'strict':
|
| 2804 |
return LINE_BREAK.STRICT;
|
| 2805 |
case 'normal':
|
| 2806 |
default:
|
| 2807 |
return LINE_BREAK.NORMAL;
|
| 2808 |
}
|
| 2809 |
}
|
| 2810 |
};
|
| 2811 |
|
| 2812 |
var lineHeight = {
|
| 2813 |
name: 'line-height',
|
| 2814 |
initialValue: 'normal',
|
| 2815 |
prefix: false,
|
| 2816 |
type: 4 /* TOKEN_VALUE */
|
| 2817 |
};
|
| 2818 |
var computeLineHeight = function (token, fontSize) {
|
| 2819 |
if (isIdentToken(token) && token.value === 'normal') {
|
| 2820 |
return 1.2 * fontSize;
|
| 2821 |
}
|
| 2822 |
else if (token.type === 17 /* NUMBER_TOKEN */) {
|
| 2823 |
return fontSize * token.number;
|
| 2824 |
}
|
| 2825 |
else if (isLengthPercentage(token)) {
|
| 2826 |
return getAbsoluteValue(token, fontSize);
|
| 2827 |
}
|
| 2828 |
return fontSize;
|
| 2829 |
};
|
| 2830 |
|
| 2831 |
var listStyleImage = {
|
| 2832 |
name: 'list-style-image',
|
| 2833 |
initialValue: 'none',
|
| 2834 |
type: 0 /* VALUE */,
|
| 2835 |
prefix: false,
|
| 2836 |
parse: function (context, token) {
|
| 2837 |
if (token.type === 20 /* IDENT_TOKEN */ && token.value === 'none') {
|
| 2838 |
return null;
|
| 2839 |
}
|
| 2840 |
return image.parse(context, token);
|
| 2841 |
}
|
| 2842 |
};
|
| 2843 |
|
| 2844 |
var listStylePosition = {
|
| 2845 |
name: 'list-style-position',
|
| 2846 |
initialValue: 'outside',
|
| 2847 |
prefix: false,
|
| 2848 |
type: 2 /* IDENT_VALUE */,
|
| 2849 |
parse: function (_context, position) {
|
| 2850 |
switch (position) {
|
| 2851 |
case 'inside':
|
| 2852 |
return 0 /* INSIDE */;
|
| 2853 |
case 'outside':
|
| 2854 |
default:
|
| 2855 |
return 1 /* OUTSIDE */;
|
| 2856 |
}
|
| 2857 |
}
|
| 2858 |
};
|
| 2859 |
|
| 2860 |
var listStyleType = {
|
| 2861 |
name: 'list-style-type',
|
| 2862 |
initialValue: 'none',
|
| 2863 |
prefix: false,
|
| 2864 |
type: 2 /* IDENT_VALUE */,
|
| 2865 |
parse: function (_context, type) {
|
| 2866 |
switch (type) {
|
| 2867 |
case 'disc':
|
| 2868 |
return 0 /* DISC */;
|
| 2869 |
case 'circle':
|
| 2870 |
return 1 /* CIRCLE */;
|
| 2871 |
case 'square':
|
| 2872 |
return 2 /* SQUARE */;
|
| 2873 |
case 'decimal':
|
| 2874 |
return 3 /* DECIMAL */;
|
| 2875 |
case 'cjk-decimal':
|
| 2876 |
return 4 /* CJK_DECIMAL */;
|
| 2877 |
case 'decimal-leading-zero':
|
| 2878 |
return 5 /* DECIMAL_LEADING_ZERO */;
|
| 2879 |
case 'lower-roman':
|
| 2880 |
return 6 /* LOWER_ROMAN */;
|
| 2881 |
case 'upper-roman':
|
| 2882 |
return 7 /* UPPER_ROMAN */;
|
| 2883 |
case 'lower-greek':
|
| 2884 |
return 8 /* LOWER_GREEK */;
|
| 2885 |
case 'lower-alpha':
|
| 2886 |
return 9 /* LOWER_ALPHA */;
|
| 2887 |
case 'upper-alpha':
|
| 2888 |
return 10 /* UPPER_ALPHA */;
|
| 2889 |
case 'arabic-indic':
|
| 2890 |
return 11 /* ARABIC_INDIC */;
|
| 2891 |
case 'armenian':
|
| 2892 |
return 12 /* ARMENIAN */;
|
| 2893 |
case 'bengali':
|
| 2894 |
return 13 /* BENGALI */;
|
| 2895 |
case 'cambodian':
|
| 2896 |
return 14 /* CAMBODIAN */;
|
| 2897 |
case 'cjk-earthly-branch':
|
| 2898 |
return 15 /* CJK_EARTHLY_BRANCH */;
|
| 2899 |
case 'cjk-heavenly-stem':
|
| 2900 |
return 16 /* CJK_HEAVENLY_STEM */;
|
| 2901 |
case 'cjk-ideographic':
|
| 2902 |
return 17 /* CJK_IDEOGRAPHIC */;
|
| 2903 |
case 'devanagari':
|
| 2904 |
return 18 /* DEVANAGARI */;
|
| 2905 |
case 'ethiopic-numeric':
|
| 2906 |
return 19 /* ETHIOPIC_NUMERIC */;
|
| 2907 |
case 'georgian':
|
| 2908 |
return 20 /* GEORGIAN */;
|
| 2909 |
case 'gujarati':
|
| 2910 |
return 21 /* GUJARATI */;
|
| 2911 |
case 'gurmukhi':
|
| 2912 |
return 22 /* GURMUKHI */;
|
| 2913 |
case 'hebrew':
|
| 2914 |
return 22 /* HEBREW */;
|
| 2915 |
case 'hiragana':
|
| 2916 |
return 23 /* HIRAGANA */;
|
| 2917 |
case 'hiragana-iroha':
|
| 2918 |
return 24 /* HIRAGANA_IROHA */;
|
| 2919 |
case 'japanese-formal':
|
| 2920 |
return 25 /* JAPANESE_FORMAL */;
|
| 2921 |
case 'japanese-informal':
|
| 2922 |
return 26 /* JAPANESE_INFORMAL */;
|
| 2923 |
case 'kannada':
|
| 2924 |
return 27 /* KANNADA */;
|
| 2925 |
case 'katakana':
|
| 2926 |
return 28 /* KATAKANA */;
|
| 2927 |
case 'katakana-iroha':
|
| 2928 |
return 29 /* KATAKANA_IROHA */;
|
| 2929 |
case 'khmer':
|
| 2930 |
return 30 /* KHMER */;
|
| 2931 |
case 'korean-hangul-formal':
|
| 2932 |
return 31 /* KOREAN_HANGUL_FORMAL */;
|
| 2933 |
case 'korean-hanja-formal':
|
| 2934 |
return 32 /* KOREAN_HANJA_FORMAL */;
|
| 2935 |
case 'korean-hanja-informal':
|
| 2936 |
return 33 /* KOREAN_HANJA_INFORMAL */;
|
| 2937 |
case 'lao':
|
| 2938 |
return 34 /* LAO */;
|
| 2939 |
case 'lower-armenian':
|
| 2940 |
return 35 /* LOWER_ARMENIAN */;
|
| 2941 |
case 'malayalam':
|
| 2942 |
return 36 /* MALAYALAM */;
|
| 2943 |
case 'mongolian':
|
| 2944 |
return 37 /* MONGOLIAN */;
|
| 2945 |
case 'myanmar':
|
| 2946 |
return 38 /* MYANMAR */;
|
| 2947 |
case 'oriya':
|
| 2948 |
return 39 /* ORIYA */;
|
| 2949 |
case 'persian':
|
| 2950 |
return 40 /* PERSIAN */;
|
| 2951 |
case 'simp-chinese-formal':
|
| 2952 |
return 41 /* SIMP_CHINESE_FORMAL */;
|
| 2953 |
case 'simp-chinese-informal':
|
| 2954 |
return 42 /* SIMP_CHINESE_INFORMAL */;
|
| 2955 |
case 'tamil':
|
| 2956 |
return 43 /* TAMIL */;
|
| 2957 |
case 'telugu':
|
| 2958 |
return 44 /* TELUGU */;
|
| 2959 |
case 'thai':
|
| 2960 |
return 45 /* THAI */;
|
| 2961 |
case 'tibetan':
|
| 2962 |
return 46 /* TIBETAN */;
|
| 2963 |
case 'trad-chinese-formal':
|
| 2964 |
return 47 /* TRAD_CHINESE_FORMAL */;
|
| 2965 |
case 'trad-chinese-informal':
|
| 2966 |
return 48 /* TRAD_CHINESE_INFORMAL */;
|
| 2967 |
case 'upper-armenian':
|
| 2968 |
return 49 /* UPPER_ARMENIAN */;
|
| 2969 |
case 'disclosure-open':
|
| 2970 |
return 50 /* DISCLOSURE_OPEN */;
|
| 2971 |
case 'disclosure-closed':
|
| 2972 |
return 51 /* DISCLOSURE_CLOSED */;
|
| 2973 |
case 'none':
|
| 2974 |
default:
|
| 2975 |
return -1 /* NONE */;
|
| 2976 |
}
|
| 2977 |
}
|
| 2978 |
};
|
| 2979 |
|
| 2980 |
var marginForSide = function (side) { return ({
|
| 2981 |
name: "margin-" + side,
|
| 2982 |
initialValue: '0',
|
| 2983 |
prefix: false,
|
| 2984 |
type: 4 /* TOKEN_VALUE */
|
| 2985 |
}); };
|
| 2986 |
var marginTop = marginForSide('top');
|
| 2987 |
var marginRight = marginForSide('right');
|
| 2988 |
var marginBottom = marginForSide('bottom');
|
| 2989 |
var marginLeft = marginForSide('left');
|
| 2990 |
|
| 2991 |
var overflow = {
|
| 2992 |
name: 'overflow',
|
| 2993 |
initialValue: 'visible',
|
| 2994 |
prefix: false,
|
| 2995 |
type: 1 /* LIST */,
|
| 2996 |
parse: function (_context, tokens) {
|
| 2997 |
return tokens.filter(isIdentToken).map(function (overflow) {
|
| 2998 |
switch (overflow.value) {
|
| 2999 |
case 'hidden':
|
| 3000 |
return 1 /* HIDDEN */;
|
| 3001 |
case 'scroll':
|
| 3002 |
return 2 /* SCROLL */;
|
| 3003 |
case 'clip':
|
| 3004 |
return 3 /* CLIP */;
|
| 3005 |
case 'auto':
|
| 3006 |
return 4 /* AUTO */;
|
| 3007 |
case 'visible':
|
| 3008 |
default:
|
| 3009 |
return 0 /* VISIBLE */;
|
| 3010 |
}
|
| 3011 |
});
|
| 3012 |
}
|
| 3013 |
};
|
| 3014 |
|
| 3015 |
var overflowWrap = {
|
| 3016 |
name: 'overflow-wrap',
|
| 3017 |
initialValue: 'normal',
|
| 3018 |
prefix: false,
|
| 3019 |
type: 2 /* IDENT_VALUE */,
|
| 3020 |
parse: function (_context, overflow) {
|
| 3021 |
switch (overflow) {
|
| 3022 |
case 'break-word':
|
| 3023 |
return "break-word" /* BREAK_WORD */;
|
| 3024 |
case 'normal':
|
| 3025 |
default:
|
| 3026 |
return "normal" /* NORMAL */;
|
| 3027 |
}
|
| 3028 |
}
|
| 3029 |
};
|
| 3030 |
|
| 3031 |
var paddingForSide = function (side) { return ({
|
| 3032 |
name: "padding-" + side,
|
| 3033 |
initialValue: '0',
|
| 3034 |
prefix: false,
|
| 3035 |
type: 3 /* TYPE_VALUE */,
|
| 3036 |
format: 'length-percentage'
|
| 3037 |
}); };
|
| 3038 |
var paddingTop = paddingForSide('top');
|
| 3039 |
var paddingRight = paddingForSide('right');
|
| 3040 |
var paddingBottom = paddingForSide('bottom');
|
| 3041 |
var paddingLeft = paddingForSide('left');
|
| 3042 |
|
| 3043 |
var textAlign = {
|
| 3044 |
name: 'text-align',
|
| 3045 |
initialValue: 'left',
|
| 3046 |
prefix: false,
|
| 3047 |
type: 2 /* IDENT_VALUE */,
|
| 3048 |
parse: function (_context, textAlign) {
|
| 3049 |
switch (textAlign) {
|
| 3050 |
case 'right':
|
| 3051 |
return 2 /* RIGHT */;
|
| 3052 |
case 'center':
|
| 3053 |
case 'justify':
|
| 3054 |
return 1 /* CENTER */;
|
| 3055 |
case 'left':
|
| 3056 |
default:
|
| 3057 |
return 0 /* LEFT */;
|
| 3058 |
}
|
| 3059 |
}
|
| 3060 |
};
|
| 3061 |
|
| 3062 |
var position = {
|
| 3063 |
name: 'position',
|
| 3064 |
initialValue: 'static',
|
| 3065 |
prefix: false,
|
| 3066 |
type: 2 /* IDENT_VALUE */,
|
| 3067 |
parse: function (_context, position) {
|
| 3068 |
switch (position) {
|
| 3069 |
case 'relative':
|
| 3070 |
return 1 /* RELATIVE */;
|
| 3071 |
case 'absolute':
|
| 3072 |
return 2 /* ABSOLUTE */;
|
| 3073 |
case 'fixed':
|
| 3074 |
return 3 /* FIXED */;
|
| 3075 |
case 'sticky':
|
| 3076 |
return 4 /* STICKY */;
|
| 3077 |
}
|
| 3078 |
return 0 /* STATIC */;
|
| 3079 |
}
|
| 3080 |
};
|
| 3081 |
|
| 3082 |
var textShadow = {
|
| 3083 |
name: 'text-shadow',
|
| 3084 |
initialValue: 'none',
|
| 3085 |
type: 1 /* LIST */,
|
| 3086 |
prefix: false,
|
| 3087 |
parse: function (context, tokens) {
|
| 3088 |
if (tokens.length === 1 && isIdentWithValue(tokens[0], 'none')) {
|
| 3089 |
return [];
|
| 3090 |
}
|
| 3091 |
return parseFunctionArgs(tokens).map(function (values) {
|
| 3092 |
var shadow = {
|
| 3093 |
color: COLORS.TRANSPARENT,
|
| 3094 |
offsetX: ZERO_LENGTH,
|
| 3095 |
offsetY: ZERO_LENGTH,
|
| 3096 |
blur: ZERO_LENGTH
|
| 3097 |
};
|
| 3098 |
var c = 0;
|
| 3099 |
for (var i = 0; i < values.length; i++) {
|
| 3100 |
var token = values[i];
|
| 3101 |
if (isLength(token)) {
|
| 3102 |
if (c === 0) {
|
| 3103 |
shadow.offsetX = token;
|
| 3104 |
}
|
| 3105 |
else if (c === 1) {
|
| 3106 |
shadow.offsetY = token;
|
| 3107 |
}
|
| 3108 |
else {
|
| 3109 |
shadow.blur = token;
|
| 3110 |
}
|
| 3111 |
c++;
|
| 3112 |
}
|
| 3113 |
else {
|
| 3114 |
shadow.color = color$1.parse(context, token);
|
| 3115 |
}
|
| 3116 |
}
|
| 3117 |
return shadow;
|
| 3118 |
});
|
| 3119 |
}
|
| 3120 |
};
|
| 3121 |
|
| 3122 |
var textTransform = {
|
| 3123 |
name: 'text-transform',
|
| 3124 |
initialValue: 'none',
|
| 3125 |
prefix: false,
|
| 3126 |
type: 2 /* IDENT_VALUE */,
|
| 3127 |
parse: function (_context, textTransform) {
|
| 3128 |
switch (textTransform) {
|
| 3129 |
case 'uppercase':
|
| 3130 |
return 2 /* UPPERCASE */;
|
| 3131 |
case 'lowercase':
|
| 3132 |
return 1 /* LOWERCASE */;
|
| 3133 |
case 'capitalize':
|
| 3134 |
return 3 /* CAPITALIZE */;
|
| 3135 |
}
|
| 3136 |
return 0 /* NONE */;
|
| 3137 |
}
|
| 3138 |
};
|
| 3139 |
|
| 3140 |
var transform$1 = {
|
| 3141 |
name: 'transform',
|
| 3142 |
initialValue: 'none',
|
| 3143 |
prefix: true,
|
| 3144 |
type: 0 /* VALUE */,
|
| 3145 |
parse: function (_context, token) {
|
| 3146 |
if (token.type === 20 /* IDENT_TOKEN */ && token.value === 'none') {
|
| 3147 |
return null;
|
| 3148 |
}
|
| 3149 |
if (token.type === 18 /* FUNCTION */) {
|
| 3150 |
var transformFunction = SUPPORTED_TRANSFORM_FUNCTIONS[token.name];
|
| 3151 |
if (typeof transformFunction === 'undefined') {
|
| 3152 |
throw new Error("Attempting to parse an unsupported transform function \"" + token.name + "\"");
|
| 3153 |
}
|
| 3154 |
return transformFunction(token.values);
|
| 3155 |
}
|
| 3156 |
return null;
|
| 3157 |
}
|
| 3158 |
};
|
| 3159 |
var matrix = function (args) {
|
| 3160 |
var values = args.filter(function (arg) { return arg.type === 17 /* NUMBER_TOKEN */; }).map(function (arg) { return arg.number; });
|
| 3161 |
return values.length === 6 ? values : null;
|
| 3162 |
};
|
| 3163 |
// doesn't support 3D transforms at the moment
|
| 3164 |
var matrix3d = function (args) {
|
| 3165 |
var values = args.filter(function (arg) { return arg.type === 17 /* NUMBER_TOKEN */; }).map(function (arg) { return arg.number; });
|
| 3166 |
var a1 = values[0], b1 = values[1]; values[2]; values[3]; var a2 = values[4], b2 = values[5]; values[6]; values[7]; values[8]; values[9]; values[10]; values[11]; var a4 = values[12], b4 = values[13]; values[14]; values[15];
|
| 3167 |
return values.length === 16 ? [a1, b1, a2, b2, a4, b4] : null;
|
| 3168 |
};
|
| 3169 |
var SUPPORTED_TRANSFORM_FUNCTIONS = {
|
| 3170 |
matrix: matrix,
|
| 3171 |
matrix3d: matrix3d
|
| 3172 |
};
|
| 3173 |
|
| 3174 |
var DEFAULT_VALUE = {
|
| 3175 |
type: 16 /* PERCENTAGE_TOKEN */,
|
| 3176 |
number: 50,
|
| 3177 |
flags: FLAG_INTEGER
|
| 3178 |
};
|
| 3179 |
var DEFAULT = [DEFAULT_VALUE, DEFAULT_VALUE];
|
| 3180 |
var transformOrigin = {
|
| 3181 |
name: 'transform-origin',
|
| 3182 |
initialValue: '50% 50%',
|
| 3183 |
prefix: true,
|
| 3184 |
type: 1 /* LIST */,
|
| 3185 |
parse: function (_context, tokens) {
|
| 3186 |
var origins = tokens.filter(isLengthPercentage);
|
| 3187 |
if (origins.length !== 2) {
|
| 3188 |
return DEFAULT;
|
| 3189 |
}
|
| 3190 |
return [origins[0], origins[1]];
|
| 3191 |
}
|
| 3192 |
};
|
| 3193 |
|
| 3194 |
var visibility = {
|
| 3195 |
name: 'visible',
|
| 3196 |
initialValue: 'none',
|
| 3197 |
prefix: false,
|
| 3198 |
type: 2 /* IDENT_VALUE */,
|
| 3199 |
parse: function (_context, visibility) {
|
| 3200 |
switch (visibility) {
|
| 3201 |
case 'hidden':
|
| 3202 |
return 1 /* HIDDEN */;
|
| 3203 |
case 'collapse':
|
| 3204 |
return 2 /* COLLAPSE */;
|
| 3205 |
case 'visible':
|
| 3206 |
default:
|
| 3207 |
return 0 /* VISIBLE */;
|
| 3208 |
}
|
| 3209 |
}
|
| 3210 |
};
|
| 3211 |
|
| 3212 |
var WORD_BREAK;
|
| 3213 |
(function (WORD_BREAK) {
|
| 3214 |
WORD_BREAK["NORMAL"] = "normal";
|
| 3215 |
WORD_BREAK["BREAK_ALL"] = "break-all";
|
| 3216 |
WORD_BREAK["KEEP_ALL"] = "keep-all";
|
| 3217 |
})(WORD_BREAK || (WORD_BREAK = {}));
|
| 3218 |
var wordBreak = {
|
| 3219 |
name: 'word-break',
|
| 3220 |
initialValue: 'normal',
|
| 3221 |
prefix: false,
|
| 3222 |
type: 2 /* IDENT_VALUE */,
|
| 3223 |
parse: function (_context, wordBreak) {
|
| 3224 |
switch (wordBreak) {
|
| 3225 |
case 'break-all':
|
| 3226 |
return WORD_BREAK.BREAK_ALL;
|
| 3227 |
case 'keep-all':
|
| 3228 |
return WORD_BREAK.KEEP_ALL;
|
| 3229 |
case 'normal':
|
| 3230 |
default:
|
| 3231 |
return WORD_BREAK.NORMAL;
|
| 3232 |
}
|
| 3233 |
}
|
| 3234 |
};
|
| 3235 |
|
| 3236 |
var zIndex = {
|
| 3237 |
name: 'z-index',
|
| 3238 |
initialValue: 'auto',
|
| 3239 |
prefix: false,
|
| 3240 |
type: 0 /* VALUE */,
|
| 3241 |
parse: function (_context, token) {
|
| 3242 |
if (token.type === 20 /* IDENT_TOKEN */) {
|
| 3243 |
return { auto: true, order: 0 };
|
| 3244 |
}
|
| 3245 |
if (isNumberToken(token)) {
|
| 3246 |
return { auto: false, order: token.number };
|
| 3247 |
}
|
| 3248 |
throw new Error("Invalid z-index number parsed");
|
| 3249 |
}
|
| 3250 |
};
|
| 3251 |
|
| 3252 |
var time = {
|
| 3253 |
name: 'time',
|
| 3254 |
parse: function (_context, value) {
|
| 3255 |
if (value.type === 15 /* DIMENSION_TOKEN */) {
|
| 3256 |
switch (value.unit.toLowerCase()) {
|
| 3257 |
case 's':
|
| 3258 |
return 1000 * value.number;
|
| 3259 |
case 'ms':
|
| 3260 |
return value.number;
|
| 3261 |
}
|
| 3262 |
}
|
| 3263 |
throw new Error("Unsupported time type");
|
| 3264 |
}
|
| 3265 |
};
|
| 3266 |
|
| 3267 |
var opacity = {
|
| 3268 |
name: 'opacity',
|
| 3269 |
initialValue: '1',
|
| 3270 |
type: 0 /* VALUE */,
|
| 3271 |
prefix: false,
|
| 3272 |
parse: function (_context, token) {
|
| 3273 |
if (isNumberToken(token)) {
|
| 3274 |
return token.number;
|
| 3275 |
}
|
| 3276 |
return 1;
|
| 3277 |
}
|
| 3278 |
};
|
| 3279 |
|
| 3280 |
var textDecorationColor = {
|
| 3281 |
name: "text-decoration-color",
|
| 3282 |
initialValue: 'transparent',
|
| 3283 |
prefix: false,
|
| 3284 |
type: 3 /* TYPE_VALUE */,
|
| 3285 |
format: 'color'
|
| 3286 |
};
|
| 3287 |
|
| 3288 |
var textDecorationLine = {
|
| 3289 |
name: 'text-decoration-line',
|
| 3290 |
initialValue: 'none',
|
| 3291 |
prefix: false,
|
| 3292 |
type: 1 /* LIST */,
|
| 3293 |
parse: function (_context, tokens) {
|
| 3294 |
return tokens
|
| 3295 |
.filter(isIdentToken)
|
| 3296 |
.map(function (token) {
|
| 3297 |
switch (token.value) {
|
| 3298 |
case 'underline':
|
| 3299 |
return 1 /* UNDERLINE */;
|
| 3300 |
case 'overline':
|
| 3301 |
return 2 /* OVERLINE */;
|
| 3302 |
case 'line-through':
|
| 3303 |
return 3 /* LINE_THROUGH */;
|
| 3304 |
case 'none':
|
| 3305 |
return 4 /* BLINK */;
|
| 3306 |
}
|
| 3307 |
return 0 /* NONE */;
|
| 3308 |
})
|
| 3309 |
.filter(function (line) { return line !== 0 /* NONE */; });
|
| 3310 |
}
|
| 3311 |
};
|
| 3312 |
|
| 3313 |
var fontFamily = {
|
| 3314 |
name: "font-family",
|
| 3315 |
initialValue: '',
|
| 3316 |
prefix: false,
|
| 3317 |
type: 1 /* LIST */,
|
| 3318 |
parse: function (_context, tokens) {
|
| 3319 |
var accumulator = [];
|
| 3320 |
var results = [];
|
| 3321 |
tokens.forEach(function (token) {
|
| 3322 |
switch (token.type) {
|
| 3323 |
case 20 /* IDENT_TOKEN */:
|
| 3324 |
case 0 /* STRING_TOKEN */:
|
| 3325 |
accumulator.push(token.value);
|
| 3326 |
break;
|
| 3327 |
case 17 /* NUMBER_TOKEN */:
|
| 3328 |
accumulator.push(token.number.toString());
|
| 3329 |
break;
|
| 3330 |
case 4 /* COMMA_TOKEN */:
|
| 3331 |
results.push(accumulator.join(' '));
|
| 3332 |
accumulator.length = 0;
|
| 3333 |
break;
|
| 3334 |
}
|
| 3335 |
});
|
| 3336 |
if (accumulator.length) {
|
| 3337 |
results.push(accumulator.join(' '));
|
| 3338 |
}
|
| 3339 |
return results.map(function (result) { return (result.indexOf(' ') === -1 ? result : "'" + result + "'"); });
|
| 3340 |
}
|
| 3341 |
};
|
| 3342 |
|
| 3343 |
var fontSize = {
|
| 3344 |
name: "font-size",
|
| 3345 |
initialValue: '0',
|
| 3346 |
prefix: false,
|
| 3347 |
type: 3 /* TYPE_VALUE */,
|
| 3348 |
format: 'length'
|
| 3349 |
};
|
| 3350 |
|
| 3351 |
var fontWeight = {
|
| 3352 |
name: 'font-weight',
|
| 3353 |
initialValue: 'normal',
|
| 3354 |
type: 0 /* VALUE */,
|
| 3355 |
prefix: false,
|
| 3356 |
parse: function (_context, token) {
|
| 3357 |
if (isNumberToken(token)) {
|
| 3358 |
return token.number;
|
| 3359 |
}
|
| 3360 |
if (isIdentToken(token)) {
|
| 3361 |
switch (token.value) {
|
| 3362 |
case 'bold':
|
| 3363 |
return 700;
|
| 3364 |
case 'normal':
|
| 3365 |
default:
|
| 3366 |
return 400;
|
| 3367 |
}
|
| 3368 |
}
|
| 3369 |
return 400;
|
| 3370 |
}
|
| 3371 |
};
|
| 3372 |
|
| 3373 |
var fontVariant = {
|
| 3374 |
name: 'font-variant',
|
| 3375 |
initialValue: 'none',
|
| 3376 |
type: 1 /* LIST */,
|
| 3377 |
prefix: false,
|
| 3378 |
parse: function (_context, tokens) {
|
| 3379 |
return tokens.filter(isIdentToken).map(function (token) { return token.value; });
|
| 3380 |
}
|
| 3381 |
};
|
| 3382 |
|
| 3383 |
var fontStyle = {
|
| 3384 |
name: 'font-style',
|
| 3385 |
initialValue: 'normal',
|
| 3386 |
prefix: false,
|
| 3387 |
type: 2 /* IDENT_VALUE */,
|
| 3388 |
parse: function (_context, overflow) {
|
| 3389 |
switch (overflow) {
|
| 3390 |
case 'oblique':
|
| 3391 |
return "oblique" /* OBLIQUE */;
|
| 3392 |
case 'italic':
|
| 3393 |
return "italic" /* ITALIC */;
|
| 3394 |
case 'normal':
|
| 3395 |
default:
|
| 3396 |
return "normal" /* NORMAL */;
|
| 3397 |
}
|
| 3398 |
}
|
| 3399 |
};
|
| 3400 |
|
| 3401 |
var contains = function (bit, value) { return (bit & value) !== 0; };
|
| 3402 |
|
| 3403 |
var content = {
|
| 3404 |
name: 'content',
|
| 3405 |
initialValue: 'none',
|
| 3406 |
type: 1 /* LIST */,
|
| 3407 |
prefix: false,
|
| 3408 |
parse: function (_context, tokens) {
|
| 3409 |
if (tokens.length === 0) {
|
| 3410 |
return [];
|
| 3411 |
}
|
| 3412 |
var first = tokens[0];
|
| 3413 |
if (first.type === 20 /* IDENT_TOKEN */ && first.value === 'none') {
|
| 3414 |
return [];
|
| 3415 |
}
|
| 3416 |
return tokens;
|
| 3417 |
}
|
| 3418 |
};
|
| 3419 |
|
| 3420 |
var counterIncrement = {
|
| 3421 |
name: 'counter-increment',
|
| 3422 |
initialValue: 'none',
|
| 3423 |
prefix: true,
|
| 3424 |
type: 1 /* LIST */,
|
| 3425 |
parse: function (_context, tokens) {
|
| 3426 |
if (tokens.length === 0) {
|
| 3427 |
return null;
|
| 3428 |
}
|
| 3429 |
var first = tokens[0];
|
| 3430 |
if (first.type === 20 /* IDENT_TOKEN */ && first.value === 'none') {
|
| 3431 |
return null;
|
| 3432 |
}
|
| 3433 |
var increments = [];
|
| 3434 |
var filtered = tokens.filter(nonWhiteSpace);
|
| 3435 |
for (var i = 0; i < filtered.length; i++) {
|
| 3436 |
var counter = filtered[i];
|
| 3437 |
var next = filtered[i + 1];
|
| 3438 |
if (counter.type === 20 /* IDENT_TOKEN */) {
|
| 3439 |
var increment = next && isNumberToken(next) ? next.number : 1;
|
| 3440 |
increments.push({ counter: counter.value, increment: increment });
|
| 3441 |
}
|
| 3442 |
}
|
| 3443 |
return increments;
|
| 3444 |
}
|
| 3445 |
};
|
| 3446 |
|
| 3447 |
var counterReset = {
|
| 3448 |
name: 'counter-reset',
|
| 3449 |
initialValue: 'none',
|
| 3450 |
prefix: true,
|
| 3451 |
type: 1 /* LIST */,
|
| 3452 |
parse: function (_context, tokens) {
|
| 3453 |
if (tokens.length === 0) {
|
| 3454 |
return [];
|
| 3455 |
}
|
| 3456 |
var resets = [];
|
| 3457 |
var filtered = tokens.filter(nonWhiteSpace);
|
| 3458 |
for (var i = 0; i < filtered.length; i++) {
|
| 3459 |
var counter = filtered[i];
|
| 3460 |
var next = filtered[i + 1];
|
| 3461 |
if (isIdentToken(counter) && counter.value !== 'none') {
|
| 3462 |
var reset = next && isNumberToken(next) ? next.number : 0;
|
| 3463 |
resets.push({ counter: counter.value, reset: reset });
|
| 3464 |
}
|
| 3465 |
}
|
| 3466 |
return resets;
|
| 3467 |
}
|
| 3468 |
};
|
| 3469 |
|
| 3470 |
var duration = {
|
| 3471 |
name: 'duration',
|
| 3472 |
initialValue: '0s',
|
| 3473 |
prefix: false,
|
| 3474 |
type: 1 /* LIST */,
|
| 3475 |
parse: function (context, tokens) {
|
| 3476 |
return tokens.filter(isDimensionToken).map(function (token) { return time.parse(context, token); });
|
| 3477 |
}
|
| 3478 |
};
|
| 3479 |
|
| 3480 |
var quotes = {
|
| 3481 |
name: 'quotes',
|
| 3482 |
initialValue: 'none',
|
| 3483 |
prefix: true,
|
| 3484 |
type: 1 /* LIST */,
|
| 3485 |
parse: function (_context, tokens) {
|
| 3486 |
if (tokens.length === 0) {
|
| 3487 |
return null;
|
| 3488 |
}
|
| 3489 |
var first = tokens[0];
|
| 3490 |
if (first.type === 20 /* IDENT_TOKEN */ && first.value === 'none') {
|
| 3491 |
return null;
|
| 3492 |
}
|
| 3493 |
var quotes = [];
|
| 3494 |
var filtered = tokens.filter(isStringToken);
|
| 3495 |
if (filtered.length % 2 !== 0) {
|
| 3496 |
return null;
|
| 3497 |
}
|
| 3498 |
for (var i = 0; i < filtered.length; i += 2) {
|
| 3499 |
var open_1 = filtered[i].value;
|
| 3500 |
var close_1 = filtered[i + 1].value;
|
| 3501 |
quotes.push({ open: open_1, close: close_1 });
|
| 3502 |
}
|
| 3503 |
return quotes;
|
| 3504 |
}
|
| 3505 |
};
|
| 3506 |
var getQuote = function (quotes, depth, open) {
|
| 3507 |
if (!quotes) {
|
| 3508 |
return '';
|
| 3509 |
}
|
| 3510 |
var quote = quotes[Math.min(depth, quotes.length - 1)];
|
| 3511 |
if (!quote) {
|
| 3512 |
return '';
|
| 3513 |
}
|
| 3514 |
return open ? quote.open : quote.close;
|
| 3515 |
};
|
| 3516 |
|
| 3517 |
var boxShadow = {
|
| 3518 |
name: 'box-shadow',
|
| 3519 |
initialValue: 'none',
|
| 3520 |
type: 1 /* LIST */,
|
| 3521 |
prefix: false,
|
| 3522 |
parse: function (context, tokens) {
|
| 3523 |
if (tokens.length === 1 && isIdentWithValue(tokens[0], 'none')) {
|
| 3524 |
return [];
|
| 3525 |
}
|
| 3526 |
return parseFunctionArgs(tokens).map(function (values) {
|
| 3527 |
var shadow = {
|
| 3528 |
color: 0x000000ff,
|
| 3529 |
offsetX: ZERO_LENGTH,
|
| 3530 |
offsetY: ZERO_LENGTH,
|
| 3531 |
blur: ZERO_LENGTH,
|
| 3532 |
spread: ZERO_LENGTH,
|
| 3533 |
inset: false
|
| 3534 |
};
|
| 3535 |
var c = 0;
|
| 3536 |
for (var i = 0; i < values.length; i++) {
|
| 3537 |
var token = values[i];
|
| 3538 |
if (isIdentWithValue(token, 'inset')) {
|
| 3539 |
shadow.inset = true;
|
| 3540 |
}
|
| 3541 |
else if (isLength(token)) {
|
| 3542 |
if (c === 0) {
|
| 3543 |
shadow.offsetX = token;
|
| 3544 |
}
|
| 3545 |
else if (c === 1) {
|
| 3546 |
shadow.offsetY = token;
|
| 3547 |
}
|
| 3548 |
else if (c === 2) {
|
| 3549 |
shadow.blur = token;
|
| 3550 |
}
|
| 3551 |
else {
|
| 3552 |
shadow.spread = token;
|
| 3553 |
}
|
| 3554 |
c++;
|
| 3555 |
}
|
| 3556 |
else {
|
| 3557 |
shadow.color = color$1.parse(context, token);
|
| 3558 |
}
|
| 3559 |
}
|
| 3560 |
return shadow;
|
| 3561 |
});
|
| 3562 |
}
|
| 3563 |
};
|
| 3564 |
|
| 3565 |
var paintOrder = {
|
| 3566 |
name: 'paint-order',
|
| 3567 |
initialValue: 'normal',
|
| 3568 |
prefix: false,
|
| 3569 |
type: 1 /* LIST */,
|
| 3570 |
parse: function (_context, tokens) {
|
| 3571 |
var DEFAULT_VALUE = [0 /* FILL */, 1 /* STROKE */, 2 /* MARKERS */];
|
| 3572 |
var layers = [];
|
| 3573 |
tokens.filter(isIdentToken).forEach(function (token) {
|
| 3574 |
switch (token.value) {
|
| 3575 |
case 'stroke':
|
| 3576 |
layers.push(1 /* STROKE */);
|
| 3577 |
break;
|
| 3578 |
case 'fill':
|
| 3579 |
layers.push(0 /* FILL */);
|
| 3580 |
break;
|
| 3581 |
case 'markers':
|
| 3582 |
layers.push(2 /* MARKERS */);
|
| 3583 |
break;
|
| 3584 |
}
|
| 3585 |
});
|
| 3586 |
DEFAULT_VALUE.forEach(function (value) {
|
| 3587 |
if (layers.indexOf(value) === -1) {
|
| 3588 |
layers.push(value);
|
| 3589 |
}
|
| 3590 |
});
|
| 3591 |
return layers;
|
| 3592 |
}
|
| 3593 |
};
|
| 3594 |
|
| 3595 |
var webkitTextStrokeColor = {
|
| 3596 |
name: "-webkit-text-stroke-color",
|
| 3597 |
initialValue: 'currentcolor',
|
| 3598 |
prefix: false,
|
| 3599 |
type: 3 /* TYPE_VALUE */,
|
| 3600 |
format: 'color'
|
| 3601 |
};
|
| 3602 |
|
| 3603 |
var webkitTextStrokeWidth = {
|
| 3604 |
name: "-webkit-text-stroke-width",
|
| 3605 |
initialValue: '0',
|
| 3606 |
type: 0 /* VALUE */,
|
| 3607 |
prefix: false,
|
| 3608 |
parse: function (_context, token) {
|
| 3609 |
if (isDimensionToken(token)) {
|
| 3610 |
return token.number;
|
| 3611 |
}
|
| 3612 |
return 0;
|
| 3613 |
}
|
| 3614 |
};
|
| 3615 |
|
| 3616 |
var CSSParsedDeclaration = /** @class */ (function () {
|
| 3617 |
function CSSParsedDeclaration(context, declaration) {
|
| 3618 |
var _a, _b;
|
| 3619 |
this.animationDuration = parse(context, duration, declaration.animationDuration);
|
| 3620 |
this.backgroundClip = parse(context, backgroundClip, declaration.backgroundClip);
|
| 3621 |
this.backgroundColor = parse(context, backgroundColor, declaration.backgroundColor);
|
| 3622 |
this.backgroundImage = parse(context, backgroundImage, declaration.backgroundImage);
|
| 3623 |
this.backgroundOrigin = parse(context, backgroundOrigin, declaration.backgroundOrigin);
|
| 3624 |
this.backgroundPosition = parse(context, backgroundPosition, declaration.backgroundPosition);
|
| 3625 |
this.backgroundRepeat = parse(context, backgroundRepeat, declaration.backgroundRepeat);
|
| 3626 |
this.backgroundSize = parse(context, backgroundSize, declaration.backgroundSize);
|
| 3627 |
this.borderTopColor = parse(context, borderTopColor, declaration.borderTopColor);
|
| 3628 |
this.borderRightColor = parse(context, borderRightColor, declaration.borderRightColor);
|
| 3629 |
this.borderBottomColor = parse(context, borderBottomColor, declaration.borderBottomColor);
|
| 3630 |
this.borderLeftColor = parse(context, borderLeftColor, declaration.borderLeftColor);
|
| 3631 |
this.borderTopLeftRadius = parse(context, borderTopLeftRadius, declaration.borderTopLeftRadius);
|
| 3632 |
this.borderTopRightRadius = parse(context, borderTopRightRadius, declaration.borderTopRightRadius);
|
| 3633 |
this.borderBottomRightRadius = parse(context, borderBottomRightRadius, declaration.borderBottomRightRadius);
|
| 3634 |
this.borderBottomLeftRadius = parse(context, borderBottomLeftRadius, declaration.borderBottomLeftRadius);
|
| 3635 |
this.borderTopStyle = parse(context, borderTopStyle, declaration.borderTopStyle);
|
| 3636 |
this.borderRightStyle = parse(context, borderRightStyle, declaration.borderRightStyle);
|
| 3637 |
this.borderBottomStyle = parse(context, borderBottomStyle, declaration.borderBottomStyle);
|
| 3638 |
this.borderLeftStyle = parse(context, borderLeftStyle, declaration.borderLeftStyle);
|
| 3639 |
this.borderTopWidth = parse(context, borderTopWidth, declaration.borderTopWidth);
|
| 3640 |
this.borderRightWidth = parse(context, borderRightWidth, declaration.borderRightWidth);
|
| 3641 |
this.borderBottomWidth = parse(context, borderBottomWidth, declaration.borderBottomWidth);
|
| 3642 |
this.borderLeftWidth = parse(context, borderLeftWidth, declaration.borderLeftWidth);
|
| 3643 |
this.boxShadow = parse(context, boxShadow, declaration.boxShadow);
|
| 3644 |
this.color = parse(context, color, declaration.color);
|
| 3645 |
this.direction = parse(context, direction, declaration.direction);
|
| 3646 |
this.display = parse(context, display, declaration.display);
|
| 3647 |
this.float = parse(context, float, declaration.cssFloat);
|
| 3648 |
this.fontFamily = parse(context, fontFamily, declaration.fontFamily);
|
| 3649 |
this.fontSize = parse(context, fontSize, declaration.fontSize);
|
| 3650 |
this.fontStyle = parse(context, fontStyle, declaration.fontStyle);
|
| 3651 |
this.fontVariant = parse(context, fontVariant, declaration.fontVariant);
|
| 3652 |
this.fontWeight = parse(context, fontWeight, declaration.fontWeight);
|
| 3653 |
this.letterSpacing = parse(context, letterSpacing, declaration.letterSpacing);
|
| 3654 |
this.lineBreak = parse(context, lineBreak, declaration.lineBreak);
|
| 3655 |
this.lineHeight = parse(context, lineHeight, declaration.lineHeight);
|
| 3656 |
this.listStyleImage = parse(context, listStyleImage, declaration.listStyleImage);
|
| 3657 |
this.listStylePosition = parse(context, listStylePosition, declaration.listStylePosition);
|
| 3658 |
this.listStyleType = parse(context, listStyleType, declaration.listStyleType);
|
| 3659 |
this.marginTop = parse(context, marginTop, declaration.marginTop);
|
| 3660 |
this.marginRight = parse(context, marginRight, declaration.marginRight);
|
| 3661 |
this.marginBottom = parse(context, marginBottom, declaration.marginBottom);
|
| 3662 |
this.marginLeft = parse(context, marginLeft, declaration.marginLeft);
|
| 3663 |
this.opacity = parse(context, opacity, declaration.opacity);
|
| 3664 |
var overflowTuple = parse(context, overflow, declaration.overflow);
|
| 3665 |
this.overflowX = overflowTuple[0];
|
| 3666 |
this.overflowY = overflowTuple[overflowTuple.length > 1 ? 1 : 0];
|
| 3667 |
this.overflowWrap = parse(context, overflowWrap, declaration.overflowWrap);
|
| 3668 |
this.paddingTop = parse(context, paddingTop, declaration.paddingTop);
|
| 3669 |
this.paddingRight = parse(context, paddingRight, declaration.paddingRight);
|
| 3670 |
this.paddingBottom = parse(context, paddingBottom, declaration.paddingBottom);
|
| 3671 |
this.paddingLeft = parse(context, paddingLeft, declaration.paddingLeft);
|
| 3672 |
this.paintOrder = parse(context, paintOrder, declaration.paintOrder);
|
| 3673 |
this.position = parse(context, position, declaration.position);
|
| 3674 |
this.textAlign = parse(context, textAlign, declaration.textAlign);
|
| 3675 |
this.textDecorationColor = parse(context, textDecorationColor, (_a = declaration.textDecorationColor) !== null && _a !== void 0 ? _a : declaration.color);
|
| 3676 |
this.textDecorationLine = parse(context, textDecorationLine, (_b = declaration.textDecorationLine) !== null && _b !== void 0 ? _b : declaration.textDecoration);
|
| 3677 |
this.textShadow = parse(context, textShadow, declaration.textShadow);
|
| 3678 |
this.textTransform = parse(context, textTransform, declaration.textTransform);
|
| 3679 |
this.transform = parse(context, transform$1, declaration.transform);
|
| 3680 |
this.transformOrigin = parse(context, transformOrigin, declaration.transformOrigin);
|
| 3681 |
this.visibility = parse(context, visibility, declaration.visibility);
|
| 3682 |
this.webkitTextStrokeColor = parse(context, webkitTextStrokeColor, declaration.webkitTextStrokeColor);
|
| 3683 |
this.webkitTextStrokeWidth = parse(context, webkitTextStrokeWidth, declaration.webkitTextStrokeWidth);
|
| 3684 |
this.wordBreak = parse(context, wordBreak, declaration.wordBreak);
|
| 3685 |
this.zIndex = parse(context, zIndex, declaration.zIndex);
|
| 3686 |
}
|
| 3687 |
CSSParsedDeclaration.prototype.isVisible = function () {
|
| 3688 |
return this.display > 0 && this.opacity > 0 && this.visibility === 0 /* VISIBLE */;
|
| 3689 |
};
|
| 3690 |
CSSParsedDeclaration.prototype.isTransparent = function () {
|
| 3691 |
return isTransparent(this.backgroundColor);
|
| 3692 |
};
|
| 3693 |
CSSParsedDeclaration.prototype.isTransformed = function () {
|
| 3694 |
return this.transform !== null;
|
| 3695 |
};
|
| 3696 |
CSSParsedDeclaration.prototype.isPositioned = function () {
|
| 3697 |
return this.position !== 0 /* STATIC */;
|
| 3698 |
};
|
| 3699 |
CSSParsedDeclaration.prototype.isPositionedWithZIndex = function () {
|
| 3700 |
return this.isPositioned() && !this.zIndex.auto;
|
| 3701 |
};
|
| 3702 |
CSSParsedDeclaration.prototype.isFloating = function () {
|
| 3703 |
return this.float !== 0 /* NONE */;
|
| 3704 |
};
|
| 3705 |
CSSParsedDeclaration.prototype.isInlineLevel = function () {
|
| 3706 |
return (contains(this.display, 4 /* INLINE */) ||
|
| 3707 |
contains(this.display, 33554432 /* INLINE_BLOCK */) ||
|
| 3708 |
contains(this.display, 268435456 /* INLINE_FLEX */) ||
|
| 3709 |
contains(this.display, 536870912 /* INLINE_GRID */) ||
|
| 3710 |
contains(this.display, 67108864 /* INLINE_LIST_ITEM */) ||
|
| 3711 |
contains(this.display, 134217728 /* INLINE_TABLE */));
|
| 3712 |
};
|
| 3713 |
return CSSParsedDeclaration;
|
| 3714 |
}());
|
| 3715 |
var CSSParsedPseudoDeclaration = /** @class */ (function () {
|
| 3716 |
function CSSParsedPseudoDeclaration(context, declaration) {
|
| 3717 |
this.content = parse(context, content, declaration.content);
|
| 3718 |
this.quotes = parse(context, quotes, declaration.quotes);
|
| 3719 |
}
|
| 3720 |
return CSSParsedPseudoDeclaration;
|
| 3721 |
}());
|
| 3722 |
var CSSParsedCounterDeclaration = /** @class */ (function () {
|
| 3723 |
function CSSParsedCounterDeclaration(context, declaration) {
|
| 3724 |
this.counterIncrement = parse(context, counterIncrement, declaration.counterIncrement);
|
| 3725 |
this.counterReset = parse(context, counterReset, declaration.counterReset);
|
| 3726 |
}
|
| 3727 |
return CSSParsedCounterDeclaration;
|
| 3728 |
}());
|
| 3729 |
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
| 3730 |
var parse = function (context, descriptor, style) {
|
| 3731 |
var tokenizer = new Tokenizer();
|
| 3732 |
var value = style !== null && typeof style !== 'undefined' ? style.toString() : descriptor.initialValue;
|
| 3733 |
tokenizer.write(value);
|
| 3734 |
var parser = new Parser(tokenizer.read());
|
| 3735 |
switch (descriptor.type) {
|
| 3736 |
case 2 /* IDENT_VALUE */:
|
| 3737 |
var token = parser.parseComponentValue();
|
| 3738 |
return descriptor.parse(context, isIdentToken(token) ? token.value : descriptor.initialValue);
|
| 3739 |
case 0 /* VALUE */:
|
| 3740 |
return descriptor.parse(context, parser.parseComponentValue());
|
| 3741 |
case 1 /* LIST */:
|
| 3742 |
return descriptor.parse(context, parser.parseComponentValues());
|
| 3743 |
case 4 /* TOKEN_VALUE */:
|
| 3744 |
return parser.parseComponentValue();
|
| 3745 |
case 3 /* TYPE_VALUE */:
|
| 3746 |
switch (descriptor.format) {
|
| 3747 |
case 'angle':
|
| 3748 |
return angle.parse(context, parser.parseComponentValue());
|
| 3749 |
case 'color':
|
| 3750 |
return color$1.parse(context, parser.parseComponentValue());
|
| 3751 |
case 'image':
|
| 3752 |
return image.parse(context, parser.parseComponentValue());
|
| 3753 |
case 'length':
|
| 3754 |
var length_1 = parser.parseComponentValue();
|
| 3755 |
return isLength(length_1) ? length_1 : ZERO_LENGTH;
|
| 3756 |
case 'length-percentage':
|
| 3757 |
var value_1 = parser.parseComponentValue();
|
| 3758 |
return isLengthPercentage(value_1) ? value_1 : ZERO_LENGTH;
|
| 3759 |
case 'time':
|
| 3760 |
return time.parse(context, parser.parseComponentValue());
|
| 3761 |
}
|
| 3762 |
break;
|
| 3763 |
}
|
| 3764 |
};
|
| 3765 |
|
| 3766 |
var elementDebuggerAttribute = 'data-html2canvas-debug';
|
| 3767 |
var getElementDebugType = function (element) {
|
| 3768 |
var attribute = element.getAttribute(elementDebuggerAttribute);
|
| 3769 |
switch (attribute) {
|
| 3770 |
case 'all':
|
| 3771 |
return 1 /* ALL */;
|
| 3772 |
case 'clone':
|
| 3773 |
return 2 /* CLONE */;
|
| 3774 |
case 'parse':
|
| 3775 |
return 3 /* PARSE */;
|
| 3776 |
case 'render':
|
| 3777 |
return 4 /* RENDER */;
|
| 3778 |
default:
|
| 3779 |
return 0 /* NONE */;
|
| 3780 |
}
|
| 3781 |
};
|
| 3782 |
var isDebugging = function (element, type) {
|
| 3783 |
var elementType = getElementDebugType(element);
|
| 3784 |
return elementType === 1 /* ALL */ || type === elementType;
|
| 3785 |
};
|
| 3786 |
|
| 3787 |
var ElementContainer = /** @class */ (function () {
|
| 3788 |
function ElementContainer(context, element) {
|
| 3789 |
this.context = context;
|
| 3790 |
this.textNodes = [];
|
| 3791 |
this.elements = [];
|
| 3792 |
this.flags = 0;
|
| 3793 |
if (isDebugging(element, 3 /* PARSE */)) {
|
| 3794 |
debugger;
|
| 3795 |
}
|
| 3796 |
this.styles = new CSSParsedDeclaration(context, window.getComputedStyle(element, null));
|
| 3797 |
if (isHTMLElementNode(element)) {
|
| 3798 |
if (this.styles.animationDuration.some(function (duration) { return duration > 0; })) {
|
| 3799 |
element.style.animationDuration = '0s';
|
| 3800 |
}
|
| 3801 |
if (this.styles.transform !== null) {
|
| 3802 |
// getBoundingClientRect takes transforms into account
|
| 3803 |
element.style.transform = 'none';
|
| 3804 |
}
|
| 3805 |
}
|
| 3806 |
this.bounds = parseBounds(this.context, element);
|
| 3807 |
if (isDebugging(element, 4 /* RENDER */)) {
|
| 3808 |
this.flags |= 16 /* DEBUG_RENDER */;
|
| 3809 |
}
|
| 3810 |
}
|
| 3811 |
return ElementContainer;
|
| 3812 |
}());
|
| 3813 |
|
| 3814 |
/*
|
| 3815 |
* text-segmentation 1.0.3 <https://github.com/niklasvh/text-segmentation>
|
| 3816 |
* Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
|
| 3817 |
* Released under MIT License
|
| 3818 |
*/
|
| 3819 |
var base64 = 'AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAA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AAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAA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4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=';
|
| 3820 |
|
| 3821 |
/*
|
| 3822 |
* utrie 1.0.2 <https://github.com/niklasvh/utrie>
|
| 3823 |
* Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
|
| 3824 |
* Released under MIT License
|
| 3825 |
*/
|
| 3826 |
var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
| 3827 |
// Use a lookup table to find the index.
|
| 3828 |
var lookup$1 = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);
|
| 3829 |
for (var i$1 = 0; i$1 < chars$1.length; i$1++) {
|
| 3830 |
lookup$1[chars$1.charCodeAt(i$1)] = i$1;
|
| 3831 |
}
|
| 3832 |
var decode = function (base64) {
|
| 3833 |
var bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;
|
| 3834 |
if (base64[base64.length - 1] === '=') {
|
| 3835 |
bufferLength--;
|
| 3836 |
if (base64[base64.length - 2] === '=') {
|
| 3837 |
bufferLength--;
|
| 3838 |
}
|
| 3839 |
}
|
| 3840 |
var buffer = typeof ArrayBuffer !== 'undefined' &&
|
| 3841 |
typeof Uint8Array !== 'undefined' &&
|
| 3842 |
typeof Uint8Array.prototype.slice !== 'undefined'
|
| 3843 |
? new ArrayBuffer(bufferLength)
|
| 3844 |
: new Array(bufferLength);
|
| 3845 |
var bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);
|
| 3846 |
for (i = 0; i < len; i += 4) {
|
| 3847 |
encoded1 = lookup$1[base64.charCodeAt(i)];
|
| 3848 |
encoded2 = lookup$1[base64.charCodeAt(i + 1)];
|
| 3849 |
encoded3 = lookup$1[base64.charCodeAt(i + 2)];
|
| 3850 |
encoded4 = lookup$1[base64.charCodeAt(i + 3)];
|
| 3851 |
bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);
|
| 3852 |
bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);
|
| 3853 |
bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);
|
| 3854 |
}
|
| 3855 |
return buffer;
|
| 3856 |
};
|
| 3857 |
var polyUint16Array = function (buffer) {
|
| 3858 |
var length = buffer.length;
|
| 3859 |
var bytes = [];
|
| 3860 |
for (var i = 0; i < length; i += 2) {
|
| 3861 |
bytes.push((buffer[i + 1] << 8) | buffer[i]);
|
| 3862 |
}
|
| 3863 |
return bytes;
|
| 3864 |
};
|
| 3865 |
var polyUint32Array = function (buffer) {
|
| 3866 |
var length = buffer.length;
|
| 3867 |
var bytes = [];
|
| 3868 |
for (var i = 0; i < length; i += 4) {
|
| 3869 |
bytes.push((buffer[i + 3] << 24) | (buffer[i + 2] << 16) | (buffer[i + 1] << 8) | buffer[i]);
|
| 3870 |
}
|
| 3871 |
return bytes;
|
| 3872 |
};
|
| 3873 |
|
| 3874 |
/** Shift size for getting the index-2 table offset. */
|
| 3875 |
var UTRIE2_SHIFT_2 = 5;
|
| 3876 |
/** Shift size for getting the index-1 table offset. */
|
| 3877 |
var UTRIE2_SHIFT_1 = 6 + 5;
|
| 3878 |
/**
|
| 3879 |
* Shift size for shifting left the index array values.
|
| 3880 |
* Increases possible data size with 16-bit index values at the cost
|
| 3881 |
* of compactability.
|
| 3882 |
* This requires data blocks to be aligned by UTRIE2_DATA_GRANULARITY.
|
| 3883 |
*/
|
| 3884 |
var UTRIE2_INDEX_SHIFT = 2;
|
| 3885 |
/**
|
| 3886 |
* Difference between the two shift sizes,
|
| 3887 |
* for getting an index-1 offset from an index-2 offset. 6=11-5
|
| 3888 |
*/
|
| 3889 |
var UTRIE2_SHIFT_1_2 = UTRIE2_SHIFT_1 - UTRIE2_SHIFT_2;
|
| 3890 |
/**
|
| 3891 |
* The part of the index-2 table for U+D800..U+DBFF stores values for
|
| 3892 |
* lead surrogate code _units_ not code _points_.
|
| 3893 |
* Values for lead surrogate code _points_ are indexed with this portion of the table.
|
| 3894 |
* Length=32=0x20=0x400>>UTRIE2_SHIFT_2. (There are 1024=0x400 lead surrogates.)
|
| 3895 |
*/
|
| 3896 |
var UTRIE2_LSCP_INDEX_2_OFFSET = 0x10000 >> UTRIE2_SHIFT_2;
|
| 3897 |
/** Number of entries in a data block. 32=0x20 */
|
| 3898 |
var UTRIE2_DATA_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_2;
|
| 3899 |
/** Mask for getting the lower bits for the in-data-block offset. */
|
| 3900 |
var UTRIE2_DATA_MASK = UTRIE2_DATA_BLOCK_LENGTH - 1;
|
| 3901 |
var UTRIE2_LSCP_INDEX_2_LENGTH = 0x400 >> UTRIE2_SHIFT_2;
|
| 3902 |
/** Count the lengths of both BMP pieces. 2080=0x820 */
|
| 3903 |
var UTRIE2_INDEX_2_BMP_LENGTH = UTRIE2_LSCP_INDEX_2_OFFSET + UTRIE2_LSCP_INDEX_2_LENGTH;
|
| 3904 |
/**
|
| 3905 |
* The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820.
|
| 3906 |
* Length 32=0x20 for lead bytes C0..DF, regardless of UTRIE2_SHIFT_2.
|
| 3907 |
*/
|
| 3908 |
var UTRIE2_UTF8_2B_INDEX_2_OFFSET = UTRIE2_INDEX_2_BMP_LENGTH;
|
| 3909 |
var UTRIE2_UTF8_2B_INDEX_2_LENGTH = 0x800 >> 6; /* U+0800 is the first code point after 2-byte UTF-8 */
|
| 3910 |
/**
|
| 3911 |
* The index-1 table, only used for supplementary code points, at offset 2112=0x840.
|
| 3912 |
* Variable length, for code points up to highStart, where the last single-value range starts.
|
| 3913 |
* Maximum length 512=0x200=0x100000>>UTRIE2_SHIFT_1.
|
| 3914 |
* (For 0x100000 supplementary code points U+10000..U+10ffff.)
|
| 3915 |
*
|
| 3916 |
* The part of the index-2 table for supplementary code points starts
|
| 3917 |
* after this index-1 table.
|
| 3918 |
*
|
| 3919 |
* Both the index-1 table and the following part of the index-2 table
|
| 3920 |
* are omitted completely if there is only BMP data.
|
| 3921 |
*/
|
| 3922 |
var UTRIE2_INDEX_1_OFFSET = UTRIE2_UTF8_2B_INDEX_2_OFFSET + UTRIE2_UTF8_2B_INDEX_2_LENGTH;
|
| 3923 |
/**
|
| 3924 |
* Number of index-1 entries for the BMP. 32=0x20
|
| 3925 |
* This part of the index-1 table is omitted from the serialized form.
|
| 3926 |
*/
|
| 3927 |
var UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> UTRIE2_SHIFT_1;
|
| 3928 |
/** Number of entries in an index-2 block. 64=0x40 */
|
| 3929 |
var UTRIE2_INDEX_2_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_1_2;
|
| 3930 |
/** Mask for getting the lower bits for the in-index-2-block offset. */
|
| 3931 |
var UTRIE2_INDEX_2_MASK = UTRIE2_INDEX_2_BLOCK_LENGTH - 1;
|
| 3932 |
var slice16 = function (view, start, end) {
|
| 3933 |
if (view.slice) {
|
| 3934 |
return view.slice(start, end);
|
| 3935 |
}
|
| 3936 |
return new Uint16Array(Array.prototype.slice.call(view, start, end));
|
| 3937 |
};
|
| 3938 |
var slice32 = function (view, start, end) {
|
| 3939 |
if (view.slice) {
|
| 3940 |
return view.slice(start, end);
|
| 3941 |
}
|
| 3942 |
return new Uint32Array(Array.prototype.slice.call(view, start, end));
|
| 3943 |
};
|
| 3944 |
var createTrieFromBase64 = function (base64, _byteLength) {
|
| 3945 |
var buffer = decode(base64);
|
| 3946 |
var view32 = Array.isArray(buffer) ? polyUint32Array(buffer) : new Uint32Array(buffer);
|
| 3947 |
var view16 = Array.isArray(buffer) ? polyUint16Array(buffer) : new Uint16Array(buffer);
|
| 3948 |
var headerLength = 24;
|
| 3949 |
var index = slice16(view16, headerLength / 2, view32[4] / 2);
|
| 3950 |
var data = view32[5] === 2
|
| 3951 |
? slice16(view16, (headerLength + view32[4]) / 2)
|
| 3952 |
: slice32(view32, Math.ceil((headerLength + view32[4]) / 4));
|
| 3953 |
return new Trie(view32[0], view32[1], view32[2], view32[3], index, data);
|
| 3954 |
};
|
| 3955 |
var Trie = /** @class */ (function () {
|
| 3956 |
function Trie(initialValue, errorValue, highStart, highValueIndex, index, data) {
|
| 3957 |
this.initialValue = initialValue;
|
| 3958 |
this.errorValue = errorValue;
|
| 3959 |
this.highStart = highStart;
|
| 3960 |
this.highValueIndex = highValueIndex;
|
| 3961 |
this.index = index;
|
| 3962 |
this.data = data;
|
| 3963 |
}
|
| 3964 |
/**
|
| 3965 |
* Get the value for a code point as stored in the Trie.
|
| 3966 |
*
|
| 3967 |
* @param codePoint the code point
|
| 3968 |
* @return the value
|
| 3969 |
*/
|
| 3970 |
Trie.prototype.get = function (codePoint) {
|
| 3971 |
var ix;
|
| 3972 |
if (codePoint >= 0) {
|
| 3973 |
if (codePoint < 0x0d800 || (codePoint > 0x0dbff && codePoint <= 0x0ffff)) {
|
| 3974 |
// Ordinary BMP code point, excluding leading surrogates.
|
| 3975 |
// BMP uses a single level lookup. BMP index starts at offset 0 in the Trie2 index.
|
| 3976 |
// 16 bit data is stored in the index array itself.
|
| 3977 |
ix = this.index[codePoint >> UTRIE2_SHIFT_2];
|
| 3978 |
ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
|
| 3979 |
return this.data[ix];
|
| 3980 |
}
|
| 3981 |
if (codePoint <= 0xffff) {
|
| 3982 |
// Lead Surrogate Code Point. A Separate index section is stored for
|
| 3983 |
// lead surrogate code units and code points.
|
| 3984 |
// The main index has the code unit data.
|
| 3985 |
// For this function, we need the code point data.
|
| 3986 |
// Note: this expression could be refactored for slightly improved efficiency, but
|
| 3987 |
// surrogate code points will be so rare in practice that it's not worth it.
|
| 3988 |
ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET + ((codePoint - 0xd800) >> UTRIE2_SHIFT_2)];
|
| 3989 |
ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
|
| 3990 |
return this.data[ix];
|
| 3991 |
}
|
| 3992 |
if (codePoint < this.highStart) {
|
| 3993 |
// Supplemental code point, use two-level lookup.
|
| 3994 |
ix = UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> UTRIE2_SHIFT_1);
|
| 3995 |
ix = this.index[ix];
|
| 3996 |
ix += (codePoint >> UTRIE2_SHIFT_2) & UTRIE2_INDEX_2_MASK;
|
| 3997 |
ix = this.index[ix];
|
| 3998 |
ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
|
| 3999 |
return this.data[ix];
|
| 4000 |
}
|
| 4001 |
if (codePoint <= 0x10ffff) {
|
| 4002 |
return this.data[this.highValueIndex];
|
| 4003 |
}
|
| 4004 |
}
|
| 4005 |
// Fall through. The code point is outside of the legal range of 0..0x10ffff.
|
| 4006 |
return this.errorValue;
|
| 4007 |
};
|
| 4008 |
return Trie;
|
| 4009 |
}());
|
| 4010 |
|
| 4011 |
/*
|
| 4012 |
* base64-arraybuffer 1.0.2 <https://github.com/niklasvh/base64-arraybuffer>
|
| 4013 |
* Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
|
| 4014 |
* Released under MIT License
|
| 4015 |
*/
|
| 4016 |
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
| 4017 |
// Use a lookup table to find the index.
|
| 4018 |
var lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);
|
| 4019 |
for (var i = 0; i < chars.length; i++) {
|
| 4020 |
lookup[chars.charCodeAt(i)] = i;
|
| 4021 |
}
|
| 4022 |
|
| 4023 |
var Prepend = 1;
|
| 4024 |
var CR = 2;
|
| 4025 |
var LF = 3;
|
| 4026 |
var Control = 4;
|
| 4027 |
var Extend = 5;
|
| 4028 |
var SpacingMark = 7;
|
| 4029 |
var L = 8;
|
| 4030 |
var V = 9;
|
| 4031 |
var T = 10;
|
| 4032 |
var LV = 11;
|
| 4033 |
var LVT = 12;
|
| 4034 |
var ZWJ = 13;
|
| 4035 |
var Extended_Pictographic = 14;
|
| 4036 |
var RI = 15;
|
| 4037 |
var toCodePoints = function (str) {
|
| 4038 |
var codePoints = [];
|
| 4039 |
var i = 0;
|
| 4040 |
var length = str.length;
|
| 4041 |
while (i < length) {
|
| 4042 |
var value = str.charCodeAt(i++);
|
| 4043 |
if (value >= 0xd800 && value <= 0xdbff && i < length) {
|
| 4044 |
var extra = str.charCodeAt(i++);
|
| 4045 |
if ((extra & 0xfc00) === 0xdc00) {
|
| 4046 |
codePoints.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000);
|
| 4047 |
}
|
| 4048 |
else {
|
| 4049 |
codePoints.push(value);
|
| 4050 |
i--;
|
| 4051 |
}
|
| 4052 |
}
|
| 4053 |
else {
|
| 4054 |
codePoints.push(value);
|
| 4055 |
}
|
| 4056 |
}
|
| 4057 |
return codePoints;
|
| 4058 |
};
|
| 4059 |
var fromCodePoint = function () {
|
| 4060 |
var codePoints = [];
|
| 4061 |
for (var _i = 0; _i < arguments.length; _i++) {
|
| 4062 |
codePoints[_i] = arguments[_i];
|
| 4063 |
}
|
| 4064 |
if (String.fromCodePoint) {
|
| 4065 |
return String.fromCodePoint.apply(String, codePoints);
|
| 4066 |
}
|
| 4067 |
var length = codePoints.length;
|
| 4068 |
if (!length) {
|
| 4069 |
return '';
|
| 4070 |
}
|
| 4071 |
var codeUnits = [];
|
| 4072 |
var index = -1;
|
| 4073 |
var result = '';
|
| 4074 |
while (++index < length) {
|
| 4075 |
var codePoint = codePoints[index];
|
| 4076 |
if (codePoint <= 0xffff) {
|
| 4077 |
codeUnits.push(codePoint);
|
| 4078 |
}
|
| 4079 |
else {
|
| 4080 |
codePoint -= 0x10000;
|
| 4081 |
codeUnits.push((codePoint >> 10) + 0xd800, (codePoint % 0x400) + 0xdc00);
|
| 4082 |
}
|
| 4083 |
if (index + 1 === length || codeUnits.length > 0x4000) {
|
| 4084 |
result += String.fromCharCode.apply(String, codeUnits);
|
| 4085 |
codeUnits.length = 0;
|
| 4086 |
}
|
| 4087 |
}
|
| 4088 |
return result;
|
| 4089 |
};
|
| 4090 |
var UnicodeTrie = createTrieFromBase64(base64);
|
| 4091 |
var BREAK_NOT_ALLOWED = '×';
|
| 4092 |
var BREAK_ALLOWED = '÷';
|
| 4093 |
var codePointToClass = function (codePoint) { return UnicodeTrie.get(codePoint); };
|
| 4094 |
var _graphemeBreakAtIndex = function (_codePoints, classTypes, index) {
|
| 4095 |
var prevIndex = index - 2;
|
| 4096 |
var prev = classTypes[prevIndex];
|
| 4097 |
var current = classTypes[index - 1];
|
| 4098 |
var next = classTypes[index];
|
| 4099 |
// GB3 Do not break between a CR and LF
|
| 4100 |
if (current === CR && next === LF) {
|
| 4101 |
return BREAK_NOT_ALLOWED;
|
| 4102 |
}
|
| 4103 |
// GB4 Otherwise, break before and after controls.
|
| 4104 |
if (current === CR || current === LF || current === Control) {
|
| 4105 |
return BREAK_ALLOWED;
|
| 4106 |
}
|
| 4107 |
// GB5
|
| 4108 |
if (next === CR || next === LF || next === Control) {
|
| 4109 |
return BREAK_ALLOWED;
|
| 4110 |
}
|
| 4111 |
// Do not break Hangul syllable sequences.
|
| 4112 |
// GB6
|
| 4113 |
if (current === L && [L, V, LV, LVT].indexOf(next) !== -1) {
|
| 4114 |
return BREAK_NOT_ALLOWED;
|
| 4115 |
}
|
| 4116 |
// GB7
|
| 4117 |
if ((current === LV || current === V) && (next === V || next === T)) {
|
| 4118 |
return BREAK_NOT_ALLOWED;
|
| 4119 |
}
|
| 4120 |
// GB8
|
| 4121 |
if ((current === LVT || current === T) && next === T) {
|
| 4122 |
return BREAK_NOT_ALLOWED;
|
| 4123 |
}
|
| 4124 |
// GB9 Do not break before extending characters or ZWJ.
|
| 4125 |
if (next === ZWJ || next === Extend) {
|
| 4126 |
return BREAK_NOT_ALLOWED;
|
| 4127 |
}
|
| 4128 |
// Do not break before SpacingMarks, or after Prepend characters.
|
| 4129 |
// GB9a
|
| 4130 |
if (next === SpacingMark) {
|
| 4131 |
return BREAK_NOT_ALLOWED;
|
| 4132 |
}
|
| 4133 |
// GB9a
|
| 4134 |
if (current === Prepend) {
|
| 4135 |
return BREAK_NOT_ALLOWED;
|
| 4136 |
}
|
| 4137 |
// GB11 Do not break within emoji modifier sequences or emoji zwj sequences.
|
| 4138 |
if (current === ZWJ && next === Extended_Pictographic) {
|
| 4139 |
while (prev === Extend) {
|
| 4140 |
prev = classTypes[--prevIndex];
|
| 4141 |
}
|
| 4142 |
if (prev === Extended_Pictographic) {
|
| 4143 |
return BREAK_NOT_ALLOWED;
|
| 4144 |
}
|
| 4145 |
}
|
| 4146 |
// GB12 Do not break within emoji flag sequences.
|
| 4147 |
// That is, do not break between regional indicator (RI) symbols
|
| 4148 |
// if there is an odd number of RI characters before the break point.
|
| 4149 |
if (current === RI && next === RI) {
|
| 4150 |
var countRI = 0;
|
| 4151 |
while (prev === RI) {
|
| 4152 |
countRI++;
|
| 4153 |
prev = classTypes[--prevIndex];
|
| 4154 |
}
|
| 4155 |
if (countRI % 2 === 0) {
|
| 4156 |
return BREAK_NOT_ALLOWED;
|
| 4157 |
}
|
| 4158 |
}
|
| 4159 |
return BREAK_ALLOWED;
|
| 4160 |
};
|
| 4161 |
var GraphemeBreaker = function (str) {
|
| 4162 |
var codePoints = toCodePoints(str);
|
| 4163 |
var length = codePoints.length;
|
| 4164 |
var index = 0;
|
| 4165 |
var lastEnd = 0;
|
| 4166 |
var classTypes = codePoints.map(codePointToClass);
|
| 4167 |
return {
|
| 4168 |
next: function () {
|
| 4169 |
if (index >= length) {
|
| 4170 |
return { done: true, value: null };
|
| 4171 |
}
|
| 4172 |
var graphemeBreak = BREAK_NOT_ALLOWED;
|
| 4173 |
while (index < length &&
|
| 4174 |
(graphemeBreak = _graphemeBreakAtIndex(codePoints, classTypes, ++index)) === BREAK_NOT_ALLOWED) { }
|
| 4175 |
if (graphemeBreak !== BREAK_NOT_ALLOWED || index === length) {
|
| 4176 |
var value = fromCodePoint.apply(null, codePoints.slice(lastEnd, index));
|
| 4177 |
lastEnd = index;
|
| 4178 |
return { value: value, done: false };
|
| 4179 |
}
|
| 4180 |
return { done: true, value: null };
|
| 4181 |
},
|
| 4182 |
};
|
| 4183 |
};
|
| 4184 |
var splitGraphemes = function (str) {
|
| 4185 |
var breaker = GraphemeBreaker(str);
|
| 4186 |
var graphemes = [];
|
| 4187 |
var bk;
|
| 4188 |
while (!(bk = breaker.next()).done) {
|
| 4189 |
if (bk.value) {
|
| 4190 |
graphemes.push(bk.value.slice());
|
| 4191 |
}
|
| 4192 |
}
|
| 4193 |
return graphemes;
|
| 4194 |
};
|
| 4195 |
|
| 4196 |
var testRangeBounds = function (document) {
|
| 4197 |
var TEST_HEIGHT = 123;
|
| 4198 |
if (document.createRange) {
|
| 4199 |
var range = document.createRange();
|
| 4200 |
if (range.getBoundingClientRect) {
|
| 4201 |
var testElement = document.createElement('boundtest');
|
| 4202 |
testElement.style.height = TEST_HEIGHT + "px";
|
| 4203 |
testElement.style.display = 'block';
|
| 4204 |
document.body.appendChild(testElement);
|
| 4205 |
range.selectNode(testElement);
|
| 4206 |
var rangeBounds = range.getBoundingClientRect();
|
| 4207 |
var rangeHeight = Math.round(rangeBounds.height);
|
| 4208 |
document.body.removeChild(testElement);
|
| 4209 |
if (rangeHeight === TEST_HEIGHT) {
|
| 4210 |
return true;
|
| 4211 |
}
|
| 4212 |
}
|
| 4213 |
}
|
| 4214 |
return false;
|
| 4215 |
};
|
| 4216 |
var testIOSLineBreak = function (document) {
|
| 4217 |
var testElement = document.createElement('boundtest');
|
| 4218 |
testElement.style.width = '50px';
|
| 4219 |
testElement.style.display = 'block';
|
| 4220 |
testElement.style.fontSize = '12px';
|
| 4221 |
testElement.style.letterSpacing = '0px';
|
| 4222 |
testElement.style.wordSpacing = '0px';
|
| 4223 |
document.body.appendChild(testElement);
|
| 4224 |
var range = document.createRange();
|
| 4225 |
testElement.innerHTML = typeof ''.repeat === 'function' ? '👨'.repeat(10) : '';
|
| 4226 |
var node = testElement.firstChild;
|
| 4227 |
var textList = toCodePoints$1(node.data).map(function (i) { return fromCodePoint$1(i); });
|
| 4228 |
var offset = 0;
|
| 4229 |
var prev = {};
|
| 4230 |
// ios 13 does not handle range getBoundingClientRect line changes correctly #2177
|
| 4231 |
var supports = textList.every(function (text, i) {
|
| 4232 |
range.setStart(node, offset);
|
| 4233 |
range.setEnd(node, offset + text.length);
|
| 4234 |
var rect = range.getBoundingClientRect();
|
| 4235 |
offset += text.length;
|
| 4236 |
var boundAhead = rect.x > prev.x || rect.y > prev.y;
|
| 4237 |
prev = rect;
|
| 4238 |
if (i === 0) {
|
| 4239 |
return true;
|
| 4240 |
}
|
| 4241 |
return boundAhead;
|
| 4242 |
});
|
| 4243 |
document.body.removeChild(testElement);
|
| 4244 |
return supports;
|
| 4245 |
};
|
| 4246 |
var testCORS = function () { return typeof new Image().crossOrigin !== 'undefined'; };
|
| 4247 |
var testResponseType = function () { return typeof new XMLHttpRequest().responseType === 'string'; };
|
| 4248 |
var testSVG = function (document) {
|
| 4249 |
var img = new Image();
|
| 4250 |
var canvas = document.createElement('canvas');
|
| 4251 |
var ctx = canvas.getContext('2d');
|
| 4252 |
if (!ctx) {
|
| 4253 |
return false;
|
| 4254 |
}
|
| 4255 |
img.src = "data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";
|
| 4256 |
try {
|
| 4257 |
ctx.drawImage(img, 0, 0);
|
| 4258 |
canvas.toDataURL();
|
| 4259 |
}
|
| 4260 |
catch (e) {
|
| 4261 |
return false;
|
| 4262 |
}
|
| 4263 |
return true;
|
| 4264 |
};
|
| 4265 |
var isGreenPixel = function (data) {
|
| 4266 |
return data[0] === 0 && data[1] === 255 && data[2] === 0 && data[3] === 255;
|
| 4267 |
};
|
| 4268 |
var testForeignObject = function (document) {
|
| 4269 |
var canvas = document.createElement('canvas');
|
| 4270 |
var size = 100;
|
| 4271 |
canvas.width = size;
|
| 4272 |
canvas.height = size;
|
| 4273 |
var ctx = canvas.getContext('2d');
|
| 4274 |
if (!ctx) {
|
| 4275 |
return Promise.reject(false);
|
| 4276 |
}
|
| 4277 |
ctx.fillStyle = 'rgb(0, 255, 0)';
|
| 4278 |
ctx.fillRect(0, 0, size, size);
|
| 4279 |
var img = new Image();
|
| 4280 |
var greenImageSrc = canvas.toDataURL();
|
| 4281 |
img.src = greenImageSrc;
|
| 4282 |
var svg = createForeignObjectSVG(size, size, 0, 0, img);
|
| 4283 |
ctx.fillStyle = 'red';
|
| 4284 |
ctx.fillRect(0, 0, size, size);
|
| 4285 |
return loadSerializedSVG$1(svg)
|
| 4286 |
.then(function (img) {
|
| 4287 |
ctx.drawImage(img, 0, 0);
|
| 4288 |
var data = ctx.getImageData(0, 0, size, size).data;
|
| 4289 |
ctx.fillStyle = 'red';
|
| 4290 |
ctx.fillRect(0, 0, size, size);
|
| 4291 |
var node = document.createElement('div');
|
| 4292 |
node.style.backgroundImage = "url(" + greenImageSrc + ")";
|
| 4293 |
node.style.height = size + "px";
|
| 4294 |
// Firefox 55 does not render inline <img /> tags
|
| 4295 |
return isGreenPixel(data)
|
| 4296 |
? loadSerializedSVG$1(createForeignObjectSVG(size, size, 0, 0, node))
|
| 4297 |
: Promise.reject(false);
|
| 4298 |
})
|
| 4299 |
.then(function (img) {
|
| 4300 |
ctx.drawImage(img, 0, 0);
|
| 4301 |
// Edge does not render background-images
|
| 4302 |
return isGreenPixel(ctx.getImageData(0, 0, size, size).data);
|
| 4303 |
})
|
| 4304 |
.catch(function () { return false; });
|
| 4305 |
};
|
| 4306 |
var createForeignObjectSVG = function (width, height, x, y, node) {
|
| 4307 |
var xmlns = 'http://www.w3.org/2000/svg';
|
| 4308 |
var svg = document.createElementNS(xmlns, 'svg');
|
| 4309 |
var foreignObject = document.createElementNS(xmlns, 'foreignObject');
|
| 4310 |
svg.setAttributeNS(null, 'width', width.toString());
|
| 4311 |
svg.setAttributeNS(null, 'height', height.toString());
|
| 4312 |
foreignObject.setAttributeNS(null, 'width', '100%');
|
| 4313 |
foreignObject.setAttributeNS(null, 'height', '100%');
|
| 4314 |
foreignObject.setAttributeNS(null, 'x', x.toString());
|
| 4315 |
foreignObject.setAttributeNS(null, 'y', y.toString());
|
| 4316 |
foreignObject.setAttributeNS(null, 'externalResourcesRequired', 'true');
|
| 4317 |
svg.appendChild(foreignObject);
|
| 4318 |
foreignObject.appendChild(node);
|
| 4319 |
return svg;
|
| 4320 |
};
|
| 4321 |
var loadSerializedSVG$1 = function (svg) {
|
| 4322 |
return new Promise(function (resolve, reject) {
|
| 4323 |
var img = new Image();
|
| 4324 |
img.onload = function () { return resolve(img); };
|
| 4325 |
img.onerror = reject;
|
| 4326 |
img.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(svg));
|
| 4327 |
});
|
| 4328 |
};
|
| 4329 |
var FEATURES = {
|
| 4330 |
get SUPPORT_RANGE_BOUNDS() {
|
| 4331 |
var value = testRangeBounds(document);
|
| 4332 |
Object.defineProperty(FEATURES, 'SUPPORT_RANGE_BOUNDS', { value: value });
|
| 4333 |
return value;
|
| 4334 |
},
|
| 4335 |
get SUPPORT_WORD_BREAKING() {
|
| 4336 |
var value = FEATURES.SUPPORT_RANGE_BOUNDS && testIOSLineBreak(document);
|
| 4337 |
Object.defineProperty(FEATURES, 'SUPPORT_WORD_BREAKING', { value: value });
|
| 4338 |
return value;
|
| 4339 |
},
|
| 4340 |
get SUPPORT_SVG_DRAWING() {
|
| 4341 |
var value = testSVG(document);
|
| 4342 |
Object.defineProperty(FEATURES, 'SUPPORT_SVG_DRAWING', { value: value });
|
| 4343 |
return value;
|
| 4344 |
},
|
| 4345 |
get SUPPORT_FOREIGNOBJECT_DRAWING() {
|
| 4346 |
var value = typeof Array.from === 'function' && typeof window.fetch === 'function'
|
| 4347 |
? testForeignObject(document)
|
| 4348 |
: Promise.resolve(false);
|
| 4349 |
Object.defineProperty(FEATURES, 'SUPPORT_FOREIGNOBJECT_DRAWING', { value: value });
|
| 4350 |
return value;
|
| 4351 |
},
|
| 4352 |
get SUPPORT_CORS_IMAGES() {
|
| 4353 |
var value = testCORS();
|
| 4354 |
Object.defineProperty(FEATURES, 'SUPPORT_CORS_IMAGES', { value: value });
|
| 4355 |
return value;
|
| 4356 |
},
|
| 4357 |
get SUPPORT_RESPONSE_TYPE() {
|
| 4358 |
var value = testResponseType();
|
| 4359 |
Object.defineProperty(FEATURES, 'SUPPORT_RESPONSE_TYPE', { value: value });
|
| 4360 |
return value;
|
| 4361 |
},
|
| 4362 |
get SUPPORT_CORS_XHR() {
|
| 4363 |
var value = 'withCredentials' in new XMLHttpRequest();
|
| 4364 |
Object.defineProperty(FEATURES, 'SUPPORT_CORS_XHR', { value: value });
|
| 4365 |
return value;
|
| 4366 |
},
|
| 4367 |
get SUPPORT_NATIVE_TEXT_SEGMENTATION() {
|
| 4368 |
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
| 4369 |
var value = !!(typeof Intl !== 'undefined' && Intl.Segmenter);
|
| 4370 |
Object.defineProperty(FEATURES, 'SUPPORT_NATIVE_TEXT_SEGMENTATION', { value: value });
|
| 4371 |
return value;
|
| 4372 |
}
|
| 4373 |
};
|
| 4374 |
|
| 4375 |
var TextBounds = /** @class */ (function () {
|
| 4376 |
function TextBounds(text, bounds) {
|
| 4377 |
this.text = text;
|
| 4378 |
this.bounds = bounds;
|
| 4379 |
}
|
| 4380 |
return TextBounds;
|
| 4381 |
}());
|
| 4382 |
var parseTextBounds = function (context, value, styles, node) {
|
| 4383 |
var textList = breakText(value, styles);
|
| 4384 |
var textBounds = [];
|
| 4385 |
var offset = 0;
|
| 4386 |
textList.forEach(function (text) {
|
| 4387 |
if (styles.textDecorationLine.length || text.trim().length > 0) {
|
| 4388 |
if (FEATURES.SUPPORT_RANGE_BOUNDS) {
|
| 4389 |
var clientRects = createRange(node, offset, text.length).getClientRects();
|
| 4390 |
if (clientRects.length > 1) {
|
| 4391 |
var subSegments = segmentGraphemes(text);
|
| 4392 |
var subOffset_1 = 0;
|
| 4393 |
subSegments.forEach(function (subSegment) {
|
| 4394 |
textBounds.push(new TextBounds(subSegment, Bounds.fromDOMRectList(context, createRange(node, subOffset_1 + offset, subSegment.length).getClientRects())));
|
| 4395 |
subOffset_1 += subSegment.length;
|
| 4396 |
});
|
| 4397 |
}
|
| 4398 |
else {
|
| 4399 |
textBounds.push(new TextBounds(text, Bounds.fromDOMRectList(context, clientRects)));
|
| 4400 |
}
|
| 4401 |
}
|
| 4402 |
else {
|
| 4403 |
var replacementNode = node.splitText(text.length);
|
| 4404 |
textBounds.push(new TextBounds(text, getWrapperBounds(context, node)));
|
| 4405 |
node = replacementNode;
|
| 4406 |
}
|
| 4407 |
}
|
| 4408 |
else if (!FEATURES.SUPPORT_RANGE_BOUNDS) {
|
| 4409 |
node = node.splitText(text.length);
|
| 4410 |
}
|
| 4411 |
offset += text.length;
|
| 4412 |
});
|
| 4413 |
return textBounds;
|
| 4414 |
};
|
| 4415 |
var getWrapperBounds = function (context, node) {
|
| 4416 |
var ownerDocument = node.ownerDocument;
|
| 4417 |
if (ownerDocument) {
|
| 4418 |
var wrapper = ownerDocument.createElement('html2canvaswrapper');
|
| 4419 |
wrapper.appendChild(node.cloneNode(true));
|
| 4420 |
var parentNode = node.parentNode;
|
| 4421 |
if (parentNode) {
|
| 4422 |
parentNode.replaceChild(wrapper, node);
|
| 4423 |
var bounds = parseBounds(context, wrapper);
|
| 4424 |
if (wrapper.firstChild) {
|
| 4425 |
parentNode.replaceChild(wrapper.firstChild, wrapper);
|
| 4426 |
}
|
| 4427 |
return bounds;
|
| 4428 |
}
|
| 4429 |
}
|
| 4430 |
return Bounds.EMPTY;
|
| 4431 |
};
|
| 4432 |
var createRange = function (node, offset, length) {
|
| 4433 |
var ownerDocument = node.ownerDocument;
|
| 4434 |
if (!ownerDocument) {
|
| 4435 |
throw new Error('Node has no owner document');
|
| 4436 |
}
|
| 4437 |
var range = ownerDocument.createRange();
|
| 4438 |
range.setStart(node, offset);
|
| 4439 |
range.setEnd(node, offset + length);
|
| 4440 |
return range;
|
| 4441 |
};
|
| 4442 |
var segmentGraphemes = function (value) {
|
| 4443 |
if (FEATURES.SUPPORT_NATIVE_TEXT_SEGMENTATION) {
|
| 4444 |
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
| 4445 |
var segmenter = new Intl.Segmenter(void 0, { granularity: 'grapheme' });
|
| 4446 |
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
| 4447 |
return Array.from(segmenter.segment(value)).map(function (segment) { return segment.segment; });
|
| 4448 |
}
|
| 4449 |
return splitGraphemes(value);
|
| 4450 |
};
|
| 4451 |
var segmentWords = function (value, styles) {
|
| 4452 |
if (FEATURES.SUPPORT_NATIVE_TEXT_SEGMENTATION) {
|
| 4453 |
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
| 4454 |
var segmenter = new Intl.Segmenter(void 0, {
|
| 4455 |
granularity: 'word'
|
| 4456 |
});
|
| 4457 |
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
| 4458 |
return Array.from(segmenter.segment(value)).map(function (segment) { return segment.segment; });
|
| 4459 |
}
|
| 4460 |
return breakWords(value, styles);
|
| 4461 |
};
|
| 4462 |
var breakText = function (value, styles) {
|
| 4463 |
return styles.letterSpacing !== 0 ? segmentGraphemes(value) : segmentWords(value, styles);
|
| 4464 |
};
|
| 4465 |
// https://drafts.csswg.org/css-text/#word-separator
|
| 4466 |
var wordSeparators = [0x0020, 0x00a0, 0x1361, 0x10100, 0x10101, 0x1039, 0x1091];
|
| 4467 |
var breakWords = function (str, styles) {
|
| 4468 |
var breaker = LineBreaker(str, {
|
| 4469 |
lineBreak: styles.lineBreak,
|
| 4470 |
wordBreak: styles.overflowWrap === "break-word" /* BREAK_WORD */ ? 'break-word' : styles.wordBreak
|
| 4471 |
});
|
| 4472 |
var words = [];
|
| 4473 |
var bk;
|
| 4474 |
var _loop_1 = function () {
|
| 4475 |
if (bk.value) {
|
| 4476 |
var value = bk.value.slice();
|
| 4477 |
var codePoints = toCodePoints$1(value);
|
| 4478 |
var word_1 = '';
|
| 4479 |
codePoints.forEach(function (codePoint) {
|
| 4480 |
if (wordSeparators.indexOf(codePoint) === -1) {
|
| 4481 |
word_1 += fromCodePoint$1(codePoint);
|
| 4482 |
}
|
| 4483 |
else {
|
| 4484 |
if (word_1.length) {
|
| 4485 |
words.push(word_1);
|
| 4486 |
}
|
| 4487 |
words.push(fromCodePoint$1(codePoint));
|
| 4488 |
word_1 = '';
|
| 4489 |
}
|
| 4490 |
});
|
| 4491 |
if (word_1.length) {
|
| 4492 |
words.push(word_1);
|
| 4493 |
}
|
| 4494 |
}
|
| 4495 |
};
|
| 4496 |
while (!(bk = breaker.next()).done) {
|
| 4497 |
_loop_1();
|
| 4498 |
}
|
| 4499 |
return words;
|
| 4500 |
};
|
| 4501 |
|
| 4502 |
var TextContainer = /** @class */ (function () {
|
| 4503 |
function TextContainer(context, node, styles) {
|
| 4504 |
this.text = transform(node.data, styles.textTransform);
|
| 4505 |
this.textBounds = parseTextBounds(context, this.text, styles, node);
|
| 4506 |
}
|
| 4507 |
return TextContainer;
|
| 4508 |
}());
|
| 4509 |
var transform = function (text, transform) {
|
| 4510 |
switch (transform) {
|
| 4511 |
case 1 /* LOWERCASE */:
|
| 4512 |
return text.toLowerCase();
|
| 4513 |
case 3 /* CAPITALIZE */:
|
| 4514 |
return text.replace(CAPITALIZE, capitalize);
|
| 4515 |
case 2 /* UPPERCASE */:
|
| 4516 |
return text.toUpperCase();
|
| 4517 |
default:
|
| 4518 |
return text;
|
| 4519 |
}
|
| 4520 |
};
|
| 4521 |
var CAPITALIZE = /(^|\s|:|-|\(|\))([a-z])/g;
|
| 4522 |
var capitalize = function (m, p1, p2) {
|
| 4523 |
if (m.length > 0) {
|
| 4524 |
return p1 + p2.toUpperCase();
|
| 4525 |
}
|
| 4526 |
return m;
|
| 4527 |
};
|
| 4528 |
|
| 4529 |
var ImageElementContainer = /** @class */ (function (_super) {
|
| 4530 |
__extends(ImageElementContainer, _super);
|
| 4531 |
function ImageElementContainer(context, img) {
|
| 4532 |
var _this = _super.call(this, context, img) || this;
|
| 4533 |
_this.src = img.currentSrc || img.src;
|
| 4534 |
_this.intrinsicWidth = img.naturalWidth;
|
| 4535 |
_this.intrinsicHeight = img.naturalHeight;
|
| 4536 |
_this.context.cache.addImage(_this.src);
|
| 4537 |
return _this;
|
| 4538 |
}
|
| 4539 |
return ImageElementContainer;
|
| 4540 |
}(ElementContainer));
|
| 4541 |
|
| 4542 |
var CanvasElementContainer = /** @class */ (function (_super) {
|
| 4543 |
__extends(CanvasElementContainer, _super);
|
| 4544 |
function CanvasElementContainer(context, canvas) {
|
| 4545 |
var _this = _super.call(this, context, canvas) || this;
|
| 4546 |
_this.canvas = canvas;
|
| 4547 |
_this.intrinsicWidth = canvas.width;
|
| 4548 |
_this.intrinsicHeight = canvas.height;
|
| 4549 |
return _this;
|
| 4550 |
}
|
| 4551 |
return CanvasElementContainer;
|
| 4552 |
}(ElementContainer));
|
| 4553 |
|
| 4554 |
var SVGElementContainer = /** @class */ (function (_super) {
|
| 4555 |
__extends(SVGElementContainer, _super);
|
| 4556 |
function SVGElementContainer(context, img) {
|
| 4557 |
var _this = _super.call(this, context, img) || this;
|
| 4558 |
var s = new XMLSerializer();
|
| 4559 |
var bounds = parseBounds(context, img);
|
| 4560 |
img.setAttribute('width', bounds.width + "px");
|
| 4561 |
img.setAttribute('height', bounds.height + "px");
|
| 4562 |
_this.svg = "data:image/svg+xml," + encodeURIComponent(s.serializeToString(img));
|
| 4563 |
_this.intrinsicWidth = img.width.baseVal.value;
|
| 4564 |
_this.intrinsicHeight = img.height.baseVal.value;
|
| 4565 |
_this.context.cache.addImage(_this.svg);
|
| 4566 |
return _this;
|
| 4567 |
}
|
| 4568 |
return SVGElementContainer;
|
| 4569 |
}(ElementContainer));
|
| 4570 |
|
| 4571 |
var LIElementContainer = /** @class */ (function (_super) {
|
| 4572 |
__extends(LIElementContainer, _super);
|
| 4573 |
function LIElementContainer(context, element) {
|
| 4574 |
var _this = _super.call(this, context, element) || this;
|
| 4575 |
_this.value = element.value;
|
| 4576 |
return _this;
|
| 4577 |
}
|
| 4578 |
return LIElementContainer;
|
| 4579 |
}(ElementContainer));
|
| 4580 |
|
| 4581 |
var OLElementContainer = /** @class */ (function (_super) {
|
| 4582 |
__extends(OLElementContainer, _super);
|
| 4583 |
function OLElementContainer(context, element) {
|
| 4584 |
var _this = _super.call(this, context, element) || this;
|
| 4585 |
_this.start = element.start;
|
| 4586 |
_this.reversed = typeof element.reversed === 'boolean' && element.reversed === true;
|
| 4587 |
return _this;
|
| 4588 |
}
|
| 4589 |
return OLElementContainer;
|
| 4590 |
}(ElementContainer));
|
| 4591 |
|
| 4592 |
var CHECKBOX_BORDER_RADIUS = [
|
| 4593 |
{
|
| 4594 |
type: 15 /* DIMENSION_TOKEN */,
|
| 4595 |
flags: 0,
|
| 4596 |
unit: 'px',
|
| 4597 |
number: 3
|
| 4598 |
}
|
| 4599 |
];
|
| 4600 |
var RADIO_BORDER_RADIUS = [
|
| 4601 |
{
|
| 4602 |
type: 16 /* PERCENTAGE_TOKEN */,
|
| 4603 |
flags: 0,
|
| 4604 |
number: 50
|
| 4605 |
}
|
| 4606 |
];
|
| 4607 |
var reformatInputBounds = function (bounds) {
|
| 4608 |
if (bounds.width > bounds.height) {
|
| 4609 |
return new Bounds(bounds.left + (bounds.width - bounds.height) / 2, bounds.top, bounds.height, bounds.height);
|
| 4610 |
}
|
| 4611 |
else if (bounds.width < bounds.height) {
|
| 4612 |
return new Bounds(bounds.left, bounds.top + (bounds.height - bounds.width) / 2, bounds.width, bounds.width);
|
| 4613 |
}
|
| 4614 |
return bounds;
|
| 4615 |
};
|
| 4616 |
var getInputValue = function (node) {
|
| 4617 |
var value = node.type === PASSWORD ? new Array(node.value.length + 1).join('\u2022') : node.value;
|
| 4618 |
return value.length === 0 ? node.placeholder || '' : value;
|
| 4619 |
};
|
| 4620 |
var CHECKBOX = 'checkbox';
|
| 4621 |
var RADIO = 'radio';
|
| 4622 |
var PASSWORD = 'password';
|
| 4623 |
var INPUT_COLOR = 0x2a2a2aff;
|
| 4624 |
var InputElementContainer = /** @class */ (function (_super) {
|
| 4625 |
__extends(InputElementContainer, _super);
|
| 4626 |
function InputElementContainer(context, input) {
|
| 4627 |
var _this = _super.call(this, context, input) || this;
|
| 4628 |
_this.type = input.type.toLowerCase();
|
| 4629 |
_this.checked = input.checked;
|
| 4630 |
_this.value = getInputValue(input);
|
| 4631 |
if (_this.type === CHECKBOX || _this.type === RADIO) {
|
| 4632 |
_this.styles.backgroundColor = 0xdededeff;
|
| 4633 |
_this.styles.borderTopColor =
|
| 4634 |
_this.styles.borderRightColor =
|
| 4635 |
_this.styles.borderBottomColor =
|
| 4636 |
_this.styles.borderLeftColor =
|
| 4637 |
0xa5a5a5ff;
|
| 4638 |
_this.styles.borderTopWidth =
|
| 4639 |
_this.styles.borderRightWidth =
|
| 4640 |
_this.styles.borderBottomWidth =
|
| 4641 |
_this.styles.borderLeftWidth =
|
| 4642 |
1;
|
| 4643 |
_this.styles.borderTopStyle =
|
| 4644 |
_this.styles.borderRightStyle =
|
| 4645 |
_this.styles.borderBottomStyle =
|
| 4646 |
_this.styles.borderLeftStyle =
|
| 4647 |
1 /* SOLID */;
|
| 4648 |
_this.styles.backgroundClip = [0 /* BORDER_BOX */];
|
| 4649 |
_this.styles.backgroundOrigin = [0 /* BORDER_BOX */];
|
| 4650 |
_this.bounds = reformatInputBounds(_this.bounds);
|
| 4651 |
}
|
| 4652 |
switch (_this.type) {
|
| 4653 |
case CHECKBOX:
|
| 4654 |
_this.styles.borderTopRightRadius =
|
| 4655 |
_this.styles.borderTopLeftRadius =
|
| 4656 |
_this.styles.borderBottomRightRadius =
|
| 4657 |
_this.styles.borderBottomLeftRadius =
|
| 4658 |
CHECKBOX_BORDER_RADIUS;
|
| 4659 |
break;
|
| 4660 |
case RADIO:
|
| 4661 |
_this.styles.borderTopRightRadius =
|
| 4662 |
_this.styles.borderTopLeftRadius =
|
| 4663 |
_this.styles.borderBottomRightRadius =
|
| 4664 |
_this.styles.borderBottomLeftRadius =
|
| 4665 |
RADIO_BORDER_RADIUS;
|
| 4666 |
break;
|
| 4667 |
}
|
| 4668 |
return _this;
|
| 4669 |
}
|
| 4670 |
return InputElementContainer;
|
| 4671 |
}(ElementContainer));
|
| 4672 |
|
| 4673 |
var SelectElementContainer = /** @class */ (function (_super) {
|
| 4674 |
__extends(SelectElementContainer, _super);
|
| 4675 |
function SelectElementContainer(context, element) {
|
| 4676 |
var _this = _super.call(this, context, element) || this;
|
| 4677 |
var option = element.options[element.selectedIndex || 0];
|
| 4678 |
_this.value = option ? option.text || '' : '';
|
| 4679 |
return _this;
|
| 4680 |
}
|
| 4681 |
return SelectElementContainer;
|
| 4682 |
}(ElementContainer));
|
| 4683 |
|
| 4684 |
var TextareaElementContainer = /** @class */ (function (_super) {
|
| 4685 |
__extends(TextareaElementContainer, _super);
|
| 4686 |
function TextareaElementContainer(context, element) {
|
| 4687 |
var _this = _super.call(this, context, element) || this;
|
| 4688 |
_this.value = element.value;
|
| 4689 |
return _this;
|
| 4690 |
}
|
| 4691 |
return TextareaElementContainer;
|
| 4692 |
}(ElementContainer));
|
| 4693 |
|
| 4694 |
var IFrameElementContainer = /** @class */ (function (_super) {
|
| 4695 |
__extends(IFrameElementContainer, _super);
|
| 4696 |
function IFrameElementContainer(context, iframe) {
|
| 4697 |
var _this = _super.call(this, context, iframe) || this;
|
| 4698 |
_this.src = iframe.src;
|
| 4699 |
_this.width = parseInt(iframe.width, 10) || 0;
|
| 4700 |
_this.height = parseInt(iframe.height, 10) || 0;
|
| 4701 |
_this.backgroundColor = _this.styles.backgroundColor;
|
| 4702 |
try {
|
| 4703 |
if (iframe.contentWindow &&
|
| 4704 |
iframe.contentWindow.document &&
|
| 4705 |
iframe.contentWindow.document.documentElement) {
|
| 4706 |
_this.tree = parseTree(context, iframe.contentWindow.document.documentElement);
|
| 4707 |
// http://www.w3.org/TR/css3-background/#special-backgrounds
|
| 4708 |
var documentBackgroundColor = iframe.contentWindow.document.documentElement
|
| 4709 |
? parseColor(context, getComputedStyle(iframe.contentWindow.document.documentElement).backgroundColor)
|
| 4710 |
: COLORS.TRANSPARENT;
|
| 4711 |
var bodyBackgroundColor = iframe.contentWindow.document.body
|
| 4712 |
? parseColor(context, getComputedStyle(iframe.contentWindow.document.body).backgroundColor)
|
| 4713 |
: COLORS.TRANSPARENT;
|
| 4714 |
_this.backgroundColor = isTransparent(documentBackgroundColor)
|
| 4715 |
? isTransparent(bodyBackgroundColor)
|
| 4716 |
? _this.styles.backgroundColor
|
| 4717 |
: bodyBackgroundColor
|
| 4718 |
: documentBackgroundColor;
|
| 4719 |
}
|
| 4720 |
}
|
| 4721 |
catch (e) { }
|
| 4722 |
return _this;
|
| 4723 |
}
|
| 4724 |
return IFrameElementContainer;
|
| 4725 |
}(ElementContainer));
|
| 4726 |
|
| 4727 |
var LIST_OWNERS = ['OL', 'UL', 'MENU'];
|
| 4728 |
var parseNodeTree = function (context, node, parent, root) {
|
| 4729 |
for (var childNode = node.firstChild, nextNode = void 0; childNode; childNode = nextNode) {
|
| 4730 |
nextNode = childNode.nextSibling;
|
| 4731 |
if (isTextNode(childNode) && childNode.data.trim().length > 0) {
|
| 4732 |
parent.textNodes.push(new TextContainer(context, childNode, parent.styles));
|
| 4733 |
}
|
| 4734 |
else if (isElementNode(childNode)) {
|
| 4735 |
if (isSlotElement(childNode) && childNode.assignedNodes) {
|
| 4736 |
childNode.assignedNodes().forEach(function (childNode) { return parseNodeTree(context, childNode, parent, root); });
|
| 4737 |
}
|
| 4738 |
else {
|
| 4739 |
var container = createContainer(context, childNode);
|
| 4740 |
if (container.styles.isVisible()) {
|
| 4741 |
if (createsRealStackingContext(childNode, container, root)) {
|
| 4742 |
container.flags |= 4 /* CREATES_REAL_STACKING_CONTEXT */;
|
| 4743 |
}
|
| 4744 |
else if (createsStackingContext(container.styles)) {
|
| 4745 |
container.flags |= 2 /* CREATES_STACKING_CONTEXT */;
|
| 4746 |
}
|
| 4747 |
if (LIST_OWNERS.indexOf(childNode.tagName) !== -1) {
|
| 4748 |
container.flags |= 8 /* IS_LIST_OWNER */;
|
| 4749 |
}
|
| 4750 |
parent.elements.push(container);
|
| 4751 |
childNode.slot;
|
| 4752 |
if (childNode.shadowRoot) {
|
| 4753 |
parseNodeTree(context, childNode.shadowRoot, container, root);
|
| 4754 |
}
|
| 4755 |
else if (!isTextareaElement(childNode) &&
|
| 4756 |
!isSVGElement(childNode) &&
|
| 4757 |
!isSelectElement(childNode)) {
|
| 4758 |
parseNodeTree(context, childNode, container, root);
|
| 4759 |
}
|
| 4760 |
}
|
| 4761 |
}
|
| 4762 |
}
|
| 4763 |
}
|
| 4764 |
};
|
| 4765 |
var createContainer = function (context, element) {
|
| 4766 |
if (isImageElement(element)) {
|
| 4767 |
return new ImageElementContainer(context, element);
|
| 4768 |
}
|
| 4769 |
if (isCanvasElement(element)) {
|
| 4770 |
return new CanvasElementContainer(context, element);
|
| 4771 |
}
|
| 4772 |
if (isSVGElement(element)) {
|
| 4773 |
return new SVGElementContainer(context, element);
|
| 4774 |
}
|
| 4775 |
if (isLIElement(element)) {
|
| 4776 |
return new LIElementContainer(context, element);
|
| 4777 |
}
|
| 4778 |
if (isOLElement(element)) {
|
| 4779 |
return new OLElementContainer(context, element);
|
| 4780 |
}
|
| 4781 |
if (isInputElement(element)) {
|
| 4782 |
return new InputElementContainer(context, element);
|
| 4783 |
}
|
| 4784 |
if (isSelectElement(element)) {
|
| 4785 |
return new SelectElementContainer(context, element);
|
| 4786 |
}
|
| 4787 |
if (isTextareaElement(element)) {
|
| 4788 |
return new TextareaElementContainer(context, element);
|
| 4789 |
}
|
| 4790 |
if (isIFrameElement(element)) {
|
| 4791 |
return new IFrameElementContainer(context, element);
|
| 4792 |
}
|
| 4793 |
return new ElementContainer(context, element);
|
| 4794 |
};
|
| 4795 |
var parseTree = function (context, element) {
|
| 4796 |
var container = createContainer(context, element);
|
| 4797 |
container.flags |= 4 /* CREATES_REAL_STACKING_CONTEXT */;
|
| 4798 |
parseNodeTree(context, element, container, container);
|
| 4799 |
return container;
|
| 4800 |
};
|
| 4801 |
var createsRealStackingContext = function (node, container, root) {
|
| 4802 |
return (container.styles.isPositionedWithZIndex() ||
|
| 4803 |
container.styles.opacity < 1 ||
|
| 4804 |
container.styles.isTransformed() ||
|
| 4805 |
(isBodyElement(node) && root.styles.isTransparent()));
|
| 4806 |
};
|
| 4807 |
var createsStackingContext = function (styles) { return styles.isPositioned() || styles.isFloating(); };
|
| 4808 |
var isTextNode = function (node) { return node.nodeType === Node.TEXT_NODE; };
|
| 4809 |
var isElementNode = function (node) { return node.nodeType === Node.ELEMENT_NODE; };
|
| 4810 |
var isHTMLElementNode = function (node) {
|
| 4811 |
return isElementNode(node) && typeof node.style !== 'undefined' && !isSVGElementNode(node);
|
| 4812 |
};
|
| 4813 |
var isSVGElementNode = function (element) {
|
| 4814 |
return typeof element.className === 'object';
|
| 4815 |
};
|
| 4816 |
var isLIElement = function (node) { return node.tagName === 'LI'; };
|
| 4817 |
var isOLElement = function (node) { return node.tagName === 'OL'; };
|
| 4818 |
var isInputElement = function (node) { return node.tagName === 'INPUT'; };
|
| 4819 |
var isHTMLElement = function (node) { return node.tagName === 'HTML'; };
|
| 4820 |
var isSVGElement = function (node) { return node.tagName === 'svg'; };
|
| 4821 |
var isBodyElement = function (node) { return node.tagName === 'BODY'; };
|
| 4822 |
var isCanvasElement = function (node) { return node.tagName === 'CANVAS'; };
|
| 4823 |
var isVideoElement = function (node) { return node.tagName === 'VIDEO'; };
|
| 4824 |
var isImageElement = function (node) { return node.tagName === 'IMG'; };
|
| 4825 |
var isIFrameElement = function (node) { return node.tagName === 'IFRAME'; };
|
| 4826 |
var isStyleElement = function (node) { return node.tagName === 'STYLE'; };
|
| 4827 |
var isScriptElement = function (node) { return node.tagName === 'SCRIPT'; };
|
| 4828 |
var isTextareaElement = function (node) { return node.tagName === 'TEXTAREA'; };
|
| 4829 |
var isSelectElement = function (node) { return node.tagName === 'SELECT'; };
|
| 4830 |
var isSlotElement = function (node) { return node.tagName === 'SLOT'; };
|
| 4831 |
// https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name
|
| 4832 |
var isCustomElement = function (node) { return node.tagName.indexOf('-') > 0; };
|
| 4833 |
|
| 4834 |
var CounterState = /** @class */ (function () {
|
| 4835 |
function CounterState() {
|
| 4836 |
this.counters = {};
|
| 4837 |
}
|
| 4838 |
CounterState.prototype.getCounterValue = function (name) {
|
| 4839 |
var counter = this.counters[name];
|
| 4840 |
if (counter && counter.length) {
|
| 4841 |
return counter[counter.length - 1];
|
| 4842 |
}
|
| 4843 |
return 1;
|
| 4844 |
};
|
| 4845 |
CounterState.prototype.getCounterValues = function (name) {
|
| 4846 |
var counter = this.counters[name];
|
| 4847 |
return counter ? counter : [];
|
| 4848 |
};
|
| 4849 |
CounterState.prototype.pop = function (counters) {
|
| 4850 |
var _this = this;
|
| 4851 |
counters.forEach(function (counter) { return _this.counters[counter].pop(); });
|
| 4852 |
};
|
| 4853 |
CounterState.prototype.parse = function (style) {
|
| 4854 |
var _this = this;
|
| 4855 |
var counterIncrement = style.counterIncrement;
|
| 4856 |
var counterReset = style.counterReset;
|
| 4857 |
var canReset = true;
|
| 4858 |
if (counterIncrement !== null) {
|
| 4859 |
counterIncrement.forEach(function (entry) {
|
| 4860 |
var counter = _this.counters[entry.counter];
|
| 4861 |
if (counter && entry.increment !== 0) {
|
| 4862 |
canReset = false;
|
| 4863 |
if (!counter.length) {
|
| 4864 |
counter.push(1);
|
| 4865 |
}
|
| 4866 |
counter[Math.max(0, counter.length - 1)] += entry.increment;
|
| 4867 |
}
|
| 4868 |
});
|
| 4869 |
}
|
| 4870 |
var counterNames = [];
|
| 4871 |
if (canReset) {
|
| 4872 |
counterReset.forEach(function (entry) {
|
| 4873 |
var counter = _this.counters[entry.counter];
|
| 4874 |
counterNames.push(entry.counter);
|
| 4875 |
if (!counter) {
|
| 4876 |
counter = _this.counters[entry.counter] = [];
|
| 4877 |
}
|
| 4878 |
counter.push(entry.reset);
|
| 4879 |
});
|
| 4880 |
}
|
| 4881 |
return counterNames;
|
| 4882 |
};
|
| 4883 |
return CounterState;
|
| 4884 |
}());
|
| 4885 |
var ROMAN_UPPER = {
|
| 4886 |
integers: [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1],
|
| 4887 |
values: ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']
|
| 4888 |
};
|
| 4889 |
var ARMENIAN = {
|
| 4890 |
integers: [
|
| 4891 |
9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70,
|
| 4892 |
60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
|
| 4893 |
],
|
| 4894 |
values: [
|
| 4895 |
'Ք',
|
| 4896 |
'Փ',
|
| 4897 |
'Ւ',
|
| 4898 |
'Ց',
|
| 4899 |
'Ր',
|
| 4900 |
'Տ',
|
| 4901 |
'Վ',
|
| 4902 |
'Ս',
|
| 4903 |
'Ռ',
|
| 4904 |
'Ջ',
|
| 4905 |
'Պ',
|
| 4906 |
'Չ',
|
| 4907 |
'Ո',
|
| 4908 |
'Շ',
|
| 4909 |
'Ն',
|
| 4910 |
'Յ',
|
| 4911 |
'Մ',
|
| 4912 |
'Ճ',
|
| 4913 |
'Ղ',
|
| 4914 |
'Ձ',
|
| 4915 |
'Հ',
|
| 4916 |
'Կ',
|
| 4917 |
'Ծ',
|
| 4918 |
'Խ',
|
| 4919 |
'Լ',
|
| 4920 |
'Ի',
|
| 4921 |
'Ժ',
|
| 4922 |
'Թ',
|
| 4923 |
'Ը',
|
| 4924 |
'Է',
|
| 4925 |
'Զ',
|
| 4926 |
'Ե',
|
| 4927 |
'Դ',
|
| 4928 |
'Գ',
|
| 4929 |
'Բ',
|
| 4930 |
'Ա'
|
| 4931 |
]
|
| 4932 |
};
|
| 4933 |
var HEBREW = {
|
| 4934 |
integers: [
|
| 4935 |
10000, 9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20,
|
| 4936 |
19, 18, 17, 16, 15, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
|
| 4937 |
],
|
| 4938 |
values: [
|
| 4939 |
'י׳',
|
| 4940 |
'ט׳',
|
| 4941 |
'ח׳',
|
| 4942 |
'ז׳',
|
| 4943 |
'ו׳',
|
| 4944 |
'ה׳',
|
| 4945 |
'ד׳',
|
| 4946 |
'ג׳',
|
| 4947 |
'ב׳',
|
| 4948 |
'א׳',
|
| 4949 |
'ת',
|
| 4950 |
'ש',
|
| 4951 |
'ר',
|
| 4952 |
'ק',
|
| 4953 |
'צ',
|
| 4954 |
'פ',
|
| 4955 |
'ע',
|
| 4956 |
'ס',
|
| 4957 |
'נ',
|
| 4958 |
'מ',
|
| 4959 |
'ל',
|
| 4960 |
'כ',
|
| 4961 |
'יט',
|
| 4962 |
'יח',
|
| 4963 |
'יז',
|
| 4964 |
'טז',
|
| 4965 |
'טו',
|
| 4966 |
'י',
|
| 4967 |
'ט',
|
| 4968 |
'ח',
|
| 4969 |
'ז',
|
| 4970 |
'ו',
|
| 4971 |
'ה',
|
| 4972 |
'ד',
|
| 4973 |
'ג',
|
| 4974 |
'ב',
|
| 4975 |
'א'
|
| 4976 |
]
|
| 4977 |
};
|
| 4978 |
var GEORGIAN = {
|
| 4979 |
integers: [
|
| 4980 |
10000, 9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90,
|
| 4981 |
80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
|
| 4982 |
],
|
| 4983 |
values: [
|
| 4984 |
'ჵ',
|
| 4985 |
'ჰ',
|
| 4986 |
'ჯ',
|
| 4987 |
'ჴ',
|
| 4988 |
'ხ',
|
| 4989 |
'ჭ',
|
| 4990 |
'წ',
|
| 4991 |
'ძ',
|
| 4992 |
'ც',
|
| 4993 |
'ჩ',
|
| 4994 |
'შ',
|
| 4995 |
'ყ',
|
| 4996 |
'ღ',
|
| 4997 |
'ქ',
|
| 4998 |
'ფ',
|
| 4999 |
'ჳ',
|
| 5000 |
'ტ',
|
| 5001 |
'ს',
|
| 5002 |
'რ',
|
| 5003 |
'ჟ',
|
| 5004 |
'პ',
|
| 5005 |
'ო',
|
| 5006 |
'ჲ',
|
| 5007 |
'ნ',
|
| 5008 |
'მ',
|
| 5009 |
'ლ',
|
| 5010 |
'კ',
|
| 5011 |
'ი',
|
| 5012 |
'თ',
|
| 5013 |
'ჱ',
|
| 5014 |
'ზ',
|
| 5015 |
'ვ',
|
| 5016 |
'ე',
|
| 5017 |
'დ',
|
| 5018 |
'გ',
|
| 5019 |
'ბ',
|
| 5020 |
'ა'
|
| 5021 |
]
|
| 5022 |
};
|
| 5023 |
var createAdditiveCounter = function (value, min, max, symbols, fallback, suffix) {
|
| 5024 |
if (value < min || value > max) {
|
| 5025 |
return createCounterText(value, fallback, suffix.length > 0);
|
| 5026 |
}
|
| 5027 |
return (symbols.integers.reduce(function (string, integer, index) {
|
| 5028 |
while (value >= integer) {
|
| 5029 |
value -= integer;
|
| 5030 |
string += symbols.values[index];
|
| 5031 |
}
|
| 5032 |
return string;
|
| 5033 |
}, '') + suffix);
|
| 5034 |
};
|
| 5035 |
var createCounterStyleWithSymbolResolver = function (value, codePointRangeLength, isNumeric, resolver) {
|
| 5036 |
var string = '';
|
| 5037 |
do {
|
| 5038 |
if (!isNumeric) {
|
| 5039 |
value--;
|
| 5040 |
}
|
| 5041 |
string = resolver(value) + string;
|
| 5042 |
value /= codePointRangeLength;
|
| 5043 |
} while (value * codePointRangeLength >= codePointRangeLength);
|
| 5044 |
return string;
|
| 5045 |
};
|
| 5046 |
var createCounterStyleFromRange = function (value, codePointRangeStart, codePointRangeEnd, isNumeric, suffix) {
|
| 5047 |
var codePointRangeLength = codePointRangeEnd - codePointRangeStart + 1;
|
| 5048 |
return ((value < 0 ? '-' : '') +
|
| 5049 |
(createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, isNumeric, function (codePoint) {
|
| 5050 |
return fromCodePoint$1(Math.floor(codePoint % codePointRangeLength) + codePointRangeStart);
|
| 5051 |
}) +
|
| 5052 |
suffix));
|
| 5053 |
};
|
| 5054 |
var createCounterStyleFromSymbols = function (value, symbols, suffix) {
|
| 5055 |
if (suffix === void 0) { suffix = '. '; }
|
| 5056 |
var codePointRangeLength = symbols.length;
|
| 5057 |
return (createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, false, function (codePoint) { return symbols[Math.floor(codePoint % codePointRangeLength)]; }) + suffix);
|
| 5058 |
};
|
| 5059 |
var CJK_ZEROS = 1 << 0;
|
| 5060 |
var CJK_TEN_COEFFICIENTS = 1 << 1;
|
| 5061 |
var CJK_TEN_HIGH_COEFFICIENTS = 1 << 2;
|
| 5062 |
var CJK_HUNDRED_COEFFICIENTS = 1 << 3;
|
| 5063 |
var createCJKCounter = function (value, numbers, multipliers, negativeSign, suffix, flags) {
|
| 5064 |
if (value < -9999 || value > 9999) {
|
| 5065 |
return createCounterText(value, 4 /* CJK_DECIMAL */, suffix.length > 0);
|
| 5066 |
}
|
| 5067 |
var tmp = Math.abs(value);
|
| 5068 |
var string = suffix;
|
| 5069 |
if (tmp === 0) {
|
| 5070 |
return numbers[0] + string;
|
| 5071 |
}
|
| 5072 |
for (var digit = 0; tmp > 0 && digit <= 4; digit++) {
|
| 5073 |
var coefficient = tmp % 10;
|
| 5074 |
if (coefficient === 0 && contains(flags, CJK_ZEROS) && string !== '') {
|
| 5075 |
string = numbers[coefficient] + string;
|
| 5076 |
}
|
| 5077 |
else if (coefficient > 1 ||
|
| 5078 |
(coefficient === 1 && digit === 0) ||
|
| 5079 |
(coefficient === 1 && digit === 1 && contains(flags, CJK_TEN_COEFFICIENTS)) ||
|
| 5080 |
(coefficient === 1 && digit === 1 && contains(flags, CJK_TEN_HIGH_COEFFICIENTS) && value > 100) ||
|
| 5081 |
(coefficient === 1 && digit > 1 && contains(flags, CJK_HUNDRED_COEFFICIENTS))) {
|
| 5082 |
string = numbers[coefficient] + (digit > 0 ? multipliers[digit - 1] : '') + string;
|
| 5083 |
}
|
| 5084 |
else if (coefficient === 1 && digit > 0) {
|
| 5085 |
string = multipliers[digit - 1] + string;
|
| 5086 |
}
|
| 5087 |
tmp = Math.floor(tmp / 10);
|
| 5088 |
}
|
| 5089 |
return (value < 0 ? negativeSign : '') + string;
|
| 5090 |
};
|
| 5091 |
var CHINESE_INFORMAL_MULTIPLIERS = '十百千萬';
|
| 5092 |
var CHINESE_FORMAL_MULTIPLIERS = '拾佰仟萬';
|
| 5093 |
var JAPANESE_NEGATIVE = 'マイナス';
|
| 5094 |
var KOREAN_NEGATIVE = '마이너스';
|
| 5095 |
var createCounterText = function (value, type, appendSuffix) {
|
| 5096 |
var defaultSuffix = appendSuffix ? '. ' : '';
|
| 5097 |
var cjkSuffix = appendSuffix ? '、' : '';
|
| 5098 |
var koreanSuffix = appendSuffix ? ', ' : '';
|
| 5099 |
var spaceSuffix = appendSuffix ? ' ' : '';
|
| 5100 |
switch (type) {
|
| 5101 |
case 0 /* DISC */:
|
| 5102 |
return '•' + spaceSuffix;
|
| 5103 |
case 1 /* CIRCLE */:
|
| 5104 |
return '◦' + spaceSuffix;
|
| 5105 |
case 2 /* SQUARE */:
|
| 5106 |
return '◾' + spaceSuffix;
|
| 5107 |
case 5 /* DECIMAL_LEADING_ZERO */:
|
| 5108 |
var string = createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);
|
| 5109 |
return string.length < 4 ? "0" + string : string;
|
| 5110 |
case 4 /* CJK_DECIMAL */:
|
| 5111 |
return createCounterStyleFromSymbols(value, '〇一二三四五六七八九', cjkSuffix);
|
| 5112 |
case 6 /* LOWER_ROMAN */:
|
| 5113 |
return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, 3 /* DECIMAL */, defaultSuffix).toLowerCase();
|
| 5114 |
case 7 /* UPPER_ROMAN */:
|
| 5115 |
return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, 3 /* DECIMAL */, defaultSuffix);
|
| 5116 |
case 8 /* LOWER_GREEK */:
|
| 5117 |
return createCounterStyleFromRange(value, 945, 969, false, defaultSuffix);
|
| 5118 |
case 9 /* LOWER_ALPHA */:
|
| 5119 |
return createCounterStyleFromRange(value, 97, 122, false, defaultSuffix);
|
| 5120 |
case 10 /* UPPER_ALPHA */:
|
| 5121 |
return createCounterStyleFromRange(value, 65, 90, false, defaultSuffix);
|
| 5122 |
case 11 /* ARABIC_INDIC */:
|
| 5123 |
return createCounterStyleFromRange(value, 1632, 1641, true, defaultSuffix);
|
| 5124 |
case 12 /* ARMENIAN */:
|
| 5125 |
case 49 /* UPPER_ARMENIAN */:
|
| 5126 |
return createAdditiveCounter(value, 1, 9999, ARMENIAN, 3 /* DECIMAL */, defaultSuffix);
|
| 5127 |
case 35 /* LOWER_ARMENIAN */:
|
| 5128 |
return createAdditiveCounter(value, 1, 9999, ARMENIAN, 3 /* DECIMAL */, defaultSuffix).toLowerCase();
|
| 5129 |
case 13 /* BENGALI */:
|
| 5130 |
return createCounterStyleFromRange(value, 2534, 2543, true, defaultSuffix);
|
| 5131 |
case 14 /* CAMBODIAN */:
|
| 5132 |
case 30 /* KHMER */:
|
| 5133 |
return createCounterStyleFromRange(value, 6112, 6121, true, defaultSuffix);
|
| 5134 |
case 15 /* CJK_EARTHLY_BRANCH */:
|
| 5135 |
return createCounterStyleFromSymbols(value, '子丑寅卯辰巳午未申酉戌亥', cjkSuffix);
|
| 5136 |
case 16 /* CJK_HEAVENLY_STEM */:
|
| 5137 |
return createCounterStyleFromSymbols(value, '甲乙丙丁戊己庚辛壬癸', cjkSuffix);
|
| 5138 |
case 17 /* CJK_IDEOGRAPHIC */:
|
| 5139 |
case 48 /* TRAD_CHINESE_INFORMAL */:
|
| 5140 |
return createCJKCounter(value, '零一二三四五六七八九', CHINESE_INFORMAL_MULTIPLIERS, '負', cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
|
| 5141 |
case 47 /* TRAD_CHINESE_FORMAL */:
|
| 5142 |
return createCJKCounter(value, '零壹貳參肆伍陸柒捌玖', CHINESE_FORMAL_MULTIPLIERS, '負', cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
|
| 5143 |
case 42 /* SIMP_CHINESE_INFORMAL */:
|
| 5144 |
return createCJKCounter(value, '零一二三四五六七八九', CHINESE_INFORMAL_MULTIPLIERS, '负', cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
|
| 5145 |
case 41 /* SIMP_CHINESE_FORMAL */:
|
| 5146 |
return createCJKCounter(value, '零壹贰叁肆伍陆柒捌玖', CHINESE_FORMAL_MULTIPLIERS, '负', cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
|
| 5147 |
case 26 /* JAPANESE_INFORMAL */:
|
| 5148 |
return createCJKCounter(value, '〇一二三四五六七八九', '十百千万', JAPANESE_NEGATIVE, cjkSuffix, 0);
|
| 5149 |
case 25 /* JAPANESE_FORMAL */:
|
| 5150 |
return createCJKCounter(value, '零壱弐参四伍六七八九', '拾百千万', JAPANESE_NEGATIVE, cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
|
| 5151 |
case 31 /* KOREAN_HANGUL_FORMAL */:
|
| 5152 |
return createCJKCounter(value, '영일이삼사오육칠팔구', '십백천만', KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
|
| 5153 |
case 33 /* KOREAN_HANJA_INFORMAL */:
|
| 5154 |
return createCJKCounter(value, '零一二三四五六七八九', '十百千萬', KOREAN_NEGATIVE, koreanSuffix, 0);
|
| 5155 |
case 32 /* KOREAN_HANJA_FORMAL */:
|
| 5156 |
return createCJKCounter(value, '零壹貳參四五六七八九', '拾百千', KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
|
| 5157 |
case 18 /* DEVANAGARI */:
|
| 5158 |
return createCounterStyleFromRange(value, 0x966, 0x96f, true, defaultSuffix);
|
| 5159 |
case 20 /* GEORGIAN */:
|
| 5160 |
return createAdditiveCounter(value, 1, 19999, GEORGIAN, 3 /* DECIMAL */, defaultSuffix);
|
| 5161 |
case 21 /* GUJARATI */:
|
| 5162 |
return createCounterStyleFromRange(value, 0xae6, 0xaef, true, defaultSuffix);
|
| 5163 |
case 22 /* GURMUKHI */:
|
| 5164 |
return createCounterStyleFromRange(value, 0xa66, 0xa6f, true, defaultSuffix);
|
| 5165 |
case 22 /* HEBREW */:
|
| 5166 |
return createAdditiveCounter(value, 1, 10999, HEBREW, 3 /* DECIMAL */, defaultSuffix);
|
| 5167 |
case 23 /* HIRAGANA */:
|
| 5168 |
return createCounterStyleFromSymbols(value, 'あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん');
|
| 5169 |
case 24 /* HIRAGANA_IROHA */:
|
| 5170 |
return createCounterStyleFromSymbols(value, 'いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす');
|
| 5171 |
case 27 /* KANNADA */:
|
| 5172 |
return createCounterStyleFromRange(value, 0xce6, 0xcef, true, defaultSuffix);
|
| 5173 |
case 28 /* KATAKANA */:
|
| 5174 |
return createCounterStyleFromSymbols(value, 'アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン', cjkSuffix);
|
| 5175 |
case 29 /* KATAKANA_IROHA */:
|
| 5176 |
return createCounterStyleFromSymbols(value, 'イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス', cjkSuffix);
|
| 5177 |
case 34 /* LAO */:
|
| 5178 |
return createCounterStyleFromRange(value, 0xed0, 0xed9, true, defaultSuffix);
|
| 5179 |
case 37 /* MONGOLIAN */:
|
| 5180 |
return createCounterStyleFromRange(value, 0x1810, 0x1819, true, defaultSuffix);
|
| 5181 |
case 38 /* MYANMAR */:
|
| 5182 |
return createCounterStyleFromRange(value, 0x1040, 0x1049, true, defaultSuffix);
|
| 5183 |
case 39 /* ORIYA */:
|
| 5184 |
return createCounterStyleFromRange(value, 0xb66, 0xb6f, true, defaultSuffix);
|
| 5185 |
case 40 /* PERSIAN */:
|
| 5186 |
return createCounterStyleFromRange(value, 0x6f0, 0x6f9, true, defaultSuffix);
|
| 5187 |
case 43 /* TAMIL */:
|
| 5188 |
return createCounterStyleFromRange(value, 0xbe6, 0xbef, true, defaultSuffix);
|
| 5189 |
case 44 /* TELUGU */:
|
| 5190 |
return createCounterStyleFromRange(value, 0xc66, 0xc6f, true, defaultSuffix);
|
| 5191 |
case 45 /* THAI */:
|
| 5192 |
return createCounterStyleFromRange(value, 0xe50, 0xe59, true, defaultSuffix);
|
| 5193 |
case 46 /* TIBETAN */:
|
| 5194 |
return createCounterStyleFromRange(value, 0xf20, 0xf29, true, defaultSuffix);
|
| 5195 |
case 3 /* DECIMAL */:
|
| 5196 |
default:
|
| 5197 |
return createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);
|
| 5198 |
}
|
| 5199 |
};
|
| 5200 |
|
| 5201 |
var IGNORE_ATTRIBUTE = 'data-html2canvas-ignore';
|
| 5202 |
var DocumentCloner = /** @class */ (function () {
|
| 5203 |
function DocumentCloner(context, element, options) {
|
| 5204 |
this.context = context;
|
| 5205 |
this.options = options;
|
| 5206 |
this.scrolledElements = [];
|
| 5207 |
this.referenceElement = element;
|
| 5208 |
this.counters = new CounterState();
|
| 5209 |
this.quoteDepth = 0;
|
| 5210 |
if (!element.ownerDocument) {
|
| 5211 |
throw new Error('Cloned element does not have an owner document');
|
| 5212 |
}
|
| 5213 |
this.documentElement = this.cloneNode(element.ownerDocument.documentElement, false);
|
| 5214 |
}
|
| 5215 |
DocumentCloner.prototype.toIFrame = function (ownerDocument, windowSize) {
|
| 5216 |
var _this = this;
|
| 5217 |
var iframe = createIFrameContainer(ownerDocument, windowSize);
|
| 5218 |
if (!iframe.contentWindow) {
|
| 5219 |
return Promise.reject("Unable to find iframe window");
|
| 5220 |
}
|
| 5221 |
var scrollX = ownerDocument.defaultView.pageXOffset;
|
| 5222 |
var scrollY = ownerDocument.defaultView.pageYOffset;
|
| 5223 |
var cloneWindow = iframe.contentWindow;
|
| 5224 |
var documentClone = cloneWindow.document;
|
| 5225 |
/* Chrome doesn't detect relative background-images assigned in inline <style> sheets when fetched through getComputedStyle
|
| 5226 |
if window url is about:blank, we can assign the url to current by writing onto the document
|
| 5227 |
*/
|
| 5228 |
var iframeLoad = iframeLoader(iframe).then(function () { return __awaiter(_this, void 0, void 0, function () {
|
| 5229 |
var onclone, referenceElement;
|
| 5230 |
return __generator(this, function (_a) {
|
| 5231 |
switch (_a.label) {
|
| 5232 |
case 0:
|
| 5233 |
this.scrolledElements.forEach(restoreNodeScroll);
|
| 5234 |
if (cloneWindow) {
|
| 5235 |
cloneWindow.scrollTo(windowSize.left, windowSize.top);
|
| 5236 |
if (/(iPad|iPhone|iPod)/g.test(navigator.userAgent) &&
|
| 5237 |
(cloneWindow.scrollY !== windowSize.top || cloneWindow.scrollX !== windowSize.left)) {
|
| 5238 |
this.context.logger.warn('Unable to restore scroll position for cloned document');
|
| 5239 |
this.context.windowBounds = this.context.windowBounds.add(cloneWindow.scrollX - windowSize.left, cloneWindow.scrollY - windowSize.top, 0, 0);
|
| 5240 |
}
|
| 5241 |
}
|
| 5242 |
onclone = this.options.onclone;
|
| 5243 |
referenceElement = this.clonedReferenceElement;
|
| 5244 |
if (typeof referenceElement === 'undefined') {
|
| 5245 |
return [2 /*return*/, Promise.reject("Error finding the " + this.referenceElement.nodeName + " in the cloned document")];
|
| 5246 |
}
|
| 5247 |
if (!(documentClone.fonts && documentClone.fonts.ready)) return [3 /*break*/, 2];
|
| 5248 |
return [4 /*yield*/, documentClone.fonts.ready];
|
| 5249 |
case 1:
|
| 5250 |
_a.sent();
|
| 5251 |
_a.label = 2;
|
| 5252 |
case 2:
|
| 5253 |
if (!/(AppleWebKit)/g.test(navigator.userAgent)) return [3 /*break*/, 4];
|
| 5254 |
return [4 /*yield*/, imagesReady(documentClone)];
|
| 5255 |
case 3:
|
| 5256 |
_a.sent();
|
| 5257 |
_a.label = 4;
|
| 5258 |
case 4:
|
| 5259 |
if (typeof onclone === 'function') {
|
| 5260 |
return [2 /*return*/, Promise.resolve()
|
| 5261 |
.then(function () { return onclone(documentClone, referenceElement); })
|
| 5262 |
.then(function () { return iframe; })];
|
| 5263 |
}
|
| 5264 |
return [2 /*return*/, iframe];
|
| 5265 |
}
|
| 5266 |
});
|
| 5267 |
}); });
|
| 5268 |
documentClone.open();
|
| 5269 |
documentClone.write(serializeDoctype(document.doctype) + "<html></html>");
|
| 5270 |
// Chrome scrolls the parent document for some reason after the write to the cloned window???
|
| 5271 |
restoreOwnerScroll(this.referenceElement.ownerDocument, scrollX, scrollY);
|
| 5272 |
documentClone.replaceChild(documentClone.adoptNode(this.documentElement), documentClone.documentElement);
|
| 5273 |
documentClone.close();
|
| 5274 |
return iframeLoad;
|
| 5275 |
};
|
| 5276 |
DocumentCloner.prototype.createElementClone = function (node) {
|
| 5277 |
if (isDebugging(node, 2 /* CLONE */)) {
|
| 5278 |
debugger;
|
| 5279 |
}
|
| 5280 |
if (isCanvasElement(node)) {
|
| 5281 |
return this.createCanvasClone(node);
|
| 5282 |
}
|
| 5283 |
if (isVideoElement(node)) {
|
| 5284 |
return this.createVideoClone(node);
|
| 5285 |
}
|
| 5286 |
if (isStyleElement(node)) {
|
| 5287 |
return this.createStyleClone(node);
|
| 5288 |
}
|
| 5289 |
var clone = node.cloneNode(false);
|
| 5290 |
if (isImageElement(clone)) {
|
| 5291 |
if (isImageElement(node) && node.currentSrc && node.currentSrc !== node.src) {
|
| 5292 |
clone.src = node.currentSrc;
|
| 5293 |
clone.srcset = '';
|
| 5294 |
}
|
| 5295 |
if (clone.loading === 'lazy') {
|
| 5296 |
clone.loading = 'eager';
|
| 5297 |
}
|
| 5298 |
}
|
| 5299 |
if (isCustomElement(clone)) {
|
| 5300 |
return this.createCustomElementClone(clone);
|
| 5301 |
}
|
| 5302 |
return clone;
|
| 5303 |
};
|
| 5304 |
DocumentCloner.prototype.createCustomElementClone = function (node) {
|
| 5305 |
var clone = document.createElement('html2canvascustomelement');
|
| 5306 |
copyCSSStyles(node.style, clone);
|
| 5307 |
return clone;
|
| 5308 |
};
|
| 5309 |
DocumentCloner.prototype.createStyleClone = function (node) {
|
| 5310 |
try {
|
| 5311 |
var sheet = node.sheet;
|
| 5312 |
if (sheet && sheet.cssRules) {
|
| 5313 |
var css = [].slice.call(sheet.cssRules, 0).reduce(function (css, rule) {
|
| 5314 |
if (rule && typeof rule.cssText === 'string') {
|
| 5315 |
return css + rule.cssText;
|
| 5316 |
}
|
| 5317 |
return css;
|
| 5318 |
}, '');
|
| 5319 |
var style = node.cloneNode(false);
|
| 5320 |
style.textContent = css;
|
| 5321 |
return style;
|
| 5322 |
}
|
| 5323 |
}
|
| 5324 |
catch (e) {
|
| 5325 |
// accessing node.sheet.cssRules throws a DOMException
|
| 5326 |
this.context.logger.error('Unable to access cssRules property', e);
|
| 5327 |
if (e.name !== 'SecurityError') {
|
| 5328 |
throw e;
|
| 5329 |
}
|
| 5330 |
}
|
| 5331 |
return node.cloneNode(false);
|
| 5332 |
};
|
| 5333 |
DocumentCloner.prototype.createCanvasClone = function (canvas) {
|
| 5334 |
var _a;
|
| 5335 |
if (this.options.inlineImages && canvas.ownerDocument) {
|
| 5336 |
var img = canvas.ownerDocument.createElement('img');
|
| 5337 |
try {
|
| 5338 |
img.src = canvas.toDataURL();
|
| 5339 |
return img;
|
| 5340 |
}
|
| 5341 |
catch (e) {
|
| 5342 |
this.context.logger.info("Unable to inline canvas contents, canvas is tainted", canvas);
|
| 5343 |
}
|
| 5344 |
}
|
| 5345 |
var clonedCanvas = canvas.cloneNode(false);
|
| 5346 |
try {
|
| 5347 |
clonedCanvas.width = canvas.width;
|
| 5348 |
clonedCanvas.height = canvas.height;
|
| 5349 |
var ctx = canvas.getContext('2d');
|
| 5350 |
var clonedCtx = clonedCanvas.getContext('2d');
|
| 5351 |
if (clonedCtx) {
|
| 5352 |
if (!this.options.allowTaint && ctx) {
|
| 5353 |
clonedCtx.putImageData(ctx.getImageData(0, 0, canvas.width, canvas.height), 0, 0);
|
| 5354 |
}
|
| 5355 |
else {
|
| 5356 |
var gl = (_a = canvas.getContext('webgl2')) !== null && _a !== void 0 ? _a : canvas.getContext('webgl');
|
| 5357 |
if (gl) {
|
| 5358 |
var attribs = gl.getContextAttributes();
|
| 5359 |
if ((attribs === null || attribs === void 0 ? void 0 : attribs.preserveDrawingBuffer) === false) {
|
| 5360 |
this.context.logger.warn('Unable to clone WebGL context as it has preserveDrawingBuffer=false', canvas);
|
| 5361 |
}
|
| 5362 |
}
|
| 5363 |
clonedCtx.drawImage(canvas, 0, 0);
|
| 5364 |
}
|
| 5365 |
}
|
| 5366 |
return clonedCanvas;
|
| 5367 |
}
|
| 5368 |
catch (e) {
|
| 5369 |
this.context.logger.info("Unable to clone canvas as it is tainted", canvas);
|
| 5370 |
}
|
| 5371 |
return clonedCanvas;
|
| 5372 |
};
|
| 5373 |
DocumentCloner.prototype.createVideoClone = function (video) {
|
| 5374 |
var canvas = video.ownerDocument.createElement('canvas');
|
| 5375 |
canvas.width = video.offsetWidth;
|
| 5376 |
canvas.height = video.offsetHeight;
|
| 5377 |
var ctx = canvas.getContext('2d');
|
| 5378 |
try {
|
| 5379 |
if (ctx) {
|
| 5380 |
ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
| 5381 |
if (!this.options.allowTaint) {
|
| 5382 |
ctx.getImageData(0, 0, canvas.width, canvas.height);
|
| 5383 |
}
|
| 5384 |
}
|
| 5385 |
return canvas;
|
| 5386 |
}
|
| 5387 |
catch (e) {
|
| 5388 |
this.context.logger.info("Unable to clone video as it is tainted", video);
|
| 5389 |
}
|
| 5390 |
var blankCanvas = video.ownerDocument.createElement('canvas');
|
| 5391 |
blankCanvas.width = video.offsetWidth;
|
| 5392 |
blankCanvas.height = video.offsetHeight;
|
| 5393 |
return blankCanvas;
|
| 5394 |
};
|
| 5395 |
DocumentCloner.prototype.appendChildNode = function (clone, child, copyStyles) {
|
| 5396 |
if (!isElementNode(child) ||
|
| 5397 |
(!isScriptElement(child) &&
|
| 5398 |
!child.hasAttribute(IGNORE_ATTRIBUTE) &&
|
| 5399 |
(typeof this.options.ignoreElements !== 'function' || !this.options.ignoreElements(child)))) {
|
| 5400 |
if (!this.options.copyStyles || !isElementNode(child) || !isStyleElement(child)) {
|
| 5401 |
clone.appendChild(this.cloneNode(child, copyStyles));
|
| 5402 |
}
|
| 5403 |
}
|
| 5404 |
};
|
| 5405 |
DocumentCloner.prototype.cloneChildNodes = function (node, clone, copyStyles) {
|
| 5406 |
var _this = this;
|
| 5407 |
for (var child = node.shadowRoot ? node.shadowRoot.firstChild : node.firstChild; child; child = child.nextSibling) {
|
| 5408 |
if (isElementNode(child) && isSlotElement(child) && typeof child.assignedNodes === 'function') {
|
| 5409 |
var assignedNodes = child.assignedNodes();
|
| 5410 |
if (assignedNodes.length) {
|
| 5411 |
assignedNodes.forEach(function (assignedNode) { return _this.appendChildNode(clone, assignedNode, copyStyles); });
|
| 5412 |
}
|
| 5413 |
}
|
| 5414 |
else {
|
| 5415 |
this.appendChildNode(clone, child, copyStyles);
|
| 5416 |
}
|
| 5417 |
}
|
| 5418 |
};
|
| 5419 |
DocumentCloner.prototype.cloneNode = function (node, copyStyles) {
|
| 5420 |
if (isTextNode(node)) {
|
| 5421 |
return document.createTextNode(node.data);
|
| 5422 |
}
|
| 5423 |
if (!node.ownerDocument) {
|
| 5424 |
return node.cloneNode(false);
|
| 5425 |
}
|
| 5426 |
var window = node.ownerDocument.defaultView;
|
| 5427 |
if (window && isElementNode(node) && (isHTMLElementNode(node) || isSVGElementNode(node))) {
|
| 5428 |
var clone = this.createElementClone(node);
|
| 5429 |
clone.style.transitionProperty = 'none';
|
| 5430 |
var style = window.getComputedStyle(node);
|
| 5431 |
var styleBefore = window.getComputedStyle(node, ':before');
|
| 5432 |
var styleAfter = window.getComputedStyle(node, ':after');
|
| 5433 |
if (this.referenceElement === node && isHTMLElementNode(clone)) {
|
| 5434 |
this.clonedReferenceElement = clone;
|
| 5435 |
}
|
| 5436 |
if (isBodyElement(clone)) {
|
| 5437 |
createPseudoHideStyles(clone);
|
| 5438 |
}
|
| 5439 |
var counters = this.counters.parse(new CSSParsedCounterDeclaration(this.context, style));
|
| 5440 |
var before = this.resolvePseudoContent(node, clone, styleBefore, PseudoElementType.BEFORE);
|
| 5441 |
if (isCustomElement(node)) {
|
| 5442 |
copyStyles = true;
|
| 5443 |
}
|
| 5444 |
if (!isVideoElement(node)) {
|
| 5445 |
this.cloneChildNodes(node, clone, copyStyles);
|
| 5446 |
}
|
| 5447 |
if (before) {
|
| 5448 |
clone.insertBefore(before, clone.firstChild);
|
| 5449 |
}
|
| 5450 |
var after = this.resolvePseudoContent(node, clone, styleAfter, PseudoElementType.AFTER);
|
| 5451 |
if (after) {
|
| 5452 |
clone.appendChild(after);
|
| 5453 |
}
|
| 5454 |
this.counters.pop(counters);
|
| 5455 |
if ((style && (this.options.copyStyles || isSVGElementNode(node)) && !isIFrameElement(node)) ||
|
| 5456 |
copyStyles) {
|
| 5457 |
copyCSSStyles(style, clone);
|
| 5458 |
}
|
| 5459 |
if (node.scrollTop !== 0 || node.scrollLeft !== 0) {
|
| 5460 |
this.scrolledElements.push([clone, node.scrollLeft, node.scrollTop]);
|
| 5461 |
}
|
| 5462 |
if ((isTextareaElement(node) || isSelectElement(node)) &&
|
| 5463 |
(isTextareaElement(clone) || isSelectElement(clone))) {
|
| 5464 |
clone.value = node.value;
|
| 5465 |
}
|
| 5466 |
return clone;
|
| 5467 |
}
|
| 5468 |
return node.cloneNode(false);
|
| 5469 |
};
|
| 5470 |
DocumentCloner.prototype.resolvePseudoContent = function (node, clone, style, pseudoElt) {
|
| 5471 |
var _this = this;
|
| 5472 |
if (!style) {
|
| 5473 |
return;
|
| 5474 |
}
|
| 5475 |
var value = style.content;
|
| 5476 |
var document = clone.ownerDocument;
|
| 5477 |
if (!document || !value || value === 'none' || value === '-moz-alt-content' || style.display === 'none') {
|
| 5478 |
return;
|
| 5479 |
}
|
| 5480 |
this.counters.parse(new CSSParsedCounterDeclaration(this.context, style));
|
| 5481 |
var declaration = new CSSParsedPseudoDeclaration(this.context, style);
|
| 5482 |
var anonymousReplacedElement = document.createElement('html2canvaspseudoelement');
|
| 5483 |
copyCSSStyles(style, anonymousReplacedElement);
|
| 5484 |
declaration.content.forEach(function (token) {
|
| 5485 |
if (token.type === 0 /* STRING_TOKEN */) {
|
| 5486 |
anonymousReplacedElement.appendChild(document.createTextNode(token.value));
|
| 5487 |
}
|
| 5488 |
else if (token.type === 22 /* URL_TOKEN */) {
|
| 5489 |
var img = document.createElement('img');
|
| 5490 |
img.src = token.value;
|
| 5491 |
img.style.opacity = '1';
|
| 5492 |
anonymousReplacedElement.appendChild(img);
|
| 5493 |
}
|
| 5494 |
else if (token.type === 18 /* FUNCTION */) {
|
| 5495 |
if (token.name === 'attr') {
|
| 5496 |
var attr = token.values.filter(isIdentToken);
|
| 5497 |
if (attr.length) {
|
| 5498 |
anonymousReplacedElement.appendChild(document.createTextNode(node.getAttribute(attr[0].value) || ''));
|
| 5499 |
}
|
| 5500 |
}
|
| 5501 |
else if (token.name === 'counter') {
|
| 5502 |
var _a = token.values.filter(nonFunctionArgSeparator), counter = _a[0], counterStyle = _a[1];
|
| 5503 |
if (counter && isIdentToken(counter)) {
|
| 5504 |
var counterState = _this.counters.getCounterValue(counter.value);
|
| 5505 |
var counterType = counterStyle && isIdentToken(counterStyle)
|
| 5506 |
? listStyleType.parse(_this.context, counterStyle.value)
|
| 5507 |
: 3 /* DECIMAL */;
|
| 5508 |
anonymousReplacedElement.appendChild(document.createTextNode(createCounterText(counterState, counterType, false)));
|
| 5509 |
}
|
| 5510 |
}
|
| 5511 |
else if (token.name === 'counters') {
|
| 5512 |
var _b = token.values.filter(nonFunctionArgSeparator), counter = _b[0], delim = _b[1], counterStyle = _b[2];
|
| 5513 |
if (counter && isIdentToken(counter)) {
|
| 5514 |
var counterStates = _this.counters.getCounterValues(counter.value);
|
| 5515 |
var counterType_1 = counterStyle && isIdentToken(counterStyle)
|
| 5516 |
? listStyleType.parse(_this.context, counterStyle.value)
|
| 5517 |
: 3 /* DECIMAL */;
|
| 5518 |
var separator = delim && delim.type === 0 /* STRING_TOKEN */ ? delim.value : '';
|
| 5519 |
var text = counterStates
|
| 5520 |
.map(function (value) { return createCounterText(value, counterType_1, false); })
|
| 5521 |
.join(separator);
|
| 5522 |
anonymousReplacedElement.appendChild(document.createTextNode(text));
|
| 5523 |
}
|
| 5524 |
}
|
| 5525 |
else ;
|
| 5526 |
}
|
| 5527 |
else if (token.type === 20 /* IDENT_TOKEN */) {
|
| 5528 |
switch (token.value) {
|
| 5529 |
case 'open-quote':
|
| 5530 |
anonymousReplacedElement.appendChild(document.createTextNode(getQuote(declaration.quotes, _this.quoteDepth++, true)));
|
| 5531 |
break;
|
| 5532 |
case 'close-quote':
|
| 5533 |
anonymousReplacedElement.appendChild(document.createTextNode(getQuote(declaration.quotes, --_this.quoteDepth, false)));
|
| 5534 |
break;
|
| 5535 |
default:
|
| 5536 |
// safari doesn't parse string tokens correctly because of lack of quotes
|
| 5537 |
anonymousReplacedElement.appendChild(document.createTextNode(token.value));
|
| 5538 |
}
|
| 5539 |
}
|
| 5540 |
});
|
| 5541 |
anonymousReplacedElement.className = PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + " " + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
|
| 5542 |
var newClassName = pseudoElt === PseudoElementType.BEFORE
|
| 5543 |
? " " + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE
|
| 5544 |
: " " + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
|
| 5545 |
if (isSVGElementNode(clone)) {
|
| 5546 |
clone.className.baseValue += newClassName;
|
| 5547 |
}
|
| 5548 |
else {
|
| 5549 |
clone.className += newClassName;
|
| 5550 |
}
|
| 5551 |
return anonymousReplacedElement;
|
| 5552 |
};
|
| 5553 |
DocumentCloner.destroy = function (container) {
|
| 5554 |
if (container.parentNode) {
|
| 5555 |
container.parentNode.removeChild(container);
|
| 5556 |
return true;
|
| 5557 |
}
|
| 5558 |
return false;
|
| 5559 |
};
|
| 5560 |
return DocumentCloner;
|
| 5561 |
}());
|
| 5562 |
var PseudoElementType;
|
| 5563 |
(function (PseudoElementType) {
|
| 5564 |
PseudoElementType[PseudoElementType["BEFORE"] = 0] = "BEFORE";
|
| 5565 |
PseudoElementType[PseudoElementType["AFTER"] = 1] = "AFTER";
|
| 5566 |
})(PseudoElementType || (PseudoElementType = {}));
|
| 5567 |
var createIFrameContainer = function (ownerDocument, bounds) {
|
| 5568 |
var cloneIframeContainer = ownerDocument.createElement('iframe');
|
| 5569 |
cloneIframeContainer.className = 'html2canvas-container';
|
| 5570 |
cloneIframeContainer.style.visibility = 'hidden';
|
| 5571 |
cloneIframeContainer.style.position = 'fixed';
|
| 5572 |
cloneIframeContainer.style.left = '-10000px';
|
| 5573 |
cloneIframeContainer.style.top = '0px';
|
| 5574 |
cloneIframeContainer.style.border = '0';
|
| 5575 |
cloneIframeContainer.width = bounds.width.toString();
|
| 5576 |
cloneIframeContainer.height = bounds.height.toString();
|
| 5577 |
cloneIframeContainer.scrolling = 'no'; // ios won't scroll without it
|
| 5578 |
cloneIframeContainer.setAttribute(IGNORE_ATTRIBUTE, 'true');
|
| 5579 |
ownerDocument.body.appendChild(cloneIframeContainer);
|
| 5580 |
return cloneIframeContainer;
|
| 5581 |
};
|
| 5582 |
var imageReady = function (img) {
|
| 5583 |
return new Promise(function (resolve) {
|
| 5584 |
if (img.complete) {
|
| 5585 |
resolve();
|
| 5586 |
return;
|
| 5587 |
}
|
| 5588 |
if (!img.src) {
|
| 5589 |
resolve();
|
| 5590 |
return;
|
| 5591 |
}
|
| 5592 |
img.onload = resolve;
|
| 5593 |
img.onerror = resolve;
|
| 5594 |
});
|
| 5595 |
};
|
| 5596 |
var imagesReady = function (document) {
|
| 5597 |
return Promise.all([].slice.call(document.images, 0).map(imageReady));
|
| 5598 |
};
|
| 5599 |
var iframeLoader = function (iframe) {
|
| 5600 |
return new Promise(function (resolve, reject) {
|
| 5601 |
var cloneWindow = iframe.contentWindow;
|
| 5602 |
if (!cloneWindow) {
|
| 5603 |
return reject("No window assigned for iframe");
|
| 5604 |
}
|
| 5605 |
var documentClone = cloneWindow.document;
|
| 5606 |
cloneWindow.onload = iframe.onload = function () {
|
| 5607 |
cloneWindow.onload = iframe.onload = null;
|
| 5608 |
var interval = setInterval(function () {
|
| 5609 |
if (documentClone.body.childNodes.length > 0 && documentClone.readyState === 'complete') {
|
| 5610 |
clearInterval(interval);
|
| 5611 |
resolve(iframe);
|
| 5612 |
}
|
| 5613 |
}, 50);
|
| 5614 |
};
|
| 5615 |
});
|
| 5616 |
};
|
| 5617 |
var ignoredStyleProperties = [
|
| 5618 |
'all',
|
| 5619 |
'd',
|
| 5620 |
'content' // Safari shows pseudoelements if content is set
|
| 5621 |
];
|
| 5622 |
var copyCSSStyles = function (style, target) {
|
| 5623 |
// Edge does not provide value for cssText
|
| 5624 |
for (var i = style.length - 1; i >= 0; i--) {
|
| 5625 |
var property = style.item(i);
|
| 5626 |
if (ignoredStyleProperties.indexOf(property) === -1) {
|
| 5627 |
target.style.setProperty(property, style.getPropertyValue(property));
|
| 5628 |
}
|
| 5629 |
}
|
| 5630 |
return target;
|
| 5631 |
};
|
| 5632 |
var serializeDoctype = function (doctype) {
|
| 5633 |
var str = '';
|
| 5634 |
if (doctype) {
|
| 5635 |
str += '<!DOCTYPE ';
|
| 5636 |
if (doctype.name) {
|
| 5637 |
str += doctype.name;
|
| 5638 |
}
|
| 5639 |
if (doctype.internalSubset) {
|
| 5640 |
str += doctype.internalSubset;
|
| 5641 |
}
|
| 5642 |
if (doctype.publicId) {
|
| 5643 |
str += "\"" + doctype.publicId + "\"";
|
| 5644 |
}
|
| 5645 |
if (doctype.systemId) {
|
| 5646 |
str += "\"" + doctype.systemId + "\"";
|
| 5647 |
}
|
| 5648 |
str += '>';
|
| 5649 |
}
|
| 5650 |
return str;
|
| 5651 |
};
|
| 5652 |
var restoreOwnerScroll = function (ownerDocument, x, y) {
|
| 5653 |
if (ownerDocument &&
|
| 5654 |
ownerDocument.defaultView &&
|
| 5655 |
(x !== ownerDocument.defaultView.pageXOffset || y !== ownerDocument.defaultView.pageYOffset)) {
|
| 5656 |
ownerDocument.defaultView.scrollTo(x, y);
|
| 5657 |
}
|
| 5658 |
};
|
| 5659 |
var restoreNodeScroll = function (_a) {
|
| 5660 |
var element = _a[0], x = _a[1], y = _a[2];
|
| 5661 |
element.scrollLeft = x;
|
| 5662 |
element.scrollTop = y;
|
| 5663 |
};
|
| 5664 |
var PSEUDO_BEFORE = ':before';
|
| 5665 |
var PSEUDO_AFTER = ':after';
|
| 5666 |
var PSEUDO_HIDE_ELEMENT_CLASS_BEFORE = '___html2canvas___pseudoelement_before';
|
| 5667 |
var PSEUDO_HIDE_ELEMENT_CLASS_AFTER = '___html2canvas___pseudoelement_after';
|
| 5668 |
var PSEUDO_HIDE_ELEMENT_STYLE = "{\n content: \"\" !important;\n display: none !important;\n}";
|
| 5669 |
var createPseudoHideStyles = function (body) {
|
| 5670 |
createStyles(body, "." + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + PSEUDO_BEFORE + PSEUDO_HIDE_ELEMENT_STYLE + "\n ." + PSEUDO_HIDE_ELEMENT_CLASS_AFTER + PSEUDO_AFTER + PSEUDO_HIDE_ELEMENT_STYLE);
|
| 5671 |
};
|
| 5672 |
var createStyles = function (body, styles) {
|
| 5673 |
var document = body.ownerDocument;
|
| 5674 |
if (document) {
|
| 5675 |
var style = document.createElement('style');
|
| 5676 |
style.textContent = styles;
|
| 5677 |
body.appendChild(style);
|
| 5678 |
}
|
| 5679 |
};
|
| 5680 |
|
| 5681 |
var CacheStorage = /** @class */ (function () {
|
| 5682 |
function CacheStorage() {
|
| 5683 |
}
|
| 5684 |
CacheStorage.getOrigin = function (url) {
|
| 5685 |
var link = CacheStorage._link;
|
| 5686 |
if (!link) {
|
| 5687 |
return 'about:blank';
|
| 5688 |
}
|
| 5689 |
link.href = url;
|
| 5690 |
link.href = link.href; // IE9, LOL! - http://jsfiddle.net/niklasvh/2e48b/
|
| 5691 |
return link.protocol + link.hostname + link.port;
|
| 5692 |
};
|
| 5693 |
CacheStorage.isSameOrigin = function (src) {
|
| 5694 |
return CacheStorage.getOrigin(src) === CacheStorage._origin;
|
| 5695 |
};
|
| 5696 |
CacheStorage.setContext = function (window) {
|
| 5697 |
CacheStorage._link = window.document.createElement('a');
|
| 5698 |
CacheStorage._origin = CacheStorage.getOrigin(window.location.href);
|
| 5699 |
};
|
| 5700 |
CacheStorage._origin = 'about:blank';
|
| 5701 |
return CacheStorage;
|
| 5702 |
}());
|
| 5703 |
var Cache = /** @class */ (function () {
|
| 5704 |
function Cache(context, _options) {
|
| 5705 |
this.context = context;
|
| 5706 |
this._options = _options;
|
| 5707 |
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
| 5708 |
this._cache = {};
|
| 5709 |
}
|
| 5710 |
Cache.prototype.addImage = function (src) {
|
| 5711 |
var result = Promise.resolve();
|
| 5712 |
if (this.has(src)) {
|
| 5713 |
return result;
|
| 5714 |
}
|
| 5715 |
if (isBlobImage(src) || isRenderable(src)) {
|
| 5716 |
(this._cache[src] = this.loadImage(src)).catch(function () {
|
| 5717 |
// prevent unhandled rejection
|
| 5718 |
});
|
| 5719 |
return result;
|
| 5720 |
}
|
| 5721 |
return result;
|
| 5722 |
};
|
| 5723 |
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
| 5724 |
Cache.prototype.match = function (src) {
|
| 5725 |
return this._cache[src];
|
| 5726 |
};
|
| 5727 |
Cache.prototype.loadImage = function (key) {
|
| 5728 |
return __awaiter(this, void 0, void 0, function () {
|
| 5729 |
var isSameOrigin, useCORS, useProxy, src;
|
| 5730 |
var _this = this;
|
| 5731 |
return __generator(this, function (_a) {
|
| 5732 |
switch (_a.label) {
|
| 5733 |
case 0:
|
| 5734 |
isSameOrigin = CacheStorage.isSameOrigin(key);
|
| 5735 |
useCORS = !isInlineImage(key) && this._options.useCORS === true && FEATURES.SUPPORT_CORS_IMAGES && !isSameOrigin;
|
| 5736 |
useProxy = !isInlineImage(key) &&
|
| 5737 |
!isSameOrigin &&
|
| 5738 |
!isBlobImage(key) &&
|
| 5739 |
typeof this._options.proxy === 'string' &&
|
| 5740 |
FEATURES.SUPPORT_CORS_XHR &&
|
| 5741 |
!useCORS;
|
| 5742 |
if (!isSameOrigin &&
|
| 5743 |
this._options.allowTaint === false &&
|
| 5744 |
!isInlineImage(key) &&
|
| 5745 |
!isBlobImage(key) &&
|
| 5746 |
!useProxy &&
|
| 5747 |
!useCORS) {
|
| 5748 |
return [2 /*return*/];
|
| 5749 |
}
|
| 5750 |
src = key;
|
| 5751 |
if (!useProxy) return [3 /*break*/, 2];
|
| 5752 |
return [4 /*yield*/, this.proxy(src)];
|
| 5753 |
case 1:
|
| 5754 |
src = _a.sent();
|
| 5755 |
_a.label = 2;
|
| 5756 |
case 2:
|
| 5757 |
this.context.logger.debug("Added image " + key.substring(0, 256));
|
| 5758 |
return [4 /*yield*/, new Promise(function (resolve, reject) {
|
| 5759 |
var img = new Image();
|
| 5760 |
img.onload = function () { return resolve(img); };
|
| 5761 |
img.onerror = reject;
|
| 5762 |
//ios safari 10.3 taints canvas with data urls unless crossOrigin is set to anonymous
|
| 5763 |
if (isInlineBase64Image(src) || useCORS) {
|
| 5764 |
img.crossOrigin = 'anonymous';
|
| 5765 |
}
|
| 5766 |
img.src = src;
|
| 5767 |
if (img.complete === true) {
|
| 5768 |
// Inline XML images may fail to parse, throwing an Error later on
|
| 5769 |
setTimeout(function () { return resolve(img); }, 500);
|
| 5770 |
}
|
| 5771 |
if (_this._options.imageTimeout > 0) {
|
| 5772 |
setTimeout(function () { return reject("Timed out (" + _this._options.imageTimeout + "ms) loading image"); }, _this._options.imageTimeout);
|
| 5773 |
}
|
| 5774 |
})];
|
| 5775 |
case 3: return [2 /*return*/, _a.sent()];
|
| 5776 |
}
|
| 5777 |
});
|
| 5778 |
});
|
| 5779 |
};
|
| 5780 |
Cache.prototype.has = function (key) {
|
| 5781 |
return typeof this._cache[key] !== 'undefined';
|
| 5782 |
};
|
| 5783 |
Cache.prototype.keys = function () {
|
| 5784 |
return Promise.resolve(Object.keys(this._cache));
|
| 5785 |
};
|
| 5786 |
Cache.prototype.proxy = function (src) {
|
| 5787 |
var _this = this;
|
| 5788 |
var proxy = this._options.proxy;
|
| 5789 |
if (!proxy) {
|
| 5790 |
throw new Error('No proxy defined');
|
| 5791 |
}
|
| 5792 |
var key = src.substring(0, 256);
|
| 5793 |
return new Promise(function (resolve, reject) {
|
| 5794 |
var responseType = FEATURES.SUPPORT_RESPONSE_TYPE ? 'blob' : 'text';
|
| 5795 |
var xhr = new XMLHttpRequest();
|
| 5796 |
xhr.onload = function () {
|
| 5797 |
if (xhr.status === 200) {
|
| 5798 |
if (responseType === 'text') {
|
| 5799 |
resolve(xhr.response);
|
| 5800 |
}
|
| 5801 |
else {
|
| 5802 |
var reader_1 = new FileReader();
|
| 5803 |
reader_1.addEventListener('load', function () { return resolve(reader_1.result); }, false);
|
| 5804 |
reader_1.addEventListener('error', function (e) { return reject(e); }, false);
|
| 5805 |
reader_1.readAsDataURL(xhr.response);
|
| 5806 |
}
|
| 5807 |
}
|
| 5808 |
else {
|
| 5809 |
reject("Failed to proxy resource " + key + " with status code " + xhr.status);
|
| 5810 |
}
|
| 5811 |
};
|
| 5812 |
xhr.onerror = reject;
|
| 5813 |
var queryString = proxy.indexOf('?') > -1 ? '&' : '?';
|
| 5814 |
xhr.open('GET', "" + proxy + queryString + "url=" + encodeURIComponent(src) + "&responseType=" + responseType);
|
| 5815 |
if (responseType !== 'text' && xhr instanceof XMLHttpRequest) {
|
| 5816 |
xhr.responseType = responseType;
|
| 5817 |
}
|
| 5818 |
if (_this._options.imageTimeout) {
|
| 5819 |
var timeout_1 = _this._options.imageTimeout;
|
| 5820 |
xhr.timeout = timeout_1;
|
| 5821 |
xhr.ontimeout = function () { return reject("Timed out (" + timeout_1 + "ms) proxying " + key); };
|
| 5822 |
}
|
| 5823 |
xhr.send();
|
| 5824 |
});
|
| 5825 |
};
|
| 5826 |
return Cache;
|
| 5827 |
}());
|
| 5828 |
var INLINE_SVG = /^data:image\/svg\+xml/i;
|
| 5829 |
var INLINE_BASE64 = /^data:image\/.*;base64,/i;
|
| 5830 |
var INLINE_IMG = /^data:image\/.*/i;
|
| 5831 |
var isRenderable = function (src) { return FEATURES.SUPPORT_SVG_DRAWING || !isSVG(src); };
|
| 5832 |
var isInlineImage = function (src) { return INLINE_IMG.test(src); };
|
| 5833 |
var isInlineBase64Image = function (src) { return INLINE_BASE64.test(src); };
|
| 5834 |
var isBlobImage = function (src) { return src.substr(0, 4) === 'blob'; };
|
| 5835 |
var isSVG = function (src) { return src.substr(-3).toLowerCase() === 'svg' || INLINE_SVG.test(src); };
|
| 5836 |
|
| 5837 |
var Vector = /** @class */ (function () {
|
| 5838 |
function Vector(x, y) {
|
| 5839 |
this.type = 0 /* VECTOR */;
|
| 5840 |
this.x = x;
|
| 5841 |
this.y = y;
|
| 5842 |
}
|
| 5843 |
Vector.prototype.add = function (deltaX, deltaY) {
|
| 5844 |
return new Vector(this.x + deltaX, this.y + deltaY);
|
| 5845 |
};
|
| 5846 |
return Vector;
|
| 5847 |
}());
|
| 5848 |
|
| 5849 |
var lerp = function (a, b, t) {
|
| 5850 |
return new Vector(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t);
|
| 5851 |
};
|
| 5852 |
var BezierCurve = /** @class */ (function () {
|
| 5853 |
function BezierCurve(start, startControl, endControl, end) {
|
| 5854 |
this.type = 1 /* BEZIER_CURVE */;
|
| 5855 |
this.start = start;
|
| 5856 |
this.startControl = startControl;
|
| 5857 |
this.endControl = endControl;
|
| 5858 |
this.end = end;
|
| 5859 |
}
|
| 5860 |
BezierCurve.prototype.subdivide = function (t, firstHalf) {
|
| 5861 |
var ab = lerp(this.start, this.startControl, t);
|
| 5862 |
var bc = lerp(this.startControl, this.endControl, t);
|
| 5863 |
var cd = lerp(this.endControl, this.end, t);
|
| 5864 |
var abbc = lerp(ab, bc, t);
|
| 5865 |
var bccd = lerp(bc, cd, t);
|
| 5866 |
var dest = lerp(abbc, bccd, t);
|
| 5867 |
return firstHalf ? new BezierCurve(this.start, ab, abbc, dest) : new BezierCurve(dest, bccd, cd, this.end);
|
| 5868 |
};
|
| 5869 |
BezierCurve.prototype.add = function (deltaX, deltaY) {
|
| 5870 |
return new BezierCurve(this.start.add(deltaX, deltaY), this.startControl.add(deltaX, deltaY), this.endControl.add(deltaX, deltaY), this.end.add(deltaX, deltaY));
|
| 5871 |
};
|
| 5872 |
BezierCurve.prototype.reverse = function () {
|
| 5873 |
return new BezierCurve(this.end, this.endControl, this.startControl, this.start);
|
| 5874 |
};
|
| 5875 |
return BezierCurve;
|
| 5876 |
}());
|
| 5877 |
var isBezierCurve = function (path) { return path.type === 1 /* BEZIER_CURVE */; };
|
| 5878 |
|
| 5879 |
var BoundCurves = /** @class */ (function () {
|
| 5880 |
function BoundCurves(element) {
|
| 5881 |
var styles = element.styles;
|
| 5882 |
var bounds = element.bounds;
|
| 5883 |
var _a = getAbsoluteValueForTuple(styles.borderTopLeftRadius, bounds.width, bounds.height), tlh = _a[0], tlv = _a[1];
|
| 5884 |
var _b = getAbsoluteValueForTuple(styles.borderTopRightRadius, bounds.width, bounds.height), trh = _b[0], trv = _b[1];
|
| 5885 |
var _c = getAbsoluteValueForTuple(styles.borderBottomRightRadius, bounds.width, bounds.height), brh = _c[0], brv = _c[1];
|
| 5886 |
var _d = getAbsoluteValueForTuple(styles.borderBottomLeftRadius, bounds.width, bounds.height), blh = _d[0], blv = _d[1];
|
| 5887 |
var factors = [];
|
| 5888 |
factors.push((tlh + trh) / bounds.width);
|
| 5889 |
factors.push((blh + brh) / bounds.width);
|
| 5890 |
factors.push((tlv + blv) / bounds.height);
|
| 5891 |
factors.push((trv + brv) / bounds.height);
|
| 5892 |
var maxFactor = Math.max.apply(Math, factors);
|
| 5893 |
if (maxFactor > 1) {
|
| 5894 |
tlh /= maxFactor;
|
| 5895 |
tlv /= maxFactor;
|
| 5896 |
trh /= maxFactor;
|
| 5897 |
trv /= maxFactor;
|
| 5898 |
brh /= maxFactor;
|
| 5899 |
brv /= maxFactor;
|
| 5900 |
blh /= maxFactor;
|
| 5901 |
blv /= maxFactor;
|
| 5902 |
}
|
| 5903 |
var topWidth = bounds.width - trh;
|
| 5904 |
var rightHeight = bounds.height - brv;
|
| 5905 |
var bottomWidth = bounds.width - brh;
|
| 5906 |
var leftHeight = bounds.height - blv;
|
| 5907 |
var borderTopWidth = styles.borderTopWidth;
|
| 5908 |
var borderRightWidth = styles.borderRightWidth;
|
| 5909 |
var borderBottomWidth = styles.borderBottomWidth;
|
| 5910 |
var borderLeftWidth = styles.borderLeftWidth;
|
| 5911 |
var paddingTop = getAbsoluteValue(styles.paddingTop, element.bounds.width);
|
| 5912 |
var paddingRight = getAbsoluteValue(styles.paddingRight, element.bounds.width);
|
| 5913 |
var paddingBottom = getAbsoluteValue(styles.paddingBottom, element.bounds.width);
|
| 5914 |
var paddingLeft = getAbsoluteValue(styles.paddingLeft, element.bounds.width);
|
| 5915 |
this.topLeftBorderDoubleOuterBox =
|
| 5916 |
tlh > 0 || tlv > 0
|
| 5917 |
? getCurvePoints(bounds.left + borderLeftWidth / 3, bounds.top + borderTopWidth / 3, tlh - borderLeftWidth / 3, tlv - borderTopWidth / 3, CORNER.TOP_LEFT)
|
| 5918 |
: new Vector(bounds.left + borderLeftWidth / 3, bounds.top + borderTopWidth / 3);
|
| 5919 |
this.topRightBorderDoubleOuterBox =
|
| 5920 |
tlh > 0 || tlv > 0
|
| 5921 |
? getCurvePoints(bounds.left + topWidth, bounds.top + borderTopWidth / 3, trh - borderRightWidth / 3, trv - borderTopWidth / 3, CORNER.TOP_RIGHT)
|
| 5922 |
: new Vector(bounds.left + bounds.width - borderRightWidth / 3, bounds.top + borderTopWidth / 3);
|
| 5923 |
this.bottomRightBorderDoubleOuterBox =
|
| 5924 |
brh > 0 || brv > 0
|
| 5925 |
? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh - borderRightWidth / 3, brv - borderBottomWidth / 3, CORNER.BOTTOM_RIGHT)
|
| 5926 |
: new Vector(bounds.left + bounds.width - borderRightWidth / 3, bounds.top + bounds.height - borderBottomWidth / 3);
|
| 5927 |
this.bottomLeftBorderDoubleOuterBox =
|
| 5928 |
blh > 0 || blv > 0
|
| 5929 |
? getCurvePoints(bounds.left + borderLeftWidth / 3, bounds.top + leftHeight, blh - borderLeftWidth / 3, blv - borderBottomWidth / 3, CORNER.BOTTOM_LEFT)
|
| 5930 |
: new Vector(bounds.left + borderLeftWidth / 3, bounds.top + bounds.height - borderBottomWidth / 3);
|
| 5931 |
this.topLeftBorderDoubleInnerBox =
|
| 5932 |
tlh > 0 || tlv > 0
|
| 5933 |
? getCurvePoints(bounds.left + (borderLeftWidth * 2) / 3, bounds.top + (borderTopWidth * 2) / 3, tlh - (borderLeftWidth * 2) / 3, tlv - (borderTopWidth * 2) / 3, CORNER.TOP_LEFT)
|
| 5934 |
: new Vector(bounds.left + (borderLeftWidth * 2) / 3, bounds.top + (borderTopWidth * 2) / 3);
|
| 5935 |
this.topRightBorderDoubleInnerBox =
|
| 5936 |
tlh > 0 || tlv > 0
|
| 5937 |
? getCurvePoints(bounds.left + topWidth, bounds.top + (borderTopWidth * 2) / 3, trh - (borderRightWidth * 2) / 3, trv - (borderTopWidth * 2) / 3, CORNER.TOP_RIGHT)
|
| 5938 |
: new Vector(bounds.left + bounds.width - (borderRightWidth * 2) / 3, bounds.top + (borderTopWidth * 2) / 3);
|
| 5939 |
this.bottomRightBorderDoubleInnerBox =
|
| 5940 |
brh > 0 || brv > 0
|
| 5941 |
? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh - (borderRightWidth * 2) / 3, brv - (borderBottomWidth * 2) / 3, CORNER.BOTTOM_RIGHT)
|
| 5942 |
: new Vector(bounds.left + bounds.width - (borderRightWidth * 2) / 3, bounds.top + bounds.height - (borderBottomWidth * 2) / 3);
|
| 5943 |
this.bottomLeftBorderDoubleInnerBox =
|
| 5944 |
blh > 0 || blv > 0
|
| 5945 |
? getCurvePoints(bounds.left + (borderLeftWidth * 2) / 3, bounds.top + leftHeight, blh - (borderLeftWidth * 2) / 3, blv - (borderBottomWidth * 2) / 3, CORNER.BOTTOM_LEFT)
|
| 5946 |
: new Vector(bounds.left + (borderLeftWidth * 2) / 3, bounds.top + bounds.height - (borderBottomWidth * 2) / 3);
|
| 5947 |
this.topLeftBorderStroke =
|
| 5948 |
tlh > 0 || tlv > 0
|
| 5949 |
? getCurvePoints(bounds.left + borderLeftWidth / 2, bounds.top + borderTopWidth / 2, tlh - borderLeftWidth / 2, tlv - borderTopWidth / 2, CORNER.TOP_LEFT)
|
| 5950 |
: new Vector(bounds.left + borderLeftWidth / 2, bounds.top + borderTopWidth / 2);
|
| 5951 |
this.topRightBorderStroke =
|
| 5952 |
tlh > 0 || tlv > 0
|
| 5953 |
? getCurvePoints(bounds.left + topWidth, bounds.top + borderTopWidth / 2, trh - borderRightWidth / 2, trv - borderTopWidth / 2, CORNER.TOP_RIGHT)
|
| 5954 |
: new Vector(bounds.left + bounds.width - borderRightWidth / 2, bounds.top + borderTopWidth / 2);
|
| 5955 |
this.bottomRightBorderStroke =
|
| 5956 |
brh > 0 || brv > 0
|
| 5957 |
? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh - borderRightWidth / 2, brv - borderBottomWidth / 2, CORNER.BOTTOM_RIGHT)
|
| 5958 |
: new Vector(bounds.left + bounds.width - borderRightWidth / 2, bounds.top + bounds.height - borderBottomWidth / 2);
|
| 5959 |
this.bottomLeftBorderStroke =
|
| 5960 |
blh > 0 || blv > 0
|
| 5961 |
? getCurvePoints(bounds.left + borderLeftWidth / 2, bounds.top + leftHeight, blh - borderLeftWidth / 2, blv - borderBottomWidth / 2, CORNER.BOTTOM_LEFT)
|
| 5962 |
: new Vector(bounds.left + borderLeftWidth / 2, bounds.top + bounds.height - borderBottomWidth / 2);
|
| 5963 |
this.topLeftBorderBox =
|
| 5964 |
tlh > 0 || tlv > 0
|
| 5965 |
? getCurvePoints(bounds.left, bounds.top, tlh, tlv, CORNER.TOP_LEFT)
|
| 5966 |
: new Vector(bounds.left, bounds.top);
|
| 5967 |
this.topRightBorderBox =
|
| 5968 |
trh > 0 || trv > 0
|
| 5969 |
? getCurvePoints(bounds.left + topWidth, bounds.top, trh, trv, CORNER.TOP_RIGHT)
|
| 5970 |
: new Vector(bounds.left + bounds.width, bounds.top);
|
| 5971 |
this.bottomRightBorderBox =
|
| 5972 |
brh > 0 || brv > 0
|
| 5973 |
? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh, brv, CORNER.BOTTOM_RIGHT)
|
| 5974 |
: new Vector(bounds.left + bounds.width, bounds.top + bounds.height);
|
| 5975 |
this.bottomLeftBorderBox =
|
| 5976 |
blh > 0 || blv > 0
|
| 5977 |
? getCurvePoints(bounds.left, bounds.top + leftHeight, blh, blv, CORNER.BOTTOM_LEFT)
|
| 5978 |
: new Vector(bounds.left, bounds.top + bounds.height);
|
| 5979 |
this.topLeftPaddingBox =
|
| 5980 |
tlh > 0 || tlv > 0
|
| 5981 |
? getCurvePoints(bounds.left + borderLeftWidth, bounds.top + borderTopWidth, Math.max(0, tlh - borderLeftWidth), Math.max(0, tlv - borderTopWidth), CORNER.TOP_LEFT)
|
| 5982 |
: new Vector(bounds.left + borderLeftWidth, bounds.top + borderTopWidth);
|
| 5983 |
this.topRightPaddingBox =
|
| 5984 |
trh > 0 || trv > 0
|
| 5985 |
? getCurvePoints(bounds.left + Math.min(topWidth, bounds.width - borderRightWidth), bounds.top + borderTopWidth, topWidth > bounds.width + borderRightWidth ? 0 : Math.max(0, trh - borderRightWidth), Math.max(0, trv - borderTopWidth), CORNER.TOP_RIGHT)
|
| 5986 |
: new Vector(bounds.left + bounds.width - borderRightWidth, bounds.top + borderTopWidth);
|
| 5987 |
this.bottomRightPaddingBox =
|
| 5988 |
brh > 0 || brv > 0
|
| 5989 |
? getCurvePoints(bounds.left + Math.min(bottomWidth, bounds.width - borderLeftWidth), bounds.top + Math.min(rightHeight, bounds.height - borderBottomWidth), Math.max(0, brh - borderRightWidth), Math.max(0, brv - borderBottomWidth), CORNER.BOTTOM_RIGHT)
|
| 5990 |
: new Vector(bounds.left + bounds.width - borderRightWidth, bounds.top + bounds.height - borderBottomWidth);
|
| 5991 |
this.bottomLeftPaddingBox =
|
| 5992 |
blh > 0 || blv > 0
|
| 5993 |
? getCurvePoints(bounds.left + borderLeftWidth, bounds.top + Math.min(leftHeight, bounds.height - borderBottomWidth), Math.max(0, blh - borderLeftWidth), Math.max(0, blv - borderBottomWidth), CORNER.BOTTOM_LEFT)
|
| 5994 |
: new Vector(bounds.left + borderLeftWidth, bounds.top + bounds.height - borderBottomWidth);
|
| 5995 |
this.topLeftContentBox =
|
| 5996 |
tlh > 0 || tlv > 0
|
| 5997 |
? getCurvePoints(bounds.left + borderLeftWidth + paddingLeft, bounds.top + borderTopWidth + paddingTop, Math.max(0, tlh - (borderLeftWidth + paddingLeft)), Math.max(0, tlv - (borderTopWidth + paddingTop)), CORNER.TOP_LEFT)
|
| 5998 |
: new Vector(bounds.left + borderLeftWidth + paddingLeft, bounds.top + borderTopWidth + paddingTop);
|
| 5999 |
this.topRightContentBox =
|
| 6000 |
trh > 0 || trv > 0
|
| 6001 |
? getCurvePoints(bounds.left + Math.min(topWidth, bounds.width + borderLeftWidth + paddingLeft), bounds.top + borderTopWidth + paddingTop, topWidth > bounds.width + borderLeftWidth + paddingLeft ? 0 : trh - borderLeftWidth + paddingLeft, trv - (borderTopWidth + paddingTop), CORNER.TOP_RIGHT)
|
| 6002 |
: new Vector(bounds.left + bounds.width - (borderRightWidth + paddingRight), bounds.top + borderTopWidth + paddingTop);
|
| 6003 |
this.bottomRightContentBox =
|
| 6004 |
brh > 0 || brv > 0
|
| 6005 |
? getCurvePoints(bounds.left + Math.min(bottomWidth, bounds.width - (borderLeftWidth + paddingLeft)), bounds.top + Math.min(rightHeight, bounds.height + borderTopWidth + paddingTop), Math.max(0, brh - (borderRightWidth + paddingRight)), brv - (borderBottomWidth + paddingBottom), CORNER.BOTTOM_RIGHT)
|
| 6006 |
: new Vector(bounds.left + bounds.width - (borderRightWidth + paddingRight), bounds.top + bounds.height - (borderBottomWidth + paddingBottom));
|
| 6007 |
this.bottomLeftContentBox =
|
| 6008 |
blh > 0 || blv > 0
|
| 6009 |
? getCurvePoints(bounds.left + borderLeftWidth + paddingLeft, bounds.top + leftHeight, Math.max(0, blh - (borderLeftWidth + paddingLeft)), blv - (borderBottomWidth + paddingBottom), CORNER.BOTTOM_LEFT)
|
| 6010 |
: new Vector(bounds.left + borderLeftWidth + paddingLeft, bounds.top + bounds.height - (borderBottomWidth + paddingBottom));
|
| 6011 |
}
|
| 6012 |
return BoundCurves;
|
| 6013 |
}());
|
| 6014 |
var CORNER;
|
| 6015 |
(function (CORNER) {
|
| 6016 |
CORNER[CORNER["TOP_LEFT"] = 0] = "TOP_LEFT";
|
| 6017 |
CORNER[CORNER["TOP_RIGHT"] = 1] = "TOP_RIGHT";
|
| 6018 |
CORNER[CORNER["BOTTOM_RIGHT"] = 2] = "BOTTOM_RIGHT";
|
| 6019 |
CORNER[CORNER["BOTTOM_LEFT"] = 3] = "BOTTOM_LEFT";
|
| 6020 |
})(CORNER || (CORNER = {}));
|
| 6021 |
var getCurvePoints = function (x, y, r1, r2, position) {
|
| 6022 |
var kappa = 4 * ((Math.sqrt(2) - 1) / 3);
|
| 6023 |
var ox = r1 * kappa; // control point offset horizontal
|
| 6024 |
var oy = r2 * kappa; // control point offset vertical
|
| 6025 |
var xm = x + r1; // x-middle
|
| 6026 |
var ym = y + r2; // y-middle
|
| 6027 |
switch (position) {
|
| 6028 |
case CORNER.TOP_LEFT:
|
| 6029 |
return new BezierCurve(new Vector(x, ym), new Vector(x, ym - oy), new Vector(xm - ox, y), new Vector(xm, y));
|
| 6030 |
case CORNER.TOP_RIGHT:
|
| 6031 |
return new BezierCurve(new Vector(x, y), new Vector(x + ox, y), new Vector(xm, ym - oy), new Vector(xm, ym));
|
| 6032 |
case CORNER.BOTTOM_RIGHT:
|
| 6033 |
return new BezierCurve(new Vector(xm, y), new Vector(xm, y + oy), new Vector(x + ox, ym), new Vector(x, ym));
|
| 6034 |
case CORNER.BOTTOM_LEFT:
|
| 6035 |
default:
|
| 6036 |
return new BezierCurve(new Vector(xm, ym), new Vector(xm - ox, ym), new Vector(x, y + oy), new Vector(x, y));
|
| 6037 |
}
|
| 6038 |
};
|
| 6039 |
var calculateBorderBoxPath = function (curves) {
|
| 6040 |
return [curves.topLeftBorderBox, curves.topRightBorderBox, curves.bottomRightBorderBox, curves.bottomLeftBorderBox];
|
| 6041 |
};
|
| 6042 |
var calculateContentBoxPath = function (curves) {
|
| 6043 |
return [
|
| 6044 |
curves.topLeftContentBox,
|
| 6045 |
curves.topRightContentBox,
|
| 6046 |
curves.bottomRightContentBox,
|
| 6047 |
curves.bottomLeftContentBox
|
| 6048 |
];
|
| 6049 |
};
|
| 6050 |
var calculatePaddingBoxPath = function (curves) {
|
| 6051 |
return [
|
| 6052 |
curves.topLeftPaddingBox,
|
| 6053 |
curves.topRightPaddingBox,
|
| 6054 |
curves.bottomRightPaddingBox,
|
| 6055 |
curves.bottomLeftPaddingBox
|
| 6056 |
];
|
| 6057 |
};
|
| 6058 |
|
| 6059 |
var TransformEffect = /** @class */ (function () {
|
| 6060 |
function TransformEffect(offsetX, offsetY, matrix) {
|
| 6061 |
this.offsetX = offsetX;
|
| 6062 |
this.offsetY = offsetY;
|
| 6063 |
this.matrix = matrix;
|
| 6064 |
this.type = 0 /* TRANSFORM */;
|
| 6065 |
this.target = 2 /* BACKGROUND_BORDERS */ | 4 /* CONTENT */;
|
| 6066 |
}
|
| 6067 |
return TransformEffect;
|
| 6068 |
}());
|
| 6069 |
var ClipEffect = /** @class */ (function () {
|
| 6070 |
function ClipEffect(path, target) {
|
| 6071 |
this.path = path;
|
| 6072 |
this.target = target;
|
| 6073 |
this.type = 1 /* CLIP */;
|
| 6074 |
}
|
| 6075 |
return ClipEffect;
|
| 6076 |
}());
|
| 6077 |
var OpacityEffect = /** @class */ (function () {
|
| 6078 |
function OpacityEffect(opacity) {
|
| 6079 |
this.opacity = opacity;
|
| 6080 |
this.type = 2 /* OPACITY */;
|
| 6081 |
this.target = 2 /* BACKGROUND_BORDERS */ | 4 /* CONTENT */;
|
| 6082 |
}
|
| 6083 |
return OpacityEffect;
|
| 6084 |
}());
|
| 6085 |
var isTransformEffect = function (effect) {
|
| 6086 |
return effect.type === 0 /* TRANSFORM */;
|
| 6087 |
};
|
| 6088 |
var isClipEffect = function (effect) { return effect.type === 1 /* CLIP */; };
|
| 6089 |
var isOpacityEffect = function (effect) { return effect.type === 2 /* OPACITY */; };
|
| 6090 |
|
| 6091 |
var equalPath = function (a, b) {
|
| 6092 |
if (a.length === b.length) {
|
| 6093 |
return a.some(function (v, i) { return v === b[i]; });
|
| 6094 |
}
|
| 6095 |
return false;
|
| 6096 |
};
|
| 6097 |
var transformPath = function (path, deltaX, deltaY, deltaW, deltaH) {
|
| 6098 |
return path.map(function (point, index) {
|
| 6099 |
switch (index) {
|
| 6100 |
case 0:
|
| 6101 |
return point.add(deltaX, deltaY);
|
| 6102 |
case 1:
|
| 6103 |
return point.add(deltaX + deltaW, deltaY);
|
| 6104 |
case 2:
|
| 6105 |
return point.add(deltaX + deltaW, deltaY + deltaH);
|
| 6106 |
case 3:
|
| 6107 |
return point.add(deltaX, deltaY + deltaH);
|
| 6108 |
}
|
| 6109 |
return point;
|
| 6110 |
});
|
| 6111 |
};
|
| 6112 |
|
| 6113 |
var StackingContext = /** @class */ (function () {
|
| 6114 |
function StackingContext(container) {
|
| 6115 |
this.element = container;
|
| 6116 |
this.inlineLevel = [];
|
| 6117 |
this.nonInlineLevel = [];
|
| 6118 |
this.negativeZIndex = [];
|
| 6119 |
this.zeroOrAutoZIndexOrTransformedOrOpacity = [];
|
| 6120 |
this.positiveZIndex = [];
|
| 6121 |
this.nonPositionedFloats = [];
|
| 6122 |
this.nonPositionedInlineLevel = [];
|
| 6123 |
}
|
| 6124 |
return StackingContext;
|
| 6125 |
}());
|
| 6126 |
var ElementPaint = /** @class */ (function () {
|
| 6127 |
function ElementPaint(container, parent) {
|
| 6128 |
this.container = container;
|
| 6129 |
this.parent = parent;
|
| 6130 |
this.effects = [];
|
| 6131 |
this.curves = new BoundCurves(this.container);
|
| 6132 |
if (this.container.styles.opacity < 1) {
|
| 6133 |
this.effects.push(new OpacityEffect(this.container.styles.opacity));
|
| 6134 |
}
|
| 6135 |
if (this.container.styles.transform !== null) {
|
| 6136 |
var offsetX = this.container.bounds.left + this.container.styles.transformOrigin[0].number;
|
| 6137 |
var offsetY = this.container.bounds.top + this.container.styles.transformOrigin[1].number;
|
| 6138 |
var matrix = this.container.styles.transform;
|
| 6139 |
this.effects.push(new TransformEffect(offsetX, offsetY, matrix));
|
| 6140 |
}
|
| 6141 |
if (this.container.styles.overflowX !== 0 /* VISIBLE */) {
|
| 6142 |
var borderBox = calculateBorderBoxPath(this.curves);
|
| 6143 |
var paddingBox = calculatePaddingBoxPath(this.curves);
|
| 6144 |
if (equalPath(borderBox, paddingBox)) {
|
| 6145 |
this.effects.push(new ClipEffect(borderBox, 2 /* BACKGROUND_BORDERS */ | 4 /* CONTENT */));
|
| 6146 |
}
|
| 6147 |
else {
|
| 6148 |
this.effects.push(new ClipEffect(borderBox, 2 /* BACKGROUND_BORDERS */));
|
| 6149 |
this.effects.push(new ClipEffect(paddingBox, 4 /* CONTENT */));
|
| 6150 |
}
|
| 6151 |
}
|
| 6152 |
}
|
| 6153 |
ElementPaint.prototype.getEffects = function (target) {
|
| 6154 |
var inFlow = [2 /* ABSOLUTE */, 3 /* FIXED */].indexOf(this.container.styles.position) === -1;
|
| 6155 |
var parent = this.parent;
|
| 6156 |
var effects = this.effects.slice(0);
|
| 6157 |
while (parent) {
|
| 6158 |
var croplessEffects = parent.effects.filter(function (effect) { return !isClipEffect(effect); });
|
| 6159 |
if (inFlow || parent.container.styles.position !== 0 /* STATIC */ || !parent.parent) {
|
| 6160 |
effects.unshift.apply(effects, croplessEffects);
|
| 6161 |
inFlow = [2 /* ABSOLUTE */, 3 /* FIXED */].indexOf(parent.container.styles.position) === -1;
|
| 6162 |
if (parent.container.styles.overflowX !== 0 /* VISIBLE */) {
|
| 6163 |
var borderBox = calculateBorderBoxPath(parent.curves);
|
| 6164 |
var paddingBox = calculatePaddingBoxPath(parent.curves);
|
| 6165 |
if (!equalPath(borderBox, paddingBox)) {
|
| 6166 |
effects.unshift(new ClipEffect(paddingBox, 2 /* BACKGROUND_BORDERS */ | 4 /* CONTENT */));
|
| 6167 |
}
|
| 6168 |
}
|
| 6169 |
}
|
| 6170 |
else {
|
| 6171 |
effects.unshift.apply(effects, croplessEffects);
|
| 6172 |
}
|
| 6173 |
parent = parent.parent;
|
| 6174 |
}
|
| 6175 |
return effects.filter(function (effect) { return contains(effect.target, target); });
|
| 6176 |
};
|
| 6177 |
return ElementPaint;
|
| 6178 |
}());
|
| 6179 |
var parseStackTree = function (parent, stackingContext, realStackingContext, listItems) {
|
| 6180 |
parent.container.elements.forEach(function (child) {
|
| 6181 |
var treatAsRealStackingContext = contains(child.flags, 4 /* CREATES_REAL_STACKING_CONTEXT */);
|
| 6182 |
var createsStackingContext = contains(child.flags, 2 /* CREATES_STACKING_CONTEXT */);
|
| 6183 |
var paintContainer = new ElementPaint(child, parent);
|
| 6184 |
if (contains(child.styles.display, 2048 /* LIST_ITEM */)) {
|
| 6185 |
listItems.push(paintContainer);
|
| 6186 |
}
|
| 6187 |
var listOwnerItems = contains(child.flags, 8 /* IS_LIST_OWNER */) ? [] : listItems;
|
| 6188 |
if (treatAsRealStackingContext || createsStackingContext) {
|
| 6189 |
var parentStack = treatAsRealStackingContext || child.styles.isPositioned() ? realStackingContext : stackingContext;
|
| 6190 |
var stack = new StackingContext(paintContainer);
|
| 6191 |
if (child.styles.isPositioned() || child.styles.opacity < 1 || child.styles.isTransformed()) {
|
| 6192 |
var order_1 = child.styles.zIndex.order;
|
| 6193 |
if (order_1 < 0) {
|
| 6194 |
var index_1 = 0;
|
| 6195 |
parentStack.negativeZIndex.some(function (current, i) {
|
| 6196 |
if (order_1 > current.element.container.styles.zIndex.order) {
|
| 6197 |
index_1 = i;
|
| 6198 |
return false;
|
| 6199 |
}
|
| 6200 |
else if (index_1 > 0) {
|
| 6201 |
return true;
|
| 6202 |
}
|
| 6203 |
return false;
|
| 6204 |
});
|
| 6205 |
parentStack.negativeZIndex.splice(index_1, 0, stack);
|
| 6206 |
}
|
| 6207 |
else if (order_1 > 0) {
|
| 6208 |
var index_2 = 0;
|
| 6209 |
parentStack.positiveZIndex.some(function (current, i) {
|
| 6210 |
if (order_1 >= current.element.container.styles.zIndex.order) {
|
| 6211 |
index_2 = i + 1;
|
| 6212 |
return false;
|
| 6213 |
}
|
| 6214 |
else if (index_2 > 0) {
|
| 6215 |
return true;
|
| 6216 |
}
|
| 6217 |
return false;
|
| 6218 |
});
|
| 6219 |
parentStack.positiveZIndex.splice(index_2, 0, stack);
|
| 6220 |
}
|
| 6221 |
else {
|
| 6222 |
parentStack.zeroOrAutoZIndexOrTransformedOrOpacity.push(stack);
|
| 6223 |
}
|
| 6224 |
}
|
| 6225 |
else {
|
| 6226 |
if (child.styles.isFloating()) {
|
| 6227 |
parentStack.nonPositionedFloats.push(stack);
|
| 6228 |
}
|
| 6229 |
else {
|
| 6230 |
parentStack.nonPositionedInlineLevel.push(stack);
|
| 6231 |
}
|
| 6232 |
}
|
| 6233 |
parseStackTree(paintContainer, stack, treatAsRealStackingContext ? stack : realStackingContext, listOwnerItems);
|
| 6234 |
}
|
| 6235 |
else {
|
| 6236 |
if (child.styles.isInlineLevel()) {
|
| 6237 |
stackingContext.inlineLevel.push(paintContainer);
|
| 6238 |
}
|
| 6239 |
else {
|
| 6240 |
stackingContext.nonInlineLevel.push(paintContainer);
|
| 6241 |
}
|
| 6242 |
parseStackTree(paintContainer, stackingContext, realStackingContext, listOwnerItems);
|
| 6243 |
}
|
| 6244 |
if (contains(child.flags, 8 /* IS_LIST_OWNER */)) {
|
| 6245 |
processListItems(child, listOwnerItems);
|
| 6246 |
}
|
| 6247 |
});
|
| 6248 |
};
|
| 6249 |
var processListItems = function (owner, elements) {
|
| 6250 |
var numbering = owner instanceof OLElementContainer ? owner.start : 1;
|
| 6251 |
var reversed = owner instanceof OLElementContainer ? owner.reversed : false;
|
| 6252 |
for (var i = 0; i < elements.length; i++) {
|
| 6253 |
var item = elements[i];
|
| 6254 |
if (item.container instanceof LIElementContainer &&
|
| 6255 |
typeof item.container.value === 'number' &&
|
| 6256 |
item.container.value !== 0) {
|
| 6257 |
numbering = item.container.value;
|
| 6258 |
}
|
| 6259 |
item.listValue = createCounterText(numbering, item.container.styles.listStyleType, true);
|
| 6260 |
numbering += reversed ? -1 : 1;
|
| 6261 |
}
|
| 6262 |
};
|
| 6263 |
var parseStackingContexts = function (container) {
|
| 6264 |
var paintContainer = new ElementPaint(container, null);
|
| 6265 |
var root = new StackingContext(paintContainer);
|
| 6266 |
var listItems = [];
|
| 6267 |
parseStackTree(paintContainer, root, root, listItems);
|
| 6268 |
processListItems(paintContainer.container, listItems);
|
| 6269 |
return root;
|
| 6270 |
};
|
| 6271 |
|
| 6272 |
var parsePathForBorder = function (curves, borderSide) {
|
| 6273 |
switch (borderSide) {
|
| 6274 |
case 0:
|
| 6275 |
return createPathFromCurves(curves.topLeftBorderBox, curves.topLeftPaddingBox, curves.topRightBorderBox, curves.topRightPaddingBox);
|
| 6276 |
case 1:
|
| 6277 |
return createPathFromCurves(curves.topRightBorderBox, curves.topRightPaddingBox, curves.bottomRightBorderBox, curves.bottomRightPaddingBox);
|
| 6278 |
case 2:
|
| 6279 |
return createPathFromCurves(curves.bottomRightBorderBox, curves.bottomRightPaddingBox, curves.bottomLeftBorderBox, curves.bottomLeftPaddingBox);
|
| 6280 |
case 3:
|
| 6281 |
default:
|
| 6282 |
return createPathFromCurves(curves.bottomLeftBorderBox, curves.bottomLeftPaddingBox, curves.topLeftBorderBox, curves.topLeftPaddingBox);
|
| 6283 |
}
|
| 6284 |
};
|
| 6285 |
var parsePathForBorderDoubleOuter = function (curves, borderSide) {
|
| 6286 |
switch (borderSide) {
|
| 6287 |
case 0:
|
| 6288 |
return createPathFromCurves(curves.topLeftBorderBox, curves.topLeftBorderDoubleOuterBox, curves.topRightBorderBox, curves.topRightBorderDoubleOuterBox);
|
| 6289 |
case 1:
|
| 6290 |
return createPathFromCurves(curves.topRightBorderBox, curves.topRightBorderDoubleOuterBox, curves.bottomRightBorderBox, curves.bottomRightBorderDoubleOuterBox);
|
| 6291 |
case 2:
|
| 6292 |
return createPathFromCurves(curves.bottomRightBorderBox, curves.bottomRightBorderDoubleOuterBox, curves.bottomLeftBorderBox, curves.bottomLeftBorderDoubleOuterBox);
|
| 6293 |
case 3:
|
| 6294 |
default:
|
| 6295 |
return createPathFromCurves(curves.bottomLeftBorderBox, curves.bottomLeftBorderDoubleOuterBox, curves.topLeftBorderBox, curves.topLeftBorderDoubleOuterBox);
|
| 6296 |
}
|
| 6297 |
};
|
| 6298 |
var parsePathForBorderDoubleInner = function (curves, borderSide) {
|
| 6299 |
switch (borderSide) {
|
| 6300 |
case 0:
|
| 6301 |
return createPathFromCurves(curves.topLeftBorderDoubleInnerBox, curves.topLeftPaddingBox, curves.topRightBorderDoubleInnerBox, curves.topRightPaddingBox);
|
| 6302 |
case 1:
|
| 6303 |
return createPathFromCurves(curves.topRightBorderDoubleInnerBox, curves.topRightPaddingBox, curves.bottomRightBorderDoubleInnerBox, curves.bottomRightPaddingBox);
|
| 6304 |
case 2:
|
| 6305 |
return createPathFromCurves(curves.bottomRightBorderDoubleInnerBox, curves.bottomRightPaddingBox, curves.bottomLeftBorderDoubleInnerBox, curves.bottomLeftPaddingBox);
|
| 6306 |
case 3:
|
| 6307 |
default:
|
| 6308 |
return createPathFromCurves(curves.bottomLeftBorderDoubleInnerBox, curves.bottomLeftPaddingBox, curves.topLeftBorderDoubleInnerBox, curves.topLeftPaddingBox);
|
| 6309 |
}
|
| 6310 |
};
|
| 6311 |
var parsePathForBorderStroke = function (curves, borderSide) {
|
| 6312 |
switch (borderSide) {
|
| 6313 |
case 0:
|
| 6314 |
return createStrokePathFromCurves(curves.topLeftBorderStroke, curves.topRightBorderStroke);
|
| 6315 |
case 1:
|
| 6316 |
return createStrokePathFromCurves(curves.topRightBorderStroke, curves.bottomRightBorderStroke);
|
| 6317 |
case 2:
|
| 6318 |
return createStrokePathFromCurves(curves.bottomRightBorderStroke, curves.bottomLeftBorderStroke);
|
| 6319 |
case 3:
|
| 6320 |
default:
|
| 6321 |
return createStrokePathFromCurves(curves.bottomLeftBorderStroke, curves.topLeftBorderStroke);
|
| 6322 |
}
|
| 6323 |
};
|
| 6324 |
var createStrokePathFromCurves = function (outer1, outer2) {
|
| 6325 |
var path = [];
|
| 6326 |
if (isBezierCurve(outer1)) {
|
| 6327 |
path.push(outer1.subdivide(0.5, false));
|
| 6328 |
}
|
| 6329 |
else {
|
| 6330 |
path.push(outer1);
|
| 6331 |
}
|
| 6332 |
if (isBezierCurve(outer2)) {
|
| 6333 |
path.push(outer2.subdivide(0.5, true));
|
| 6334 |
}
|
| 6335 |
else {
|
| 6336 |
path.push(outer2);
|
| 6337 |
}
|
| 6338 |
return path;
|
| 6339 |
};
|
| 6340 |
var createPathFromCurves = function (outer1, inner1, outer2, inner2) {
|
| 6341 |
var path = [];
|
| 6342 |
if (isBezierCurve(outer1)) {
|
| 6343 |
path.push(outer1.subdivide(0.5, false));
|
| 6344 |
}
|
| 6345 |
else {
|
| 6346 |
path.push(outer1);
|
| 6347 |
}
|
| 6348 |
if (isBezierCurve(outer2)) {
|
| 6349 |
path.push(outer2.subdivide(0.5, true));
|
| 6350 |
}
|
| 6351 |
else {
|
| 6352 |
path.push(outer2);
|
| 6353 |
}
|
| 6354 |
if (isBezierCurve(inner2)) {
|
| 6355 |
path.push(inner2.subdivide(0.5, true).reverse());
|
| 6356 |
}
|
| 6357 |
else {
|
| 6358 |
path.push(inner2);
|
| 6359 |
}
|
| 6360 |
if (isBezierCurve(inner1)) {
|
| 6361 |
path.push(inner1.subdivide(0.5, false).reverse());
|
| 6362 |
}
|
| 6363 |
else {
|
| 6364 |
path.push(inner1);
|
| 6365 |
}
|
| 6366 |
return path;
|
| 6367 |
};
|
| 6368 |
|
| 6369 |
var paddingBox = function (element) {
|
| 6370 |
var bounds = element.bounds;
|
| 6371 |
var styles = element.styles;
|
| 6372 |
return bounds.add(styles.borderLeftWidth, styles.borderTopWidth, -(styles.borderRightWidth + styles.borderLeftWidth), -(styles.borderTopWidth + styles.borderBottomWidth));
|
| 6373 |
};
|
| 6374 |
var contentBox = function (element) {
|
| 6375 |
var styles = element.styles;
|
| 6376 |
var bounds = element.bounds;
|
| 6377 |
var paddingLeft = getAbsoluteValue(styles.paddingLeft, bounds.width);
|
| 6378 |
var paddingRight = getAbsoluteValue(styles.paddingRight, bounds.width);
|
| 6379 |
var paddingTop = getAbsoluteValue(styles.paddingTop, bounds.width);
|
| 6380 |
var paddingBottom = getAbsoluteValue(styles.paddingBottom, bounds.width);
|
| 6381 |
return bounds.add(paddingLeft + styles.borderLeftWidth, paddingTop + styles.borderTopWidth, -(styles.borderRightWidth + styles.borderLeftWidth + paddingLeft + paddingRight), -(styles.borderTopWidth + styles.borderBottomWidth + paddingTop + paddingBottom));
|
| 6382 |
};
|
| 6383 |
|
| 6384 |
var calculateBackgroundPositioningArea = function (backgroundOrigin, element) {
|
| 6385 |
if (backgroundOrigin === 0 /* BORDER_BOX */) {
|
| 6386 |
return element.bounds;
|
| 6387 |
}
|
| 6388 |
if (backgroundOrigin === 2 /* CONTENT_BOX */) {
|
| 6389 |
return contentBox(element);
|
| 6390 |
}
|
| 6391 |
return paddingBox(element);
|
| 6392 |
};
|
| 6393 |
var calculateBackgroundPaintingArea = function (backgroundClip, element) {
|
| 6394 |
if (backgroundClip === 0 /* BORDER_BOX */) {
|
| 6395 |
return element.bounds;
|
| 6396 |
}
|
| 6397 |
if (backgroundClip === 2 /* CONTENT_BOX */) {
|
| 6398 |
return contentBox(element);
|
| 6399 |
}
|
| 6400 |
return paddingBox(element);
|
| 6401 |
};
|
| 6402 |
var calculateBackgroundRendering = function (container, index, intrinsicSize) {
|
| 6403 |
var backgroundPositioningArea = calculateBackgroundPositioningArea(getBackgroundValueForIndex(container.styles.backgroundOrigin, index), container);
|
| 6404 |
var backgroundPaintingArea = calculateBackgroundPaintingArea(getBackgroundValueForIndex(container.styles.backgroundClip, index), container);
|
| 6405 |
var backgroundImageSize = calculateBackgroundSize(getBackgroundValueForIndex(container.styles.backgroundSize, index), intrinsicSize, backgroundPositioningArea);
|
| 6406 |
var sizeWidth = backgroundImageSize[0], sizeHeight = backgroundImageSize[1];
|
| 6407 |
var position = getAbsoluteValueForTuple(getBackgroundValueForIndex(container.styles.backgroundPosition, index), backgroundPositioningArea.width - sizeWidth, backgroundPositioningArea.height - sizeHeight);
|
| 6408 |
var path = calculateBackgroundRepeatPath(getBackgroundValueForIndex(container.styles.backgroundRepeat, index), position, backgroundImageSize, backgroundPositioningArea, backgroundPaintingArea);
|
| 6409 |
var offsetX = Math.round(backgroundPositioningArea.left + position[0]);
|
| 6410 |
var offsetY = Math.round(backgroundPositioningArea.top + position[1]);
|
| 6411 |
return [path, offsetX, offsetY, sizeWidth, sizeHeight];
|
| 6412 |
};
|
| 6413 |
var isAuto = function (token) { return isIdentToken(token) && token.value === BACKGROUND_SIZE.AUTO; };
|
| 6414 |
var hasIntrinsicValue = function (value) { return typeof value === 'number'; };
|
| 6415 |
var calculateBackgroundSize = function (size, _a, bounds) {
|
| 6416 |
var intrinsicWidth = _a[0], intrinsicHeight = _a[1], intrinsicProportion = _a[2];
|
| 6417 |
var first = size[0], second = size[1];
|
| 6418 |
if (!first) {
|
| 6419 |
return [0, 0];
|
| 6420 |
}
|
| 6421 |
if (isLengthPercentage(first) && second && isLengthPercentage(second)) {
|
| 6422 |
return [getAbsoluteValue(first, bounds.width), getAbsoluteValue(second, bounds.height)];
|
| 6423 |
}
|
| 6424 |
var hasIntrinsicProportion = hasIntrinsicValue(intrinsicProportion);
|
| 6425 |
if (isIdentToken(first) && (first.value === BACKGROUND_SIZE.CONTAIN || first.value === BACKGROUND_SIZE.COVER)) {
|
| 6426 |
if (hasIntrinsicValue(intrinsicProportion)) {
|
| 6427 |
var targetRatio = bounds.width / bounds.height;
|
| 6428 |
return targetRatio < intrinsicProportion !== (first.value === BACKGROUND_SIZE.COVER)
|
| 6429 |
? [bounds.width, bounds.width / intrinsicProportion]
|
| 6430 |
: [bounds.height * intrinsicProportion, bounds.height];
|
| 6431 |
}
|
| 6432 |
return [bounds.width, bounds.height];
|
| 6433 |
}
|
| 6434 |
var hasIntrinsicWidth = hasIntrinsicValue(intrinsicWidth);
|
| 6435 |
var hasIntrinsicHeight = hasIntrinsicValue(intrinsicHeight);
|
| 6436 |
var hasIntrinsicDimensions = hasIntrinsicWidth || hasIntrinsicHeight;
|
| 6437 |
// If the background-size is auto or auto auto:
|
| 6438 |
if (isAuto(first) && (!second || isAuto(second))) {
|
| 6439 |
// If the image has both horizontal and vertical intrinsic dimensions, it's rendered at that size.
|
| 6440 |
if (hasIntrinsicWidth && hasIntrinsicHeight) {
|
| 6441 |
return [intrinsicWidth, intrinsicHeight];
|
| 6442 |
}
|
| 6443 |
// If the image has no intrinsic dimensions and has no intrinsic proportions,
|
| 6444 |
// it's rendered at the size of the background positioning area.
|
| 6445 |
if (!hasIntrinsicProportion && !hasIntrinsicDimensions) {
|
| 6446 |
return [bounds.width, bounds.height];
|
| 6447 |
}
|
| 6448 |
// TODO If the image has no intrinsic dimensions but has intrinsic proportions, it's rendered as if contain had been specified instead.
|
| 6449 |
// If the image has only one intrinsic dimension and has intrinsic proportions, it's rendered at the size corresponding to that one dimension.
|
| 6450 |
// The other dimension is computed using the specified dimension and the intrinsic proportions.
|
| 6451 |
if (hasIntrinsicDimensions && hasIntrinsicProportion) {
|
| 6452 |
var width_1 = hasIntrinsicWidth
|
| 6453 |
? intrinsicWidth
|
| 6454 |
: intrinsicHeight * intrinsicProportion;
|
| 6455 |
var height_1 = hasIntrinsicHeight
|
| 6456 |
? intrinsicHeight
|
| 6457 |
: intrinsicWidth / intrinsicProportion;
|
| 6458 |
return [width_1, height_1];
|
| 6459 |
}
|
| 6460 |
// If the image has only one intrinsic dimension but has no intrinsic proportions,
|
| 6461 |
// it's rendered using the specified dimension and the other dimension of the background positioning area.
|
| 6462 |
var width_2 = hasIntrinsicWidth ? intrinsicWidth : bounds.width;
|
| 6463 |
var height_2 = hasIntrinsicHeight ? intrinsicHeight : bounds.height;
|
| 6464 |
return [width_2, height_2];
|
| 6465 |
}
|
| 6466 |
// If the image has intrinsic proportions, it's stretched to the specified dimension.
|
| 6467 |
// The unspecified dimension is computed using the specified dimension and the intrinsic proportions.
|
| 6468 |
if (hasIntrinsicProportion) {
|
| 6469 |
var width_3 = 0;
|
| 6470 |
var height_3 = 0;
|
| 6471 |
if (isLengthPercentage(first)) {
|
| 6472 |
width_3 = getAbsoluteValue(first, bounds.width);
|
| 6473 |
}
|
| 6474 |
else if (isLengthPercentage(second)) {
|
| 6475 |
height_3 = getAbsoluteValue(second, bounds.height);
|
| 6476 |
}
|
| 6477 |
if (isAuto(first)) {
|
| 6478 |
width_3 = height_3 * intrinsicProportion;
|
| 6479 |
}
|
| 6480 |
else if (!second || isAuto(second)) {
|
| 6481 |
height_3 = width_3 / intrinsicProportion;
|
| 6482 |
}
|
| 6483 |
return [width_3, height_3];
|
| 6484 |
}
|
| 6485 |
// If the image has no intrinsic proportions, it's stretched to the specified dimension.
|
| 6486 |
// The unspecified dimension is computed using the image's corresponding intrinsic dimension,
|
| 6487 |
// if there is one. If there is no such intrinsic dimension,
|
| 6488 |
// it becomes the corresponding dimension of the background positioning area.
|
| 6489 |
var width = null;
|
| 6490 |
var height = null;
|
| 6491 |
if (isLengthPercentage(first)) {
|
| 6492 |
width = getAbsoluteValue(first, bounds.width);
|
| 6493 |
}
|
| 6494 |
else if (second && isLengthPercentage(second)) {
|
| 6495 |
height = getAbsoluteValue(second, bounds.height);
|
| 6496 |
}
|
| 6497 |
if (width !== null && (!second || isAuto(second))) {
|
| 6498 |
height =
|
| 6499 |
hasIntrinsicWidth && hasIntrinsicHeight
|
| 6500 |
? (width / intrinsicWidth) * intrinsicHeight
|
| 6501 |
: bounds.height;
|
| 6502 |
}
|
| 6503 |
if (height !== null && isAuto(first)) {
|
| 6504 |
width =
|
| 6505 |
hasIntrinsicWidth && hasIntrinsicHeight
|
| 6506 |
? (height / intrinsicHeight) * intrinsicWidth
|
| 6507 |
: bounds.width;
|
| 6508 |
}
|
| 6509 |
if (width !== null && height !== null) {
|
| 6510 |
return [width, height];
|
| 6511 |
}
|
| 6512 |
throw new Error("Unable to calculate background-size for element");
|
| 6513 |
};
|
| 6514 |
var getBackgroundValueForIndex = function (values, index) {
|
| 6515 |
var value = values[index];
|
| 6516 |
if (typeof value === 'undefined') {
|
| 6517 |
return values[0];
|
| 6518 |
}
|
| 6519 |
return value;
|
| 6520 |
};
|
| 6521 |
var calculateBackgroundRepeatPath = function (repeat, _a, _b, backgroundPositioningArea, backgroundPaintingArea) {
|
| 6522 |
var x = _a[0], y = _a[1];
|
| 6523 |
var width = _b[0], height = _b[1];
|
| 6524 |
switch (repeat) {
|
| 6525 |
case 2 /* REPEAT_X */:
|
| 6526 |
return [
|
| 6527 |
new Vector(Math.round(backgroundPositioningArea.left), Math.round(backgroundPositioningArea.top + y)),
|
| 6528 |
new Vector(Math.round(backgroundPositioningArea.left + backgroundPositioningArea.width), Math.round(backgroundPositioningArea.top + y)),
|
| 6529 |
new Vector(Math.round(backgroundPositioningArea.left + backgroundPositioningArea.width), Math.round(height + backgroundPositioningArea.top + y)),
|
| 6530 |
new Vector(Math.round(backgroundPositioningArea.left), Math.round(height + backgroundPositioningArea.top + y))
|
| 6531 |
];
|
| 6532 |
case 3 /* REPEAT_Y */:
|
| 6533 |
return [
|
| 6534 |
new Vector(Math.round(backgroundPositioningArea.left + x), Math.round(backgroundPositioningArea.top)),
|
| 6535 |
new Vector(Math.round(backgroundPositioningArea.left + x + width), Math.round(backgroundPositioningArea.top)),
|
| 6536 |
new Vector(Math.round(backgroundPositioningArea.left + x + width), Math.round(backgroundPositioningArea.height + backgroundPositioningArea.top)),
|
| 6537 |
new Vector(Math.round(backgroundPositioningArea.left + x), Math.round(backgroundPositioningArea.height + backgroundPositioningArea.top))
|
| 6538 |
];
|
| 6539 |
case 1 /* NO_REPEAT */:
|
| 6540 |
return [
|
| 6541 |
new Vector(Math.round(backgroundPositioningArea.left + x), Math.round(backgroundPositioningArea.top + y)),
|
| 6542 |
new Vector(Math.round(backgroundPositioningArea.left + x + width), Math.round(backgroundPositioningArea.top + y)),
|
| 6543 |
new Vector(Math.round(backgroundPositioningArea.left + x + width), Math.round(backgroundPositioningArea.top + y + height)),
|
| 6544 |
new Vector(Math.round(backgroundPositioningArea.left + x), Math.round(backgroundPositioningArea.top + y + height))
|
| 6545 |
];
|
| 6546 |
default:
|
| 6547 |
return [
|
| 6548 |
new Vector(Math.round(backgroundPaintingArea.left), Math.round(backgroundPaintingArea.top)),
|
| 6549 |
new Vector(Math.round(backgroundPaintingArea.left + backgroundPaintingArea.width), Math.round(backgroundPaintingArea.top)),
|
| 6550 |
new Vector(Math.round(backgroundPaintingArea.left + backgroundPaintingArea.width), Math.round(backgroundPaintingArea.height + backgroundPaintingArea.top)),
|
| 6551 |
new Vector(Math.round(backgroundPaintingArea.left), Math.round(backgroundPaintingArea.height + backgroundPaintingArea.top))
|
| 6552 |
];
|
| 6553 |
}
|
| 6554 |
};
|
| 6555 |
|
| 6556 |
var SMALL_IMAGE = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
|
| 6557 |
|
| 6558 |
var SAMPLE_TEXT = 'Hidden Text';
|
| 6559 |
var FontMetrics = /** @class */ (function () {
|
| 6560 |
function FontMetrics(document) {
|
| 6561 |
this._data = {};
|
| 6562 |
this._document = document;
|
| 6563 |
}
|
| 6564 |
FontMetrics.prototype.parseMetrics = function (fontFamily, fontSize) {
|
| 6565 |
var container = this._document.createElement('div');
|
| 6566 |
var img = this._document.createElement('img');
|
| 6567 |
var span = this._document.createElement('span');
|
| 6568 |
var body = this._document.body;
|
| 6569 |
container.style.visibility = 'hidden';
|
| 6570 |
container.style.fontFamily = fontFamily;
|
| 6571 |
container.style.fontSize = fontSize;
|
| 6572 |
container.style.margin = '0';
|
| 6573 |
container.style.padding = '0';
|
| 6574 |
container.style.whiteSpace = 'nowrap';
|
| 6575 |
body.appendChild(container);
|
| 6576 |
img.src = SMALL_IMAGE;
|
| 6577 |
img.width = 1;
|
| 6578 |
img.height = 1;
|
| 6579 |
img.style.margin = '0';
|
| 6580 |
img.style.padding = '0';
|
| 6581 |
img.style.verticalAlign = 'baseline';
|
| 6582 |
span.style.fontFamily = fontFamily;
|
| 6583 |
span.style.fontSize = fontSize;
|
| 6584 |
span.style.margin = '0';
|
| 6585 |
span.style.padding = '0';
|
| 6586 |
span.appendChild(this._document.createTextNode(SAMPLE_TEXT));
|
| 6587 |
container.appendChild(span);
|
| 6588 |
container.appendChild(img);
|
| 6589 |
var baseline = img.offsetTop - span.offsetTop + 2;
|
| 6590 |
container.removeChild(span);
|
| 6591 |
container.appendChild(this._document.createTextNode(SAMPLE_TEXT));
|
| 6592 |
container.style.lineHeight = 'normal';
|
| 6593 |
img.style.verticalAlign = 'super';
|
| 6594 |
var middle = img.offsetTop - container.offsetTop + 2;
|
| 6595 |
body.removeChild(container);
|
| 6596 |
return { baseline: baseline, middle: middle };
|
| 6597 |
};
|
| 6598 |
FontMetrics.prototype.getMetrics = function (fontFamily, fontSize) {
|
| 6599 |
var key = fontFamily + " " + fontSize;
|
| 6600 |
if (typeof this._data[key] === 'undefined') {
|
| 6601 |
this._data[key] = this.parseMetrics(fontFamily, fontSize);
|
| 6602 |
}
|
| 6603 |
return this._data[key];
|
| 6604 |
};
|
| 6605 |
return FontMetrics;
|
| 6606 |
}());
|
| 6607 |
|
| 6608 |
var Renderer = /** @class */ (function () {
|
| 6609 |
function Renderer(context, options) {
|
| 6610 |
this.context = context;
|
| 6611 |
this.options = options;
|
| 6612 |
}
|
| 6613 |
return Renderer;
|
| 6614 |
}());
|
| 6615 |
|
| 6616 |
var MASK_OFFSET = 10000;
|
| 6617 |
var CanvasRenderer = /** @class */ (function (_super) {
|
| 6618 |
__extends(CanvasRenderer, _super);
|
| 6619 |
function CanvasRenderer(context, options) {
|
| 6620 |
var _this = _super.call(this, context, options) || this;
|
| 6621 |
_this._activeEffects = [];
|
| 6622 |
_this.canvas = options.canvas ? options.canvas : document.createElement('canvas');
|
| 6623 |
_this.ctx = _this.canvas.getContext('2d');
|
| 6624 |
if (!options.canvas) {
|
| 6625 |
_this.canvas.width = Math.floor(options.width * options.scale);
|
| 6626 |
_this.canvas.height = Math.floor(options.height * options.scale);
|
| 6627 |
_this.canvas.style.width = options.width + "px";
|
| 6628 |
_this.canvas.style.height = options.height + "px";
|
| 6629 |
}
|
| 6630 |
_this.fontMetrics = new FontMetrics(document);
|
| 6631 |
_this.ctx.scale(_this.options.scale, _this.options.scale);
|
| 6632 |
_this.ctx.translate(-options.x, -options.y);
|
| 6633 |
_this.ctx.textBaseline = 'bottom';
|
| 6634 |
_this._activeEffects = [];
|
| 6635 |
_this.context.logger.debug("Canvas renderer initialized (" + options.width + "x" + options.height + ") with scale " + options.scale);
|
| 6636 |
return _this;
|
| 6637 |
}
|
| 6638 |
CanvasRenderer.prototype.applyEffects = function (effects) {
|
| 6639 |
var _this = this;
|
| 6640 |
while (this._activeEffects.length) {
|
| 6641 |
this.popEffect();
|
| 6642 |
}
|
| 6643 |
effects.forEach(function (effect) { return _this.applyEffect(effect); });
|
| 6644 |
};
|
| 6645 |
CanvasRenderer.prototype.applyEffect = function (effect) {
|
| 6646 |
this.ctx.save();
|
| 6647 |
if (isOpacityEffect(effect)) {
|
| 6648 |
this.ctx.globalAlpha = effect.opacity;
|
| 6649 |
}
|
| 6650 |
if (isTransformEffect(effect)) {
|
| 6651 |
this.ctx.translate(effect.offsetX, effect.offsetY);
|
| 6652 |
this.ctx.transform(effect.matrix[0], effect.matrix[1], effect.matrix[2], effect.matrix[3], effect.matrix[4], effect.matrix[5]);
|
| 6653 |
this.ctx.translate(-effect.offsetX, -effect.offsetY);
|
| 6654 |
}
|
| 6655 |
if (isClipEffect(effect)) {
|
| 6656 |
this.path(effect.path);
|
| 6657 |
this.ctx.clip();
|
| 6658 |
}
|
| 6659 |
this._activeEffects.push(effect);
|
| 6660 |
};
|
| 6661 |
CanvasRenderer.prototype.popEffect = function () {
|
| 6662 |
this._activeEffects.pop();
|
| 6663 |
this.ctx.restore();
|
| 6664 |
};
|
| 6665 |
CanvasRenderer.prototype.renderStack = function (stack) {
|
| 6666 |
return __awaiter(this, void 0, void 0, function () {
|
| 6667 |
var styles;
|
| 6668 |
return __generator(this, function (_a) {
|
| 6669 |
switch (_a.label) {
|
| 6670 |
case 0:
|
| 6671 |
styles = stack.element.container.styles;
|
| 6672 |
if (!styles.isVisible()) return [3 /*break*/, 2];
|
| 6673 |
return [4 /*yield*/, this.renderStackContent(stack)];
|
| 6674 |
case 1:
|
| 6675 |
_a.sent();
|
| 6676 |
_a.label = 2;
|
| 6677 |
case 2: return [2 /*return*/];
|
| 6678 |
}
|
| 6679 |
});
|
| 6680 |
});
|
| 6681 |
};
|
| 6682 |
CanvasRenderer.prototype.renderNode = function (paint) {
|
| 6683 |
return __awaiter(this, void 0, void 0, function () {
|
| 6684 |
return __generator(this, function (_a) {
|
| 6685 |
switch (_a.label) {
|
| 6686 |
case 0:
|
| 6687 |
if (contains(paint.container.flags, 16 /* DEBUG_RENDER */)) {
|
| 6688 |
debugger;
|
| 6689 |
}
|
| 6690 |
if (!paint.container.styles.isVisible()) return [3 /*break*/, 3];
|
| 6691 |
return [4 /*yield*/, this.renderNodeBackgroundAndBorders(paint)];
|
| 6692 |
case 1:
|
| 6693 |
_a.sent();
|
| 6694 |
return [4 /*yield*/, this.renderNodeContent(paint)];
|
| 6695 |
case 2:
|
| 6696 |
_a.sent();
|
| 6697 |
_a.label = 3;
|
| 6698 |
case 3: return [2 /*return*/];
|
| 6699 |
}
|
| 6700 |
});
|
| 6701 |
});
|
| 6702 |
};
|
| 6703 |
CanvasRenderer.prototype.renderTextWithLetterSpacing = function (text, letterSpacing, baseline) {
|
| 6704 |
var _this = this;
|
| 6705 |
if (letterSpacing === 0) {
|
| 6706 |
this.ctx.fillText(text.text, text.bounds.left, text.bounds.top + baseline);
|
| 6707 |
}
|
| 6708 |
else {
|
| 6709 |
var letters = segmentGraphemes(text.text);
|
| 6710 |
letters.reduce(function (left, letter) {
|
| 6711 |
_this.ctx.fillText(letter, left, text.bounds.top + baseline);
|
| 6712 |
return left + _this.ctx.measureText(letter).width;
|
| 6713 |
}, text.bounds.left);
|
| 6714 |
}
|
| 6715 |
};
|
| 6716 |
CanvasRenderer.prototype.createFontStyle = function (styles) {
|
| 6717 |
var fontVariant = styles.fontVariant
|
| 6718 |
.filter(function (variant) { return variant === 'normal' || variant === 'small-caps'; })
|
| 6719 |
.join('');
|
| 6720 |
var fontFamily = fixIOSSystemFonts(styles.fontFamily).join(', ');
|
| 6721 |
var fontSize = isDimensionToken(styles.fontSize)
|
| 6722 |
? "" + styles.fontSize.number + styles.fontSize.unit
|
| 6723 |
: styles.fontSize.number + "px";
|
| 6724 |
return [
|
| 6725 |
[styles.fontStyle, fontVariant, styles.fontWeight, fontSize, fontFamily].join(' '),
|
| 6726 |
fontFamily,
|
| 6727 |
fontSize
|
| 6728 |
];
|
| 6729 |
};
|
| 6730 |
CanvasRenderer.prototype.renderTextNode = function (text, styles) {
|
| 6731 |
return __awaiter(this, void 0, void 0, function () {
|
| 6732 |
var _a, font, fontFamily, fontSize, _b, baseline, middle, paintOrder;
|
| 6733 |
var _this = this;
|
| 6734 |
return __generator(this, function (_c) {
|
| 6735 |
_a = this.createFontStyle(styles), font = _a[0], fontFamily = _a[1], fontSize = _a[2];
|
| 6736 |
this.ctx.font = font;
|
| 6737 |
this.ctx.direction = styles.direction === 1 /* RTL */ ? 'rtl' : 'ltr';
|
| 6738 |
this.ctx.textAlign = 'left';
|
| 6739 |
this.ctx.textBaseline = 'alphabetic';
|
| 6740 |
_b = this.fontMetrics.getMetrics(fontFamily, fontSize), baseline = _b.baseline, middle = _b.middle;
|
| 6741 |
paintOrder = styles.paintOrder;
|
| 6742 |
text.textBounds.forEach(function (text) {
|
| 6743 |
paintOrder.forEach(function (paintOrderLayer) {
|
| 6744 |
switch (paintOrderLayer) {
|
| 6745 |
case 0 /* FILL */:
|
| 6746 |
_this.ctx.fillStyle = asString(styles.color);
|
| 6747 |
_this.renderTextWithLetterSpacing(text, styles.letterSpacing, baseline);
|
| 6748 |
var textShadows = styles.textShadow;
|
| 6749 |
if (textShadows.length && text.text.trim().length) {
|
| 6750 |
textShadows
|
| 6751 |
.slice(0)
|
| 6752 |
.reverse()
|
| 6753 |
.forEach(function (textShadow) {
|
| 6754 |
_this.ctx.shadowColor = asString(textShadow.color);
|
| 6755 |
_this.ctx.shadowOffsetX = textShadow.offsetX.number * _this.options.scale;
|
| 6756 |
_this.ctx.shadowOffsetY = textShadow.offsetY.number * _this.options.scale;
|
| 6757 |
_this.ctx.shadowBlur = textShadow.blur.number;
|
| 6758 |
_this.renderTextWithLetterSpacing(text, styles.letterSpacing, baseline);
|
| 6759 |
});
|
| 6760 |
_this.ctx.shadowColor = '';
|
| 6761 |
_this.ctx.shadowOffsetX = 0;
|
| 6762 |
_this.ctx.shadowOffsetY = 0;
|
| 6763 |
_this.ctx.shadowBlur = 0;
|
| 6764 |
}
|
| 6765 |
if (styles.textDecorationLine.length) {
|
| 6766 |
_this.ctx.fillStyle = asString(styles.textDecorationColor || styles.color);
|
| 6767 |
styles.textDecorationLine.forEach(function (textDecorationLine) {
|
| 6768 |
switch (textDecorationLine) {
|
| 6769 |
case 1 /* UNDERLINE */:
|
| 6770 |
// Draws a line at the baseline of the font
|
| 6771 |
// TODO As some browsers display the line as more than 1px if the font-size is big,
|
| 6772 |
// need to take that into account both in position and size
|
| 6773 |
_this.ctx.fillRect(text.bounds.left, Math.round(text.bounds.top + baseline), text.bounds.width, 1);
|
| 6774 |
break;
|
| 6775 |
case 2 /* OVERLINE */:
|
| 6776 |
_this.ctx.fillRect(text.bounds.left, Math.round(text.bounds.top), text.bounds.width, 1);
|
| 6777 |
break;
|
| 6778 |
case 3 /* LINE_THROUGH */:
|
| 6779 |
// TODO try and find exact position for line-through
|
| 6780 |
_this.ctx.fillRect(text.bounds.left, Math.ceil(text.bounds.top + middle), text.bounds.width, 1);
|
| 6781 |
break;
|
| 6782 |
}
|
| 6783 |
});
|
| 6784 |
}
|
| 6785 |
break;
|
| 6786 |
case 1 /* STROKE */:
|
| 6787 |
if (styles.webkitTextStrokeWidth && text.text.trim().length) {
|
| 6788 |
_this.ctx.strokeStyle = asString(styles.webkitTextStrokeColor);
|
| 6789 |
_this.ctx.lineWidth = styles.webkitTextStrokeWidth;
|
| 6790 |
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
| 6791 |
_this.ctx.lineJoin = !!window.chrome ? 'miter' : 'round';
|
| 6792 |
_this.ctx.strokeText(text.text, text.bounds.left, text.bounds.top + baseline);
|
| 6793 |
}
|
| 6794 |
_this.ctx.strokeStyle = '';
|
| 6795 |
_this.ctx.lineWidth = 0;
|
| 6796 |
_this.ctx.lineJoin = 'miter';
|
| 6797 |
break;
|
| 6798 |
}
|
| 6799 |
});
|
| 6800 |
});
|
| 6801 |
return [2 /*return*/];
|
| 6802 |
});
|
| 6803 |
});
|
| 6804 |
};
|
| 6805 |
CanvasRenderer.prototype.renderReplacedElement = function (container, curves, image) {
|
| 6806 |
if (image && container.intrinsicWidth > 0 && container.intrinsicHeight > 0) {
|
| 6807 |
var box = contentBox(container);
|
| 6808 |
var path = calculatePaddingBoxPath(curves);
|
| 6809 |
this.path(path);
|
| 6810 |
this.ctx.save();
|
| 6811 |
this.ctx.clip();
|
| 6812 |
this.ctx.drawImage(image, 0, 0, container.intrinsicWidth, container.intrinsicHeight, box.left, box.top, box.width, box.height);
|
| 6813 |
this.ctx.restore();
|
| 6814 |
}
|
| 6815 |
};
|
| 6816 |
CanvasRenderer.prototype.renderNodeContent = function (paint) {
|
| 6817 |
return __awaiter(this, void 0, void 0, function () {
|
| 6818 |
var container, curves, styles, _i, _a, child, image, image, iframeRenderer, canvas, size, _b, fontFamily, fontSize, baseline, bounds, x, textBounds, img, image, url, fontFamily, bounds;
|
| 6819 |
return __generator(this, function (_c) {
|
| 6820 |
switch (_c.label) {
|
| 6821 |
case 0:
|
| 6822 |
this.applyEffects(paint.getEffects(4 /* CONTENT */));
|
| 6823 |
container = paint.container;
|
| 6824 |
curves = paint.curves;
|
| 6825 |
styles = container.styles;
|
| 6826 |
_i = 0, _a = container.textNodes;
|
| 6827 |
_c.label = 1;
|
| 6828 |
case 1:
|
| 6829 |
if (!(_i < _a.length)) return [3 /*break*/, 4];
|
| 6830 |
child = _a[_i];
|
| 6831 |
return [4 /*yield*/, this.renderTextNode(child, styles)];
|
| 6832 |
case 2:
|
| 6833 |
_c.sent();
|
| 6834 |
_c.label = 3;
|
| 6835 |
case 3:
|
| 6836 |
_i++;
|
| 6837 |
return [3 /*break*/, 1];
|
| 6838 |
case 4:
|
| 6839 |
if (!(container instanceof ImageElementContainer)) return [3 /*break*/, 8];
|
| 6840 |
_c.label = 5;
|
| 6841 |
case 5:
|
| 6842 |
_c.trys.push([5, 7, , 8]);
|
| 6843 |
return [4 /*yield*/, this.context.cache.match(container.src)];
|
| 6844 |
case 6:
|
| 6845 |
image = _c.sent();
|
| 6846 |
this.renderReplacedElement(container, curves, image);
|
| 6847 |
return [3 /*break*/, 8];
|
| 6848 |
case 7:
|
| 6849 |
_c.sent();
|
| 6850 |
this.context.logger.error("Error loading image " + container.src);
|
| 6851 |
return [3 /*break*/, 8];
|
| 6852 |
case 8:
|
| 6853 |
if (container instanceof CanvasElementContainer) {
|
| 6854 |
this.renderReplacedElement(container, curves, container.canvas);
|
| 6855 |
}
|
| 6856 |
if (!(container instanceof SVGElementContainer)) return [3 /*break*/, 12];
|
| 6857 |
_c.label = 9;
|
| 6858 |
case 9:
|
| 6859 |
_c.trys.push([9, 11, , 12]);
|
| 6860 |
return [4 /*yield*/, this.context.cache.match(container.svg)];
|
| 6861 |
case 10:
|
| 6862 |
image = _c.sent();
|
| 6863 |
this.renderReplacedElement(container, curves, image);
|
| 6864 |
return [3 /*break*/, 12];
|
| 6865 |
case 11:
|
| 6866 |
_c.sent();
|
| 6867 |
this.context.logger.error("Error loading svg " + container.svg.substring(0, 255));
|
| 6868 |
return [3 /*break*/, 12];
|
| 6869 |
case 12:
|
| 6870 |
if (!(container instanceof IFrameElementContainer && container.tree)) return [3 /*break*/, 14];
|
| 6871 |
iframeRenderer = new CanvasRenderer(this.context, {
|
| 6872 |
scale: this.options.scale,
|
| 6873 |
backgroundColor: container.backgroundColor,
|
| 6874 |
x: 0,
|
| 6875 |
y: 0,
|
| 6876 |
width: container.width,
|
| 6877 |
height: container.height
|
| 6878 |
});
|
| 6879 |
return [4 /*yield*/, iframeRenderer.render(container.tree)];
|
| 6880 |
case 13:
|
| 6881 |
canvas = _c.sent();
|
| 6882 |
if (container.width && container.height) {
|
| 6883 |
this.ctx.drawImage(canvas, 0, 0, container.width, container.height, container.bounds.left, container.bounds.top, container.bounds.width, container.bounds.height);
|
| 6884 |
}
|
| 6885 |
_c.label = 14;
|
| 6886 |
case 14:
|
| 6887 |
if (container instanceof InputElementContainer) {
|
| 6888 |
size = Math.min(container.bounds.width, container.bounds.height);
|
| 6889 |
if (container.type === CHECKBOX) {
|
| 6890 |
if (container.checked) {
|
| 6891 |
this.ctx.save();
|
| 6892 |
this.path([
|
| 6893 |
new Vector(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79),
|
| 6894 |
new Vector(container.bounds.left + size * 0.16, container.bounds.top + size * 0.5549),
|
| 6895 |
new Vector(container.bounds.left + size * 0.27347, container.bounds.top + size * 0.44071),
|
| 6896 |
new Vector(container.bounds.left + size * 0.39694, container.bounds.top + size * 0.5649),
|
| 6897 |
new Vector(container.bounds.left + size * 0.72983, container.bounds.top + size * 0.23),
|
| 6898 |
new Vector(container.bounds.left + size * 0.84, container.bounds.top + size * 0.34085),
|
| 6899 |
new Vector(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79)
|
| 6900 |
]);
|
| 6901 |
this.ctx.fillStyle = asString(INPUT_COLOR);
|
| 6902 |
this.ctx.fill();
|
| 6903 |
this.ctx.restore();
|
| 6904 |
}
|
| 6905 |
}
|
| 6906 |
else if (container.type === RADIO) {
|
| 6907 |
if (container.checked) {
|
| 6908 |
this.ctx.save();
|
| 6909 |
this.ctx.beginPath();
|
| 6910 |
this.ctx.arc(container.bounds.left + size / 2, container.bounds.top + size / 2, size / 4, 0, Math.PI * 2, true);
|
| 6911 |
this.ctx.fillStyle = asString(INPUT_COLOR);
|
| 6912 |
this.ctx.fill();
|
| 6913 |
this.ctx.restore();
|
| 6914 |
}
|
| 6915 |
}
|
| 6916 |
}
|
| 6917 |
if (isTextInputElement(container) && container.value.length) {
|
| 6918 |
_b = this.createFontStyle(styles), fontFamily = _b[0], fontSize = _b[1];
|
| 6919 |
baseline = this.fontMetrics.getMetrics(fontFamily, fontSize).baseline;
|
| 6920 |
this.ctx.font = fontFamily;
|
| 6921 |
this.ctx.fillStyle = asString(styles.color);
|
| 6922 |
this.ctx.textBaseline = 'alphabetic';
|
| 6923 |
this.ctx.textAlign = canvasTextAlign(container.styles.textAlign);
|
| 6924 |
bounds = contentBox(container);
|
| 6925 |
x = 0;
|
| 6926 |
switch (container.styles.textAlign) {
|
| 6927 |
case 1 /* CENTER */:
|
| 6928 |
x += bounds.width / 2;
|
| 6929 |
break;
|
| 6930 |
case 2 /* RIGHT */:
|
| 6931 |
x += bounds.width;
|
| 6932 |
break;
|
| 6933 |
}
|
| 6934 |
textBounds = bounds.add(x, 0, 0, -bounds.height / 2 + 1);
|
| 6935 |
this.ctx.save();
|
| 6936 |
this.path([
|
| 6937 |
new Vector(bounds.left, bounds.top),
|
| 6938 |
new Vector(bounds.left + bounds.width, bounds.top),
|
| 6939 |
new Vector(bounds.left + bounds.width, bounds.top + bounds.height),
|
| 6940 |
new Vector(bounds.left, bounds.top + bounds.height)
|
| 6941 |
]);
|
| 6942 |
this.ctx.clip();
|
| 6943 |
this.renderTextWithLetterSpacing(new TextBounds(container.value, textBounds), styles.letterSpacing, baseline);
|
| 6944 |
this.ctx.restore();
|
| 6945 |
this.ctx.textBaseline = 'alphabetic';
|
| 6946 |
this.ctx.textAlign = 'left';
|
| 6947 |
}
|
| 6948 |
if (!contains(container.styles.display, 2048 /* LIST_ITEM */)) return [3 /*break*/, 20];
|
| 6949 |
if (!(container.styles.listStyleImage !== null)) return [3 /*break*/, 19];
|
| 6950 |
img = container.styles.listStyleImage;
|
| 6951 |
if (!(img.type === 0 /* URL */)) return [3 /*break*/, 18];
|
| 6952 |
image = void 0;
|
| 6953 |
url = img.url;
|
| 6954 |
_c.label = 15;
|
| 6955 |
case 15:
|
| 6956 |
_c.trys.push([15, 17, , 18]);
|
| 6957 |
return [4 /*yield*/, this.context.cache.match(url)];
|
| 6958 |
case 16:
|
| 6959 |
image = _c.sent();
|
| 6960 |
this.ctx.drawImage(image, container.bounds.left - (image.width + 10), container.bounds.top);
|
| 6961 |
return [3 /*break*/, 18];
|
| 6962 |
case 17:
|
| 6963 |
_c.sent();
|
| 6964 |
this.context.logger.error("Error loading list-style-image " + url);
|
| 6965 |
return [3 /*break*/, 18];
|
| 6966 |
case 18: return [3 /*break*/, 20];
|
| 6967 |
case 19:
|
| 6968 |
if (paint.listValue && container.styles.listStyleType !== -1 /* NONE */) {
|
| 6969 |
fontFamily = this.createFontStyle(styles)[0];
|
| 6970 |
this.ctx.font = fontFamily;
|
| 6971 |
this.ctx.fillStyle = asString(styles.color);
|
| 6972 |
this.ctx.textBaseline = 'middle';
|
| 6973 |
this.ctx.textAlign = 'right';
|
| 6974 |
bounds = new Bounds(container.bounds.left, container.bounds.top + getAbsoluteValue(container.styles.paddingTop, container.bounds.width), container.bounds.width, computeLineHeight(styles.lineHeight, styles.fontSize.number) / 2 + 1);
|
| 6975 |
this.renderTextWithLetterSpacing(new TextBounds(paint.listValue, bounds), styles.letterSpacing, computeLineHeight(styles.lineHeight, styles.fontSize.number) / 2 + 2);
|
| 6976 |
this.ctx.textBaseline = 'bottom';
|
| 6977 |
this.ctx.textAlign = 'left';
|
| 6978 |
}
|
| 6979 |
_c.label = 20;
|
| 6980 |
case 20: return [2 /*return*/];
|
| 6981 |
}
|
| 6982 |
});
|
| 6983 |
});
|
| 6984 |
};
|
| 6985 |
CanvasRenderer.prototype.renderStackContent = function (stack) {
|
| 6986 |
return __awaiter(this, void 0, void 0, function () {
|
| 6987 |
var _i, _a, child, _b, _c, child, _d, _e, child, _f, _g, child, _h, _j, child, _k, _l, child, _m, _o, child;
|
| 6988 |
return __generator(this, function (_p) {
|
| 6989 |
switch (_p.label) {
|
| 6990 |
case 0:
|
| 6991 |
if (contains(stack.element.container.flags, 16 /* DEBUG_RENDER */)) {
|
| 6992 |
debugger;
|
| 6993 |
}
|
| 6994 |
// https://www.w3.org/TR/css-position-3/#painting-order
|
| 6995 |
// 1. the background and borders of the element forming the stacking context.
|
| 6996 |
return [4 /*yield*/, this.renderNodeBackgroundAndBorders(stack.element)];
|
| 6997 |
case 1:
|
| 6998 |
// https://www.w3.org/TR/css-position-3/#painting-order
|
| 6999 |
// 1. the background and borders of the element forming the stacking context.
|
| 7000 |
_p.sent();
|
| 7001 |
_i = 0, _a = stack.negativeZIndex;
|
| 7002 |
_p.label = 2;
|
| 7003 |
case 2:
|
| 7004 |
if (!(_i < _a.length)) return [3 /*break*/, 5];
|
| 7005 |
child = _a[_i];
|
| 7006 |
return [4 /*yield*/, this.renderStack(child)];
|
| 7007 |
case 3:
|
| 7008 |
_p.sent();
|
| 7009 |
_p.label = 4;
|
| 7010 |
case 4:
|
| 7011 |
_i++;
|
| 7012 |
return [3 /*break*/, 2];
|
| 7013 |
case 5:
|
| 7014 |
// 3. For all its in-flow, non-positioned, block-level descendants in tree order:
|
| 7015 |
return [4 /*yield*/, this.renderNodeContent(stack.element)];
|
| 7016 |
case 6:
|
| 7017 |
// 3. For all its in-flow, non-positioned, block-level descendants in tree order:
|
| 7018 |
_p.sent();
|
| 7019 |
_b = 0, _c = stack.nonInlineLevel;
|
| 7020 |
_p.label = 7;
|
| 7021 |
case 7:
|
| 7022 |
if (!(_b < _c.length)) return [3 /*break*/, 10];
|
| 7023 |
child = _c[_b];
|
| 7024 |
return [4 /*yield*/, this.renderNode(child)];
|
| 7025 |
case 8:
|
| 7026 |
_p.sent();
|
| 7027 |
_p.label = 9;
|
| 7028 |
case 9:
|
| 7029 |
_b++;
|
| 7030 |
return [3 /*break*/, 7];
|
| 7031 |
case 10:
|
| 7032 |
_d = 0, _e = stack.nonPositionedFloats;
|
| 7033 |
_p.label = 11;
|
| 7034 |
case 11:
|
| 7035 |
if (!(_d < _e.length)) return [3 /*break*/, 14];
|
| 7036 |
child = _e[_d];
|
| 7037 |
return [4 /*yield*/, this.renderStack(child)];
|
| 7038 |
case 12:
|
| 7039 |
_p.sent();
|
| 7040 |
_p.label = 13;
|
| 7041 |
case 13:
|
| 7042 |
_d++;
|
| 7043 |
return [3 /*break*/, 11];
|
| 7044 |
case 14:
|
| 7045 |
_f = 0, _g = stack.nonPositionedInlineLevel;
|
| 7046 |
_p.label = 15;
|
| 7047 |
case 15:
|
| 7048 |
if (!(_f < _g.length)) return [3 /*break*/, 18];
|
| 7049 |
child = _g[_f];
|
| 7050 |
return [4 /*yield*/, this.renderStack(child)];
|
| 7051 |
case 16:
|
| 7052 |
_p.sent();
|
| 7053 |
_p.label = 17;
|
| 7054 |
case 17:
|
| 7055 |
_f++;
|
| 7056 |
return [3 /*break*/, 15];
|
| 7057 |
case 18:
|
| 7058 |
_h = 0, _j = stack.inlineLevel;
|
| 7059 |
_p.label = 19;
|
| 7060 |
case 19:
|
| 7061 |
if (!(_h < _j.length)) return [3 /*break*/, 22];
|
| 7062 |
child = _j[_h];
|
| 7063 |
return [4 /*yield*/, this.renderNode(child)];
|
| 7064 |
case 20:
|
| 7065 |
_p.sent();
|
| 7066 |
_p.label = 21;
|
| 7067 |
case 21:
|
| 7068 |
_h++;
|
| 7069 |
return [3 /*break*/, 19];
|
| 7070 |
case 22:
|
| 7071 |
_k = 0, _l = stack.zeroOrAutoZIndexOrTransformedOrOpacity;
|
| 7072 |
_p.label = 23;
|
| 7073 |
case 23:
|
| 7074 |
if (!(_k < _l.length)) return [3 /*break*/, 26];
|
| 7075 |
child = _l[_k];
|
| 7076 |
return [4 /*yield*/, this.renderStack(child)];
|
| 7077 |
case 24:
|
| 7078 |
_p.sent();
|
| 7079 |
_p.label = 25;
|
| 7080 |
case 25:
|
| 7081 |
_k++;
|
| 7082 |
return [3 /*break*/, 23];
|
| 7083 |
case 26:
|
| 7084 |
_m = 0, _o = stack.positiveZIndex;
|
| 7085 |
_p.label = 27;
|
| 7086 |
case 27:
|
| 7087 |
if (!(_m < _o.length)) return [3 /*break*/, 30];
|
| 7088 |
child = _o[_m];
|
| 7089 |
return [4 /*yield*/, this.renderStack(child)];
|
| 7090 |
case 28:
|
| 7091 |
_p.sent();
|
| 7092 |
_p.label = 29;
|
| 7093 |
case 29:
|
| 7094 |
_m++;
|
| 7095 |
return [3 /*break*/, 27];
|
| 7096 |
case 30: return [2 /*return*/];
|
| 7097 |
}
|
| 7098 |
});
|
| 7099 |
});
|
| 7100 |
};
|
| 7101 |
CanvasRenderer.prototype.mask = function (paths) {
|
| 7102 |
this.ctx.beginPath();
|
| 7103 |
this.ctx.moveTo(0, 0);
|
| 7104 |
this.ctx.lineTo(this.canvas.width, 0);
|
| 7105 |
this.ctx.lineTo(this.canvas.width, this.canvas.height);
|
| 7106 |
this.ctx.lineTo(0, this.canvas.height);
|
| 7107 |
this.ctx.lineTo(0, 0);
|
| 7108 |
this.formatPath(paths.slice(0).reverse());
|
| 7109 |
this.ctx.closePath();
|
| 7110 |
};
|
| 7111 |
CanvasRenderer.prototype.path = function (paths) {
|
| 7112 |
this.ctx.beginPath();
|
| 7113 |
this.formatPath(paths);
|
| 7114 |
this.ctx.closePath();
|
| 7115 |
};
|
| 7116 |
CanvasRenderer.prototype.formatPath = function (paths) {
|
| 7117 |
var _this = this;
|
| 7118 |
paths.forEach(function (point, index) {
|
| 7119 |
var start = isBezierCurve(point) ? point.start : point;
|
| 7120 |
if (index === 0) {
|
| 7121 |
_this.ctx.moveTo(start.x, start.y);
|
| 7122 |
}
|
| 7123 |
else {
|
| 7124 |
_this.ctx.lineTo(start.x, start.y);
|
| 7125 |
}
|
| 7126 |
if (isBezierCurve(point)) {
|
| 7127 |
_this.ctx.bezierCurveTo(point.startControl.x, point.startControl.y, point.endControl.x, point.endControl.y, point.end.x, point.end.y);
|
| 7128 |
}
|
| 7129 |
});
|
| 7130 |
};
|
| 7131 |
CanvasRenderer.prototype.renderRepeat = function (path, pattern, offsetX, offsetY) {
|
| 7132 |
this.path(path);
|
| 7133 |
this.ctx.fillStyle = pattern;
|
| 7134 |
this.ctx.translate(offsetX, offsetY);
|
| 7135 |
this.ctx.fill();
|
| 7136 |
this.ctx.translate(-offsetX, -offsetY);
|
| 7137 |
};
|
| 7138 |
CanvasRenderer.prototype.resizeImage = function (image, width, height) {
|
| 7139 |
var _a;
|
| 7140 |
if (image.width === width && image.height === height) {
|
| 7141 |
return image;
|
| 7142 |
}
|
| 7143 |
var ownerDocument = (_a = this.canvas.ownerDocument) !== null && _a !== void 0 ? _a : document;
|
| 7144 |
var canvas = ownerDocument.createElement('canvas');
|
| 7145 |
canvas.width = Math.max(1, width);
|
| 7146 |
canvas.height = Math.max(1, height);
|
| 7147 |
var ctx = canvas.getContext('2d');
|
| 7148 |
ctx.drawImage(image, 0, 0, image.width, image.height, 0, 0, width, height);
|
| 7149 |
return canvas;
|
| 7150 |
};
|
| 7151 |
CanvasRenderer.prototype.renderBackgroundImage = function (container) {
|
| 7152 |
return __awaiter(this, void 0, void 0, function () {
|
| 7153 |
var index, _loop_1, this_1, _i, _a, backgroundImage;
|
| 7154 |
return __generator(this, function (_b) {
|
| 7155 |
switch (_b.label) {
|
| 7156 |
case 0:
|
| 7157 |
index = container.styles.backgroundImage.length - 1;
|
| 7158 |
_loop_1 = function (backgroundImage) {
|
| 7159 |
var image, url, _c, path, x, y, width, height, pattern, _d, path, x, y, width, height, _e, lineLength, x0, x1, y0, y1, canvas, ctx, gradient_1, pattern, _f, path, left, top_1, width, height, position, x, y, _g, rx, ry, radialGradient_1, midX, midY, f, invF;
|
| 7160 |
return __generator(this, function (_h) {
|
| 7161 |
switch (_h.label) {
|
| 7162 |
case 0:
|
| 7163 |
if (!(backgroundImage.type === 0 /* URL */)) return [3 /*break*/, 5];
|
| 7164 |
image = void 0;
|
| 7165 |
url = backgroundImage.url;
|
| 7166 |
_h.label = 1;
|
| 7167 |
case 1:
|
| 7168 |
_h.trys.push([1, 3, , 4]);
|
| 7169 |
return [4 /*yield*/, this_1.context.cache.match(url)];
|
| 7170 |
case 2:
|
| 7171 |
image = _h.sent();
|
| 7172 |
return [3 /*break*/, 4];
|
| 7173 |
case 3:
|
| 7174 |
_h.sent();
|
| 7175 |
this_1.context.logger.error("Error loading background-image " + url);
|
| 7176 |
return [3 /*break*/, 4];
|
| 7177 |
case 4:
|
| 7178 |
if (image) {
|
| 7179 |
_c = calculateBackgroundRendering(container, index, [
|
| 7180 |
image.width,
|
| 7181 |
image.height,
|
| 7182 |
image.width / image.height
|
| 7183 |
]), path = _c[0], x = _c[1], y = _c[2], width = _c[3], height = _c[4];
|
| 7184 |
pattern = this_1.ctx.createPattern(this_1.resizeImage(image, width, height), 'repeat');
|
| 7185 |
this_1.renderRepeat(path, pattern, x, y);
|
| 7186 |
}
|
| 7187 |
return [3 /*break*/, 6];
|
| 7188 |
case 5:
|
| 7189 |
if (isLinearGradient(backgroundImage)) {
|
| 7190 |
_d = calculateBackgroundRendering(container, index, [null, null, null]), path = _d[0], x = _d[1], y = _d[2], width = _d[3], height = _d[4];
|
| 7191 |
_e = calculateGradientDirection(backgroundImage.angle, width, height), lineLength = _e[0], x0 = _e[1], x1 = _e[2], y0 = _e[3], y1 = _e[4];
|
| 7192 |
canvas = document.createElement('canvas');
|
| 7193 |
canvas.width = width;
|
| 7194 |
canvas.height = height;
|
| 7195 |
ctx = canvas.getContext('2d');
|
| 7196 |
gradient_1 = ctx.createLinearGradient(x0, y0, x1, y1);
|
| 7197 |
processColorStops(backgroundImage.stops, lineLength).forEach(function (colorStop) {
|
| 7198 |
return gradient_1.addColorStop(colorStop.stop, asString(colorStop.color));
|
| 7199 |
});
|
| 7200 |
ctx.fillStyle = gradient_1;
|
| 7201 |
ctx.fillRect(0, 0, width, height);
|
| 7202 |
if (width > 0 && height > 0) {
|
| 7203 |
pattern = this_1.ctx.createPattern(canvas, 'repeat');
|
| 7204 |
this_1.renderRepeat(path, pattern, x, y);
|
| 7205 |
}
|
| 7206 |
}
|
| 7207 |
else if (isRadialGradient(backgroundImage)) {
|
| 7208 |
_f = calculateBackgroundRendering(container, index, [
|
| 7209 |
null,
|
| 7210 |
null,
|
| 7211 |
null
|
| 7212 |
]), path = _f[0], left = _f[1], top_1 = _f[2], width = _f[3], height = _f[4];
|
| 7213 |
position = backgroundImage.position.length === 0 ? [FIFTY_PERCENT] : backgroundImage.position;
|
| 7214 |
x = getAbsoluteValue(position[0], width);
|
| 7215 |
y = getAbsoluteValue(position[position.length - 1], height);
|
| 7216 |
_g = calculateRadius(backgroundImage, x, y, width, height), rx = _g[0], ry = _g[1];
|
| 7217 |
if (rx > 0 && ry > 0) {
|
| 7218 |
radialGradient_1 = this_1.ctx.createRadialGradient(left + x, top_1 + y, 0, left + x, top_1 + y, rx);
|
| 7219 |
processColorStops(backgroundImage.stops, rx * 2).forEach(function (colorStop) {
|
| 7220 |
return radialGradient_1.addColorStop(colorStop.stop, asString(colorStop.color));
|
| 7221 |
});
|
| 7222 |
this_1.path(path);
|
| 7223 |
this_1.ctx.fillStyle = radialGradient_1;
|
| 7224 |
if (rx !== ry) {
|
| 7225 |
midX = container.bounds.left + 0.5 * container.bounds.width;
|
| 7226 |
midY = container.bounds.top + 0.5 * container.bounds.height;
|
| 7227 |
f = ry / rx;
|
| 7228 |
invF = 1 / f;
|
| 7229 |
this_1.ctx.save();
|
| 7230 |
this_1.ctx.translate(midX, midY);
|
| 7231 |
this_1.ctx.transform(1, 0, 0, f, 0, 0);
|
| 7232 |
this_1.ctx.translate(-midX, -midY);
|
| 7233 |
this_1.ctx.fillRect(left, invF * (top_1 - midY) + midY, width, height * invF);
|
| 7234 |
this_1.ctx.restore();
|
| 7235 |
}
|
| 7236 |
else {
|
| 7237 |
this_1.ctx.fill();
|
| 7238 |
}
|
| 7239 |
}
|
| 7240 |
}
|
| 7241 |
_h.label = 6;
|
| 7242 |
case 6:
|
| 7243 |
index--;
|
| 7244 |
return [2 /*return*/];
|
| 7245 |
}
|
| 7246 |
});
|
| 7247 |
};
|
| 7248 |
this_1 = this;
|
| 7249 |
_i = 0, _a = container.styles.backgroundImage.slice(0).reverse();
|
| 7250 |
_b.label = 1;
|
| 7251 |
case 1:
|
| 7252 |
if (!(_i < _a.length)) return [3 /*break*/, 4];
|
| 7253 |
backgroundImage = _a[_i];
|
| 7254 |
return [5 /*yield**/, _loop_1(backgroundImage)];
|
| 7255 |
case 2:
|
| 7256 |
_b.sent();
|
| 7257 |
_b.label = 3;
|
| 7258 |
case 3:
|
| 7259 |
_i++;
|
| 7260 |
return [3 /*break*/, 1];
|
| 7261 |
case 4: return [2 /*return*/];
|
| 7262 |
}
|
| 7263 |
});
|
| 7264 |
});
|
| 7265 |
};
|
| 7266 |
CanvasRenderer.prototype.renderSolidBorder = function (color, side, curvePoints) {
|
| 7267 |
return __awaiter(this, void 0, void 0, function () {
|
| 7268 |
return __generator(this, function (_a) {
|
| 7269 |
this.path(parsePathForBorder(curvePoints, side));
|
| 7270 |
this.ctx.fillStyle = asString(color);
|
| 7271 |
this.ctx.fill();
|
| 7272 |
return [2 /*return*/];
|
| 7273 |
});
|
| 7274 |
});
|
| 7275 |
};
|
| 7276 |
CanvasRenderer.prototype.renderDoubleBorder = function (color, width, side, curvePoints) {
|
| 7277 |
return __awaiter(this, void 0, void 0, function () {
|
| 7278 |
var outerPaths, innerPaths;
|
| 7279 |
return __generator(this, function (_a) {
|
| 7280 |
switch (_a.label) {
|
| 7281 |
case 0:
|
| 7282 |
if (!(width < 3)) return [3 /*break*/, 2];
|
| 7283 |
return [4 /*yield*/, this.renderSolidBorder(color, side, curvePoints)];
|
| 7284 |
case 1:
|
| 7285 |
_a.sent();
|
| 7286 |
return [2 /*return*/];
|
| 7287 |
case 2:
|
| 7288 |
outerPaths = parsePathForBorderDoubleOuter(curvePoints, side);
|
| 7289 |
this.path(outerPaths);
|
| 7290 |
this.ctx.fillStyle = asString(color);
|
| 7291 |
this.ctx.fill();
|
| 7292 |
innerPaths = parsePathForBorderDoubleInner(curvePoints, side);
|
| 7293 |
this.path(innerPaths);
|
| 7294 |
this.ctx.fill();
|
| 7295 |
return [2 /*return*/];
|
| 7296 |
}
|
| 7297 |
});
|
| 7298 |
});
|
| 7299 |
};
|
| 7300 |
CanvasRenderer.prototype.renderNodeBackgroundAndBorders = function (paint) {
|
| 7301 |
return __awaiter(this, void 0, void 0, function () {
|
| 7302 |
var styles, hasBackground, borders, backgroundPaintingArea, side, _i, borders_1, border;
|
| 7303 |
var _this = this;
|
| 7304 |
return __generator(this, function (_a) {
|
| 7305 |
switch (_a.label) {
|
| 7306 |
case 0:
|
| 7307 |
this.applyEffects(paint.getEffects(2 /* BACKGROUND_BORDERS */));
|
| 7308 |
styles = paint.container.styles;
|
| 7309 |
hasBackground = !isTransparent(styles.backgroundColor) || styles.backgroundImage.length;
|
| 7310 |
borders = [
|
| 7311 |
{ style: styles.borderTopStyle, color: styles.borderTopColor, width: styles.borderTopWidth },
|
| 7312 |
{ style: styles.borderRightStyle, color: styles.borderRightColor, width: styles.borderRightWidth },
|
| 7313 |
{ style: styles.borderBottomStyle, color: styles.borderBottomColor, width: styles.borderBottomWidth },
|
| 7314 |
{ style: styles.borderLeftStyle, color: styles.borderLeftColor, width: styles.borderLeftWidth }
|
| 7315 |
];
|
| 7316 |
backgroundPaintingArea = calculateBackgroundCurvedPaintingArea(getBackgroundValueForIndex(styles.backgroundClip, 0), paint.curves);
|
| 7317 |
if (!(hasBackground || styles.boxShadow.length)) return [3 /*break*/, 2];
|
| 7318 |
this.ctx.save();
|
| 7319 |
this.path(backgroundPaintingArea);
|
| 7320 |
this.ctx.clip();
|
| 7321 |
if (!isTransparent(styles.backgroundColor)) {
|
| 7322 |
this.ctx.fillStyle = asString(styles.backgroundColor);
|
| 7323 |
this.ctx.fill();
|
| 7324 |
}
|
| 7325 |
return [4 /*yield*/, this.renderBackgroundImage(paint.container)];
|
| 7326 |
case 1:
|
| 7327 |
_a.sent();
|
| 7328 |
this.ctx.restore();
|
| 7329 |
styles.boxShadow
|
| 7330 |
.slice(0)
|
| 7331 |
.reverse()
|
| 7332 |
.forEach(function (shadow) {
|
| 7333 |
_this.ctx.save();
|
| 7334 |
var borderBoxArea = calculateBorderBoxPath(paint.curves);
|
| 7335 |
var maskOffset = shadow.inset ? 0 : MASK_OFFSET;
|
| 7336 |
var shadowPaintingArea = transformPath(borderBoxArea, -maskOffset + (shadow.inset ? 1 : -1) * shadow.spread.number, (shadow.inset ? 1 : -1) * shadow.spread.number, shadow.spread.number * (shadow.inset ? -2 : 2), shadow.spread.number * (shadow.inset ? -2 : 2));
|
| 7337 |
if (shadow.inset) {
|
| 7338 |
_this.path(borderBoxArea);
|
| 7339 |
_this.ctx.clip();
|
| 7340 |
_this.mask(shadowPaintingArea);
|
| 7341 |
}
|
| 7342 |
else {
|
| 7343 |
_this.mask(borderBoxArea);
|
| 7344 |
_this.ctx.clip();
|
| 7345 |
_this.path(shadowPaintingArea);
|
| 7346 |
}
|
| 7347 |
_this.ctx.shadowOffsetX = shadow.offsetX.number + maskOffset;
|
| 7348 |
_this.ctx.shadowOffsetY = shadow.offsetY.number;
|
| 7349 |
_this.ctx.shadowColor = asString(shadow.color);
|
| 7350 |
_this.ctx.shadowBlur = shadow.blur.number;
|
| 7351 |
_this.ctx.fillStyle = shadow.inset ? asString(shadow.color) : 'rgba(0,0,0,1)';
|
| 7352 |
_this.ctx.fill();
|
| 7353 |
_this.ctx.restore();
|
| 7354 |
});
|
| 7355 |
_a.label = 2;
|
| 7356 |
case 2:
|
| 7357 |
side = 0;
|
| 7358 |
_i = 0, borders_1 = borders;
|
| 7359 |
_a.label = 3;
|
| 7360 |
case 3:
|
| 7361 |
if (!(_i < borders_1.length)) return [3 /*break*/, 13];
|
| 7362 |
border = borders_1[_i];
|
| 7363 |
if (!(border.style !== 0 /* NONE */ && !isTransparent(border.color) && border.width > 0)) return [3 /*break*/, 11];
|
| 7364 |
if (!(border.style === 2 /* DASHED */)) return [3 /*break*/, 5];
|
| 7365 |
return [4 /*yield*/, this.renderDashedDottedBorder(border.color, border.width, side, paint.curves, 2 /* DASHED */)];
|
| 7366 |
case 4:
|
| 7367 |
_a.sent();
|
| 7368 |
return [3 /*break*/, 11];
|
| 7369 |
case 5:
|
| 7370 |
if (!(border.style === 3 /* DOTTED */)) return [3 /*break*/, 7];
|
| 7371 |
return [4 /*yield*/, this.renderDashedDottedBorder(border.color, border.width, side, paint.curves, 3 /* DOTTED */)];
|
| 7372 |
case 6:
|
| 7373 |
_a.sent();
|
| 7374 |
return [3 /*break*/, 11];
|
| 7375 |
case 7:
|
| 7376 |
if (!(border.style === 4 /* DOUBLE */)) return [3 /*break*/, 9];
|
| 7377 |
return [4 /*yield*/, this.renderDoubleBorder(border.color, border.width, side, paint.curves)];
|
| 7378 |
case 8:
|
| 7379 |
_a.sent();
|
| 7380 |
return [3 /*break*/, 11];
|
| 7381 |
case 9: return [4 /*yield*/, this.renderSolidBorder(border.color, side, paint.curves)];
|
| 7382 |
case 10:
|
| 7383 |
_a.sent();
|
| 7384 |
_a.label = 11;
|
| 7385 |
case 11:
|
| 7386 |
side++;
|
| 7387 |
_a.label = 12;
|
| 7388 |
case 12:
|
| 7389 |
_i++;
|
| 7390 |
return [3 /*break*/, 3];
|
| 7391 |
case 13: return [2 /*return*/];
|
| 7392 |
}
|
| 7393 |
});
|
| 7394 |
});
|
| 7395 |
};
|
| 7396 |
CanvasRenderer.prototype.renderDashedDottedBorder = function (color, width, side, curvePoints, style) {
|
| 7397 |
return __awaiter(this, void 0, void 0, function () {
|
| 7398 |
var strokePaths, boxPaths, startX, startY, endX, endY, length, dashLength, spaceLength, useLineDash, multiplier, numberOfDashes, minSpace, maxSpace, path1, path2, path1, path2;
|
| 7399 |
return __generator(this, function (_a) {
|
| 7400 |
this.ctx.save();
|
| 7401 |
strokePaths = parsePathForBorderStroke(curvePoints, side);
|
| 7402 |
boxPaths = parsePathForBorder(curvePoints, side);
|
| 7403 |
if (style === 2 /* DASHED */) {
|
| 7404 |
this.path(boxPaths);
|
| 7405 |
this.ctx.clip();
|
| 7406 |
}
|
| 7407 |
if (isBezierCurve(boxPaths[0])) {
|
| 7408 |
startX = boxPaths[0].start.x;
|
| 7409 |
startY = boxPaths[0].start.y;
|
| 7410 |
}
|
| 7411 |
else {
|
| 7412 |
startX = boxPaths[0].x;
|
| 7413 |
startY = boxPaths[0].y;
|
| 7414 |
}
|
| 7415 |
if (isBezierCurve(boxPaths[1])) {
|
| 7416 |
endX = boxPaths[1].end.x;
|
| 7417 |
endY = boxPaths[1].end.y;
|
| 7418 |
}
|
| 7419 |
else {
|
| 7420 |
endX = boxPaths[1].x;
|
| 7421 |
endY = boxPaths[1].y;
|
| 7422 |
}
|
| 7423 |
if (side === 0 || side === 2) {
|
| 7424 |
length = Math.abs(startX - endX);
|
| 7425 |
}
|
| 7426 |
else {
|
| 7427 |
length = Math.abs(startY - endY);
|
| 7428 |
}
|
| 7429 |
this.ctx.beginPath();
|
| 7430 |
if (style === 3 /* DOTTED */) {
|
| 7431 |
this.formatPath(strokePaths);
|
| 7432 |
}
|
| 7433 |
else {
|
| 7434 |
this.formatPath(boxPaths.slice(0, 2));
|
| 7435 |
}
|
| 7436 |
dashLength = width < 3 ? width * 3 : width * 2;
|
| 7437 |
spaceLength = width < 3 ? width * 2 : width;
|
| 7438 |
if (style === 3 /* DOTTED */) {
|
| 7439 |
dashLength = width;
|
| 7440 |
spaceLength = width;
|
| 7441 |
}
|
| 7442 |
useLineDash = true;
|
| 7443 |
if (length <= dashLength * 2) {
|
| 7444 |
useLineDash = false;
|
| 7445 |
}
|
| 7446 |
else if (length <= dashLength * 2 + spaceLength) {
|
| 7447 |
multiplier = length / (2 * dashLength + spaceLength);
|
| 7448 |
dashLength *= multiplier;
|
| 7449 |
spaceLength *= multiplier;
|
| 7450 |
}
|
| 7451 |
else {
|
| 7452 |
numberOfDashes = Math.floor((length + spaceLength) / (dashLength + spaceLength));
|
| 7453 |
minSpace = (length - numberOfDashes * dashLength) / (numberOfDashes - 1);
|
| 7454 |
maxSpace = (length - (numberOfDashes + 1) * dashLength) / numberOfDashes;
|
| 7455 |
spaceLength =
|
| 7456 |
maxSpace <= 0 || Math.abs(spaceLength - minSpace) < Math.abs(spaceLength - maxSpace)
|
| 7457 |
? minSpace
|
| 7458 |
: maxSpace;
|
| 7459 |
}
|
| 7460 |
if (useLineDash) {
|
| 7461 |
if (style === 3 /* DOTTED */) {
|
| 7462 |
this.ctx.setLineDash([0, dashLength + spaceLength]);
|
| 7463 |
}
|
| 7464 |
else {
|
| 7465 |
this.ctx.setLineDash([dashLength, spaceLength]);
|
| 7466 |
}
|
| 7467 |
}
|
| 7468 |
if (style === 3 /* DOTTED */) {
|
| 7469 |
this.ctx.lineCap = 'round';
|
| 7470 |
this.ctx.lineWidth = width;
|
| 7471 |
}
|
| 7472 |
else {
|
| 7473 |
this.ctx.lineWidth = width * 2 + 1.1;
|
| 7474 |
}
|
| 7475 |
this.ctx.strokeStyle = asString(color);
|
| 7476 |
this.ctx.stroke();
|
| 7477 |
this.ctx.setLineDash([]);
|
| 7478 |
// dashed round edge gap
|
| 7479 |
if (style === 2 /* DASHED */) {
|
| 7480 |
if (isBezierCurve(boxPaths[0])) {
|
| 7481 |
path1 = boxPaths[3];
|
| 7482 |
path2 = boxPaths[0];
|
| 7483 |
this.ctx.beginPath();
|
| 7484 |
this.formatPath([new Vector(path1.end.x, path1.end.y), new Vector(path2.start.x, path2.start.y)]);
|
| 7485 |
this.ctx.stroke();
|
| 7486 |
}
|
| 7487 |
if (isBezierCurve(boxPaths[1])) {
|
| 7488 |
path1 = boxPaths[1];
|
| 7489 |
path2 = boxPaths[2];
|
| 7490 |
this.ctx.beginPath();
|
| 7491 |
this.formatPath([new Vector(path1.end.x, path1.end.y), new Vector(path2.start.x, path2.start.y)]);
|
| 7492 |
this.ctx.stroke();
|
| 7493 |
}
|
| 7494 |
}
|
| 7495 |
this.ctx.restore();
|
| 7496 |
return [2 /*return*/];
|
| 7497 |
});
|
| 7498 |
});
|
| 7499 |
};
|
| 7500 |
CanvasRenderer.prototype.render = function (element) {
|
| 7501 |
return __awaiter(this, void 0, void 0, function () {
|
| 7502 |
var stack;
|
| 7503 |
return __generator(this, function (_a) {
|
| 7504 |
switch (_a.label) {
|
| 7505 |
case 0:
|
| 7506 |
if (this.options.backgroundColor) {
|
| 7507 |
this.ctx.fillStyle = asString(this.options.backgroundColor);
|
| 7508 |
this.ctx.fillRect(this.options.x, this.options.y, this.options.width, this.options.height);
|
| 7509 |
}
|
| 7510 |
stack = parseStackingContexts(element);
|
| 7511 |
return [4 /*yield*/, this.renderStack(stack)];
|
| 7512 |
case 1:
|
| 7513 |
_a.sent();
|
| 7514 |
this.applyEffects([]);
|
| 7515 |
return [2 /*return*/, this.canvas];
|
| 7516 |
}
|
| 7517 |
});
|
| 7518 |
});
|
| 7519 |
};
|
| 7520 |
return CanvasRenderer;
|
| 7521 |
}(Renderer));
|
| 7522 |
var isTextInputElement = function (container) {
|
| 7523 |
if (container instanceof TextareaElementContainer) {
|
| 7524 |
return true;
|
| 7525 |
}
|
| 7526 |
else if (container instanceof SelectElementContainer) {
|
| 7527 |
return true;
|
| 7528 |
}
|
| 7529 |
else if (container instanceof InputElementContainer && container.type !== RADIO && container.type !== CHECKBOX) {
|
| 7530 |
return true;
|
| 7531 |
}
|
| 7532 |
return false;
|
| 7533 |
};
|
| 7534 |
var calculateBackgroundCurvedPaintingArea = function (clip, curves) {
|
| 7535 |
switch (clip) {
|
| 7536 |
case 0 /* BORDER_BOX */:
|
| 7537 |
return calculateBorderBoxPath(curves);
|
| 7538 |
case 2 /* CONTENT_BOX */:
|
| 7539 |
return calculateContentBoxPath(curves);
|
| 7540 |
case 1 /* PADDING_BOX */:
|
| 7541 |
default:
|
| 7542 |
return calculatePaddingBoxPath(curves);
|
| 7543 |
}
|
| 7544 |
};
|
| 7545 |
var canvasTextAlign = function (textAlign) {
|
| 7546 |
switch (textAlign) {
|
| 7547 |
case 1 /* CENTER */:
|
| 7548 |
return 'center';
|
| 7549 |
case 2 /* RIGHT */:
|
| 7550 |
return 'right';
|
| 7551 |
case 0 /* LEFT */:
|
| 7552 |
default:
|
| 7553 |
return 'left';
|
| 7554 |
}
|
| 7555 |
};
|
| 7556 |
// see https://github.com/niklasvh/html2canvas/pull/2645
|
| 7557 |
var iOSBrokenFonts = ['-apple-system', 'system-ui'];
|
| 7558 |
var fixIOSSystemFonts = function (fontFamilies) {
|
| 7559 |
return /iPhone OS 15_(0|1)/.test(window.navigator.userAgent)
|
| 7560 |
? fontFamilies.filter(function (fontFamily) { return iOSBrokenFonts.indexOf(fontFamily) === -1; })
|
| 7561 |
: fontFamilies;
|
| 7562 |
};
|
| 7563 |
|
| 7564 |
var ForeignObjectRenderer = /** @class */ (function (_super) {
|
| 7565 |
__extends(ForeignObjectRenderer, _super);
|
| 7566 |
function ForeignObjectRenderer(context, options) {
|
| 7567 |
var _this = _super.call(this, context, options) || this;
|
| 7568 |
_this.canvas = options.canvas ? options.canvas : document.createElement('canvas');
|
| 7569 |
_this.ctx = _this.canvas.getContext('2d');
|
| 7570 |
_this.options = options;
|
| 7571 |
_this.canvas.width = Math.floor(options.width * options.scale);
|
| 7572 |
_this.canvas.height = Math.floor(options.height * options.scale);
|
| 7573 |
_this.canvas.style.width = options.width + "px";
|
| 7574 |
_this.canvas.style.height = options.height + "px";
|
| 7575 |
_this.ctx.scale(_this.options.scale, _this.options.scale);
|
| 7576 |
_this.ctx.translate(-options.x, -options.y);
|
| 7577 |
_this.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized (" + options.width + "x" + options.height + " at " + options.x + "," + options.y + ") with scale " + options.scale);
|
| 7578 |
return _this;
|
| 7579 |
}
|
| 7580 |
ForeignObjectRenderer.prototype.render = function (element) {
|
| 7581 |
return __awaiter(this, void 0, void 0, function () {
|
| 7582 |
var svg, img;
|
| 7583 |
return __generator(this, function (_a) {
|
| 7584 |
switch (_a.label) {
|
| 7585 |
case 0:
|
| 7586 |
svg = createForeignObjectSVG(this.options.width * this.options.scale, this.options.height * this.options.scale, this.options.scale, this.options.scale, element);
|
| 7587 |
return [4 /*yield*/, loadSerializedSVG(svg)];
|
| 7588 |
case 1:
|
| 7589 |
img = _a.sent();
|
| 7590 |
if (this.options.backgroundColor) {
|
| 7591 |
this.ctx.fillStyle = asString(this.options.backgroundColor);
|
| 7592 |
this.ctx.fillRect(0, 0, this.options.width * this.options.scale, this.options.height * this.options.scale);
|
| 7593 |
}
|
| 7594 |
this.ctx.drawImage(img, -this.options.x * this.options.scale, -this.options.y * this.options.scale);
|
| 7595 |
return [2 /*return*/, this.canvas];
|
| 7596 |
}
|
| 7597 |
});
|
| 7598 |
});
|
| 7599 |
};
|
| 7600 |
return ForeignObjectRenderer;
|
| 7601 |
}(Renderer));
|
| 7602 |
var loadSerializedSVG = function (svg) {
|
| 7603 |
return new Promise(function (resolve, reject) {
|
| 7604 |
var img = new Image();
|
| 7605 |
img.onload = function () {
|
| 7606 |
resolve(img);
|
| 7607 |
};
|
| 7608 |
img.onerror = reject;
|
| 7609 |
img.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(svg));
|
| 7610 |
});
|
| 7611 |
};
|
| 7612 |
|
| 7613 |
var Logger = /** @class */ (function () {
|
| 7614 |
function Logger(_a) {
|
| 7615 |
var id = _a.id, enabled = _a.enabled;
|
| 7616 |
this.id = id;
|
| 7617 |
this.enabled = enabled;
|
| 7618 |
this.start = Date.now();
|
| 7619 |
}
|
| 7620 |
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
| 7621 |
Logger.prototype.debug = function () {
|
| 7622 |
var args = [];
|
| 7623 |
for (var _i = 0; _i < arguments.length; _i++) {
|
| 7624 |
args[_i] = arguments[_i];
|
| 7625 |
}
|
| 7626 |
if (this.enabled) {
|
| 7627 |
// eslint-disable-next-line no-console
|
| 7628 |
if (typeof window !== 'undefined' && window.console && typeof console.debug === 'function') {
|
| 7629 |
// eslint-disable-next-line no-console
|
| 7630 |
console.debug.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
|
| 7631 |
}
|
| 7632 |
else {
|
| 7633 |
this.info.apply(this, args);
|
| 7634 |
}
|
| 7635 |
}
|
| 7636 |
};
|
| 7637 |
Logger.prototype.getTime = function () {
|
| 7638 |
return Date.now() - this.start;
|
| 7639 |
};
|
| 7640 |
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
| 7641 |
Logger.prototype.info = function () {
|
| 7642 |
var args = [];
|
| 7643 |
for (var _i = 0; _i < arguments.length; _i++) {
|
| 7644 |
args[_i] = arguments[_i];
|
| 7645 |
}
|
| 7646 |
if (this.enabled) {
|
| 7647 |
// eslint-disable-next-line no-console
|
| 7648 |
if (typeof window !== 'undefined' && window.console && typeof console.info === 'function') {
|
| 7649 |
// eslint-disable-next-line no-console
|
| 7650 |
console.info.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
|
| 7651 |
}
|
| 7652 |
}
|
| 7653 |
};
|
| 7654 |
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
| 7655 |
Logger.prototype.warn = function () {
|
| 7656 |
var args = [];
|
| 7657 |
for (var _i = 0; _i < arguments.length; _i++) {
|
| 7658 |
args[_i] = arguments[_i];
|
| 7659 |
}
|
| 7660 |
if (this.enabled) {
|
| 7661 |
// eslint-disable-next-line no-console
|
| 7662 |
if (typeof window !== 'undefined' && window.console && typeof console.warn === 'function') {
|
| 7663 |
// eslint-disable-next-line no-console
|
| 7664 |
console.warn.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
|
| 7665 |
}
|
| 7666 |
else {
|
| 7667 |
this.info.apply(this, args);
|
| 7668 |
}
|
| 7669 |
}
|
| 7670 |
};
|
| 7671 |
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
| 7672 |
Logger.prototype.error = function () {
|
| 7673 |
var args = [];
|
| 7674 |
for (var _i = 0; _i < arguments.length; _i++) {
|
| 7675 |
args[_i] = arguments[_i];
|
| 7676 |
}
|
| 7677 |
if (this.enabled) {
|
| 7678 |
// eslint-disable-next-line no-console
|
| 7679 |
if (typeof window !== 'undefined' && window.console && typeof console.error === 'function') {
|
| 7680 |
// eslint-disable-next-line no-console
|
| 7681 |
console.error.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
|
| 7682 |
}
|
| 7683 |
else {
|
| 7684 |
this.info.apply(this, args);
|
| 7685 |
}
|
| 7686 |
}
|
| 7687 |
};
|
| 7688 |
Logger.instances = {};
|
| 7689 |
return Logger;
|
| 7690 |
}());
|
| 7691 |
|
| 7692 |
var Context = /** @class */ (function () {
|
| 7693 |
function Context(options, windowBounds) {
|
| 7694 |
var _a;
|
| 7695 |
this.windowBounds = windowBounds;
|
| 7696 |
this.instanceName = "#" + Context.instanceCount++;
|
| 7697 |
this.logger = new Logger({ id: this.instanceName, enabled: options.logging });
|
| 7698 |
this.cache = (_a = options.cache) !== null && _a !== void 0 ? _a : new Cache(this, options);
|
| 7699 |
}
|
| 7700 |
Context.instanceCount = 1;
|
| 7701 |
return Context;
|
| 7702 |
}());
|
| 7703 |
|
| 7704 |
var html2canvas = function (element, options) {
|
| 7705 |
if (options === void 0) { options = {}; }
|
| 7706 |
return renderElement(element, options);
|
| 7707 |
};
|
| 7708 |
if (typeof window !== 'undefined') {
|
| 7709 |
CacheStorage.setContext(window);
|
| 7710 |
}
|
| 7711 |
var renderElement = function (element, opts) { return __awaiter(void 0, void 0, void 0, function () {
|
| 7712 |
var ownerDocument, defaultView, resourceOptions, contextOptions, windowOptions, windowBounds, context, foreignObjectRendering, cloneOptions, documentCloner, clonedElement, container, _a, width, height, left, top, backgroundColor, renderOptions, canvas, renderer, root, renderer;
|
| 7713 |
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
| 7714 |
return __generator(this, function (_u) {
|
| 7715 |
switch (_u.label) {
|
| 7716 |
case 0:
|
| 7717 |
if (!element || typeof element !== 'object') {
|
| 7718 |
return [2 /*return*/, Promise.reject('Invalid element provided as first argument')];
|
| 7719 |
}
|
| 7720 |
ownerDocument = element.ownerDocument;
|
| 7721 |
if (!ownerDocument) {
|
| 7722 |
throw new Error("Element is not attached to a Document");
|
| 7723 |
}
|
| 7724 |
defaultView = ownerDocument.defaultView;
|
| 7725 |
if (!defaultView) {
|
| 7726 |
throw new Error("Document is not attached to a Window");
|
| 7727 |
}
|
| 7728 |
resourceOptions = {
|
| 7729 |
allowTaint: (_b = opts.allowTaint) !== null && _b !== void 0 ? _b : false,
|
| 7730 |
imageTimeout: (_c = opts.imageTimeout) !== null && _c !== void 0 ? _c : 15000,
|
| 7731 |
proxy: opts.proxy,
|
| 7732 |
useCORS: (_d = opts.useCORS) !== null && _d !== void 0 ? _d : false
|
| 7733 |
};
|
| 7734 |
contextOptions = __assign({ logging: (_e = opts.logging) !== null && _e !== void 0 ? _e : true, cache: opts.cache }, resourceOptions);
|
| 7735 |
windowOptions = {
|
| 7736 |
windowWidth: (_f = opts.windowWidth) !== null && _f !== void 0 ? _f : defaultView.innerWidth,
|
| 7737 |
windowHeight: (_g = opts.windowHeight) !== null && _g !== void 0 ? _g : defaultView.innerHeight,
|
| 7738 |
scrollX: (_h = opts.scrollX) !== null && _h !== void 0 ? _h : defaultView.pageXOffset,
|
| 7739 |
scrollY: (_j = opts.scrollY) !== null && _j !== void 0 ? _j : defaultView.pageYOffset
|
| 7740 |
};
|
| 7741 |
windowBounds = new Bounds(windowOptions.scrollX, windowOptions.scrollY, windowOptions.windowWidth, windowOptions.windowHeight);
|
| 7742 |
context = new Context(contextOptions, windowBounds);
|
| 7743 |
foreignObjectRendering = (_k = opts.foreignObjectRendering) !== null && _k !== void 0 ? _k : false;
|
| 7744 |
cloneOptions = {
|
| 7745 |
allowTaint: (_l = opts.allowTaint) !== null && _l !== void 0 ? _l : false,
|
| 7746 |
onclone: opts.onclone,
|
| 7747 |
ignoreElements: opts.ignoreElements,
|
| 7748 |
inlineImages: foreignObjectRendering,
|
| 7749 |
copyStyles: foreignObjectRendering
|
| 7750 |
};
|
| 7751 |
context.logger.debug("Starting document clone with size " + windowBounds.width + "x" + windowBounds.height + " scrolled to " + -windowBounds.left + "," + -windowBounds.top);
|
| 7752 |
documentCloner = new DocumentCloner(context, element, cloneOptions);
|
| 7753 |
clonedElement = documentCloner.clonedReferenceElement;
|
| 7754 |
if (!clonedElement) {
|
| 7755 |
return [2 /*return*/, Promise.reject("Unable to find element in cloned iframe")];
|
| 7756 |
}
|
| 7757 |
return [4 /*yield*/, documentCloner.toIFrame(ownerDocument, windowBounds)];
|
| 7758 |
case 1:
|
| 7759 |
container = _u.sent();
|
| 7760 |
_a = isBodyElement(clonedElement) || isHTMLElement(clonedElement)
|
| 7761 |
? parseDocumentSize(clonedElement.ownerDocument)
|
| 7762 |
: parseBounds(context, clonedElement), width = _a.width, height = _a.height, left = _a.left, top = _a.top;
|
| 7763 |
backgroundColor = parseBackgroundColor(context, clonedElement, opts.backgroundColor);
|
| 7764 |
renderOptions = {
|
| 7765 |
canvas: opts.canvas,
|
| 7766 |
backgroundColor: backgroundColor,
|
| 7767 |
scale: (_o = (_m = opts.scale) !== null && _m !== void 0 ? _m : defaultView.devicePixelRatio) !== null && _o !== void 0 ? _o : 1,
|
| 7768 |
x: ((_p = opts.x) !== null && _p !== void 0 ? _p : 0) + left,
|
| 7769 |
y: ((_q = opts.y) !== null && _q !== void 0 ? _q : 0) + top,
|
| 7770 |
width: (_r = opts.width) !== null && _r !== void 0 ? _r : Math.ceil(width),
|
| 7771 |
height: (_s = opts.height) !== null && _s !== void 0 ? _s : Math.ceil(height)
|
| 7772 |
};
|
| 7773 |
if (!foreignObjectRendering) return [3 /*break*/, 3];
|
| 7774 |
context.logger.debug("Document cloned, using foreign object rendering");
|
| 7775 |
renderer = new ForeignObjectRenderer(context, renderOptions);
|
| 7776 |
return [4 /*yield*/, renderer.render(clonedElement)];
|
| 7777 |
case 2:
|
| 7778 |
canvas = _u.sent();
|
| 7779 |
return [3 /*break*/, 5];
|
| 7780 |
case 3:
|
| 7781 |
context.logger.debug("Document cloned, element located at " + left + "," + top + " with size " + width + "x" + height + " using computed rendering");
|
| 7782 |
context.logger.debug("Starting DOM parsing");
|
| 7783 |
root = parseTree(context, clonedElement);
|
| 7784 |
if (backgroundColor === root.styles.backgroundColor) {
|
| 7785 |
root.styles.backgroundColor = COLORS.TRANSPARENT;
|
| 7786 |
}
|
| 7787 |
context.logger.debug("Starting renderer for element at " + renderOptions.x + "," + renderOptions.y + " with size " + renderOptions.width + "x" + renderOptions.height);
|
| 7788 |
renderer = new CanvasRenderer(context, renderOptions);
|
| 7789 |
return [4 /*yield*/, renderer.render(root)];
|
| 7790 |
case 4:
|
| 7791 |
canvas = _u.sent();
|
| 7792 |
_u.label = 5;
|
| 7793 |
case 5:
|
| 7794 |
if ((_t = opts.removeContainer) !== null && _t !== void 0 ? _t : true) {
|
| 7795 |
if (!DocumentCloner.destroy(container)) {
|
| 7796 |
context.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore");
|
| 7797 |
}
|
| 7798 |
}
|
| 7799 |
context.logger.debug("Finished rendering");
|
| 7800 |
return [2 /*return*/, canvas];
|
| 7801 |
}
|
| 7802 |
});
|
| 7803 |
}); };
|
| 7804 |
var parseBackgroundColor = function (context, element, backgroundColorOverride) {
|
| 7805 |
var ownerDocument = element.ownerDocument;
|
| 7806 |
// http://www.w3.org/TR/css3-background/#special-backgrounds
|
| 7807 |
var documentBackgroundColor = ownerDocument.documentElement
|
| 7808 |
? parseColor(context, getComputedStyle(ownerDocument.documentElement).backgroundColor)
|
| 7809 |
: COLORS.TRANSPARENT;
|
| 7810 |
var bodyBackgroundColor = ownerDocument.body
|
| 7811 |
? parseColor(context, getComputedStyle(ownerDocument.body).backgroundColor)
|
| 7812 |
: COLORS.TRANSPARENT;
|
| 7813 |
var defaultBackgroundColor = typeof backgroundColorOverride === 'string'
|
| 7814 |
? parseColor(context, backgroundColorOverride)
|
| 7815 |
: backgroundColorOverride === null
|
| 7816 |
? COLORS.TRANSPARENT
|
| 7817 |
: 0xffffffff;
|
| 7818 |
return element === ownerDocument.documentElement
|
| 7819 |
? isTransparent(documentBackgroundColor)
|
| 7820 |
? isTransparent(bodyBackgroundColor)
|
| 7821 |
? defaultBackgroundColor
|
| 7822 |
: bodyBackgroundColor
|
| 7823 |
: documentBackgroundColor
|
| 7824 |
: defaultBackgroundColor;
|
| 7825 |
};
|
| 7826 |
|
| 7827 |
return html2canvas;
|
| 7828 |
|
| 7829 |
})));
|
| 7830 |
//# sourceMappingURL=html2canvas.js.map
|
| 7831 |
|