@mhosaic/feedback 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/layout/bounds.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/node_modules/src/Util.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/node_modules/css-line-break/node_modules/src/Util.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/node_modules/css-line-break/node_modules/src/Trie.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/node_modules/css-line-break/node_modules/utrie/node_modules/src/index.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/node_modules/src/linebreak-trie.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/node_modules/src/LineBreak.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/syntax/tokenizer.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/syntax/parser.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/length.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/length-percentage.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/angle.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/color-utilities.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/color-spaces/srgb.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/color-spaces/p3.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/color-spaces/a98.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/color-spaces/pro-photo.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/color-spaces/rec2020.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/color.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/background-clip.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/background-color.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/functions/gradient.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/functions/linear-gradient.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/functions/-prefix-linear-gradient.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/functions/-webkit-gradient.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/functions/radial-gradient.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/functions/-prefix-radial-gradient.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/image.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/background-image.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/background-origin.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/background-position.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/background-repeat.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/background-size.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/border-color.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/border-radius.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/border-style.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/border-width.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/color.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/direction.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/display.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/float.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/letter-spacing.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/line-break.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/line-height.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/list-style-image.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/list-style-position.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/list-style-type.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/margin.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/overflow.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/overflow-wrap.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/padding.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/text-align.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/position.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/text-shadow.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/text-transform.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/transform.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/transform-origin.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/rotate.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/visibility.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/word-break.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/z-index.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/time.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/opacity.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/text-decoration-color.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/text-decoration-line.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/text-decoration-style.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/text-decoration-thickness.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/text-underline-offset.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/font-family.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/font-size.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/font-weight.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/font-variant.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/font-style.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/core/bitwise.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/content.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/counter-increment.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/counter-reset.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/duration.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/quotes.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/box-shadow.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/paint-order.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/webkit-text-stroke-color.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/webkit-text-stroke-width.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/webkit-line-clamp.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/object-fit.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/text-overflow.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/index.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/core/debugger.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/element-container.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/node_modules/src/grapheme-break-trie.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/node_modules/text-segmentation/node_modules/src/Util.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/node_modules/text-segmentation/node_modules/src/Trie.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/node_modules/text-segmentation/node_modules/utrie/node_modules/src/index.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/node_modules/src/GraphemeBreak.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/core/features.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/layout/text.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/text-container.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/replaced-elements/image-element-container.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/replaced-elements/canvas-element-container.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/replaced-elements/svg-element-container.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/elements/li-element-container.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/elements/ol-element-container.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/replaced-elements/input-element-container.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/elements/select-element-container.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/elements/textarea-element-container.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/replaced-elements/iframe-element-container.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/node-parser.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/functions/counter.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/document-cloner.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/core/cache-storage.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/vector.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/bezier-curve.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/bound-curves.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/effects.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/path.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/stacking-context.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/border.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/box-sizing.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/background.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/core/util.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/font-metrics.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/renderer.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/canvas/canvas-renderer.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/canvas/foreignobject-renderer.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/core/logger.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/core/context.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/index.ts","../src/api/client.ts","../src/capture/urlSanitizer.ts","../src/capture/device.ts","../src/capture/console.ts","../src/capture/network.ts","../src/capture/errors.ts","../src/capture/performance.ts","../src/capture/ringBuffer.ts","../src/capture/index.ts","../src/screenshot/index.ts","../src/widget/i18n.ts","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/constants.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/util.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/options.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/create-element.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/component.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/diff/props.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/create-context.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/diff/children.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/diff/index.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/render.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/clone-element.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/diff/catch-error.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/hooks/src/index.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/jsx-runtime/src/utils.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/constants.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/jsx-runtime/src/index.js","../src/widget/Fab.tsx","../src/widget/Form.tsx","../src/widget/Modal.tsx","../src/widget/styles.ts","../src/widget/mount.tsx","../src/core.ts","../src/embed.ts"],"sourcesContent":["import { Context } from '../../core/context';\n\nexport class Bounds {\n constructor(\n readonly left: number,\n readonly top: number,\n readonly width: number,\n readonly height: number\n ) {}\n\n add(x: number, y: number, w: number, h: number): Bounds {\n return new Bounds(this.left + x, this.top + y, this.width + w, this.height + h);\n }\n\n static fromClientRect(context: Context, clientRect: ClientRect): Bounds {\n return new Bounds(\n clientRect.left + context.windowBounds.left,\n clientRect.top + context.windowBounds.top,\n clientRect.width,\n clientRect.height\n );\n }\n\n static fromDOMRectList(context: Context, domRectList: DOMRectList): Bounds {\n const rects = Array.from(domRectList);\n\n // First try to find a rect with non-zero width\n let domRect = rects.find((rect) => rect.width !== 0);\n\n // If not found, try to find a rect with non-zero height\n // This handles cases like inline-flex with single child where width might be 0\n if (!domRect) {\n domRect = rects.find((rect) => rect.height !== 0);\n }\n\n // If still not found but rects exist, use the first rect\n // Position info (left, top) might still be valid even if dimensions are 0\n if (!domRect && rects.length > 0) {\n domRect = rects[0];\n }\n\n return domRect\n ? new Bounds(\n domRect.left + context.windowBounds.left,\n domRect.top + context.windowBounds.top,\n domRect.width,\n domRect.height\n )\n : Bounds.EMPTY;\n }\n\n static EMPTY = new Bounds(0, 0, 0, 0);\n}\n\nexport const parseBounds = (context: Context, node: Element): Bounds => {\n return Bounds.fromClientRect(context, node.getBoundingClientRect());\n};\n\nexport const parseDocumentSize = (document: Document): Bounds => {\n const body = document.body;\n const documentElement = document.documentElement;\n\n if (!body || !documentElement) {\n throw new Error(`Unable to get document size`);\n }\n const width = Math.max(\n Math.max(body.scrollWidth, documentElement.scrollWidth),\n Math.max(body.offsetWidth, documentElement.offsetWidth),\n Math.max(body.clientWidth, documentElement.clientWidth)\n );\n\n const height = Math.max(\n Math.max(body.scrollHeight, documentElement.scrollHeight),\n Math.max(body.offsetHeight, documentElement.offsetHeight),\n Math.max(body.clientHeight, documentElement.clientHeight)\n );\n\n return new Bounds(0, 0, width, height);\n};\n","export const toCodePoints = (str: string): number[] => {\n const codePoints = [];\n let i = 0;\n const length = str.length;\n while (i < length) {\n const value = str.charCodeAt(i++);\n if (value >= 0xd800 && value <= 0xdbff && i < length) {\n const extra = str.charCodeAt(i++);\n if ((extra & 0xfc00) === 0xdc00) {\n codePoints.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000);\n } else {\n codePoints.push(value);\n i--;\n }\n } else {\n codePoints.push(value);\n }\n }\n return codePoints;\n};\n\nexport const fromCodePoint = (...codePoints: number[]): string => {\n if (String.fromCodePoint) {\n return String.fromCodePoint(...codePoints);\n }\n\n const length = codePoints.length;\n if (!length) {\n return '';\n }\n\n const codeUnits = [];\n\n let index = -1;\n let result = '';\n while (++index < length) {\n let codePoint = codePoints[index];\n if (codePoint <= 0xffff) {\n codeUnits.push(codePoint);\n } else {\n codePoint -= 0x10000;\n codeUnits.push((codePoint >> 10) + 0xd800, (codePoint % 0x400) + 0xdc00);\n }\n if (index + 1 === length || codeUnits.length > 0x4000) {\n result += String.fromCharCode(...codeUnits);\n codeUnits.length = 0;\n }\n }\n return result;\n};\n\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\n// Use a lookup table to find the index.\nconst lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\n\nexport const decode = (base64: string): ArrayBuffer | number[] => {\n let bufferLength = base64.length * 0.75,\n len = base64.length,\n i,\n p = 0,\n encoded1,\n encoded2,\n encoded3,\n encoded4;\n\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n\n const buffer =\n typeof ArrayBuffer !== 'undefined' &&\n typeof Uint8Array !== 'undefined' &&\n typeof Uint8Array.prototype.slice !== 'undefined'\n ? new ArrayBuffer(bufferLength)\n : new Array(bufferLength);\n const bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);\n\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n\n return buffer;\n};\n\nexport const polyUint16Array = (buffer: number[]): number[] => {\n const length = buffer.length;\n const bytes = [];\n for (let i = 0; i < length; i += 2) {\n bytes.push((buffer[i + 1] << 8) | buffer[i]);\n }\n return bytes;\n};\n\nexport const polyUint32Array = (buffer: number[]): number[] => {\n const length = buffer.length;\n const bytes = [];\n for (let i = 0; i < length; i += 4) {\n bytes.push((buffer[i + 3] << 24) | (buffer[i + 2] << 16) | (buffer[i + 1] << 8) | buffer[i]);\n }\n return bytes;\n};\n","const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\n// Use a lookup table to find the index.\nconst lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\n\nexport const decode = (base64: string): ArrayBuffer | number[] => {\n let bufferLength = base64.length * 0.75,\n len = base64.length,\n i,\n p = 0,\n encoded1,\n encoded2,\n encoded3,\n encoded4;\n\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n\n const buffer =\n typeof ArrayBuffer !== 'undefined' &&\n typeof Uint8Array !== 'undefined' &&\n typeof Uint8Array.prototype.slice !== 'undefined'\n ? new ArrayBuffer(bufferLength)\n : new Array(bufferLength);\n const bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);\n\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n\n return buffer;\n};\n\nexport const polyUint16Array = (buffer: number[]): number[] => {\n const length = buffer.length;\n const bytes = [];\n for (let i = 0; i < length; i += 2) {\n bytes.push((buffer[i + 1] << 8) | buffer[i]);\n }\n return bytes;\n};\n\nexport const polyUint32Array = (buffer: number[]): number[] => {\n const length = buffer.length;\n const bytes = [];\n for (let i = 0; i < length; i += 4) {\n bytes.push((buffer[i + 3] << 24) | (buffer[i + 2] << 16) | (buffer[i + 1] << 8) | buffer[i]);\n }\n return bytes;\n};\n","import {decode, polyUint16Array, polyUint32Array} from './Util';\n\nexport type int = number;\n\n/** Shift size for getting the index-2 table offset. */\nexport const UTRIE2_SHIFT_2 = 5;\n\n/** Shift size for getting the index-1 table offset. */\nexport const UTRIE2_SHIFT_1 = 6 + 5;\n\n/**\n * Shift size for shifting left the index array values.\n * Increases possible data size with 16-bit index values at the cost\n * of compactability.\n * This requires data blocks to be aligned by UTRIE2_DATA_GRANULARITY.\n */\nexport const UTRIE2_INDEX_SHIFT = 2;\n\n/**\n * Difference between the two shift sizes,\n * for getting an index-1 offset from an index-2 offset. 6=11-5\n */\nexport const UTRIE2_SHIFT_1_2 = UTRIE2_SHIFT_1 - UTRIE2_SHIFT_2;\n\n/**\n * The part of the index-2 table for U+D800..U+DBFF stores values for\n * lead surrogate code _units_ not code _points_.\n * Values for lead surrogate code _points_ are indexed with this portion of the table.\n * Length=32=0x20=0x400>>UTRIE2_SHIFT_2. (There are 1024=0x400 lead surrogates.)\n */\nexport const UTRIE2_LSCP_INDEX_2_OFFSET = 0x10000 >> UTRIE2_SHIFT_2;\n\n/** Number of entries in a data block. 32=0x20 */\nexport const UTRIE2_DATA_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_2;\n/** Mask for getting the lower bits for the in-data-block offset. */\nexport const UTRIE2_DATA_MASK = UTRIE2_DATA_BLOCK_LENGTH - 1;\n\nexport const UTRIE2_LSCP_INDEX_2_LENGTH = 0x400 >> UTRIE2_SHIFT_2;\n/** Count the lengths of both BMP pieces. 2080=0x820 */\nexport const UTRIE2_INDEX_2_BMP_LENGTH = UTRIE2_LSCP_INDEX_2_OFFSET + UTRIE2_LSCP_INDEX_2_LENGTH;\n/**\n * The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820.\n * Length 32=0x20 for lead bytes C0..DF, regardless of UTRIE2_SHIFT_2.\n */\nexport const UTRIE2_UTF8_2B_INDEX_2_OFFSET = UTRIE2_INDEX_2_BMP_LENGTH;\nexport const UTRIE2_UTF8_2B_INDEX_2_LENGTH = 0x800 >> 6; /* U+0800 is the first code point after 2-byte UTF-8 */\n/**\n * The index-1 table, only used for supplementary code points, at offset 2112=0x840.\n * Variable length, for code points up to highStart, where the last single-value range starts.\n * Maximum length 512=0x200=0x100000>>UTRIE2_SHIFT_1.\n * (For 0x100000 supplementary code points U+10000..U+10ffff.)\n *\n * The part of the index-2 table for supplementary code points starts\n * after this index-1 table.\n *\n * Both the index-1 table and the following part of the index-2 table\n * are omitted completely if there is only BMP data.\n */\nexport const UTRIE2_INDEX_1_OFFSET = UTRIE2_UTF8_2B_INDEX_2_OFFSET + UTRIE2_UTF8_2B_INDEX_2_LENGTH;\n\n/**\n * Number of index-1 entries for the BMP. 32=0x20\n * This part of the index-1 table is omitted from the serialized form.\n */\nexport const UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> UTRIE2_SHIFT_1;\n\n/** Number of entries in an index-2 block. 64=0x40 */\nexport const UTRIE2_INDEX_2_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_1_2;\n/** Mask for getting the lower bits for the in-index-2-block offset. */\nexport const UTRIE2_INDEX_2_MASK = UTRIE2_INDEX_2_BLOCK_LENGTH - 1;\n\nconst slice16 = (view: number[] | Uint16Array, start: number, end?: number) => {\n if (view.slice) {\n return view.slice(start, end);\n }\n\n return new Uint16Array(Array.prototype.slice.call(view, start, end));\n};\n\nconst slice32 = (view: number[] | Uint32Array, start: number, end?: number) => {\n if (view.slice) {\n return view.slice(start, end);\n }\n\n return new Uint32Array(Array.prototype.slice.call(view, start, end));\n};\n\nexport const createTrieFromBase64 = (base64: string, _byteLength: number): Trie => {\n const buffer = decode(base64);\n const view32 = Array.isArray(buffer) ? polyUint32Array(buffer) : new Uint32Array(buffer);\n const view16 = Array.isArray(buffer) ? polyUint16Array(buffer) : new Uint16Array(buffer);\n const headerLength = 24;\n\n const index = slice16(view16, headerLength / 2, view32[4] / 2);\n const data =\n view32[5] === 2\n ? slice16(view16, (headerLength + view32[4]) / 2)\n : slice32(view32, Math.ceil((headerLength + view32[4]) / 4));\n\n return new Trie(view32[0], view32[1], view32[2], view32[3], index, data);\n};\n\nexport class Trie {\n initialValue: int;\n errorValue: int;\n highStart: int;\n highValueIndex: int;\n index: Uint16Array | number[];\n data: Uint32Array | Uint16Array | number[];\n\n constructor(\n initialValue: int,\n errorValue: int,\n highStart: int,\n highValueIndex: int,\n index: Uint16Array | number[],\n data: Uint32Array | Uint16Array | number[]\n ) {\n this.initialValue = initialValue;\n this.errorValue = errorValue;\n this.highStart = highStart;\n this.highValueIndex = highValueIndex;\n this.index = index;\n this.data = data;\n }\n\n /**\n * Get the value for a code point as stored in the Trie.\n *\n * @param codePoint the code point\n * @return the value\n */\n get(codePoint: number): number {\n let ix;\n if (codePoint >= 0) {\n if (codePoint < 0x0d800 || (codePoint > 0x0dbff && codePoint <= 0x0ffff)) {\n // Ordinary BMP code point, excluding leading surrogates.\n // BMP uses a single level lookup. BMP index starts at offset 0 in the Trie2 index.\n // 16 bit data is stored in the index array itself.\n ix = this.index[codePoint >> UTRIE2_SHIFT_2];\n ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);\n return this.data[ix];\n }\n\n if (codePoint <= 0xffff) {\n // Lead Surrogate Code Point. A Separate index section is stored for\n // lead surrogate code units and code points.\n // The main index has the code unit data.\n // For this function, we need the code point data.\n // Note: this expression could be refactored for slightly improved efficiency, but\n // surrogate code points will be so rare in practice that it's not worth it.\n ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET + ((codePoint - 0xd800) >> UTRIE2_SHIFT_2)];\n ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);\n return this.data[ix];\n }\n\n if (codePoint < this.highStart) {\n // Supplemental code point, use two-level lookup.\n ix = UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> UTRIE2_SHIFT_1);\n ix = this.index[ix];\n ix += (codePoint >> UTRIE2_SHIFT_2) & UTRIE2_INDEX_2_MASK;\n ix = this.index[ix];\n ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);\n return this.data[ix];\n }\n if (codePoint <= 0x10ffff) {\n return this.data[this.highValueIndex];\n }\n }\n\n // Fall through. The code point is outside of the legal range of 0..0x10ffff.\n return this.errorValue;\n }\n}\n","const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\n// Use a lookup table to find the index.\nconst lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\n\nexport const encode = (arraybuffer: ArrayBuffer): string => {\n let bytes = new Uint8Array(arraybuffer),\n i,\n len = bytes.length,\n base64 = '';\n\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n\n return base64;\n};\n\nexport const decode = (base64: string): ArrayBuffer => {\n let bufferLength = base64.length * 0.75,\n len = base64.length,\n i,\n p = 0,\n encoded1,\n encoded2,\n encoded3,\n encoded4;\n\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n\n const arraybuffer = new ArrayBuffer(bufferLength),\n bytes = new Uint8Array(arraybuffer);\n\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n\n return arraybuffer;\n};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uMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsByw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CGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwA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B1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAw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UABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACs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gAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHg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ArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgA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eAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==';\nexport const byteLength = 39664;\n","'use strict';\n\nimport {createTrieFromBase64} from 'utrie';\nimport {base64, byteLength} from './linebreak-trie';\nimport {fromCodePoint, toCodePoints} from './Util';\n\nexport const LETTER_NUMBER_MODIFIER = 50;\n\n// Non-tailorable Line Breaking Classes\nconst BK = 1; // Cause a line break (after)\nconst CR = 2; // Cause a line break (after), except between CR and LF\nconst LF = 3; // Cause a line break (after)\nconst CM = 4; // Prohibit a line break between the character and the preceding character\nconst NL = 5; // Cause a line break (after)\nconst SG = 6; // Do not occur in well-formed text\nconst WJ = 7; // Prohibit line breaks before and after\nconst ZW = 8; // Provide a break opportunity\nconst GL = 9; // Prohibit line breaks before and after\nconst SP = 10; // Enable indirect line breaks\nconst ZWJ = 11; // Prohibit line breaks within joiner sequences\n// Break Opportunities\nconst B2 = 12; // Provide a line break opportunity before and after the character\nconst BA = 13; // Generally provide a line break opportunity after the character\nconst BB = 14; // Generally provide a line break opportunity before the character\nconst HY = 15; // Provide a line break opportunity after the character, except in numeric context\nconst CB = 16; // Provide a line break opportunity contingent on additional information\n// Characters Prohibiting Certain Breaks\nconst CL = 17; // Prohibit line breaks before\nconst CP = 18; // Prohibit line breaks before\nconst EX = 19; // Prohibit line breaks before\nconst IN = 20; // Allow only indirect line breaks between pairs\nconst NS = 21; // Allow only indirect line breaks before\nconst OP = 22; // Prohibit line breaks after\nconst QU = 23; // Act like they are both opening and closing\n// Numeric Context\nconst IS = 24; // Prevent breaks after any and before numeric\nconst NU = 25; // Form numeric expressions for line breaking purposes\nconst PO = 26; // Do not break following a numeric expression\nconst PR = 27; // Do not break in front of a numeric expression\nconst SY = 28; // Prevent a break before; and allow a break after\n// Other Characters\nconst AI = 29; // Act like AL when the resolvedEAW is N; otherwise; act as ID\nconst AL = 30; // Are alphabetic characters or symbols that are used with alphabetic characters\nconst CJ = 31; // Treat as NS or ID for strict or normal breaking.\nconst EB = 32; // Do not break from following Emoji Modifier\nconst EM = 33; // Do not break from preceding Emoji Base\nconst H2 = 34; // Form Korean syllable blocks\nconst H3 = 35; // Form Korean syllable blocks\nconst HL = 36; // Do not break around a following hyphen; otherwise act as Alphabetic\nconst ID = 37; // Break before or after; except in some numeric context\nconst JL = 38; // Form Korean syllable blocks\nconst JV = 39; // Form Korean syllable blocks\nconst JT = 40; // Form Korean syllable blocks\nconst RI = 41; // Keep pairs together. For pairs; break before and after other classes\nconst SA = 42; // Provide a line break opportunity contingent on additional, language-specific context analysis\nconst XX = 43; // Have as yet unknown line breaking behavior or unassigned code positions\n\nconst ea_OP = [0x2329, 0xff08];\n\nexport const classes: {[key: string]: number} = {\n BK,\n CR,\n LF,\n CM,\n NL,\n SG,\n WJ,\n ZW,\n GL,\n SP,\n ZWJ,\n B2,\n BA,\n BB,\n HY,\n CB,\n CL,\n CP,\n EX,\n IN,\n NS,\n OP,\n QU,\n IS,\n NU,\n PO,\n PR,\n SY,\n AI,\n AL,\n CJ,\n EB,\n EM,\n H2,\n H3,\n HL,\n ID,\n JL,\n JV,\n JT,\n RI,\n SA,\n XX,\n};\n\nexport const BREAK_MANDATORY = '!';\nexport const BREAK_NOT_ALLOWED = '×';\nexport const BREAK_ALLOWED = '÷';\nexport const UnicodeTrie = createTrieFromBase64(base64, byteLength);\n\nconst ALPHABETICS = [AL, HL];\nconst HARD_LINE_BREAKS = [BK, CR, LF, NL];\nconst SPACE = [SP, ZW];\nconst PREFIX_POSTFIX = [PR, PO];\nconst LINE_BREAKS = HARD_LINE_BREAKS.concat(SPACE);\nconst KOREAN_SYLLABLE_BLOCK = [JL, JV, JT, H2, H3];\nconst HYPHEN = [HY, BA];\n\nexport const codePointsToCharacterClasses = (\n codePoints: number[],\n lineBreak: string = 'strict'\n): [number[], number[], boolean[]] => {\n const types: number[] = [];\n const indices: number[] = [];\n const categories: boolean[] = [];\n codePoints.forEach((codePoint, index) => {\n let classType = UnicodeTrie.get(codePoint);\n if (classType > LETTER_NUMBER_MODIFIER) {\n categories.push(true);\n classType -= LETTER_NUMBER_MODIFIER;\n } else {\n categories.push(false);\n }\n\n if (['normal', 'auto', 'loose'].indexOf(lineBreak) !== -1) {\n // U+2010, – U+2013, 〜 U+301C, ゠ U+30A0\n if ([0x2010, 0x2013, 0x301c, 0x30a0].indexOf(codePoint) !== -1) {\n indices.push(index);\n return types.push(CB);\n }\n }\n\n if (classType === CM || classType === ZWJ) {\n // LB10 Treat any remaining combining mark or ZWJ as AL.\n if (index === 0) {\n indices.push(index);\n return types.push(AL);\n }\n\n // LB9 Do not break a combining character sequence; treat it as if it has the line breaking class of\n // the base character in all of the following rules. Treat ZWJ as if it were CM.\n const prev = types[index - 1];\n if (LINE_BREAKS.indexOf(prev) === -1) {\n indices.push(indices[index - 1]);\n return types.push(prev);\n }\n indices.push(index);\n return types.push(AL);\n }\n\n indices.push(index);\n\n if (classType === CJ) {\n return types.push(lineBreak === 'strict' ? NS : ID);\n }\n\n if (classType === SA) {\n return types.push(AL);\n }\n\n if (classType === AI) {\n return types.push(AL);\n }\n\n // For supplementary characters, a useful default is to treat characters in the range 10000..1FFFD as AL\n // and characters in the ranges 20000..2FFFD and 30000..3FFFD as ID, until the implementation can be revised\n // to take into account the actual line breaking properties for these characters.\n if (classType === XX) {\n if ((codePoint >= 0x20000 && codePoint <= 0x2fffd) || (codePoint >= 0x30000 && codePoint <= 0x3fffd)) {\n return types.push(ID);\n } else {\n return types.push(AL);\n }\n }\n\n types.push(classType);\n });\n\n return [indices, types, categories];\n};\n\nconst isAdjacentWithSpaceIgnored = (\n a: number[] | number,\n b: number,\n currentIndex: number,\n classTypes: number[]\n): boolean => {\n const current = classTypes[currentIndex];\n if (Array.isArray(a) ? a.indexOf(current) !== -1 : a === current) {\n let i = currentIndex;\n while (i <= classTypes.length) {\n i++;\n let next = classTypes[i];\n\n if (next === b) {\n return true;\n }\n\n if (next !== SP) {\n break;\n }\n }\n }\n\n if (current === SP) {\n let i = currentIndex;\n\n while (i > 0) {\n i--;\n const prev = classTypes[i];\n\n if (Array.isArray(a) ? a.indexOf(prev) !== -1 : a === prev) {\n let n = currentIndex;\n while (n <= classTypes.length) {\n n++;\n let next = classTypes[n];\n\n if (next === b) {\n return true;\n }\n\n if (next !== SP) {\n break;\n }\n }\n }\n\n if (prev !== SP) {\n break;\n }\n }\n }\n return false;\n};\n\nconst previousNonSpaceClassType = (currentIndex: number, classTypes: number[]): number => {\n let i = currentIndex;\n while (i >= 0) {\n let type = classTypes[i];\n if (type === SP) {\n i--;\n } else {\n return type;\n }\n }\n return 0;\n};\n\nexport type BREAK_OPPORTUNITIES = typeof BREAK_NOT_ALLOWED | typeof BREAK_ALLOWED | typeof BREAK_MANDATORY;\n\nconst _lineBreakAtIndex = (\n codePoints: number[],\n classTypes: number[],\n indicies: number[],\n index: number,\n forbiddenBreaks?: boolean[]\n): BREAK_OPPORTUNITIES => {\n if (indicies[index] === 0) {\n return BREAK_NOT_ALLOWED;\n }\n\n let currentIndex = index - 1;\n if (Array.isArray(forbiddenBreaks) && forbiddenBreaks[currentIndex] === true) {\n return BREAK_NOT_ALLOWED;\n }\n\n let beforeIndex = currentIndex - 1;\n let afterIndex = currentIndex + 1;\n let current = classTypes[currentIndex];\n\n // LB4 Always break after hard line breaks.\n // LB5 Treat CR followed by LF, as well as CR, LF, and NL as hard line breaks.\n let before = beforeIndex >= 0 ? classTypes[beforeIndex] : 0;\n let next = classTypes[afterIndex];\n\n if (current === CR && next === LF) {\n return BREAK_NOT_ALLOWED;\n }\n\n if (HARD_LINE_BREAKS.indexOf(current) !== -1) {\n return BREAK_MANDATORY;\n }\n\n // LB6 Do not break before hard line breaks.\n if (HARD_LINE_BREAKS.indexOf(next) !== -1) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB7 Do not break before spaces or zero width space.\n if (SPACE.indexOf(next) !== -1) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB8 Break before any character following a zero-width space, even if one or more spaces intervene.\n if (previousNonSpaceClassType(currentIndex, classTypes) === ZW) {\n return BREAK_ALLOWED;\n }\n\n // LB8a Do not break after a zero width joiner.\n if (UnicodeTrie.get(codePoints[currentIndex]) === ZWJ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // zwj emojis\n if ((current === EB || current === EM) && UnicodeTrie.get(codePoints[afterIndex]) === ZWJ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB11 Do not break before or after Word joiner and related characters.\n if (current === WJ || next === WJ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB12 Do not break after NBSP and related characters.\n if (current === GL) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB12a Do not break before NBSP and related characters, except after spaces and hyphens.\n if ([SP, BA, HY].indexOf(current) === -1 && next === GL) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB13 Do not break before ‘]’ or ‘!’ or ‘;’ or ‘/’, even after spaces.\n if ([CL, CP, EX, IS, SY].indexOf(next) !== -1) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB14 Do not break after ‘[’, even after spaces.\n if (previousNonSpaceClassType(currentIndex, classTypes) === OP) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB15 Do not break within ‘”[’, even with intervening spaces.\n if (isAdjacentWithSpaceIgnored(QU, OP, currentIndex, classTypes)) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB16 Do not break between closing punctuation and a nonstarter (lb=NS), even with intervening spaces.\n if (isAdjacentWithSpaceIgnored([CL, CP], NS, currentIndex, classTypes)) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB17 Do not break within ‘——’, even with intervening spaces.\n if (isAdjacentWithSpaceIgnored(B2, B2, currentIndex, classTypes)) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB18 Break after spaces.\n if (current === SP) {\n return BREAK_ALLOWED;\n }\n\n // LB19 Do not break before or after quotation marks, such as ‘ ” ’.\n if (current === QU || next === QU) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB20 Break before and after unresolved CB.\n if (next === CB || current === CB) {\n return BREAK_ALLOWED;\n }\n\n // LB21 Do not break before hyphen-minus, other hyphens, fixed-width spaces, small kana, and other non-starters, or after acute accents.\n if ([BA, HY, NS].indexOf(next) !== -1 || current === BB) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB21a Don't break after Hebrew + Hyphen.\n if (before === HL && HYPHEN.indexOf(current) !== -1) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB21b Don’t break between Solidus and Hebrew letters.\n if (current === SY && next === HL) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB22 Do not break before ellipsis.\n if (next === IN) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB23 Do not break between digits and letters.\n if ((ALPHABETICS.indexOf(next) !== -1 && current === NU) || (ALPHABETICS.indexOf(current) !== -1 && next === NU)) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB23a Do not break between numeric prefixes and ideographs, or between ideographs and numeric postfixes.\n if (\n (current === PR && [ID, EB, EM].indexOf(next) !== -1) ||\n ([ID, EB, EM].indexOf(current) !== -1 && next === PO)\n ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB24 Do not break between numeric prefix/postfix and letters, or between letters and prefix/postfix.\n if (\n (ALPHABETICS.indexOf(current) !== -1 && PREFIX_POSTFIX.indexOf(next) !== -1) ||\n (PREFIX_POSTFIX.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1)\n ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB25 Do not break between the following pairs of classes relevant to numbers:\n if (\n // (PR | PO) × ( OP | HY )? NU\n ([PR, PO].indexOf(current) !== -1 &&\n (next === NU || ([OP, HY].indexOf(next) !== -1 && classTypes[afterIndex + 1] === NU))) ||\n // ( OP | HY ) × NU\n ([OP, HY].indexOf(current) !== -1 && next === NU) ||\n // NU ×\t(NU | SY | IS)\n (current === NU && [NU, SY, IS].indexOf(next) !== -1)\n ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // NU (NU | SY | IS)* × (NU | SY | IS | CL | CP)\n if ([NU, SY, IS, CL, CP].indexOf(next) !== -1) {\n let prevIndex = currentIndex;\n while (prevIndex >= 0) {\n let type = classTypes[prevIndex];\n if (type === NU) {\n return BREAK_NOT_ALLOWED;\n } else if ([SY, IS].indexOf(type) !== -1) {\n prevIndex--;\n } else {\n break;\n }\n }\n }\n\n // NU (NU | SY | IS)* (CL | CP)? × (PO | PR))\n if ([PR, PO].indexOf(next) !== -1) {\n let prevIndex = [CL, CP].indexOf(current) !== -1 ? beforeIndex : currentIndex;\n while (prevIndex >= 0) {\n let type = classTypes[prevIndex];\n if (type === NU) {\n return BREAK_NOT_ALLOWED;\n } else if ([SY, IS].indexOf(type) !== -1) {\n prevIndex--;\n } else {\n break;\n }\n }\n }\n\n // LB26 Do not break a Korean syllable.\n if (\n (JL === current && [JL, JV, H2, H3].indexOf(next) !== -1) ||\n ([JV, H2].indexOf(current) !== -1 && [JV, JT].indexOf(next) !== -1) ||\n ([JT, H3].indexOf(current) !== -1 && next === JT)\n ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB27 Treat a Korean Syllable Block the same as ID.\n if (\n (KOREAN_SYLLABLE_BLOCK.indexOf(current) !== -1 && [IN, PO].indexOf(next) !== -1) ||\n (KOREAN_SYLLABLE_BLOCK.indexOf(next) !== -1 && current === PR)\n ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB28 Do not break between alphabetics (“at”).\n if (ALPHABETICS.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB29 Do not break between numeric punctuation and alphabetics (“e.g.”).\n if (current === IS && ALPHABETICS.indexOf(next) !== -1) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB30 Do not break between letters, numbers, or ordinary symbols and opening or closing parentheses.\n if (\n (ALPHABETICS.concat(NU).indexOf(current) !== -1 &&\n next === OP &&\n ea_OP.indexOf(codePoints[afterIndex]) === -1) ||\n (ALPHABETICS.concat(NU).indexOf(next) !== -1 && current === CP)\n ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB30a Break between two regional indicator symbols if and only if there are an even number of regional\n // indicators preceding the position of the break.\n if (current === RI && next === RI) {\n let i = indicies[currentIndex];\n let count = 1;\n while (i > 0) {\n i--;\n if (classTypes[i] === RI) {\n count++;\n } else {\n break;\n }\n }\n if (count % 2 !== 0) {\n return BREAK_NOT_ALLOWED;\n }\n }\n\n // LB30b Do not break between an emoji base and an emoji modifier.\n if (current === EB && next === EM) {\n return BREAK_NOT_ALLOWED;\n }\n\n return BREAK_ALLOWED;\n};\n\nexport const lineBreakAtIndex = (codePoints: number[], index: number): BREAK_OPPORTUNITIES => {\n // LB2 Never break at the start of text.\n if (index === 0) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB3 Always break at the end of text.\n if (index >= codePoints.length) {\n return BREAK_MANDATORY;\n }\n\n const [indices, classTypes] = codePointsToCharacterClasses(codePoints);\n\n return _lineBreakAtIndex(codePoints, classTypes, indices, index);\n};\n\nexport type LINE_BREAK = 'auto' | 'normal' | 'strict';\nexport type WORD_BREAK = 'normal' | 'break-all' | 'break-word' | 'keep-all';\n\ninterface IOptions {\n lineBreak?: LINE_BREAK;\n wordBreak?: WORD_BREAK;\n}\n\nconst cssFormattedClasses = (codePoints: number[], options?: IOptions): [number[], number[], boolean[] | undefined] => {\n if (!options) {\n options = {lineBreak: 'normal', wordBreak: 'normal'};\n }\n let [indicies, classTypes, isLetterNumber] = codePointsToCharacterClasses(codePoints, options.lineBreak);\n\n if (options.wordBreak === 'break-all' || options.wordBreak === 'break-word') {\n classTypes = classTypes.map((type) => ([NU, AL, SA].indexOf(type) !== -1 ? ID : type));\n }\n\n const forbiddenBreakpoints =\n options.wordBreak === 'keep-all'\n ? isLetterNumber.map((letterNumber, i) => {\n return letterNumber && codePoints[i] >= 0x4e00 && codePoints[i] <= 0x9fff;\n })\n : undefined;\n\n return [indicies, classTypes, forbiddenBreakpoints];\n};\n\nexport const inlineBreakOpportunities = (str: string, options?: IOptions): string => {\n const codePoints = toCodePoints(str);\n let output = BREAK_NOT_ALLOWED;\n const [indicies, classTypes, forbiddenBreakpoints] = cssFormattedClasses(codePoints, options);\n\n codePoints.forEach((codePoint, i) => {\n output +=\n fromCodePoint(codePoint) +\n (i >= codePoints.length - 1\n ? BREAK_MANDATORY\n : _lineBreakAtIndex(codePoints, classTypes, indicies, i + 1, forbiddenBreakpoints));\n });\n\n return output;\n};\n\nclass Break {\n private readonly codePoints: number[];\n readonly required: boolean;\n readonly start: number;\n readonly end: number;\n\n constructor(codePoints: number[], lineBreak: string, start: number, end: number) {\n this.codePoints = codePoints;\n this.required = lineBreak === BREAK_MANDATORY;\n this.start = start;\n this.end = end;\n }\n\n slice(): string {\n return fromCodePoint(...this.codePoints.slice(this.start, this.end));\n }\n}\n\nexport type LineBreak =\n | {\n done: true;\n value: null;\n }\n | {\n done: false;\n value: Break;\n };\n\ninterface ILineBreakIterator {\n next: () => LineBreak;\n}\n\nexport const LineBreaker = (str: string, options?: IOptions): ILineBreakIterator => {\n const codePoints = toCodePoints(str);\n const [indicies, classTypes, forbiddenBreakpoints] = cssFormattedClasses(codePoints, options);\n const length = codePoints.length;\n let lastEnd = 0;\n let nextIndex = 0;\n\n return {\n next: () => {\n if (nextIndex >= length) {\n return {done: true, value: null};\n }\n let lineBreak = BREAK_NOT_ALLOWED;\n while (\n nextIndex < length &&\n (lineBreak = _lineBreakAtIndex(codePoints, classTypes, indicies, ++nextIndex, forbiddenBreakpoints)) ===\n BREAK_NOT_ALLOWED\n ) {}\n\n if (lineBreak !== BREAK_NOT_ALLOWED || nextIndex === length) {\n const value = new Break(codePoints, lineBreak, lastEnd, nextIndex);\n lastEnd = nextIndex;\n return {value, done: false};\n }\n\n return {done: true, value: null};\n },\n };\n};\n","// https://www.w3.org/TR/css-syntax-3\n\nimport { fromCodePoint, toCodePoints } from 'css-line-break';\n\nexport const enum TokenType {\n STRING_TOKEN,\n BAD_STRING_TOKEN,\n LEFT_PARENTHESIS_TOKEN,\n RIGHT_PARENTHESIS_TOKEN,\n COMMA_TOKEN,\n HASH_TOKEN,\n DELIM_TOKEN,\n AT_KEYWORD_TOKEN,\n PREFIX_MATCH_TOKEN,\n DASH_MATCH_TOKEN,\n INCLUDE_MATCH_TOKEN,\n LEFT_CURLY_BRACKET_TOKEN,\n RIGHT_CURLY_BRACKET_TOKEN,\n SUFFIX_MATCH_TOKEN,\n SUBSTRING_MATCH_TOKEN,\n DIMENSION_TOKEN,\n PERCENTAGE_TOKEN,\n NUMBER_TOKEN,\n FUNCTION,\n FUNCTION_TOKEN,\n IDENT_TOKEN,\n COLUMN_TOKEN,\n URL_TOKEN,\n BAD_URL_TOKEN,\n CDC_TOKEN,\n CDO_TOKEN,\n COLON_TOKEN,\n SEMICOLON_TOKEN,\n LEFT_SQUARE_BRACKET_TOKEN,\n RIGHT_SQUARE_BRACKET_TOKEN,\n UNICODE_RANGE_TOKEN,\n WHITESPACE_TOKEN,\n EOF_TOKEN\n}\n\ninterface IToken {\n type: TokenType;\n}\n\nexport interface Token extends IToken {\n type:\n | TokenType.BAD_URL_TOKEN\n | TokenType.BAD_STRING_TOKEN\n | TokenType.LEFT_PARENTHESIS_TOKEN\n | TokenType.RIGHT_PARENTHESIS_TOKEN\n | TokenType.COMMA_TOKEN\n | TokenType.SUBSTRING_MATCH_TOKEN\n | TokenType.PREFIX_MATCH_TOKEN\n | TokenType.SUFFIX_MATCH_TOKEN\n | TokenType.COLON_TOKEN\n | TokenType.SEMICOLON_TOKEN\n | TokenType.LEFT_SQUARE_BRACKET_TOKEN\n | TokenType.RIGHT_SQUARE_BRACKET_TOKEN\n | TokenType.LEFT_CURLY_BRACKET_TOKEN\n | TokenType.RIGHT_CURLY_BRACKET_TOKEN\n | TokenType.DASH_MATCH_TOKEN\n | TokenType.INCLUDE_MATCH_TOKEN\n | TokenType.COLUMN_TOKEN\n | TokenType.WHITESPACE_TOKEN\n | TokenType.CDC_TOKEN\n | TokenType.CDO_TOKEN\n | TokenType.EOF_TOKEN;\n}\n\nexport interface StringValueToken extends IToken {\n type:\n | TokenType.STRING_TOKEN\n | TokenType.DELIM_TOKEN\n | TokenType.FUNCTION_TOKEN\n | TokenType.IDENT_TOKEN\n | TokenType.URL_TOKEN\n | TokenType.AT_KEYWORD_TOKEN;\n value: string;\n}\n\nexport interface HashToken extends IToken {\n type: TokenType.HASH_TOKEN;\n flags: number;\n value: string;\n}\n\nexport interface NumberValueToken extends IToken {\n type: TokenType.PERCENTAGE_TOKEN | TokenType.NUMBER_TOKEN;\n flags: number;\n number: number;\n}\n\nexport interface DimensionToken extends IToken {\n type: TokenType.DIMENSION_TOKEN;\n flags: number;\n unit: string;\n number: number;\n}\n\nexport interface UnicodeRangeToken extends IToken {\n type: TokenType.UNICODE_RANGE_TOKEN;\n start: number;\n end: number;\n}\n\nexport type CSSToken = Token | StringValueToken | NumberValueToken | DimensionToken | UnicodeRangeToken | HashToken;\n\nexport const FLAG_UNRESTRICTED = 1 << 0;\nexport const FLAG_ID = 1 << 1;\nexport const FLAG_INTEGER = 1 << 2;\nexport const FLAG_NUMBER = 1 << 3;\n\nconst LINE_FEED = 0x000a;\nconst SOLIDUS = 0x002f;\nconst REVERSE_SOLIDUS = 0x005c;\nconst CHARACTER_TABULATION = 0x0009;\nconst SPACE = 0x0020;\nconst QUOTATION_MARK = 0x0022;\nconst EQUALS_SIGN = 0x003d;\nconst NUMBER_SIGN = 0x0023;\nconst DOLLAR_SIGN = 0x0024;\nconst PERCENTAGE_SIGN = 0x0025;\nconst APOSTROPHE = 0x0027;\nconst LEFT_PARENTHESIS = 0x0028;\nconst RIGHT_PARENTHESIS = 0x0029;\nconst LOW_LINE = 0x005f;\nconst HYPHEN_MINUS = 0x002d;\nconst EXCLAMATION_MARK = 0x0021;\nconst LESS_THAN_SIGN = 0x003c;\nconst GREATER_THAN_SIGN = 0x003e;\nconst COMMERCIAL_AT = 0x0040;\nconst LEFT_SQUARE_BRACKET = 0x005b;\nconst RIGHT_SQUARE_BRACKET = 0x005d;\nconst CIRCUMFLEX_ACCENT = 0x003d;\nconst LEFT_CURLY_BRACKET = 0x007b;\nconst QUESTION_MARK = 0x003f;\nconst RIGHT_CURLY_BRACKET = 0x007d;\nconst VERTICAL_LINE = 0x007c;\nconst TILDE = 0x007e;\nconst CONTROL = 0x0080;\nconst REPLACEMENT_CHARACTER = 0xfffd;\nconst ASTERISK = 0x002a;\nconst PLUS_SIGN = 0x002b;\nconst COMMA = 0x002c;\nconst COLON = 0x003a;\nconst SEMICOLON = 0x003b;\nconst FULL_STOP = 0x002e;\nconst NULL = 0x0000;\nconst BACKSPACE = 0x0008;\nconst LINE_TABULATION = 0x000b;\nconst SHIFT_OUT = 0x000e;\nconst INFORMATION_SEPARATOR_ONE = 0x001f;\nconst DELETE = 0x007f;\nconst EOF = -1;\nconst ZERO = 0x0030;\nconst a = 0x0061;\nconst e = 0x0065;\nconst f = 0x0066;\nconst u = 0x0075;\nconst z = 0x007a;\nconst A = 0x0041;\nconst E = 0x0045;\nconst F = 0x0046;\nconst U = 0x0055;\nconst Z = 0x005a;\n\nconst isDigit = (codePoint: number) => codePoint >= ZERO && codePoint <= 0x0039;\nconst isSurrogateCodePoint = (codePoint: number) => codePoint >= 0xd800 && codePoint <= 0xdfff;\nconst isHex = (codePoint: number) =>\n isDigit(codePoint) || (codePoint >= A && codePoint <= F) || (codePoint >= a && codePoint <= f);\nconst isLowerCaseLetter = (codePoint: number) => codePoint >= a && codePoint <= z;\nconst isUpperCaseLetter = (codePoint: number) => codePoint >= A && codePoint <= Z;\nconst isLetter = (codePoint: number) => isLowerCaseLetter(codePoint) || isUpperCaseLetter(codePoint);\nconst isNonASCIICodePoint = (codePoint: number) => codePoint >= CONTROL;\nconst isWhiteSpace = (codePoint: number): boolean =>\n codePoint === LINE_FEED || codePoint === CHARACTER_TABULATION || codePoint === SPACE;\nconst isNameStartCodePoint = (codePoint: number): boolean =>\n isLetter(codePoint) || isNonASCIICodePoint(codePoint) || codePoint === LOW_LINE;\nconst isNameCodePoint = (codePoint: number): boolean =>\n isNameStartCodePoint(codePoint) || isDigit(codePoint) || codePoint === HYPHEN_MINUS;\nconst isNonPrintableCodePoint = (codePoint: number): boolean => {\n return (\n (codePoint >= NULL && codePoint <= BACKSPACE) ||\n codePoint === LINE_TABULATION ||\n (codePoint >= SHIFT_OUT && codePoint <= INFORMATION_SEPARATOR_ONE) ||\n codePoint === DELETE\n );\n};\nconst isValidEscape = (c1: number, c2: number): boolean => {\n if (c1 !== REVERSE_SOLIDUS) {\n return false;\n }\n\n return c2 !== LINE_FEED;\n};\nconst isIdentifierStart = (c1: number, c2: number, c3: number): boolean => {\n if (c1 === HYPHEN_MINUS) {\n return isNameStartCodePoint(c2) || isValidEscape(c2, c3);\n } else if (isNameStartCodePoint(c1)) {\n return true;\n } else if (c1 === REVERSE_SOLIDUS && isValidEscape(c1, c2)) {\n return true;\n }\n return false;\n};\n\nconst isNumberStart = (c1: number, c2: number, c3: number): boolean => {\n if (c1 === PLUS_SIGN || c1 === HYPHEN_MINUS) {\n if (isDigit(c2)) {\n return true;\n }\n\n return c2 === FULL_STOP && isDigit(c3);\n }\n\n if (c1 === FULL_STOP) {\n return isDigit(c2);\n }\n\n return isDigit(c1);\n};\n\nconst stringToNumber = (codePoints: number[]): number => {\n let c = 0;\n let sign = 1;\n if (codePoints[c] === PLUS_SIGN || codePoints[c] === HYPHEN_MINUS) {\n if (codePoints[c] === HYPHEN_MINUS) {\n sign = -1;\n }\n c++;\n }\n\n const integers = [];\n\n while (isDigit(codePoints[c])) {\n integers.push(codePoints[c++]);\n }\n\n const int = integers.length ? parseInt(fromCodePoint(...integers), 10) : 0;\n\n if (codePoints[c] === FULL_STOP) {\n c++;\n }\n\n const fraction = [];\n while (isDigit(codePoints[c])) {\n fraction.push(codePoints[c++]);\n }\n\n const fracd = fraction.length;\n const frac = fracd ? parseInt(fromCodePoint(...fraction), 10) : 0;\n\n if (codePoints[c] === E || codePoints[c] === e) {\n c++;\n }\n\n let expsign = 1;\n\n if (codePoints[c] === PLUS_SIGN || codePoints[c] === HYPHEN_MINUS) {\n if (codePoints[c] === HYPHEN_MINUS) {\n expsign = -1;\n }\n c++;\n }\n\n const exponent = [];\n\n while (isDigit(codePoints[c])) {\n exponent.push(codePoints[c++]);\n }\n\n const exp = exponent.length ? parseInt(fromCodePoint(...exponent), 10) : 0;\n\n return sign * (int + frac * Math.pow(10, -fracd)) * Math.pow(10, expsign * exp);\n};\n\nconst LEFT_PARENTHESIS_TOKEN: Token = {\n type: TokenType.LEFT_PARENTHESIS_TOKEN\n};\nconst RIGHT_PARENTHESIS_TOKEN: Token = {\n type: TokenType.RIGHT_PARENTHESIS_TOKEN\n};\nconst COMMA_TOKEN: Token = { type: TokenType.COMMA_TOKEN };\nconst SUFFIX_MATCH_TOKEN: Token = { type: TokenType.SUFFIX_MATCH_TOKEN };\nconst PREFIX_MATCH_TOKEN: Token = { type: TokenType.PREFIX_MATCH_TOKEN };\nconst COLUMN_TOKEN: Token = { type: TokenType.COLUMN_TOKEN };\nconst DASH_MATCH_TOKEN: Token = { type: TokenType.DASH_MATCH_TOKEN };\nconst INCLUDE_MATCH_TOKEN: Token = { type: TokenType.INCLUDE_MATCH_TOKEN };\nconst LEFT_CURLY_BRACKET_TOKEN: Token = {\n type: TokenType.LEFT_CURLY_BRACKET_TOKEN\n};\nconst RIGHT_CURLY_BRACKET_TOKEN: Token = {\n type: TokenType.RIGHT_CURLY_BRACKET_TOKEN\n};\nconst SUBSTRING_MATCH_TOKEN: Token = { type: TokenType.SUBSTRING_MATCH_TOKEN };\nconst BAD_URL_TOKEN: Token = { type: TokenType.BAD_URL_TOKEN };\nconst BAD_STRING_TOKEN: Token = { type: TokenType.BAD_STRING_TOKEN };\nconst CDO_TOKEN: Token = { type: TokenType.CDO_TOKEN };\nconst CDC_TOKEN: Token = { type: TokenType.CDC_TOKEN };\nconst COLON_TOKEN: Token = { type: TokenType.COLON_TOKEN };\nconst SEMICOLON_TOKEN: Token = { type: TokenType.SEMICOLON_TOKEN };\nconst LEFT_SQUARE_BRACKET_TOKEN: Token = {\n type: TokenType.LEFT_SQUARE_BRACKET_TOKEN\n};\nconst RIGHT_SQUARE_BRACKET_TOKEN: Token = {\n type: TokenType.RIGHT_SQUARE_BRACKET_TOKEN\n};\nconst WHITESPACE_TOKEN: Token = { type: TokenType.WHITESPACE_TOKEN };\nexport const EOF_TOKEN: Token = { type: TokenType.EOF_TOKEN };\n\nexport class Tokenizer {\n private _value: number[];\n\n constructor() {\n this._value = [];\n }\n\n write(chunk: string): void {\n this._value = this._value.concat(toCodePoints(chunk));\n }\n\n read(): CSSToken[] {\n const tokens = [];\n let token = this.consumeToken();\n while (token !== EOF_TOKEN) {\n tokens.push(token);\n token = this.consumeToken();\n }\n return tokens;\n }\n\n private consumeToken(): CSSToken {\n const codePoint = this.consumeCodePoint();\n\n switch (codePoint) {\n case QUOTATION_MARK:\n return this.consumeStringToken(QUOTATION_MARK);\n case NUMBER_SIGN:\n const c1 = this.peekCodePoint(0);\n const c2 = this.peekCodePoint(1);\n const c3 = this.peekCodePoint(2);\n if (isNameCodePoint(c1) || isValidEscape(c2, c3)) {\n const flags = isIdentifierStart(c1, c2, c3) ? FLAG_ID : FLAG_UNRESTRICTED;\n const value = this.consumeName();\n\n return { type: TokenType.HASH_TOKEN, value, flags };\n }\n break;\n case DOLLAR_SIGN:\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\n this.consumeCodePoint();\n return SUFFIX_MATCH_TOKEN;\n }\n break;\n case APOSTROPHE:\n return this.consumeStringToken(APOSTROPHE);\n case LEFT_PARENTHESIS:\n return LEFT_PARENTHESIS_TOKEN;\n case RIGHT_PARENTHESIS:\n return RIGHT_PARENTHESIS_TOKEN;\n case ASTERISK:\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\n this.consumeCodePoint();\n return SUBSTRING_MATCH_TOKEN;\n }\n break;\n case PLUS_SIGN:\n if (isNumberStart(codePoint, this.peekCodePoint(0), this.peekCodePoint(1))) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeNumericToken();\n }\n break;\n case COMMA:\n return COMMA_TOKEN;\n case HYPHEN_MINUS:\n const e1 = codePoint;\n const e2 = this.peekCodePoint(0);\n const e3 = this.peekCodePoint(1);\n\n if (isNumberStart(e1, e2, e3)) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeNumericToken();\n }\n\n if (isIdentifierStart(e1, e2, e3)) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeIdentLikeToken();\n }\n\n if (e2 === HYPHEN_MINUS && e3 === GREATER_THAN_SIGN) {\n this.consumeCodePoint();\n this.consumeCodePoint();\n return CDC_TOKEN;\n }\n break;\n\n case FULL_STOP:\n if (isNumberStart(codePoint, this.peekCodePoint(0), this.peekCodePoint(1))) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeNumericToken();\n }\n break;\n case SOLIDUS:\n if (this.peekCodePoint(0) === ASTERISK) {\n this.consumeCodePoint();\n while (true) {\n let c = this.consumeCodePoint();\n if (c === ASTERISK) {\n c = this.consumeCodePoint();\n if (c === SOLIDUS) {\n return this.consumeToken();\n }\n }\n if (c === EOF) {\n return this.consumeToken();\n }\n }\n }\n break;\n case COLON:\n return COLON_TOKEN;\n case SEMICOLON:\n return SEMICOLON_TOKEN;\n case LESS_THAN_SIGN:\n if (\n this.peekCodePoint(0) === EXCLAMATION_MARK &&\n this.peekCodePoint(1) === HYPHEN_MINUS &&\n this.peekCodePoint(2) === HYPHEN_MINUS\n ) {\n this.consumeCodePoint();\n this.consumeCodePoint();\n return CDO_TOKEN;\n }\n break;\n case COMMERCIAL_AT:\n const a1 = this.peekCodePoint(0);\n const a2 = this.peekCodePoint(1);\n const a3 = this.peekCodePoint(2);\n if (isIdentifierStart(a1, a2, a3)) {\n const value = this.consumeName();\n return { type: TokenType.AT_KEYWORD_TOKEN, value };\n }\n break;\n case LEFT_SQUARE_BRACKET:\n return LEFT_SQUARE_BRACKET_TOKEN;\n case REVERSE_SOLIDUS:\n if (isValidEscape(codePoint, this.peekCodePoint(0))) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeIdentLikeToken();\n }\n break;\n case RIGHT_SQUARE_BRACKET:\n return RIGHT_SQUARE_BRACKET_TOKEN;\n case CIRCUMFLEX_ACCENT:\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\n this.consumeCodePoint();\n return PREFIX_MATCH_TOKEN;\n }\n break;\n case LEFT_CURLY_BRACKET:\n return LEFT_CURLY_BRACKET_TOKEN;\n case RIGHT_CURLY_BRACKET:\n return RIGHT_CURLY_BRACKET_TOKEN;\n case u:\n case U:\n const u1 = this.peekCodePoint(0);\n const u2 = this.peekCodePoint(1);\n if (u1 === PLUS_SIGN && (isHex(u2) || u2 === QUESTION_MARK)) {\n this.consumeCodePoint();\n this.consumeUnicodeRangeToken();\n }\n this.reconsumeCodePoint(codePoint);\n return this.consumeIdentLikeToken();\n case VERTICAL_LINE:\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\n this.consumeCodePoint();\n return DASH_MATCH_TOKEN;\n }\n if (this.peekCodePoint(0) === VERTICAL_LINE) {\n this.consumeCodePoint();\n return COLUMN_TOKEN;\n }\n break;\n case TILDE:\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\n this.consumeCodePoint();\n return INCLUDE_MATCH_TOKEN;\n }\n break;\n case EOF:\n return EOF_TOKEN;\n }\n\n if (isWhiteSpace(codePoint)) {\n this.consumeWhiteSpace();\n return WHITESPACE_TOKEN;\n }\n\n if (isDigit(codePoint)) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeNumericToken();\n }\n\n if (isNameStartCodePoint(codePoint)) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeIdentLikeToken();\n }\n\n return { type: TokenType.DELIM_TOKEN, value: fromCodePoint(codePoint) };\n }\n\n private consumeCodePoint(): number {\n const value = this._value.shift();\n\n return typeof value === 'undefined' ? -1 : value;\n }\n\n private reconsumeCodePoint(codePoint: number) {\n this._value.unshift(codePoint);\n }\n\n private peekCodePoint(delta: number): number {\n if (delta >= this._value.length) {\n return -1;\n }\n\n return this._value[delta];\n }\n\n private consumeUnicodeRangeToken(): UnicodeRangeToken {\n const digits = [];\n let codePoint = this.consumeCodePoint();\n while (isHex(codePoint) && digits.length < 6) {\n digits.push(codePoint);\n codePoint = this.consumeCodePoint();\n }\n let questionMarks = false;\n while (codePoint === QUESTION_MARK && digits.length < 6) {\n digits.push(codePoint);\n codePoint = this.consumeCodePoint();\n questionMarks = true;\n }\n\n if (questionMarks) {\n const start = parseInt(\n fromCodePoint(...digits.map((digit) => (digit === QUESTION_MARK ? ZERO : digit))),\n 16\n );\n const end = parseInt(fromCodePoint(...digits.map((digit) => (digit === QUESTION_MARK ? F : digit))), 16);\n return { type: TokenType.UNICODE_RANGE_TOKEN, start, end };\n }\n\n const start = parseInt(fromCodePoint(...digits), 16);\n if (this.peekCodePoint(0) === HYPHEN_MINUS && isHex(this.peekCodePoint(1))) {\n this.consumeCodePoint();\n codePoint = this.consumeCodePoint();\n const endDigits = [];\n while (isHex(codePoint) && endDigits.length < 6) {\n endDigits.push(codePoint);\n codePoint = this.consumeCodePoint();\n }\n const end = parseInt(fromCodePoint(...endDigits), 16);\n\n return { type: TokenType.UNICODE_RANGE_TOKEN, start, end };\n } else {\n return { type: TokenType.UNICODE_RANGE_TOKEN, start, end: start };\n }\n }\n\n private consumeIdentLikeToken(): StringValueToken | Token {\n const value = this.consumeName();\n if (value.toLowerCase() === 'url' && this.peekCodePoint(0) === LEFT_PARENTHESIS) {\n this.consumeCodePoint();\n return this.consumeUrlToken();\n } else if (this.peekCodePoint(0) === LEFT_PARENTHESIS) {\n this.consumeCodePoint();\n return { type: TokenType.FUNCTION_TOKEN, value };\n }\n\n return { type: TokenType.IDENT_TOKEN, value };\n }\n\n private consumeUrlToken(): StringValueToken | Token {\n const value = [];\n this.consumeWhiteSpace();\n\n if (this.peekCodePoint(0) === EOF) {\n return { type: TokenType.URL_TOKEN, value: '' };\n }\n\n const next = this.peekCodePoint(0);\n if (next === APOSTROPHE || next === QUOTATION_MARK) {\n const stringToken = this.consumeStringToken(this.consumeCodePoint());\n if (stringToken.type === TokenType.STRING_TOKEN) {\n this.consumeWhiteSpace();\n\n if (this.peekCodePoint(0) === EOF || this.peekCodePoint(0) === RIGHT_PARENTHESIS) {\n this.consumeCodePoint();\n return { type: TokenType.URL_TOKEN, value: stringToken.value };\n }\n }\n\n this.consumeBadUrlRemnants();\n return BAD_URL_TOKEN;\n }\n\n while (true) {\n const codePoint = this.consumeCodePoint();\n if (codePoint === EOF || codePoint === RIGHT_PARENTHESIS) {\n return { type: TokenType.URL_TOKEN, value: fromCodePoint(...value) };\n } else if (isWhiteSpace(codePoint)) {\n this.consumeWhiteSpace();\n if (this.peekCodePoint(0) === EOF || this.peekCodePoint(0) === RIGHT_PARENTHESIS) {\n this.consumeCodePoint();\n return { type: TokenType.URL_TOKEN, value: fromCodePoint(...value) };\n }\n this.consumeBadUrlRemnants();\n return BAD_URL_TOKEN;\n } else if (\n codePoint === QUOTATION_MARK ||\n codePoint === APOSTROPHE ||\n codePoint === LEFT_PARENTHESIS ||\n isNonPrintableCodePoint(codePoint)\n ) {\n this.consumeBadUrlRemnants();\n return BAD_URL_TOKEN;\n } else if (codePoint === REVERSE_SOLIDUS) {\n if (isValidEscape(codePoint, this.peekCodePoint(0))) {\n value.push(this.consumeEscapedCodePoint());\n } else {\n this.consumeBadUrlRemnants();\n return BAD_URL_TOKEN;\n }\n } else {\n value.push(codePoint);\n }\n }\n }\n\n private consumeWhiteSpace(): void {\n while (isWhiteSpace(this.peekCodePoint(0))) {\n this.consumeCodePoint();\n }\n }\n\n private consumeBadUrlRemnants(): void {\n while (true) {\n const codePoint = this.consumeCodePoint();\n if (codePoint === RIGHT_PARENTHESIS || codePoint === EOF) {\n return;\n }\n\n if (isValidEscape(codePoint, this.peekCodePoint(0))) {\n this.consumeEscapedCodePoint();\n }\n }\n }\n\n private consumeStringSlice(count: number): string {\n const SLICE_STACK_SIZE = 50000;\n let value = '';\n while (count > 0) {\n const amount = Math.min(SLICE_STACK_SIZE, count);\n value += fromCodePoint(...this._value.splice(0, amount));\n count -= amount;\n }\n this._value.shift();\n\n return value;\n }\n\n private consumeStringToken(endingCodePoint: number): StringValueToken | Token {\n let value = '';\n let i = 0;\n\n do {\n const codePoint = this._value[i];\n if (codePoint === EOF || codePoint === undefined || codePoint === endingCodePoint) {\n value += this.consumeStringSlice(i);\n return { type: TokenType.STRING_TOKEN, value };\n }\n\n if (codePoint === LINE_FEED) {\n this._value.splice(0, i);\n return BAD_STRING_TOKEN;\n }\n\n if (codePoint === REVERSE_SOLIDUS) {\n const next = this._value[i + 1];\n if (next !== EOF && next !== undefined) {\n if (next === LINE_FEED) {\n value += this.consumeStringSlice(i);\n i = -1;\n this._value.shift();\n } else if (isValidEscape(codePoint, next)) {\n value += this.consumeStringSlice(i);\n value += fromCodePoint(this.consumeEscapedCodePoint());\n i = -1;\n }\n }\n }\n\n i++;\n } while (true);\n }\n\n private consumeNumber() {\n const repr = [];\n let type = FLAG_INTEGER;\n let c1 = this.peekCodePoint(0);\n if (c1 === PLUS_SIGN || c1 === HYPHEN_MINUS) {\n repr.push(this.consumeCodePoint());\n }\n\n while (isDigit(this.peekCodePoint(0))) {\n repr.push(this.consumeCodePoint());\n }\n c1 = this.peekCodePoint(0);\n let c2 = this.peekCodePoint(1);\n if (c1 === FULL_STOP && isDigit(c2)) {\n repr.push(this.consumeCodePoint(), this.consumeCodePoint());\n type = FLAG_NUMBER;\n while (isDigit(this.peekCodePoint(0))) {\n repr.push(this.consumeCodePoint());\n }\n }\n\n c1 = this.peekCodePoint(0);\n c2 = this.peekCodePoint(1);\n const c3 = this.peekCodePoint(2);\n if ((c1 === E || c1 === e) && (((c2 === PLUS_SIGN || c2 === HYPHEN_MINUS) && isDigit(c3)) || isDigit(c2))) {\n repr.push(this.consumeCodePoint(), this.consumeCodePoint());\n type = FLAG_NUMBER;\n while (isDigit(this.peekCodePoint(0))) {\n repr.push(this.consumeCodePoint());\n }\n }\n\n return [stringToNumber(repr), type];\n }\n\n private consumeNumericToken(): NumberValueToken | DimensionToken {\n const [number, flags] = this.consumeNumber();\n const c1 = this.peekCodePoint(0);\n const c2 = this.peekCodePoint(1);\n const c3 = this.peekCodePoint(2);\n\n if (isIdentifierStart(c1, c2, c3)) {\n const unit = this.consumeName();\n return { type: TokenType.DIMENSION_TOKEN, number, flags, unit };\n }\n\n if (c1 === PERCENTAGE_SIGN) {\n this.consumeCodePoint();\n return { type: TokenType.PERCENTAGE_TOKEN, number, flags };\n }\n\n return { type: TokenType.NUMBER_TOKEN, number, flags };\n }\n\n private consumeEscapedCodePoint(): number {\n const codePoint = this.consumeCodePoint();\n\n if (isHex(codePoint)) {\n let hex = fromCodePoint(codePoint);\n while (isHex(this.peekCodePoint(0)) && hex.length < 6) {\n hex += fromCodePoint(this.consumeCodePoint());\n }\n\n if (isWhiteSpace(this.peekCodePoint(0))) {\n this.consumeCodePoint();\n }\n\n const hexCodePoint = parseInt(hex, 16);\n\n if (hexCodePoint === 0 || isSurrogateCodePoint(hexCodePoint) || hexCodePoint > 0x10ffff) {\n return REPLACEMENT_CHARACTER;\n }\n\n return hexCodePoint;\n }\n\n if (codePoint === EOF) {\n return REPLACEMENT_CHARACTER;\n }\n\n return codePoint;\n }\n\n private consumeName(): string {\n let result = '';\n while (true) {\n const codePoint = this.consumeCodePoint();\n if (isNameCodePoint(codePoint)) {\n result += fromCodePoint(codePoint);\n } else if (isValidEscape(codePoint, this.peekCodePoint(0))) {\n result += fromCodePoint(this.consumeEscapedCodePoint());\n } else {\n this.reconsumeCodePoint(codePoint);\n return result;\n }\n }\n }\n}\n","import {\n CSSToken,\n DimensionToken,\n EOF_TOKEN,\n NumberValueToken,\n StringValueToken,\n Tokenizer,\n TokenType\n} from './tokenizer';\n\nexport type CSSBlockType =\n | TokenType.LEFT_PARENTHESIS_TOKEN\n | TokenType.LEFT_SQUARE_BRACKET_TOKEN\n | TokenType.LEFT_CURLY_BRACKET_TOKEN;\n\nexport interface CSSBlock {\n type: CSSBlockType;\n values: CSSValue[];\n}\n\nexport interface CSSFunction {\n type: TokenType.FUNCTION;\n name: string;\n values: CSSValue[];\n}\n\nexport type CSSValue = CSSFunction | CSSToken | CSSBlock;\n\nexport class Parser {\n private _tokens: CSSToken[];\n\n constructor(tokens: CSSToken[]) {\n this._tokens = tokens;\n }\n\n static create(value: string): Parser {\n const tokenizer = new Tokenizer();\n tokenizer.write(value);\n return new Parser(tokenizer.read());\n }\n\n static parseValue(value: string): CSSValue {\n return Parser.create(value).parseComponentValue();\n }\n\n static parseValues(value: string): CSSValue[] {\n return Parser.create(value).parseComponentValues();\n }\n\n parseComponentValue(): CSSValue {\n let token = this.consumeToken();\n while (token.type === TokenType.WHITESPACE_TOKEN) {\n token = this.consumeToken();\n }\n\n if (token.type === TokenType.EOF_TOKEN) {\n throw new SyntaxError(`Error parsing CSS component value, unexpected EOF`);\n }\n\n this.reconsumeToken(token);\n const value = this.consumeComponentValue();\n\n do {\n token = this.consumeToken();\n } while (token.type === TokenType.WHITESPACE_TOKEN);\n\n if (token.type === TokenType.EOF_TOKEN) {\n return value;\n }\n\n throw new SyntaxError(`Error parsing CSS component value, multiple values found when expecting only one`);\n }\n\n parseComponentValues(): CSSValue[] {\n const values = [];\n while (true) {\n const value = this.consumeComponentValue();\n if (value.type === TokenType.EOF_TOKEN) {\n return values;\n }\n values.push(value);\n values.push();\n }\n }\n\n private consumeComponentValue(): CSSValue {\n const token = this.consumeToken();\n\n switch (token.type) {\n case TokenType.LEFT_CURLY_BRACKET_TOKEN:\n case TokenType.LEFT_SQUARE_BRACKET_TOKEN:\n case TokenType.LEFT_PARENTHESIS_TOKEN:\n return this.consumeSimpleBlock(token.type);\n case TokenType.FUNCTION_TOKEN:\n return this.consumeFunction(token);\n }\n\n return token;\n }\n\n private consumeSimpleBlock(type: CSSBlockType): CSSBlock {\n const block: CSSBlock = { type, values: [] };\n\n let token = this.consumeToken();\n while (true) {\n if (token.type === TokenType.EOF_TOKEN || isEndingTokenFor(token, type)) {\n return block;\n }\n\n this.reconsumeToken(token);\n block.values.push(this.consumeComponentValue());\n token = this.consumeToken();\n }\n }\n\n private consumeFunction(functionToken: StringValueToken): CSSFunction {\n const cssFunction: CSSFunction = {\n name: functionToken.value,\n values: [],\n type: TokenType.FUNCTION\n };\n\n while (true) {\n const token = this.consumeToken();\n if (token.type === TokenType.EOF_TOKEN || token.type === TokenType.RIGHT_PARENTHESIS_TOKEN) {\n return cssFunction;\n }\n\n this.reconsumeToken(token);\n cssFunction.values.push(this.consumeComponentValue());\n }\n }\n\n private consumeToken(): CSSToken {\n const token = this._tokens.shift();\n return typeof token === 'undefined' ? EOF_TOKEN : token;\n }\n\n private reconsumeToken(token: CSSToken): void {\n this._tokens.unshift(token);\n }\n}\n\nexport const isDimensionToken = (token: CSSValue): token is DimensionToken => token.type === TokenType.DIMENSION_TOKEN;\nexport const isNumberToken = (token: CSSValue): token is NumberValueToken => token.type === TokenType.NUMBER_TOKEN;\nexport const isIdentToken = (token: CSSValue): token is StringValueToken => token.type === TokenType.IDENT_TOKEN;\nexport const isStringToken = (token: CSSValue): token is StringValueToken => token.type === TokenType.STRING_TOKEN;\nexport const isIdentWithValue = (token: CSSValue, value: string): boolean =>\n isIdentToken(token) && token.value === value;\n\nexport const nonWhiteSpace = (token: CSSValue): boolean => token.type !== TokenType.WHITESPACE_TOKEN;\nexport const nonFunctionArgSeparator = (token: CSSValue): boolean =>\n token.type !== TokenType.WHITESPACE_TOKEN && token.type !== TokenType.COMMA_TOKEN;\n\nexport const parseFunctionArgs = (tokens: CSSValue[]): CSSValue[][] => {\n const args: CSSValue[][] = [];\n let arg: CSSValue[] = [];\n tokens.forEach((token) => {\n if (token.type === TokenType.COMMA_TOKEN) {\n if (arg.length === 0) {\n throw new Error(`Error parsing function args, zero tokens for arg`);\n }\n args.push(arg);\n arg = [];\n return;\n }\n\n if (token.type !== TokenType.WHITESPACE_TOKEN) {\n arg.push(token);\n }\n });\n if (arg.length) {\n args.push(arg);\n }\n\n return args;\n};\n\nconst isEndingTokenFor = (token: CSSToken, type: CSSBlockType): boolean => {\n if (type === TokenType.LEFT_CURLY_BRACKET_TOKEN && token.type === TokenType.RIGHT_CURLY_BRACKET_TOKEN) {\n return true;\n }\n if (type === TokenType.LEFT_SQUARE_BRACKET_TOKEN && token.type === TokenType.RIGHT_SQUARE_BRACKET_TOKEN) {\n return true;\n }\n\n return type === TokenType.LEFT_PARENTHESIS_TOKEN && token.type === TokenType.RIGHT_PARENTHESIS_TOKEN;\n};\n","import { CSSValue } from '../syntax/parser';\nimport { DimensionToken, NumberValueToken, TokenType } from '../syntax/tokenizer';\n\nexport type Length = DimensionToken | NumberValueToken;\n\nexport const isLength = (token: CSSValue): token is Length =>\n token.type === TokenType.NUMBER_TOKEN || token.type === TokenType.DIMENSION_TOKEN;\n","import { DimensionToken, FLAG_INTEGER, NumberValueToken, TokenType } from '../syntax/tokenizer';\nimport { CSSValue, CSSFunction, isDimensionToken } from '../syntax/parser';\nimport { isLength } from './length';\nexport type LengthPercentage = DimensionToken | NumberValueToken;\nexport type LengthPercentageTuple = [LengthPercentage] | [LengthPercentage, LengthPercentage];\n\nexport const isLengthPercentage = (token: CSSValue): token is LengthPercentage =>\n token.type === TokenType.PERCENTAGE_TOKEN || isLength(token);\n\n/**\n * Check if a token is a calc() function\n */\nexport const isCalcFunction = (token: CSSValue): token is CSSFunction =>\n token.type === TokenType.FUNCTION && token.name === 'calc';\n\n/**\n * Evaluate a calc() expression and convert to LengthPercentage token\n * Supports basic arithmetic: +, -, *, /\n * Note: Percentages in calc() are converted based on a context value\n */\nexport const evaluateCalcToLengthPercentage = (calcToken: CSSFunction, contextValue = 0): LengthPercentage | null => {\n // Build expression string from tokens\n const buildExpression = (values: CSSValue[]): string | null => {\n let expression = '';\n\n for (const value of values) {\n if (value.type === TokenType.WHITESPACE_TOKEN) {\n continue;\n }\n\n if (value.type === TokenType.FUNCTION) {\n if (value.name === 'calc') {\n const nested = buildExpression(value.values);\n if (nested === null) return null;\n expression += `(${nested})`;\n } else {\n return null;\n }\n } else if (value.type === TokenType.NUMBER_TOKEN) {\n expression += value.number.toString();\n } else if (value.type === TokenType.DIMENSION_TOKEN) {\n // Convert units to px\n if (value.unit === 'px') {\n expression += value.number.toString();\n } else if (value.unit === 'rem' || value.unit === 'em') {\n expression += (value.number * 16).toString();\n } else {\n expression += value.number.toString();\n }\n } else if (value.type === TokenType.PERCENTAGE_TOKEN) {\n // Convert percentage to absolute value based on context\n expression += ((value.number / 100) * contextValue).toString();\n } else if (value.type === TokenType.DELIM_TOKEN) {\n const op = value.value;\n if (op === '+' || op === '-' || op === '*' || op === '/') {\n expression += ` ${op} `;\n } else if (op === '(') {\n expression += '(';\n } else if (op === ')') {\n expression += ')';\n }\n }\n }\n\n return expression;\n };\n\n try {\n const expression = buildExpression(calcToken.values);\n if (expression === null || expression.trim() === '') {\n return null;\n }\n\n // Evaluate the expression\n // Note: Using Function constructor (similar to color.ts line 185)\n const result = new Function('return ' + expression)();\n\n if (typeof result === 'number' && !isNaN(result)) {\n // Return as a number token in px\n return {\n type: TokenType.NUMBER_TOKEN,\n number: result,\n flags: FLAG_INTEGER\n };\n }\n } catch (e) {\n return null;\n }\n\n return null;\n};\nexport const parseLengthPercentageTuple = (tokens: LengthPercentage[]): LengthPercentageTuple =>\n tokens.length > 1 ? [tokens[0], tokens[1]] : [tokens[0]];\nexport const ZERO_LENGTH: NumberValueToken = {\n type: TokenType.NUMBER_TOKEN,\n number: 0,\n flags: FLAG_INTEGER\n};\n\nexport const FIFTY_PERCENT: NumberValueToken = {\n type: TokenType.PERCENTAGE_TOKEN,\n number: 50,\n flags: FLAG_INTEGER\n};\n\nexport const HUNDRED_PERCENT: NumberValueToken = {\n type: TokenType.PERCENTAGE_TOKEN,\n number: 100,\n flags: FLAG_INTEGER\n};\n\nexport const getAbsoluteValueForTuple = (\n tuple: LengthPercentageTuple,\n width: number,\n height: number\n): [number, number] => {\n const [x, y] = tuple;\n return [getAbsoluteValue(x, width), getAbsoluteValue(typeof y !== 'undefined' ? y : x, height)];\n};\nexport const getAbsoluteValue = (token: LengthPercentage, parent: number): number => {\n if (token.type === TokenType.PERCENTAGE_TOKEN) {\n return (token.number / 100) * parent;\n }\n\n if (isDimensionToken(token)) {\n switch (token.unit) {\n case 'rem':\n case 'em':\n return 16 * token.number; // TODO use correct font-size\n case 'px':\n default:\n return token.number;\n }\n }\n\n return token.number;\n};\n","import { CSSValue, isIdentToken } from '../syntax/parser';\nimport { TokenType } from '../syntax/tokenizer';\nimport { ITypeDescriptor } from '../ITypeDescriptor';\nimport { HUNDRED_PERCENT, ZERO_LENGTH } from './length-percentage';\nimport { GradientCorner } from './image';\nimport { Context } from '../../core/context';\n\nconst DEG = 'deg';\nconst GRAD = 'grad';\nconst RAD = 'rad';\nconst TURN = 'turn';\n\nexport const angle: ITypeDescriptor<number> = {\n name: 'angle',\n parse: (_context: Context, value: CSSValue): number => {\n if (value.type === TokenType.DIMENSION_TOKEN) {\n switch (value.unit) {\n case DEG:\n return (Math.PI * value.number) / 180;\n case GRAD:\n return (Math.PI / 200) * value.number;\n case RAD:\n return value.number;\n case TURN:\n return Math.PI * 2 * value.number;\n }\n }\n\n throw new Error(`Unsupported angle type`);\n }\n};\n\nexport const isAngle = (value: CSSValue): boolean => {\n if (value.type === TokenType.DIMENSION_TOKEN) {\n if (value.unit === DEG || value.unit === GRAD || value.unit === RAD || value.unit === TURN) {\n return true;\n }\n }\n return false;\n};\n\nexport const parseNamedSide = (tokens: CSSValue[]): number | GradientCorner => {\n const sideOrCorner = tokens\n .filter(isIdentToken)\n .map((ident) => ident.value)\n .join(' ');\n\n switch (sideOrCorner) {\n case 'to bottom right':\n case 'to right bottom':\n case 'left top':\n case 'top left':\n return [ZERO_LENGTH, ZERO_LENGTH];\n case 'to top':\n case 'bottom':\n return deg(0);\n case 'to bottom left':\n case 'to left bottom':\n case 'right top':\n case 'top right':\n return [ZERO_LENGTH, HUNDRED_PERCENT];\n case 'to right':\n case 'left':\n return deg(90);\n case 'to top left':\n case 'to left top':\n case 'right bottom':\n case 'bottom right':\n return [HUNDRED_PERCENT, HUNDRED_PERCENT];\n case 'to bottom':\n case 'top':\n return deg(180);\n case 'to top right':\n case 'to right top':\n case 'left bottom':\n case 'bottom left':\n return [HUNDRED_PERCENT, ZERO_LENGTH];\n case 'to left':\n case 'right':\n return deg(270);\n }\n\n return 0;\n};\n\nexport const deg = (deg: number): number => (Math.PI * deg) / 180;\n","import { Context } from '../../core/context';\nimport { CSSValue, isDimensionToken, isNumberToken, nonFunctionArgSeparator } from '../syntax/parser';\nimport { rgb2rgbLinear, rgbLinear2xyz, srgbLinear2rgb, xyz2rgbLinear } from './color-spaces/srgb';\nimport { TokenType } from '../syntax/tokenizer';\nimport { angle, deg } from './angle';\nimport { getAbsoluteValue, isLengthPercentage } from './length-percentage';\n\ntype Color = number;\n\nexport const isTransparent = (color: Color): boolean => (0xff & color) === 0;\n\nexport const asString = (color: Color): string => {\n const alpha = 0xff & color;\n const blue = 0xff & (color >> 8);\n const green = 0xff & (color >> 16);\n const red = 0xff & (color >> 24);\n return alpha < 255 ? `rgba(${red},${green},${blue},${alpha / 255})` : `rgb(${red},${green},${blue})`;\n};\n\nexport const pack = (r: number, g: number, b: number, a: number): Color =>\n ((r << 24) | (g << 16) | (b << 8) | (Math.round(a * 255) << 0)) >>> 0;\n\nexport const getTokenColorValue = (token: CSSValue, i: number): number => {\n if (token.type === TokenType.NUMBER_TOKEN) {\n return token.number;\n }\n\n if (token.type === TokenType.PERCENTAGE_TOKEN) {\n const max = i === 3 ? 1 : 255;\n return i === 3 ? (token.number / 100) * max : Math.round((token.number / 100) * max);\n }\n\n return 0;\n};\n\nexport const isRelativeTransform = (tokens: CSSValue[]): boolean =>\n (tokens[0].type === TokenType.IDENT_TOKEN ? tokens[0].value : 'unknown') === 'from';\n\nexport const clamp = (value: number, min: number, max: number) => {\n return Math.min(Math.max(value, min), max);\n};\n\nexport const multiplyMatrices = (A: number[], B: number[]): [number, number, number] => {\n return [\n A[0] * B[0] + A[1] * B[1] + A[2] * B[2],\n A[3] * B[0] + A[4] * B[1] + A[5] * B[2],\n A[6] * B[0] + A[7] * B[1] + A[8] * B[2]\n ];\n};\n\nexport const packSrgb = (args: number[]): number => {\n return pack(\n clamp(Math.round(args[0] * 255), 0, 255),\n clamp(Math.round(args[1] * 255), 0, 255),\n clamp(Math.round(args[2] * 255), 0, 255),\n clamp(args[3], 0, 1)\n );\n};\n\nexport const packSrgbLinear = ([r, g, b, a]: [number, number, number, number]): number => {\n const rgb = srgbLinear2rgb([r, g, b]);\n return pack(\n clamp(Math.round(rgb[0] * 255), 0, 255),\n clamp(Math.round(rgb[1] * 255), 0, 255),\n clamp(Math.round(rgb[2] * 255), 0, 255),\n a\n );\n};\n\nexport const packXYZ = (args: number[]): number => {\n const srgb_linear = xyz2rgbLinear([args[0], args[1], args[2]]);\n return packSrgbLinear([srgb_linear[0], srgb_linear[1], srgb_linear[2], args[3]]);\n};\n\nexport const packLab = (_context: Context, args: CSSValue[]): number => {\n if (isRelativeTransform(args.filter(nonFunctionArgSeparator))) {\n throw new Error('Relative color not supported for lab()');\n }\n const [l, a, b, alpha] = extractLabComponents(args),\n rgb = srgbLinear2rgb(xyz2rgbLinear(lab2xyz([l, a, b])));\n\n return pack(\n clamp(Math.round(rgb[0] * 255), 0, 255),\n clamp(Math.round(rgb[1] * 255), 0, 255),\n clamp(Math.round(rgb[2] * 255), 0, 255),\n alpha\n );\n};\n\nexport const packOkLab = (_context: Context, args: CSSValue[]): number => {\n if (isRelativeTransform(args.filter(nonFunctionArgSeparator))) {\n throw new Error('Relative color not supported for oklab()');\n }\n const [l, a, b, alpha] = extractLabComponents(args),\n rgb = srgbLinear2rgb(xyz2rgbLinear(oklab2xyz([l, a, b])));\n\n return pack(\n clamp(Math.round(rgb[0] * 255), 0, 255),\n clamp(Math.round(rgb[1] * 255), 0, 255),\n clamp(Math.round(rgb[2] * 255), 0, 255),\n alpha\n );\n};\n\nexport const packOkLch = (_context: Context, args: CSSValue[]): number => {\n if (isRelativeTransform(args.filter(nonFunctionArgSeparator))) {\n throw new Error('Relative color not supported for oklch()');\n }\n const [l, c, h, alpha] = extractOkLchComponents(args),\n rgb = srgbLinear2rgb(xyz2rgbLinear(oklab2xyz(lch2lab([l, c, h]))));\n\n return pack(\n clamp(Math.round(rgb[0] * 255), 0, 255),\n clamp(Math.round(rgb[1] * 255), 0, 255),\n clamp(Math.round(rgb[2] * 255), 0, 255),\n alpha\n );\n};\n\nexport const packLch = (_context: Context, args: CSSValue[]): number => {\n if (isRelativeTransform(args.filter(nonFunctionArgSeparator))) {\n throw new Error('Relative color not supported for lch()');\n }\n const [l, c, h, a] = extractLchComponents(args),\n rgb = srgbLinear2rgb(xyz2rgbLinear(lab2xyz(lch2lab([l, c, h]))));\n\n return pack(\n clamp(Math.round(rgb[0] * 255), 0, 255),\n clamp(Math.round(rgb[1] * 255), 0, 255),\n clamp(Math.round(rgb[2] * 255), 0, 255),\n a\n );\n};\n\nexport const extractHslComponents = (context: Context, args: CSSValue[]): [number, number, number, number] => {\n const tokens = args.filter(nonFunctionArgSeparator),\n [hue, saturation, lightness, alpha] = tokens,\n h = (hue.type === TokenType.NUMBER_TOKEN ? deg(hue.number) : angle.parse(context, hue)) / (Math.PI * 2),\n s = isLengthPercentage(saturation) ? saturation.number / 100 : 0,\n l = isLengthPercentage(lightness) ? lightness.number / 100 : 0,\n a = typeof alpha !== 'undefined' && isLengthPercentage(alpha) ? getAbsoluteValue(alpha, 1) : 1;\n return [h, s, l, a];\n};\n\nexport const packHSL = (context: Context, args: CSSValue[]): number => {\n if (isRelativeTransform(args)) {\n throw new Error('Relative color not supported for hsl()');\n }\n const [h, s, l, a] = extractHslComponents(context, args),\n rgb = hsl2rgb([h, s, l]);\n return pack(rgb[0] * 255, rgb[1] * 255, rgb[2] * 255, s === 0 ? 1 : a);\n};\n\nexport const extractLchComponents = (args: CSSValue[]): [number, number, number, number] => {\n const tokens = args.filter(nonFunctionArgSeparator),\n l = isLengthPercentage(tokens[0]) ? tokens[0].number : 0,\n c = isLengthPercentage(tokens[1]) ? tokens[1].number : 0,\n h = isNumberToken(tokens[2]) || isDimensionToken(tokens[2]) ? tokens[2].number : 0,\n a = typeof tokens[4] !== 'undefined' && isLengthPercentage(tokens[4]) ? getAbsoluteValue(tokens[4], 1) : 1;\n\n return [l, c, h, a];\n};\n\nexport const extractLabComponents = (args: CSSValue[]): [number, number, number, number] => {\n const tokens = args.filter(nonFunctionArgSeparator),\n l =\n tokens[0].type === TokenType.PERCENTAGE_TOKEN\n ? tokens[0].number / 100\n : isNumberToken(tokens[0])\n ? tokens[0].number\n : 0,\n a =\n tokens[1].type === TokenType.PERCENTAGE_TOKEN\n ? tokens[1].number / 100\n : isNumberToken(tokens[1])\n ? tokens[1].number\n : 0,\n b = isNumberToken(tokens[2]) || isDimensionToken(tokens[2]) ? tokens[2].number : 0,\n alpha = typeof tokens[4] !== 'undefined' && isLengthPercentage(tokens[4]) ? getAbsoluteValue(tokens[4], 1) : 1;\n\n return [l, a, b, alpha];\n};\n\nexport const extractOkLchComponents = (args: CSSValue[]): [number, number, number, number] => {\n const tokens = args.filter(nonFunctionArgSeparator),\n l =\n tokens[0].type === TokenType.PERCENTAGE_TOKEN\n ? tokens[0].number / 100\n : isNumberToken(tokens[0])\n ? tokens[0].number\n : 0,\n c =\n tokens[1].type === TokenType.PERCENTAGE_TOKEN\n ? tokens[1].number / 100\n : isNumberToken(tokens[1])\n ? tokens[1].number\n : 0,\n h = isNumberToken(tokens[2]) || isDimensionToken(tokens[2]) ? tokens[2].number : 0,\n a = typeof tokens[4] !== 'undefined' && isLengthPercentage(tokens[4]) ? getAbsoluteValue(tokens[4], 1) : 1;\n\n return [l, c, h, a];\n};\n\n/**\n * Convert D65 to D50\n *\n * @param xyz\n */\nexport const d65toD50 = (xyz: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 1.0479297925449969, 0.022946870601609652, -0.05019226628920524, 0.02962780877005599, 0.9904344267538799,\n -0.017073799063418826, -0.009243040646204504, 0.015055191490298152, 0.7518742814281371\n ],\n xyz\n );\n};\n\n/**\n * Convert D50 to D65\n *\n * @param xyz\n */\nexport const d50toD65 = (xyz: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 0.955473421488075, -0.02309845494876471, 0.06325924320057072, -0.0283697093338637, 1.0099953980813041,\n 0.021041441191917323, 0.012314014864481998, -0.020507649298898964, 1.330365926242124\n ],\n xyz\n );\n};\n\nexport const hue2rgb = (t1: number, t2: number, hue: number): number => {\n if (hue < 0) {\n hue += 1;\n }\n if (hue >= 1) {\n hue -= 1;\n }\n\n if (hue < 1 / 6) {\n return (t2 - t1) * hue * 6 + t1;\n } else if (hue < 1 / 2) {\n return t2;\n } else if (hue < 2 / 3) {\n return (t2 - t1) * 6 * (2 / 3 - hue) + t1;\n } else {\n return t1;\n }\n};\n\nconst hsl2rgb = ([h, s, l]: [number, number, number]): [number, number, number] => {\n if (s === 0) {\n return [l * 255, l * 255, l * 255];\n }\n const t2 = l <= 0.5 ? l * (s + 1) : l + s - l * s,\n t1 = l * 2 - t2,\n r = hue2rgb(t1, t2, h + 1 / 3),\n g = hue2rgb(t1, t2, h),\n b = hue2rgb(t1, t2, h - 1 / 3);\n\n return [r, g, b];\n};\n\n/**\n * Convert lch to OKLab\n *\n * @param l\n * @param c\n * @param h\n */\nconst lch2lab = ([l, c, h]: [number, number, number]): [number, number, number] => {\n if (c < 0) {\n c = 0;\n }\n if (isNaN(h)) {\n h = 0;\n }\n return [l, c * Math.cos((h * Math.PI) / 180), c * Math.sin((h * Math.PI) / 180)];\n};\n\n/**\n * Convert OKLab to XYZ relative to D65\n *\n * @param lab\n */\nconst oklab2xyz = (lab: [number, number, number]): [number, number, number] => {\n const LMSg = multiplyMatrices(\n [\n 1, 0.3963377773761749, 0.2158037573099136, 1, -0.1055613458156586, -0.0638541728258133, 1,\n -0.0894841775298119, -1.2914855480194092\n ],\n lab\n ),\n LMS = LMSg.map((val: number) => val ** 3);\n\n return multiplyMatrices(\n [\n 1.2268798758459243, -0.5578149944602171, 0.2813910456659647, -0.0405757452148008, 1.112286803280317,\n -0.0717110580655164, -0.0763729366746601, -0.4214933324022432, 1.5869240198367816\n ],\n LMS\n );\n};\n\n/**\n * Convert Lab to D50-adapted XYZ\n *\n * @param lab\n */\nconst lab2xyz = (lab: [number, number, number]): [number, number, number] => {\n const fy = (lab[0] + 16) / 116,\n fx = lab[1] / 500 + fy,\n fz = fy - lab[2] / 200,\n k = 24389 / 27,\n e = 24 / 116,\n xyz = [\n ((fx > e ? fx ** 3 : (116 * fx - 16) / k) * 0.3457) / 0.3585,\n lab[0] > 8 ? fy ** 3 : lab[0] / k,\n ((fz > e ? fz ** 3 : (116 * fz - 16) / k) * (1.0 - 0.3457 - 0.3585)) / 0.3585\n ];\n\n return d50toD65([xyz[0], xyz[1], xyz[2]]);\n};\n\n/**\n * Convert RGB to XYZ\n *\n * @param _context\n * @param args\n */\nexport const rgbToXyz = (_context: Context, args: CSSValue[]): [number, number, number, number] => {\n const tokens = args.filter(nonFunctionArgSeparator);\n\n if (tokens.length === 3) {\n const [r, g, b] = tokens.map(getTokenColorValue),\n rgb_linear = rgb2rgbLinear([r / 255, g / 255, b / 255]),\n [x, y, z] = rgbLinear2xyz([rgb_linear[0], rgb_linear[1], rgb_linear[2]]);\n return [x, y, z, 1];\n }\n\n if (tokens.length === 4) {\n const [r, g, b, a] = tokens.map(getTokenColorValue),\n rgb_linear = rgb2rgbLinear([r / 255, g / 255, b / 255]),\n [x, y, z] = rgbLinear2xyz([rgb_linear[0], rgb_linear[1], rgb_linear[2]]);\n return [x, y, z, a];\n }\n\n return [0, 0, 0, 1];\n};\n\n/**\n * HSL to XYZ\n *\n * @param context\n * @param args\n */\nexport const hslToXyz = (context: Context, args: CSSValue[]): [number, number, number, number] => {\n const [h, s, l, a] = extractHslComponents(context, args),\n rgb_linear = rgb2rgbLinear(hsl2rgb([h, s, l])),\n [x, y, z] = rgbLinear2xyz([rgb_linear[0], rgb_linear[1], rgb_linear[2]]);\n\n return [x, y, z, a];\n};\n\n/**\n * LAB to XYZ\n *\n * @param _context\n * @param args\n */\nexport const labToXyz = (_context: Context, args: CSSValue[]): [number, number, number, number] => {\n const [l, a, b, alpha] = extractLabComponents(args),\n [x, y, z] = lab2xyz([l, a, b]);\n return [x, y, z, alpha];\n};\n\n/**\n * LCH to XYZ\n *\n * @param _context\n * @param args\n */\nexport const lchToXyz = (_context: Context, args: CSSValue[]): [number, number, number, number] => {\n const [l, c, h, alpha] = extractLchComponents(args),\n [x, y, z] = lab2xyz(lch2lab([l, c, h]));\n return [x, y, z, alpha];\n};\n\n/**\n * OKLch to XYZ\n *\n * @param _context\n * @param args\n */\nexport const oklchToXyz = (_context: Context, args: CSSValue[]): [number, number, number, number] => {\n const [l, c, h, alpha] = extractOkLchComponents(args),\n [x, y, z] = oklab2xyz(lch2lab([l, c, h]));\n return [x, y, z, alpha];\n};\n\n/**\n * OKLab to XYZ\n *\n * @param _context\n * @param args\n */\nexport const oklabToXyz = (_context: Context, args: CSSValue[]): [number, number, number, number] => {\n const [l, c, h, alpha] = extractLabComponents(args),\n [x, y, z] = oklab2xyz([l, c, h]);\n return [x, y, z, alpha];\n};\n\n/**\n * XYZ-50 to XYZ\n *\n * @param args\n */\nexport const xyz50ToXYZ = (args: number[]): [number, number, number] => {\n return d50toD65([args[0], args[1], args[2]]);\n};\n\n/**\n * Does nothing, required for SUPPORTED_COLOR_SPACES_FROM_XYZ in the _color() function\n *\n * @param args\n */\nexport const xyzFromXYZ = (args: [number, number, number, number]): [number, number, number, number] => {\n return args;\n};\n\n/**\n * XYZ-65 to XYZ-50\n *\n * @param args\n */\nexport const xyz50FromXYZ = (args: [number, number, number, number]): [number, number, number, number] => {\n const [x, y, z] = d65toD50([args[0], args[2], args[3]]);\n return [x, y, z, args[3]];\n};\n\n/**\n * Convert XYZ to SRGB and Pack\n *\n * @param args\n */\nexport const convertXyz = (args: number[]): number => {\n return packXYZ([args[0], args[1], args[2], args[3]]);\n};\n\n/**\n * Convert XYZ-50 to SRGB and Pack\n *\n * @param args\n */\nexport const convertXyz50 = (args: number[]): number => {\n const xyz = xyz50ToXYZ([args[0], args[1], args[2]]);\n return packXYZ([xyz[0], xyz[1], xyz[2], args[3]]);\n};\n","/**\n * SRGB related functions\n */\n\nimport { clamp, multiplyMatrices } from '../color-utilities';\n\n/**\n * Convert XYZ to linear-light sRGB\n *\n * @param xyz\n */\nexport const xyz2rgbLinear = (xyz: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 3.2409699419045226, -1.537383177570094, -0.4986107602930034, -0.9692436362808796, 1.8759675015077202,\n 0.04155505740717559, 0.05563007969699366, -0.20397695888897652, 1.0569715142428786\n ],\n xyz\n );\n};\n\n/**\n * Convert XYZ to linear-light sRGB\n *\n * @param xyz\n */\nexport const rgbLinear2xyz = (xyz: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 0.41239079926595934, 0.357584339383878, 0.1804807884018343, 0.21263900587151027, 0.715168678767756,\n 0.07219231536073371, 0.01933081871559182, 0.11919477979462598, 0.9505321522496607\n ],\n xyz\n );\n};\n\n/**\n * Convert sRGB to RGB\n *\n * @param rgb\n */\nexport const srgbLinear2rgb = (rgb: [number, number, number]): number[] => {\n return rgb.map((c: number) => {\n const sign = c < 0 ? -1 : 1,\n abs = Math.abs(c);\n\n return abs > 0.0031308 ? sign * (1.055 * abs ** (1 / 2.4) - 0.055) : 12.92 * c;\n });\n};\n\n/**\n * Convert RGB to sRGB\n *\n * @param rgb\n */\nexport const rgb2rgbLinear = (rgb: [number, number, number]): number[] => {\n return rgb.map((c: number) => {\n const sign = c < 0 ? -1 : 1,\n abs = Math.abs(c);\n\n return abs <= 0.04045 ? c / 12.92 : sign * ((abs + 0.055) / 1.055) ** 2.4;\n });\n};\n\n/**\n * XYZ to SRGB\n *\n * @param args\n */\nexport const srgbFromXYZ = (args: [number, number, number, number]): [number, number, number, number] => {\n const [r, g, b] = srgbLinear2rgb(xyz2rgbLinear([args[0], args[1], args[2]]));\n return [r, g, b, args[3]];\n};\n\n/**\n * XYZ to SRGB-Linear\n * @param args\n */\nexport const srgbLinearFromXYZ = (args: [number, number, number, number]): [number, number, number, number] => {\n const [r, g, b] = xyz2rgbLinear([args[0], args[1], args[2]]);\n return [\n clamp(Math.round(r * 255), 0, 255),\n clamp(Math.round(g * 255), 0, 255),\n clamp(Math.round(b * 255), 0, 255),\n args[3]\n ];\n};\n","/**\n * Display-P3 related functions\n */\n\nimport { srgbLinear2rgb } from './srgb';\nimport { multiplyMatrices, packXYZ } from '../color-utilities';\n\n/**\n * Convert P3 Linear to xyz\n *\n * @param p3l\n */\nexport const p3LinearToXyz = (p3l: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 0.4865709486482162, 0.26566769316909306, 0.1982172852343625, 0.2289745640697488, 0.6917385218365064,\n 0.079286914093745, 0.0, 0.04511338185890264, 1.043944368900976\n ],\n p3l\n );\n};\n/**\n * Convert XYZ to P3 Linear\n *\n * @param xyz\n */\nexport const xyzToP3Linear = (xyz: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 2.493496911941425, -0.9313836179191239, -0.40271078445071684, -0.8294889695615747, 1.7626640603183463,\n 0.023624685841943577, 0.03584583024378447, -0.07617238926804182, 0.9568845240076872\n ],\n xyz\n );\n};\n\n/**\n * Convert P3 to P3 linear\n *\n * @param p3\n */\nexport const p32p3Linear = (p3: [number, number, number]): number[] => {\n return p3.map((c: number) => {\n const sign = c < 0 ? -1 : 1,\n abs = c * sign;\n\n if (abs <= 0.04045) {\n return c / 12.92;\n }\n\n return sign * ((c + 0.055) / 1.055) ** 2.4 || 0;\n });\n};\n\n/**\n * Convert P3 Linear to P3\n *\n * @param p3l\n */\nexport const p3Linear2p3 = (p3l: [number, number, number]): number[] => {\n return srgbLinear2rgb(p3l);\n};\n\n/**\n * Convert P3 to XYZ\n *\n * @param args\n */\nexport const p3ToXYZ = (args: number[]): number[] => {\n const p3_linear = p32p3Linear([args[0], args[1], args[2]]);\n return p3LinearToXyz([p3_linear[0], p3_linear[1], p3_linear[2]]);\n};\n\n/**\n * Convert XYZ to P3\n *\n * @param args\n */\nexport const p3FromXYZ = (args: [number, number, number, number]): [number, number, number, number] => {\n const [r, g, b] = p3Linear2p3(xyzToP3Linear([args[0], args[1], args[2]]));\n return [r, g, b, args[3]];\n};\n\n/**\n * Convert P3 to SRGB and Pack\n *\n * @param args\n */\nexport const convertP3 = (args: number[]): number => {\n const xyz = p3ToXYZ([args[0], args[1], args[2]]);\n return packXYZ([xyz[0], xyz[1], xyz[2], args[3]]);\n};\n","/**\n * A98-RGB related functions\n */\n\nimport { multiplyMatrices, packSrgbLinear } from '../color-utilities';\nimport { xyz2rgbLinear } from './srgb';\n\n/**\n * Convert XYZ to a98 linear\n *\n * @param xyz\n */\nexport const xyz2a98Linear = (xyz: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 2.0415879038107465, -0.5650069742788596, -0.34473135077832956, -0.9692436362808795, 1.8759675015077202,\n 0.04155505740717557, 0.013444280632031142, -0.11836239223101838, 1.0151749943912054\n ],\n xyz\n );\n};\n\n/**\n * Convert XYZ to a98 linear\n *\n * @param a98\n */\nexport const a98Linear2xyz = (a98: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 0.5766690429101305, 0.1855582379065463, 0.1882286462349947, 0.29734497525053605, 0.6273635662554661,\n 0.0752914584939978, 0.02703136138641234, 0.07068885253582723, 0.9913375368376388\n ],\n a98\n );\n};\n\n/**\n * Convert A98 RGB to rgb linear\n *\n * @param rgb\n */\nexport const a982a98Linear = (rgb: [number, number, number]): [number, number, number] => {\n const mapped = rgb.map((c: number) => {\n const sign = c < 0 ? -1 : 1,\n abs = Math.abs(c);\n return sign * abs ** (563 / 256);\n });\n\n return [mapped[0], mapped[1], mapped[2]];\n};\n\n/**\n * Convert A98 RGB Linear to A98\n *\n * @param rgb\n */\nexport const a98Linear2a98 = (rgb: [number, number, number]): [number, number, number] => {\n const mapped = rgb.map((c: number) => {\n const sign = c < 0 ? -1 : 1,\n abs = Math.abs(c);\n return sign * abs ** (256 / 563);\n });\n\n return [mapped[0], mapped[1], mapped[2]];\n};\n\n/**\n * Convert XYZ to A98\n *\n * @param args\n */\nexport const a98FromXYZ = (args: [number, number, number, number]): [number, number, number, number] => {\n const [r, g, b] = a98Linear2a98(xyz2a98Linear([args[0], args[1], args[2]]));\n return [r, g, b, args[3]];\n};\n\n/**\n * Convert A98 to XYZ and Pack\n *\n * @param args\n */\nexport const convertA98rgb = (args: number[]): number => {\n const srgb_linear = xyz2rgbLinear(a98Linear2xyz(a982a98Linear([args[0], args[1], args[2]])));\n return packSrgbLinear([srgb_linear[0], srgb_linear[1], srgb_linear[2], args[3]]);\n};\n","/**\n * Pro Photo related functions\n */\n\nimport { d50toD65, d65toD50, multiplyMatrices, packXYZ } from '../color-utilities';\n\n/**\n * Convert linear-light display-p3 to XYZ D65\n *\n * @param p3\n */\nexport const proPhotoLinearToXyz = (p3: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 0.7977666449006423, 0.13518129740053308, 0.0313477341283922, 0.2880748288194013, 0.711835234241873,\n 0.00008993693872564, 0.0, 0.0, 0.8251046025104602\n ],\n p3\n );\n};\n\n/**\n * Convert XYZ D65 to linear-light display-p3\n *\n * @param xyz\n */\nexport const xyzToProPhotoLinear = (xyz: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 1.3457868816471583, -0.25557208737979464, -0.05110186497554526, -0.5446307051249019, 1.5082477428451468,\n 0.02052744743642139, 0.0, 0.0, 1.2119675456389452\n ],\n xyz\n );\n};\n\n/**\n * Convert Pro-Photo to Pro-Photo Linear\n *\n * @param p3\n */\nexport const proPhotoToProPhotoLinear = (p3: [number, number, number]): number[] => {\n return p3.map((c: number) => {\n return c < 16 / 512 ? c / 16 : c ** 1.8;\n });\n};\n\n/**\n * Convert Pro-Photo Linear to Pro-Photo\n *\n * @param p3\n */\nexport const proPhotoLinearToProPhoto = (p3: [number, number, number]): number[] => {\n return p3.map((c: number) => {\n return c > 1 / 512 ? c ** (1 / 1.8) : c * 16;\n });\n};\n\n/**\n * Convert Pro-Photo to XYZ\n *\n * @param args\n */\nexport const proPhotoToXYZ = (args: number[]): [number, number, number] => {\n const prophoto_linear = proPhotoToProPhotoLinear([args[0], args[1], args[2]]);\n return d50toD65(proPhotoLinearToXyz([prophoto_linear[0], prophoto_linear[1], prophoto_linear[2]]));\n};\n\n/**\n * Convert XYZ to Pro-Photo\n *\n * @param args\n */\nexport const proPhotoFromXYZ = (args: [number, number, number, number]): [number, number, number, number] => {\n const [r, g, b] = proPhotoLinearToProPhoto(xyzToProPhotoLinear(d65toD50([args[0], args[1], args[2]])));\n return [r, g, b, args[3]];\n};\n\n/**\n * Convert Pro-Photo to XYZ and Pack\n *\n * @param args\n */\nexport const convertProPhoto = (args: number[]): number => {\n const xyz = proPhotoToXYZ([args[0], args[1], args[2]]);\n return packXYZ([xyz[0], xyz[1], xyz[2], args[3]]);\n};\n","/**\n * REC2020 related functions\n */\n\nimport { multiplyMatrices, packXYZ } from '../color-utilities';\n\nconst _a = 1.09929682680944;\nconst _b = 0.018053968510807;\n\n/**\n * Convert rec2020 to rec2020 linear\n *\n * @param rgb\n */\nexport const rec20202rec2020Linear = (rgb: [number, number, number]): number[] => {\n return rgb.map(function (c) {\n return c < _b * 4.5 ? c / 4.5 : Math.pow((c + _a - 1) / _a, 1 / 0.45);\n });\n};\n\n/**\n * Convert rec2020 linear to rec2020\n *\n * @param rgb\n */\nexport const rec2020Linear2rec2020 = (rgb: [number, number, number]): number[] => {\n return rgb.map(function (c) {\n return c >= _b ? _a * Math.pow(c, 0.45) - (_a - 1) : 4.5 * c;\n });\n};\n\n/**\n * Convert rec2020 linear to XYZ D65\n *\n * @param rec\n */\nexport const rec2020LinearToXyz = (rec: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 0.6369580483012914, 0.14461690358620832, 0.1688809751641721, 0.2627002120112671, 0.6779980715188708,\n 0.05930171646986196, 0.0, 0.028072693049087428, 1.060985057710791\n ],\n rec\n );\n};\n\n/**\n * Convert XYZ D65 to rec2020 linear\n *\n * @param xyz\n */\nexport const xyzToRec2020Linear = (xyz: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 1.716651187971268, -0.355670783776392, -0.25336628137366, -0.666684351832489, 1.616481236634939,\n 0.0157685458139111, 0.017639857445311, -0.042770613257809, 0.942103121235474\n ],\n xyz\n );\n};\n\n/**\n * Convert Rec2020 to XYZ\n *\n * @param args\n */\nexport const rec2020ToXYZ = (args: number[]): [number, number, number] => {\n const rec2020_linear = rec20202rec2020Linear([args[0], args[1], args[2]]);\n return rec2020LinearToXyz([rec2020_linear[0], rec2020_linear[1], rec2020_linear[2]]);\n};\n\n/**\n * Convert XYZ to Rec2020\n *\n * @param args\n */\nexport const rec2020FromXYZ = (args: [number, number, number, number]): [number, number, number, number] => {\n const [r, g, b] = rec2020Linear2rec2020(xyzToRec2020Linear([args[0], args[1], args[2]]));\n return [r, g, b, args[3]];\n};\n\n/**\n * Convert Rec2020 to SRGB and Pack\n *\n * @param args\n */\nexport const convertRec2020 = (args: number[]): number => {\n const xyz = rec2020ToXYZ([args[0], args[1], args[2]]);\n return packXYZ([xyz[0], xyz[1], xyz[2], args[3]]);\n};\n","import { CSSValue, isIdentToken, isNumberToken, nonFunctionArgSeparator, Parser } from '../syntax/parser';\nimport { HashToken, TokenType } from '../syntax/tokenizer';\nimport { ITypeDescriptor } from '../ITypeDescriptor';\nimport { Context } from '../../core/context';\nimport { srgbFromXYZ, srgbLinearFromXYZ } from './color-spaces/srgb';\nimport {\n packSrgbLinear,\n packSrgb,\n packHSL,\n packLch,\n packOkLch,\n packOkLab,\n packLab,\n isRelativeTransform,\n pack,\n getTokenColorValue,\n convertXyz,\n convertXyz50,\n rgbToXyz,\n hslToXyz,\n labToXyz,\n lchToXyz,\n oklabToXyz,\n oklchToXyz,\n xyzFromXYZ,\n xyz50FromXYZ\n} from './color-utilities';\nimport { convertP3, p3FromXYZ } from './color-spaces/p3';\nimport { a98FromXYZ, convertA98rgb } from './color-spaces/a98';\nimport { convertProPhoto, proPhotoFromXYZ } from './color-spaces/pro-photo';\nimport { convertRec2020, rec2020FromXYZ } from './color-spaces/rec2020';\n\nexport type Color = number;\n\nexport const color: ITypeDescriptor<Color> = {\n name: 'color',\n parse: (context: Context, value: CSSValue): Color => {\n if (value.type === TokenType.FUNCTION) {\n const colorFunction = SUPPORTED_COLOR_FUNCTIONS[value.name];\n if (typeof colorFunction === 'undefined') {\n throw new Error(`Attempting to parse an unsupported color function \"${value.name}\"`);\n }\n return colorFunction(context, value.values);\n }\n\n if (value.type === TokenType.HASH_TOKEN) {\n const [r, g, b, a] = hash2rgb(value);\n return pack(r, g, b, a);\n }\n\n if (value.type === TokenType.IDENT_TOKEN) {\n const namedColor = COLORS[value.value.toUpperCase()];\n if (typeof namedColor !== 'undefined') {\n return namedColor;\n }\n }\n\n return COLORS.TRANSPARENT;\n }\n};\n\nconst hash2rgb = (token: HashToken): [number, number, number, number] => {\n if (token.value.length === 3) {\n const r = token.value.substring(0, 1);\n const g = token.value.substring(1, 2);\n const b = token.value.substring(2, 3);\n return [parseInt(r + r, 16), parseInt(g + g, 16), parseInt(b + b, 16), 1];\n }\n\n if (token.value.length === 4) {\n const r = token.value.substring(0, 1);\n const g = token.value.substring(1, 2);\n const b = token.value.substring(2, 3);\n const a = token.value.substring(3, 4);\n return [parseInt(r + r, 16), parseInt(g + g, 16), parseInt(b + b, 16), parseInt(a + a, 16) / 255];\n }\n\n if (token.value.length === 6) {\n const r = token.value.substring(0, 2);\n const g = token.value.substring(2, 4);\n const b = token.value.substring(4, 6);\n return [parseInt(r, 16), parseInt(g, 16), parseInt(b, 16), 1];\n }\n\n if (token.value.length === 8) {\n const r = token.value.substring(0, 2);\n const g = token.value.substring(2, 4);\n const b = token.value.substring(4, 6);\n const a = token.value.substring(6, 8);\n return [parseInt(r, 16), parseInt(g, 16), parseInt(b, 16), parseInt(a, 16) / 255];\n }\n\n return [0, 0, 0, 1];\n};\n\nconst rgb = (_context: Context, args: CSSValue[]): number => {\n const tokens = args.filter(nonFunctionArgSeparator);\n\n if (isRelativeTransform(tokens)) {\n throw new Error('Relative color not supported for rgb()');\n }\n\n if (tokens.length === 3) {\n const [r, g, b] = tokens.map(getTokenColorValue);\n return pack(r, g, b, 1);\n }\n\n if (tokens.length === 4) {\n const [r, g, b, a] = tokens.map(getTokenColorValue);\n return pack(r, g, b, a);\n }\n\n // Handle modern CSS syntax with / separator: rgb(r g b / alpha)\n // tokens[0] = r, tokens[1] = g, tokens[2] = b, tokens[3] = '/', tokens[4] = alpha\n if (tokens.length === 5 && tokens[3].type === TokenType.DELIM_TOKEN && tokens[3].value === '/') {\n const r = getTokenColorValue(tokens[0], 0);\n const g = getTokenColorValue(tokens[1], 1);\n const b = getTokenColorValue(tokens[2], 2);\n const a = getTokenColorValue(tokens[4], 3);\n return pack(r, g, b, a);\n }\n\n return 0;\n};\n\n/**\n * Handle the CSS color() function\n *\n * @param context\n * @param args\n */\nconst _color = (context: Context, args: CSSValue[]) => {\n const tokens = args.filter(nonFunctionArgSeparator),\n token_1_value = tokens[0].type === TokenType.IDENT_TOKEN ? tokens[0].value : 'unknown',\n is_absolute = !isRelativeTransform(tokens);\n\n if (is_absolute) {\n const color_space = token_1_value,\n colorSpaceFunction = SUPPORTED_COLOR_SPACES_ABSOLUTE[color_space];\n if (typeof colorSpaceFunction === 'undefined') {\n throw new Error(`Attempting to parse an unsupported color space \"${color_space}\" for color() function`);\n }\n const c1 = isNumberToken(tokens[1]) ? tokens[1].number : 0,\n c2 = isNumberToken(tokens[2]) ? tokens[2].number : 0,\n c3 = isNumberToken(tokens[3]) ? tokens[3].number : 0,\n a =\n tokens.length > 4 &&\n tokens[4].type === TokenType.DELIM_TOKEN &&\n tokens[4].value === '/' &&\n isNumberToken(tokens[5])\n ? tokens[5].number\n : 1;\n\n return colorSpaceFunction([c1, c2, c3, a]);\n } else {\n const extractComponent = (color: [number, number, number, number], token: CSSValue) => {\n if (isNumberToken(token)) {\n return token.number;\n }\n\n const posFromVal = (value: string): number => {\n return value === 'r' || value === 'x' ? 0 : value === 'g' || value === 'y' ? 1 : 2;\n };\n\n if (isIdentToken(token)) {\n const position = posFromVal(token.value);\n return color[position];\n }\n\n const parseCalc = (args: CSSValue[]): string => {\n const parts = args.filter(nonFunctionArgSeparator);\n let expression = '(';\n for (const part of parts) {\n expression +=\n part.type === TokenType.FUNCTION && part.name === 'calc'\n ? parseCalc(part.values)\n : isNumberToken(part)\n ? part.number\n : part.type === TokenType.DELIM_TOKEN || isIdentToken(part)\n ? part.value\n : '';\n }\n expression += ')';\n return expression;\n };\n\n if (token.type === TokenType.FUNCTION) {\n const args = token.values.filter(nonFunctionArgSeparator);\n if (token.name === 'calc') {\n const expression = parseCalc(args)\n .replace(/r|x/, color[0].toString())\n .replace(/g|y/, color[1].toString())\n .replace(/b|z/, color[2].toString());\n\n return new Function('return ' + expression)();\n }\n }\n\n return null;\n };\n\n const from_colorspace =\n tokens[1].type === TokenType.FUNCTION\n ? tokens[1].name\n : isIdentToken(tokens[1]) || tokens[1].type === TokenType.HASH_TOKEN\n ? 'rgb'\n : 'unknown',\n to_colorspace = isIdentToken(tokens[2]) ? tokens[2].value : 'unknown';\n\n let from =\n tokens[1].type === TokenType.FUNCTION ? tokens[1].values : isIdentToken(tokens[1]) ? [tokens[1]] : [];\n\n if (isIdentToken(tokens[1])) {\n const named_color = COLORS[tokens[1].value.toUpperCase()];\n if (typeof named_color === 'undefined') {\n throw new Error(`Attempting to use unknown color in relative color 'from'`);\n } else {\n const _c = parseColor(context, tokens[1].value),\n alpha = 0xff & _c,\n blue = 0xff & (_c >> 8),\n green = 0xff & (_c >> 16),\n red = 0xff & (_c >> 24);\n from = [\n { type: TokenType.NUMBER_TOKEN, number: red, flags: 1 },\n { type: TokenType.NUMBER_TOKEN, number: green, flags: 1 },\n { type: TokenType.NUMBER_TOKEN, number: blue, flags: 1 },\n { type: TokenType.NUMBER_TOKEN, number: alpha > 1 ? alpha / 255 : alpha, flags: 1 }\n ];\n }\n } else if (tokens[1].type === TokenType.HASH_TOKEN) {\n const [red, green, blue, alpha] = hash2rgb(tokens[1]);\n from = [\n { type: TokenType.NUMBER_TOKEN, number: red, flags: 1 },\n { type: TokenType.NUMBER_TOKEN, number: green, flags: 1 },\n { type: TokenType.NUMBER_TOKEN, number: blue, flags: 1 },\n { type: TokenType.NUMBER_TOKEN, number: alpha > 1 ? alpha / 255 : alpha, flags: 1 }\n ];\n }\n\n if (from.length === 0) {\n throw new Error(`Attempting to use unknown color in relative color 'from'`);\n }\n\n if (to_colorspace === 'unknown') {\n throw new Error(`Attempting to use unknown colorspace in relative color 'to'`);\n }\n\n const fromColorToXyz = SUPPORTED_COLOR_SPACES_TO_XYZ[from_colorspace],\n toColorFromXyz = SUPPORTED_COLOR_SPACES_FROM_XYZ[to_colorspace],\n toColorPack = SUPPORTED_COLOR_SPACES_ABSOLUTE[to_colorspace];\n\n if (typeof fromColorToXyz === 'undefined') {\n throw new Error(`Attempting to parse an unsupported color space \"${from_colorspace}\" for color() function`);\n }\n if (typeof toColorFromXyz === 'undefined') {\n throw new Error(`Attempting to parse an unsupported color space \"${to_colorspace}\" for color() function`);\n }\n\n const from_color: [number, number, number, number] = fromColorToXyz(context, from),\n from_final_colorspace: [number, number, number, number] = toColorFromXyz(from_color),\n c1 = extractComponent(from_final_colorspace, tokens[3]),\n c2 = extractComponent(from_final_colorspace, tokens[4]),\n c3 = extractComponent(from_final_colorspace, tokens[5]),\n a =\n tokens.length > 6 &&\n tokens[6].type === TokenType.DELIM_TOKEN &&\n tokens[6].value === '/' &&\n isNumberToken(tokens[7])\n ? tokens[7].number\n : 1;\n if (c1 === null || c2 === null || c3 === null) {\n throw new Error(`Invalid relative color in color() function`);\n }\n\n return toColorPack([c1, c2, c3, a]);\n }\n};\n\nconst SUPPORTED_COLOR_SPACES_ABSOLUTE: {\n [key: string]: (args: number[]) => number;\n} = {\n srgb: packSrgb,\n 'srgb-linear': packSrgbLinear,\n 'display-p3': convertP3,\n 'a98-rgb': convertA98rgb,\n 'prophoto-rgb': convertProPhoto,\n xyz: convertXyz,\n 'xyz-d50': convertXyz50,\n 'xyz-d65': convertXyz,\n rec2020: convertRec2020\n};\n\nconst SUPPORTED_COLOR_SPACES_TO_XYZ: {\n [key: string]: (context: Context, args: CSSValue[]) => [number, number, number, number];\n} = {\n rgb: rgbToXyz,\n hsl: hslToXyz,\n lab: labToXyz,\n lch: lchToXyz,\n oklab: oklabToXyz,\n oklch: oklchToXyz\n};\n\nconst SUPPORTED_COLOR_SPACES_FROM_XYZ: {\n [key: string]: (args: [number, number, number, number]) => [number, number, number, number];\n} = {\n srgb: srgbFromXYZ,\n 'srgb-linear': srgbLinearFromXYZ,\n 'display-p3': p3FromXYZ,\n 'a98-rgb': a98FromXYZ,\n 'prophoto-rgb': proPhotoFromXYZ,\n xyz: xyzFromXYZ,\n 'xyz-d50': xyz50FromXYZ,\n 'xyz-d65': xyzFromXYZ,\n rec2020: rec2020FromXYZ\n};\n\nconst SUPPORTED_COLOR_FUNCTIONS: {\n [key: string]: (context: Context, args: CSSValue[]) => number;\n} = {\n hsl: packHSL,\n hsla: packHSL,\n rgb: rgb,\n rgba: rgb,\n lch: packLch,\n oklch: packOkLch,\n oklab: packOkLab,\n lab: packLab,\n color: _color\n};\n\nexport const parseColor = (context: Context, value: string): Color =>\n color.parse(context, Parser.create(value).parseComponentValue());\n\nexport const COLORS: { [key: string]: Color } = {\n ALICEBLUE: 0xf0f8ffff,\n ANTIQUEWHITE: 0xfaebd7ff,\n AQUA: 0x00ffffff,\n AQUAMARINE: 0x7fffd4ff,\n AZURE: 0xf0ffffff,\n BEIGE: 0xf5f5dcff,\n BISQUE: 0xffe4c4ff,\n BLACK: 0x000000ff,\n BLANCHEDALMOND: 0xffebcdff,\n BLUE: 0x0000ffff,\n BLUEVIOLET: 0x8a2be2ff,\n BROWN: 0xa52a2aff,\n BURLYWOOD: 0xdeb887ff,\n CADETBLUE: 0x5f9ea0ff,\n CHARTREUSE: 0x7fff00ff,\n CHOCOLATE: 0xd2691eff,\n CORAL: 0xff7f50ff,\n CORNFLOWERBLUE: 0x6495edff,\n CORNSILK: 0xfff8dcff,\n CRIMSON: 0xdc143cff,\n CYAN: 0x00ffffff,\n DARKBLUE: 0x00008bff,\n DARKCYAN: 0x008b8bff,\n DARKGOLDENROD: 0xb886bbff,\n DARKGRAY: 0xa9a9a9ff,\n DARKGREEN: 0x006400ff,\n DARKGREY: 0xa9a9a9ff,\n DARKKHAKI: 0xbdb76bff,\n DARKMAGENTA: 0x8b008bff,\n DARKOLIVEGREEN: 0x556b2fff,\n DARKORANGE: 0xff8c00ff,\n DARKORCHID: 0x9932ccff,\n DARKRED: 0x8b0000ff,\n DARKSALMON: 0xe9967aff,\n DARKSEAGREEN: 0x8fbc8fff,\n DARKSLATEBLUE: 0x483d8bff,\n DARKSLATEGRAY: 0x2f4f4fff,\n DARKSLATEGREY: 0x2f4f4fff,\n DARKTURQUOISE: 0x00ced1ff,\n DARKVIOLET: 0x9400d3ff,\n DEEPPINK: 0xff1493ff,\n DEEPSKYBLUE: 0x00bfffff,\n DIMGRAY: 0x696969ff,\n DIMGREY: 0x696969ff,\n DODGERBLUE: 0x1e90ffff,\n FIREBRICK: 0xb22222ff,\n FLORALWHITE: 0xfffaf0ff,\n FORESTGREEN: 0x228b22ff,\n FUCHSIA: 0xff00ffff,\n GAINSBORO: 0xdcdcdcff,\n GHOSTWHITE: 0xf8f8ffff,\n GOLD: 0xffd700ff,\n GOLDENROD: 0xdaa520ff,\n GRAY: 0x808080ff,\n GREEN: 0x008000ff,\n GREENYELLOW: 0xadff2fff,\n GREY: 0x808080ff,\n HONEYDEW: 0xf0fff0ff,\n HOTPINK: 0xff69b4ff,\n INDIANRED: 0xcd5c5cff,\n INDIGO: 0x4b0082ff,\n IVORY: 0xfffff0ff,\n KHAKI: 0xf0e68cff,\n LAVENDER: 0xe6e6faff,\n LAVENDERBLUSH: 0xfff0f5ff,\n LAWNGREEN: 0x7cfc00ff,\n LEMONCHIFFON: 0xfffacdff,\n LIGHTBLUE: 0xadd8e6ff,\n LIGHTCORAL: 0xf08080ff,\n LIGHTCYAN: 0xe0ffffff,\n LIGHTGOLDENRODYELLOW: 0xfafad2ff,\n LIGHTGRAY: 0xd3d3d3ff,\n LIGHTGREEN: 0x90ee90ff,\n LIGHTGREY: 0xd3d3d3ff,\n LIGHTPINK: 0xffb6c1ff,\n LIGHTSALMON: 0xffa07aff,\n LIGHTSEAGREEN: 0x20b2aaff,\n LIGHTSKYBLUE: 0x87cefaff,\n LIGHTSLATEGRAY: 0x778899ff,\n LIGHTSLATEGREY: 0x778899ff,\n LIGHTSTEELBLUE: 0xb0c4deff,\n LIGHTYELLOW: 0xffffe0ff,\n LIME: 0x00ff00ff,\n LIMEGREEN: 0x32cd32ff,\n LINEN: 0xfaf0e6ff,\n MAGENTA: 0xff00ffff,\n MAROON: 0x800000ff,\n MEDIUMAQUAMARINE: 0x66cdaaff,\n MEDIUMBLUE: 0x0000cdff,\n MEDIUMORCHID: 0xba55d3ff,\n MEDIUMPURPLE: 0x9370dbff,\n MEDIUMSEAGREEN: 0x3cb371ff,\n MEDIUMSLATEBLUE: 0x7b68eeff,\n MEDIUMSPRINGGREEN: 0x00fa9aff,\n MEDIUMTURQUOISE: 0x48d1ccff,\n MEDIUMVIOLETRED: 0xc71585ff,\n MIDNIGHTBLUE: 0x191970ff,\n MINTCREAM: 0xf5fffaff,\n MISTYROSE: 0xffe4e1ff,\n MOCCASIN: 0xffe4b5ff,\n NAVAJOWHITE: 0xffdeadff,\n NAVY: 0x000080ff,\n OLDLACE: 0xfdf5e6ff,\n OLIVE: 0x808000ff,\n OLIVEDRAB: 0x6b8e23ff,\n ORANGE: 0xffa500ff,\n ORANGERED: 0xff4500ff,\n ORCHID: 0xda70d6ff,\n PALEGOLDENROD: 0xeee8aaff,\n PALEGREEN: 0x98fb98ff,\n PALETURQUOISE: 0xafeeeeff,\n PALEVIOLETRED: 0xdb7093ff,\n PAPAYAWHIP: 0xffefd5ff,\n PEACHPUFF: 0xffdab9ff,\n PERU: 0xcd853fff,\n PINK: 0xffc0cbff,\n PLUM: 0xdda0ddff,\n POWDERBLUE: 0xb0e0e6ff,\n PURPLE: 0x800080ff,\n REBECCAPURPLE: 0x663399ff,\n RED: 0xff0000ff,\n ROSYBROWN: 0xbc8f8fff,\n ROYALBLUE: 0x4169e1ff,\n SADDLEBROWN: 0x8b4513ff,\n SALMON: 0xfa8072ff,\n SANDYBROWN: 0xf4a460ff,\n SEAGREEN: 0x2e8b57ff,\n SEASHELL: 0xfff5eeff,\n SIENNA: 0xa0522dff,\n SILVER: 0xc0c0c0ff,\n SKYBLUE: 0x87ceebff,\n SLATEBLUE: 0x6a5acdff,\n SLATEGRAY: 0x708090ff,\n SLATEGREY: 0x708090ff,\n SNOW: 0xfffafaff,\n SPRINGGREEN: 0x00ff7fff,\n STEELBLUE: 0x4682b4ff,\n TAN: 0xd2b48cff,\n TEAL: 0x008080ff,\n THISTLE: 0xd8bfd8ff,\n TOMATO: 0xff6347ff,\n TRANSPARENT: 0x00000000,\n TURQUOISE: 0x40e0d0ff,\n VIOLET: 0xee82eeff,\n WHEAT: 0xf5deb3ff,\n WHITE: 0xffffffff,\n WHITESMOKE: 0xf5f5f5ff,\n YELLOW: 0xffff00ff,\n YELLOWGREEN: 0x9acd32ff\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\nexport const enum BACKGROUND_CLIP {\n BORDER_BOX = 0,\n PADDING_BOX = 1,\n CONTENT_BOX = 2\n}\n\nexport type BackgroundClip = BACKGROUND_CLIP[];\n\nexport const backgroundClip: IPropertyListDescriptor<BackgroundClip> = {\n name: 'background-clip',\n initialValue: 'border-box',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]): BackgroundClip => {\n return tokens.map((token) => {\n if (isIdentToken(token)) {\n switch (token.value) {\n case 'padding-box':\n return BACKGROUND_CLIP.PADDING_BOX;\n case 'content-box':\n return BACKGROUND_CLIP.CONTENT_BOX;\n }\n }\n return BACKGROUND_CLIP.BORDER_BOX;\n });\n }\n};\n","import { IPropertyTypeValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\n\nexport const backgroundColor: IPropertyTypeValueDescriptor = {\n name: `background-color`,\n initialValue: 'transparent',\n prefix: false,\n type: PropertyDescriptorParsingType.TYPE_VALUE,\n format: 'color'\n};\n","import { CSSValue } from '../../syntax/parser';\nimport {\n CSSRadialExtent,\n CSSRadialGradientImage,\n CSSRadialShape,\n GradientColorStop,\n GradientCorner,\n UnprocessedGradientColorStop\n} from '../image';\nimport { color as colorType } from '../color';\nimport { getAbsoluteValue, HUNDRED_PERCENT, isLengthPercentage, ZERO_LENGTH } from '../length-percentage';\nimport { Context } from '../../../core/context';\n\nexport const parseColorStop = (context: Context, args: CSSValue[]): UnprocessedGradientColorStop => {\n const color = colorType.parse(context, args[0]);\n const stop = args[1];\n return stop && isLengthPercentage(stop) ? { color, stop } : { color, stop: null };\n};\n\nexport const processColorStops = (stops: UnprocessedGradientColorStop[], lineLength: number): GradientColorStop[] => {\n const first = stops[0];\n const last = stops[stops.length - 1];\n if (first.stop === null) {\n first.stop = ZERO_LENGTH;\n }\n\n if (last.stop === null) {\n last.stop = HUNDRED_PERCENT;\n }\n\n const processStops: (number | null)[] = [];\n let previous = 0;\n for (let i = 0; i < stops.length; i++) {\n const stop = stops[i].stop;\n if (stop !== null) {\n const absoluteValue = getAbsoluteValue(stop, lineLength);\n if (absoluteValue > previous) {\n processStops.push(absoluteValue);\n } else {\n processStops.push(previous);\n }\n previous = absoluteValue;\n } else {\n processStops.push(null);\n }\n }\n\n let gapBegin = null;\n for (let i = 0; i < processStops.length; i++) {\n const stop = processStops[i];\n if (stop === null) {\n if (gapBegin === null) {\n gapBegin = i;\n }\n } else if (gapBegin !== null) {\n const gapLength = i - gapBegin;\n const beforeGap = processStops[gapBegin - 1] as number;\n const gapValue = (stop - beforeGap) / (gapLength + 1);\n for (let g = 1; g <= gapLength; g++) {\n processStops[gapBegin + g - 1] = gapValue * g;\n }\n gapBegin = null;\n }\n }\n\n return stops.map(({ color }, i) => {\n return { color, stop: Math.max(Math.min(1, (processStops[i] as number) / lineLength), 0) };\n });\n};\n\nconst getAngleFromCorner = (corner: GradientCorner, width: number, height: number): number => {\n const centerX = width / 2;\n const centerY = height / 2;\n const x = getAbsoluteValue(corner[0], width) - centerX;\n const y = centerY - getAbsoluteValue(corner[1], height);\n\n return (Math.atan2(y, x) + Math.PI * 2) % (Math.PI * 2);\n};\n\nexport const calculateGradientDirection = (\n angle: number | GradientCorner,\n width: number,\n height: number\n): [number, number, number, number, number] => {\n const radian = typeof angle === 'number' ? angle : getAngleFromCorner(angle, width, height);\n\n const lineLength = Math.abs(width * Math.sin(radian)) + Math.abs(height * Math.cos(radian));\n\n const halfWidth = width / 2;\n const halfHeight = height / 2;\n const halfLineLength = lineLength / 2;\n\n const yDiff = Math.sin(radian - Math.PI / 2) * halfLineLength;\n const xDiff = Math.cos(radian - Math.PI / 2) * halfLineLength;\n\n return [lineLength, halfWidth - xDiff, halfWidth + xDiff, halfHeight - yDiff, halfHeight + yDiff];\n};\n\nconst distance = (a: number, b: number): number => Math.sqrt(a * a + b * b);\n\nconst findCorner = (width: number, height: number, x: number, y: number, closest: boolean): [number, number] => {\n const corners = [\n [0, 0],\n [0, height],\n [width, 0],\n [width, height]\n ];\n\n return corners.reduce(\n (stat, corner) => {\n const [cx, cy] = corner;\n const d = distance(x - cx, y - cy);\n if (closest ? d < stat.optimumDistance : d > stat.optimumDistance) {\n return {\n optimumCorner: corner,\n optimumDistance: d\n };\n }\n\n return stat;\n },\n {\n optimumDistance: closest ? Infinity : -Infinity,\n optimumCorner: null\n }\n ).optimumCorner as [number, number];\n};\n\nexport const calculateRadius = (\n gradient: CSSRadialGradientImage,\n x: number,\n y: number,\n width: number,\n height: number\n): [number, number] => {\n let rx = 0;\n let ry = 0;\n\n switch (gradient.size) {\n case CSSRadialExtent.CLOSEST_SIDE:\n // The ending shape is sized so that that it exactly meets the side of the gradient box closest to the gradient’s center.\n // If the shape is an ellipse, it exactly meets the closest side in each dimension.\n if (gradient.shape === CSSRadialShape.CIRCLE) {\n rx = ry = Math.min(Math.abs(x), Math.abs(x - width), Math.abs(y), Math.abs(y - height));\n } else if (gradient.shape === CSSRadialShape.ELLIPSE) {\n rx = Math.min(Math.abs(x), Math.abs(x - width));\n ry = Math.min(Math.abs(y), Math.abs(y - height));\n }\n break;\n\n case CSSRadialExtent.CLOSEST_CORNER:\n // The ending shape is sized so that that it passes through the corner of the gradient box closest to the gradient’s center.\n // If the shape is an ellipse, the ending shape is given the same aspect-ratio it would have if closest-side were specified.\n if (gradient.shape === CSSRadialShape.CIRCLE) {\n rx = ry = Math.min(\n distance(x, y),\n distance(x, y - height),\n distance(x - width, y),\n distance(x - width, y - height)\n );\n } else if (gradient.shape === CSSRadialShape.ELLIPSE) {\n // Compute the ratio ry/rx (which is to be the same as for \"closest-side\")\n const c = Math.min(Math.abs(y), Math.abs(y - height)) / Math.min(Math.abs(x), Math.abs(x - width));\n const [cx, cy] = findCorner(width, height, x, y, true);\n rx = distance(cx - x, (cy - y) / c);\n ry = c * rx;\n }\n break;\n\n case CSSRadialExtent.FARTHEST_SIDE:\n // Same as closest-side, except the ending shape is sized based on the farthest side(s)\n if (gradient.shape === CSSRadialShape.CIRCLE) {\n rx = ry = Math.max(Math.abs(x), Math.abs(x - width), Math.abs(y), Math.abs(y - height));\n } else if (gradient.shape === CSSRadialShape.ELLIPSE) {\n rx = Math.max(Math.abs(x), Math.abs(x - width));\n ry = Math.max(Math.abs(y), Math.abs(y - height));\n }\n break;\n\n case CSSRadialExtent.FARTHEST_CORNER:\n // Same as closest-corner, except the ending shape is sized based on the farthest corner.\n // If the shape is an ellipse, the ending shape is given the same aspect ratio it would have if farthest-side were specified.\n if (gradient.shape === CSSRadialShape.CIRCLE) {\n rx = ry = Math.max(\n distance(x, y),\n distance(x, y - height),\n distance(x - width, y),\n distance(x - width, y - height)\n );\n } else if (gradient.shape === CSSRadialShape.ELLIPSE) {\n // Compute the ratio ry/rx (which is to be the same as for \"farthest-side\")\n const c = Math.max(Math.abs(y), Math.abs(y - height)) / Math.max(Math.abs(x), Math.abs(x - width));\n const [cx, cy] = findCorner(width, height, x, y, false);\n rx = distance(cx - x, (cy - y) / c);\n ry = c * rx;\n }\n break;\n }\n\n if (Array.isArray(gradient.size)) {\n rx = getAbsoluteValue(gradient.size[0], width);\n ry = gradient.size.length === 2 ? getAbsoluteValue(gradient.size[1], height) : rx;\n }\n\n return [rx, ry];\n};\n","import { CSSValue, parseFunctionArgs } from '../../syntax/parser';\nimport { TokenType } from '../../syntax/tokenizer';\nimport { isAngle, angle as angleType, parseNamedSide, deg } from '../angle';\nimport { CSSImageType, CSSLinearGradientImage, GradientCorner, UnprocessedGradientColorStop } from '../image';\nimport { parseColorStop } from './gradient';\nimport { Context } from '../../../core/context';\n\nexport const linearGradient = (context: Context, tokens: CSSValue[]): CSSLinearGradientImage => {\n let angle: number | GradientCorner = deg(180);\n const stops: UnprocessedGradientColorStop[] = [];\n\n parseFunctionArgs(tokens).forEach((arg, i) => {\n if (i === 0) {\n const firstToken = arg[0];\n if (firstToken.type === TokenType.IDENT_TOKEN && firstToken.value === 'to') {\n angle = parseNamedSide(arg);\n return;\n } else if (isAngle(firstToken)) {\n angle = angleType.parse(context, firstToken);\n return;\n }\n }\n const colorStop = parseColorStop(context, arg);\n stops.push(colorStop);\n });\n\n return { angle, stops, type: CSSImageType.LINEAR_GRADIENT };\n};\n","import { CSSValue, parseFunctionArgs } from '../../syntax/parser';\nimport { CSSImageType, CSSLinearGradientImage, GradientCorner, UnprocessedGradientColorStop } from '../image';\nimport { TokenType } from '../../syntax/tokenizer';\nimport { isAngle, angle as angleType, parseNamedSide, deg } from '../angle';\nimport { parseColorStop } from './gradient';\nimport { Context } from '../../../core/context';\n\nexport const prefixLinearGradient = (context: Context, tokens: CSSValue[]): CSSLinearGradientImage => {\n let angle: number | GradientCorner = deg(180);\n const stops: UnprocessedGradientColorStop[] = [];\n\n parseFunctionArgs(tokens).forEach((arg, i) => {\n if (i === 0) {\n const firstToken = arg[0];\n if (\n firstToken.type === TokenType.IDENT_TOKEN &&\n ['top', 'left', 'right', 'bottom'].indexOf(firstToken.value) !== -1\n ) {\n angle = parseNamedSide(arg);\n return;\n } else if (isAngle(firstToken)) {\n angle = (angleType.parse(context, firstToken) + deg(270)) % deg(360);\n return;\n }\n }\n const colorStop = parseColorStop(context, arg);\n stops.push(colorStop);\n });\n\n return {\n angle,\n stops,\n type: CSSImageType.LINEAR_GRADIENT\n };\n};\n","import { CSSValue, isIdentToken, isNumberToken, nonFunctionArgSeparator, parseFunctionArgs } from '../../syntax/parser';\nimport {\n CSSImageType,\n CSSLinearGradientImage,\n CSSRadialExtent,\n CSSRadialGradientImage,\n CSSRadialShape,\n CSSRadialSize,\n UnprocessedGradientColorStop\n} from '../image';\nimport { deg } from '../angle';\nimport { TokenType } from '../../syntax/tokenizer';\nimport { color as colorType } from '../color';\nimport { HUNDRED_PERCENT, LengthPercentage, ZERO_LENGTH } from '../length-percentage';\nimport { Context } from '../../../core/context';\n\nexport const webkitGradient = (\n context: Context,\n tokens: CSSValue[]\n): CSSLinearGradientImage | CSSRadialGradientImage => {\n const angle = deg(180);\n const stops: UnprocessedGradientColorStop[] = [];\n let type = CSSImageType.LINEAR_GRADIENT;\n const shape: CSSRadialShape = CSSRadialShape.CIRCLE;\n const size: CSSRadialSize = CSSRadialExtent.FARTHEST_CORNER;\n const position: LengthPercentage[] = [];\n parseFunctionArgs(tokens).forEach((arg, i) => {\n const firstToken = arg[0];\n if (i === 0) {\n if (isIdentToken(firstToken) && firstToken.value === 'linear') {\n type = CSSImageType.LINEAR_GRADIENT;\n return;\n } else if (isIdentToken(firstToken) && firstToken.value === 'radial') {\n type = CSSImageType.RADIAL_GRADIENT;\n return;\n }\n }\n\n if (firstToken.type === TokenType.FUNCTION) {\n if (firstToken.name === 'from') {\n const color = colorType.parse(context, firstToken.values[0]);\n stops.push({ stop: ZERO_LENGTH, color });\n } else if (firstToken.name === 'to') {\n const color = colorType.parse(context, firstToken.values[0]);\n stops.push({ stop: HUNDRED_PERCENT, color });\n } else if (firstToken.name === 'color-stop') {\n const values = firstToken.values.filter(nonFunctionArgSeparator);\n if (values.length === 2) {\n const color = colorType.parse(context, values[1]);\n const stop = values[0];\n if (isNumberToken(stop)) {\n stops.push({\n stop: { type: TokenType.PERCENTAGE_TOKEN, number: stop.number * 100, flags: stop.flags },\n color\n });\n }\n }\n }\n }\n });\n\n return type === CSSImageType.LINEAR_GRADIENT\n ? {\n angle: (angle + deg(180)) % deg(360),\n stops,\n type\n }\n : { size, shape, stops, position, type };\n};\n","import { CSSValue, isIdentToken, parseFunctionArgs } from '../../syntax/parser';\nimport {\n CSSImageType,\n CSSRadialExtent,\n CSSRadialGradientImage,\n CSSRadialShape,\n CSSRadialSize,\n UnprocessedGradientColorStop\n} from '../image';\nimport { parseColorStop } from './gradient';\nimport {\n FIFTY_PERCENT,\n HUNDRED_PERCENT,\n isLengthPercentage,\n LengthPercentage,\n ZERO_LENGTH\n} from '../length-percentage';\nimport { isLength } from '../length';\nimport { Context } from '../../../core/context';\nexport const CLOSEST_SIDE = 'closest-side';\nexport const FARTHEST_SIDE = 'farthest-side';\nexport const CLOSEST_CORNER = 'closest-corner';\nexport const FARTHEST_CORNER = 'farthest-corner';\nexport const CIRCLE = 'circle';\nexport const ELLIPSE = 'ellipse';\nexport const COVER = 'cover';\nexport const CONTAIN = 'contain';\n\nexport const radialGradient = (context: Context, tokens: CSSValue[]): CSSRadialGradientImage => {\n let shape: CSSRadialShape = CSSRadialShape.CIRCLE;\n let size: CSSRadialSize = CSSRadialExtent.FARTHEST_CORNER;\n const stops: UnprocessedGradientColorStop[] = [];\n const position: LengthPercentage[] = [];\n parseFunctionArgs(tokens).forEach((arg, i) => {\n let isColorStop = true;\n if (i === 0) {\n let isAtPosition = false;\n isColorStop = arg.reduce((acc, token) => {\n if (isAtPosition) {\n if (isIdentToken(token)) {\n switch (token.value) {\n case 'center':\n position.push(FIFTY_PERCENT);\n return acc;\n case 'top':\n case 'left':\n position.push(ZERO_LENGTH);\n return acc;\n case 'right':\n case 'bottom':\n position.push(HUNDRED_PERCENT);\n return acc;\n }\n } else if (isLengthPercentage(token) || isLength(token)) {\n position.push(token);\n }\n } else if (isIdentToken(token)) {\n switch (token.value) {\n case CIRCLE:\n shape = CSSRadialShape.CIRCLE;\n return false;\n case ELLIPSE:\n shape = CSSRadialShape.ELLIPSE;\n return false;\n case 'at':\n isAtPosition = true;\n return false;\n case CLOSEST_SIDE:\n size = CSSRadialExtent.CLOSEST_SIDE;\n return false;\n case COVER:\n case FARTHEST_SIDE:\n size = CSSRadialExtent.FARTHEST_SIDE;\n return false;\n case CONTAIN:\n case CLOSEST_CORNER:\n size = CSSRadialExtent.CLOSEST_CORNER;\n return false;\n case FARTHEST_CORNER:\n size = CSSRadialExtent.FARTHEST_CORNER;\n return false;\n }\n } else if (isLength(token) || isLengthPercentage(token)) {\n if (!Array.isArray(size)) {\n size = [];\n }\n size.push(token);\n return false;\n }\n return acc;\n }, isColorStop);\n }\n\n if (isColorStop) {\n const colorStop = parseColorStop(context, arg);\n stops.push(colorStop);\n }\n });\n\n return { size, shape, stops, position, type: CSSImageType.RADIAL_GRADIENT };\n};\n","import { CSSValue, isIdentToken, parseFunctionArgs } from '../../syntax/parser';\nimport {\n CSSImageType,\n CSSRadialExtent,\n CSSRadialGradientImage,\n CSSRadialShape,\n CSSRadialSize,\n UnprocessedGradientColorStop\n} from '../image';\nimport { parseColorStop } from './gradient';\nimport {\n FIFTY_PERCENT,\n HUNDRED_PERCENT,\n isLengthPercentage,\n LengthPercentage,\n ZERO_LENGTH\n} from '../length-percentage';\nimport { isLength } from '../length';\nimport {\n CIRCLE,\n CLOSEST_CORNER,\n CLOSEST_SIDE,\n CONTAIN,\n COVER,\n ELLIPSE,\n FARTHEST_CORNER,\n FARTHEST_SIDE\n} from './radial-gradient';\nimport { Context } from '../../../core/context';\n\nexport const prefixRadialGradient = (context: Context, tokens: CSSValue[]): CSSRadialGradientImage => {\n let shape: CSSRadialShape = CSSRadialShape.CIRCLE;\n let size: CSSRadialSize = CSSRadialExtent.FARTHEST_CORNER;\n const stops: UnprocessedGradientColorStop[] = [];\n const position: LengthPercentage[] = [];\n\n parseFunctionArgs(tokens).forEach((arg, i) => {\n let isColorStop = true;\n if (i === 0) {\n isColorStop = arg.reduce((acc, token) => {\n if (isIdentToken(token)) {\n switch (token.value) {\n case 'center':\n position.push(FIFTY_PERCENT);\n return false;\n case 'top':\n case 'left':\n position.push(ZERO_LENGTH);\n return false;\n case 'right':\n case 'bottom':\n position.push(HUNDRED_PERCENT);\n return false;\n }\n } else if (isLengthPercentage(token) || isLength(token)) {\n position.push(token);\n return false;\n }\n\n return acc;\n }, isColorStop);\n } else if (i === 1) {\n isColorStop = arg.reduce((acc, token) => {\n if (isIdentToken(token)) {\n switch (token.value) {\n case CIRCLE:\n shape = CSSRadialShape.CIRCLE;\n return false;\n case ELLIPSE:\n shape = CSSRadialShape.ELLIPSE;\n return false;\n case CONTAIN:\n case CLOSEST_SIDE:\n size = CSSRadialExtent.CLOSEST_SIDE;\n return false;\n case FARTHEST_SIDE:\n size = CSSRadialExtent.FARTHEST_SIDE;\n return false;\n case CLOSEST_CORNER:\n size = CSSRadialExtent.CLOSEST_CORNER;\n return false;\n case COVER:\n case FARTHEST_CORNER:\n size = CSSRadialExtent.FARTHEST_CORNER;\n return false;\n }\n } else if (isLength(token) || isLengthPercentage(token)) {\n if (!Array.isArray(size)) {\n size = [];\n }\n size.push(token);\n return false;\n }\n\n return acc;\n }, isColorStop);\n }\n\n if (isColorStop) {\n const colorStop = parseColorStop(context, arg);\n stops.push(colorStop);\n }\n });\n\n return { size, shape, stops, position, type: CSSImageType.RADIAL_GRADIENT };\n};\n","import { CSSValue } from '../syntax/parser';\nimport { TokenType } from '../syntax/tokenizer';\nimport { Color } from './color';\nimport { linearGradient } from './functions/linear-gradient';\nimport { prefixLinearGradient } from './functions/-prefix-linear-gradient';\nimport { ITypeDescriptor } from '../ITypeDescriptor';\nimport { LengthPercentage } from './length-percentage';\nimport { webkitGradient } from './functions/-webkit-gradient';\nimport { radialGradient } from './functions/radial-gradient';\nimport { prefixRadialGradient } from './functions/-prefix-radial-gradient';\nimport { Context } from '../../core/context';\n\nexport const enum CSSImageType {\n URL,\n LINEAR_GRADIENT,\n RADIAL_GRADIENT\n}\n\nexport const isLinearGradient = (background: ICSSImage): background is CSSLinearGradientImage => {\n return background.type === CSSImageType.LINEAR_GRADIENT;\n};\n\nexport const isRadialGradient = (background: ICSSImage): background is CSSRadialGradientImage => {\n return background.type === CSSImageType.RADIAL_GRADIENT;\n};\n\nexport interface UnprocessedGradientColorStop {\n color: Color;\n stop: LengthPercentage | null;\n}\n\nexport interface GradientColorStop {\n color: Color;\n stop: number;\n}\n\nexport interface ICSSImage {\n type: CSSImageType;\n}\n\nexport interface CSSURLImage extends ICSSImage {\n url: string;\n type: CSSImageType.URL;\n}\n\n// interface ICSSGeneratedImage extends ICSSImage {}\n\nexport type GradientCorner = [LengthPercentage, LengthPercentage];\n\ninterface ICSSGradientImage extends ICSSImage {\n stops: UnprocessedGradientColorStop[];\n}\n\nexport interface CSSLinearGradientImage extends ICSSGradientImage {\n angle: number | GradientCorner;\n type: CSSImageType.LINEAR_GRADIENT;\n}\n\nexport const enum CSSRadialShape {\n CIRCLE,\n ELLIPSE\n}\n\nexport const enum CSSRadialExtent {\n CLOSEST_SIDE,\n FARTHEST_SIDE,\n CLOSEST_CORNER,\n FARTHEST_CORNER\n}\n\nexport type CSSRadialSize = CSSRadialExtent | LengthPercentage[];\n\nexport interface CSSRadialGradientImage extends ICSSGradientImage {\n type: CSSImageType.RADIAL_GRADIENT;\n shape: CSSRadialShape;\n size: CSSRadialSize;\n position: LengthPercentage[];\n}\n\nexport const image: ITypeDescriptor<ICSSImage> = {\n name: 'image',\n parse: (context: Context, value: CSSValue): ICSSImage => {\n if (value.type === TokenType.URL_TOKEN) {\n const image: CSSURLImage = { url: value.value, type: CSSImageType.URL };\n context.cache.addImage(value.value);\n return image;\n }\n\n if (value.type === TokenType.FUNCTION) {\n const imageFunction = SUPPORTED_IMAGE_FUNCTIONS[value.name];\n if (typeof imageFunction === 'undefined') {\n throw new Error(`Attempting to parse an unsupported image function \"${value.name}\"`);\n }\n return imageFunction(context, value.values);\n }\n\n throw new Error(`Unsupported image type ${value.type}`);\n }\n};\n\nexport function isSupportedImage(value: CSSValue): boolean {\n return (\n !(value.type === TokenType.IDENT_TOKEN && value.value === 'none') &&\n (value.type !== TokenType.FUNCTION || !!SUPPORTED_IMAGE_FUNCTIONS[value.name])\n );\n}\n\nconst SUPPORTED_IMAGE_FUNCTIONS: Record<string, (context: Context, args: CSSValue[]) => ICSSImage> = {\n 'linear-gradient': linearGradient,\n '-moz-linear-gradient': prefixLinearGradient,\n '-ms-linear-gradient': prefixLinearGradient,\n '-o-linear-gradient': prefixLinearGradient,\n '-webkit-linear-gradient': prefixLinearGradient,\n 'radial-gradient': radialGradient,\n '-moz-radial-gradient': prefixRadialGradient,\n '-ms-radial-gradient': prefixRadialGradient,\n '-o-radial-gradient': prefixRadialGradient,\n '-webkit-radial-gradient': prefixRadialGradient,\n '-webkit-gradient': webkitGradient\n};\n","import { TokenType } from '../syntax/tokenizer';\nimport { ICSSImage, image, isSupportedImage } from '../types/image';\nimport { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, nonFunctionArgSeparator } from '../syntax/parser';\nimport { Context } from '../../core/context';\n\nexport const backgroundImage: IPropertyListDescriptor<ICSSImage[]> = {\n name: 'background-image',\n initialValue: 'none',\n type: PropertyDescriptorParsingType.LIST,\n prefix: false,\n parse: (context: Context, tokens: CSSValue[]) => {\n if (tokens.length === 0) {\n return [];\n }\n\n const first = tokens[0];\n\n if (first.type === TokenType.IDENT_TOKEN && first.value === 'none') {\n return [];\n }\n\n return tokens\n .filter((value) => nonFunctionArgSeparator(value) && isSupportedImage(value))\n .map((value) => image.parse(context, value));\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\n\nexport const enum BACKGROUND_ORIGIN {\n BORDER_BOX = 0,\n PADDING_BOX = 1,\n CONTENT_BOX = 2\n}\n\nexport type BackgroundOrigin = BACKGROUND_ORIGIN[];\n\nexport const backgroundOrigin: IPropertyListDescriptor<BackgroundOrigin> = {\n name: 'background-origin',\n initialValue: 'border-box',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]): BackgroundOrigin => {\n return tokens.map((token) => {\n if (isIdentToken(token)) {\n switch (token.value) {\n case 'padding-box':\n return BACKGROUND_ORIGIN.PADDING_BOX;\n case 'content-box':\n return BACKGROUND_ORIGIN.CONTENT_BOX;\n }\n }\n return BACKGROUND_ORIGIN.BORDER_BOX;\n });\n }\n};\n","import { PropertyDescriptorParsingType, IPropertyListDescriptor } from '../IPropertyDescriptor';\nimport { CSSValue, parseFunctionArgs } from '../syntax/parser';\nimport {\n isLengthPercentage,\n isCalcFunction,\n evaluateCalcToLengthPercentage,\n LengthPercentageTuple,\n parseLengthPercentageTuple\n} from '../types/length-percentage';\nimport { Context } from '../../core/context';\nexport type BackgroundPosition = BackgroundImagePosition[];\n\nexport type BackgroundImagePosition = LengthPercentageTuple;\n\nexport const backgroundPosition: IPropertyListDescriptor<BackgroundPosition> = {\n name: 'background-position',\n initialValue: '0% 0%',\n type: PropertyDescriptorParsingType.LIST,\n prefix: false,\n parse: (_context: Context, tokens: CSSValue[]): BackgroundPosition => {\n return parseFunctionArgs(tokens)\n .map((values: CSSValue[]) => {\n // Convert calc() to length-percentage tokens, keep other length-percentage as is\n return values\n .map((value) => {\n if (isCalcFunction(value)) {\n // For calc() at parse time, we can't know the container size\n // So we evaluate with 0 context which will work for px-only calc()\n // Percentage-based calc() will need special handling\n return evaluateCalcToLengthPercentage(value, 0);\n }\n return isLengthPercentage(value) ? value : null;\n })\n .filter((v): v is NonNullable<typeof v> => v !== null);\n })\n .map(parseLengthPercentageTuple);\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken, parseFunctionArgs } from '../syntax/parser';\nimport { Context } from '../../core/context';\nexport type BackgroundRepeat = BACKGROUND_REPEAT[];\n\nexport const enum BACKGROUND_REPEAT {\n REPEAT = 0,\n NO_REPEAT = 1,\n REPEAT_X = 2,\n REPEAT_Y = 3\n}\n\nexport const backgroundRepeat: IPropertyListDescriptor<BackgroundRepeat> = {\n name: 'background-repeat',\n initialValue: 'repeat',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]): BackgroundRepeat => {\n return parseFunctionArgs(tokens)\n .map((values) =>\n values\n .filter(isIdentToken)\n .map((token) => token.value)\n .join(' ')\n )\n .map(parseBackgroundRepeat);\n }\n};\n\nconst parseBackgroundRepeat = (value: string): BACKGROUND_REPEAT => {\n switch (value) {\n case 'no-repeat':\n return BACKGROUND_REPEAT.NO_REPEAT;\n case 'repeat-x':\n case 'repeat no-repeat':\n return BACKGROUND_REPEAT.REPEAT_X;\n case 'repeat-y':\n case 'no-repeat repeat':\n return BACKGROUND_REPEAT.REPEAT_Y;\n case 'repeat':\n default:\n return BACKGROUND_REPEAT.REPEAT;\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken, parseFunctionArgs } from '../syntax/parser';\nimport { isLengthPercentage, LengthPercentage } from '../types/length-percentage';\nimport { StringValueToken } from '../syntax/tokenizer';\nimport { Context } from '../../core/context';\n\nexport enum BACKGROUND_SIZE {\n AUTO = 'auto',\n CONTAIN = 'contain',\n COVER = 'cover'\n}\n\nexport type BackgroundSizeInfo = LengthPercentage | StringValueToken;\nexport type BackgroundSize = BackgroundSizeInfo[][];\n\nexport const backgroundSize: IPropertyListDescriptor<BackgroundSize> = {\n name: 'background-size',\n initialValue: '0',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]): BackgroundSize => {\n return parseFunctionArgs(tokens).map((values) => values.filter(isBackgroundSizeInfoToken));\n }\n};\n\nconst isBackgroundSizeInfoToken = (value: CSSValue): value is BackgroundSizeInfo =>\n isIdentToken(value) || isLengthPercentage(value);\n","import { IPropertyTypeValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nconst borderColorForSide = (side: string): IPropertyTypeValueDescriptor => ({\n name: `border-${side}-color`,\n initialValue: 'transparent',\n prefix: false,\n type: PropertyDescriptorParsingType.TYPE_VALUE,\n format: 'color'\n});\n\nexport const borderTopColor: IPropertyTypeValueDescriptor = borderColorForSide('top');\nexport const borderRightColor: IPropertyTypeValueDescriptor = borderColorForSide('right');\nexport const borderBottomColor: IPropertyTypeValueDescriptor = borderColorForSide('bottom');\nexport const borderLeftColor: IPropertyTypeValueDescriptor = borderColorForSide('left');\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue } from '../syntax/parser';\nimport { isLengthPercentage, LengthPercentageTuple, parseLengthPercentageTuple } from '../types/length-percentage';\nimport { Context } from '../../core/context';\nexport type BorderRadius = LengthPercentageTuple;\n\nconst borderRadiusForSide = (side: string): IPropertyListDescriptor<BorderRadius> => ({\n name: `border-radius-${side}`,\n initialValue: '0 0',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]): BorderRadius =>\n parseLengthPercentageTuple(tokens.filter(isLengthPercentage))\n});\n\nexport const borderTopLeftRadius: IPropertyListDescriptor<BorderRadius> = borderRadiusForSide('top-left');\nexport const borderTopRightRadius: IPropertyListDescriptor<BorderRadius> = borderRadiusForSide('top-right');\nexport const borderBottomRightRadius: IPropertyListDescriptor<BorderRadius> = borderRadiusForSide('bottom-right');\nexport const borderBottomLeftRadius: IPropertyListDescriptor<BorderRadius> = borderRadiusForSide('bottom-left');\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport const enum BORDER_STYLE {\n NONE = 0,\n SOLID = 1,\n DASHED = 2,\n DOTTED = 3,\n DOUBLE = 4\n}\n\nconst borderStyleForSide = (side: string): IPropertyIdentValueDescriptor<BORDER_STYLE> => ({\n name: `border-${side}-style`,\n initialValue: 'solid',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, style: string): BORDER_STYLE => {\n switch (style) {\n case 'none':\n return BORDER_STYLE.NONE;\n case 'dashed':\n return BORDER_STYLE.DASHED;\n case 'dotted':\n return BORDER_STYLE.DOTTED;\n case 'double':\n return BORDER_STYLE.DOUBLE;\n }\n return BORDER_STYLE.SOLID;\n }\n});\n\nexport const borderTopStyle: IPropertyIdentValueDescriptor<BORDER_STYLE> = borderStyleForSide('top');\nexport const borderRightStyle: IPropertyIdentValueDescriptor<BORDER_STYLE> = borderStyleForSide('right');\nexport const borderBottomStyle: IPropertyIdentValueDescriptor<BORDER_STYLE> = borderStyleForSide('bottom');\nexport const borderLeftStyle: IPropertyIdentValueDescriptor<BORDER_STYLE> = borderStyleForSide('left');\n","import { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isDimensionToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\nconst borderWidthForSide = (side: string): IPropertyValueDescriptor<number> => ({\n name: `border-${side}-width`,\n initialValue: '0',\n type: PropertyDescriptorParsingType.VALUE,\n prefix: false,\n parse: (_context: Context, token: CSSValue): number => {\n if (isDimensionToken(token)) {\n return token.number;\n }\n return 0;\n }\n});\n\nexport const borderTopWidth: IPropertyValueDescriptor<number> = borderWidthForSide('top');\nexport const borderRightWidth: IPropertyValueDescriptor<number> = borderWidthForSide('right');\nexport const borderBottomWidth: IPropertyValueDescriptor<number> = borderWidthForSide('bottom');\nexport const borderLeftWidth: IPropertyValueDescriptor<number> = borderWidthForSide('left');\n","import { IPropertyTypeValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\n\nexport const color: IPropertyTypeValueDescriptor = {\n name: `color`,\n initialValue: 'transparent',\n prefix: false,\n type: PropertyDescriptorParsingType.TYPE_VALUE,\n format: 'color'\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\n\nexport const enum DIRECTION {\n LTR = 0,\n RTL = 1\n}\n\nexport const direction: IPropertyIdentValueDescriptor<DIRECTION> = {\n name: 'direction',\n initialValue: 'ltr',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, direction: string) => {\n switch (direction) {\n case 'rtl':\n return DIRECTION.RTL;\n case 'ltr':\n default:\n return DIRECTION.LTR;\n }\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\nexport const enum DISPLAY {\n NONE = 0,\n BLOCK = 1 << 1,\n INLINE = 1 << 2,\n RUN_IN = 1 << 3,\n FLOW = 1 << 4,\n FLOW_ROOT = 1 << 5,\n TABLE = 1 << 6,\n FLEX = 1 << 7,\n GRID = 1 << 8,\n RUBY = 1 << 9,\n SUBGRID = 1 << 10,\n LIST_ITEM = 1 << 11,\n TABLE_ROW_GROUP = 1 << 12,\n TABLE_HEADER_GROUP = 1 << 13,\n TABLE_FOOTER_GROUP = 1 << 14,\n TABLE_ROW = 1 << 15,\n TABLE_CELL = 1 << 16,\n TABLE_COLUMN_GROUP = 1 << 17,\n TABLE_COLUMN = 1 << 18,\n TABLE_CAPTION = 1 << 19,\n RUBY_BASE = 1 << 20,\n RUBY_TEXT = 1 << 21,\n RUBY_BASE_CONTAINER = 1 << 22,\n RUBY_TEXT_CONTAINER = 1 << 23,\n CONTENTS = 1 << 24,\n INLINE_BLOCK = 1 << 25,\n INLINE_LIST_ITEM = 1 << 26,\n INLINE_TABLE = 1 << 27,\n INLINE_FLEX = 1 << 28,\n INLINE_GRID = 1 << 29\n}\n\nexport type Display = number;\n\nexport const display: IPropertyListDescriptor<Display> = {\n name: 'display',\n initialValue: 'inline-block',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]): Display => {\n return tokens.filter(isIdentToken).reduce((bit, token) => {\n return bit | parseDisplayValue(token.value);\n }, DISPLAY.NONE);\n }\n};\n\nconst parseDisplayValue = (display: string): Display => {\n switch (display) {\n case 'block':\n case '-webkit-box':\n return DISPLAY.BLOCK;\n case 'inline':\n return DISPLAY.INLINE;\n case 'run-in':\n return DISPLAY.RUN_IN;\n case 'flow':\n return DISPLAY.FLOW;\n case 'flow-root':\n return DISPLAY.FLOW_ROOT;\n case 'table':\n return DISPLAY.TABLE;\n case 'flex':\n case '-webkit-flex':\n return DISPLAY.FLEX;\n case 'grid':\n case '-ms-grid':\n return DISPLAY.GRID;\n case 'ruby':\n return DISPLAY.RUBY;\n case 'subgrid':\n return DISPLAY.SUBGRID;\n case 'list-item':\n return DISPLAY.LIST_ITEM;\n case 'table-row-group':\n return DISPLAY.TABLE_ROW_GROUP;\n case 'table-header-group':\n return DISPLAY.TABLE_HEADER_GROUP;\n case 'table-footer-group':\n return DISPLAY.TABLE_FOOTER_GROUP;\n case 'table-row':\n return DISPLAY.TABLE_ROW;\n case 'table-cell':\n return DISPLAY.TABLE_CELL;\n case 'table-column-group':\n return DISPLAY.TABLE_COLUMN_GROUP;\n case 'table-column':\n return DISPLAY.TABLE_COLUMN;\n case 'table-caption':\n return DISPLAY.TABLE_CAPTION;\n case 'ruby-base':\n return DISPLAY.RUBY_BASE;\n case 'ruby-text':\n return DISPLAY.RUBY_TEXT;\n case 'ruby-base-container':\n return DISPLAY.RUBY_BASE_CONTAINER;\n case 'ruby-text-container':\n return DISPLAY.RUBY_TEXT_CONTAINER;\n case 'contents':\n return DISPLAY.CONTENTS;\n case 'inline-block':\n return DISPLAY.INLINE_BLOCK;\n case 'inline-list-item':\n return DISPLAY.INLINE_LIST_ITEM;\n case 'inline-table':\n return DISPLAY.INLINE_TABLE;\n case 'inline-flex':\n return DISPLAY.INLINE_FLEX;\n case 'inline-grid':\n return DISPLAY.INLINE_GRID;\n }\n\n return DISPLAY.NONE;\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport const enum FLOAT {\n NONE = 0,\n LEFT = 1,\n RIGHT = 2,\n INLINE_START = 3,\n INLINE_END = 4\n}\n\nexport const float: IPropertyIdentValueDescriptor<FLOAT> = {\n name: 'float',\n initialValue: 'none',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, float: string) => {\n switch (float) {\n case 'left':\n return FLOAT.LEFT;\n case 'right':\n return FLOAT.RIGHT;\n case 'inline-start':\n return FLOAT.INLINE_START;\n case 'inline-end':\n return FLOAT.INLINE_END;\n }\n return FLOAT.NONE;\n }\n};\n","import { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue } from '../syntax/parser';\nimport { TokenType } from '../syntax/tokenizer';\nimport { Context } from '../../core/context';\nexport const letterSpacing: IPropertyValueDescriptor<number> = {\n name: 'letter-spacing',\n initialValue: '0',\n prefix: false,\n type: PropertyDescriptorParsingType.VALUE,\n parse: (_context: Context, token: CSSValue) => {\n if (token.type === TokenType.IDENT_TOKEN && token.value === 'normal') {\n return 0;\n }\n\n if (token.type === TokenType.NUMBER_TOKEN) {\n return token.number;\n }\n\n if (token.type === TokenType.DIMENSION_TOKEN) {\n return token.number;\n }\n\n return 0;\n }\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport enum LINE_BREAK {\n NORMAL = 'normal',\n STRICT = 'strict'\n}\n\nexport const lineBreak: IPropertyIdentValueDescriptor<LINE_BREAK> = {\n name: 'line-break',\n initialValue: 'normal',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, lineBreak: string): LINE_BREAK => {\n switch (lineBreak) {\n case 'strict':\n return LINE_BREAK.STRICT;\n case 'normal':\n default:\n return LINE_BREAK.NORMAL;\n }\n }\n};\n","import { IPropertyTokenValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken } from '../syntax/parser';\nimport { TokenType } from '../syntax/tokenizer';\nimport { getAbsoluteValue, isLengthPercentage } from '../types/length-percentage';\nexport const lineHeight: IPropertyTokenValueDescriptor = {\n name: 'line-height',\n initialValue: 'normal',\n prefix: false,\n type: PropertyDescriptorParsingType.TOKEN_VALUE\n};\n\nexport const computeLineHeight = (token: CSSValue, fontSize: number): number => {\n if (isIdentToken(token) && token.value === 'normal') {\n return 1.2 * fontSize;\n } else if (token.type === TokenType.NUMBER_TOKEN) {\n return fontSize * token.number;\n } else if (isLengthPercentage(token)) {\n return getAbsoluteValue(token, fontSize);\n }\n\n return fontSize;\n};\n","import { TokenType } from '../syntax/tokenizer';\nimport { ICSSImage, image } from '../types/image';\nimport { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue } from '../syntax/parser';\nimport { Context } from '../../core/context';\n\nexport const listStyleImage: IPropertyValueDescriptor<ICSSImage | null> = {\n name: 'list-style-image',\n initialValue: 'none',\n type: PropertyDescriptorParsingType.VALUE,\n prefix: false,\n parse: (context: Context, token: CSSValue) => {\n if (token.type === TokenType.IDENT_TOKEN && token.value === 'none') {\n return null;\n }\n\n return image.parse(context, token);\n }\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport const enum LIST_STYLE_POSITION {\n INSIDE = 0,\n OUTSIDE = 1\n}\n\nexport const listStylePosition: IPropertyIdentValueDescriptor<LIST_STYLE_POSITION> = {\n name: 'list-style-position',\n initialValue: 'outside',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, position: string) => {\n switch (position) {\n case 'inside':\n return LIST_STYLE_POSITION.INSIDE;\n case 'outside':\n default:\n return LIST_STYLE_POSITION.OUTSIDE;\n }\n }\n};\n","import { Context } from '../../core/context';\nimport { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nexport const enum LIST_STYLE_TYPE {\n NONE = -1,\n DISC = 0,\n CIRCLE = 1,\n SQUARE = 2,\n DECIMAL = 3,\n CJK_DECIMAL = 4,\n DECIMAL_LEADING_ZERO = 5,\n LOWER_ROMAN = 6,\n UPPER_ROMAN = 7,\n LOWER_GREEK = 8,\n LOWER_ALPHA = 9,\n UPPER_ALPHA = 10,\n ARABIC_INDIC = 11,\n ARMENIAN = 12,\n BENGALI = 13,\n CAMBODIAN = 14,\n CJK_EARTHLY_BRANCH = 15,\n CJK_HEAVENLY_STEM = 16,\n CJK_IDEOGRAPHIC = 17,\n DEVANAGARI = 18,\n ETHIOPIC_NUMERIC = 19,\n GEORGIAN = 20,\n GUJARATI = 21,\n GURMUKHI = 22,\n HIRAGANA = 23,\n HIRAGANA_IROHA = 24,\n JAPANESE_FORMAL = 25,\n JAPANESE_INFORMAL = 26,\n KANNADA = 27,\n KATAKANA = 28,\n KATAKANA_IROHA = 29,\n KHMER = 30,\n KOREAN_HANGUL_FORMAL = 31,\n KOREAN_HANJA_FORMAL = 32,\n KOREAN_HANJA_INFORMAL = 33,\n LAO = 34,\n LOWER_ARMENIAN = 35,\n MALAYALAM = 36,\n MONGOLIAN = 37,\n MYANMAR = 38,\n ORIYA = 39,\n PERSIAN = 40,\n SIMP_CHINESE_FORMAL = 41,\n SIMP_CHINESE_INFORMAL = 42,\n TAMIL = 43,\n TELUGU = 44,\n THAI = 45,\n TIBETAN = 46,\n TRAD_CHINESE_FORMAL = 47,\n TRAD_CHINESE_INFORMAL = 48,\n UPPER_ARMENIAN = 49,\n DISCLOSURE_OPEN = 50,\n DISCLOSURE_CLOSED = 51,\n // This was originally 22, duplicating GURMUKHI.\n HEBREW = 52\n}\n\nexport const listStyleType: IPropertyIdentValueDescriptor<LIST_STYLE_TYPE> = {\n name: 'list-style-type',\n initialValue: 'none',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, type: string) => {\n switch (type) {\n case 'disc':\n return LIST_STYLE_TYPE.DISC;\n case 'circle':\n return LIST_STYLE_TYPE.CIRCLE;\n case 'square':\n return LIST_STYLE_TYPE.SQUARE;\n case 'decimal':\n return LIST_STYLE_TYPE.DECIMAL;\n case 'cjk-decimal':\n return LIST_STYLE_TYPE.CJK_DECIMAL;\n case 'decimal-leading-zero':\n return LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO;\n case 'lower-roman':\n return LIST_STYLE_TYPE.LOWER_ROMAN;\n case 'upper-roman':\n return LIST_STYLE_TYPE.UPPER_ROMAN;\n case 'lower-greek':\n return LIST_STYLE_TYPE.LOWER_GREEK;\n case 'lower-alpha':\n return LIST_STYLE_TYPE.LOWER_ALPHA;\n case 'upper-alpha':\n return LIST_STYLE_TYPE.UPPER_ALPHA;\n case 'arabic-indic':\n return LIST_STYLE_TYPE.ARABIC_INDIC;\n case 'armenian':\n return LIST_STYLE_TYPE.ARMENIAN;\n case 'bengali':\n return LIST_STYLE_TYPE.BENGALI;\n case 'cambodian':\n return LIST_STYLE_TYPE.CAMBODIAN;\n case 'cjk-earthly-branch':\n return LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH;\n case 'cjk-heavenly-stem':\n return LIST_STYLE_TYPE.CJK_HEAVENLY_STEM;\n case 'cjk-ideographic':\n return LIST_STYLE_TYPE.CJK_IDEOGRAPHIC;\n case 'devanagari':\n return LIST_STYLE_TYPE.DEVANAGARI;\n case 'ethiopic-numeric':\n return LIST_STYLE_TYPE.ETHIOPIC_NUMERIC;\n case 'georgian':\n return LIST_STYLE_TYPE.GEORGIAN;\n case 'gujarati':\n return LIST_STYLE_TYPE.GUJARATI;\n case 'gurmukhi':\n return LIST_STYLE_TYPE.GURMUKHI;\n case 'hebrew':\n return LIST_STYLE_TYPE.HEBREW;\n case 'hiragana':\n return LIST_STYLE_TYPE.HIRAGANA;\n case 'hiragana-iroha':\n return LIST_STYLE_TYPE.HIRAGANA_IROHA;\n case 'japanese-formal':\n return LIST_STYLE_TYPE.JAPANESE_FORMAL;\n case 'japanese-informal':\n return LIST_STYLE_TYPE.JAPANESE_INFORMAL;\n case 'kannada':\n return LIST_STYLE_TYPE.KANNADA;\n case 'katakana':\n return LIST_STYLE_TYPE.KATAKANA;\n case 'katakana-iroha':\n return LIST_STYLE_TYPE.KATAKANA_IROHA;\n case 'khmer':\n return LIST_STYLE_TYPE.KHMER;\n case 'korean-hangul-formal':\n return LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL;\n case 'korean-hanja-formal':\n return LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL;\n case 'korean-hanja-informal':\n return LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL;\n case 'lao':\n return LIST_STYLE_TYPE.LAO;\n case 'lower-armenian':\n return LIST_STYLE_TYPE.LOWER_ARMENIAN;\n case 'malayalam':\n return LIST_STYLE_TYPE.MALAYALAM;\n case 'mongolian':\n return LIST_STYLE_TYPE.MONGOLIAN;\n case 'myanmar':\n return LIST_STYLE_TYPE.MYANMAR;\n case 'oriya':\n return LIST_STYLE_TYPE.ORIYA;\n case 'persian':\n return LIST_STYLE_TYPE.PERSIAN;\n case 'simp-chinese-formal':\n return LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL;\n case 'simp-chinese-informal':\n return LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL;\n case 'tamil':\n return LIST_STYLE_TYPE.TAMIL;\n case 'telugu':\n return LIST_STYLE_TYPE.TELUGU;\n case 'thai':\n return LIST_STYLE_TYPE.THAI;\n case 'tibetan':\n return LIST_STYLE_TYPE.TIBETAN;\n case 'trad-chinese-formal':\n return LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL;\n case 'trad-chinese-informal':\n return LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL;\n case 'upper-armenian':\n return LIST_STYLE_TYPE.UPPER_ARMENIAN;\n case 'disclosure-open':\n return LIST_STYLE_TYPE.DISCLOSURE_OPEN;\n case 'disclosure-closed':\n return LIST_STYLE_TYPE.DISCLOSURE_CLOSED;\n case 'none':\n default:\n return LIST_STYLE_TYPE.NONE;\n }\n }\n};\n","import { IPropertyTokenValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\n\nconst marginForSide = (side: string): IPropertyTokenValueDescriptor => ({\n name: `margin-${side}`,\n initialValue: '0',\n prefix: false,\n type: PropertyDescriptorParsingType.TOKEN_VALUE\n});\n\nexport const marginTop: IPropertyTokenValueDescriptor = marginForSide('top');\nexport const marginRight: IPropertyTokenValueDescriptor = marginForSide('right');\nexport const marginBottom: IPropertyTokenValueDescriptor = marginForSide('bottom');\nexport const marginLeft: IPropertyTokenValueDescriptor = marginForSide('left');\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\nexport const enum OVERFLOW {\n VISIBLE = 0,\n HIDDEN = 1,\n SCROLL = 2,\n CLIP = 3,\n AUTO = 4\n}\n\nexport const overflow: IPropertyListDescriptor<OVERFLOW[]> = {\n name: 'overflow',\n initialValue: 'visible',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]): OVERFLOW[] => {\n return tokens.filter(isIdentToken).map((overflow) => {\n switch (overflow.value) {\n case 'hidden':\n return OVERFLOW.HIDDEN;\n case 'scroll':\n return OVERFLOW.SCROLL;\n case 'clip':\n return OVERFLOW.CLIP;\n case 'auto':\n return OVERFLOW.AUTO;\n case 'visible':\n default:\n return OVERFLOW.VISIBLE;\n }\n });\n }\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport const enum OVERFLOW_WRAP {\n NORMAL = 'normal',\n BREAK_WORD = 'break-word'\n}\n\nexport const overflowWrap: IPropertyIdentValueDescriptor<OVERFLOW_WRAP> = {\n name: 'overflow-wrap',\n initialValue: 'normal',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, overflow: string) => {\n switch (overflow) {\n case 'break-word':\n return OVERFLOW_WRAP.BREAK_WORD;\n case 'normal':\n default:\n return OVERFLOW_WRAP.NORMAL;\n }\n }\n};\n","import { IPropertyTypeValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\n\nconst paddingForSide = (side: string): IPropertyTypeValueDescriptor => ({\n name: `padding-${side}`,\n initialValue: '0',\n prefix: false,\n type: PropertyDescriptorParsingType.TYPE_VALUE,\n format: 'length-percentage'\n});\n\nexport const paddingTop: IPropertyTypeValueDescriptor = paddingForSide('top');\nexport const paddingRight: IPropertyTypeValueDescriptor = paddingForSide('right');\nexport const paddingBottom: IPropertyTypeValueDescriptor = paddingForSide('bottom');\nexport const paddingLeft: IPropertyTypeValueDescriptor = paddingForSide('left');\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport const enum TEXT_ALIGN {\n LEFT = 0,\n CENTER = 1,\n RIGHT = 2\n}\n\nexport const textAlign: IPropertyIdentValueDescriptor<TEXT_ALIGN> = {\n name: 'text-align',\n initialValue: 'left',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, textAlign: string) => {\n switch (textAlign) {\n case 'right':\n return TEXT_ALIGN.RIGHT;\n case 'center':\n case 'justify':\n return TEXT_ALIGN.CENTER;\n case 'left':\n default:\n return TEXT_ALIGN.LEFT;\n }\n }\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport const enum POSITION {\n STATIC = 0,\n RELATIVE = 1,\n ABSOLUTE = 2,\n FIXED = 3,\n STICKY = 4\n}\n\nexport const position: IPropertyIdentValueDescriptor<POSITION> = {\n name: 'position',\n initialValue: 'static',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, position: string) => {\n switch (position) {\n case 'relative':\n return POSITION.RELATIVE;\n case 'absolute':\n return POSITION.ABSOLUTE;\n case 'fixed':\n return POSITION.FIXED;\n case 'sticky':\n return POSITION.STICKY;\n }\n\n return POSITION.STATIC;\n }\n};\n","import { PropertyDescriptorParsingType, IPropertyListDescriptor } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentWithValue, parseFunctionArgs } from '../syntax/parser';\nimport { ZERO_LENGTH } from '../types/length-percentage';\nimport { color, Color, COLORS } from '../types/color';\nimport { isLength, Length } from '../types/length';\nimport { Context } from '../../core/context';\n\nexport type TextShadow = TextShadowItem[];\ninterface TextShadowItem {\n color: Color;\n offsetX: Length;\n offsetY: Length;\n blur: Length;\n}\n\nexport const textShadow: IPropertyListDescriptor<TextShadow> = {\n name: 'text-shadow',\n initialValue: 'none',\n type: PropertyDescriptorParsingType.LIST,\n prefix: false,\n parse: (context: Context, tokens: CSSValue[]): TextShadow => {\n if (tokens.length === 1 && isIdentWithValue(tokens[0], 'none')) {\n return [];\n }\n\n return parseFunctionArgs(tokens).map((values: CSSValue[]) => {\n const shadow: TextShadowItem = {\n color: COLORS.TRANSPARENT,\n offsetX: ZERO_LENGTH,\n offsetY: ZERO_LENGTH,\n blur: ZERO_LENGTH\n };\n let c = 0;\n for (let i = 0; i < values.length; i++) {\n const token = values[i];\n if (isLength(token)) {\n if (c === 0) {\n shadow.offsetX = token;\n } else if (c === 1) {\n shadow.offsetY = token;\n } else {\n shadow.blur = token;\n }\n c++;\n } else {\n shadow.color = color.parse(context, token);\n }\n }\n return shadow;\n });\n }\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport const enum TEXT_TRANSFORM {\n NONE = 0,\n LOWERCASE = 1,\n UPPERCASE = 2,\n CAPITALIZE = 3\n}\n\nexport const textTransform: IPropertyIdentValueDescriptor<TEXT_TRANSFORM> = {\n name: 'text-transform',\n initialValue: 'none',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, textTransform: string) => {\n switch (textTransform) {\n case 'uppercase':\n return TEXT_TRANSFORM.UPPERCASE;\n case 'lowercase':\n return TEXT_TRANSFORM.LOWERCASE;\n case 'capitalize':\n return TEXT_TRANSFORM.CAPITALIZE;\n }\n\n return TEXT_TRANSFORM.NONE;\n }\n};\n","import { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue } from '../syntax/parser';\nimport { NumberValueToken, TokenType } from '../syntax/tokenizer';\nimport { Context } from '../../core/context';\nimport { angle } from '../types/angle';\nexport type Matrix = [number, number, number, number, number, number];\nexport type Transform = Matrix | null;\n\nexport const transform: IPropertyValueDescriptor<Transform> = {\n name: 'transform',\n initialValue: 'none',\n prefix: true,\n type: PropertyDescriptorParsingType.VALUE,\n parse: (_context: Context, token: CSSValue) => {\n if (token.type === TokenType.IDENT_TOKEN && token.value === 'none') {\n return null;\n }\n\n if (token.type === TokenType.FUNCTION) {\n const transformFunction = SUPPORTED_TRANSFORM_FUNCTIONS[token.name];\n if (typeof transformFunction === 'undefined') {\n throw new Error(`Attempting to parse an unsupported transform function \"${token.name}\"`);\n }\n return transformFunction(_context, token.values);\n }\n\n return null;\n }\n};\n\nconst matrix = (_context: Context, args: CSSValue[]): Transform => {\n const values = args.filter((arg) => arg.type === TokenType.NUMBER_TOKEN).map((arg: NumberValueToken) => arg.number);\n\n return values.length === 6 ? (values as Matrix) : null;\n};\n\n// doesn't support 3D transforms at the moment\nconst matrix3d = (_context: Context, args: CSSValue[]): Transform => {\n const values = args.filter((arg) => arg.type === TokenType.NUMBER_TOKEN).map((arg: NumberValueToken) => arg.number);\n\n const [a1, b1, {}, {}, a2, b2, {}, {}, {}, {}, {}, {}, a4, b4, {}, {}] = values;\n\n return values.length === 16 ? [a1, b1, a2, b2, a4, b4] : null;\n};\n\nconst rotate = (context: Context, args: CSSValue[]): Transform => {\n if (args.length !== 1) {\n return null;\n }\n\n const arg = args[0];\n let radians = 0;\n\n if (arg.type === TokenType.NUMBER_TOKEN && arg.number === 0) {\n radians = 0;\n } else if (arg.type === TokenType.DIMENSION_TOKEN) {\n radians = angle.parse(context, arg);\n } else {\n return null;\n }\n\n const cos = Math.cos(radians);\n const sin = Math.sin(radians);\n\n return [cos, sin, -sin, cos, 0, 0];\n};\n\nconst SUPPORTED_TRANSFORM_FUNCTIONS: {\n [key: string]: (context: Context, args: CSSValue[]) => Transform;\n} = {\n matrix: matrix,\n matrix3d: matrix3d,\n rotate: rotate\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue } from '../syntax/parser';\nimport { isLengthPercentage, LengthPercentage } from '../types/length-percentage';\nimport { FLAG_INTEGER, TokenType } from '../syntax/tokenizer';\nimport { Context } from '../../core/context';\nexport type TransformOrigin = [LengthPercentage, LengthPercentage];\n\nconst DEFAULT_VALUE: LengthPercentage = {\n type: TokenType.PERCENTAGE_TOKEN,\n number: 50,\n flags: FLAG_INTEGER\n};\nconst DEFAULT: TransformOrigin = [DEFAULT_VALUE, DEFAULT_VALUE];\n\nexport const transformOrigin: IPropertyListDescriptor<TransformOrigin> = {\n name: 'transform-origin',\n initialValue: '50% 50%',\n prefix: true,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]) => {\n const origins: LengthPercentage[] = tokens.filter(isLengthPercentage);\n\n if (origins.length !== 2) {\n return DEFAULT;\n }\n\n return [origins[0], origins[1]];\n }\n};\n","import { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue } from '../syntax/parser';\nimport { TokenType } from '../syntax/tokenizer';\nimport { Context } from '../../core/context';\nimport { angle } from '../types/angle';\n\nexport type Rotate = number | null;\n\nexport const rotate: IPropertyValueDescriptor<Rotate> = {\n name: 'rotate',\n initialValue: 'none',\n prefix: false,\n type: PropertyDescriptorParsingType.VALUE,\n parse: (_context: Context, token: CSSValue): Rotate => {\n if (token.type === TokenType.IDENT_TOKEN && token.value === 'none') {\n return null;\n }\n\n if (token.type === TokenType.NUMBER_TOKEN) {\n if (token.number === 0) {\n return 0;\n }\n }\n\n if (token.type === TokenType.DIMENSION_TOKEN) {\n // Parse angle and convert to degrees for storage\n const radians = angle.parse(_context, token);\n // Store as degrees for consistency\n return (radians * 180) / Math.PI;\n }\n\n return null;\n }\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport const enum VISIBILITY {\n VISIBLE = 0,\n HIDDEN = 1,\n COLLAPSE = 2\n}\n\nexport const visibility: IPropertyIdentValueDescriptor<VISIBILITY> = {\n name: 'visible',\n initialValue: 'none',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, visibility: string) => {\n switch (visibility) {\n case 'hidden':\n return VISIBILITY.HIDDEN;\n case 'collapse':\n return VISIBILITY.COLLAPSE;\n case 'visible':\n default:\n return VISIBILITY.VISIBLE;\n }\n }\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport enum WORD_BREAK {\n NORMAL = 'normal',\n BREAK_ALL = 'break-all',\n KEEP_ALL = 'keep-all'\n}\n\nexport const wordBreak: IPropertyIdentValueDescriptor<WORD_BREAK> = {\n name: 'word-break',\n initialValue: 'normal',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, wordBreak: string): WORD_BREAK => {\n switch (wordBreak) {\n case 'break-all':\n return WORD_BREAK.BREAK_ALL;\n case 'keep-all':\n return WORD_BREAK.KEEP_ALL;\n case 'normal':\n default:\n return WORD_BREAK.NORMAL;\n }\n }\n};\n","import { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isNumberToken } from '../syntax/parser';\nimport { TokenType } from '../syntax/tokenizer';\nimport { Context } from '../../core/context';\n\ninterface zIndex {\n order: number;\n auto: boolean;\n}\n\nexport const zIndex: IPropertyValueDescriptor<zIndex> = {\n name: 'z-index',\n initialValue: 'auto',\n prefix: false,\n type: PropertyDescriptorParsingType.VALUE,\n parse: (_context: Context, token: CSSValue): zIndex => {\n if (token.type === TokenType.IDENT_TOKEN) {\n return { auto: true, order: 0 };\n }\n\n if (isNumberToken(token)) {\n return { auto: false, order: token.number };\n }\n\n throw new Error(`Invalid z-index number parsed`);\n }\n};\n","import { CSSValue } from '../syntax/parser';\nimport { TokenType } from '../syntax/tokenizer';\nimport { ITypeDescriptor } from '../ITypeDescriptor';\nimport { Context } from '../../core/context';\n\nexport const time: ITypeDescriptor<number> = {\n name: 'time',\n parse: (_context: Context, value: CSSValue): number => {\n if (value.type === TokenType.DIMENSION_TOKEN) {\n switch (value.unit.toLowerCase()) {\n case 's':\n return 1000 * value.number;\n case 'ms':\n return value.number;\n }\n }\n\n throw new Error(`Unsupported time type`);\n }\n};\n","import { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isNumberToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\nexport const opacity: IPropertyValueDescriptor<number> = {\n name: 'opacity',\n initialValue: '1',\n type: PropertyDescriptorParsingType.VALUE,\n prefix: false,\n parse: (_context: Context, token: CSSValue): number => {\n if (isNumberToken(token)) {\n return token.number;\n }\n return 1;\n }\n};\n","import { IPropertyTypeValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\n\nexport const textDecorationColor: IPropertyTypeValueDescriptor = {\n name: `text-decoration-color`,\n initialValue: 'transparent',\n prefix: false,\n type: PropertyDescriptorParsingType.TYPE_VALUE,\n format: 'color'\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\n\nexport const enum TEXT_DECORATION_LINE {\n NONE = 0,\n UNDERLINE = 1,\n OVERLINE = 2,\n LINE_THROUGH = 3,\n BLINK = 4\n}\n\nexport type TextDecorationLine = TEXT_DECORATION_LINE[];\n\nexport const textDecorationLine: IPropertyListDescriptor<TextDecorationLine> = {\n name: 'text-decoration-line',\n initialValue: 'none',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]): TextDecorationLine => {\n return tokens\n .filter(isIdentToken)\n .map((token) => {\n switch (token.value) {\n case 'underline':\n return TEXT_DECORATION_LINE.UNDERLINE;\n case 'overline':\n return TEXT_DECORATION_LINE.OVERLINE;\n case 'line-through':\n return TEXT_DECORATION_LINE.LINE_THROUGH;\n case 'none':\n return TEXT_DECORATION_LINE.BLINK;\n }\n return TEXT_DECORATION_LINE.NONE;\n })\n .filter((line) => line !== TEXT_DECORATION_LINE.NONE);\n }\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\n\nexport const enum TEXT_DECORATION_STYLE {\n SOLID = 0,\n DOUBLE = 1,\n DOTTED = 2,\n DASHED = 3,\n WAVY = 4\n}\n\nexport const textDecorationStyle: IPropertyIdentValueDescriptor<TEXT_DECORATION_STYLE> = {\n name: 'text-decoration-style',\n initialValue: 'solid',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, style: string): TEXT_DECORATION_STYLE => {\n switch (style) {\n case 'double':\n return TEXT_DECORATION_STYLE.DOUBLE;\n case 'dotted':\n return TEXT_DECORATION_STYLE.DOTTED;\n case 'dashed':\n return TEXT_DECORATION_STYLE.DASHED;\n case 'wavy':\n return TEXT_DECORATION_STYLE.WAVY;\n case 'solid':\n default:\n return TEXT_DECORATION_STYLE.SOLID;\n }\n }\n};\n","import { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken, isDimensionToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\n\nexport type TextDecorationThickness = number | 'auto' | 'from-font';\n\nexport const textDecorationThickness: IPropertyValueDescriptor<TextDecorationThickness> = {\n name: 'text-decoration-thickness',\n initialValue: 'auto',\n prefix: false,\n type: PropertyDescriptorParsingType.VALUE,\n parse: (_context: Context, token: CSSValue): TextDecorationThickness => {\n if (isIdentToken(token)) {\n switch (token.value) {\n case 'auto':\n return 'auto';\n case 'from-font':\n return 'from-font';\n }\n }\n\n if (isDimensionToken(token)) {\n // Convert to pixels\n return token.number;\n }\n\n // Default to auto\n return 'auto';\n }\n};\n","import { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken, isDimensionToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\n\nexport type TextUnderlineOffset = number | 'auto';\n\nexport const textUnderlineOffset: IPropertyValueDescriptor<TextUnderlineOffset> = {\n name: 'text-underline-offset',\n initialValue: 'auto',\n prefix: false,\n type: PropertyDescriptorParsingType.VALUE,\n parse: (_context: Context, token: CSSValue): TextUnderlineOffset => {\n if (isIdentToken(token)) {\n if (token.value === 'auto') {\n return 'auto';\n }\n }\n\n if (isDimensionToken(token)) {\n // Return pixel value\n return token.number;\n }\n\n // Default to auto\n return 'auto';\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue } from '../syntax/parser';\nimport { TokenType } from '../syntax/tokenizer';\nimport { Context } from '../../core/context';\n\nexport type FONT_FAMILY = string;\n\nexport type FontFamily = FONT_FAMILY[];\n\nexport const fontFamily: IPropertyListDescriptor<FontFamily> = {\n name: `font-family`,\n initialValue: '',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]) => {\n const accumulator: string[] = [];\n const results: string[] = [];\n tokens.forEach((token) => {\n switch (token.type) {\n case TokenType.IDENT_TOKEN:\n case TokenType.STRING_TOKEN:\n accumulator.push(token.value);\n break;\n case TokenType.NUMBER_TOKEN:\n accumulator.push(token.number.toString());\n break;\n case TokenType.COMMA_TOKEN:\n results.push(accumulator.join(' '));\n accumulator.length = 0;\n break;\n }\n });\n if (accumulator.length) {\n results.push(accumulator.join(' '));\n }\n return results.map((result) => (result.indexOf(' ') === -1 ? result : `'${result}'`));\n }\n};\n","import { IPropertyTypeValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\n\nexport const fontSize: IPropertyTypeValueDescriptor = {\n name: `font-size`,\n initialValue: '0',\n prefix: false,\n type: PropertyDescriptorParsingType.TYPE_VALUE,\n format: 'length'\n};\n","import { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken, isNumberToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\nexport const fontWeight: IPropertyValueDescriptor<number> = {\n name: 'font-weight',\n initialValue: 'normal',\n type: PropertyDescriptorParsingType.VALUE,\n prefix: false,\n parse: (_context: Context, token: CSSValue): number => {\n if (isNumberToken(token)) {\n return token.number;\n }\n\n if (isIdentToken(token)) {\n switch (token.value) {\n case 'bold':\n return 700;\n case 'normal':\n default:\n return 400;\n }\n }\n\n return 400;\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\nexport const fontVariant: IPropertyListDescriptor<string[]> = {\n name: 'font-variant',\n initialValue: 'none',\n type: PropertyDescriptorParsingType.LIST,\n prefix: false,\n parse: (_context: Context, tokens: CSSValue[]): string[] => {\n return tokens.filter(isIdentToken).map((token) => token.value);\n }\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport const enum FONT_STYLE {\n NORMAL = 'normal',\n ITALIC = 'italic',\n OBLIQUE = 'oblique'\n}\n\nexport const fontStyle: IPropertyIdentValueDescriptor<FONT_STYLE> = {\n name: 'font-style',\n initialValue: 'normal',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, overflow: string) => {\n switch (overflow) {\n case 'oblique':\n return FONT_STYLE.OBLIQUE;\n case 'italic':\n return FONT_STYLE.ITALIC;\n case 'normal':\n default:\n return FONT_STYLE.NORMAL;\n }\n }\n};\n","export const contains = (bit: number, value: number): boolean => (bit & value) !== 0;\n","import { TokenType } from '../syntax/tokenizer';\nimport { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue } from '../syntax/parser';\nimport { Context } from '../../core/context';\n\nexport type Content = CSSValue[];\n\nexport const content: IPropertyListDescriptor<Content> = {\n name: 'content',\n initialValue: 'none',\n type: PropertyDescriptorParsingType.LIST,\n prefix: false,\n parse: (_context: Context, tokens: CSSValue[]) => {\n if (tokens.length === 0) {\n return [];\n }\n\n const first = tokens[0];\n\n if (first.type === TokenType.IDENT_TOKEN && first.value === 'none') {\n return [];\n }\n\n return tokens;\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isNumberToken, nonWhiteSpace } from '../syntax/parser';\nimport { TokenType } from '../syntax/tokenizer';\nimport { Context } from '../../core/context';\n\nexport interface COUNTER_INCREMENT {\n counter: string;\n increment: number;\n}\n\nexport type CounterIncrement = COUNTER_INCREMENT[] | null;\n\nexport const counterIncrement: IPropertyListDescriptor<CounterIncrement> = {\n name: 'counter-increment',\n initialValue: 'none',\n prefix: true,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]) => {\n if (tokens.length === 0) {\n return null;\n }\n\n const first = tokens[0];\n\n if (first.type === TokenType.IDENT_TOKEN && first.value === 'none') {\n return null;\n }\n\n const increments = [];\n const filtered = tokens.filter(nonWhiteSpace);\n\n for (let i = 0; i < filtered.length; i++) {\n const counter = filtered[i];\n const next = filtered[i + 1];\n if (counter.type === TokenType.IDENT_TOKEN) {\n const increment = next && isNumberToken(next) ? next.number : 1;\n increments.push({ counter: counter.value, increment });\n }\n }\n\n return increments;\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken, isNumberToken, nonWhiteSpace } from '../syntax/parser';\nimport { Context } from '../../core/context';\n\nexport interface COUNTER_RESET {\n counter: string;\n reset: number;\n}\n\nexport type CounterReset = COUNTER_RESET[];\n\nexport const counterReset: IPropertyListDescriptor<CounterReset> = {\n name: 'counter-reset',\n initialValue: 'none',\n prefix: true,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]) => {\n if (tokens.length === 0) {\n return [];\n }\n\n const resets = [];\n const filtered = tokens.filter(nonWhiteSpace);\n\n for (let i = 0; i < filtered.length; i++) {\n const counter = filtered[i];\n const next = filtered[i + 1];\n if (isIdentToken(counter) && counter.value !== 'none') {\n const reset = next && isNumberToken(next) ? next.number : 0;\n resets.push({ counter: counter.value, reset });\n }\n }\n\n return resets;\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nimport { CSSValue, isDimensionToken } from '../syntax/parser';\nimport { time } from '../types/time';\n\nexport const duration: IPropertyListDescriptor<number[]> = {\n name: 'duration',\n initialValue: '0s',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (context: Context, tokens: CSSValue[]) => {\n return tokens.filter(isDimensionToken).map((token) => time.parse(context, token));\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isStringToken } from '../syntax/parser';\nimport { TokenType } from '../syntax/tokenizer';\nimport { Context } from '../../core/context';\n\nexport interface QUOTE {\n open: string;\n close: string;\n}\n\nexport type Quotes = QUOTE[] | null;\n\nexport const quotes: IPropertyListDescriptor<Quotes> = {\n name: 'quotes',\n initialValue: 'none',\n prefix: true,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]) => {\n if (tokens.length === 0) {\n return null;\n }\n\n const first = tokens[0];\n\n if (first.type === TokenType.IDENT_TOKEN && first.value === 'none') {\n return null;\n }\n\n const quotes = [];\n const filtered = tokens.filter(isStringToken);\n\n if (filtered.length % 2 !== 0) {\n return null;\n }\n\n for (let i = 0; i < filtered.length; i += 2) {\n const open = filtered[i].value;\n const close = filtered[i + 1].value;\n quotes.push({ open, close });\n }\n\n return quotes;\n }\n};\n\nexport const getQuote = (quotes: Quotes, depth: number, open: boolean): string => {\n if (!quotes) {\n return '';\n }\n\n const quote = quotes[Math.min(depth, quotes.length - 1)];\n if (!quote) {\n return '';\n }\n\n return open ? quote.open : quote.close;\n};\n","import { PropertyDescriptorParsingType, IPropertyListDescriptor } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentWithValue, parseFunctionArgs } from '../syntax/parser';\nimport { ZERO_LENGTH } from '../types/length-percentage';\nimport { color, Color } from '../types/color';\nimport { isLength, Length } from '../types/length';\nimport { Context } from '../../core/context';\n\nexport type BoxShadow = BoxShadowItem[];\ninterface BoxShadowItem {\n inset: boolean;\n color: Color;\n offsetX: Length;\n offsetY: Length;\n blur: Length;\n spread: Length;\n}\n\nexport const boxShadow: IPropertyListDescriptor<BoxShadow> = {\n name: 'box-shadow',\n initialValue: 'none',\n type: PropertyDescriptorParsingType.LIST,\n prefix: false,\n parse: (context: Context, tokens: CSSValue[]): BoxShadow => {\n if (tokens.length === 1 && isIdentWithValue(tokens[0], 'none')) {\n return [];\n }\n\n return parseFunctionArgs(tokens).map((values: CSSValue[]) => {\n const shadow: BoxShadowItem = {\n color: 0x000000ff,\n offsetX: ZERO_LENGTH,\n offsetY: ZERO_LENGTH,\n blur: ZERO_LENGTH,\n spread: ZERO_LENGTH,\n inset: false\n };\n let c = 0;\n for (let i = 0; i < values.length; i++) {\n const token = values[i];\n if (isIdentWithValue(token, 'inset')) {\n shadow.inset = true;\n } else if (isLength(token)) {\n if (c === 0) {\n shadow.offsetX = token;\n } else if (c === 1) {\n shadow.offsetY = token;\n } else if (c === 2) {\n shadow.blur = token;\n } else {\n shadow.spread = token;\n }\n c++;\n } else {\n shadow.color = color.parse(context, token);\n }\n }\n return shadow;\n });\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\nexport const enum PAINT_ORDER_LAYER {\n FILL,\n STROKE,\n MARKERS\n}\n\nexport type PaintOrder = PAINT_ORDER_LAYER[];\n\nexport const paintOrder: IPropertyListDescriptor<PaintOrder> = {\n name: 'paint-order',\n initialValue: 'normal',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]): PaintOrder => {\n const DEFAULT_VALUE = [PAINT_ORDER_LAYER.FILL, PAINT_ORDER_LAYER.STROKE, PAINT_ORDER_LAYER.MARKERS];\n const layers: PaintOrder = [];\n\n tokens.filter(isIdentToken).forEach((token) => {\n switch (token.value) {\n case 'stroke':\n layers.push(PAINT_ORDER_LAYER.STROKE);\n break;\n case 'fill':\n layers.push(PAINT_ORDER_LAYER.FILL);\n break;\n case 'markers':\n layers.push(PAINT_ORDER_LAYER.MARKERS);\n break;\n }\n });\n DEFAULT_VALUE.forEach((value) => {\n if (layers.indexOf(value) === -1) {\n layers.push(value);\n }\n });\n\n return layers;\n }\n};\n","import { IPropertyTypeValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nexport const webkitTextStrokeColor: IPropertyTypeValueDescriptor = {\n name: `-webkit-text-stroke-color`,\n initialValue: 'currentcolor',\n prefix: false,\n type: PropertyDescriptorParsingType.TYPE_VALUE,\n format: 'color'\n};\n","import { CSSValue, isDimensionToken } from '../syntax/parser';\nimport { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport const webkitTextStrokeWidth: IPropertyValueDescriptor<number> = {\n name: `-webkit-text-stroke-width`,\n initialValue: '0',\n type: PropertyDescriptorParsingType.VALUE,\n prefix: false,\n parse: (_context: Context, token: CSSValue): number => {\n if (isDimensionToken(token)) {\n return token.number;\n }\n return 0;\n }\n};\n","import { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue } from '../syntax/parser';\nimport { TokenType } from '../syntax/tokenizer';\nimport { Context } from '../../core/context';\n\n/**\n * -webkit-line-clamp property descriptor\n * Used with display: -webkit-box and -webkit-box-orient: vertical\n * to limit text to a specific number of lines\n */\nexport const webkitLineClamp: IPropertyValueDescriptor<number> = {\n name: '-webkit-line-clamp',\n initialValue: 'none',\n prefix: true,\n type: PropertyDescriptorParsingType.VALUE,\n parse: (_context: Context, token: CSSValue) => {\n // 'none' means no line clamping\n if (token.type === TokenType.IDENT_TOKEN && token.value === 'none') {\n return 0;\n }\n\n // Number value specifies the number of lines\n if (token.type === TokenType.NUMBER_TOKEN) {\n return Math.max(0, Math.floor(token.number));\n }\n\n // Default to 0 (no clamping)\n return 0;\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\nexport const enum OBJECT_FIT {\n FILL = 0,\n CONTAIN = 1 << 1,\n COVER = 1 << 2,\n NONE = 1 << 3,\n SCALE_DOWN = 1 << 4\n}\n\nexport type ObjectFit = number;\n\nexport const objectFit: IPropertyListDescriptor<ObjectFit> = {\n name: 'objectFit',\n initialValue: 'fill',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]): ObjectFit => {\n return tokens.filter(isIdentToken).reduce((bit, token) => {\n return bit | parseDisplayValue(token.value);\n }, OBJECT_FIT.FILL);\n }\n};\n\nconst parseDisplayValue = (display: string): ObjectFit => {\n switch (display) {\n case 'contain':\n return OBJECT_FIT.CONTAIN;\n case 'cover':\n return OBJECT_FIT.COVER;\n case 'none':\n return OBJECT_FIT.NONE;\n case 'scale-down':\n return OBJECT_FIT.SCALE_DOWN;\n }\n\n return OBJECT_FIT.FILL;\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\n\nexport const enum TEXT_OVERFLOW {\n CLIP = 0,\n ELLIPSIS = 1\n}\n\nexport const textOverflow: IPropertyIdentValueDescriptor<TEXT_OVERFLOW> = {\n name: 'text-overflow',\n initialValue: 'clip',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, textOverflow: string) => {\n switch (textOverflow) {\n case 'ellipsis':\n return TEXT_OVERFLOW.ELLIPSIS;\n case 'clip':\n default:\n return TEXT_OVERFLOW.CLIP;\n }\n }\n};\n","import { CSSPropertyDescriptor, PropertyDescriptorParsingType } from './IPropertyDescriptor';\nimport { backgroundClip } from './property-descriptors/background-clip';\nimport { backgroundColor } from './property-descriptors/background-color';\nimport { backgroundImage } from './property-descriptors/background-image';\nimport { backgroundOrigin } from './property-descriptors/background-origin';\nimport { backgroundPosition } from './property-descriptors/background-position';\nimport { backgroundRepeat } from './property-descriptors/background-repeat';\nimport { backgroundSize } from './property-descriptors/background-size';\nimport {\n borderBottomColor,\n borderLeftColor,\n borderRightColor,\n borderTopColor\n} from './property-descriptors/border-color';\nimport {\n borderBottomLeftRadius,\n borderBottomRightRadius,\n borderTopLeftRadius,\n borderTopRightRadius\n} from './property-descriptors/border-radius';\nimport {\n borderBottomStyle,\n borderLeftStyle,\n borderRightStyle,\n borderTopStyle\n} from './property-descriptors/border-style';\nimport {\n borderBottomWidth,\n borderLeftWidth,\n borderRightWidth,\n borderTopWidth\n} from './property-descriptors/border-width';\nimport { color } from './property-descriptors/color';\nimport { direction } from './property-descriptors/direction';\nimport { display, DISPLAY } from './property-descriptors/display';\nimport { float, FLOAT } from './property-descriptors/float';\nimport { letterSpacing } from './property-descriptors/letter-spacing';\nimport { lineBreak } from './property-descriptors/line-break';\nimport { lineHeight } from './property-descriptors/line-height';\nimport { listStyleImage } from './property-descriptors/list-style-image';\nimport { listStylePosition } from './property-descriptors/list-style-position';\nimport { listStyleType } from './property-descriptors/list-style-type';\nimport { marginBottom, marginLeft, marginRight, marginTop } from './property-descriptors/margin';\nimport { overflow, OVERFLOW } from './property-descriptors/overflow';\nimport { overflowWrap } from './property-descriptors/overflow-wrap';\nimport { paddingBottom, paddingLeft, paddingRight, paddingTop } from './property-descriptors/padding';\nimport { textAlign } from './property-descriptors/text-align';\nimport { position, POSITION } from './property-descriptors/position';\nimport { textShadow } from './property-descriptors/text-shadow';\nimport { textTransform } from './property-descriptors/text-transform';\nimport { transform } from './property-descriptors/transform';\nimport { transformOrigin } from './property-descriptors/transform-origin';\nimport { rotate } from './property-descriptors/rotate';\nimport { visibility, VISIBILITY } from './property-descriptors/visibility';\nimport { wordBreak } from './property-descriptors/word-break';\nimport { zIndex } from './property-descriptors/z-index';\nimport { CSSValue, isIdentToken, Parser } from './syntax/parser';\nimport { Tokenizer } from './syntax/tokenizer';\nimport { Color, color as colorType } from './types/color';\nimport { isTransparent } from './types/color-utilities';\nimport { angle } from './types/angle';\nimport { image } from './types/image';\nimport { time } from './types/time';\nimport { opacity } from './property-descriptors/opacity';\nimport { textDecorationColor } from './property-descriptors/text-decoration-color';\nimport { textDecorationLine } from './property-descriptors/text-decoration-line';\nimport { textDecorationStyle } from './property-descriptors/text-decoration-style';\nimport { textDecorationThickness } from './property-descriptors/text-decoration-thickness';\nimport { textUnderlineOffset } from './property-descriptors/text-underline-offset';\nimport { isLengthPercentage, LengthPercentage, ZERO_LENGTH } from './types/length-percentage';\nimport { fontFamily } from './property-descriptors/font-family';\nimport { fontSize } from './property-descriptors/font-size';\nimport { isLength } from './types/length';\nimport { fontWeight } from './property-descriptors/font-weight';\nimport { fontVariant } from './property-descriptors/font-variant';\nimport { fontStyle } from './property-descriptors/font-style';\nimport { contains } from '../core/bitwise';\nimport { content } from './property-descriptors/content';\nimport { counterIncrement } from './property-descriptors/counter-increment';\nimport { counterReset } from './property-descriptors/counter-reset';\nimport { duration } from './property-descriptors/duration';\nimport { quotes } from './property-descriptors/quotes';\nimport { boxShadow } from './property-descriptors/box-shadow';\nimport { paintOrder } from './property-descriptors/paint-order';\nimport { webkitTextStrokeColor } from './property-descriptors/webkit-text-stroke-color';\nimport { webkitTextStrokeWidth } from './property-descriptors/webkit-text-stroke-width';\nimport { webkitLineClamp } from './property-descriptors/webkit-line-clamp';\nimport { Context } from '../core/context';\nimport { objectFit } from './property-descriptors/object-fit';\nimport { textOverflow } from './property-descriptors/text-overflow';\n\nexport class CSSParsedDeclaration {\n animationDuration: ReturnType<typeof duration.parse>;\n backgroundClip: ReturnType<typeof backgroundClip.parse>;\n backgroundColor: Color;\n backgroundImage: ReturnType<typeof backgroundImage.parse>;\n backgroundOrigin: ReturnType<typeof backgroundOrigin.parse>;\n backgroundPosition: ReturnType<typeof backgroundPosition.parse>;\n backgroundRepeat: ReturnType<typeof backgroundRepeat.parse>;\n backgroundSize: ReturnType<typeof backgroundSize.parse>;\n borderTopColor: Color;\n borderRightColor: Color;\n borderBottomColor: Color;\n borderLeftColor: Color;\n borderTopLeftRadius: ReturnType<typeof borderTopLeftRadius.parse>;\n borderTopRightRadius: ReturnType<typeof borderTopRightRadius.parse>;\n borderBottomRightRadius: ReturnType<typeof borderBottomRightRadius.parse>;\n borderBottomLeftRadius: ReturnType<typeof borderBottomLeftRadius.parse>;\n borderTopStyle: ReturnType<typeof borderTopStyle.parse>;\n borderRightStyle: ReturnType<typeof borderRightStyle.parse>;\n borderBottomStyle: ReturnType<typeof borderBottomStyle.parse>;\n borderLeftStyle: ReturnType<typeof borderLeftStyle.parse>;\n borderTopWidth: ReturnType<typeof borderTopWidth.parse>;\n borderRightWidth: ReturnType<typeof borderRightWidth.parse>;\n borderBottomWidth: ReturnType<typeof borderBottomWidth.parse>;\n borderLeftWidth: ReturnType<typeof borderLeftWidth.parse>;\n boxShadow: ReturnType<typeof boxShadow.parse>;\n color: Color;\n direction: ReturnType<typeof direction.parse>;\n display: ReturnType<typeof display.parse>;\n float: ReturnType<typeof float.parse>;\n fontFamily: ReturnType<typeof fontFamily.parse>;\n fontSize: LengthPercentage;\n fontStyle: ReturnType<typeof fontStyle.parse>;\n fontVariant: ReturnType<typeof fontVariant.parse>;\n fontWeight: ReturnType<typeof fontWeight.parse>;\n letterSpacing: ReturnType<typeof letterSpacing.parse>;\n lineBreak: ReturnType<typeof lineBreak.parse>;\n lineHeight: CSSValue;\n listStyleImage: ReturnType<typeof listStyleImage.parse>;\n listStylePosition: ReturnType<typeof listStylePosition.parse>;\n listStyleType: ReturnType<typeof listStyleType.parse>;\n marginTop: CSSValue;\n marginRight: CSSValue;\n marginBottom: CSSValue;\n marginLeft: CSSValue;\n opacity: ReturnType<typeof opacity.parse>;\n overflowX: OVERFLOW;\n overflowY: OVERFLOW;\n overflowWrap: ReturnType<typeof overflowWrap.parse>;\n paddingTop: LengthPercentage;\n paddingRight: LengthPercentage;\n paddingBottom: LengthPercentage;\n paddingLeft: LengthPercentage;\n paintOrder: ReturnType<typeof paintOrder.parse>;\n position: ReturnType<typeof position.parse>;\n textAlign: ReturnType<typeof textAlign.parse>;\n textDecorationColor: Color;\n textDecorationLine: ReturnType<typeof textDecorationLine.parse>;\n textDecorationStyle: ReturnType<typeof textDecorationStyle.parse>;\n textDecorationThickness: ReturnType<typeof textDecorationThickness.parse>;\n textUnderlineOffset: ReturnType<typeof textUnderlineOffset.parse>;\n textShadow: ReturnType<typeof textShadow.parse>;\n textTransform: ReturnType<typeof textTransform.parse>;\n textOverflow: ReturnType<typeof textOverflow.parse>;\n transform: ReturnType<typeof transform.parse>;\n transformOrigin: ReturnType<typeof transformOrigin.parse>;\n rotate: ReturnType<typeof rotate.parse>;\n visibility: ReturnType<typeof visibility.parse>;\n webkitTextStrokeColor: Color;\n webkitTextStrokeWidth: ReturnType<typeof webkitTextStrokeWidth.parse>;\n webkitLineClamp: ReturnType<typeof webkitLineClamp.parse>;\n wordBreak: ReturnType<typeof wordBreak.parse>;\n zIndex: ReturnType<typeof zIndex.parse>;\n objectFit: ReturnType<typeof objectFit.parse>;\n\n constructor(context: Context, declaration: CSSStyleDeclaration) {\n this.animationDuration = parse(context, duration, declaration.animationDuration);\n this.backgroundClip = parse(context, backgroundClip, declaration.backgroundClip);\n this.backgroundColor = parse(context, backgroundColor, declaration.backgroundColor);\n this.backgroundImage = parse(context, backgroundImage, declaration.backgroundImage);\n this.backgroundOrigin = parse(context, backgroundOrigin, declaration.backgroundOrigin);\n this.backgroundPosition = parse(context, backgroundPosition, declaration.backgroundPosition);\n this.backgroundRepeat = parse(context, backgroundRepeat, declaration.backgroundRepeat);\n this.backgroundSize = parse(context, backgroundSize, declaration.backgroundSize);\n this.borderTopColor = parse(context, borderTopColor, declaration.borderTopColor);\n this.borderRightColor = parse(context, borderRightColor, declaration.borderRightColor);\n this.borderBottomColor = parse(context, borderBottomColor, declaration.borderBottomColor);\n this.borderLeftColor = parse(context, borderLeftColor, declaration.borderLeftColor);\n this.borderTopLeftRadius = parse(context, borderTopLeftRadius, declaration.borderTopLeftRadius);\n this.borderTopRightRadius = parse(context, borderTopRightRadius, declaration.borderTopRightRadius);\n this.borderBottomRightRadius = parse(context, borderBottomRightRadius, declaration.borderBottomRightRadius);\n this.borderBottomLeftRadius = parse(context, borderBottomLeftRadius, declaration.borderBottomLeftRadius);\n this.borderTopStyle = parse(context, borderTopStyle, declaration.borderTopStyle);\n this.borderRightStyle = parse(context, borderRightStyle, declaration.borderRightStyle);\n this.borderBottomStyle = parse(context, borderBottomStyle, declaration.borderBottomStyle);\n this.borderLeftStyle = parse(context, borderLeftStyle, declaration.borderLeftStyle);\n this.borderTopWidth = parse(context, borderTopWidth, declaration.borderTopWidth);\n this.borderRightWidth = parse(context, borderRightWidth, declaration.borderRightWidth);\n this.borderBottomWidth = parse(context, borderBottomWidth, declaration.borderBottomWidth);\n this.borderLeftWidth = parse(context, borderLeftWidth, declaration.borderLeftWidth);\n this.boxShadow = parse(context, boxShadow, declaration.boxShadow);\n this.color = parse(context, color, declaration.color);\n this.direction = parse(context, direction, declaration.direction);\n this.display = parse(context, display, declaration.display);\n this.float = parse(context, float, declaration.cssFloat);\n this.fontFamily = parse(context, fontFamily, declaration.fontFamily);\n this.fontSize = parse(context, fontSize, declaration.fontSize);\n this.fontStyle = parse(context, fontStyle, declaration.fontStyle);\n this.fontVariant = parse(context, fontVariant, declaration.fontVariant);\n this.fontWeight = parse(context, fontWeight, declaration.fontWeight);\n this.letterSpacing = parse(context, letterSpacing, declaration.letterSpacing);\n this.lineBreak = parse(context, lineBreak, declaration.lineBreak);\n this.lineHeight = parse(context, lineHeight, declaration.lineHeight);\n this.listStyleImage = parse(context, listStyleImage, declaration.listStyleImage);\n this.listStylePosition = parse(context, listStylePosition, declaration.listStylePosition);\n this.listStyleType = parse(context, listStyleType, declaration.listStyleType);\n this.marginTop = parse(context, marginTop, declaration.marginTop);\n this.marginRight = parse(context, marginRight, declaration.marginRight);\n this.marginBottom = parse(context, marginBottom, declaration.marginBottom);\n this.marginLeft = parse(context, marginLeft, declaration.marginLeft);\n this.opacity = parse(context, opacity, declaration.opacity);\n const overflowTuple = parse(context, overflow, declaration.overflow);\n this.overflowX = overflowTuple[0];\n this.overflowY = overflowTuple[overflowTuple.length > 1 ? 1 : 0];\n this.overflowWrap = parse(context, overflowWrap, declaration.overflowWrap);\n this.paddingTop = parse(context, paddingTop, declaration.paddingTop);\n this.paddingRight = parse(context, paddingRight, declaration.paddingRight);\n this.paddingBottom = parse(context, paddingBottom, declaration.paddingBottom);\n this.paddingLeft = parse(context, paddingLeft, declaration.paddingLeft);\n this.paintOrder = parse(context, paintOrder, declaration.paintOrder);\n this.position = parse(context, position, declaration.position);\n this.textAlign = parse(context, textAlign, declaration.textAlign);\n this.textDecorationColor = parse(\n context,\n textDecorationColor,\n declaration.textDecorationColor ?? declaration.color\n );\n this.textDecorationLine = parse(\n context,\n textDecorationLine,\n declaration.textDecorationLine ?? declaration.textDecoration\n );\n this.textDecorationStyle = parse(context, textDecorationStyle, declaration.textDecorationStyle);\n this.textDecorationThickness = parse(context, textDecorationThickness, declaration.textDecorationThickness);\n this.textUnderlineOffset = parse(context, textUnderlineOffset, declaration.textUnderlineOffset);\n this.textShadow = parse(context, textShadow, declaration.textShadow);\n this.textTransform = parse(context, textTransform, declaration.textTransform);\n this.textOverflow = parse(context, textOverflow, declaration.textOverflow);\n this.transform = parse(context, transform, declaration.transform);\n this.transformOrigin = parse(context, transformOrigin, declaration.transformOrigin);\n this.rotate = parse(context, rotate, declaration.rotate);\n this.visibility = parse(context, visibility, declaration.visibility);\n this.webkitTextStrokeColor = parse(context, webkitTextStrokeColor, declaration.webkitTextStrokeColor);\n this.webkitTextStrokeWidth = parse(context, webkitTextStrokeWidth, declaration.webkitTextStrokeWidth);\n this.webkitLineClamp = parse(context, webkitLineClamp, declaration.webkitLineClamp);\n this.wordBreak = parse(context, wordBreak, declaration.wordBreak);\n this.zIndex = parse(context, zIndex, declaration.zIndex);\n this.objectFit = parse(context, objectFit, declaration.objectFit);\n }\n\n isVisible(): boolean {\n return this.display > 0 && this.opacity > 0 && this.visibility === VISIBILITY.VISIBLE;\n }\n\n isTransparent(): boolean {\n return isTransparent(this.backgroundColor);\n }\n\n isTransformed(): boolean {\n return this.transform !== null || this.rotate !== null;\n }\n\n isPositioned(): boolean {\n return this.position !== POSITION.STATIC;\n }\n\n isPositionedWithZIndex(): boolean {\n return this.isPositioned() && !this.zIndex.auto;\n }\n\n isFloating(): boolean {\n return this.float !== FLOAT.NONE;\n }\n\n isInlineLevel(): boolean {\n return (\n contains(this.display, DISPLAY.INLINE) ||\n contains(this.display, DISPLAY.INLINE_BLOCK) ||\n contains(this.display, DISPLAY.INLINE_FLEX) ||\n contains(this.display, DISPLAY.INLINE_GRID) ||\n contains(this.display, DISPLAY.INLINE_LIST_ITEM) ||\n contains(this.display, DISPLAY.INLINE_TABLE)\n );\n }\n}\n\nexport class CSSParsedPseudoDeclaration {\n content: ReturnType<typeof content.parse>;\n quotes: ReturnType<typeof quotes.parse>;\n\n constructor(context: Context, declaration: CSSStyleDeclaration) {\n this.content = parse(context, content, declaration.content);\n this.quotes = parse(context, quotes, declaration.quotes);\n }\n}\n\nexport class CSSParsedCounterDeclaration {\n counterIncrement: ReturnType<typeof counterIncrement.parse>;\n counterReset: ReturnType<typeof counterReset.parse>;\n\n constructor(context: Context, declaration: CSSStyleDeclaration) {\n this.counterIncrement = parse(context, counterIncrement, declaration.counterIncrement);\n this.counterReset = parse(context, counterReset, declaration.counterReset);\n }\n}\n\nconst parse = (context: Context, descriptor: CSSPropertyDescriptor<any>, style?: string | null) => {\n const tokenizer = new Tokenizer();\n const value = style !== null && typeof style !== 'undefined' ? style.toString() : descriptor.initialValue;\n tokenizer.write(value);\n const parser = new Parser(tokenizer.read());\n switch (descriptor.type) {\n case PropertyDescriptorParsingType.IDENT_VALUE:\n const token = parser.parseComponentValue();\n return descriptor.parse(context, isIdentToken(token) ? token.value : descriptor.initialValue);\n case PropertyDescriptorParsingType.VALUE:\n return descriptor.parse(context, parser.parseComponentValue());\n case PropertyDescriptorParsingType.LIST:\n return descriptor.parse(context, parser.parseComponentValues());\n case PropertyDescriptorParsingType.TOKEN_VALUE:\n return parser.parseComponentValue();\n case PropertyDescriptorParsingType.TYPE_VALUE:\n switch (descriptor.format) {\n case 'angle':\n return angle.parse(context, parser.parseComponentValue());\n case 'color':\n return colorType.parse(context, parser.parseComponentValue());\n case 'image':\n return image.parse(context, parser.parseComponentValue());\n case 'length':\n const length = parser.parseComponentValue();\n return isLength(length) ? length : ZERO_LENGTH;\n case 'length-percentage':\n const value = parser.parseComponentValue();\n return isLengthPercentage(value) ? value : ZERO_LENGTH;\n case 'time':\n return time.parse(context, parser.parseComponentValue());\n }\n break;\n }\n};\n","const elementDebuggerAttribute = 'data-html2canvas-debug';\nexport const enum DebuggerType {\n NONE,\n ALL,\n CLONE,\n PARSE,\n RENDER\n}\n\nconst getElementDebugType = (element: Element): DebuggerType => {\n const attribute = element.getAttribute(elementDebuggerAttribute);\n switch (attribute) {\n case 'all':\n return DebuggerType.ALL;\n case 'clone':\n return DebuggerType.CLONE;\n case 'parse':\n return DebuggerType.PARSE;\n case 'render':\n return DebuggerType.RENDER;\n default:\n return DebuggerType.NONE;\n }\n};\n\nexport const isDebugging = (element: Element, type: Omit<DebuggerType, DebuggerType.NONE>): boolean => {\n const elementType = getElementDebugType(element);\n return elementType === DebuggerType.ALL || type === elementType;\n};\n","import { CSSParsedDeclaration } from '../css/index';\nimport { TextContainer } from './text-container';\nimport { Bounds, parseBounds } from '../css/layout/bounds';\nimport { isHTMLElementNode } from './node-parser';\nimport { Context } from '../core/context';\nimport { DebuggerType, isDebugging } from '../core/debugger';\n\nexport const enum FLAGS {\n CREATES_STACKING_CONTEXT = 1 << 1,\n CREATES_REAL_STACKING_CONTEXT = 1 << 2,\n IS_LIST_OWNER = 1 << 3,\n DEBUG_RENDER = 1 << 4\n}\n\nexport class ElementContainer {\n readonly styles: CSSParsedDeclaration;\n readonly textNodes: TextContainer[] = [];\n readonly elements: ElementContainer[] = [];\n bounds: Bounds;\n flags = 0;\n\n constructor(\n protected readonly context: Context,\n element: Element\n ) {\n if (isDebugging(element, DebuggerType.PARSE)) {\n debugger;\n }\n\n this.styles = new CSSParsedDeclaration(context, window.getComputedStyle(element, null));\n\n if (isHTMLElementNode(element)) {\n if (this.styles.animationDuration.some((duration) => duration > 0)) {\n element.style.animationDuration = '0s';\n }\n\n if (this.styles.transform !== null) {\n // getBoundingClientRect takes transforms into account\n element.style.transform = 'none';\n }\n\n if (this.styles.rotate !== null) {\n // Handle rotate property similarly to transform\n element.style.rotate = 'none';\n }\n }\n\n this.bounds = parseBounds(this.context, element);\n\n if (isDebugging(element, DebuggerType.RENDER)) {\n this.flags |= FLAGS.DEBUG_RENDER;\n }\n }\n}\n","export const base64 =\n 'AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAI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gACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=';\nexport const byteLength = 19616;\n","const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\n// Use a lookup table to find the index.\nconst lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\n\nexport const decode = (base64: string): ArrayBuffer | number[] => {\n let bufferLength = base64.length * 0.75,\n len = base64.length,\n i,\n p = 0,\n encoded1,\n encoded2,\n encoded3,\n encoded4;\n\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n\n const buffer =\n typeof ArrayBuffer !== 'undefined' &&\n typeof Uint8Array !== 'undefined' &&\n typeof Uint8Array.prototype.slice !== 'undefined'\n ? new ArrayBuffer(bufferLength)\n : new Array(bufferLength);\n const bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);\n\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n\n return buffer;\n};\n\nexport const polyUint16Array = (buffer: number[]): number[] => {\n const length = buffer.length;\n const bytes = [];\n for (let i = 0; i < length; i += 2) {\n bytes.push((buffer[i + 1] << 8) | buffer[i]);\n }\n return bytes;\n};\n\nexport const polyUint32Array = (buffer: number[]): number[] => {\n const length = buffer.length;\n const bytes = [];\n for (let i = 0; i < length; i += 4) {\n bytes.push((buffer[i + 3] << 24) | (buffer[i + 2] << 16) | (buffer[i + 1] << 8) | buffer[i]);\n }\n return bytes;\n};\n","import {decode, polyUint16Array, polyUint32Array} from './Util';\n\nexport type int = number;\n\n/** Shift size for getting the index-2 table offset. */\nexport const UTRIE2_SHIFT_2 = 5;\n\n/** Shift size for getting the index-1 table offset. */\nexport const UTRIE2_SHIFT_1 = 6 + 5;\n\n/**\n * Shift size for shifting left the index array values.\n * Increases possible data size with 16-bit index values at the cost\n * of compactability.\n * This requires data blocks to be aligned by UTRIE2_DATA_GRANULARITY.\n */\nexport const UTRIE2_INDEX_SHIFT = 2;\n\n/**\n * Difference between the two shift sizes,\n * for getting an index-1 offset from an index-2 offset. 6=11-5\n */\nexport const UTRIE2_SHIFT_1_2 = UTRIE2_SHIFT_1 - UTRIE2_SHIFT_2;\n\n/**\n * The part of the index-2 table for U+D800..U+DBFF stores values for\n * lead surrogate code _units_ not code _points_.\n * Values for lead surrogate code _points_ are indexed with this portion of the table.\n * Length=32=0x20=0x400>>UTRIE2_SHIFT_2. (There are 1024=0x400 lead surrogates.)\n */\nexport const UTRIE2_LSCP_INDEX_2_OFFSET = 0x10000 >> UTRIE2_SHIFT_2;\n\n/** Number of entries in a data block. 32=0x20 */\nexport const UTRIE2_DATA_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_2;\n/** Mask for getting the lower bits for the in-data-block offset. */\nexport const UTRIE2_DATA_MASK = UTRIE2_DATA_BLOCK_LENGTH - 1;\n\nexport const UTRIE2_LSCP_INDEX_2_LENGTH = 0x400 >> UTRIE2_SHIFT_2;\n/** Count the lengths of both BMP pieces. 2080=0x820 */\nexport const UTRIE2_INDEX_2_BMP_LENGTH = UTRIE2_LSCP_INDEX_2_OFFSET + UTRIE2_LSCP_INDEX_2_LENGTH;\n/**\n * The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820.\n * Length 32=0x20 for lead bytes C0..DF, regardless of UTRIE2_SHIFT_2.\n */\nexport const UTRIE2_UTF8_2B_INDEX_2_OFFSET = UTRIE2_INDEX_2_BMP_LENGTH;\nexport const UTRIE2_UTF8_2B_INDEX_2_LENGTH = 0x800 >> 6; /* U+0800 is the first code point after 2-byte UTF-8 */\n/**\n * The index-1 table, only used for supplementary code points, at offset 2112=0x840.\n * Variable length, for code points up to highStart, where the last single-value range starts.\n * Maximum length 512=0x200=0x100000>>UTRIE2_SHIFT_1.\n * (For 0x100000 supplementary code points U+10000..U+10ffff.)\n *\n * The part of the index-2 table for supplementary code points starts\n * after this index-1 table.\n *\n * Both the index-1 table and the following part of the index-2 table\n * are omitted completely if there is only BMP data.\n */\nexport const UTRIE2_INDEX_1_OFFSET = UTRIE2_UTF8_2B_INDEX_2_OFFSET + UTRIE2_UTF8_2B_INDEX_2_LENGTH;\n\n/**\n * Number of index-1 entries for the BMP. 32=0x20\n * This part of the index-1 table is omitted from the serialized form.\n */\nexport const UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> UTRIE2_SHIFT_1;\n\n/** Number of entries in an index-2 block. 64=0x40 */\nexport const UTRIE2_INDEX_2_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_1_2;\n/** Mask for getting the lower bits for the in-index-2-block offset. */\nexport const UTRIE2_INDEX_2_MASK = UTRIE2_INDEX_2_BLOCK_LENGTH - 1;\n\nconst slice16 = (view: number[] | Uint16Array, start: number, end?: number) => {\n if (view.slice) {\n return view.slice(start, end);\n }\n\n return new Uint16Array(Array.prototype.slice.call(view, start, end));\n};\n\nconst slice32 = (view: number[] | Uint32Array, start: number, end?: number) => {\n if (view.slice) {\n return view.slice(start, end);\n }\n\n return new Uint32Array(Array.prototype.slice.call(view, start, end));\n};\n\nexport const createTrieFromBase64 = (base64: string, _byteLength: number): Trie => {\n const buffer = decode(base64);\n const view32 = Array.isArray(buffer) ? polyUint32Array(buffer) : new Uint32Array(buffer);\n const view16 = Array.isArray(buffer) ? polyUint16Array(buffer) : new Uint16Array(buffer);\n const headerLength = 24;\n\n const index = slice16(view16, headerLength / 2, view32[4] / 2);\n const data =\n view32[5] === 2\n ? slice16(view16, (headerLength + view32[4]) / 2)\n : slice32(view32, Math.ceil((headerLength + view32[4]) / 4));\n\n return new Trie(view32[0], view32[1], view32[2], view32[3], index, data);\n};\n\nexport class Trie {\n initialValue: int;\n errorValue: int;\n highStart: int;\n highValueIndex: int;\n index: Uint16Array | number[];\n data: Uint32Array | Uint16Array | number[];\n\n constructor(\n initialValue: int,\n errorValue: int,\n highStart: int,\n highValueIndex: int,\n index: Uint16Array | number[],\n data: Uint32Array | Uint16Array | number[]\n ) {\n this.initialValue = initialValue;\n this.errorValue = errorValue;\n this.highStart = highStart;\n this.highValueIndex = highValueIndex;\n this.index = index;\n this.data = data;\n }\n\n /**\n * Get the value for a code point as stored in the Trie.\n *\n * @param codePoint the code point\n * @return the value\n */\n get(codePoint: number): number {\n let ix;\n if (codePoint >= 0) {\n if (codePoint < 0x0d800 || (codePoint > 0x0dbff && codePoint <= 0x0ffff)) {\n // Ordinary BMP code point, excluding leading surrogates.\n // BMP uses a single level lookup. BMP index starts at offset 0 in the Trie2 index.\n // 16 bit data is stored in the index array itself.\n ix = this.index[codePoint >> UTRIE2_SHIFT_2];\n ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);\n return this.data[ix];\n }\n\n if (codePoint <= 0xffff) {\n // Lead Surrogate Code Point. A Separate index section is stored for\n // lead surrogate code units and code points.\n // The main index has the code unit data.\n // For this function, we need the code point data.\n // Note: this expression could be refactored for slightly improved efficiency, but\n // surrogate code points will be so rare in practice that it's not worth it.\n ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET + ((codePoint - 0xd800) >> UTRIE2_SHIFT_2)];\n ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);\n return this.data[ix];\n }\n\n if (codePoint < this.highStart) {\n // Supplemental code point, use two-level lookup.\n ix = UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> UTRIE2_SHIFT_1);\n ix = this.index[ix];\n ix += (codePoint >> UTRIE2_SHIFT_2) & UTRIE2_INDEX_2_MASK;\n ix = this.index[ix];\n ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);\n return this.data[ix];\n }\n if (codePoint <= 0x10ffff) {\n return this.data[this.highValueIndex];\n }\n }\n\n // Fall through. The code point is outside of the legal range of 0..0x10ffff.\n return this.errorValue;\n }\n}\n","const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\n// Use a lookup table to find the index.\nconst lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\n\nexport const encode = (arraybuffer: ArrayBuffer): string => {\n let bytes = new Uint8Array(arraybuffer),\n i,\n len = bytes.length,\n base64 = '';\n\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n\n return base64;\n};\n\nexport const decode = (base64: string): ArrayBuffer => {\n let bufferLength = base64.length * 0.75,\n len = base64.length,\n i,\n p = 0,\n encoded1,\n encoded2,\n encoded3,\n encoded4;\n\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n\n const arraybuffer = new ArrayBuffer(bufferLength),\n bytes = new Uint8Array(arraybuffer);\n\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n\n return arraybuffer;\n};\n","import {base64, byteLength} from './grapheme-break-trie';\nimport {createTrieFromBase64} from 'utrie';\n\nconst Other = 0;\nconst Prepend = 1;\nconst CR = 2;\nconst LF = 3;\nconst Control = 4;\nconst Extend = 5;\nconst Regional_Indicator = 6;\nconst SpacingMark = 7;\nconst L = 8;\nconst V = 9;\nconst T = 10;\nconst LV = 11;\nconst LVT = 12;\nconst ZWJ = 13;\nconst Extended_Pictographic = 14;\nconst RI = 15;\n\nexport const classes: {[key: string]: number} = {\n Other,\n Prepend,\n CR,\n LF,\n Control,\n Extend,\n Regional_Indicator,\n SpacingMark,\n L,\n V,\n T,\n LV,\n LVT,\n ZWJ,\n Extended_Pictographic,\n RI,\n};\n\nexport const toCodePoints = (str: string): number[] => {\n const codePoints = [];\n let i = 0;\n const length = str.length;\n while (i < length) {\n const value = str.charCodeAt(i++);\n if (value >= 0xd800 && value <= 0xdbff && i < length) {\n const extra = str.charCodeAt(i++);\n if ((extra & 0xfc00) === 0xdc00) {\n codePoints.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000);\n } else {\n codePoints.push(value);\n i--;\n }\n } else {\n codePoints.push(value);\n }\n }\n return codePoints;\n};\n\nexport const fromCodePoint = (...codePoints: number[]): string => {\n if (String.fromCodePoint) {\n return String.fromCodePoint(...codePoints);\n }\n\n const length = codePoints.length;\n if (!length) {\n return '';\n }\n\n const codeUnits = [];\n\n let index = -1;\n let result = '';\n while (++index < length) {\n let codePoint = codePoints[index];\n if (codePoint <= 0xffff) {\n codeUnits.push(codePoint);\n } else {\n codePoint -= 0x10000;\n codeUnits.push((codePoint >> 10) + 0xd800, (codePoint % 0x400) + 0xdc00);\n }\n if (index + 1 === length || codeUnits.length > 0x4000) {\n result += String.fromCharCode(...codeUnits);\n codeUnits.length = 0;\n }\n }\n return result;\n};\n\nexport const UnicodeTrie = createTrieFromBase64(base64, byteLength);\n\nexport const BREAK_NOT_ALLOWED = '×';\nexport const BREAK_ALLOWED = '÷';\n\nexport type BREAK_OPPORTUNITIES = typeof BREAK_NOT_ALLOWED | typeof BREAK_ALLOWED;\n\nexport const codePointToClass = (codePoint: number): number => UnicodeTrie.get(codePoint);\n\nconst _graphemeBreakAtIndex = (_codePoints: number[], classTypes: number[], index: number): BREAK_OPPORTUNITIES => {\n let prevIndex = index - 2;\n let prev = classTypes[prevIndex];\n const current = classTypes[index - 1];\n const next = classTypes[index];\n // GB3 Do not break between a CR and LF\n if (current === CR && next === LF) {\n return BREAK_NOT_ALLOWED;\n }\n\n // GB4 Otherwise, break before and after controls.\n if (current === CR || current === LF || current === Control) {\n return BREAK_ALLOWED;\n }\n\n // GB5\n if (next === CR || next === LF || next === Control) {\n return BREAK_ALLOWED;\n }\n\n // Do not break Hangul syllable sequences.\n // GB6\n if (current === L && [L, V, LV, LVT].indexOf(next) !== -1) {\n return BREAK_NOT_ALLOWED;\n }\n\n // GB7\n if ((current === LV || current === V) && (next === V || next === T)) {\n return BREAK_NOT_ALLOWED;\n }\n\n // GB8\n if ((current === LVT || current === T) && next === T) {\n return BREAK_NOT_ALLOWED;\n }\n\n // GB9 Do not break before extending characters or ZWJ.\n if (next === ZWJ || next === Extend) {\n return BREAK_NOT_ALLOWED;\n }\n // Do not break before SpacingMarks, or after Prepend characters.\n // GB9a\n if (next === SpacingMark) {\n return BREAK_NOT_ALLOWED;\n }\n\n // GB9a\n if (current === Prepend) {\n return BREAK_NOT_ALLOWED;\n }\n\n // GB11 Do not break within emoji modifier sequences or emoji zwj sequences.\n if (current === ZWJ && next === Extended_Pictographic) {\n while (prev === Extend) {\n prev = classTypes[--prevIndex];\n }\n if (prev === Extended_Pictographic) {\n return BREAK_NOT_ALLOWED;\n }\n }\n\n // GB12 Do not break within emoji flag sequences.\n // That is, do not break between regional indicator (RI) symbols\n // if there is an odd number of RI characters before the break point.\n if (current === RI && next === RI) {\n let countRI = 0;\n while (prev === RI) {\n countRI++;\n prev = classTypes[--prevIndex];\n }\n if (countRI % 2 === 0) {\n return BREAK_NOT_ALLOWED;\n }\n }\n\n return BREAK_ALLOWED;\n};\n\nexport const graphemeBreakAtIndex = (codePoints: number[], index: number): BREAK_OPPORTUNITIES => {\n // GB1 Break at the start and end of text, unless the text is empty.\n if (index === 0) {\n return BREAK_ALLOWED;\n }\n\n // GB2\n if (index >= codePoints.length) {\n return BREAK_ALLOWED;\n }\n\n const classTypes = codePoints.map(codePointToClass);\n return _graphemeBreakAtIndex(codePoints, classTypes, index);\n};\n\nexport const GraphemeBreaker = (str: string) => {\n const codePoints = toCodePoints(str);\n const length = codePoints.length;\n let index = 0;\n let lastEnd = 0;\n const classTypes = codePoints.map(codePointToClass);\n\n return {\n next: () => {\n if (index >= length) {\n return {done: true, value: null};\n }\n\n let graphemeBreak = BREAK_NOT_ALLOWED;\n while (\n index < length &&\n (graphemeBreak = _graphemeBreakAtIndex(codePoints, classTypes, ++index)) === BREAK_NOT_ALLOWED\n ) {}\n\n if (graphemeBreak !== BREAK_NOT_ALLOWED || index === length) {\n const value = fromCodePoint.apply(null, codePoints.slice(lastEnd, index));\n lastEnd = index;\n return {value, done: false};\n }\n\n return {done: true, value: null};\n while (index < length) {}\n\n return {done: true, value: null};\n },\n };\n};\n\nexport const splitGraphemes = (str: string): string[] => {\n const breaker = GraphemeBreaker(str);\n\n const graphemes = [];\n let bk;\n\n while (!(bk = breaker.next()).done) {\n if (bk.value) {\n graphemes.push(bk.value.slice());\n }\n }\n\n return graphemes;\n};\n","import { fromCodePoint, toCodePoints } from 'css-line-break';\n\nconst testRangeBounds = (document: Document) => {\n const TEST_HEIGHT = 123;\n\n if (document.createRange) {\n const range = document.createRange();\n if (range.getBoundingClientRect) {\n const testElement = document.createElement('boundtest');\n testElement.style.height = `${TEST_HEIGHT}px`;\n testElement.style.display = 'block';\n document.body.appendChild(testElement);\n\n range.selectNode(testElement);\n const rangeBounds = range.getBoundingClientRect();\n const rangeHeight = Math.round(rangeBounds.height);\n document.body.removeChild(testElement);\n if (rangeHeight === TEST_HEIGHT) {\n return true;\n }\n }\n }\n\n return false;\n};\n\nconst testIOSLineBreak = (document: Document) => {\n const testElement = document.createElement('boundtest');\n testElement.style.width = '50px';\n testElement.style.display = 'block';\n testElement.style.fontSize = '12px';\n testElement.style.letterSpacing = '0px';\n testElement.style.wordSpacing = '0px';\n document.body.appendChild(testElement);\n const range = document.createRange();\n\n testElement.innerHTML = typeof ''.repeat === 'function' ? '&#128104;'.repeat(10) : '';\n\n const node = testElement.firstChild as Text;\n\n const textList = toCodePoints(node.data).map((i) => fromCodePoint(i));\n let offset = 0;\n let prev: DOMRect = {} as DOMRect;\n\n // ios 13 does not handle range getBoundingClientRect line changes correctly #2177\n const supports = textList.every((text, i) => {\n range.setStart(node, offset);\n range.setEnd(node, offset + text.length);\n const rect = range.getBoundingClientRect();\n\n offset += text.length;\n const boundAhead = rect.x > prev.x || rect.y > prev.y;\n\n prev = rect;\n if (i === 0) {\n return true;\n }\n\n return boundAhead;\n });\n\n document.body.removeChild(testElement);\n return supports;\n};\n\nconst testCORS = (): boolean => typeof new Image().crossOrigin !== 'undefined';\n\nconst testResponseType = (): boolean => typeof new XMLHttpRequest().responseType === 'string';\n\nconst testSVG = (document: Document): boolean => {\n const img = new Image();\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n if (!ctx) {\n return false;\n }\n\n img.src = `data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>`;\n\n try {\n ctx.drawImage(img, 0, 0);\n canvas.toDataURL();\n } catch (e) {\n return false;\n }\n return true;\n};\n\nconst isGreenPixel = (data: Uint8ClampedArray): boolean =>\n data[0] === 0 && data[1] === 255 && data[2] === 0 && data[3] === 255;\n\nconst testForeignObject = (document: Document): Promise<boolean> => {\n const canvas = document.createElement('canvas');\n const size = 100;\n canvas.width = size;\n canvas.height = size;\n const ctx = canvas.getContext('2d');\n if (!ctx) {\n return Promise.reject(false);\n }\n ctx.fillStyle = 'rgb(0, 255, 0)';\n ctx.fillRect(0, 0, size, size);\n\n const img = new Image();\n const greenImageSrc = canvas.toDataURL();\n img.src = greenImageSrc;\n const svg = createForeignObjectSVG(size, size, 0, 0, img);\n ctx.fillStyle = 'red';\n ctx.fillRect(0, 0, size, size);\n\n return loadSerializedSVG(svg)\n .then((img: HTMLImageElement) => {\n ctx.drawImage(img, 0, 0);\n const data = ctx.getImageData(0, 0, size, size).data;\n ctx.fillStyle = 'red';\n ctx.fillRect(0, 0, size, size);\n\n const node = document.createElement('div');\n node.style.backgroundImage = `url(${greenImageSrc})`;\n node.style.height = `${size}px`;\n // Firefox 55 does not render inline <img /> tags\n return isGreenPixel(data)\n ? loadSerializedSVG(createForeignObjectSVG(size, size, 0, 0, node))\n : Promise.reject(false);\n })\n .then((img: HTMLImageElement) => {\n ctx.drawImage(img, 0, 0);\n // Edge does not render background-images\n return isGreenPixel(ctx.getImageData(0, 0, size, size).data);\n })\n .catch(() => false);\n};\n\nexport const createForeignObjectSVG = (\n width: number,\n height: number,\n x: number,\n y: number,\n node: Node\n): SVGForeignObjectElement => {\n const xmlns = 'http://www.w3.org/2000/svg';\n const svg = document.createElementNS(xmlns, 'svg');\n const foreignObject = document.createElementNS(xmlns, 'foreignObject');\n svg.setAttributeNS(null, 'width', width.toString());\n svg.setAttributeNS(null, 'height', height.toString());\n\n foreignObject.setAttributeNS(null, 'width', '100%');\n foreignObject.setAttributeNS(null, 'height', '100%');\n foreignObject.setAttributeNS(null, 'x', x.toString());\n foreignObject.setAttributeNS(null, 'y', y.toString());\n foreignObject.setAttributeNS(null, 'externalResourcesRequired', 'true');\n svg.appendChild(foreignObject);\n\n foreignObject.appendChild(node);\n\n return svg;\n};\n\nexport const loadSerializedSVG = (svg: Node): Promise<HTMLImageElement> => {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => resolve(img);\n img.onerror = reject;\n\n img.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(svg))}`;\n });\n};\n\nexport const FEATURES = {\n get SUPPORT_RANGE_BOUNDS(): boolean {\n 'use strict';\n const value = testRangeBounds(document);\n Object.defineProperty(FEATURES, 'SUPPORT_RANGE_BOUNDS', { value });\n return value;\n },\n get SUPPORT_WORD_BREAKING(): boolean {\n 'use strict';\n const value = FEATURES.SUPPORT_RANGE_BOUNDS && testIOSLineBreak(document);\n Object.defineProperty(FEATURES, 'SUPPORT_WORD_BREAKING', { value });\n return value;\n },\n get SUPPORT_SVG_DRAWING(): boolean {\n 'use strict';\n const value = testSVG(document);\n Object.defineProperty(FEATURES, 'SUPPORT_SVG_DRAWING', { value });\n return value;\n },\n get SUPPORT_FOREIGNOBJECT_DRAWING(): Promise<boolean> {\n 'use strict';\n const value =\n typeof Array.from === 'function' && typeof window.fetch === 'function'\n ? testForeignObject(document)\n : Promise.resolve(false);\n Object.defineProperty(FEATURES, 'SUPPORT_FOREIGNOBJECT_DRAWING', { value });\n return value;\n },\n get SUPPORT_CORS_IMAGES(): boolean {\n 'use strict';\n const value = testCORS();\n Object.defineProperty(FEATURES, 'SUPPORT_CORS_IMAGES', { value });\n return value;\n },\n get SUPPORT_RESPONSE_TYPE(): boolean {\n 'use strict';\n const value = testResponseType();\n Object.defineProperty(FEATURES, 'SUPPORT_RESPONSE_TYPE', { value });\n return value;\n },\n get SUPPORT_CORS_XHR(): boolean {\n 'use strict';\n const value = 'withCredentials' in new XMLHttpRequest();\n Object.defineProperty(FEATURES, 'SUPPORT_CORS_XHR', { value });\n return value;\n },\n get SUPPORT_NATIVE_TEXT_SEGMENTATION(): boolean {\n 'use strict';\n\n const value = !!(typeof Intl !== 'undefined' && (Intl as any).Segmenter);\n Object.defineProperty(FEATURES, 'SUPPORT_NATIVE_TEXT_SEGMENTATION', { value });\n return value;\n }\n};\n","import { OVERFLOW_WRAP } from '../property-descriptors/overflow-wrap';\nimport { CSSParsedDeclaration } from '../index';\nimport { fromCodePoint, LineBreaker, toCodePoints } from 'css-line-break';\nimport { splitGraphemes } from 'text-segmentation';\nimport { Bounds, parseBounds } from './bounds';\nimport { FEATURES } from '../../core/features';\nimport { Context } from '../../core/context';\n\nexport class TextBounds {\n readonly text: string;\n readonly bounds: Bounds;\n\n constructor(text: string, bounds: Bounds) {\n this.text = text;\n this.bounds = bounds;\n }\n}\n\nexport const parseTextBounds = (\n context: Context,\n value: string,\n styles: CSSParsedDeclaration,\n node: Text\n): TextBounds[] => {\n const textList = breakText(value, styles);\n const textBounds: TextBounds[] = [];\n let offset = 0;\n textList.forEach((text) => {\n if (styles.textDecorationLine.length || text.trim().length > 0) {\n if (FEATURES.SUPPORT_RANGE_BOUNDS) {\n const clientRects = createRange(node, offset, text.length).getClientRects();\n if (clientRects.length > 1) {\n const subSegments = segmentGraphemes(text);\n let subOffset = 0;\n subSegments.forEach((subSegment) => {\n textBounds.push(\n new TextBounds(\n subSegment,\n Bounds.fromDOMRectList(\n context,\n createRange(node, subOffset + offset, subSegment.length).getClientRects()\n )\n )\n );\n subOffset += subSegment.length;\n });\n } else {\n textBounds.push(new TextBounds(text, Bounds.fromDOMRectList(context, clientRects)));\n }\n } else {\n const replacementNode = node.splitText(text.length);\n textBounds.push(new TextBounds(text, getWrapperBounds(context, node)));\n node = replacementNode;\n }\n } else if (!FEATURES.SUPPORT_RANGE_BOUNDS) {\n node = node.splitText(text.length);\n }\n offset += text.length;\n });\n\n return textBounds;\n};\n\nconst getWrapperBounds = (context: Context, node: Text): Bounds => {\n const ownerDocument = node.ownerDocument;\n if (ownerDocument) {\n const wrapper = ownerDocument.createElement('html2canvaswrapper');\n wrapper.appendChild(node.cloneNode(true));\n const parentNode = node.parentNode;\n if (parentNode) {\n parentNode.replaceChild(wrapper, node);\n const bounds = parseBounds(context, wrapper);\n if (wrapper.firstChild) {\n parentNode.replaceChild(wrapper.firstChild, wrapper);\n }\n return bounds;\n }\n }\n\n return Bounds.EMPTY;\n};\n\nconst createRange = (node: Text, offset: number, length: number): Range => {\n const ownerDocument = node.ownerDocument;\n if (!ownerDocument) {\n throw new Error('Node has no owner document');\n }\n const range = ownerDocument.createRange();\n range.setStart(node, offset);\n range.setEnd(node, offset + length);\n return range;\n};\n\nexport const segmentGraphemes = (value: string): string[] => {\n if (FEATURES.SUPPORT_NATIVE_TEXT_SEGMENTATION) {\n const segmenter = new (Intl as any).Segmenter(void 0, { granularity: 'grapheme' });\n\n return Array.from(segmenter.segment(value)).map((segment: any) => segment.segment);\n }\n\n return splitGraphemes(value);\n};\n\nconst segmentWords = (value: string, styles: CSSParsedDeclaration): string[] => {\n if (FEATURES.SUPPORT_NATIVE_TEXT_SEGMENTATION) {\n const segmenter = new (Intl as any).Segmenter(void 0, {\n granularity: 'word'\n });\n\n return Array.from(segmenter.segment(value)).map((segment: any) => segment.segment);\n }\n\n return breakWords(value, styles);\n};\n\nconst breakText = (value: string, styles: CSSParsedDeclaration): string[] => {\n return styles.letterSpacing !== 0 ? segmentGraphemes(value) : segmentWords(value, styles);\n};\n\n// https://drafts.csswg.org/css-text/#word-separator\nconst wordSeparators = [0x0020, 0x00a0, 0x1361, 0x10100, 0x10101, 0x1039, 0x1091];\n\nconst breakWords = (str: string, styles: CSSParsedDeclaration): string[] => {\n const breaker = LineBreaker(str, {\n lineBreak: styles.lineBreak,\n wordBreak: styles.overflowWrap === OVERFLOW_WRAP.BREAK_WORD ? 'break-word' : styles.wordBreak\n });\n\n const words = [];\n let bk;\n\n while (!(bk = breaker.next()).done) {\n if (bk.value) {\n const value = bk.value.slice();\n const codePoints = toCodePoints(value);\n let word = '';\n codePoints.forEach((codePoint) => {\n if (wordSeparators.indexOf(codePoint) === -1) {\n word += fromCodePoint(codePoint);\n } else {\n if (word.length) {\n words.push(word);\n }\n words.push(fromCodePoint(codePoint));\n word = '';\n }\n });\n\n if (word.length) {\n words.push(word);\n }\n }\n }\n\n return words;\n};\n","import { CSSParsedDeclaration } from '../css/index';\nimport { TEXT_TRANSFORM } from '../css/property-descriptors/text-transform';\nimport { parseTextBounds, TextBounds } from '../css/layout/text';\nimport { Context } from '../core/context';\n\nexport class TextContainer {\n text: string;\n textBounds: TextBounds[];\n\n constructor(context: Context, node: Text, styles: CSSParsedDeclaration) {\n this.text = transform(node.data, styles.textTransform);\n this.textBounds = parseTextBounds(context, this.text, styles, node);\n }\n}\n\nconst transform = (text: string, transform: TEXT_TRANSFORM) => {\n switch (transform) {\n case TEXT_TRANSFORM.LOWERCASE:\n return text.toLowerCase();\n case TEXT_TRANSFORM.CAPITALIZE:\n return text.replace(CAPITALIZE, capitalize);\n case TEXT_TRANSFORM.UPPERCASE:\n return text.toUpperCase();\n default:\n return text;\n }\n};\n\nconst CAPITALIZE = /(^|\\s|:|-|\\(|\\))([a-z])/g;\n\nconst capitalize = (m: string, p1: string, p2: string) => {\n if (m.length > 0) {\n return p1 + p2.toUpperCase();\n }\n\n return m;\n};\n","import { ElementContainer } from '../element-container';\nimport { Context } from '../../core/context';\n\nexport class ImageElementContainer extends ElementContainer {\n src: string;\n intrinsicWidth: number;\n intrinsicHeight: number;\n\n constructor(context: Context, img: HTMLImageElement) {\n super(context, img);\n this.src = img.currentSrc || img.src;\n this.intrinsicWidth = img.naturalWidth;\n this.intrinsicHeight = img.naturalHeight;\n this.context.cache.addImage(this.src);\n }\n}\n","import { ElementContainer } from '../element-container';\nimport { Context } from '../../core/context';\n\nexport class CanvasElementContainer extends ElementContainer {\n canvas: HTMLCanvasElement;\n intrinsicWidth: number;\n intrinsicHeight: number;\n\n constructor(context: Context, canvas: HTMLCanvasElement) {\n super(context, canvas);\n this.canvas = canvas;\n this.intrinsicWidth = canvas.width;\n this.intrinsicHeight = canvas.height;\n }\n}\n","import { ElementContainer } from '../element-container';\nimport { parseBounds } from '../../css/layout/bounds';\nimport { Context } from '../../core/context';\n\nexport class SVGElementContainer extends ElementContainer {\n svg: string;\n intrinsicWidth: number;\n intrinsicHeight: number;\n\n constructor(context: Context, img: SVGSVGElement) {\n super(context, img);\n const s = new XMLSerializer();\n const bounds = parseBounds(context, img);\n img.setAttribute('width', `${bounds.width}px`);\n img.setAttribute('height', `${bounds.height}px`);\n\n this.svg = `data:image/svg+xml,${encodeURIComponent(s.serializeToString(img))}`;\n this.intrinsicWidth = img.width.baseVal.value;\n this.intrinsicHeight = img.height.baseVal.value;\n\n this.context.cache.addImage(this.svg);\n }\n}\n","import { ElementContainer } from '../element-container';\nimport { Context } from '../../core/context';\nexport class LIElementContainer extends ElementContainer {\n readonly value: number;\n\n constructor(context: Context, element: HTMLLIElement) {\n super(context, element);\n this.value = element.value;\n }\n}\n","import { ElementContainer } from '../element-container';\nimport { Context } from '../../core/context';\nexport class OLElementContainer extends ElementContainer {\n readonly start: number;\n readonly reversed: boolean;\n\n constructor(context: Context, element: HTMLOListElement) {\n super(context, element);\n this.start = element.start;\n this.reversed = typeof element.reversed === 'boolean' && element.reversed === true;\n }\n}\n","import { ElementContainer } from '../element-container';\nimport { BORDER_STYLE } from '../../css/property-descriptors/border-style';\nimport { BACKGROUND_CLIP } from '../../css/property-descriptors/background-clip';\nimport { BACKGROUND_ORIGIN } from '../../css/property-descriptors/background-origin';\nimport { TokenType } from '../../css/syntax/tokenizer';\nimport { LengthPercentageTuple } from '../../css/types/length-percentage';\nimport { Bounds } from '../../css/layout/bounds';\nimport { Context } from '../../core/context';\n\nconst CHECKBOX_BORDER_RADIUS: LengthPercentageTuple = [\n {\n type: TokenType.DIMENSION_TOKEN,\n flags: 0,\n unit: 'px',\n number: 3\n }\n];\n\nconst RADIO_BORDER_RADIUS: LengthPercentageTuple = [\n {\n type: TokenType.PERCENTAGE_TOKEN,\n flags: 0,\n number: 50\n }\n];\n\nconst reformatInputBounds = (bounds: Bounds): Bounds => {\n if (bounds.width > bounds.height) {\n return new Bounds(bounds.left + (bounds.width - bounds.height) / 2, bounds.top, bounds.height, bounds.height);\n } else if (bounds.width < bounds.height) {\n return new Bounds(bounds.left, bounds.top + (bounds.height - bounds.width) / 2, bounds.width, bounds.width);\n }\n return bounds;\n};\n\nconst getInputValue = (node: HTMLInputElement): string => {\n const value = node.type === PASSWORD ? new Array(node.value.length + 1).join('\\u2022') : node.value;\n\n return value.length === 0 ? node.placeholder || '' : value;\n};\n\nconst isPlaceholder = (node: HTMLInputElement): boolean => {\n return node.value.length === 0 && !!node.placeholder;\n};\n\nexport const CHECKBOX = 'checkbox';\nexport const RADIO = 'radio';\nexport const PASSWORD = 'password';\nexport const INPUT_COLOR = 0x2a2a2aff;\n// Default placeholder color (similar to browsers: rgba(117, 117, 117, 1) or #757575)\nexport const PLACEHOLDER_COLOR = 0x757575ff;\n\nexport class InputElementContainer extends ElementContainer {\n readonly type: string;\n readonly checked: boolean;\n readonly value: string;\n readonly isPlaceholder: boolean;\n\n constructor(context: Context, input: HTMLInputElement) {\n super(context, input);\n this.type = input.type.toLowerCase();\n this.checked = input.checked;\n this.value = getInputValue(input);\n this.isPlaceholder = isPlaceholder(input);\n\n if (this.type === CHECKBOX || this.type === RADIO) {\n this.styles.backgroundColor = 0xdededeff;\n this.styles.borderTopColor =\n this.styles.borderRightColor =\n this.styles.borderBottomColor =\n this.styles.borderLeftColor =\n 0xa5a5a5ff;\n this.styles.borderTopWidth =\n this.styles.borderRightWidth =\n this.styles.borderBottomWidth =\n this.styles.borderLeftWidth =\n 1;\n this.styles.borderTopStyle =\n this.styles.borderRightStyle =\n this.styles.borderBottomStyle =\n this.styles.borderLeftStyle =\n BORDER_STYLE.SOLID;\n this.styles.backgroundClip = [BACKGROUND_CLIP.BORDER_BOX];\n this.styles.backgroundOrigin = [BACKGROUND_ORIGIN.BORDER_BOX];\n this.bounds = reformatInputBounds(this.bounds);\n }\n\n switch (this.type) {\n case CHECKBOX:\n this.styles.borderTopRightRadius =\n this.styles.borderTopLeftRadius =\n this.styles.borderBottomRightRadius =\n this.styles.borderBottomLeftRadius =\n CHECKBOX_BORDER_RADIUS;\n break;\n case RADIO:\n this.styles.borderTopRightRadius =\n this.styles.borderTopLeftRadius =\n this.styles.borderBottomRightRadius =\n this.styles.borderBottomLeftRadius =\n RADIO_BORDER_RADIUS;\n break;\n }\n }\n}\n","import { ElementContainer } from '../element-container';\nimport { Context } from '../../core/context';\nexport class SelectElementContainer extends ElementContainer {\n readonly value: string;\n constructor(context: Context, element: HTMLSelectElement) {\n super(context, element);\n const option = element.options[element.selectedIndex || 0];\n this.value = option ? option.text || '' : '';\n }\n}\n","import { ElementContainer } from '../element-container';\nimport { Context } from '../../core/context';\nexport class TextareaElementContainer extends ElementContainer {\n readonly value: string;\n constructor(context: Context, element: HTMLTextAreaElement) {\n super(context, element);\n this.value = element.value;\n }\n}\n","import { ElementContainer } from '../element-container';\nimport { parseTree } from '../node-parser';\nimport { Color, parseColor, COLORS } from '../../css/types/color';\nimport { isTransparent } from '../../css/types/color-utilities';\nimport { Context } from '../../core/context';\n\nexport class IFrameElementContainer extends ElementContainer {\n src: string;\n width: number;\n height: number;\n tree?: ElementContainer;\n backgroundColor: Color;\n\n constructor(context: Context, iframe: HTMLIFrameElement) {\n super(context, iframe);\n this.src = iframe.src;\n this.width = parseInt(iframe.width, 10) || 0;\n this.height = parseInt(iframe.height, 10) || 0;\n this.backgroundColor = this.styles.backgroundColor;\n try {\n if (\n iframe.contentWindow &&\n iframe.contentWindow.document &&\n iframe.contentWindow.document.documentElement\n ) {\n this.tree = parseTree(context, iframe.contentWindow.document.documentElement);\n\n // http://www.w3.org/TR/css3-background/#special-backgrounds\n const documentBackgroundColor = iframe.contentWindow.document.documentElement\n ? parseColor(\n context,\n getComputedStyle(iframe.contentWindow.document.documentElement).backgroundColor as string\n )\n : COLORS.TRANSPARENT;\n const bodyBackgroundColor = iframe.contentWindow.document.body\n ? parseColor(\n context,\n getComputedStyle(iframe.contentWindow.document.body).backgroundColor as string\n )\n : COLORS.TRANSPARENT;\n\n this.backgroundColor = isTransparent(documentBackgroundColor)\n ? isTransparent(bodyBackgroundColor)\n ? this.styles.backgroundColor\n : bodyBackgroundColor\n : documentBackgroundColor;\n }\n } catch (e) {}\n }\n}\n","import { CSSParsedDeclaration } from '../css';\nimport { ElementContainer, FLAGS } from './element-container';\nimport { TextContainer } from './text-container';\nimport { ImageElementContainer } from './replaced-elements/image-element-container';\nimport { CanvasElementContainer } from './replaced-elements/canvas-element-container';\nimport { SVGElementContainer } from './replaced-elements/svg-element-container';\nimport { LIElementContainer } from './elements/li-element-container';\nimport { OLElementContainer } from './elements/ol-element-container';\nimport { InputElementContainer } from './replaced-elements/input-element-container';\nimport { SelectElementContainer } from './elements/select-element-container';\nimport { TextareaElementContainer } from './elements/textarea-element-container';\nimport { IFrameElementContainer } from './replaced-elements/iframe-element-container';\nimport { Context } from '../core/context';\nimport { contains } from '../core/bitwise';\nimport { DISPLAY } from '../css/property-descriptors/display';\n\nconst LIST_OWNERS = ['OL', 'UL', 'MENU'];\n\nconst parseNodeTree = (context: Context, node: Node, parent: ElementContainer, root: ElementContainer) => {\n for (let childNode = node.firstChild, nextNode; childNode; childNode = nextNode) {\n nextNode = childNode.nextSibling;\n\n // Fixes #2238 #1624 - Fix the issue of TextNode content being overlooked in rendering due to being perceived as blank by trim().\n if (isTextNode(childNode) && childNode.data.length > 0) {\n parent.textNodes.push(new TextContainer(context, childNode, parent.styles));\n } else if (isElementNode(childNode)) {\n if (isSlotElement(childNode) && childNode.assignedNodes) {\n childNode.assignedNodes().forEach((childNode) => parseNodeTree(context, childNode, parent, root));\n } else {\n const container = createContainer(context, childNode);\n if (container.styles.isVisible()) {\n if (createsRealStackingContext(childNode, container, root)) {\n container.flags |= FLAGS.CREATES_REAL_STACKING_CONTEXT;\n } else if (createsStackingContext(container.styles)) {\n container.flags |= FLAGS.CREATES_STACKING_CONTEXT;\n }\n\n if (LIST_OWNERS.indexOf(childNode.tagName) !== -1) {\n container.flags |= FLAGS.IS_LIST_OWNER;\n }\n\n parent.elements.push(container);\n childNode.slot;\n if (childNode.shadowRoot) {\n parseNodeTree(context, childNode.shadowRoot, container, root);\n } else if (\n !isTextareaElement(childNode) &&\n !isSVGElement(childNode) &&\n !isSelectElement(childNode)\n ) {\n parseNodeTree(context, childNode, container, root);\n }\n }\n }\n }\n }\n};\n\nconst createContainer = (context: Context, element: Element): ElementContainer => {\n if (isImageElement(element)) {\n return new ImageElementContainer(context, element);\n }\n\n if (isCanvasElement(element)) {\n return new CanvasElementContainer(context, element);\n }\n\n if (isSVGElement(element)) {\n return new SVGElementContainer(context, element);\n }\n\n if (isLIElement(element)) {\n return new LIElementContainer(context, element);\n }\n\n if (isOLElement(element)) {\n return new OLElementContainer(context, element);\n }\n\n if (isInputElement(element)) {\n return new InputElementContainer(context, element);\n }\n\n if (isSelectElement(element)) {\n return new SelectElementContainer(context, element);\n }\n\n if (isTextareaElement(element)) {\n return new TextareaElementContainer(context, element);\n }\n\n if (isIFrameElement(element)) {\n return new IFrameElementContainer(context, element);\n }\n\n return new ElementContainer(context, element);\n};\n\nexport const parseTree = (context: Context, element: HTMLElement): ElementContainer => {\n const container = createContainer(context, element);\n container.flags |= FLAGS.CREATES_REAL_STACKING_CONTEXT;\n parseNodeTree(context, element, container, container);\n return container;\n};\n\nconst createsRealStackingContext = (node: Element, container: ElementContainer, root: ElementContainer): boolean => {\n return (\n container.styles.isPositionedWithZIndex() ||\n container.styles.opacity < 1 ||\n container.styles.isTransformed() ||\n (isBodyElement(node) && root.styles.isTransparent())\n );\n};\n\nconst createsStackingContext = (styles: CSSParsedDeclaration): boolean => {\n // Positioned and floating elements create stacking contexts\n if (styles.isPositioned() || styles.isFloating()) {\n return true;\n }\n\n // Fix for Issue #137: Inline-level containers (inline-flex, inline-block, etc.)\n // should create stacking contexts to prevent their children from being added\n // to the parent's stacking context, which causes rendering order issues\n return (\n contains(styles.display, DISPLAY.INLINE_FLEX) ||\n contains(styles.display, DISPLAY.INLINE_BLOCK) ||\n contains(styles.display, DISPLAY.INLINE_GRID) ||\n contains(styles.display, DISPLAY.INLINE_TABLE)\n );\n};\n\nexport const isTextNode = (node: Node): node is Text => node.nodeType === Node.TEXT_NODE;\nexport const isElementNode = (node: Node): node is Element => node.nodeType === Node.ELEMENT_NODE;\nexport const isHTMLElementNode = (node: Node): node is HTMLElement =>\n isElementNode(node) && typeof (node as HTMLElement).style !== 'undefined' && !isSVGElementNode(node);\nexport const isSVGElementNode = (element: Element): element is SVGElement =>\n typeof (element as SVGElement).className === 'object';\nexport const isLIElement = (node: Element): node is HTMLLIElement => node.tagName === 'LI';\nexport const isOLElement = (node: Element): node is HTMLOListElement => node.tagName === 'OL';\nexport const isInputElement = (node: Element): node is HTMLInputElement => node.tagName === 'INPUT';\nexport const isHTMLElement = (node: Element): node is HTMLHtmlElement => node.tagName === 'HTML';\nexport const isSVGElement = (node: Element): node is SVGSVGElement => node.tagName === 'svg';\nexport const isBodyElement = (node: Element): node is HTMLBodyElement => node.tagName === 'BODY';\nexport const isCanvasElement = (node: Element): node is HTMLCanvasElement => node.tagName === 'CANVAS';\nexport const isVideoElement = (node: Element): node is HTMLVideoElement => node.tagName === 'VIDEO';\nexport const isImageElement = (node: Element): node is HTMLImageElement => node.tagName === 'IMG';\nexport const isIFrameElement = (node: Element): node is HTMLIFrameElement => node.tagName === 'IFRAME';\nexport const isStyleElement = (node: Element): node is HTMLStyleElement => node.tagName === 'STYLE';\nexport const isScriptElement = (node: Element): node is HTMLScriptElement => node.tagName === 'SCRIPT';\nexport const isTextareaElement = (node: Element): node is HTMLTextAreaElement => node.tagName === 'TEXTAREA';\nexport const isSelectElement = (node: Element): node is HTMLSelectElement => node.tagName === 'SELECT';\nexport const isSlotElement = (node: Element): node is HTMLSlotElement => node.tagName === 'SLOT';\n// https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\nexport const isCustomElement = (node: Element): node is HTMLElement => node.tagName.indexOf('-') > 0;\n","import { LIST_STYLE_TYPE } from '../../property-descriptors/list-style-type';\nimport { fromCodePoint } from 'css-line-break';\nimport { contains } from '../../../core/bitwise';\nimport { CSSParsedCounterDeclaration } from '../../index';\n\nexport class CounterState {\n private readonly counters: { [key: string]: number[] } = {};\n\n getCounterValue(name: string): number {\n const counter = this.counters[name];\n\n if (counter && counter.length) {\n return counter[counter.length - 1];\n }\n return 1;\n }\n\n getCounterValues(name: string): readonly number[] {\n const counter = this.counters[name];\n return counter ? counter : [];\n }\n\n pop(counters: string[]): void {\n counters.forEach((counter) => this.counters[counter].pop());\n }\n\n parse(style: CSSParsedCounterDeclaration): string[] {\n const counterIncrement = style.counterIncrement;\n const counterReset = style.counterReset;\n let canReset = true;\n\n if (counterIncrement !== null) {\n counterIncrement.forEach((entry) => {\n const counter = this.counters[entry.counter];\n if (counter && entry.increment !== 0) {\n canReset = false;\n if (!counter.length) {\n counter.push(1);\n }\n counter[Math.max(0, counter.length - 1)] += entry.increment;\n }\n });\n }\n\n const counterNames: string[] = [];\n if (canReset) {\n counterReset.forEach((entry) => {\n let counter = this.counters[entry.counter];\n counterNames.push(entry.counter);\n if (!counter) {\n counter = this.counters[entry.counter] = [];\n }\n counter.push(entry.reset);\n });\n }\n\n return counterNames;\n }\n}\n\ninterface CounterSymbols {\n integers: number[];\n values: string[];\n}\n\nconst ROMAN_UPPER: CounterSymbols = {\n integers: [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1],\n values: ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']\n};\n\nconst ARMENIAN: CounterSymbols = {\n integers: [\n 9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70,\n 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1\n ],\n values: [\n 'Ք',\n 'Փ',\n 'Ւ',\n 'Ց',\n 'Ր',\n 'Տ',\n 'Վ',\n 'Ս',\n 'Ռ',\n 'Ջ',\n 'Պ',\n 'Չ',\n 'Ո',\n 'Շ',\n 'Ն',\n 'Յ',\n 'Մ',\n 'Ճ',\n 'Ղ',\n 'Ձ',\n 'Հ',\n 'Կ',\n 'Ծ',\n 'Խ',\n 'Լ',\n 'Ի',\n 'Ժ',\n 'Թ',\n 'Ը',\n 'Է',\n 'Զ',\n 'Ե',\n 'Դ',\n 'Գ',\n 'Բ',\n 'Ա'\n ]\n};\n\nconst HEBREW: CounterSymbols = {\n integers: [\n 10000, 9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20,\n 19, 18, 17, 16, 15, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1\n ],\n values: [\n 'י׳',\n 'ט׳',\n 'ח׳',\n 'ז׳',\n 'ו׳',\n 'ה׳',\n 'ד׳',\n 'ג׳',\n 'ב׳',\n 'א׳',\n 'ת',\n 'ש',\n 'ר',\n 'ק',\n 'צ',\n 'פ',\n 'ע',\n 'ס',\n 'נ',\n 'מ',\n 'ל',\n 'כ',\n 'יט',\n 'יח',\n 'יז',\n 'טז',\n 'טו',\n 'י',\n 'ט',\n 'ח',\n 'ז',\n 'ו',\n 'ה',\n 'ד',\n 'ג',\n 'ב',\n 'א'\n ]\n};\n\nconst GEORGIAN: CounterSymbols = {\n integers: [\n 10000, 9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90,\n 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1\n ],\n values: [\n 'ჵ',\n 'ჰ',\n 'ჯ',\n 'ჴ',\n 'ხ',\n 'ჭ',\n 'წ',\n 'ძ',\n 'ც',\n 'ჩ',\n 'შ',\n 'ყ',\n 'ღ',\n 'ქ',\n 'ფ',\n 'ჳ',\n 'ტ',\n 'ს',\n 'რ',\n 'ჟ',\n 'პ',\n 'ო',\n 'ჲ',\n 'ნ',\n 'მ',\n 'ლ',\n 'კ',\n 'ი',\n 'თ',\n 'ჱ',\n 'ზ',\n 'ვ',\n 'ე',\n 'დ',\n 'გ',\n 'ბ',\n 'ა'\n ]\n};\n\nconst createAdditiveCounter = (\n value: number,\n min: number,\n max: number,\n symbols: CounterSymbols,\n fallback: LIST_STYLE_TYPE,\n suffix: string\n) => {\n if (value < min || value > max) {\n return createCounterText(value, fallback, suffix.length > 0);\n }\n\n return (\n symbols.integers.reduce((string, integer, index) => {\n while (value >= integer) {\n value -= integer;\n string += symbols.values[index];\n }\n return string;\n }, '') + suffix\n );\n};\n\nconst createCounterStyleWithSymbolResolver = (\n value: number,\n codePointRangeLength: number,\n isNumeric: boolean,\n resolver: (codePoint: number) => string\n): string => {\n let string = '';\n\n do {\n if (!isNumeric) {\n value--;\n }\n string = resolver(value) + string;\n value /= codePointRangeLength;\n } while (value * codePointRangeLength >= codePointRangeLength);\n\n return string;\n};\n\nconst createCounterStyleFromRange = (\n value: number,\n codePointRangeStart: number,\n codePointRangeEnd: number,\n isNumeric: boolean,\n suffix: string\n): string => {\n const codePointRangeLength = codePointRangeEnd - codePointRangeStart + 1;\n\n return (\n (value < 0 ? '-' : '') +\n (createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, isNumeric, (codePoint) =>\n fromCodePoint(Math.floor(codePoint % codePointRangeLength) + codePointRangeStart)\n ) +\n suffix)\n );\n};\n\nconst createCounterStyleFromSymbols = (value: number, symbols: string, suffix = '. '): string => {\n const codePointRangeLength = symbols.length;\n return (\n createCounterStyleWithSymbolResolver(\n Math.abs(value),\n codePointRangeLength,\n false,\n (codePoint) => symbols[Math.floor(codePoint % codePointRangeLength)]\n ) + suffix\n );\n};\n\nconst CJK_ZEROS = 1 << 0;\nconst CJK_TEN_COEFFICIENTS = 1 << 1;\nconst CJK_TEN_HIGH_COEFFICIENTS = 1 << 2;\nconst CJK_HUNDRED_COEFFICIENTS = 1 << 3;\n\nconst createCJKCounter = (\n value: number,\n numbers: string,\n multipliers: string,\n negativeSign: string,\n suffix: string,\n flags: number\n): string => {\n if (value < -9999 || value > 9999) {\n return createCounterText(value, LIST_STYLE_TYPE.CJK_DECIMAL, suffix.length > 0);\n }\n let tmp = Math.abs(value);\n let string = suffix;\n\n if (tmp === 0) {\n return numbers[0] + string;\n }\n\n for (let digit = 0; tmp > 0 && digit <= 4; digit++) {\n const coefficient = tmp % 10;\n\n if (coefficient === 0 && contains(flags, CJK_ZEROS) && string !== '') {\n string = numbers[coefficient] + string;\n } else if (\n coefficient > 1 ||\n (coefficient === 1 && digit === 0) ||\n (coefficient === 1 && digit === 1 && contains(flags, CJK_TEN_COEFFICIENTS)) ||\n (coefficient === 1 && digit === 1 && contains(flags, CJK_TEN_HIGH_COEFFICIENTS) && value > 100) ||\n (coefficient === 1 && digit > 1 && contains(flags, CJK_HUNDRED_COEFFICIENTS))\n ) {\n string = numbers[coefficient] + (digit > 0 ? multipliers[digit - 1] : '') + string;\n } else if (coefficient === 1 && digit > 0) {\n string = multipliers[digit - 1] + string;\n }\n tmp = Math.floor(tmp / 10);\n }\n\n return (value < 0 ? negativeSign : '') + string;\n};\n\nconst CHINESE_INFORMAL_MULTIPLIERS = '十百千萬';\nconst CHINESE_FORMAL_MULTIPLIERS = '拾佰仟萬';\nconst JAPANESE_NEGATIVE = 'マイナス';\nconst KOREAN_NEGATIVE = '마이너스';\n\nexport const createCounterText = (value: number, type: LIST_STYLE_TYPE, appendSuffix: boolean): string => {\n const defaultSuffix = appendSuffix ? '. ' : '';\n const cjkSuffix = appendSuffix ? '、' : '';\n const koreanSuffix = appendSuffix ? ', ' : '';\n const spaceSuffix = appendSuffix ? ' ' : '';\n switch (type) {\n case LIST_STYLE_TYPE.DISC:\n return '•' + spaceSuffix;\n case LIST_STYLE_TYPE.CIRCLE:\n return '◦' + spaceSuffix;\n case LIST_STYLE_TYPE.SQUARE:\n return '◾' + spaceSuffix;\n case LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO:\n const string = createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);\n return string.length < 4 ? `0${string}` : string;\n case LIST_STYLE_TYPE.CJK_DECIMAL:\n return createCounterStyleFromSymbols(value, '〇一二三四五六七八九', cjkSuffix);\n case LIST_STYLE_TYPE.LOWER_ROMAN:\n return createAdditiveCounter(\n value,\n 1,\n 3999,\n ROMAN_UPPER,\n LIST_STYLE_TYPE.DECIMAL,\n defaultSuffix\n ).toLowerCase();\n case LIST_STYLE_TYPE.UPPER_ROMAN:\n return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, LIST_STYLE_TYPE.DECIMAL, defaultSuffix);\n case LIST_STYLE_TYPE.LOWER_GREEK:\n return createCounterStyleFromRange(value, 945, 969, false, defaultSuffix);\n case LIST_STYLE_TYPE.LOWER_ALPHA:\n return createCounterStyleFromRange(value, 97, 122, false, defaultSuffix);\n case LIST_STYLE_TYPE.UPPER_ALPHA:\n return createCounterStyleFromRange(value, 65, 90, false, defaultSuffix);\n case LIST_STYLE_TYPE.ARABIC_INDIC:\n return createCounterStyleFromRange(value, 1632, 1641, true, defaultSuffix);\n case LIST_STYLE_TYPE.ARMENIAN:\n case LIST_STYLE_TYPE.UPPER_ARMENIAN:\n return createAdditiveCounter(value, 1, 9999, ARMENIAN, LIST_STYLE_TYPE.DECIMAL, defaultSuffix);\n case LIST_STYLE_TYPE.LOWER_ARMENIAN:\n return createAdditiveCounter(\n value,\n 1,\n 9999,\n ARMENIAN,\n LIST_STYLE_TYPE.DECIMAL,\n defaultSuffix\n ).toLowerCase();\n case LIST_STYLE_TYPE.BENGALI:\n return createCounterStyleFromRange(value, 2534, 2543, true, defaultSuffix);\n case LIST_STYLE_TYPE.CAMBODIAN:\n case LIST_STYLE_TYPE.KHMER:\n return createCounterStyleFromRange(value, 6112, 6121, true, defaultSuffix);\n case LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH:\n return createCounterStyleFromSymbols(value, '子丑寅卯辰巳午未申酉戌亥', cjkSuffix);\n case LIST_STYLE_TYPE.CJK_HEAVENLY_STEM:\n return createCounterStyleFromSymbols(value, '甲乙丙丁戊己庚辛壬癸', cjkSuffix);\n case LIST_STYLE_TYPE.CJK_IDEOGRAPHIC:\n case LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL:\n return createCJKCounter(\n value,\n '零一二三四五六七八九',\n CHINESE_INFORMAL_MULTIPLIERS,\n '負',\n cjkSuffix,\n CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS\n );\n case LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL:\n return createCJKCounter(\n value,\n '零壹貳參肆伍陸柒捌玖',\n CHINESE_FORMAL_MULTIPLIERS,\n '負',\n cjkSuffix,\n CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS\n );\n case LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL:\n return createCJKCounter(\n value,\n '零一二三四五六七八九',\n CHINESE_INFORMAL_MULTIPLIERS,\n '负',\n cjkSuffix,\n CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS\n );\n case LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL:\n return createCJKCounter(\n value,\n '零壹贰叁肆伍陆柒捌玖',\n CHINESE_FORMAL_MULTIPLIERS,\n '负',\n cjkSuffix,\n CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS\n );\n case LIST_STYLE_TYPE.JAPANESE_INFORMAL:\n return createCJKCounter(value, '〇一二三四五六七八九', '十百千万', JAPANESE_NEGATIVE, cjkSuffix, 0);\n case LIST_STYLE_TYPE.JAPANESE_FORMAL:\n return createCJKCounter(\n value,\n '零壱弐参四伍六七八九',\n '拾百千万',\n JAPANESE_NEGATIVE,\n cjkSuffix,\n CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS\n );\n case LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL:\n return createCJKCounter(\n value,\n '영일이삼사오육칠팔구',\n '십백천만',\n KOREAN_NEGATIVE,\n koreanSuffix,\n CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS\n );\n case LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL:\n return createCJKCounter(value, '零一二三四五六七八九', '十百千萬', KOREAN_NEGATIVE, koreanSuffix, 0);\n case LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL:\n return createCJKCounter(\n value,\n '零壹貳參四五六七八九',\n '拾百千',\n KOREAN_NEGATIVE,\n koreanSuffix,\n CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS\n );\n case LIST_STYLE_TYPE.DEVANAGARI:\n return createCounterStyleFromRange(value, 0x966, 0x96f, true, defaultSuffix);\n case LIST_STYLE_TYPE.GEORGIAN:\n return createAdditiveCounter(value, 1, 19999, GEORGIAN, LIST_STYLE_TYPE.DECIMAL, defaultSuffix);\n case LIST_STYLE_TYPE.GUJARATI:\n return createCounterStyleFromRange(value, 0xae6, 0xaef, true, defaultSuffix);\n case LIST_STYLE_TYPE.GURMUKHI:\n return createCounterStyleFromRange(value, 0xa66, 0xa6f, true, defaultSuffix);\n case LIST_STYLE_TYPE.HEBREW:\n return createAdditiveCounter(value, 1, 10999, HEBREW, LIST_STYLE_TYPE.DECIMAL, defaultSuffix);\n case LIST_STYLE_TYPE.HIRAGANA:\n return createCounterStyleFromSymbols(\n value,\n 'あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん'\n );\n case LIST_STYLE_TYPE.HIRAGANA_IROHA:\n return createCounterStyleFromSymbols(\n value,\n 'いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす'\n );\n case LIST_STYLE_TYPE.KANNADA:\n return createCounterStyleFromRange(value, 0xce6, 0xcef, true, defaultSuffix);\n case LIST_STYLE_TYPE.KATAKANA:\n return createCounterStyleFromSymbols(\n value,\n 'アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン',\n cjkSuffix\n );\n case LIST_STYLE_TYPE.KATAKANA_IROHA:\n return createCounterStyleFromSymbols(\n value,\n 'イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス',\n cjkSuffix\n );\n case LIST_STYLE_TYPE.LAO:\n return createCounterStyleFromRange(value, 0xed0, 0xed9, true, defaultSuffix);\n case LIST_STYLE_TYPE.MONGOLIAN:\n return createCounterStyleFromRange(value, 0x1810, 0x1819, true, defaultSuffix);\n case LIST_STYLE_TYPE.MYANMAR:\n return createCounterStyleFromRange(value, 0x1040, 0x1049, true, defaultSuffix);\n case LIST_STYLE_TYPE.ORIYA:\n return createCounterStyleFromRange(value, 0xb66, 0xb6f, true, defaultSuffix);\n case LIST_STYLE_TYPE.PERSIAN:\n return createCounterStyleFromRange(value, 0x6f0, 0x6f9, true, defaultSuffix);\n case LIST_STYLE_TYPE.TAMIL:\n return createCounterStyleFromRange(value, 0xbe6, 0xbef, true, defaultSuffix);\n case LIST_STYLE_TYPE.TELUGU:\n return createCounterStyleFromRange(value, 0xc66, 0xc6f, true, defaultSuffix);\n case LIST_STYLE_TYPE.THAI:\n return createCounterStyleFromRange(value, 0xe50, 0xe59, true, defaultSuffix);\n case LIST_STYLE_TYPE.TIBETAN:\n return createCounterStyleFromRange(value, 0xf20, 0xf29, true, defaultSuffix);\n case LIST_STYLE_TYPE.DECIMAL:\n default:\n return createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);\n }\n};\n","import { Bounds } from '../css/layout/bounds';\nimport {\n isBodyElement,\n isCanvasElement,\n isCustomElement,\n isElementNode,\n isHTMLElementNode,\n isIFrameElement,\n isImageElement,\n isScriptElement,\n isSelectElement,\n isSlotElement,\n isStyleElement,\n isSVGElementNode,\n isTextareaElement,\n isTextNode,\n isVideoElement\n} from './node-parser';\nimport { isIdentToken, nonFunctionArgSeparator } from '../css/syntax/parser';\nimport { TokenType } from '../css/syntax/tokenizer';\nimport { CounterState, createCounterText } from '../css/types/functions/counter';\nimport { LIST_STYLE_TYPE, listStyleType } from '../css/property-descriptors/list-style-type';\nimport { CSSParsedCounterDeclaration, CSSParsedPseudoDeclaration } from '../css/index';\nimport { getQuote } from '../css/property-descriptors/quotes';\nimport { Context } from '../core/context';\nimport { DebuggerType, isDebugging } from '../core/debugger';\n\nexport interface CloneOptions {\n ignoreElements?: (element: Element) => boolean;\n onclone?: (document: Document, element: HTMLElement) => void;\n allowTaint?: boolean;\n iframeContainer?: HTMLElement | ShadowRoot;\n}\n\nexport interface WindowOptions {\n scrollX: number;\n scrollY: number;\n windowWidth: number;\n windowHeight: number;\n}\n\nexport type CloneConfigurations = CloneOptions & {\n inlineImages: boolean;\n copyStyles: boolean;\n cspNonce?: string;\n};\n\nconst IGNORE_ATTRIBUTE = 'data-html2canvas-ignore';\n\n/**\n * Find the parent ShadowRoot of an element, if any\n * @param element - The element to check\n * @returns The parent ShadowRoot or null\n */\nconst findParentShadowRoot = (element: Element): ShadowRoot | null => {\n let current: Node | null = element;\n while (current) {\n // Check if we've reached a shadow root boundary\n if (current.parentNode && (current.parentNode as ShadowRoot).host) {\n return current.parentNode as ShadowRoot;\n }\n // Use getRootNode to check if we're in a shadow root\n const root = current.getRootNode();\n if (root && root !== current.ownerDocument && (root as ShadowRoot).host) {\n return root as ShadowRoot;\n }\n current = current.parentNode;\n }\n return null;\n};\n\nexport class DocumentCloner {\n private readonly scrolledElements: [Element, number, number][];\n private readonly referenceElement: HTMLElement;\n clonedReferenceElement?: HTMLElement;\n private readonly documentElement: HTMLElement;\n private readonly counters: CounterState;\n private quoteDepth: number;\n\n constructor(\n private readonly context: Context,\n element: HTMLElement,\n private readonly options: CloneConfigurations\n ) {\n this.scrolledElements = [];\n this.referenceElement = element;\n this.counters = new CounterState();\n this.quoteDepth = 0;\n if (!element.ownerDocument) {\n throw new Error('Cloned element does not have an owner document');\n }\n\n // Auto-detect Shadow Root if not explicitly provided\n if (!this.options.iframeContainer) {\n const shadowRoot = findParentShadowRoot(element);\n if (shadowRoot) {\n this.options.iframeContainer = shadowRoot;\n }\n }\n\n this.documentElement = this.cloneNode(element.ownerDocument.documentElement, false) as HTMLElement;\n }\n\n toIFrame(ownerDocument: Document, windowSize: Bounds): Promise<HTMLIFrameElement> {\n const iframe: HTMLIFrameElement = createIFrameContainer(\n ownerDocument,\n windowSize,\n this.options.iframeContainer\n );\n\n if (!iframe.contentWindow) {\n return Promise.reject(`Unable to find iframe window`);\n }\n\n const scrollX = (ownerDocument.defaultView as Window).pageXOffset;\n const scrollY = (ownerDocument.defaultView as Window).pageYOffset;\n\n const cloneWindow = iframe.contentWindow;\n const documentClone: Document = cloneWindow.document;\n\n /* Chrome doesn't detect relative background-images assigned in inline <style> sheets when fetched through getComputedStyle\n if window url is about:blank, we can assign the url to current by writing onto the document\n */\n\n const iframeLoad = iframeLoader(iframe).then(async () => {\n this.scrolledElements.forEach(restoreNodeScroll);\n if (cloneWindow) {\n cloneWindow.scrollTo(windowSize.left, windowSize.top);\n if (\n /(iPad|iPhone|iPod)/g.test(navigator.userAgent) &&\n (cloneWindow.scrollY !== windowSize.top || cloneWindow.scrollX !== windowSize.left)\n ) {\n this.context.logger.warn('Unable to restore scroll position for cloned document');\n this.context.windowBounds = this.context.windowBounds.add(\n cloneWindow.scrollX - windowSize.left,\n cloneWindow.scrollY - windowSize.top,\n 0,\n 0\n );\n }\n }\n\n const onclone = this.options.onclone;\n\n const referenceElement = this.clonedReferenceElement;\n\n if (typeof referenceElement === 'undefined') {\n return Promise.reject(`Error finding the ${this.referenceElement.nodeName} in the cloned document`);\n }\n\n if (documentClone.fonts && documentClone.fonts.ready) {\n await documentClone.fonts.ready;\n }\n\n if (/(AppleWebKit)/g.test(navigator.userAgent)) {\n await imagesReady(documentClone);\n }\n\n if (typeof onclone === 'function') {\n return Promise.resolve()\n .then(() => onclone(documentClone, referenceElement))\n .then(() => iframe);\n }\n\n return iframe;\n });\n /**\n * The baseURI of the document will be lost after documentClone.open().\n * We save it before open() to preserve the original base URI for resource resolution.\n * */\n const baseUri = documentClone.baseURI;\n documentClone.open();\n try {\n // fixing \"This document requires 'TrustedHTML' assignment. The action has been blocked.\" error\n // @ts-ignore\n const policy = trustedTypes.createPolicy('my-policy', {\n createHTML: (string: string) => string\n });\n const rawHTML = serializeDoctype(document.doctype) + '<html></html>';\n const trustedHTML = policy.createHTML(rawHTML);\n documentClone.write(trustedHTML);\n } catch (e) {\n // if browser does not support trustedTypes\n documentClone.write(serializeDoctype(document.doctype) + '<html></html>');\n }\n // Chrome scrolls the parent document for some reason after the write to the cloned window???\n restoreOwnerScroll(this.referenceElement.ownerDocument, scrollX, scrollY);\n /**\n * Note: adoptNode() should be called AFTER documentClone.open() and close()\n *\n * In Chrome, calling adoptNode() before or during open/write may cause\n * styles with uppercase characters in class names (e.g. \".MyClass\") to not apply correctly.\n *\n * Fix:\n * - Make sure adoptNode() is called after documentClone.open() and close()\n * - This allows Chrome to properly match and apply all CSS rules including mixed-case class selectors.\n * */\n const adoptedNode = documentClone.adoptNode(this.documentElement);\n addBase(adoptedNode, baseUri);\n documentClone.replaceChild(adoptedNode, documentClone.documentElement);\n documentClone.close();\n\n return iframeLoad;\n }\n\n createElementClone<T extends HTMLElement | SVGElement>(node: T): HTMLElement | SVGElement {\n if (isDebugging(node, DebuggerType.CLONE)) {\n debugger;\n }\n if (isCanvasElement(node)) {\n return this.createCanvasClone(node);\n }\n if (isVideoElement(node)) {\n return this.createVideoClone(node);\n }\n if (isStyleElement(node)) {\n return this.createStyleClone(node);\n }\n\n const clone = node.cloneNode(false) as T;\n if (isImageElement(clone)) {\n if (isImageElement(node) && node.currentSrc && node.currentSrc !== node.src) {\n clone.src = node.currentSrc;\n clone.srcset = '';\n }\n\n if (clone.loading === 'lazy') {\n clone.loading = 'eager';\n }\n }\n\n if (isCustomElement(clone)) {\n return this.createCustomElementClone(clone);\n }\n\n return clone;\n }\n\n createCustomElementClone(node: HTMLElement): HTMLElement {\n const clone = document.createElement('div');\n clone.className = node.className;\n copyCSSStyles(node.style, clone);\n\n // Clone shadow DOM if it exists\n // Fix for Issue #108: This is critical for Web Components with slots to work correctly\n if (node.shadowRoot) {\n try {\n clone.attachShadow({ mode: 'open' });\n // The actual shadow DOM content will be cloned in cloneChildNodes\n } catch (e) {\n // Some elements cannot have shadow roots attached\n // This can happen if the element doesn't support shadow DOM\n this.context.logger.error('Failed to attach shadow root to custom element clone:', e);\n }\n }\n\n return clone;\n }\n\n createStyleClone(node: HTMLStyleElement): HTMLStyleElement {\n try {\n const sheet = node.sheet as CSSStyleSheet | undefined;\n if (sheet && sheet.cssRules) {\n const css: string = [].slice.call(sheet.cssRules, 0).reduce((css: string, rule: CSSRule) => {\n if (rule && typeof rule.cssText === 'string') {\n return css + rule.cssText;\n }\n return css;\n }, '');\n const style = node.cloneNode(false) as HTMLStyleElement;\n style.textContent = css;\n if (this.options.cspNonce) {\n style.nonce = this.options.cspNonce;\n }\n return style;\n }\n } catch (e) {\n // accessing node.sheet.cssRules throws a DOMException\n this.context.logger.error('Unable to access cssRules property', e);\n if (e.name !== 'SecurityError') {\n throw e;\n }\n }\n const cloned = node.cloneNode(false) as HTMLStyleElement;\n if (this.options.cspNonce) {\n cloned.nonce = this.options.cspNonce;\n }\n return cloned;\n }\n\n createCanvasClone(canvas: HTMLCanvasElement): HTMLImageElement | HTMLCanvasElement {\n if (this.options.inlineImages && canvas.ownerDocument) {\n const img = canvas.ownerDocument.createElement('img');\n try {\n img.src = canvas.toDataURL();\n return img;\n } catch (e) {\n this.context.logger.info(`Unable to inline canvas contents, canvas is tainted`, canvas);\n }\n }\n\n const clonedCanvas = canvas.cloneNode(false) as HTMLCanvasElement;\n\n try {\n clonedCanvas.width = canvas.width;\n clonedCanvas.height = canvas.height;\n const ctx = canvas.getContext('2d');\n const clonedCtx = clonedCanvas.getContext('2d', { willReadFrequently: true }) as CanvasRenderingContext2D;\n if (clonedCtx) {\n if (!this.options.allowTaint && ctx) {\n clonedCtx.putImageData(ctx.getImageData(0, 0, canvas.width, canvas.height), 0, 0);\n } else {\n const gl = canvas.getContext('webgl2') ?? canvas.getContext('webgl');\n if (gl) {\n const attribs = gl.getContextAttributes();\n if (attribs?.preserveDrawingBuffer === false) {\n this.context.logger.warn(\n 'Unable to clone WebGL context as it has preserveDrawingBuffer=false',\n canvas\n );\n }\n }\n\n clonedCtx.drawImage(canvas, 0, 0);\n }\n }\n return clonedCanvas;\n } catch (e) {\n this.context.logger.info(`Unable to clone canvas as it is tainted`, canvas);\n }\n\n return clonedCanvas;\n }\n\n createVideoClone(video: HTMLVideoElement): HTMLCanvasElement {\n const canvas = video.ownerDocument.createElement('canvas');\n\n canvas.width = video.offsetWidth;\n canvas.height = video.offsetHeight;\n const ctx = canvas.getContext('2d');\n\n try {\n if (ctx) {\n ctx.drawImage(video, 0, 0, canvas.width, canvas.height);\n if (!this.options.allowTaint) {\n ctx.getImageData(0, 0, canvas.width, canvas.height);\n }\n }\n return canvas;\n } catch (e) {\n this.context.logger.info(`Unable to clone video as it is tainted`, video);\n }\n\n const blankCanvas = video.ownerDocument.createElement('canvas');\n\n blankCanvas.width = video.offsetWidth;\n blankCanvas.height = video.offsetHeight;\n return blankCanvas;\n }\n\n appendChildNode(clone: HTMLElement | SVGElement, child: Node, copyStyles: boolean): void {\n if (\n !isElementNode(child) ||\n (!isScriptElement(child) &&\n !child.hasAttribute(IGNORE_ATTRIBUTE) &&\n (typeof this.options.ignoreElements !== 'function' || !this.options.ignoreElements(child)))\n ) {\n if (!this.options.copyStyles || !isElementNode(child) || !isStyleElement(child)) {\n clone.appendChild(this.cloneNode(child, copyStyles));\n }\n }\n }\n\n /**\n * Check if a child node should be cloned based on filtering rules\n * Filters out: scripts, ignored elements, and optionally styles\n */\n private shouldCloneChild(child: Node): boolean {\n return (\n !isElementNode(child) ||\n (!isScriptElement(child) &&\n !child.hasAttribute(IGNORE_ATTRIBUTE) &&\n (typeof this.options.ignoreElements !== 'function' || !this.options.ignoreElements(child)))\n );\n }\n\n /**\n * Check if a style element should be cloned based on copyStyles option\n */\n private shouldCloneStyleElement(child: Node): boolean {\n return !this.options.copyStyles || !isElementNode(child) || !isStyleElement(child);\n }\n\n /**\n * Safely append a cloned child to a target, applying all filtering rules\n */\n private safeAppendClonedChild(\n target: ShadowRoot | HTMLElement | SVGElement,\n child: Node,\n copyStyles: boolean\n ): void {\n if (this.shouldCloneChild(child) && this.shouldCloneStyleElement(child)) {\n target.appendChild(this.cloneNode(child, copyStyles));\n }\n }\n\n /**\n * Clone assigned nodes from a slot element to the target\n */\n private cloneAssignedNodes(assignedNodes: Node[], target: ShadowRoot, copyStyles: boolean): void {\n assignedNodes.forEach((node) => {\n this.safeAppendClonedChild(target, node, copyStyles);\n });\n }\n\n /**\n * Clone fallback content from a slot element when no nodes are assigned\n */\n private cloneSlotFallbackContent(slot: Element, target: ShadowRoot, copyStyles: boolean): void {\n for (let child = slot.firstChild; child; child = child.nextSibling) {\n this.safeAppendClonedChild(target, child, copyStyles);\n }\n }\n\n /**\n * Handle cloning of a slot element, including assigned nodes or fallback content\n */\n private cloneSlotElement(slot: Element, targetShadowRoot: ShadowRoot, copyStyles: boolean): void {\n if (!isSlotElement(slot)) {\n return;\n }\n\n const slotElement = slot as HTMLSlotElement;\n\n // Defensive check: ensure assignedNodes method exists\n if (typeof slotElement.assignedNodes !== 'function') {\n this.context.logger.warn('HTMLSlotElement.assignedNodes is not available', slot);\n this.cloneSlotFallbackContent(slot, targetShadowRoot, copyStyles);\n return;\n }\n\n const assignedNodes = slotElement.assignedNodes();\n\n // Defensive check: ensure assignedNodes returns an array\n if (!assignedNodes || !Array.isArray(assignedNodes)) {\n this.context.logger.warn('assignedNodes() did not return a valid array', slot);\n this.cloneSlotFallbackContent(slot, targetShadowRoot, copyStyles);\n return;\n }\n\n if (assignedNodes.length > 0) {\n // Clone assigned nodes\n this.cloneAssignedNodes(assignedNodes, targetShadowRoot, copyStyles);\n } else {\n // Clone fallback content\n this.cloneSlotFallbackContent(slot, targetShadowRoot, copyStyles);\n }\n }\n\n /**\n * Clone shadow DOM children to the target shadow root\n */\n private cloneShadowDOMChildren(shadowRoot: ShadowRoot, targetShadowRoot: ShadowRoot, copyStyles: boolean): void {\n for (let child = shadowRoot.firstChild; child; child = child.nextSibling) {\n if (isElementNode(child) && isSlotElement(child)) {\n // Handle slot elements specially\n this.cloneSlotElement(child, targetShadowRoot, copyStyles);\n } else {\n // Clone regular elements\n this.safeAppendClonedChild(targetShadowRoot, child, copyStyles);\n }\n }\n }\n\n /**\n * Clone light DOM children to the target element\n */\n private cloneLightDOMChildren(node: Element, clone: HTMLElement | SVGElement, copyStyles: boolean): void {\n for (let child = node.firstChild; child; child = child.nextSibling) {\n this.appendChildNode(clone, child, copyStyles);\n }\n }\n\n /**\n * Clone slot element as light DOM when shadow root creation failed\n */\n private cloneSlotElementAsLightDOM(slot: Element, clone: HTMLElement | SVGElement, copyStyles: boolean): void {\n if (!isSlotElement(slot)) {\n return;\n }\n\n const slotElement = slot as HTMLSlotElement;\n\n if (typeof slotElement.assignedNodes !== 'function') {\n // Fallback: clone slot's children\n for (let child = slot.firstChild; child; child = child.nextSibling) {\n this.appendChildNode(clone, child, copyStyles);\n }\n return;\n }\n\n const assignedNodes = slotElement.assignedNodes();\n\n if (assignedNodes && Array.isArray(assignedNodes) && assignedNodes.length > 0) {\n // Clone assigned nodes as light DOM\n assignedNodes.forEach((node) => this.appendChildNode(clone, node, copyStyles));\n } else {\n // Clone fallback content as light DOM\n for (let child = slot.firstChild; child; child = child.nextSibling) {\n this.appendChildNode(clone, child, copyStyles);\n }\n }\n }\n\n /**\n * Clone shadow DOM content as light DOM when shadow root creation failed\n * This is a fallback mechanism to ensure content is not lost\n */\n private cloneShadowDOMAsLightDOM(\n shadowRoot: ShadowRoot,\n clone: HTMLElement | SVGElement,\n copyStyles: boolean\n ): void {\n for (let child = shadowRoot.firstChild; child; child = child.nextSibling) {\n if (isElementNode(child) && isSlotElement(child)) {\n this.cloneSlotElementAsLightDOM(child, clone, copyStyles);\n } else {\n this.appendChildNode(clone, child, copyStyles);\n }\n }\n }\n\n /**\n * Clone child nodes from source element to clone element\n * Handles shadow DOM, slots, and light DOM appropriately\n */\n cloneChildNodes(node: Element, clone: HTMLElement | SVGElement, copyStyles: boolean): void {\n if (node.shadowRoot && clone.shadowRoot) {\n // Both original and clone have shadow roots - clone shadow DOM content\n this.cloneShadowDOMChildren(node.shadowRoot, clone.shadowRoot, copyStyles);\n // Also clone light DOM (slot content sources)\n this.cloneLightDOMChildren(node, clone, copyStyles);\n } else if (node.shadowRoot && !clone.shadowRoot) {\n // Original has shadow root but clone doesn't (creation failed)\n // Fallback: clone shadow DOM content as light DOM to preserve content\n this.cloneShadowDOMAsLightDOM(node.shadowRoot, clone, copyStyles);\n } else {\n // No shadow DOM - just clone light DOM children\n this.cloneLightDOMChildren(node, clone, copyStyles);\n }\n }\n\n cloneNode(node: Node, copyStyles: boolean): Node {\n if (isTextNode(node)) {\n return document.createTextNode(node.data);\n }\n\n if (!node.ownerDocument) {\n return node.cloneNode(false);\n }\n\n const window = node.ownerDocument.defaultView;\n\n if (window && isElementNode(node) && (isHTMLElementNode(node) || isSVGElementNode(node))) {\n const clone = this.createElementClone(node);\n clone.style.transitionProperty = 'none';\n\n const style = window.getComputedStyle(node);\n const styleBefore = window.getComputedStyle(node, ':before');\n const styleAfter = window.getComputedStyle(node, ':after');\n\n if (this.referenceElement === node && isHTMLElementNode(clone)) {\n this.clonedReferenceElement = clone;\n }\n if (isBodyElement(clone)) {\n createPseudoHideStyles(clone, this.options.cspNonce);\n }\n\n const counters = this.counters.parse(new CSSParsedCounterDeclaration(this.context, style));\n const before = this.resolvePseudoContent(node, clone, styleBefore, PseudoElementType.BEFORE);\n\n if (isCustomElement(node)) {\n copyStyles = true;\n }\n\n if (!isVideoElement(node)) {\n this.cloneChildNodes(node, clone, copyStyles);\n }\n\n if (before) {\n clone.insertBefore(before, clone.firstChild);\n }\n\n const after = this.resolvePseudoContent(node, clone, styleAfter, PseudoElementType.AFTER);\n if (after) {\n clone.appendChild(after);\n }\n\n this.counters.pop(counters);\n\n if (\n (style && (this.options.copyStyles || isSVGElementNode(node)) && !isIFrameElement(node)) ||\n copyStyles\n ) {\n copyCSSStyles(style, clone);\n }\n\n if (node.scrollTop !== 0 || node.scrollLeft !== 0) {\n this.scrolledElements.push([clone, node.scrollLeft, node.scrollTop]);\n }\n\n if (\n (isTextareaElement(node) || isSelectElement(node)) &&\n (isTextareaElement(clone) || isSelectElement(clone))\n ) {\n clone.value = node.value;\n }\n\n return clone;\n }\n\n return node.cloneNode(false);\n }\n\n resolvePseudoContent(\n node: Element,\n clone: Element,\n style: CSSStyleDeclaration,\n pseudoElt: PseudoElementType\n ): HTMLElement | void {\n if (!style) {\n return;\n }\n\n const value = style.content;\n const document = clone.ownerDocument;\n if (!document || !value || value === 'none' || value === '-moz-alt-content' || style.display === 'none') {\n return;\n }\n\n this.counters.parse(new CSSParsedCounterDeclaration(this.context, style));\n const declaration = new CSSParsedPseudoDeclaration(this.context, style);\n\n const anonymousReplacedElement = document.createElement('html2canvaspseudoelement');\n copyCSSStyles(style, anonymousReplacedElement);\n\n declaration.content.forEach((token) => {\n if (token.type === TokenType.STRING_TOKEN) {\n anonymousReplacedElement.appendChild(document.createTextNode(token.value));\n } else if (token.type === TokenType.URL_TOKEN) {\n const img = document.createElement('img');\n img.src = token.value;\n img.style.opacity = '1';\n anonymousReplacedElement.appendChild(img);\n } else if (token.type === TokenType.FUNCTION) {\n if (token.name === 'attr') {\n const attr = token.values.filter(isIdentToken);\n if (attr.length) {\n anonymousReplacedElement.appendChild(\n document.createTextNode(node.getAttribute(attr[0].value) || '')\n );\n }\n } else if (token.name === 'counter') {\n const [counter, counterStyle] = token.values.filter(nonFunctionArgSeparator);\n if (counter && isIdentToken(counter)) {\n const counterState = this.counters.getCounterValue(counter.value);\n const counterType =\n counterStyle && isIdentToken(counterStyle)\n ? listStyleType.parse(this.context, counterStyle.value)\n : LIST_STYLE_TYPE.DECIMAL;\n\n anonymousReplacedElement.appendChild(\n document.createTextNode(createCounterText(counterState, counterType, false))\n );\n }\n } else if (token.name === 'counters') {\n const [counter, delim, counterStyle] = token.values.filter(nonFunctionArgSeparator);\n if (counter && isIdentToken(counter)) {\n const counterStates = this.counters.getCounterValues(counter.value);\n const counterType =\n counterStyle && isIdentToken(counterStyle)\n ? listStyleType.parse(this.context, counterStyle.value)\n : LIST_STYLE_TYPE.DECIMAL;\n const separator = delim && delim.type === TokenType.STRING_TOKEN ? delim.value : '';\n const text = counterStates\n .map((value) => createCounterText(value, counterType, false))\n .join(separator);\n\n anonymousReplacedElement.appendChild(document.createTextNode(text));\n }\n } else {\n // console.log('FUNCTION_TOKEN', token);\n }\n } else if (token.type === TokenType.IDENT_TOKEN) {\n switch (token.value) {\n case 'open-quote':\n anonymousReplacedElement.appendChild(\n document.createTextNode(getQuote(declaration.quotes, this.quoteDepth++, true))\n );\n break;\n case 'close-quote':\n anonymousReplacedElement.appendChild(\n document.createTextNode(getQuote(declaration.quotes, --this.quoteDepth, false))\n );\n break;\n default:\n // safari doesn't parse string tokens correctly because of lack of quotes\n anonymousReplacedElement.appendChild(document.createTextNode(token.value));\n }\n }\n });\n\n anonymousReplacedElement.className = `${PSEUDO_HIDE_ELEMENT_CLASS_BEFORE} ${PSEUDO_HIDE_ELEMENT_CLASS_AFTER}`;\n const newClassName =\n pseudoElt === PseudoElementType.BEFORE\n ? ` ${PSEUDO_HIDE_ELEMENT_CLASS_BEFORE}`\n : ` ${PSEUDO_HIDE_ELEMENT_CLASS_AFTER}`;\n\n if (isSVGElementNode(clone)) {\n clone.className.baseValue += newClassName;\n } else {\n clone.className += newClassName;\n }\n\n return anonymousReplacedElement;\n }\n\n static destroy(container: HTMLIFrameElement): boolean {\n if (container.parentNode) {\n container.parentNode.removeChild(container);\n return true;\n }\n return false;\n }\n}\n\nenum PseudoElementType {\n BEFORE,\n AFTER\n}\n\nconst createIFrameContainer = (\n ownerDocument: Document,\n bounds: Bounds,\n customContainer?: HTMLElement | ShadowRoot\n): HTMLIFrameElement => {\n const cloneIframeContainer = ownerDocument.createElement('iframe');\n\n cloneIframeContainer.className = 'html2canvas-container';\n cloneIframeContainer.style.visibility = 'hidden';\n cloneIframeContainer.style.position = 'fixed';\n cloneIframeContainer.style.left = '-10000px';\n cloneIframeContainer.style.top = '0px';\n cloneIframeContainer.style.border = '0';\n cloneIframeContainer.width = bounds.width.toString();\n cloneIframeContainer.height = bounds.height.toString();\n cloneIframeContainer.scrolling = 'no'; // ios won't scroll without it\n cloneIframeContainer.setAttribute(IGNORE_ATTRIBUTE, 'true');\n\n // Use custom container if provided, otherwise use body\n const container = customContainer || ownerDocument.body;\n container.appendChild(cloneIframeContainer);\n\n return cloneIframeContainer;\n};\n\nconst imageReady = (img: HTMLImageElement): Promise<Event | void | string> => {\n return new Promise((resolve) => {\n if (img.complete) {\n resolve();\n return;\n }\n if (!img.src) {\n resolve();\n return;\n }\n img.onload = resolve;\n img.onerror = resolve;\n });\n};\n\nconst imagesReady = (document: HTMLDocument): Promise<unknown[]> => {\n return Promise.all([].slice.call(document.images, 0).map(imageReady));\n};\n\nconst iframeLoader = (iframe: HTMLIFrameElement): Promise<HTMLIFrameElement> => {\n return new Promise((resolve, reject) => {\n const cloneWindow = iframe.contentWindow;\n\n if (!cloneWindow) {\n return reject(`No window assigned for iframe`);\n }\n\n const documentClone = cloneWindow.document;\n\n cloneWindow.onload = iframe.onload = () => {\n cloneWindow.onload = iframe.onload = null;\n const interval = setInterval(() => {\n if (documentClone.body.childNodes.length > 0 && documentClone.readyState === 'complete') {\n clearInterval(interval);\n resolve(iframe);\n }\n }, 50);\n };\n });\n};\n\nconst ignoredStyleProperties = [\n 'all', // #2476\n 'd', // #2483\n 'content' // Safari shows pseudoelements if content is set\n];\n\nexport const copyCSSStyles = <T extends HTMLElement | SVGElement>(style: CSSStyleDeclaration, target: T): T => {\n // Edge does not provide value for cssText\n for (let i = style.length - 1; i >= 0; i--) {\n const property = style.item(i);\n // fix: Chrome_138 ignore custom properties\n if (ignoredStyleProperties.indexOf(property) === -1 && !property.startsWith('--')) {\n target.style.setProperty(property, style.getPropertyValue(property));\n }\n }\n return target;\n};\n\nconst serializeDoctype = (doctype?: DocumentType | null): string => {\n let str = '';\n if (doctype) {\n str += '<!DOCTYPE ';\n if (doctype.name) {\n str += doctype.name;\n }\n\n if (doctype.internalSubset) {\n str += doctype.internalSubset;\n }\n\n if (doctype.publicId) {\n str += `\"${doctype.publicId}\"`;\n }\n\n if (doctype.systemId) {\n str += `\"${doctype.systemId}\"`;\n }\n\n str += '>';\n }\n\n return str;\n};\n\nconst restoreOwnerScroll = (ownerDocument: Document | null, x: number, y: number) => {\n if (\n ownerDocument &&\n ownerDocument.defaultView &&\n (x !== ownerDocument.defaultView.pageXOffset || y !== ownerDocument.defaultView.pageYOffset)\n ) {\n ownerDocument.defaultView.scrollTo(x, y);\n }\n};\n\nconst restoreNodeScroll = ([element, x, y]: [HTMLElement, number, number]) => {\n element.scrollLeft = x;\n element.scrollTop = y;\n};\n\nconst PSEUDO_BEFORE = ':before';\nconst PSEUDO_AFTER = ':after';\nconst PSEUDO_HIDE_ELEMENT_CLASS_BEFORE = '___html2canvas___pseudoelement_before';\nconst PSEUDO_HIDE_ELEMENT_CLASS_AFTER = '___html2canvas___pseudoelement_after';\n\nconst PSEUDO_HIDE_ELEMENT_STYLE = `{\n content: \"\" !important;\n display: none !important;\n}`;\n\nconst createPseudoHideStyles = (body: HTMLElement, cspNonce?: string) => {\n createStyles(\n body,\n `.${PSEUDO_HIDE_ELEMENT_CLASS_BEFORE}${PSEUDO_BEFORE}${PSEUDO_HIDE_ELEMENT_STYLE}\n .${PSEUDO_HIDE_ELEMENT_CLASS_AFTER}${PSEUDO_AFTER}${PSEUDO_HIDE_ELEMENT_STYLE}`,\n cspNonce\n );\n};\n\nconst createStyles = (body: HTMLElement, styles: string, cspNonce?: string) => {\n const document = body.ownerDocument;\n if (document) {\n const style = document.createElement('style');\n style.textContent = styles;\n if (cspNonce) {\n style.nonce = cspNonce;\n }\n body.appendChild(style);\n }\n};\n\nconst addBase = (targetELement: HTMLElement, baseUri: string) => {\n const baseNode = targetELement.ownerDocument.createElement('base');\n baseNode.href = baseUri;\n const headEle = targetELement.getElementsByTagName('head').item(0);\n headEle?.insertBefore(baseNode, headEle?.firstChild ?? null);\n};\n","import { FEATURES } from './features';\nimport { Context } from './context';\n\nexport class CacheStorage {\n private static _link?: HTMLAnchorElement;\n private static _origin = 'about:blank';\n\n static getOrigin(url: string): string {\n const link = CacheStorage._link;\n if (!link) {\n return 'about:blank';\n }\n\n link.href = url;\n link.href = link.href; // IE9, LOL! - http://jsfiddle.net/niklasvh/2e48b/\n return link.protocol + link.hostname + link.port;\n }\n\n static isSameOrigin(src: string): boolean {\n return CacheStorage.getOrigin(src) === CacheStorage._origin;\n }\n\n static setContext(window: Window): void {\n CacheStorage._link = window.document.createElement('a');\n CacheStorage._origin = CacheStorage.getOrigin(window.location.href);\n }\n}\n\nexport interface ResourceOptions {\n imageTimeout: number;\n useCORS: boolean;\n allowTaint: boolean;\n proxy?: string;\n customIsSameOrigin?: (this: void, src: string, oldFn: (src: string) => boolean) => boolean | Promise<boolean>;\n}\n\nexport class Cache {\n private readonly _cache: { [key: string]: Promise<any> } = {};\n\n constructor(\n private readonly context: Context,\n private readonly _options: ResourceOptions\n ) {}\n\n addImage(src: string): Promise<void> {\n const result = Promise.resolve();\n if (this.has(src)) {\n return result;\n }\n\n if (isBlobImage(src) || isRenderable(src)) {\n (this._cache[src] = this.loadImage(src)).catch(() => {\n // prevent unhandled rejection\n });\n return result;\n }\n\n return result;\n }\n\n match(src: string): Promise<any> {\n return this._cache[src];\n }\n\n private async loadImage(key: string) {\n const isSameOrigin: boolean =\n typeof this._options.customIsSameOrigin === 'function'\n ? await this._options.customIsSameOrigin(key, CacheStorage.isSameOrigin)\n : CacheStorage.isSameOrigin(key);\n const useCORS =\n !isInlineImage(key) && this._options.useCORS === true && FEATURES.SUPPORT_CORS_IMAGES && !isSameOrigin;\n const useProxy =\n !isInlineImage(key) &&\n !isSameOrigin &&\n !isBlobImage(key) &&\n typeof this._options.proxy === 'string' &&\n FEATURES.SUPPORT_CORS_XHR &&\n !useCORS;\n if (\n !isSameOrigin &&\n this._options.allowTaint === false &&\n !isInlineImage(key) &&\n !isBlobImage(key) &&\n !useProxy &&\n !useCORS\n ) {\n return;\n }\n\n let src = key;\n if (useProxy) {\n src = await this.proxy(src);\n }\n\n this.context.logger.debug(`Added image ${key.substring(0, 256)}`);\n\n return await new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => resolve(img);\n img.onerror = reject;\n //ios safari 10.3 taints canvas with data urls unless crossOrigin is set to anonymous\n if (isInlineBase64Image(src) || useCORS) {\n img.crossOrigin = 'anonymous';\n }\n img.src = src;\n if (img.complete === true) {\n // Inline XML images may fail to parse, throwing an Error later on\n setTimeout(() => resolve(img), 500);\n }\n if (this._options.imageTimeout > 0) {\n setTimeout(\n () => reject(`Timed out (${this._options.imageTimeout}ms) loading image`),\n this._options.imageTimeout\n );\n }\n });\n }\n\n private has(key: string): boolean {\n return typeof this._cache[key] !== 'undefined';\n }\n\n keys(): Promise<string[]> {\n return Promise.resolve(Object.keys(this._cache));\n }\n\n private proxy(src: string): Promise<string> {\n const proxy = this._options.proxy;\n\n if (!proxy) {\n throw new Error('No proxy defined');\n }\n\n const key = src.substring(0, 256);\n\n return new Promise((resolve, reject) => {\n const responseType = FEATURES.SUPPORT_RESPONSE_TYPE ? 'blob' : 'text';\n const xhr = new XMLHttpRequest();\n xhr.onload = () => {\n if (xhr.status === 200) {\n if (responseType === 'text') {\n resolve(xhr.response);\n } else {\n const reader = new FileReader();\n reader.addEventListener('load', () => resolve(reader.result as string), false);\n reader.addEventListener('error', (e) => reject(e), false);\n reader.readAsDataURL(xhr.response);\n }\n } else {\n reject(`Failed to proxy resource ${key} with status code ${xhr.status}`);\n }\n };\n\n xhr.onerror = reject;\n const queryString = proxy.indexOf('?') > -1 ? '&' : '?';\n xhr.open('GET', `${proxy}${queryString}url=${encodeURIComponent(src)}&responseType=${responseType}`);\n\n if (responseType !== 'text' && xhr instanceof XMLHttpRequest) {\n xhr.responseType = responseType;\n }\n\n if (this._options.imageTimeout) {\n const timeout = this._options.imageTimeout;\n xhr.timeout = timeout;\n xhr.ontimeout = () => reject(`Timed out (${timeout}ms) proxying ${key}`);\n }\n\n xhr.send();\n });\n }\n}\n\nconst INLINE_SVG = /^data:image\\/svg\\+xml/i;\nconst INLINE_BASE64 = /^data:image\\/.*;base64,/i;\nconst INLINE_IMG = /^data:image\\/.*/i;\n\nconst isRenderable = (src: string): boolean => FEATURES.SUPPORT_SVG_DRAWING || !isSVG(src);\nconst isInlineImage = (src: string): boolean => INLINE_IMG.test(src);\nconst isInlineBase64Image = (src: string): boolean => INLINE_BASE64.test(src);\nconst isBlobImage = (src: string): boolean => src.substr(0, 4) === 'blob';\n\nconst isSVG = (src: string): boolean => src.substr(-3).toLowerCase() === 'svg' || INLINE_SVG.test(src);\n","import { IPath, Path, PathType } from './path';\n\nexport class Vector implements IPath {\n type: PathType;\n x: number;\n y: number;\n\n constructor(x: number, y: number) {\n this.type = PathType.VECTOR;\n this.x = x;\n this.y = y;\n }\n\n add(deltaX: number, deltaY: number): Vector {\n return new Vector(this.x + deltaX, this.y + deltaY);\n }\n}\n\nexport const isVector = (path: Path): path is Vector => path.type === PathType.VECTOR;\n","import { Vector } from './vector';\nimport { IPath, PathType, Path } from './path';\n\nconst lerp = (a: Vector, b: Vector, t: number): Vector => {\n return new Vector(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t);\n};\n\nexport class BezierCurve implements IPath {\n type: PathType;\n start: Vector;\n startControl: Vector;\n endControl: Vector;\n end: Vector;\n\n constructor(start: Vector, startControl: Vector, endControl: Vector, end: Vector) {\n this.type = PathType.BEZIER_CURVE;\n this.start = start;\n this.startControl = startControl;\n this.endControl = endControl;\n this.end = end;\n }\n\n subdivide(t: number, firstHalf: boolean): BezierCurve {\n const ab = lerp(this.start, this.startControl, t);\n const bc = lerp(this.startControl, this.endControl, t);\n const cd = lerp(this.endControl, this.end, t);\n const abbc = lerp(ab, bc, t);\n const bccd = lerp(bc, cd, t);\n const dest = lerp(abbc, bccd, t);\n return firstHalf ? new BezierCurve(this.start, ab, abbc, dest) : new BezierCurve(dest, bccd, cd, this.end);\n }\n\n add(deltaX: number, deltaY: number): BezierCurve {\n return new BezierCurve(\n this.start.add(deltaX, deltaY),\n this.startControl.add(deltaX, deltaY),\n this.endControl.add(deltaX, deltaY),\n this.end.add(deltaX, deltaY)\n );\n }\n\n reverse(): BezierCurve {\n return new BezierCurve(this.end, this.endControl, this.startControl, this.start);\n }\n}\n\nexport const isBezierCurve = (path: Path): path is BezierCurve => path.type === PathType.BEZIER_CURVE;\n","import { ElementContainer } from '../dom/element-container';\nimport { getAbsoluteValue, getAbsoluteValueForTuple } from '../css/types/length-percentage';\nimport { Vector } from './vector';\nimport { BezierCurve } from './bezier-curve';\nimport { Path } from './path';\n\nexport class BoundCurves {\n readonly topLeftBorderDoubleOuterBox: Path;\n readonly topRightBorderDoubleOuterBox: Path;\n readonly bottomRightBorderDoubleOuterBox: Path;\n readonly bottomLeftBorderDoubleOuterBox: Path;\n readonly topLeftBorderDoubleInnerBox: Path;\n readonly topRightBorderDoubleInnerBox: Path;\n readonly bottomRightBorderDoubleInnerBox: Path;\n readonly bottomLeftBorderDoubleInnerBox: Path;\n readonly topLeftBorderStroke: Path;\n readonly topRightBorderStroke: Path;\n readonly bottomRightBorderStroke: Path;\n readonly bottomLeftBorderStroke: Path;\n readonly topLeftBorderBox: Path;\n readonly topRightBorderBox: Path;\n readonly bottomRightBorderBox: Path;\n readonly bottomLeftBorderBox: Path;\n readonly topLeftPaddingBox: Path;\n readonly topRightPaddingBox: Path;\n readonly bottomRightPaddingBox: Path;\n readonly bottomLeftPaddingBox: Path;\n readonly topLeftContentBox: Path;\n readonly topRightContentBox: Path;\n readonly bottomRightContentBox: Path;\n readonly bottomLeftContentBox: Path;\n\n constructor(element: ElementContainer) {\n const styles = element.styles;\n const bounds = element.bounds;\n\n let [tlh, tlv] = getAbsoluteValueForTuple(styles.borderTopLeftRadius, bounds.width, bounds.height);\n let [trh, trv] = getAbsoluteValueForTuple(styles.borderTopRightRadius, bounds.width, bounds.height);\n let [brh, brv] = getAbsoluteValueForTuple(styles.borderBottomRightRadius, bounds.width, bounds.height);\n let [blh, blv] = getAbsoluteValueForTuple(styles.borderBottomLeftRadius, bounds.width, bounds.height);\n\n const factors = [];\n factors.push((tlh + trh) / bounds.width);\n factors.push((blh + brh) / bounds.width);\n factors.push((tlv + blv) / bounds.height);\n factors.push((trv + brv) / bounds.height);\n const maxFactor = Math.max(...factors);\n\n if (maxFactor > 1) {\n tlh /= maxFactor;\n tlv /= maxFactor;\n trh /= maxFactor;\n trv /= maxFactor;\n brh /= maxFactor;\n brv /= maxFactor;\n blh /= maxFactor;\n blv /= maxFactor;\n }\n\n const topWidth = bounds.width - trh;\n const rightHeight = bounds.height - brv;\n const bottomWidth = bounds.width - brh;\n const leftHeight = bounds.height - blv;\n\n const borderTopWidth = styles.borderTopWidth;\n const borderRightWidth = styles.borderRightWidth;\n const borderBottomWidth = styles.borderBottomWidth;\n const borderLeftWidth = styles.borderLeftWidth;\n\n const paddingTop = getAbsoluteValue(styles.paddingTop, element.bounds.width);\n const paddingRight = getAbsoluteValue(styles.paddingRight, element.bounds.width);\n const paddingBottom = getAbsoluteValue(styles.paddingBottom, element.bounds.width);\n const paddingLeft = getAbsoluteValue(styles.paddingLeft, element.bounds.width);\n\n this.topLeftBorderDoubleOuterBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(\n bounds.left + borderLeftWidth / 3,\n bounds.top + borderTopWidth / 3,\n tlh - borderLeftWidth / 3,\n tlv - borderTopWidth / 3,\n CORNER.TOP_LEFT\n )\n : new Vector(bounds.left + borderLeftWidth / 3, bounds.top + borderTopWidth / 3);\n this.topRightBorderDoubleOuterBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(\n bounds.left + topWidth,\n bounds.top + borderTopWidth / 3,\n trh - borderRightWidth / 3,\n trv - borderTopWidth / 3,\n CORNER.TOP_RIGHT\n )\n : new Vector(bounds.left + bounds.width - borderRightWidth / 3, bounds.top + borderTopWidth / 3);\n this.bottomRightBorderDoubleOuterBox =\n brh > 0 || brv > 0\n ? getCurvePoints(\n bounds.left + bottomWidth,\n bounds.top + rightHeight,\n brh - borderRightWidth / 3,\n brv - borderBottomWidth / 3,\n CORNER.BOTTOM_RIGHT\n )\n : new Vector(\n bounds.left + bounds.width - borderRightWidth / 3,\n bounds.top + bounds.height - borderBottomWidth / 3\n );\n this.bottomLeftBorderDoubleOuterBox =\n blh > 0 || blv > 0\n ? getCurvePoints(\n bounds.left + borderLeftWidth / 3,\n bounds.top + leftHeight,\n blh - borderLeftWidth / 3,\n blv - borderBottomWidth / 3,\n CORNER.BOTTOM_LEFT\n )\n : new Vector(bounds.left + borderLeftWidth / 3, bounds.top + bounds.height - borderBottomWidth / 3);\n this.topLeftBorderDoubleInnerBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(\n bounds.left + (borderLeftWidth * 2) / 3,\n bounds.top + (borderTopWidth * 2) / 3,\n tlh - (borderLeftWidth * 2) / 3,\n tlv - (borderTopWidth * 2) / 3,\n CORNER.TOP_LEFT\n )\n : new Vector(bounds.left + (borderLeftWidth * 2) / 3, bounds.top + (borderTopWidth * 2) / 3);\n this.topRightBorderDoubleInnerBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(\n bounds.left + topWidth,\n bounds.top + (borderTopWidth * 2) / 3,\n trh - (borderRightWidth * 2) / 3,\n trv - (borderTopWidth * 2) / 3,\n CORNER.TOP_RIGHT\n )\n : new Vector(\n bounds.left + bounds.width - (borderRightWidth * 2) / 3,\n bounds.top + (borderTopWidth * 2) / 3\n );\n this.bottomRightBorderDoubleInnerBox =\n brh > 0 || brv > 0\n ? getCurvePoints(\n bounds.left + bottomWidth,\n bounds.top + rightHeight,\n brh - (borderRightWidth * 2) / 3,\n brv - (borderBottomWidth * 2) / 3,\n CORNER.BOTTOM_RIGHT\n )\n : new Vector(\n bounds.left + bounds.width - (borderRightWidth * 2) / 3,\n bounds.top + bounds.height - (borderBottomWidth * 2) / 3\n );\n this.bottomLeftBorderDoubleInnerBox =\n blh > 0 || blv > 0\n ? getCurvePoints(\n bounds.left + (borderLeftWidth * 2) / 3,\n bounds.top + leftHeight,\n blh - (borderLeftWidth * 2) / 3,\n blv - (borderBottomWidth * 2) / 3,\n CORNER.BOTTOM_LEFT\n )\n : new Vector(\n bounds.left + (borderLeftWidth * 2) / 3,\n bounds.top + bounds.height - (borderBottomWidth * 2) / 3\n );\n this.topLeftBorderStroke =\n tlh > 0 || tlv > 0\n ? getCurvePoints(\n bounds.left + borderLeftWidth / 2,\n bounds.top + borderTopWidth / 2,\n tlh - borderLeftWidth / 2,\n tlv - borderTopWidth / 2,\n CORNER.TOP_LEFT\n )\n : new Vector(bounds.left + borderLeftWidth / 2, bounds.top + borderTopWidth / 2);\n this.topRightBorderStroke =\n tlh > 0 || tlv > 0\n ? getCurvePoints(\n bounds.left + topWidth,\n bounds.top + borderTopWidth / 2,\n trh - borderRightWidth / 2,\n trv - borderTopWidth / 2,\n CORNER.TOP_RIGHT\n )\n : new Vector(bounds.left + bounds.width - borderRightWidth / 2, bounds.top + borderTopWidth / 2);\n this.bottomRightBorderStroke =\n brh > 0 || brv > 0\n ? getCurvePoints(\n bounds.left + bottomWidth,\n bounds.top + rightHeight,\n brh - borderRightWidth / 2,\n brv - borderBottomWidth / 2,\n CORNER.BOTTOM_RIGHT\n )\n : new Vector(\n bounds.left + bounds.width - borderRightWidth / 2,\n bounds.top + bounds.height - borderBottomWidth / 2\n );\n this.bottomLeftBorderStroke =\n blh > 0 || blv > 0\n ? getCurvePoints(\n bounds.left + borderLeftWidth / 2,\n bounds.top + leftHeight,\n blh - borderLeftWidth / 2,\n blv - borderBottomWidth / 2,\n CORNER.BOTTOM_LEFT\n )\n : new Vector(bounds.left + borderLeftWidth / 2, bounds.top + bounds.height - borderBottomWidth / 2);\n this.topLeftBorderBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(bounds.left, bounds.top, tlh, tlv, CORNER.TOP_LEFT)\n : new Vector(bounds.left, bounds.top);\n this.topRightBorderBox =\n trh > 0 || trv > 0\n ? getCurvePoints(bounds.left + topWidth, bounds.top, trh, trv, CORNER.TOP_RIGHT)\n : new Vector(bounds.left + bounds.width, bounds.top);\n this.bottomRightBorderBox =\n brh > 0 || brv > 0\n ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh, brv, CORNER.BOTTOM_RIGHT)\n : new Vector(bounds.left + bounds.width, bounds.top + bounds.height);\n this.bottomLeftBorderBox =\n blh > 0 || blv > 0\n ? getCurvePoints(bounds.left, bounds.top + leftHeight, blh, blv, CORNER.BOTTOM_LEFT)\n : new Vector(bounds.left, bounds.top + bounds.height);\n this.topLeftPaddingBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(\n bounds.left + borderLeftWidth,\n bounds.top + borderTopWidth,\n Math.max(0, tlh - borderLeftWidth),\n Math.max(0, tlv - borderTopWidth),\n CORNER.TOP_LEFT\n )\n : new Vector(bounds.left + borderLeftWidth, bounds.top + borderTopWidth);\n this.topRightPaddingBox =\n trh > 0 || trv > 0\n ? getCurvePoints(\n bounds.left + Math.min(topWidth, bounds.width - borderRightWidth),\n bounds.top + borderTopWidth,\n topWidth > bounds.width + borderRightWidth ? 0 : Math.max(0, trh - borderRightWidth),\n Math.max(0, trv - borderTopWidth),\n CORNER.TOP_RIGHT\n )\n : new Vector(bounds.left + bounds.width - borderRightWidth, bounds.top + borderTopWidth);\n this.bottomRightPaddingBox =\n brh > 0 || brv > 0\n ? getCurvePoints(\n bounds.left + Math.min(bottomWidth, bounds.width - borderLeftWidth),\n bounds.top + Math.min(rightHeight, bounds.height - borderBottomWidth),\n Math.max(0, brh - borderRightWidth),\n Math.max(0, brv - borderBottomWidth),\n CORNER.BOTTOM_RIGHT\n )\n : new Vector(\n bounds.left + bounds.width - borderRightWidth,\n bounds.top + bounds.height - borderBottomWidth\n );\n this.bottomLeftPaddingBox =\n blh > 0 || blv > 0\n ? getCurvePoints(\n bounds.left + borderLeftWidth,\n bounds.top + Math.min(leftHeight, bounds.height - borderBottomWidth),\n Math.max(0, blh - borderLeftWidth),\n Math.max(0, blv - borderBottomWidth),\n CORNER.BOTTOM_LEFT\n )\n : new Vector(bounds.left + borderLeftWidth, bounds.top + bounds.height - borderBottomWidth);\n this.topLeftContentBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(\n bounds.left + borderLeftWidth + paddingLeft,\n bounds.top + borderTopWidth + paddingTop,\n Math.max(0, tlh - (borderLeftWidth + paddingLeft)),\n Math.max(0, tlv - (borderTopWidth + paddingTop)),\n CORNER.TOP_LEFT\n )\n : new Vector(bounds.left + borderLeftWidth + paddingLeft, bounds.top + borderTopWidth + paddingTop);\n this.topRightContentBox =\n trh > 0 || trv > 0\n ? getCurvePoints(\n bounds.left + Math.min(topWidth, bounds.width + borderLeftWidth + paddingLeft),\n bounds.top + borderTopWidth + paddingTop,\n topWidth > bounds.width + borderLeftWidth + paddingLeft ? 0 : trh - borderLeftWidth + paddingLeft,\n trv - (borderTopWidth + paddingTop),\n CORNER.TOP_RIGHT\n )\n : new Vector(\n bounds.left + bounds.width - (borderRightWidth + paddingRight),\n bounds.top + borderTopWidth + paddingTop\n );\n this.bottomRightContentBox =\n brh > 0 || brv > 0\n ? getCurvePoints(\n bounds.left + Math.min(bottomWidth, bounds.width - (borderLeftWidth + paddingLeft)),\n bounds.top + Math.min(rightHeight, bounds.height + borderTopWidth + paddingTop),\n Math.max(0, brh - (borderRightWidth + paddingRight)),\n brv - (borderBottomWidth + paddingBottom),\n CORNER.BOTTOM_RIGHT\n )\n : new Vector(\n bounds.left + bounds.width - (borderRightWidth + paddingRight),\n bounds.top + bounds.height - (borderBottomWidth + paddingBottom)\n );\n this.bottomLeftContentBox =\n blh > 0 || blv > 0\n ? getCurvePoints(\n bounds.left + borderLeftWidth + paddingLeft,\n bounds.top + leftHeight,\n Math.max(0, blh - (borderLeftWidth + paddingLeft)),\n blv - (borderBottomWidth + paddingBottom),\n CORNER.BOTTOM_LEFT\n )\n : new Vector(\n bounds.left + borderLeftWidth + paddingLeft,\n bounds.top + bounds.height - (borderBottomWidth + paddingBottom)\n );\n }\n}\n\nenum CORNER {\n TOP_LEFT = 0,\n TOP_RIGHT = 1,\n BOTTOM_RIGHT = 2,\n BOTTOM_LEFT = 3\n}\n\nconst getCurvePoints = (x: number, y: number, r1: number, r2: number, position: CORNER): BezierCurve => {\n const kappa = 4 * ((Math.sqrt(2) - 1) / 3);\n const ox = r1 * kappa; // control point offset horizontal\n const oy = r2 * kappa; // control point offset vertical\n const xm = x + r1; // x-middle\n const ym = y + r2; // y-middle\n\n switch (position) {\n case CORNER.TOP_LEFT:\n return new BezierCurve(\n new Vector(x, ym),\n new Vector(x, ym - oy),\n new Vector(xm - ox, y),\n new Vector(xm, y)\n );\n case CORNER.TOP_RIGHT:\n return new BezierCurve(\n new Vector(x, y),\n new Vector(x + ox, y),\n new Vector(xm, ym - oy),\n new Vector(xm, ym)\n );\n case CORNER.BOTTOM_RIGHT:\n return new BezierCurve(\n new Vector(xm, y),\n new Vector(xm, y + oy),\n new Vector(x + ox, ym),\n new Vector(x, ym)\n );\n case CORNER.BOTTOM_LEFT:\n default:\n return new BezierCurve(\n new Vector(xm, ym),\n new Vector(xm - ox, ym),\n new Vector(x, y + oy),\n new Vector(x, y)\n );\n }\n};\n\nexport const calculateBorderBoxPath = (curves: BoundCurves): Path[] => {\n return [curves.topLeftBorderBox, curves.topRightBorderBox, curves.bottomRightBorderBox, curves.bottomLeftBorderBox];\n};\n\nexport const calculateContentBoxPath = (curves: BoundCurves): Path[] => {\n return [\n curves.topLeftContentBox,\n curves.topRightContentBox,\n curves.bottomRightContentBox,\n curves.bottomLeftContentBox\n ];\n};\n\nexport const calculatePaddingBoxPath = (curves: BoundCurves): Path[] => {\n return [\n curves.topLeftPaddingBox,\n curves.topRightPaddingBox,\n curves.bottomRightPaddingBox,\n curves.bottomLeftPaddingBox\n ];\n};\n","import { Matrix } from '../css/property-descriptors/transform';\nimport { Path } from './path';\n\nexport const enum EffectType {\n TRANSFORM = 0,\n CLIP = 1,\n OPACITY = 2\n}\n\nexport const enum EffectTarget {\n BACKGROUND_BORDERS = 1 << 1,\n CONTENT = 1 << 2\n}\n\nexport interface IElementEffect {\n readonly type: EffectType;\n readonly target: number;\n}\n\nexport class TransformEffect implements IElementEffect {\n readonly type: EffectType = EffectType.TRANSFORM;\n readonly target: number = EffectTarget.BACKGROUND_BORDERS | EffectTarget.CONTENT;\n\n constructor(\n readonly offsetX: number,\n readonly offsetY: number,\n readonly matrix: Matrix\n ) {}\n}\n\nexport class ClipEffect implements IElementEffect {\n readonly type: EffectType = EffectType.CLIP;\n\n constructor(\n readonly path: Path[],\n readonly target: EffectTarget\n ) {}\n}\n\nexport class OpacityEffect implements IElementEffect {\n readonly type: EffectType = EffectType.OPACITY;\n readonly target: number = EffectTarget.BACKGROUND_BORDERS | EffectTarget.CONTENT;\n\n constructor(readonly opacity: number) {}\n}\n\nexport const isTransformEffect = (effect: IElementEffect): effect is TransformEffect =>\n effect.type === EffectType.TRANSFORM;\nexport const isClipEffect = (effect: IElementEffect): effect is ClipEffect => effect.type === EffectType.CLIP;\nexport const isOpacityEffect = (effect: IElementEffect): effect is OpacityEffect => effect.type === EffectType.OPACITY;\n","import { BezierCurve } from './bezier-curve';\nimport { Vector } from './vector';\nexport const enum PathType {\n VECTOR = 0,\n BEZIER_CURVE = 1\n}\n\nexport interface IPath {\n type: PathType;\n add(deltaX: number, deltaY: number): IPath;\n}\n\nexport const equalPath = (a: Path[], b: Path[]): boolean => {\n if (a.length === b.length) {\n return a.some((v, i) => v === b[i]);\n }\n\n return false;\n};\n\nexport const transformPath = (path: Path[], deltaX: number, deltaY: number, deltaW: number, deltaH: number): Path[] => {\n return path.map((point, index) => {\n switch (index) {\n case 0:\n return point.add(deltaX, deltaY);\n case 1:\n return point.add(deltaX + deltaW, deltaY);\n case 2:\n return point.add(deltaX + deltaW, deltaY + deltaH);\n case 3:\n return point.add(deltaX, deltaY + deltaH);\n }\n return point;\n });\n};\n\nexport type Path = Vector | BezierCurve;\n","import { ElementContainer, FLAGS } from '../dom/element-container';\nimport { contains } from '../core/bitwise';\nimport { BoundCurves, calculateBorderBoxPath, calculatePaddingBoxPath } from './bound-curves';\nimport { ClipEffect, EffectTarget, IElementEffect, isClipEffect, OpacityEffect, TransformEffect } from './effects';\nimport { Matrix } from '../css/property-descriptors/transform';\nimport { OVERFLOW } from '../css/property-descriptors/overflow';\nimport { equalPath } from './path';\nimport { DISPLAY } from '../css/property-descriptors/display';\nimport { OLElementContainer } from '../dom/elements/ol-element-container';\nimport { LIElementContainer } from '../dom/elements/li-element-container';\nimport { createCounterText } from '../css/types/functions/counter';\nimport { POSITION } from '../css/property-descriptors/position';\nimport { getAbsoluteValue } from '../css/types/length-percentage';\n\nexport class StackingContext {\n element: ElementPaint;\n negativeZIndex: StackingContext[];\n zeroOrAutoZIndexOrTransformedOrOpacity: StackingContext[];\n positiveZIndex: StackingContext[];\n nonPositionedFloats: StackingContext[];\n nonPositionedInlineLevel: StackingContext[];\n inlineLevel: ElementPaint[];\n nonInlineLevel: ElementPaint[];\n\n constructor(container: ElementPaint) {\n this.element = container;\n this.inlineLevel = [];\n this.nonInlineLevel = [];\n this.negativeZIndex = [];\n this.zeroOrAutoZIndexOrTransformedOrOpacity = [];\n this.positiveZIndex = [];\n this.nonPositionedFloats = [];\n this.nonPositionedInlineLevel = [];\n }\n}\n\nexport class ElementPaint {\n readonly effects: IElementEffect[] = [];\n readonly curves: BoundCurves;\n listValue?: string;\n\n constructor(\n readonly container: ElementContainer,\n readonly parent: ElementPaint | null\n ) {\n this.curves = new BoundCurves(this.container);\n if (this.container.styles.opacity < 1) {\n this.effects.push(new OpacityEffect(this.container.styles.opacity));\n }\n\n if (this.container.styles.rotate !== null) {\n const origin = this.container.styles.transformOrigin;\n const offsetX = this.container.bounds.left + getAbsoluteValue(origin[0], this.container.bounds.width);\n const offsetY = this.container.bounds.top + getAbsoluteValue(origin[1], this.container.bounds.height);\n // Apply rotate property if present\n const angle = this.container.styles.rotate;\n const rad = (angle * Math.PI) / 180;\n const cos = Math.cos(rad);\n const sin = Math.sin(rad);\n const rotateMatrix: Matrix = [cos, sin, -sin, cos, 0, 0];\n this.effects.push(new TransformEffect(offsetX, offsetY, rotateMatrix));\n }\n\n if (this.container.styles.transform !== null) {\n const origin = this.container.styles.transformOrigin;\n const offsetX = this.container.bounds.left + getAbsoluteValue(origin[0], this.container.bounds.width);\n const offsetY = this.container.bounds.top + getAbsoluteValue(origin[1], this.container.bounds.height);\n const matrix = this.container.styles.transform;\n this.effects.push(new TransformEffect(offsetX, offsetY, matrix));\n }\n\n if (this.container.styles.overflowX !== OVERFLOW.VISIBLE) {\n const borderBox = calculateBorderBoxPath(this.curves);\n const paddingBox = calculatePaddingBoxPath(this.curves);\n\n if (equalPath(borderBox, paddingBox)) {\n this.effects.push(new ClipEffect(borderBox, EffectTarget.BACKGROUND_BORDERS | EffectTarget.CONTENT));\n } else {\n this.effects.push(new ClipEffect(borderBox, EffectTarget.BACKGROUND_BORDERS));\n this.effects.push(new ClipEffect(paddingBox, EffectTarget.CONTENT));\n }\n }\n }\n\n getEffects(target: EffectTarget): IElementEffect[] {\n let inFlow = [POSITION.ABSOLUTE, POSITION.FIXED].indexOf(this.container.styles.position) === -1;\n let parent = this.parent;\n const effects = this.effects.slice(0);\n while (parent) {\n const croplessEffects = parent.effects.filter((effect) => !isClipEffect(effect));\n if (inFlow || parent.container.styles.position !== POSITION.STATIC || !parent.parent) {\n inFlow = [POSITION.ABSOLUTE, POSITION.FIXED].indexOf(parent.container.styles.position) === -1;\n if (parent.container.styles.overflowX !== OVERFLOW.VISIBLE) {\n const borderBox = calculateBorderBoxPath(parent.curves);\n const paddingBox = calculatePaddingBoxPath(parent.curves);\n if (!equalPath(borderBox, paddingBox)) {\n effects.unshift(\n new ClipEffect(paddingBox, EffectTarget.BACKGROUND_BORDERS | EffectTarget.CONTENT)\n );\n }\n }\n effects.unshift(...croplessEffects);\n } else {\n effects.unshift(...croplessEffects);\n }\n\n parent = parent.parent;\n }\n\n return effects.filter((effect) => contains(effect.target, target));\n }\n}\n\nconst parseStackTree = (\n parent: ElementPaint,\n stackingContext: StackingContext,\n realStackingContext: StackingContext,\n listItems: ElementPaint[]\n) => {\n parent.container.elements.forEach((child) => {\n const treatAsRealStackingContext = contains(child.flags, FLAGS.CREATES_REAL_STACKING_CONTEXT);\n const createsStackingContext = contains(child.flags, FLAGS.CREATES_STACKING_CONTEXT);\n const paintContainer = new ElementPaint(child, parent);\n if (contains(child.styles.display, DISPLAY.LIST_ITEM)) {\n listItems.push(paintContainer);\n }\n\n const listOwnerItems = contains(child.flags, FLAGS.IS_LIST_OWNER) ? [] : listItems;\n\n if (treatAsRealStackingContext || createsStackingContext) {\n const parentStack =\n treatAsRealStackingContext || child.styles.isPositioned() ? realStackingContext : stackingContext;\n\n const stack = new StackingContext(paintContainer);\n\n if (child.styles.isPositioned() || child.styles.opacity < 1 || child.styles.isTransformed()) {\n const order = child.styles.zIndex.order;\n if (order < 0) {\n let index = 0;\n\n parentStack.negativeZIndex.some((current, i) => {\n if (order > current.element.container.styles.zIndex.order) {\n index = i;\n return false;\n } else if (index > 0) {\n return true;\n }\n\n return false;\n });\n parentStack.negativeZIndex.splice(index, 0, stack);\n } else if (order > 0) {\n let index = 0;\n parentStack.positiveZIndex.some((current, i) => {\n if (order >= current.element.container.styles.zIndex.order) {\n index = i + 1;\n return false;\n } else if (index > 0) {\n return true;\n }\n\n return false;\n });\n parentStack.positiveZIndex.splice(index, 0, stack);\n } else {\n parentStack.zeroOrAutoZIndexOrTransformedOrOpacity.push(stack);\n }\n } else {\n if (child.styles.isFloating()) {\n parentStack.nonPositionedFloats.push(stack);\n } else {\n parentStack.nonPositionedInlineLevel.push(stack);\n }\n }\n\n parseStackTree(\n paintContainer,\n stack,\n treatAsRealStackingContext ? stack : realStackingContext,\n listOwnerItems\n );\n } else {\n if (child.styles.isInlineLevel()) {\n stackingContext.inlineLevel.push(paintContainer);\n } else {\n stackingContext.nonInlineLevel.push(paintContainer);\n }\n\n parseStackTree(paintContainer, stackingContext, realStackingContext, listOwnerItems);\n }\n\n if (contains(child.flags, FLAGS.IS_LIST_OWNER)) {\n processListItems(child, listOwnerItems);\n }\n });\n};\n\nconst processListItems = (owner: ElementContainer, elements: ElementPaint[]) => {\n let numbering = owner instanceof OLElementContainer ? owner.start : 1;\n const reversed = owner instanceof OLElementContainer ? owner.reversed : false;\n for (let i = 0; i < elements.length; i++) {\n const item = elements[i];\n if (\n item.container instanceof LIElementContainer &&\n typeof item.container.value === 'number' &&\n item.container.value !== 0\n ) {\n numbering = item.container.value;\n }\n\n item.listValue = createCounterText(numbering, item.container.styles.listStyleType, true);\n\n numbering += reversed ? -1 : 1;\n }\n};\n\nexport const parseStackingContexts = (container: ElementContainer): StackingContext => {\n const paintContainer = new ElementPaint(container, null);\n const root = new StackingContext(paintContainer);\n const listItems: ElementPaint[] = [];\n parseStackTree(paintContainer, root, root, listItems);\n processListItems(paintContainer.container, listItems);\n return root;\n};\n","import { Path } from './path';\nimport { BoundCurves } from './bound-curves';\nimport { isBezierCurve } from './bezier-curve';\n\nexport const parsePathForBorder = (curves: BoundCurves, borderSide: number): Path[] => {\n switch (borderSide) {\n case 0:\n return createPathFromCurves(\n curves.topLeftBorderBox,\n curves.topLeftPaddingBox,\n curves.topRightBorderBox,\n curves.topRightPaddingBox\n );\n case 1:\n return createPathFromCurves(\n curves.topRightBorderBox,\n curves.topRightPaddingBox,\n curves.bottomRightBorderBox,\n curves.bottomRightPaddingBox\n );\n case 2:\n return createPathFromCurves(\n curves.bottomRightBorderBox,\n curves.bottomRightPaddingBox,\n curves.bottomLeftBorderBox,\n curves.bottomLeftPaddingBox\n );\n case 3:\n default:\n return createPathFromCurves(\n curves.bottomLeftBorderBox,\n curves.bottomLeftPaddingBox,\n curves.topLeftBorderBox,\n curves.topLeftPaddingBox\n );\n }\n};\n\nexport const parsePathForBorderDoubleOuter = (curves: BoundCurves, borderSide: number): Path[] => {\n switch (borderSide) {\n case 0:\n return createPathFromCurves(\n curves.topLeftBorderBox,\n curves.topLeftBorderDoubleOuterBox,\n curves.topRightBorderBox,\n curves.topRightBorderDoubleOuterBox\n );\n case 1:\n return createPathFromCurves(\n curves.topRightBorderBox,\n curves.topRightBorderDoubleOuterBox,\n curves.bottomRightBorderBox,\n curves.bottomRightBorderDoubleOuterBox\n );\n case 2:\n return createPathFromCurves(\n curves.bottomRightBorderBox,\n curves.bottomRightBorderDoubleOuterBox,\n curves.bottomLeftBorderBox,\n curves.bottomLeftBorderDoubleOuterBox\n );\n case 3:\n default:\n return createPathFromCurves(\n curves.bottomLeftBorderBox,\n curves.bottomLeftBorderDoubleOuterBox,\n curves.topLeftBorderBox,\n curves.topLeftBorderDoubleOuterBox\n );\n }\n};\n\nexport const parsePathForBorderDoubleInner = (curves: BoundCurves, borderSide: number): Path[] => {\n switch (borderSide) {\n case 0:\n return createPathFromCurves(\n curves.topLeftBorderDoubleInnerBox,\n curves.topLeftPaddingBox,\n curves.topRightBorderDoubleInnerBox,\n curves.topRightPaddingBox\n );\n case 1:\n return createPathFromCurves(\n curves.topRightBorderDoubleInnerBox,\n curves.topRightPaddingBox,\n curves.bottomRightBorderDoubleInnerBox,\n curves.bottomRightPaddingBox\n );\n case 2:\n return createPathFromCurves(\n curves.bottomRightBorderDoubleInnerBox,\n curves.bottomRightPaddingBox,\n curves.bottomLeftBorderDoubleInnerBox,\n curves.bottomLeftPaddingBox\n );\n case 3:\n default:\n return createPathFromCurves(\n curves.bottomLeftBorderDoubleInnerBox,\n curves.bottomLeftPaddingBox,\n curves.topLeftBorderDoubleInnerBox,\n curves.topLeftPaddingBox\n );\n }\n};\n\nexport const parsePathForBorderStroke = (curves: BoundCurves, borderSide: number): Path[] => {\n switch (borderSide) {\n case 0:\n return createStrokePathFromCurves(curves.topLeftBorderStroke, curves.topRightBorderStroke);\n case 1:\n return createStrokePathFromCurves(curves.topRightBorderStroke, curves.bottomRightBorderStroke);\n case 2:\n return createStrokePathFromCurves(curves.bottomRightBorderStroke, curves.bottomLeftBorderStroke);\n case 3:\n default:\n return createStrokePathFromCurves(curves.bottomLeftBorderStroke, curves.topLeftBorderStroke);\n }\n};\n\nconst createStrokePathFromCurves = (outer1: Path, outer2: Path): Path[] => {\n const path = [];\n if (isBezierCurve(outer1)) {\n path.push(outer1.subdivide(0.5, false));\n } else {\n path.push(outer1);\n }\n\n if (isBezierCurve(outer2)) {\n path.push(outer2.subdivide(0.5, true));\n } else {\n path.push(outer2);\n }\n\n return path;\n};\n\nconst createPathFromCurves = (outer1: Path, inner1: Path, outer2: Path, inner2: Path): Path[] => {\n const path = [];\n if (isBezierCurve(outer1)) {\n path.push(outer1.subdivide(0.5, false));\n } else {\n path.push(outer1);\n }\n\n if (isBezierCurve(outer2)) {\n path.push(outer2.subdivide(0.5, true));\n } else {\n path.push(outer2);\n }\n\n if (isBezierCurve(inner2)) {\n path.push(inner2.subdivide(0.5, true).reverse());\n } else {\n path.push(inner2);\n }\n\n if (isBezierCurve(inner1)) {\n path.push(inner1.subdivide(0.5, false).reverse());\n } else {\n path.push(inner1);\n }\n\n return path;\n};\n","import { getAbsoluteValue } from '../css/types/length-percentage';\nimport { Bounds } from '../css/layout/bounds';\nimport { ElementContainer } from '../dom/element-container';\n\nexport const paddingBox = (element: ElementContainer): Bounds => {\n const bounds = element.bounds;\n const styles = element.styles;\n return bounds.add(\n styles.borderLeftWidth,\n styles.borderTopWidth,\n -(styles.borderRightWidth + styles.borderLeftWidth),\n -(styles.borderTopWidth + styles.borderBottomWidth)\n );\n};\n\nexport const contentBox = (element: ElementContainer): Bounds => {\n const styles = element.styles;\n const bounds = element.bounds;\n\n const paddingLeft = getAbsoluteValue(styles.paddingLeft, bounds.width);\n const paddingRight = getAbsoluteValue(styles.paddingRight, bounds.width);\n const paddingTop = getAbsoluteValue(styles.paddingTop, bounds.width);\n const paddingBottom = getAbsoluteValue(styles.paddingBottom, bounds.width);\n\n return bounds.add(\n paddingLeft + styles.borderLeftWidth,\n paddingTop + styles.borderTopWidth,\n -(styles.borderRightWidth + styles.borderLeftWidth + paddingLeft + paddingRight),\n -(styles.borderTopWidth + styles.borderBottomWidth + paddingTop + paddingBottom)\n );\n};\n","import { Bounds } from '../css/layout/bounds';\nimport { BACKGROUND_ORIGIN } from '../css/property-descriptors/background-origin';\nimport { ElementContainer } from '../dom/element-container';\nimport { BACKGROUND_SIZE, BackgroundSizeInfo } from '../css/property-descriptors/background-size';\nimport { Vector } from './vector';\nimport { BACKGROUND_REPEAT } from '../css/property-descriptors/background-repeat';\nimport { getAbsoluteValue, getAbsoluteValueForTuple, isLengthPercentage } from '../css/types/length-percentage';\nimport { CSSValue, isIdentToken } from '../css/syntax/parser';\nimport { contentBox, paddingBox } from './box-sizing';\nimport { Path } from './path';\nimport { BACKGROUND_CLIP } from '../css/property-descriptors/background-clip';\n\nexport const calculateBackgroundPositioningArea = (\n backgroundOrigin: BACKGROUND_ORIGIN,\n element: ElementContainer\n): Bounds => {\n if (backgroundOrigin === BACKGROUND_ORIGIN.BORDER_BOX) {\n return element.bounds;\n }\n\n if (backgroundOrigin === BACKGROUND_ORIGIN.CONTENT_BOX) {\n return contentBox(element);\n }\n\n return paddingBox(element);\n};\n\nexport const calculateBackgroundPaintingArea = (backgroundClip: BACKGROUND_CLIP, element: ElementContainer): Bounds => {\n if (backgroundClip === BACKGROUND_CLIP.BORDER_BOX) {\n return element.bounds;\n }\n\n if (backgroundClip === BACKGROUND_CLIP.CONTENT_BOX) {\n return contentBox(element);\n }\n\n return paddingBox(element);\n};\n\nexport const calculateBackgroundRendering = (\n container: ElementContainer,\n index: number,\n intrinsicSize: [number | null, number | null, number | null]\n): [Path[], number, number, number, number] => {\n const backgroundPositioningArea = calculateBackgroundPositioningArea(\n getBackgroundValueForIndex(container.styles.backgroundOrigin, index),\n container\n );\n\n const backgroundPaintingArea = calculateBackgroundPaintingArea(\n getBackgroundValueForIndex(container.styles.backgroundClip, index),\n container\n );\n\n const backgroundImageSize = calculateBackgroundSize(\n getBackgroundValueForIndex(container.styles.backgroundSize, index),\n intrinsicSize,\n backgroundPositioningArea\n );\n\n let [sizeWidth, sizeHeight] = backgroundImageSize;\n\n const position = getAbsoluteValueForTuple(\n getBackgroundValueForIndex(container.styles.backgroundPosition, index),\n backgroundPositioningArea.width - sizeWidth,\n backgroundPositioningArea.height - sizeHeight\n );\n\n const path = calculateBackgroundRepeatPath(\n getBackgroundValueForIndex(container.styles.backgroundRepeat, index),\n position,\n backgroundImageSize,\n backgroundPositioningArea,\n backgroundPaintingArea\n );\n\n const offsetX = Math.round(backgroundPositioningArea.left + position[0]);\n const offsetY = Math.round(backgroundPositioningArea.top + position[1]);\n\n sizeWidth = Math.max(1, sizeWidth);\n sizeHeight = Math.max(1, sizeHeight);\n\n return [path, offsetX, offsetY, sizeWidth, sizeHeight];\n};\n\nexport const isAuto = (token: CSSValue): boolean => isIdentToken(token) && token.value === BACKGROUND_SIZE.AUTO;\n\nconst hasIntrinsicValue = (value: number | null): value is number => typeof value === 'number';\n\nexport const calculateBackgroundSize = (\n size: BackgroundSizeInfo[],\n [intrinsicWidth, intrinsicHeight, intrinsicProportion]: [number | null, number | null, number | null],\n bounds: Bounds\n): [number, number] => {\n const [first, second] = size;\n\n if (!first) {\n return [0, 0];\n }\n\n if (isLengthPercentage(first) && second && isLengthPercentage(second)) {\n return [getAbsoluteValue(first, bounds.width), getAbsoluteValue(second, bounds.height)];\n }\n\n const hasIntrinsicProportion = hasIntrinsicValue(intrinsicProportion);\n\n if (isIdentToken(first) && (first.value === BACKGROUND_SIZE.CONTAIN || first.value === BACKGROUND_SIZE.COVER)) {\n if (hasIntrinsicValue(intrinsicProportion)) {\n const targetRatio = bounds.width / bounds.height;\n\n return targetRatio < intrinsicProportion !== (first.value === BACKGROUND_SIZE.COVER)\n ? [bounds.width, bounds.width / intrinsicProportion]\n : [bounds.height * intrinsicProportion, bounds.height];\n }\n\n return [bounds.width, bounds.height];\n }\n\n const hasIntrinsicWidth = hasIntrinsicValue(intrinsicWidth);\n const hasIntrinsicHeight = hasIntrinsicValue(intrinsicHeight);\n const hasIntrinsicDimensions = hasIntrinsicWidth || hasIntrinsicHeight;\n\n // If the background-size is auto or auto auto:\n if (isAuto(first) && (!second || isAuto(second))) {\n // If the image has both horizontal and vertical intrinsic dimensions, it's rendered at that size.\n if (hasIntrinsicWidth && hasIntrinsicHeight) {\n return [intrinsicWidth as number, intrinsicHeight as number];\n }\n\n // If the image has no intrinsic dimensions and has no intrinsic proportions,\n // it's rendered at the size of the background positioning area.\n\n if (!hasIntrinsicProportion && !hasIntrinsicDimensions) {\n return [bounds.width, bounds.height];\n }\n\n // TODO If the image has no intrinsic dimensions but has intrinsic proportions, it's rendered as if contain had been specified instead.\n\n // If the image has only one intrinsic dimension and has intrinsic proportions, it's rendered at the size corresponding to that one dimension.\n // The other dimension is computed using the specified dimension and the intrinsic proportions.\n if (hasIntrinsicDimensions && hasIntrinsicProportion) {\n const width = hasIntrinsicWidth\n ? (intrinsicWidth as number)\n : (intrinsicHeight as number) * (intrinsicProportion as number);\n const height = hasIntrinsicHeight\n ? (intrinsicHeight as number)\n : (intrinsicWidth as number) / (intrinsicProportion as number);\n return [width, height];\n }\n\n // If the image has only one intrinsic dimension but has no intrinsic proportions,\n // it's rendered using the specified dimension and the other dimension of the background positioning area.\n const width = hasIntrinsicWidth ? (intrinsicWidth as number) : bounds.width;\n const height = hasIntrinsicHeight ? (intrinsicHeight as number) : bounds.height;\n return [width, height];\n }\n\n // If the image has intrinsic proportions, it's stretched to the specified dimension.\n // The unspecified dimension is computed using the specified dimension and the intrinsic proportions.\n if (hasIntrinsicProportion) {\n let width = 0;\n let height = 0;\n if (isLengthPercentage(first)) {\n width = getAbsoluteValue(first, bounds.width);\n } else if (isLengthPercentage(second)) {\n height = getAbsoluteValue(second, bounds.height);\n }\n\n if (isAuto(first)) {\n width = height * (intrinsicProportion as number);\n } else if (!second || isAuto(second)) {\n height = width / (intrinsicProportion as number);\n }\n\n return [width, height];\n }\n\n // If the image has no intrinsic proportions, it's stretched to the specified dimension.\n // The unspecified dimension is computed using the image's corresponding intrinsic dimension,\n // if there is one. If there is no such intrinsic dimension,\n // it becomes the corresponding dimension of the background positioning area.\n\n let width = null;\n let height = null;\n\n if (isLengthPercentage(first)) {\n width = getAbsoluteValue(first, bounds.width);\n } else if (second && isLengthPercentage(second)) {\n height = getAbsoluteValue(second, bounds.height);\n }\n\n if (width !== null && (!second || isAuto(second))) {\n height =\n hasIntrinsicWidth && hasIntrinsicHeight\n ? (width / (intrinsicWidth as number)) * (intrinsicHeight as number)\n : bounds.height;\n }\n\n if (height !== null && isAuto(first)) {\n width =\n hasIntrinsicWidth && hasIntrinsicHeight\n ? (height / (intrinsicHeight as number)) * (intrinsicWidth as number)\n : bounds.width;\n }\n\n if (width !== null && height !== null) {\n return [width, height];\n }\n\n throw new Error(`Unable to calculate background-size for element`);\n};\n\nexport const getBackgroundValueForIndex = <T>(values: T[], index: number): T => {\n const value = values[index];\n if (typeof value === 'undefined') {\n return values[0];\n }\n\n return value;\n};\n\nexport const calculateBackgroundRepeatPath = (\n repeat: BACKGROUND_REPEAT,\n [x, y]: [number, number],\n [width, height]: [number, number],\n backgroundPositioningArea: Bounds,\n backgroundPaintingArea: Bounds\n): [Vector, Vector, Vector, Vector] => {\n switch (repeat) {\n case BACKGROUND_REPEAT.REPEAT_X:\n return [\n new Vector(Math.round(backgroundPositioningArea.left), Math.round(backgroundPositioningArea.top + y)),\n new Vector(\n Math.round(backgroundPositioningArea.left + backgroundPositioningArea.width),\n Math.round(backgroundPositioningArea.top + y)\n ),\n new Vector(\n Math.round(backgroundPositioningArea.left + backgroundPositioningArea.width),\n Math.round(height + backgroundPositioningArea.top + y)\n ),\n new Vector(\n Math.round(backgroundPositioningArea.left),\n Math.round(height + backgroundPositioningArea.top + y)\n )\n ];\n case BACKGROUND_REPEAT.REPEAT_Y:\n return [\n new Vector(Math.round(backgroundPositioningArea.left + x), Math.round(backgroundPositioningArea.top)),\n new Vector(\n Math.round(backgroundPositioningArea.left + x + width),\n Math.round(backgroundPositioningArea.top)\n ),\n new Vector(\n Math.round(backgroundPositioningArea.left + x + width),\n Math.round(backgroundPositioningArea.height + backgroundPositioningArea.top)\n ),\n new Vector(\n Math.round(backgroundPositioningArea.left + x),\n Math.round(backgroundPositioningArea.height + backgroundPositioningArea.top)\n )\n ];\n case BACKGROUND_REPEAT.NO_REPEAT:\n return [\n new Vector(\n Math.round(backgroundPositioningArea.left + x),\n Math.round(backgroundPositioningArea.top + y)\n ),\n new Vector(\n Math.round(backgroundPositioningArea.left + x + width),\n Math.round(backgroundPositioningArea.top + y)\n ),\n new Vector(\n Math.round(backgroundPositioningArea.left + x + width),\n Math.round(backgroundPositioningArea.top + y + height)\n ),\n new Vector(\n Math.round(backgroundPositioningArea.left + x),\n Math.round(backgroundPositioningArea.top + y + height)\n )\n ];\n default:\n return [\n new Vector(Math.round(backgroundPaintingArea.left), Math.round(backgroundPaintingArea.top)),\n new Vector(\n Math.round(backgroundPaintingArea.left + backgroundPaintingArea.width),\n Math.round(backgroundPaintingArea.top)\n ),\n new Vector(\n Math.round(backgroundPaintingArea.left + backgroundPaintingArea.width),\n Math.round(backgroundPaintingArea.height + backgroundPaintingArea.top)\n ),\n new Vector(\n Math.round(backgroundPaintingArea.left),\n Math.round(backgroundPaintingArea.height + backgroundPaintingArea.top)\n )\n ];\n }\n};\n","export const SMALL_IMAGE = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';\n","import { SMALL_IMAGE } from '../core/util';\nexport interface FontMetric {\n baseline: number;\n middle: number;\n}\n\nconst SAMPLE_TEXT = 'Hidden Text';\n\nexport class FontMetrics {\n private readonly _data: { [key: string]: FontMetric };\n private readonly _document: Document;\n\n constructor(document: Document) {\n this._data = {};\n this._document = document;\n }\n\n private parseMetrics(fontFamily: string, fontSize: string): FontMetric {\n const container = this._document.createElement('div');\n const img = this._document.createElement('img');\n const span = this._document.createElement('span');\n\n const body = this._document.body as HTMLBodyElement;\n\n container.style.visibility = 'hidden';\n container.style.fontFamily = fontFamily;\n container.style.fontSize = fontSize;\n container.style.margin = '0';\n container.style.padding = '0';\n container.style.whiteSpace = 'nowrap';\n\n body.appendChild(container);\n\n img.src = SMALL_IMAGE;\n img.width = 1;\n img.height = 1;\n\n img.style.margin = '0';\n img.style.padding = '0';\n img.style.verticalAlign = 'baseline';\n\n span.style.fontFamily = fontFamily;\n span.style.fontSize = fontSize;\n span.style.margin = '0';\n span.style.padding = '0';\n\n span.appendChild(this._document.createTextNode(SAMPLE_TEXT));\n container.appendChild(span);\n container.appendChild(img);\n const baseline = img.offsetTop - span.offsetTop + 2;\n\n container.removeChild(span);\n container.appendChild(this._document.createTextNode(SAMPLE_TEXT));\n\n container.style.lineHeight = 'normal';\n img.style.verticalAlign = 'super';\n\n const middle = img.offsetTop - container.offsetTop + 2;\n\n body.removeChild(container);\n\n return { baseline, middle };\n }\n getMetrics(fontFamily: string, fontSize: string): FontMetric {\n const key = `${fontFamily} ${fontSize}`;\n if (typeof this._data[key] === 'undefined') {\n this._data[key] = this.parseMetrics(fontFamily, fontSize);\n }\n\n return this._data[key];\n }\n}\n","import { Context } from '../core/context';\nimport { RenderConfigurations } from './canvas/canvas-renderer';\n\nexport class Renderer {\n constructor(\n protected readonly context: Context,\n protected readonly options: RenderConfigurations\n ) {}\n}\n","import { ElementPaint, parseStackingContexts, StackingContext } from '../stacking-context';\nimport { Color } from '../../css/types/color';\nimport { asString, isTransparent } from '../../css/types/color-utilities';\nimport { ElementContainer, FLAGS } from '../../dom/element-container';\nimport { BORDER_STYLE } from '../../css/property-descriptors/border-style';\nimport { CSSParsedDeclaration } from '../../css';\nimport { TextContainer } from '../../dom/text-container';\nimport { Path, transformPath } from '../path';\nimport { BACKGROUND_CLIP } from '../../css/property-descriptors/background-clip';\nimport { BoundCurves, calculateBorderBoxPath, calculateContentBoxPath, calculatePaddingBoxPath } from '../bound-curves';\nimport { BezierCurve, isBezierCurve } from '../bezier-curve';\nimport { Vector } from '../vector';\nimport { CSSImageType, CSSURLImage, isLinearGradient, isRadialGradient } from '../../css/types/image';\nimport {\n parsePathForBorder,\n parsePathForBorderDoubleInner,\n parsePathForBorderDoubleOuter,\n parsePathForBorderStroke\n} from '../border';\nimport { calculateBackgroundRendering, getBackgroundValueForIndex } from '../background';\nimport { isDimensionToken } from '../../css/syntax/parser';\nimport { segmentGraphemes, TextBounds } from '../../css/layout/text';\nimport { ImageElementContainer } from '../../dom/replaced-elements/image-element-container';\nimport { contentBox } from '../box-sizing';\nimport { CanvasElementContainer } from '../../dom/replaced-elements/canvas-element-container';\nimport { SVGElementContainer } from '../../dom/replaced-elements/svg-element-container';\nimport { ReplacedElementContainer } from '../../dom/replaced-elements';\nimport { EffectTarget, IElementEffect, isClipEffect, isOpacityEffect, isTransformEffect } from '../effects';\nimport { contains } from '../../core/bitwise';\nimport { calculateGradientDirection, calculateRadius, processColorStops } from '../../css/types/functions/gradient';\nimport { FIFTY_PERCENT, getAbsoluteValue } from '../../css/types/length-percentage';\nimport { TEXT_DECORATION_LINE } from '../../css/property-descriptors/text-decoration-line';\nimport { TEXT_DECORATION_STYLE } from '../../css/property-descriptors/text-decoration-style';\nimport { FontMetrics } from '../font-metrics';\nimport { DISPLAY } from '../../css/property-descriptors/display';\nimport { Bounds } from '../../css/layout/bounds';\nimport { LIST_STYLE_TYPE } from '../../css/property-descriptors/list-style-type';\nimport { computeLineHeight } from '../../css/property-descriptors/line-height';\nimport {\n CHECKBOX,\n INPUT_COLOR,\n PLACEHOLDER_COLOR,\n InputElementContainer,\n RADIO\n} from '../../dom/replaced-elements/input-element-container';\nimport { TEXT_ALIGN } from '../../css/property-descriptors/text-align';\nimport { TextareaElementContainer } from '../../dom/elements/textarea-element-container';\nimport { SelectElementContainer } from '../../dom/elements/select-element-container';\nimport { IFrameElementContainer } from '../../dom/replaced-elements/iframe-element-container';\nimport { TextShadow } from '../../css/property-descriptors/text-shadow';\nimport { PAINT_ORDER_LAYER } from '../../css/property-descriptors/paint-order';\nimport { Renderer } from '../renderer';\nimport { Context } from '../../core/context';\nimport { DIRECTION } from '../../css/property-descriptors/direction';\nimport { OBJECT_FIT } from '../../css/property-descriptors/object-fit';\nimport { TEXT_OVERFLOW } from '../../css/property-descriptors/text-overflow';\nimport { OVERFLOW } from '../../css/property-descriptors/overflow';\n\nexport type RenderConfigurations = RenderOptions & {\n backgroundColor: Color | null;\n};\n\nexport interface RenderOptions {\n scale: number;\n canvas?: HTMLCanvasElement;\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nconst MASK_OFFSET = 10000;\n\nexport class CanvasRenderer extends Renderer {\n canvas: HTMLCanvasElement;\n ctx: CanvasRenderingContext2D;\n private readonly _activeEffects: IElementEffect[] = [];\n private readonly fontMetrics: FontMetrics;\n\n constructor(context: Context, options: RenderConfigurations) {\n super(context, options);\n this.canvas = options.canvas ? options.canvas : document.createElement('canvas');\n this.ctx = this.canvas.getContext('2d') as CanvasRenderingContext2D;\n if (!options.canvas) {\n this.canvas.width = Math.floor(options.width * options.scale);\n this.canvas.height = Math.floor(options.height * options.scale);\n this.canvas.style.width = `${options.width}px`;\n this.canvas.style.height = `${options.height}px`;\n }\n this.fontMetrics = new FontMetrics(document);\n this.ctx.scale(this.options.scale, this.options.scale);\n this.ctx.translate(-options.x, -options.y);\n this.ctx.textBaseline = 'bottom';\n this._activeEffects = [];\n this.context.logger.debug(\n `Canvas renderer initialized (${options.width}x${options.height}) with scale ${options.scale}`\n );\n }\n\n applyEffects(effects: IElementEffect[]): void {\n while (this._activeEffects.length) {\n this.popEffect();\n }\n\n effects.forEach((effect) => this.applyEffect(effect));\n }\n\n applyEffect(effect: IElementEffect): void {\n this.ctx.save();\n if (isOpacityEffect(effect)) {\n this.ctx.globalAlpha = effect.opacity;\n }\n\n if (isTransformEffect(effect)) {\n this.ctx.translate(effect.offsetX, effect.offsetY);\n this.ctx.transform(\n effect.matrix[0],\n effect.matrix[1],\n effect.matrix[2],\n effect.matrix[3],\n effect.matrix[4],\n effect.matrix[5]\n );\n this.ctx.translate(-effect.offsetX, -effect.offsetY);\n }\n\n if (isClipEffect(effect)) {\n this.path(effect.path);\n this.ctx.clip();\n }\n\n this._activeEffects.push(effect);\n }\n\n popEffect(): void {\n this._activeEffects.pop();\n this.ctx.restore();\n }\n\n async renderStack(stack: StackingContext): Promise<void> {\n const styles = stack.element.container.styles;\n if (styles.isVisible()) {\n await this.renderStackContent(stack);\n }\n }\n\n async renderNode(paint: ElementPaint): Promise<void> {\n if (contains(paint.container.flags, FLAGS.DEBUG_RENDER)) {\n debugger;\n }\n\n if (paint.container.styles.isVisible()) {\n await this.renderNodeBackgroundAndBorders(paint);\n await this.renderNodeContent(paint);\n }\n }\n\n renderTextWithLetterSpacing(text: TextBounds, letterSpacing: number, baseline: number): void {\n if (letterSpacing === 0) {\n // Use alphabetic baseline for consistent text positioning across browsers\n // Issue #129: text.bounds.top + text.bounds.height causes text to render too low\n this.ctx.fillText(text.text, text.bounds.left, text.bounds.top + baseline);\n } else {\n const letters = segmentGraphemes(text.text);\n letters.reduce((left, letter) => {\n this.ctx.fillText(letter, left, text.bounds.top + baseline);\n\n return left + this.ctx.measureText(letter).width;\n }, text.bounds.left);\n }\n }\n\n /**\n * Helper method to render text with paint order support\n * Reduces code duplication in line-clamp and normal rendering\n */\n private renderTextBoundWithPaintOrder(\n textBound: TextBounds,\n styles: CSSParsedDeclaration,\n paintOrderLayers: number[]\n ): void {\n paintOrderLayers.forEach((paintOrderLayer: number) => {\n switch (paintOrderLayer) {\n case PAINT_ORDER_LAYER.FILL:\n this.ctx.fillStyle = asString(styles.color);\n this.renderTextWithLetterSpacing(textBound, styles.letterSpacing, styles.fontSize.number);\n break;\n case PAINT_ORDER_LAYER.STROKE:\n if (styles.webkitTextStrokeWidth && textBound.text.trim().length) {\n this.ctx.strokeStyle = asString(styles.webkitTextStrokeColor);\n this.ctx.lineWidth = styles.webkitTextStrokeWidth;\n this.ctx.lineJoin = !!(window as any).chrome ? 'miter' : 'round';\n this.renderTextWithLetterSpacing(textBound, styles.letterSpacing, styles.fontSize.number);\n }\n break;\n }\n });\n }\n\n private renderTextDecoration(bounds: Bounds, styles: CSSParsedDeclaration): void {\n this.ctx.fillStyle = asString(styles.textDecorationColor || styles.color);\n\n // Calculate decoration line thickness\n let thickness = 1; // default\n if (typeof styles.textDecorationThickness === 'number') {\n thickness = styles.textDecorationThickness;\n } else if (styles.textDecorationThickness === 'from-font') {\n // Use a reasonable default based on font size\n thickness = Math.max(1, Math.floor(styles.fontSize.number * 0.05));\n }\n // 'auto' uses default thickness of 1\n\n // Calculate underline offset\n let underlineOffset = 0;\n if (typeof styles.textUnderlineOffset === 'number') {\n // It's a pixel value\n underlineOffset = styles.textUnderlineOffset;\n }\n // 'auto' uses default offset of 0\n\n const decorationStyle = styles.textDecorationStyle;\n\n styles.textDecorationLine.forEach((textDecorationLine) => {\n let y = 0;\n\n switch (textDecorationLine) {\n case TEXT_DECORATION_LINE.UNDERLINE:\n y = bounds.top + bounds.height - thickness + underlineOffset;\n break;\n case TEXT_DECORATION_LINE.OVERLINE:\n y = bounds.top;\n break;\n case TEXT_DECORATION_LINE.LINE_THROUGH:\n y = bounds.top + (bounds.height / 2 - thickness / 2);\n break;\n default:\n return;\n }\n\n this.drawDecorationLine(bounds.left, y, bounds.width, thickness, decorationStyle);\n });\n }\n\n private drawDecorationLine(x: number, y: number, width: number, thickness: number, style: number): void {\n switch (style) {\n case TEXT_DECORATION_STYLE.SOLID:\n // Solid line (default)\n this.ctx.fillRect(x, y, width, thickness);\n break;\n\n case TEXT_DECORATION_STYLE.DOUBLE:\n // Double line\n const gap = Math.max(1, thickness);\n this.ctx.fillRect(x, y, width, thickness);\n this.ctx.fillRect(x, y + thickness + gap, width, thickness);\n break;\n\n case TEXT_DECORATION_STYLE.DOTTED:\n // Dotted line\n this.ctx.save();\n this.ctx.beginPath();\n this.ctx.setLineDash([thickness, thickness * 2]);\n this.ctx.lineWidth = thickness;\n this.ctx.strokeStyle = this.ctx.fillStyle;\n this.ctx.moveTo(x, y + thickness / 2);\n this.ctx.lineTo(x + width, y + thickness / 2);\n this.ctx.stroke();\n this.ctx.restore();\n break;\n\n case TEXT_DECORATION_STYLE.DASHED:\n // Dashed line\n this.ctx.save();\n this.ctx.beginPath();\n this.ctx.setLineDash([thickness * 3, thickness * 2]);\n this.ctx.lineWidth = thickness;\n this.ctx.strokeStyle = this.ctx.fillStyle;\n this.ctx.moveTo(x, y + thickness / 2);\n this.ctx.lineTo(x + width, y + thickness / 2);\n this.ctx.stroke();\n this.ctx.restore();\n break;\n\n case TEXT_DECORATION_STYLE.WAVY:\n // Wavy line (approximation using quadratic curves)\n this.ctx.save();\n this.ctx.beginPath();\n this.ctx.lineWidth = thickness;\n this.ctx.strokeStyle = this.ctx.fillStyle;\n\n const amplitude = thickness * 2;\n const wavelength = thickness * 4;\n let currentX = x;\n\n this.ctx.moveTo(currentX, y + thickness / 2);\n\n while (currentX < x + width) {\n const nextX = Math.min(currentX + wavelength / 2, x + width);\n this.ctx.quadraticCurveTo(\n currentX + wavelength / 4,\n y + thickness / 2 - amplitude,\n nextX,\n y + thickness / 2\n );\n currentX = nextX;\n\n if (currentX < x + width) {\n const nextX2 = Math.min(currentX + wavelength / 2, x + width);\n this.ctx.quadraticCurveTo(\n currentX + wavelength / 4,\n y + thickness / 2 + amplitude,\n nextX2,\n y + thickness / 2\n );\n currentX = nextX2;\n }\n }\n\n this.ctx.stroke();\n this.ctx.restore();\n break;\n\n default:\n // Fallback to solid\n this.ctx.fillRect(x, y, width, thickness);\n }\n }\n\n // Helper method to truncate text and add ellipsis if needed\n private truncateTextWithEllipsis(text: string, maxWidth: number, letterSpacing: number): string {\n const ellipsis = '...';\n const ellipsisWidth = this.ctx.measureText(ellipsis).width;\n\n if (letterSpacing === 0) {\n let truncated = text;\n while (this.ctx.measureText(truncated).width + ellipsisWidth > maxWidth && truncated.length > 0) {\n truncated = truncated.slice(0, -1);\n }\n return truncated + ellipsis;\n } else {\n const letters = segmentGraphemes(text);\n let width = ellipsisWidth;\n let result: string[] = [];\n\n for (const letter of letters) {\n const letterWidth = this.ctx.measureText(letter).width + letterSpacing;\n if (width + letterWidth > maxWidth) {\n break;\n }\n result.push(letter);\n width += letterWidth;\n }\n\n return result.join('') + ellipsis;\n }\n }\n\n private createFontStyle(styles: CSSParsedDeclaration): string[] {\n const fontVariant = styles.fontVariant\n .filter((variant) => variant === 'normal' || variant === 'small-caps')\n .join('');\n const fontFamily = fixIOSSystemFonts(styles.fontFamily).join(', ');\n const fontSize = isDimensionToken(styles.fontSize)\n ? `${styles.fontSize.number}${styles.fontSize.unit}`\n : `${styles.fontSize.number}px`;\n\n return [\n [styles.fontStyle, fontVariant, styles.fontWeight, fontSize, fontFamily].join(' '),\n fontFamily,\n fontSize\n ];\n }\n\n async renderTextNode(text: TextContainer, styles: CSSParsedDeclaration, containerBounds?: Bounds): Promise<void> {\n const [font] = this.createFontStyle(styles);\n\n this.ctx.font = font;\n\n this.ctx.direction = styles.direction === DIRECTION.RTL ? 'rtl' : 'ltr';\n this.ctx.textAlign = 'left';\n this.ctx.textBaseline = 'alphabetic';\n const paintOrder = styles.paintOrder;\n\n // Calculate line height for text layout detection (used by both line-clamp and ellipsis)\n const lineHeight = styles.fontSize.number * 1.5;\n\n // Check if we need to apply -webkit-line-clamp\n // This limits text to a specific number of lines with ellipsis\n const shouldApplyLineClamp =\n styles.webkitLineClamp > 0 &&\n (styles.display & DISPLAY.BLOCK) !== 0 &&\n styles.overflowY === OVERFLOW.HIDDEN &&\n text.textBounds.length > 0;\n\n if (shouldApplyLineClamp) {\n // Group text bounds by lines based on their Y position\n const lines: TextBounds[][] = [];\n let currentLine: TextBounds[] = [];\n let currentLineTop = text.textBounds[0].bounds.top;\n\n text.textBounds.forEach((tb) => {\n // If this text bound is on a different line, start a new line\n if (Math.abs(tb.bounds.top - currentLineTop) >= lineHeight * 0.5) {\n if (currentLine.length > 0) {\n lines.push(currentLine);\n }\n currentLine = [tb];\n currentLineTop = tb.bounds.top;\n } else {\n currentLine.push(tb);\n }\n });\n\n // Don't forget the last line\n if (currentLine.length > 0) {\n lines.push(currentLine);\n }\n\n // Only render up to webkitLineClamp lines\n const maxLines = styles.webkitLineClamp;\n if (lines.length > maxLines) {\n // Render only the first (maxLines - 1) complete lines\n for (let i = 0; i < maxLines - 1; i++) {\n lines[i].forEach((textBound) => {\n this.renderTextBoundWithPaintOrder(textBound, styles, paintOrder);\n });\n }\n\n // For the last line, truncate with ellipsis\n const lastLine = lines[maxLines - 1];\n if (lastLine && lastLine.length > 0 && containerBounds) {\n const lastLineText = lastLine.map((tb) => tb.text).join('');\n const firstBound = lastLine[0];\n const availableWidth = containerBounds.width - (firstBound.bounds.left - containerBounds.left);\n const truncatedText = this.truncateTextWithEllipsis(\n lastLineText,\n availableWidth,\n styles.letterSpacing\n );\n\n paintOrder.forEach((paintOrderLayer) => {\n switch (paintOrderLayer) {\n case PAINT_ORDER_LAYER.FILL:\n this.ctx.fillStyle = asString(styles.color);\n if (styles.letterSpacing === 0) {\n this.ctx.fillText(\n truncatedText,\n firstBound.bounds.left,\n firstBound.bounds.top + styles.fontSize.number\n );\n } else {\n const letters = segmentGraphemes(truncatedText);\n letters.reduce((left, letter) => {\n this.ctx.fillText(letter, left, firstBound.bounds.top + styles.fontSize.number);\n return left + this.ctx.measureText(letter).width + styles.letterSpacing;\n }, firstBound.bounds.left);\n }\n break;\n case PAINT_ORDER_LAYER.STROKE:\n if (styles.webkitTextStrokeWidth && truncatedText.trim().length) {\n this.ctx.strokeStyle = asString(styles.webkitTextStrokeColor);\n this.ctx.lineWidth = styles.webkitTextStrokeWidth;\n this.ctx.lineJoin = !!(window as any).chrome ? 'miter' : 'round';\n if (styles.letterSpacing === 0) {\n this.ctx.strokeText(\n truncatedText,\n firstBound.bounds.left,\n firstBound.bounds.top + styles.fontSize.number\n );\n } else {\n const letters = segmentGraphemes(truncatedText);\n letters.reduce((left, letter) => {\n this.ctx.strokeText(\n letter,\n left,\n firstBound.bounds.top + styles.fontSize.number\n );\n return left + this.ctx.measureText(letter).width + styles.letterSpacing;\n }, firstBound.bounds.left);\n }\n }\n break;\n }\n });\n }\n return; // Don't render anything else\n }\n // If lines.length <= maxLines, fall through to normal rendering\n }\n\n // Check if we need to apply text-overflow: ellipsis\n // Issue #203: Only apply ellipsis for single-line text overflow\n // Multi-line text truncation (like -webkit-line-clamp) should not be affected\n const shouldApplyEllipsis =\n styles.textOverflow === TEXT_OVERFLOW.ELLIPSIS &&\n containerBounds &&\n styles.overflowX === OVERFLOW.HIDDEN &&\n text.textBounds.length > 0;\n\n // Calculate total text width if ellipsis might be needed\n let needsEllipsis = false;\n let truncatedText = '';\n if (shouldApplyEllipsis) {\n // Check if all text bounds are on approximately the same line (single-line scenario)\n // For multi-line text (like -webkit-line-clamp), textBounds will have different Y positions\n const firstTop = text.textBounds[0].bounds.top;\n const isSingleLine = text.textBounds.every((tb) => Math.abs(tb.bounds.top - firstTop) < lineHeight * 0.5);\n\n if (isSingleLine) {\n // Measure the full text content\n // Note: text.textBounds may contain whitespace characters from HTML formatting\n // We need to collapse them like the browser does for white-space: nowrap\n let fullText = text.textBounds.map((tb) => tb.text).join('');\n\n // Collapse whitespace: replace sequences of whitespace (including newlines) with single spaces\n // and trim leading/trailing whitespace\n fullText = fullText.replace(/\\s+/g, ' ').trim();\n\n const fullTextWidth = this.ctx.measureText(fullText).width;\n const availableWidth = containerBounds.width;\n\n if (fullTextWidth > availableWidth) {\n needsEllipsis = true;\n truncatedText = this.truncateTextWithEllipsis(fullText, availableWidth, styles.letterSpacing);\n }\n }\n }\n\n // If ellipsis is needed, render the truncated text once\n if (needsEllipsis) {\n const firstBound = text.textBounds[0];\n paintOrder.forEach((paintOrderLayer) => {\n switch (paintOrderLayer) {\n case PAINT_ORDER_LAYER.FILL:\n this.ctx.fillStyle = asString(styles.color);\n\n if (styles.letterSpacing === 0) {\n this.ctx.fillText(\n truncatedText,\n firstBound.bounds.left,\n firstBound.bounds.top + styles.fontSize.number\n );\n } else {\n const letters = segmentGraphemes(truncatedText);\n letters.reduce((left, letter) => {\n this.ctx.fillText(letter, left, firstBound.bounds.top + styles.fontSize.number);\n return left + this.ctx.measureText(letter).width + styles.letterSpacing;\n }, firstBound.bounds.left);\n }\n\n const textShadows: TextShadow = styles.textShadow;\n if (textShadows.length && truncatedText.trim().length) {\n textShadows\n .slice(0)\n .reverse()\n .forEach((textShadow) => {\n this.ctx.shadowColor = asString(textShadow.color);\n this.ctx.shadowOffsetX = textShadow.offsetX.number * this.options.scale;\n this.ctx.shadowOffsetY = textShadow.offsetY.number * this.options.scale;\n this.ctx.shadowBlur = textShadow.blur.number;\n\n if (styles.letterSpacing === 0) {\n this.ctx.fillText(\n truncatedText,\n firstBound.bounds.left,\n firstBound.bounds.top + styles.fontSize.number\n );\n } else {\n const letters = segmentGraphemes(truncatedText);\n letters.reduce((left, letter) => {\n this.ctx.fillText(\n letter,\n left,\n firstBound.bounds.top + styles.fontSize.number\n );\n return left + this.ctx.measureText(letter).width + styles.letterSpacing;\n }, firstBound.bounds.left);\n }\n });\n\n this.ctx.shadowColor = '';\n this.ctx.shadowOffsetX = 0;\n this.ctx.shadowOffsetY = 0;\n this.ctx.shadowBlur = 0;\n }\n break;\n case PAINT_ORDER_LAYER.STROKE:\n if (styles.webkitTextStrokeWidth && truncatedText.trim().length) {\n this.ctx.strokeStyle = asString(styles.webkitTextStrokeColor);\n this.ctx.lineWidth = styles.webkitTextStrokeWidth;\n this.ctx.lineJoin = !!(window as any).chrome ? 'miter' : 'round';\n\n if (styles.letterSpacing === 0) {\n this.ctx.strokeText(\n truncatedText,\n firstBound.bounds.left,\n firstBound.bounds.top + styles.fontSize.number\n );\n } else {\n const letters = segmentGraphemes(truncatedText);\n letters.reduce((left, letter) => {\n this.ctx.strokeText(letter, left, firstBound.bounds.top + styles.fontSize.number);\n return left + this.ctx.measureText(letter).width + styles.letterSpacing;\n }, firstBound.bounds.left);\n }\n }\n break;\n }\n });\n return;\n }\n\n // Normal rendering (no ellipsis needed)\n text.textBounds.forEach((text) => {\n paintOrder.forEach((paintOrderLayer) => {\n switch (paintOrderLayer) {\n case PAINT_ORDER_LAYER.FILL:\n this.ctx.fillStyle = asString(styles.color);\n this.renderTextWithLetterSpacing(text, styles.letterSpacing, styles.fontSize.number);\n const textShadows: TextShadow = styles.textShadow;\n\n if (textShadows.length && text.text.trim().length) {\n textShadows\n .slice(0)\n .reverse()\n .forEach((textShadow) => {\n this.ctx.shadowColor = asString(textShadow.color);\n this.ctx.shadowOffsetX = textShadow.offsetX.number * this.options.scale;\n this.ctx.shadowOffsetY = textShadow.offsetY.number * this.options.scale;\n this.ctx.shadowBlur = textShadow.blur.number;\n\n this.renderTextWithLetterSpacing(\n text,\n styles.letterSpacing,\n styles.fontSize.number\n );\n });\n\n this.ctx.shadowColor = '';\n this.ctx.shadowOffsetX = 0;\n this.ctx.shadowOffsetY = 0;\n this.ctx.shadowBlur = 0;\n }\n\n if (styles.textDecorationLine.length) {\n this.renderTextDecoration(text.bounds, styles);\n }\n break;\n case PAINT_ORDER_LAYER.STROKE:\n if (styles.webkitTextStrokeWidth && text.text.trim().length) {\n this.ctx.strokeStyle = asString(styles.webkitTextStrokeColor);\n this.ctx.lineWidth = styles.webkitTextStrokeWidth;\n\n this.ctx.lineJoin = !!(window as any).chrome ? 'miter' : 'round';\n // Issue #110: Use baseline (fontSize) for consistent positioning with fill\n // Previously used text.bounds.height which caused stroke to render too low\n const baseline = styles.fontSize.number;\n if (styles.letterSpacing === 0) {\n this.ctx.strokeText(text.text, text.bounds.left, text.bounds.top + baseline);\n } else {\n const letters = segmentGraphemes(text.text);\n letters.reduce((left, letter) => {\n this.ctx.strokeText(letter, left, text.bounds.top + baseline);\n return left + this.ctx.measureText(letter).width;\n }, text.bounds.left);\n }\n }\n this.ctx.strokeStyle = '';\n this.ctx.lineWidth = 0;\n this.ctx.lineJoin = 'miter';\n break;\n }\n });\n });\n }\n\n renderReplacedElement(\n container: ReplacedElementContainer,\n curves: BoundCurves,\n image: HTMLImageElement | HTMLCanvasElement\n ): void {\n const intrinsicWidth = (image as HTMLImageElement).naturalWidth || container.intrinsicWidth;\n const intrinsicHeight = (image as HTMLImageElement).naturalHeight || container.intrinsicHeight;\n if (image && intrinsicWidth > 0 && intrinsicHeight > 0) {\n const box = contentBox(container);\n const path = calculatePaddingBoxPath(curves);\n this.path(path);\n this.ctx.save();\n this.ctx.clip();\n let sx = 0,\n sy = 0,\n sw: number = intrinsicWidth,\n sh: number = intrinsicHeight,\n dx: number = box.left,\n dy: number = box.top,\n dw: number = box.width,\n dh: number = box.height;\n const { objectFit } = container.styles;\n const boxRatio = dw / dh;\n const imgRatio = sw / sh;\n if (objectFit === OBJECT_FIT.CONTAIN) {\n if (imgRatio > boxRatio) {\n dh = dw / imgRatio;\n dy += (box.height - dh) / 2;\n } else {\n dw = dh * imgRatio;\n dx += (box.width - dw) / 2;\n }\n } else if (objectFit === OBJECT_FIT.COVER) {\n if (imgRatio > boxRatio) {\n sw = sh * boxRatio;\n sx += (intrinsicWidth - sw) / 2;\n } else {\n sh = sw / boxRatio;\n sy += (intrinsicHeight - sh) / 2;\n }\n } else if (objectFit === OBJECT_FIT.NONE) {\n if (sw > dw) {\n sx += (sw - dw) / 2;\n sw = dw;\n } else {\n dx += (dw - sw) / 2;\n dw = sw;\n }\n if (sh > dh) {\n sy += (sh - dh) / 2;\n sh = dh;\n } else {\n dy += (dh - sh) / 2;\n dh = sh;\n }\n } else if (objectFit === OBJECT_FIT.SCALE_DOWN) {\n const containW = imgRatio > boxRatio ? dw : dh * imgRatio;\n const noneW = sw > dw ? sw : dw;\n if (containW < noneW) {\n if (imgRatio > boxRatio) {\n dh = dw / imgRatio;\n dy += (box.height - dh) / 2;\n } else {\n dw = dh * imgRatio;\n dx += (box.width - dw) / 2;\n }\n } else {\n if (sw > dw) {\n sx += (sw - dw) / 2;\n sw = dw;\n } else {\n dx += (dw - sw) / 2;\n dw = sw;\n }\n if (sh > dh) {\n sy += (sh - dh) / 2;\n sh = dh;\n } else {\n dy += (dh - sh) / 2;\n dh = sh;\n }\n }\n }\n this.ctx.drawImage(image, sx, sy, sw, sh, dx, dy, dw, dh);\n this.ctx.restore();\n }\n }\n\n async renderNodeContent(paint: ElementPaint): Promise<void> {\n this.applyEffects(paint.getEffects(EffectTarget.CONTENT));\n const container = paint.container;\n const curves = paint.curves;\n const styles = container.styles;\n // Use content box for text overflow calculation (excludes padding and border)\n // This matches browser behavior where text-overflow uses the content width\n const textBounds = contentBox(container);\n for (const child of container.textNodes) {\n await this.renderTextNode(child, styles, textBounds);\n }\n\n if (container instanceof ImageElementContainer) {\n try {\n const image = await this.context.cache.match(container.src);\n this.renderReplacedElement(container, curves, image);\n } catch (e) {\n this.context.logger.error(`Error loading image ${container.src}`);\n }\n }\n\n if (container instanceof CanvasElementContainer) {\n this.renderReplacedElement(container, curves, container.canvas);\n }\n\n if (container instanceof SVGElementContainer) {\n try {\n const image = await this.context.cache.match(container.svg);\n this.renderReplacedElement(container, curves, image);\n } catch (e) {\n this.context.logger.error(`Error loading svg ${container.svg.substring(0, 255)}`);\n }\n }\n\n if (container instanceof IFrameElementContainer && container.tree) {\n const iframeRenderer = new CanvasRenderer(this.context, {\n scale: this.options.scale,\n backgroundColor: container.backgroundColor,\n x: 0,\n y: 0,\n width: container.width,\n height: container.height\n });\n\n const canvas = await iframeRenderer.render(container.tree);\n if (container.width && container.height) {\n this.ctx.drawImage(\n canvas,\n 0,\n 0,\n container.width,\n container.height,\n container.bounds.left,\n container.bounds.top,\n container.bounds.width,\n container.bounds.height\n );\n }\n }\n\n if (container instanceof InputElementContainer) {\n const size = Math.min(container.bounds.width, container.bounds.height);\n\n if (container.type === CHECKBOX) {\n if (container.checked) {\n this.ctx.save();\n this.path([\n new Vector(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79),\n new Vector(container.bounds.left + size * 0.16, container.bounds.top + size * 0.5549),\n new Vector(container.bounds.left + size * 0.27347, container.bounds.top + size * 0.44071),\n new Vector(container.bounds.left + size * 0.39694, container.bounds.top + size * 0.5649),\n new Vector(container.bounds.left + size * 0.72983, container.bounds.top + size * 0.23),\n new Vector(container.bounds.left + size * 0.84, container.bounds.top + size * 0.34085),\n new Vector(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79)\n ]);\n\n this.ctx.fillStyle = asString(INPUT_COLOR);\n this.ctx.fill();\n this.ctx.restore();\n }\n } else if (container.type === RADIO) {\n if (container.checked) {\n this.ctx.save();\n this.ctx.beginPath();\n this.ctx.arc(\n container.bounds.left + size / 2,\n container.bounds.top + size / 2,\n size / 4,\n 0,\n Math.PI * 2,\n true\n );\n this.ctx.fillStyle = asString(INPUT_COLOR);\n this.ctx.fill();\n this.ctx.restore();\n }\n }\n }\n\n if (isTextInputElement(container) && container.value.length) {\n const [font, fontFamily, fontSize] = this.createFontStyle(styles);\n const { baseline } = this.fontMetrics.getMetrics(fontFamily, fontSize);\n\n this.ctx.font = font;\n\n // Fix for Issue #92: Use placeholder color when rendering placeholder text\n const isPlaceholder = container instanceof InputElementContainer && container.isPlaceholder;\n this.ctx.fillStyle = isPlaceholder ? asString(PLACEHOLDER_COLOR) : asString(styles.color);\n\n this.ctx.textBaseline = 'alphabetic';\n this.ctx.textAlign = canvasTextAlign(container.styles.textAlign);\n\n const bounds = contentBox(container);\n\n let x = 0;\n\n switch (container.styles.textAlign) {\n case TEXT_ALIGN.CENTER:\n x += bounds.width / 2;\n break;\n case TEXT_ALIGN.RIGHT:\n x += bounds.width;\n break;\n }\n\n // Fix for Issue #92: Position text vertically centered in single-line input\n // Only apply vertical centering for InputElementContainer, not for textarea or select\n let verticalOffset = 0;\n if (container instanceof InputElementContainer) {\n const fontSizeValue = getAbsoluteValue(styles.fontSize, 0);\n verticalOffset = (bounds.height - fontSizeValue) / 2;\n }\n\n // Create text bounds with horizontal and vertical offsets\n // Height is not modified as it doesn't affect text rendering position\n const textBounds = bounds.add(x, verticalOffset, 0, 0);\n\n this.ctx.save();\n this.path([\n new Vector(bounds.left, bounds.top),\n new Vector(bounds.left + bounds.width, bounds.top),\n new Vector(bounds.left + bounds.width, bounds.top + bounds.height),\n new Vector(bounds.left, bounds.top + bounds.height)\n ]);\n\n this.ctx.clip();\n\n this.renderTextWithLetterSpacing(\n new TextBounds(container.value, textBounds),\n styles.letterSpacing,\n baseline\n );\n this.ctx.restore();\n this.ctx.textBaseline = 'alphabetic';\n this.ctx.textAlign = 'left';\n }\n\n if (contains(container.styles.display, DISPLAY.LIST_ITEM)) {\n if (container.styles.listStyleImage !== null) {\n const img = container.styles.listStyleImage;\n if (img.type === CSSImageType.URL) {\n let image;\n const url = (img as CSSURLImage).url;\n try {\n image = await this.context.cache.match(url);\n this.ctx.drawImage(image, container.bounds.left - (image.width + 10), container.bounds.top);\n } catch (e) {\n this.context.logger.error(`Error loading list-style-image ${url}`);\n }\n }\n } else if (paint.listValue && container.styles.listStyleType !== LIST_STYLE_TYPE.NONE) {\n const [font] = this.createFontStyle(styles);\n\n this.ctx.font = font;\n this.ctx.fillStyle = asString(styles.color);\n\n this.ctx.textBaseline = 'middle';\n this.ctx.textAlign = 'right';\n const bounds = new Bounds(\n container.bounds.left,\n container.bounds.top + getAbsoluteValue(container.styles.paddingTop, container.bounds.width),\n container.bounds.width,\n computeLineHeight(styles.lineHeight, styles.fontSize.number) / 2 + 1\n );\n\n this.renderTextWithLetterSpacing(\n new TextBounds(paint.listValue, bounds),\n styles.letterSpacing,\n computeLineHeight(styles.lineHeight, styles.fontSize.number) / 2 + 2\n );\n this.ctx.textBaseline = 'bottom';\n this.ctx.textAlign = 'left';\n }\n }\n }\n\n async renderStackContent(stack: StackingContext): Promise<void> {\n if (contains(stack.element.container.flags, FLAGS.DEBUG_RENDER)) {\n debugger;\n }\n // https://www.w3.org/TR/css-position-3/#painting-order\n // 1. the background and borders of the element forming the stacking context.\n await this.renderNodeBackgroundAndBorders(stack.element);\n // 2. the child stacking contexts with negative stack levels (most negative first).\n for (const child of stack.negativeZIndex) {\n await this.renderStack(child);\n }\n // 3. For all its in-flow, non-positioned, block-level descendants in tree order:\n await this.renderNodeContent(stack.element);\n\n for (const child of stack.nonInlineLevel) {\n await this.renderNode(child);\n }\n // 4. All non-positioned floating descendants, in tree order. For each one of these,\n // treat the element as if it created a new stacking context, but any positioned descendants and descendants\n // which actually create a new stacking context should be considered part of the parent stacking context,\n // not this new one.\n for (const child of stack.nonPositionedFloats) {\n await this.renderStack(child);\n }\n // 5. the in-flow, inline-level, non-positioned descendants, including inline tables and inline blocks.\n for (const child of stack.nonPositionedInlineLevel) {\n await this.renderStack(child);\n }\n for (const child of stack.inlineLevel) {\n await this.renderNode(child);\n }\n // 6. All positioned, opacity or transform descendants, in tree order that fall into the following categories:\n // All positioned descendants with 'z-index: auto' or 'z-index: 0', in tree order.\n // For those with 'z-index: auto', treat the element as if it created a new stacking context,\n // but any positioned descendants and descendants which actually create a new stacking context should be\n // considered part of the parent stacking context, not this new one. For those with 'z-index: 0',\n // treat the stacking context generated atomically.\n //\n // All opacity descendants with opacity less than 1\n //\n // All transform descendants with transform other than none\n for (const child of stack.zeroOrAutoZIndexOrTransformedOrOpacity) {\n await this.renderStack(child);\n }\n // 7. Stacking contexts formed by positioned descendants with z-indices greater than or equal to 1 in z-index\n // order (smallest first) then tree order.\n for (const child of stack.positiveZIndex) {\n await this.renderStack(child);\n }\n }\n\n mask(paths: Path[]): void {\n this.ctx.beginPath();\n this.ctx.moveTo(0, 0);\n // Use logical dimensions (options.width/height) instead of canvas pixel dimensions\n // because context has already been scaled by this.options.scale\n // Fix for Issue #126: Using canvas pixel dimensions causes broken output\n this.ctx.lineTo(this.options.width, 0);\n this.ctx.lineTo(this.options.width, this.options.height);\n this.ctx.lineTo(0, this.options.height);\n this.ctx.lineTo(0, 0);\n this.formatPath(paths.slice(0).reverse());\n this.ctx.closePath();\n }\n\n path(paths: Path[]): void {\n this.ctx.beginPath();\n this.formatPath(paths);\n this.ctx.closePath();\n }\n\n formatPath(paths: Path[]): void {\n paths.forEach((point, index) => {\n const start: Vector = isBezierCurve(point) ? point.start : point;\n if (index === 0) {\n this.ctx.moveTo(start.x, start.y);\n } else {\n this.ctx.lineTo(start.x, start.y);\n }\n\n if (isBezierCurve(point)) {\n this.ctx.bezierCurveTo(\n point.startControl.x,\n point.startControl.y,\n point.endControl.x,\n point.endControl.y,\n point.end.x,\n point.end.y\n );\n }\n });\n }\n\n renderRepeat(path: Path[], pattern: CanvasPattern | CanvasGradient, offsetX: number, offsetY: number): void {\n this.path(path);\n this.ctx.fillStyle = pattern;\n this.ctx.translate(offsetX, offsetY);\n this.ctx.fill();\n this.ctx.translate(-offsetX, -offsetY);\n }\n\n resizeImage(image: HTMLImageElement, width: number, height: number): HTMLCanvasElement | HTMLImageElement {\n // https://github.com/niklasvh/html2canvas/pull/2911\n // if (image.width === width && image.height === height) {\n // return image;\n // }\n\n const ownerDocument = this.canvas.ownerDocument ?? document;\n const canvas = ownerDocument.createElement('canvas');\n canvas.width = Math.max(1, width);\n canvas.height = Math.max(1, height);\n const ctx = canvas.getContext('2d') as CanvasRenderingContext2D;\n ctx.drawImage(image, 0, 0, image.width, image.height, 0, 0, width, height);\n return canvas;\n }\n\n async renderBackgroundImage(container: ElementContainer): Promise<void> {\n let index = container.styles.backgroundImage.length - 1;\n for (const backgroundImage of container.styles.backgroundImage.slice(0).reverse()) {\n if (backgroundImage.type === CSSImageType.URL) {\n let image;\n const url = (backgroundImage as CSSURLImage).url;\n try {\n image = await this.context.cache.match(url);\n } catch (e) {\n this.context.logger.error(`Error loading background-image ${url}`);\n }\n\n if (image) {\n const imageWidth = isNaN(image.width) || image.width === 0 ? 1 : image.width;\n const imageHeight = isNaN(image.height) || image.height === 0 ? 1 : image.height;\n const [path, x, y, width, height] = calculateBackgroundRendering(container, index, [\n imageWidth,\n imageHeight,\n imageWidth / imageHeight\n ]);\n const pattern = this.ctx.createPattern(\n this.resizeImage(image, width, height),\n 'repeat'\n ) as CanvasPattern;\n this.renderRepeat(path, pattern, x, y);\n }\n } else if (isLinearGradient(backgroundImage)) {\n const [path, x, y, width, height] = calculateBackgroundRendering(container, index, [null, null, null]);\n const [lineLength, x0, x1, y0, y1] = calculateGradientDirection(backgroundImage.angle, width, height);\n\n const canvas = document.createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n const ctx = canvas.getContext('2d') as CanvasRenderingContext2D;\n const gradient = ctx.createLinearGradient(x0, y0, x1, y1);\n\n processColorStops(backgroundImage.stops, lineLength || 1).forEach((colorStop) =>\n gradient.addColorStop(colorStop.stop, asString(colorStop.color))\n );\n\n ctx.fillStyle = gradient;\n ctx.fillRect(0, 0, width, height);\n if (width > 0 && height > 0) {\n const pattern = this.ctx.createPattern(canvas, 'repeat') as CanvasPattern;\n this.renderRepeat(path, pattern, x, y);\n }\n } else if (isRadialGradient(backgroundImage)) {\n const [path, left, top, width, height] = calculateBackgroundRendering(container, index, [\n null,\n null,\n null\n ]);\n const position = backgroundImage.position.length === 0 ? [FIFTY_PERCENT] : backgroundImage.position;\n const x = getAbsoluteValue(position[0], width);\n const y = getAbsoluteValue(position[position.length - 1], height);\n\n let [rx, ry] = calculateRadius(backgroundImage, x, y, width, height);\n // Handle edge case where radial gradient size is 0\n // Use a minimum value of 0.01 to ensure gradient is still rendered\n if (rx === 0 || ry === 0) {\n rx = Math.max(rx, 0.01);\n ry = Math.max(ry, 0.01);\n }\n if (rx > 0 && ry > 0) {\n const radialGradient = this.ctx.createRadialGradient(left + x, top + y, 0, left + x, top + y, rx);\n\n processColorStops(backgroundImage.stops, rx * 2).forEach((colorStop) =>\n radialGradient.addColorStop(colorStop.stop, asString(colorStop.color))\n );\n\n this.path(path);\n this.ctx.fillStyle = radialGradient;\n if (rx !== ry) {\n // transforms for elliptical radial gradient\n const midX = container.bounds.left + 0.5 * container.bounds.width;\n const midY = container.bounds.top + 0.5 * container.bounds.height;\n const f = ry / rx;\n const invF = 1 / f;\n\n this.ctx.save();\n this.ctx.translate(midX, midY);\n this.ctx.transform(1, 0, 0, f, 0, 0);\n this.ctx.translate(-midX, -midY);\n\n this.ctx.fillRect(left, invF * (top - midY) + midY, width, height * invF);\n this.ctx.restore();\n } else {\n this.ctx.fill();\n }\n }\n }\n index--;\n }\n }\n\n async renderSolidBorder(color: Color, side: number, curvePoints: BoundCurves): Promise<void> {\n this.path(parsePathForBorder(curvePoints, side));\n this.ctx.fillStyle = asString(color);\n this.ctx.fill();\n }\n\n async renderDoubleBorder(color: Color, width: number, side: number, curvePoints: BoundCurves): Promise<void> {\n if (width < 3) {\n await this.renderSolidBorder(color, side, curvePoints);\n return;\n }\n\n const outerPaths = parsePathForBorderDoubleOuter(curvePoints, side);\n this.path(outerPaths);\n this.ctx.fillStyle = asString(color);\n this.ctx.fill();\n const innerPaths = parsePathForBorderDoubleInner(curvePoints, side);\n this.path(innerPaths);\n this.ctx.fill();\n }\n\n async renderNodeBackgroundAndBorders(paint: ElementPaint): Promise<void> {\n this.applyEffects(paint.getEffects(EffectTarget.BACKGROUND_BORDERS));\n const styles = paint.container.styles;\n const hasBackground = !isTransparent(styles.backgroundColor) || styles.backgroundImage.length;\n\n const borders = [\n { style: styles.borderTopStyle, color: styles.borderTopColor, width: styles.borderTopWidth },\n { style: styles.borderRightStyle, color: styles.borderRightColor, width: styles.borderRightWidth },\n { style: styles.borderBottomStyle, color: styles.borderBottomColor, width: styles.borderBottomWidth },\n { style: styles.borderLeftStyle, color: styles.borderLeftColor, width: styles.borderLeftWidth }\n ];\n\n const backgroundPaintingArea = calculateBackgroundCurvedPaintingArea(\n getBackgroundValueForIndex(styles.backgroundClip, 0),\n paint.curves\n );\n\n if (hasBackground || styles.boxShadow.length) {\n this.ctx.save();\n this.path(backgroundPaintingArea);\n this.ctx.clip();\n\n if (!isTransparent(styles.backgroundColor)) {\n this.ctx.fillStyle = asString(styles.backgroundColor);\n this.ctx.fill();\n }\n\n await this.renderBackgroundImage(paint.container);\n\n this.ctx.restore();\n\n styles.boxShadow\n .slice(0)\n .reverse()\n .forEach((shadow) => {\n this.ctx.save();\n const borderBoxArea = calculateBorderBoxPath(paint.curves);\n const maskOffset = shadow.inset ? 0 : MASK_OFFSET;\n const shadowPaintingArea = transformPath(\n borderBoxArea,\n -maskOffset + (shadow.inset ? 1 : -1) * shadow.spread.number,\n (shadow.inset ? 1 : -1) * shadow.spread.number,\n shadow.spread.number * (shadow.inset ? -2 : 2),\n shadow.spread.number * (shadow.inset ? -2 : 2)\n );\n\n if (shadow.inset) {\n this.path(borderBoxArea);\n this.ctx.clip();\n this.mask(shadowPaintingArea);\n } else {\n this.mask(borderBoxArea);\n this.ctx.clip();\n this.path(shadowPaintingArea);\n }\n\n this.ctx.shadowOffsetX = shadow.offsetX.number + maskOffset;\n this.ctx.shadowOffsetY = shadow.offsetY.number;\n this.ctx.shadowColor = asString(shadow.color);\n this.ctx.shadowBlur = shadow.blur.number;\n this.ctx.fillStyle = shadow.inset ? asString(shadow.color) : 'rgba(0,0,0,1)';\n\n this.ctx.fill();\n this.ctx.restore();\n });\n }\n\n let side = 0;\n for (const border of borders) {\n if (border.style !== BORDER_STYLE.NONE && !isTransparent(border.color) && border.width > 0) {\n if (border.style === BORDER_STYLE.DASHED) {\n await this.renderDashedDottedBorder(\n border.color,\n border.width,\n side,\n paint.curves,\n BORDER_STYLE.DASHED\n );\n } else if (border.style === BORDER_STYLE.DOTTED) {\n await this.renderDashedDottedBorder(\n border.color,\n border.width,\n side,\n paint.curves,\n BORDER_STYLE.DOTTED\n );\n } else if (border.style === BORDER_STYLE.DOUBLE) {\n await this.renderDoubleBorder(border.color, border.width, side, paint.curves);\n } else {\n await this.renderSolidBorder(border.color, side, paint.curves);\n }\n }\n side++;\n }\n }\n\n async renderDashedDottedBorder(\n color: Color,\n width: number,\n side: number,\n curvePoints: BoundCurves,\n style: BORDER_STYLE\n ): Promise<void> {\n this.ctx.save();\n\n const strokePaths = parsePathForBorderStroke(curvePoints, side);\n const boxPaths = parsePathForBorder(curvePoints, side);\n\n if (style === BORDER_STYLE.DASHED) {\n this.path(boxPaths);\n this.ctx.clip();\n }\n\n let startX, startY, endX, endY;\n if (isBezierCurve(boxPaths[0])) {\n startX = (boxPaths[0] as BezierCurve).start.x;\n startY = (boxPaths[0] as BezierCurve).start.y;\n } else {\n startX = (boxPaths[0] as Vector).x;\n startY = (boxPaths[0] as Vector).y;\n }\n if (isBezierCurve(boxPaths[1])) {\n endX = (boxPaths[1] as BezierCurve).end.x;\n endY = (boxPaths[1] as BezierCurve).end.y;\n } else {\n endX = (boxPaths[1] as Vector).x;\n endY = (boxPaths[1] as Vector).y;\n }\n\n let length;\n if (side === 0 || side === 2) {\n length = Math.abs(startX - endX);\n } else {\n length = Math.abs(startY - endY);\n }\n\n this.ctx.beginPath();\n if (style === BORDER_STYLE.DOTTED) {\n this.formatPath(strokePaths);\n } else {\n this.formatPath(boxPaths.slice(0, 2));\n }\n\n let dashLength = width < 3 ? width * 3 : width * 2;\n let spaceLength = width < 3 ? width * 2 : width;\n if (style === BORDER_STYLE.DOTTED) {\n dashLength = width;\n spaceLength = width;\n }\n\n let useLineDash = true;\n if (length <= dashLength * 2) {\n useLineDash = false;\n } else if (length <= dashLength * 2 + spaceLength) {\n const multiplier = length / (2 * dashLength + spaceLength);\n dashLength *= multiplier;\n spaceLength *= multiplier;\n } else {\n const numberOfDashes = Math.floor((length + spaceLength) / (dashLength + spaceLength));\n const minSpace = (length - numberOfDashes * dashLength) / (numberOfDashes - 1);\n const maxSpace = (length - (numberOfDashes + 1) * dashLength) / numberOfDashes;\n spaceLength =\n maxSpace <= 0 || Math.abs(spaceLength - minSpace) < Math.abs(spaceLength - maxSpace)\n ? minSpace\n : maxSpace;\n }\n\n if (useLineDash) {\n if (style === BORDER_STYLE.DOTTED) {\n this.ctx.setLineDash([0, dashLength + spaceLength]);\n } else {\n this.ctx.setLineDash([dashLength, spaceLength]);\n }\n }\n\n if (style === BORDER_STYLE.DOTTED) {\n this.ctx.lineCap = 'round';\n this.ctx.lineWidth = width;\n } else {\n this.ctx.lineWidth = width * 2 + 1.1;\n }\n this.ctx.strokeStyle = asString(color);\n this.ctx.stroke();\n this.ctx.setLineDash([]);\n\n // dashed round edge gap\n if (style === BORDER_STYLE.DASHED) {\n if (isBezierCurve(boxPaths[0])) {\n const path1 = boxPaths[3] as BezierCurve;\n const path2 = boxPaths[0] as BezierCurve;\n this.ctx.beginPath();\n this.formatPath([new Vector(path1.end.x, path1.end.y), new Vector(path2.start.x, path2.start.y)]);\n this.ctx.stroke();\n }\n if (isBezierCurve(boxPaths[1])) {\n const path1 = boxPaths[1] as BezierCurve;\n const path2 = boxPaths[2] as BezierCurve;\n this.ctx.beginPath();\n this.formatPath([new Vector(path1.end.x, path1.end.y), new Vector(path2.start.x, path2.start.y)]);\n this.ctx.stroke();\n }\n }\n\n this.ctx.restore();\n }\n\n async render(element: ElementContainer): Promise<HTMLCanvasElement> {\n if (this.options.backgroundColor) {\n this.ctx.fillStyle = asString(this.options.backgroundColor);\n this.ctx.fillRect(this.options.x, this.options.y, this.options.width, this.options.height);\n }\n\n const stack = parseStackingContexts(element);\n\n await this.renderStack(stack);\n this.applyEffects([]);\n return this.canvas;\n }\n}\n\nconst isTextInputElement = (\n container: ElementContainer\n): container is InputElementContainer | TextareaElementContainer | SelectElementContainer => {\n if (container instanceof TextareaElementContainer) {\n return true;\n } else if (container instanceof SelectElementContainer) {\n return true;\n } else if (container instanceof InputElementContainer && container.type !== RADIO && container.type !== CHECKBOX) {\n return true;\n }\n return false;\n};\n\nconst calculateBackgroundCurvedPaintingArea = (clip: BACKGROUND_CLIP, curves: BoundCurves): Path[] => {\n switch (clip) {\n case BACKGROUND_CLIP.BORDER_BOX:\n return calculateBorderBoxPath(curves);\n case BACKGROUND_CLIP.CONTENT_BOX:\n return calculateContentBoxPath(curves);\n case BACKGROUND_CLIP.PADDING_BOX:\n default:\n return calculatePaddingBoxPath(curves);\n }\n};\n\nconst canvasTextAlign = (textAlign: TEXT_ALIGN): CanvasTextAlign => {\n switch (textAlign) {\n case TEXT_ALIGN.CENTER:\n return 'center';\n case TEXT_ALIGN.RIGHT:\n return 'right';\n case TEXT_ALIGN.LEFT:\n default:\n return 'left';\n }\n};\n\n// see https://github.com/niklasvh/html2canvas/pull/2645\nconst iOSBrokenFonts = ['-apple-system', 'system-ui'];\n\nconst fixIOSSystemFonts = (fontFamilies: string[]): string[] => {\n return /iPhone OS 15_(0|1)/.test(window.navigator.userAgent)\n ? fontFamilies.filter((fontFamily) => iOSBrokenFonts.indexOf(fontFamily) === -1)\n : fontFamilies;\n};\n","import { RenderConfigurations } from './canvas-renderer';\nimport { createForeignObjectSVG } from '../../core/features';\nimport { asString } from '../../css/types/color-utilities';\nimport { Renderer } from '../renderer';\nimport { Context } from '../../core/context';\n\nexport class ForeignObjectRenderer extends Renderer {\n canvas: HTMLCanvasElement;\n ctx: CanvasRenderingContext2D;\n options: RenderConfigurations;\n\n constructor(context: Context, options: RenderConfigurations) {\n super(context, options);\n this.canvas = options.canvas ? options.canvas : document.createElement('canvas');\n this.ctx = this.canvas.getContext('2d') as CanvasRenderingContext2D;\n this.options = options;\n this.canvas.width = Math.floor(options.width * options.scale);\n this.canvas.height = Math.floor(options.height * options.scale);\n this.canvas.style.width = `${options.width}px`;\n this.canvas.style.height = `${options.height}px`;\n\n this.ctx.scale(this.options.scale, this.options.scale);\n this.ctx.translate(-options.x, -options.y);\n this.context.logger.debug(\n `EXPERIMENTAL ForeignObject renderer initialized (${options.width}x${options.height} at ${options.x},${options.y}) with scale ${options.scale}`\n );\n }\n\n async render(element: HTMLElement): Promise<HTMLCanvasElement> {\n const svg = createForeignObjectSVG(\n this.options.width * this.options.scale,\n this.options.height * this.options.scale,\n this.options.scale,\n this.options.scale,\n element\n );\n\n const img = await loadSerializedSVG(svg);\n\n if (this.options.backgroundColor) {\n this.ctx.fillStyle = asString(this.options.backgroundColor);\n this.ctx.fillRect(0, 0, this.options.width * this.options.scale, this.options.height * this.options.scale);\n }\n\n this.ctx.drawImage(img, -this.options.x * this.options.scale, -this.options.y * this.options.scale);\n\n return this.canvas;\n }\n}\n\nexport const loadSerializedSVG = (svg: Node): Promise<HTMLImageElement> =>\n new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => {\n resolve(img);\n };\n img.onerror = reject;\n\n img.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(svg))}`;\n });\n","export interface LoggerOptions {\n id: string;\n enabled: boolean;\n}\n\nexport class Logger {\n static instances: { [key: string]: Logger } = {};\n\n private readonly id: string;\n private readonly enabled: boolean;\n private readonly start: number;\n\n constructor({ id, enabled }: LoggerOptions) {\n this.id = id;\n this.enabled = enabled;\n this.start = Date.now();\n }\n\n debug(...args: unknown[]): void {\n if (this.enabled) {\n // eslint-disable-next-line no-console\n if (typeof window !== 'undefined' && window.console && typeof console.debug === 'function') {\n // eslint-disable-next-line no-console\n console.debug(this.id, `${this.getTime()}ms`, ...args);\n } else {\n this.info(...args);\n }\n }\n }\n\n getTime(): number {\n return Date.now() - this.start;\n }\n\n info(...args: unknown[]): void {\n if (this.enabled) {\n // eslint-disable-next-line no-console\n if (typeof window !== 'undefined' && window.console && typeof console.info === 'function') {\n // eslint-disable-next-line no-console\n console.info(this.id, `${this.getTime()}ms`, ...args);\n }\n }\n }\n\n warn(...args: unknown[]): void {\n if (this.enabled) {\n if (typeof window !== 'undefined' && window.console && typeof console.warn === 'function') {\n console.warn(this.id, `${this.getTime()}ms`, ...args);\n } else {\n this.info(...args);\n }\n }\n }\n\n error(...args: unknown[]): void {\n if (this.enabled) {\n if (typeof window !== 'undefined' && window.console && typeof console.error === 'function') {\n console.error(this.id, `${this.getTime()}ms`, ...args);\n } else {\n this.info(...args);\n }\n }\n }\n}\n","import { Logger } from './logger';\nimport { Cache, ResourceOptions } from './cache-storage';\nimport { Bounds } from '../css/layout/bounds';\n\nexport type ContextOptions = {\n logging: boolean;\n cache?: Cache;\n} & ResourceOptions;\n\nexport class Context {\n private readonly instanceName = `#${Context.instanceCount++}`;\n readonly logger: Logger;\n readonly cache: Cache;\n\n private static instanceCount = 1;\n\n constructor(\n options: ContextOptions,\n public windowBounds: Bounds\n ) {\n this.logger = new Logger({ id: this.instanceName, enabled: options.logging });\n this.cache = options.cache ?? new Cache(this, options);\n }\n}\n","import { Bounds, parseBounds, parseDocumentSize } from './css/layout/bounds';\nimport { COLORS, parseColor } from './css/types/color';\nimport { isTransparent } from './css/types/color-utilities';\nimport { CloneConfigurations, CloneOptions, DocumentCloner, WindowOptions } from './dom/document-cloner';\nimport { isBodyElement, isHTMLElement, parseTree } from './dom/node-parser';\nimport { CacheStorage } from './core/cache-storage';\nimport { CanvasRenderer, RenderConfigurations, RenderOptions } from './render/canvas/canvas-renderer';\nimport { ForeignObjectRenderer } from './render/canvas/foreignobject-renderer';\nimport { Context, ContextOptions } from './core/context';\n\nexport type Options = CloneOptions &\n WindowOptions &\n RenderOptions &\n ContextOptions & {\n backgroundColor: string | null;\n foreignObjectRendering: boolean;\n removeContainer?: boolean;\n };\n\nlet cspNonce: string | undefined;\n\nconst setCspNonce = (nonce: string) => {\n cspNonce = nonce;\n};\n\nconst html2canvas = (element: HTMLElement, options: Partial<Options> = {}): Promise<HTMLCanvasElement> => {\n return renderElement(element, options);\n};\n\nhtml2canvas.setCspNonce = setCspNonce;\n\nexport default html2canvas;\nexport { html2canvas, setCspNonce };\n\nif (typeof window !== 'undefined') {\n CacheStorage.setContext(window);\n}\n\nconst renderElement = async (element: HTMLElement, opts: Partial<Options>): Promise<HTMLCanvasElement> => {\n if (!element || typeof element !== 'object') {\n return Promise.reject('Invalid element provided as first argument');\n }\n const ownerDocument = element.ownerDocument;\n\n if (!ownerDocument) {\n throw new Error(`Element is not attached to a Document`);\n }\n\n const defaultView = ownerDocument.defaultView;\n\n if (!defaultView) {\n throw new Error(`Document is not attached to a Window`);\n }\n\n const resourceOptions = {\n allowTaint: opts.allowTaint ?? false,\n imageTimeout: opts.imageTimeout ?? 15000,\n proxy: opts.proxy,\n useCORS: opts.useCORS ?? false,\n customIsSameOrigin: opts.customIsSameOrigin\n };\n\n const contextOptions = {\n logging: opts.logging ?? true,\n cache: opts.cache,\n ...resourceOptions\n };\n\n const windowOptions = {\n windowWidth: opts.windowWidth ?? defaultView.innerWidth,\n windowHeight: opts.windowHeight ?? defaultView.innerHeight,\n scrollX: opts.scrollX ?? defaultView.pageXOffset,\n scrollY: opts.scrollY ?? defaultView.pageYOffset\n };\n\n const windowBounds = new Bounds(\n windowOptions.scrollX,\n windowOptions.scrollY,\n windowOptions.windowWidth,\n windowOptions.windowHeight\n );\n\n const context = new Context(contextOptions, windowBounds);\n\n const foreignObjectRendering = opts.foreignObjectRendering ?? false;\n\n const cloneOptions: CloneConfigurations = {\n allowTaint: opts.allowTaint ?? false,\n onclone: opts.onclone,\n ignoreElements: opts.ignoreElements,\n iframeContainer: opts.iframeContainer,\n inlineImages: foreignObjectRendering,\n copyStyles: foreignObjectRendering,\n cspNonce\n };\n\n context.logger.debug(\n `Starting document clone with size ${windowBounds.width}x${\n windowBounds.height\n } scrolled to ${-windowBounds.left},${-windowBounds.top}`\n );\n\n const documentCloner = new DocumentCloner(context, element, cloneOptions);\n const clonedElement = documentCloner.clonedReferenceElement;\n if (!clonedElement) {\n return Promise.reject(`Unable to find element in cloned iframe`);\n }\n\n const container = await documentCloner.toIFrame(ownerDocument, windowBounds);\n\n const { width, height, left, top } =\n isBodyElement(clonedElement) || isHTMLElement(clonedElement)\n ? parseDocumentSize(clonedElement.ownerDocument)\n : parseBounds(context, clonedElement);\n\n const backgroundColor = parseBackgroundColor(context, clonedElement, opts.backgroundColor);\n\n const renderOptions: RenderConfigurations = {\n canvas: opts.canvas,\n backgroundColor,\n scale: opts.scale ?? defaultView.devicePixelRatio ?? 1,\n x: (opts.x ?? 0) + left,\n y: (opts.y ?? 0) + top,\n width: opts.width ?? Math.ceil(width),\n height: opts.height ?? Math.ceil(height)\n };\n\n let canvas;\n\n if (foreignObjectRendering) {\n context.logger.debug(`Document cloned, using foreign object rendering`);\n const renderer = new ForeignObjectRenderer(context, renderOptions);\n canvas = await renderer.render(clonedElement);\n } else {\n context.logger.debug(\n `Document cloned, element located at ${left},${top} with size ${width}x${height} using computed rendering`\n );\n\n context.logger.debug(`Starting DOM parsing`);\n const root = parseTree(context, clonedElement);\n\n if (backgroundColor === root.styles.backgroundColor) {\n root.styles.backgroundColor = COLORS.TRANSPARENT;\n }\n\n context.logger.debug(\n `Starting renderer for element at ${renderOptions.x},${renderOptions.y} with size ${renderOptions.width}x${renderOptions.height}`\n );\n\n const renderer = new CanvasRenderer(context, renderOptions);\n canvas = await renderer.render(root);\n }\n\n if (opts.removeContainer ?? true) {\n if (!DocumentCloner.destroy(container)) {\n context.logger.error(`Cannot detach cloned iframe as it is not in the DOM anymore`);\n }\n }\n\n context.logger.debug(`Finished rendering`);\n return canvas;\n};\n\nconst parseBackgroundColor = (context: Context, element: HTMLElement, backgroundColorOverride?: string | null) => {\n const ownerDocument = element.ownerDocument;\n // http://www.w3.org/TR/css3-background/#special-backgrounds\n const documentBackgroundColor = ownerDocument.documentElement\n ? parseColor(context, getComputedStyle(ownerDocument.documentElement).backgroundColor as string)\n : COLORS.TRANSPARENT;\n const bodyBackgroundColor = ownerDocument.body\n ? parseColor(context, getComputedStyle(ownerDocument.body).backgroundColor as string)\n : COLORS.TRANSPARENT;\n\n const defaultBackgroundColor =\n typeof backgroundColorOverride === 'string'\n ? parseColor(context, backgroundColorOverride)\n : backgroundColorOverride === null\n ? COLORS.TRANSPARENT\n : 0xffffffff;\n\n return element === ownerDocument.documentElement\n ? isTransparent(documentBackgroundColor)\n ? isTransparent(bodyBackgroundColor)\n ? defaultBackgroundColor\n : bodyBackgroundColor\n : documentBackgroundColor\n : defaultBackgroundColor;\n};\n","import type { ReportPayload, SubmittedReport } from '../types'\n\nexport interface ApiClientOptions {\n apiKey: string\n endpoint?: string\n fetch?: typeof fetch\n beforeSend?: (payload: ReportPayload) => ReportPayload | false | Promise<ReportPayload | false>\n}\n\nexport interface ApiClient {\n submitReport(payload: ReportPayload): Promise<SubmittedReport>\n}\n\nconst SCALAR_FIELDS: Array<keyof ReportPayload> = [\n 'description', 'feedback_type', 'severity', 'env', 'page_url', 'user_agent', 'capture_method',\n]\n\nexport function createApiClient(options: ApiClientOptions): ApiClient {\n const endpoint = options.endpoint ?? 'https://core.mhosaic.com'\n const fetcher = options.fetch ?? globalThis.fetch\n\n async function submitReport(input: ReportPayload): Promise<SubmittedReport> {\n let payload: ReportPayload | false = input\n if (options.beforeSend) payload = await options.beforeSend(input)\n if (payload === false) throw new Error('Submission cancelled by beforeSend')\n\n const form = new FormData()\n for (const field of SCALAR_FIELDS) {\n form.append(field, String(payload[field]))\n }\n form.append('technical_context', JSON.stringify(payload.technical_context))\n if (payload.screenshot) form.append('screenshot', payload.screenshot, 'screenshot.png')\n\n const response = await fetcher(`${endpoint}/api/feedback/v1/reports/`, {\n method: 'POST',\n headers: { Authorization: `Bearer ${options.apiKey}` },\n body: form,\n })\n if (!response.ok) {\n const text = await response.text().catch(() => '')\n throw new Error(`Feedback submit failed: ${response.status} ${text}`)\n }\n return response.json() as Promise<SubmittedReport>\n }\n\n return { submitReport }\n}\n","const SENSITIVE = /token|key|password|secret|auth|session|sig/i\n\nexport function sanitizeUrl(url: string): string {\n try {\n // Accept absolute URLs or root-relative paths; reject everything else\n const isAbsolute = /^https?:\\/\\//i.test(url)\n const isRootRelative = url.startsWith('/')\n if (!isAbsolute && !isRootRelative) return url\n\n const base = typeof window !== 'undefined' ? window.location.origin : 'http://localhost'\n const u = new URL(url, base)\n const clean = new URLSearchParams()\n u.searchParams.forEach((value, name) => {\n clean.set(name, SENSITIVE.test(name) ? '[redacted]' : value)\n })\n u.search = clean.toString()\n return u.toString()\n } catch {\n return url\n }\n}\n","import type { DeviceContext } from '../types'\n\nexport function collectDevice(): DeviceContext {\n const nav = navigator as Navigator & { connection?: { effectiveType?: string }; deviceMemory?: number }\n const connection = nav.connection?.effectiveType\n const deviceMemory = nav.deviceMemory\n const referrer = document.referrer || undefined\n return {\n viewport: { w: window.innerWidth, h: window.innerHeight, dpr: window.devicePixelRatio || 1 },\n screen: { w: window.screen.width, h: window.screen.height },\n platform: nav.platform,\n language: nav.language,\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n timezoneOffset: new Date().getTimezoneOffset(),\n ...(connection !== undefined && { connection }),\n online: nav.onLine,\n ...(deviceMemory !== undefined && { deviceMemory }),\n hardwareConcurrency: nav.hardwareConcurrency,\n ...(referrer !== undefined && { referrer }),\n title: document.title,\n pathname: window.location.pathname,\n }\n}\n","import type { RingBuffer } from './ringBuffer'\nimport type { ConsoleEntry } from '../types'\n\ntype ConsoleLevel = 'log' | 'info' | 'warn' | 'error' | 'debug'\n\nfunction safeStringify(arg: unknown): string {\n if (arg == null) return String(arg)\n if (typeof arg === 'string') return arg\n if (typeof arg === 'number' || typeof arg === 'boolean') return String(arg)\n if (arg instanceof Error) return `${arg.name}: ${arg.message}`\n if (arg instanceof Element) return `<${arg.tagName.toLowerCase()}>`\n try {\n return JSON.stringify(arg, (_k, v) => (typeof v === 'bigint' ? v.toString() : v))\n } catch {\n try { return String(arg) } catch { return '[unserializable]' }\n }\n}\n\nexport function installConsolePatch(buffer: RingBuffer<ConsoleEntry>): () => void {\n const levels: ConsoleLevel[] = ['log', 'info', 'warn', 'error', 'debug']\n const originals: Partial<Record<ConsoleLevel, (...args: unknown[]) => void>> = {}\n for (const level of levels) {\n const original = console[level] as ((...args: unknown[]) => void) | undefined\n if (typeof original !== 'function') continue\n originals[level] = original\n console[level] = function patched(...args: unknown[]) {\n try {\n const message = args.map(safeStringify).join(' ').slice(0, 2000)\n const entry: ConsoleEntry = { level, message, ts: Date.now() }\n if (level === 'error') {\n const stack = new Error().stack\n if (stack) entry.stack = stack.split('\\n').slice(2, 8).join('\\n')\n }\n buffer.push(entry)\n } catch { /* never break console */ }\n original.apply(console, args)\n }\n }\n return () => {\n for (const [level, fn] of Object.entries(originals)) {\n (console as unknown as Record<string, (...args: unknown[]) => void>)[level] = fn\n }\n }\n}\n","import type { RingBuffer } from './ringBuffer'\nimport type { NetworkEntry } from '../types'\n\nexport function installFetchPatch(buffer: RingBuffer<NetworkEntry>, sanitize: (url: string) => string): () => void {\n if (typeof window === 'undefined' || typeof window.fetch !== 'function') return () => {}\n const original = window.fetch.bind(window)\n window.fetch = async function patched(input: RequestInfo | URL, init?: RequestInit) {\n const start = performance.now()\n const url = typeof input === 'string' ? input : input instanceof URL ? input.toString() : input.url\n const method = (init?.method || (input instanceof Request ? input.method : 'GET')).toUpperCase()\n try {\n const response = await original(input, init)\n buffer.push({ url: sanitize(url), method, status: response.status, durationMs: Math.round(performance.now() - start), ts: Date.now() })\n return response\n } catch (err) {\n buffer.push({\n url: sanitize(url), method, status: 0,\n durationMs: Math.round(performance.now() - start),\n ts: Date.now(),\n error: err instanceof Error ? err.message : String(err),\n })\n throw err\n }\n }\n return () => { window.fetch = original }\n}\n\nexport function installXhrPatch(buffer: RingBuffer<NetworkEntry>, sanitize: (url: string) => string): () => void {\n if (typeof window === 'undefined' || typeof window.XMLHttpRequest !== 'function') return () => {}\n const Original = window.XMLHttpRequest\n const originalOpen = Original.prototype.open\n const originalSend = Original.prototype.send\n\n Original.prototype.open = function patchedOpen(this: XMLHttpRequest & { __mfb?: { method: string; url: string; start: number } }, method: string, url: string | URL) {\n this.__mfb = { method: method.toUpperCase(), url: typeof url === 'string' ? url : url.toString(), start: performance.now() }\n return originalOpen.apply(this, arguments as unknown as Parameters<typeof originalOpen>)\n }\n\n Original.prototype.send = function patchedSend(this: XMLHttpRequest & { __mfb?: { method: string; url: string; start: number } }, body?: Document | XMLHttpRequestBodyInit | null) {\n this.addEventListener('loadend', () => {\n try {\n const ctx = this.__mfb\n if (!ctx) return\n buffer.push({\n url: sanitize(ctx.url),\n method: ctx.method,\n status: this.status,\n durationMs: Math.round(performance.now() - ctx.start),\n ts: Date.now(),\n })\n } catch { /* noop */ }\n })\n return originalSend.call(this, body ?? null)\n }\n\n return () => {\n Original.prototype.open = originalOpen\n Original.prototype.send = originalSend\n }\n}\n","import type { RingBuffer } from './ringBuffer'\nimport type { ErrorEntry } from '../types'\n\nexport function installErrorHandlers(buffer: RingBuffer<ErrorEntry>): () => void {\n if (typeof window === 'undefined') return () => {}\n const onError = (e: ErrorEvent) => {\n const stack = e.error instanceof Error ? e.error.stack : undefined\n buffer.push({\n message: e.message || 'Unknown error',\n ...(stack !== undefined && { stack }),\n ts: Date.now(),\n source: 'window.error',\n })\n }\n const onRejection = (e: PromiseRejectionEvent) => {\n const reason = e.reason\n const message =\n reason instanceof Error ? reason.message :\n typeof reason === 'string' ? reason :\n (() => { try { return JSON.stringify(reason) } catch { return String(reason) } })()\n const stack = reason instanceof Error ? reason.stack : undefined\n buffer.push({\n message,\n ...(stack !== undefined && { stack }),\n ts: Date.now(),\n source: 'unhandledrejection',\n })\n }\n window.addEventListener('error', onError)\n window.addEventListener('unhandledrejection', onRejection)\n return () => {\n window.removeEventListener('error', onError)\n window.removeEventListener('unhandledrejection', onRejection)\n }\n}\n","export interface PerformanceSnapshot {\n navigation?: { type: string; duration: number }\n longTasks: { duration: number; startTime: number }[]\n slowResources: { name: string; duration: number; initiatorType: string }[]\n}\n\nexport function createPerformanceCollector(slowResourceMs = 1000) {\n const longTasks: PerformanceSnapshot['longTasks'] = []\n const slowResources: PerformanceSnapshot['slowResources'] = []\n let observer: PerformanceObserver | null = null\n\n if (typeof PerformanceObserver !== 'undefined') {\n try {\n observer = new PerformanceObserver((list) => {\n for (const entry of list.getEntries()) {\n if (entry.entryType === 'longtask') {\n longTasks.push({ duration: entry.duration, startTime: entry.startTime })\n while (longTasks.length > 20) longTasks.shift()\n } else if (entry.entryType === 'resource') {\n const e = entry as PerformanceResourceTiming\n if (e.duration > slowResourceMs) {\n slowResources.push({ name: e.name, duration: e.duration, initiatorType: e.initiatorType })\n while (slowResources.length > 20) slowResources.shift()\n }\n }\n }\n })\n observer.observe({ entryTypes: ['longtask', 'resource'] })\n } catch { /* unsupported */ }\n }\n\n return {\n snapshot(): PerformanceSnapshot {\n const nav = typeof performance !== 'undefined' ? performance.getEntriesByType('navigation')[0] as PerformanceNavigationTiming | undefined : undefined\n const navigation = nav ? { type: nav.type, duration: nav.duration } : undefined\n return {\n ...(navigation !== undefined && { navigation }),\n longTasks: longTasks.slice(),\n slowResources: slowResources.slice(),\n }\n },\n dispose() { observer?.disconnect() },\n }\n}\n","export class RingBuffer<T> {\n private items: T[] = []\n constructor(private readonly max: number) {}\n\n push(item: T): void {\n this.items.push(item)\n while (this.items.length > this.max) this.items.shift()\n }\n\n snapshot(): T[] {\n return this.items.slice()\n }\n\n clear(): void {\n this.items.length = 0\n }\n}\n","import { sanitizeUrl } from './urlSanitizer'\nimport { collectDevice } from './device'\nimport { installConsolePatch } from './console'\nimport { installFetchPatch, installXhrPatch } from './network'\nimport { installErrorHandlers } from './errors'\nimport { createPerformanceCollector } from './performance'\nimport { RingBuffer } from './ringBuffer'\nimport type { CapturedContext, ConsoleEntry, ErrorEntry, NetworkEntry } from '../types'\n\nexport interface CaptureOptions {\n sanitizeUrl?: (url: string) => string\n maxConsole?: number\n maxNetwork?: number\n maxErrors?: number\n}\n\nexport interface CaptureHandle {\n snapshot(): CapturedContext\n clear(): void\n dispose(): void\n}\n\nexport function installCapture(options: CaptureOptions = {}): CaptureHandle {\n const { maxConsole = 50, maxNetwork = 50, maxErrors = 20 } = options\n const sanitize = options.sanitizeUrl ?? sanitizeUrl\n\n const consoleBuf = new RingBuffer<ConsoleEntry>(maxConsole)\n const networkBuf = new RingBuffer<NetworkEntry>(maxNetwork)\n const errorBuf = new RingBuffer<ErrorEntry>(maxErrors)\n\n const uninstallConsole = installConsolePatch(consoleBuf)\n const uninstallFetch = installFetchPatch(networkBuf, sanitize)\n const uninstallXhr = installXhrPatch(networkBuf, sanitize)\n const uninstallErrors = installErrorHandlers(errorBuf)\n const perf = createPerformanceCollector()\n\n return {\n snapshot(): CapturedContext {\n return {\n consoleLogs: consoleBuf.snapshot(),\n networkRequests: networkBuf.snapshot(),\n errors: errorBuf.snapshot(),\n device: collectDevice(),\n capturedAt: Date.now(),\n }\n },\n clear() {\n consoleBuf.clear(); networkBuf.clear(); errorBuf.clear()\n },\n dispose() {\n uninstallConsole(); uninstallFetch(); uninstallXhr(); uninstallErrors()\n perf.dispose()\n },\n }\n}\n","export function isMaskedElement(el: Element): boolean {\n return el.hasAttribute('data-mfb-mask') || el.classList.contains('mfb-mask')\n}\n\nexport function prepareMaskMatcher(selectors: string[]): (el: Element) => boolean {\n const joined = selectors.join(',').trim()\n if (!joined) return isMaskedElement\n return (el: Element) => isMaskedElement(el) || el.matches(joined)\n}\n\nexport interface ScreenshotOptions {\n mask?: string[]\n maxBytes?: number\n}\n\nexport async function takeScreenshot(target: Element, options: ScreenshotOptions = {}): Promise<Blob | null> {\n if (typeof document === 'undefined') return null\n try {\n const html2canvas = (await import('html2canvas-pro')).default\n const matcher = prepareMaskMatcher(options.mask ?? [])\n const canvas = await html2canvas(target as HTMLElement, {\n ignoreElements: (el) => matcher(el),\n useCORS: true,\n logging: false,\n backgroundColor: null,\n })\n return await new Promise<Blob | null>((resolve) => canvas.toBlob(resolve, 'image/png'))\n } catch {\n return null\n }\n}\n","export const DEFAULT_STRINGS = {\n 'fab.label': 'Send feedback',\n 'form.title': 'Send feedback',\n 'form.description.label': 'What happened?',\n 'form.description.placeholder': 'Describe the issue or idea in one or two sentences.',\n 'form.type.label': 'Type',\n 'form.severity.label': 'Severity',\n 'form.submit': 'Send',\n 'form.cancel': 'Cancel',\n 'form.submitting': 'Sending…',\n 'form.success': 'Thanks — your feedback was sent.',\n 'form.error': 'Could not send. Please try again.',\n 'type.bug': 'Bug',\n 'type.feature': 'Feature request',\n 'type.question': 'Question',\n 'type.praise': 'Praise',\n 'type.typo': 'Typo',\n 'severity.blocker': 'Blocker',\n 'severity.high': 'High',\n 'severity.medium': 'Medium',\n 'severity.low': 'Low',\n}\n\nexport type StringKey = keyof typeof DEFAULT_STRINGS\n\nexport function resolveStrings(overrides: Record<string, string>): Record<StringKey, string> {\n return { ...DEFAULT_STRINGS, ...overrides } as Record<StringKey, string>\n}\n","/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 2;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 1;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nexport const XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nexport const MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n\nexport const NULL = null;\nexport const UNDEFINED = undefined;\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL =\n\t/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n","import { EMPTY_ARR } from './constants';\n\nexport const isArray = Array.isArray;\n\n/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\t// @ts-expect-error We change the type of `obj` to be `O & P`\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Remove a child node from its parent if attached. This is a workaround for\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\n * is smaller than including a dedicated polyfill.\n * @param {import('./index').ContainerNode} node The node to remove\n */\nexport function removeNode(node) {\n\tif (node && node.parentNode) node.parentNode.removeChild(node);\n}\n\nexport const slice = EMPTY_ARR.slice;\n","import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {import('./internal').Options}\n */\nconst options = {\n\t_catchError\n};\n\nexport default options;\n","import { slice } from './util';\nimport options from './options';\nimport { NULL, UNDEFINED } from './constants';\n\nlet vnodeId = 0;\n\n/**\n * Create an virtual node (used for JSX)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component constructor for this\n * virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array<import('.').ComponentChildren>} [children] The children of the\n * virtual node\n * @returns {import('./internal').VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != NULL) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === UNDEFINED) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, NULL);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {import('./internal').VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {import('./internal').VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\t/** @type {import('./internal').VNode} */\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: NULL,\n\t\t_parent: NULL,\n\t\t_depth: 0,\n\t\t_dom: NULL,\n\t\t_component: NULL,\n\t\tconstructor: UNDEFINED,\n\t\t_original: original == NULL ? ++vnodeId : original,\n\t\t_index: -1,\n\t\t_flags: 0\n\t};\n\n\t// Only invoke the vnode hook if this was *not* a direct copy:\n\tif (original == NULL && options.vnode != NULL) options.vnode(vnode);\n\n\treturn vnode;\n}\n\nexport function createRef() {\n\treturn { current: NULL };\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != NULL && vnode.constructor === UNDEFINED;\n","import { assign } from './util';\nimport { diff, commitRoot } from './diff/index';\nimport options from './options';\nimport { Fragment } from './create-element';\nimport { MODE_HYDRATE, NULL } from './constants';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function BaseComponent(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @this {import('./internal').Component}\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nBaseComponent.prototype.setState = function (update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != NULL && this._nextState != this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == NULL) return;\n\n\tif (this._vnode) {\n\t\tif (callback) {\n\t\t\tthis._stateCallbacks.push(callback);\n\t\t}\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @this {import('./internal').Component}\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nBaseComponent.prototype.forceUpdate = function (callback) {\n\tif (this._vnode) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._force = true;\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](https://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {ComponentChildren | void}\n */\nBaseComponent.prototype.render = Fragment;\n\n/**\n * @param {import('./internal').VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, childIndex) {\n\tif (childIndex == NULL) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn vnode._parent\n\t\t\t? getDomSibling(vnode._parent, vnode._index + 1)\n\t\t\t: NULL;\n\t}\n\n\tlet sibling;\n\tfor (; childIndex < vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling != NULL && sibling._dom != NULL) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We must resume from this vnode's sibling (in it's parent _children array)\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search)\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : NULL;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {import('./internal').Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tif (component._parentDom && component._dirty) {\n\t\tlet oldVNode = component._vnode,\n\t\t\toldDom = oldVNode._dom,\n\t\t\tcommitQueue = [],\n\t\t\trefQueue = [],\n\t\t\tnewVNode = assign({}, oldVNode);\n\t\tnewVNode._original = oldVNode._original + 1;\n\t\tif (options.vnode) options.vnode(newVNode);\n\n\t\tdiff(\n\t\t\tcomponent._parentDom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tcomponent._parentDom.namespaceURI,\n\t\t\toldVNode._flags & MODE_HYDRATE ? [oldDom] : NULL,\n\t\t\tcommitQueue,\n\t\t\toldDom == NULL ? getDomSibling(oldVNode) : oldDom,\n\t\t\t!!(oldVNode._flags & MODE_HYDRATE),\n\t\t\trefQueue\n\t\t);\n\n\t\tnewVNode._original = oldVNode._original;\n\t\tnewVNode._parent._children[newVNode._index] = newVNode;\n\t\tcommitRoot(commitQueue, newVNode, refQueue);\n\t\toldVNode._dom = oldVNode._parent = null;\n\n\t\tif (newVNode._dom != oldDom) {\n\t\t\tupdateParentDomPointers(newVNode);\n\t\t}\n\t}\n}\n\n/**\n * @param {import('./internal').VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\tif ((vnode = vnode._parent) != NULL && vnode._component != NULL) {\n\t\tvnode._dom = vnode._component.base = NULL;\n\t\tvnode._children.some(child => {\n\t\t\tif (child != NULL && child._dom != NULL) {\n\t\t\t\treturn (vnode._dom = vnode._component.base = child._dom);\n\t\t\t}\n\t\t});\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array<import('./internal').Component>}\n */\nlet rerenderQueue = [];\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\nconst defer =\n\ttypeof Promise == 'function'\n\t\t? Promise.prototype.then.bind(Promise.resolve())\n\t\t: setTimeout;\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./internal').Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!c._dirty &&\n\t\t\t(c._dirty = true) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce != options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/**\n * @param {import('./internal').Component} a\n * @param {import('./internal').Component} b\n */\nconst depthSort = (a, b) => a._vnode._depth - b._vnode._depth;\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\ttry {\n\t\tlet c,\n\t\t\tl = 1;\n\n\t\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t\t// process() calls from getting scheduled while `queue` is still being consumed.\n\t\twhile (rerenderQueue.length) {\n\t\t\t// Keep the rerender queue sorted by (depth, insertion order). The queue\n\t\t\t// will initially be sorted on the first iteration only if it has more than 1 item.\n\t\t\t//\n\t\t\t// New items can be added to the queue e.g. when rerendering a provider, so we want to\n\t\t\t// keep the order from top to bottom with those new items so we can handle them in a\n\t\t\t// single pass\n\t\t\tif (rerenderQueue.length > l) {\n\t\t\t\trerenderQueue.sort(depthSort);\n\t\t\t}\n\n\t\t\tc = rerenderQueue.shift();\n\t\t\tl = rerenderQueue.length;\n\n\t\t\trenderComponent(c);\n\t\t}\n\t} finally {\n\t\trerenderQueue.length = process._rerenderCount = 0;\n\t}\n}\n\nprocess._rerenderCount = 0;\n","import { IS_NON_DIMENSIONAL, NULL, SVG_NAMESPACE } from '../constants';\nimport options from '../options';\n\n// Per-instance unique key for event clock stamps. Each Preact copy on the page\n// gets its own random suffix so that `_dispatched` / `_attached` properties on\n// shared event objects and handler functions cannot collide across instances.\n// ~1 in 60M collision odds - if you have that many praect versions on the page,\n// you deserve some weird bugs.\n// In 11 we can replace this with a\n// Symbol\nlet _id = Math.random().toString(8),\n\tEVENT_DISPATCHED = '__d' + _id,\n\tEVENT_ATTACHED = '__a' + _id;\n\nfunction setStyle(style, key, value) {\n\tif (key[0] == '-') {\n\t\tstyle.setProperty(key, value == NULL ? '' : value);\n\t} else if (value == NULL) {\n\t\tstyle[key] = '';\n\t} else if (typeof value != 'number' || IS_NON_DIMENSIONAL.test(key)) {\n\t\tstyle[key] = value;\n\t} else {\n\t\tstyle[key] = value + 'px';\n\t}\n}\n\nconst CAPTURE_REGEX = /(PointerCapture)$|Capture$/i;\n\n// A logical clock to solve issues like https://github.com/preactjs/preact/issues/3927.\n// When the DOM performs an event it leaves micro-ticks in between bubbling up which means that\n// an event can trigger on a newly reated DOM-node while the event bubbles up.\n//\n// Originally inspired by Vue\n// (https://github.com/vuejs/core/blob/caeb8a68811a1b0f79/packages/runtime-dom/src/modules/events.ts#L90-L101),\n// but modified to use a logical clock instead of Date.now() in case event handlers get attached\n// and events get dispatched during the same millisecond.\n//\n// The clock is incremented after each new event dispatch. This allows 1 000 000 new events\n// per second for over 280 years before the value reaches Number.MAX_SAFE_INTEGER (2**53 - 1).\nlet eventClock = 0;\n\n/**\n * Set a property value on a DOM node\n * @param {import('../internal').PreactElement} dom The DOM node to modify\n * @param {string} name The name of the property to set\n * @param {*} value The value to set the property to\n * @param {*} oldValue The old value the property had\n * @param {string} namespace Whether or not this DOM node is an SVG node or not\n */\nexport function setProperty(dom, name, value, oldValue, namespace) {\n\tlet useCapture;\n\n\to: if (name == 'style') {\n\t\tif (typeof value == 'string') {\n\t\t\tdom.style.cssText = value;\n\t\t} else {\n\t\t\tif (typeof oldValue == 'string') {\n\t\t\t\tdom.style.cssText = oldValue = '';\n\t\t\t}\n\n\t\t\tif (oldValue) {\n\t\t\t\tfor (name in oldValue) {\n\t\t\t\t\tif (!(value && name in value)) {\n\t\t\t\t\t\tsetStyle(dom.style, name, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (value) {\n\t\t\t\tfor (name in value) {\n\t\t\t\t\tif (!oldValue || value[name] != oldValue[name]) {\n\t\t\t\t\t\tsetStyle(dom.style, name, value[name]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6\n\telse if (name[0] == 'o' && name[1] == 'n') {\n\t\tuseCapture = name != (name = name.replace(CAPTURE_REGEX, '$1'));\n\t\tconst lowerCaseName = name.toLowerCase();\n\n\t\t// Infer correct casing for DOM built-in events:\n\t\tif (lowerCaseName in dom || name == 'onFocusOut' || name == 'onFocusIn')\n\t\t\tname = lowerCaseName.slice(2);\n\t\telse name = name.slice(2);\n\n\t\tif (!dom._listeners) dom._listeners = {};\n\t\tdom._listeners[name + useCapture] = value;\n\n\t\tif (value) {\n\t\t\tif (!oldValue) {\n\t\t\t\tvalue[EVENT_ATTACHED] = eventClock;\n\t\t\t\tdom.addEventListener(\n\t\t\t\t\tname,\n\t\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\t\tuseCapture\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tvalue[EVENT_ATTACHED] = oldValue[EVENT_ATTACHED];\n\t\t\t}\n\t\t} else {\n\t\t\tdom.removeEventListener(\n\t\t\t\tname,\n\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\tuseCapture\n\t\t\t);\n\t\t}\n\t} else {\n\t\tif (namespace == SVG_NAMESPACE) {\n\t\t\t// Normalize incorrect prop usage for SVG:\n\t\t\t// - xlink:href / xlinkHref --> href (xlink:href was removed from SVG and isn't needed)\n\t\t\t// - className --> class\n\t\t\tname = name.replace(/xlink(H|:h)/, 'h').replace(/sName$/, 's');\n\t\t} else if (\n\t\t\tname != 'width' &&\n\t\t\tname != 'height' &&\n\t\t\tname != 'href' &&\n\t\t\tname != 'list' &&\n\t\t\tname != 'form' &&\n\t\t\t// Default value in browsers is `-1` and an empty string is\n\t\t\t// cast to `0` instead\n\t\t\tname != 'tabIndex' &&\n\t\t\tname != 'download' &&\n\t\t\tname != 'rowSpan' &&\n\t\t\tname != 'colSpan' &&\n\t\t\tname != 'role' &&\n\t\t\tname != 'popover' &&\n\t\t\tname in dom\n\t\t) {\n\t\t\ttry {\n\t\t\t\tdom[name] = value == NULL ? '' : value;\n\t\t\t\t// labelled break is 1b smaller here than a return statement (sorry)\n\t\t\t\tbreak o;\n\t\t\t} catch (e) {}\n\t\t}\n\n\t\t// aria- and data- attributes have no boolean representation.\n\t\t// A `false` value is different from the attribute not being\n\t\t// present, so we can't remove it. For non-boolean aria\n\t\t// attributes we could treat false as a removal, but the\n\t\t// amount of exceptions would cost too many bytes. On top of\n\t\t// that other frameworks generally stringify `false`.\n\n\t\tif (typeof value == 'function') {\n\t\t\t// never serialize functions as attribute values\n\t\t} else if (value != NULL && (value !== false || name[4] == '-')) {\n\t\t\tdom.setAttribute(name, name == 'popover' && value == true ? '' : value);\n\t\t} else {\n\t\t\tdom.removeAttribute(name);\n\t\t}\n\t}\n}\n\n/**\n * Create an event proxy function.\n * @param {boolean} useCapture Is the event handler for the capture phase.\n * @private\n */\nfunction createEventProxy(useCapture) {\n\t/**\n\t * Proxy an event to hooked event handlers\n\t * @param {import('../internal').PreactEvent} e The event object from the browser\n\t * @private\n\t */\n\treturn function (e) {\n\t\tif (this._listeners) {\n\t\t\tconst eventHandler = this._listeners[e.type + useCapture];\n\t\t\tif (e[EVENT_DISPATCHED] == NULL) {\n\t\t\t\te[EVENT_DISPATCHED] = eventClock++;\n\n\t\t\t\t// When `e[EVENT_DISPATCHED]` is smaller than the time when the targeted event\n\t\t\t\t// handler was attached we know we have bubbled up to an element that was added\n\t\t\t\t// during patching the DOM.\n\t\t\t} else if (e[EVENT_DISPATCHED] < eventHandler[EVENT_ATTACHED]) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn eventHandler(options.event ? options.event(e) : e);\n\t\t}\n\t};\n}\n\nconst eventProxy = createEventProxy(false);\nconst eventProxyCapture = createEventProxy(true);\n","import { enqueueRender } from './component';\nimport { NULL } from './constants';\n\nexport let i = 0;\n\nexport function createContext(defaultValue) {\n\tfunction Context(props) {\n\t\tif (!this.getChildContext) {\n\t\t\t/** @type {Set<import('./internal').Component> | null} */\n\t\t\tlet subs = new Set();\n\t\t\tlet ctx = {};\n\t\t\tctx[Context._id] = this;\n\n\t\t\tthis.getChildContext = () => ctx;\n\n\t\t\tthis.componentWillUnmount = () => {\n\t\t\t\tsubs = NULL;\n\t\t\t};\n\n\t\t\tthis.shouldComponentUpdate = function (_props) {\n\t\t\t\t// @ts-expect-error even\n\t\t\t\tif (this.props.value != _props.value) {\n\t\t\t\t\tsubs.forEach(c => {\n\t\t\t\t\t\tc._force = true;\n\t\t\t\t\t\tenqueueRender(c);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.sub = c => {\n\t\t\t\tsubs.add(c);\n\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\tif (subs) {\n\t\t\t\t\t\tsubs.delete(c);\n\t\t\t\t\t}\n\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\treturn props.children;\n\t}\n\n\tContext._id = '__cC' + i++;\n\tContext._defaultValue = defaultValue;\n\n\t/** @type {import('./internal').FunctionComponent} */\n\tContext.Consumer = (props, contextValue) => {\n\t\treturn props.children(contextValue);\n\t};\n\n\t// we could also get rid of _contextRef entirely\n\tContext.Provider =\n\t\tContext._contextRef =\n\t\tContext.Consumer.contextType =\n\t\t\tContext;\n\n\treturn Context;\n}\n","import { diff, unmount, applyRef } from './index';\nimport { createVNode, Fragment } from '../create-element';\nimport {\n\tEMPTY_OBJ,\n\tEMPTY_ARR,\n\tINSERT_VNODE,\n\tMATCHED,\n\tUNDEFINED,\n\tNULL\n} from '../constants';\nimport { isArray } from '../util';\nimport { getDomSibling } from '../component';\n\n/**\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\n\n/**\n * Diff the children of a virtual node\n * @param {PreactElement} parentDom The DOM element whose children are being\n * diffed\n * @param {ComponentChildren[]} renderResult\n * @param {VNode} newParentVNode The new virtual node whose children should be\n * diff'ed against oldParentVNode\n * @param {VNode} oldParentVNode The old virtual node whose children should be\n * diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tnewParentVNode,\n\toldParentVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\tlet i,\n\t\t/** @type {VNode} */\n\t\toldVNode,\n\t\t/** @type {VNode} */\n\t\tchildVNode,\n\t\t/** @type {PreactElement} */\n\t\tnewDom,\n\t\t/** @type {PreactElement} */\n\t\tfirstChildDom;\n\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`.\n\t/** @type {VNode[]} */\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\n\n\tlet newChildrenLength = renderResult.length;\n\n\toldDom = constructNewChildrenArray(\n\t\tnewParentVNode,\n\t\trenderResult,\n\t\toldChildren,\n\t\toldDom,\n\t\tnewChildrenLength\n\t);\n\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\tchildVNode = newParentVNode._children[i];\n\t\tif (childVNode == NULL) continue;\n\n\t\t// At this point, constructNewChildrenArray has assigned _index to be the\n\t\t// matchingIndex for this VNode's oldVNode (or -1 if there is no oldVNode).\n\t\toldVNode =\n\t\t\t(childVNode._index != -1 && oldChildren[childVNode._index]) || EMPTY_OBJ;\n\n\t\t// Update childVNode._index to its final index\n\t\tchildVNode._index = i;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tlet result = diff(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\toldDom,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\n\t\t// Adjust DOM nodes\n\t\tnewDom = childVNode._dom;\n\t\tif (childVNode.ref && oldVNode.ref != childVNode.ref) {\n\t\t\tif (oldVNode.ref) {\n\t\t\t\tapplyRef(oldVNode.ref, NULL, childVNode);\n\t\t\t}\n\t\t\trefQueue.push(\n\t\t\t\tchildVNode.ref,\n\t\t\t\tchildVNode._component || newDom,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t}\n\n\t\tif (firstChildDom == NULL && newDom != NULL) {\n\t\t\tfirstChildDom = newDom;\n\t\t}\n\n\t\tlet shouldPlace = !!(childVNode._flags & INSERT_VNODE);\n\t\tif (shouldPlace || oldVNode._children === childVNode._children) {\n\t\t\toldDom = insert(childVNode, oldDom, parentDom, shouldPlace);\n\n\t\t\t// When a matched VNode is physically moved via INSERT_VNODE, its old\n\t\t\t// _dom pointer becomes a stale positional reference. Clear it so that\n\t\t\t// getDomSibling (called from nested diffs) won't return this stale\n\t\t\t// reference and mis-place subsequent DOM nodes. See #5065.\n\t\t\tif (shouldPlace && oldVNode._dom) {\n\t\t\t\toldVNode._dom = NULL;\n\t\t\t}\n\t\t} else if (typeof childVNode.type == 'function' && result !== UNDEFINED) {\n\t\t\toldDom = result;\n\t\t} else if (newDom) {\n\t\t\toldDom = newDom.nextSibling;\n\t\t}\n\n\t\t// Unset diffing flags\n\t\tchildVNode._flags &= ~(INSERT_VNODE | MATCHED);\n\t}\n\n\tnewParentVNode._dom = firstChildDom;\n\n\treturn oldDom;\n}\n\n/**\n * @param {VNode} newParentVNode\n * @param {ComponentChildren[]} renderResult\n * @param {VNode[]} oldChildren\n */\nfunction constructNewChildrenArray(\n\tnewParentVNode,\n\trenderResult,\n\toldChildren,\n\toldDom,\n\tnewChildrenLength\n) {\n\t/** @type {number} */\n\tlet i;\n\t/** @type {VNode} */\n\tlet childVNode;\n\t/** @type {VNode} */\n\tlet oldVNode;\n\n\tlet oldChildrenLength = oldChildren.length,\n\t\tremainingOldChildren = oldChildrenLength;\n\n\tlet skew = 0;\n\n\tnewParentVNode._children = new Array(newChildrenLength);\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\t// @ts-expect-error We are reusing the childVNode variable to hold both the\n\t\t// pre and post normalized childVNode\n\t\tchildVNode = renderResult[i];\n\n\t\tif (\n\t\t\tchildVNode == NULL ||\n\t\t\ttypeof childVNode == 'boolean' ||\n\t\t\ttypeof childVNode == 'function'\n\t\t) {\n\t\t\tnewParentVNode._children[i] = NULL;\n\t\t\tcontinue;\n\t\t}\n\t\t// If this newVNode is being reused (e.g. <div>{reuse}{reuse}</div>) in the same diff,\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t\t// it's own DOM & etc. pointers\n\t\telse if (\n\t\t\ttypeof childVNode == 'string' ||\n\t\t\ttypeof childVNode == 'number' ||\n\t\t\t// eslint-disable-next-line valid-typeof\n\t\t\ttypeof childVNode == 'bigint' ||\n\t\t\tchildVNode.constructor == String\n\t\t) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tNULL,\n\t\t\t\tchildVNode,\n\t\t\t\tNULL,\n\t\t\t\tNULL,\n\t\t\t\tNULL\n\t\t\t);\n\t\t} else if (isArray(childVNode)) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tFragment,\n\t\t\t\t{ children: childVNode },\n\t\t\t\tNULL,\n\t\t\t\tNULL,\n\t\t\t\tNULL\n\t\t\t);\n\t\t} else if (childVNode.constructor === UNDEFINED && childVNode._depth > 0) {\n\t\t\t// VNode is already in use, clone it. This can happen in the following\n\t\t\t// scenario:\n\t\t\t// const reuse = <div />\n\t\t\t// <div>{reuse}<span />{reuse}</div>\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tchildVNode.type,\n\t\t\t\tchildVNode.props,\n\t\t\t\tchildVNode.key,\n\t\t\t\tchildVNode.ref ? childVNode.ref : NULL,\n\t\t\t\tchildVNode._original\n\t\t\t);\n\t\t} else {\n\t\t\tnewParentVNode._children[i] = childVNode;\n\t\t}\n\n\t\tconst skewedIndex = i + skew;\n\t\tchildVNode._parent = newParentVNode;\n\t\tchildVNode._depth = newParentVNode._depth + 1;\n\n\t\t// Temporarily store the matchingIndex on the _index property so we can pull\n\t\t// out the oldVNode in diffChildren. We'll override this to the VNode's\n\t\t// final index after using this property to get the oldVNode\n\t\tconst matchingIndex = (childVNode._index = findMatchingIndex(\n\t\t\tchildVNode,\n\t\t\toldChildren,\n\t\t\tskewedIndex,\n\t\t\tremainingOldChildren\n\t\t));\n\n\t\toldVNode = NULL;\n\t\tif (matchingIndex != -1) {\n\t\t\toldVNode = oldChildren[matchingIndex];\n\t\t\tremainingOldChildren--;\n\t\t\tif (oldVNode) {\n\t\t\t\toldVNode._flags |= MATCHED;\n\t\t\t}\n\t\t}\n\n\t\t// Here, we define isMounting for the purposes of the skew diffing\n\t\t// algorithm. Nodes that are unsuspending are considered mounting and we detect\n\t\t// this by checking if oldVNode._original == null\n\t\tconst isMounting = oldVNode == NULL || oldVNode._original == NULL;\n\n\t\tif (isMounting) {\n\t\t\tif (matchingIndex == -1) {\n\t\t\t\t// When the array of children is growing we need to decrease the skew\n\t\t\t\t// as we are adding a new element to the array.\n\t\t\t\t// Example:\n\t\t\t\t// [1, 2, 3] --> [0, 1, 2, 3]\n\t\t\t\t// oldChildren newChildren\n\t\t\t\t//\n\t\t\t\t// The new element is at index 0, so our skew is 0,\n\t\t\t\t// we need to decrease the skew as we are adding a new element.\n\t\t\t\t// The decrease will cause us to compare the element at position 1\n\t\t\t\t// with value 1 with the element at position 0 with value 0.\n\t\t\t\t//\n\t\t\t\t// A linear concept is applied when the array is shrinking,\n\t\t\t\t// if the length is unchanged we can assume that no skew\n\t\t\t\t// changes are needed.\n\t\t\t\tif (newChildrenLength > oldChildrenLength) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else if (newChildrenLength < oldChildrenLength) {\n\t\t\t\t\tskew++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we are mounting a DOM VNode, mark it for insertion\n\t\t\tif (typeof childVNode.type != 'function') {\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t} else if (matchingIndex != skewedIndex) {\n\t\t\t// When we move elements around i.e. [0, 1, 2] --> [1, 0, 2]\n\t\t\t// --> we diff 1, we find it at position 1 while our skewed index is 0 and our skew is 0\n\t\t\t// we set the skew to 1 as we found an offset.\n\t\t\t// --> we diff 0, we find it at position 0 while our skewed index is at 2 and our skew is 1\n\t\t\t// this makes us increase the skew again.\n\t\t\t// --> we diff 2, we find it at position 2 while our skewed index is at 4 and our skew is 2\n\t\t\t//\n\t\t\t// this becomes an optimization question where currently we see a 1 element offset as an insertion\n\t\t\t// or deletion i.e. we optimize for [0, 1, 2] --> [9, 0, 1, 2]\n\t\t\t// while a more than 1 offset we see as a swap.\n\t\t\t// We could probably build heuristics for having an optimized course of action here as well, but\n\t\t\t// might go at the cost of some bytes.\n\t\t\t//\n\t\t\t// If we wanted to optimize for i.e. only swaps we'd just do the last two code-branches and have\n\t\t\t// only the first item be a re-scouting and all the others fall in their skewed counter-part.\n\t\t\t// We could also further optimize for swaps\n\t\t\tif (matchingIndex == skewedIndex - 1) {\n\t\t\t\tskew--;\n\t\t\t} else if (matchingIndex == skewedIndex + 1) {\n\t\t\t\tskew++;\n\t\t\t} else {\n\t\t\t\tif (matchingIndex > skewedIndex) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else {\n\t\t\t\t\tskew++;\n\t\t\t\t}\n\n\t\t\t\t// Move this VNode's DOM if the original index (matchingIndex) doesn't\n\t\t\t\t// match the new skew index (i + new skew)\n\t\t\t\t// In the former two branches we know that it matches after skewing\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove remaining oldChildren if there are any. Loop forwards so that as we\n\t// unmount DOM from the beginning of the oldChildren, we can adjust oldDom to\n\t// point to the next child, which needs to be the first DOM node that won't be\n\t// unmounted.\n\tif (remainingOldChildren) {\n\t\tfor (i = 0; i < oldChildrenLength; i++) {\n\t\t\toldVNode = oldChildren[i];\n\t\t\tif (oldVNode != NULL && (oldVNode._flags & MATCHED) == 0) {\n\t\t\t\tif (oldVNode._dom == oldDom) {\n\t\t\t\t\toldDom = getDomSibling(oldVNode);\n\t\t\t\t}\n\n\t\t\t\tunmount(oldVNode, oldVNode);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn oldDom;\n}\n\n/**\n * @param {VNode} parentVNode\n * @param {PreactElement} oldDom\n * @param {PreactElement} parentDom\n * @param {boolean} shouldPlace\n * @returns {PreactElement}\n */\nfunction insert(parentVNode, oldDom, parentDom, shouldPlace) {\n\t// Note: VNodes in nested suspended trees may be missing _children.\n\n\tif (typeof parentVNode.type == 'function') {\n\t\tlet children = parentVNode._children;\n\t\tfor (let i = 0; children && i < children.length; i++) {\n\t\t\tif (children[i]) {\n\t\t\t\t// If we enter this code path on sCU bailout, where we copy\n\t\t\t\t// oldVNode._children to newVNode._children, we need to update the old\n\t\t\t\t// children's _parent pointer to point to the newVNode (parentVNode\n\t\t\t\t// here).\n\t\t\t\tchildren[i]._parent = parentVNode;\n\t\t\t\toldDom = insert(children[i], oldDom, parentDom, shouldPlace);\n\t\t\t}\n\t\t}\n\n\t\treturn oldDom;\n\t} else if (parentVNode._dom != oldDom) {\n\t\tif (shouldPlace) {\n\t\t\tif (oldDom && parentVNode.type && !oldDom.parentNode) {\n\t\t\t\toldDom = getDomSibling(parentVNode);\n\t\t\t}\n\t\t\tparentDom.insertBefore(parentVNode._dom, oldDom || NULL);\n\t\t}\n\t\toldDom = parentVNode._dom;\n\t}\n\n\tdo {\n\t\toldDom = oldDom && oldDom.nextSibling;\n\t} while (oldDom != NULL && oldDom.nodeType == 8);\n\n\treturn oldDom;\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {ComponentChildren} children The unflattened children of a virtual\n * node\n * @returns {VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children == NULL || typeof children == 'boolean') {\n\t} else if (isArray(children)) {\n\t\tchildren.some(child => {\n\t\t\ttoChildArray(child, out);\n\t\t});\n\t} else {\n\t\tout.push(children);\n\t}\n\treturn out;\n}\n\n/**\n * @param {VNode} childVNode\n * @param {VNode[]} oldChildren\n * @param {number} skewedIndex\n * @param {number} remainingOldChildren\n * @returns {number}\n */\nfunction findMatchingIndex(\n\tchildVNode,\n\toldChildren,\n\tskewedIndex,\n\tremainingOldChildren\n) {\n\tconst key = childVNode.key;\n\tconst type = childVNode.type;\n\tlet oldVNode = oldChildren[skewedIndex];\n\tconst matched = oldVNode != NULL && (oldVNode._flags & MATCHED) == 0;\n\n\t// We only need to perform a search if there are more children\n\t// (remainingOldChildren) to search. However, if the oldVNode we just looked\n\t// at skewedIndex was not already used in this diff, then there must be at\n\t// least 1 other (so greater than 1) remainingOldChildren to attempt to match\n\t// against. So the following condition checks that ensuring\n\t// remainingOldChildren > 1 if the oldVNode is not already used/matched. Else\n\t// if the oldVNode was null or matched, then there could needs to be at least\n\t// 1 (aka `remainingOldChildren > 0`) children to find and compare against.\n\t//\n\t// If there is an unkeyed functional VNode, that isn't a built-in like our Fragment,\n\t// we should not search as we risk re-using state of an unrelated VNode. (reverted for now)\n\tlet shouldSearch =\n\t\t// (typeof type != 'function' || type === Fragment || key) &&\n\t\tremainingOldChildren > (matched ? 1 : 0);\n\n\tif (\n\t\t(oldVNode === NULL && key == null) ||\n\t\t(matched && key == oldVNode.key && type == oldVNode.type)\n\t) {\n\t\treturn skewedIndex;\n\t} else if (shouldSearch) {\n\t\tlet x = skewedIndex - 1;\n\t\tlet y = skewedIndex + 1;\n\t\twhile (x >= 0 || y < oldChildren.length) {\n\t\t\tconst childIndex = x >= 0 ? x-- : y++;\n\t\t\toldVNode = oldChildren[childIndex];\n\t\t\tif (\n\t\t\t\toldVNode != NULL &&\n\t\t\t\t(oldVNode._flags & MATCHED) == 0 &&\n\t\t\t\tkey == oldVNode.key &&\n\t\t\t\ttype == oldVNode.type\n\t\t\t) {\n\t\t\t\treturn childIndex;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn -1;\n}\n","import {\n\tEMPTY_ARR,\n\tEMPTY_OBJ,\n\tMATH_NAMESPACE,\n\tMODE_HYDRATE,\n\tMODE_SUSPENDED,\n\tNULL,\n\tRESET_MODE,\n\tSVG_NAMESPACE,\n\tUNDEFINED,\n\tXHTML_NAMESPACE\n} from '../constants';\nimport { BaseComponent, getDomSibling } from '../component';\nimport { Fragment } from '../create-element';\nimport { diffChildren } from './children';\nimport { setProperty } from './props';\nimport { assign, isArray, removeNode, slice } from '../util';\nimport options from '../options';\n\n/**\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\n\n/**\n * @template {any} T\n * @typedef {import('../internal').Ref<T>} Ref<T>\n */\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {PreactElement} parentDom The parent of the DOM element\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object. Modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diff(\n\tparentDom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\t/** @type {any} */\n\tlet tmp,\n\t\tnewType = newVNode.type;\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== UNDEFINED) return NULL;\n\n\t// If the previous diff bailed out, resume creating/hydrating.\n\tif (oldVNode._flags & MODE_SUSPENDED) {\n\t\tisHydrating = !!(oldVNode._flags & MODE_HYDRATE);\n\t\toldDom = newVNode._dom = oldVNode._dom;\n\t\texcessDomChildren = [oldDom];\n\t}\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\touter: if (typeof newType == 'function') {\n\t\ttry {\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\n\t\t\tlet newProps = newVNode.props;\n\t\t\tconst isClassComponent = newType.prototype && newType.prototype.render;\n\n\t\t\t// Necessary for createContext api. Setting this property will pass\n\t\t\t// the context value as `this.context` just for this component.\n\t\t\ttmp = newType.contextType;\n\t\t\tlet provider = tmp && globalContext[tmp._id];\n\t\t\tlet componentContext = tmp\n\t\t\t\t? provider\n\t\t\t\t\t? provider.props.value\n\t\t\t\t\t: tmp._defaultValue\n\t\t\t\t: globalContext;\n\n\t\t\t// Get component and set it to `c`\n\t\t\tif (oldVNode._component) {\n\t\t\t\tc = newVNode._component = oldVNode._component;\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\n\t\t\t} else {\n\t\t\t\t// Instantiate the new component\n\t\t\t\tif (isClassComponent) {\n\t\t\t\t\t// @ts-expect-error The check above verifies that newType is suppose to be constructed\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-expect-error Trust me, Component implements the interface we want\n\t\t\t\t\tnewVNode._component = c = new BaseComponent(\n\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t);\n\t\t\t\t\tc.constructor = newType;\n\t\t\t\t\tc.render = doRender;\n\t\t\t\t}\n\t\t\t\tif (provider) provider.sub(c);\n\n\t\t\t\tif (!c.state) c.state = {};\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tisNew = c._dirty = true;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t}\n\n\t\t\t// Invoke getDerivedStateFromProps\n\t\t\tif (isClassComponent && c._nextState == NULL) {\n\t\t\t\tc._nextState = c.state;\n\t\t\t}\n\n\t\t\tif (isClassComponent && newType.getDerivedStateFromProps != NULL) {\n\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t}\n\n\t\t\t\tassign(\n\t\t\t\t\tc._nextState,\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\toldProps = c.props;\n\t\t\toldState = c.state;\n\t\t\tc._vnode = newVNode;\n\n\t\t\t// Invoke pre-render lifecycle methods\n\t\t\tif (isNew) {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent &&\n\t\t\t\t\tnewType.getDerivedStateFromProps == NULL &&\n\t\t\t\t\tc.componentWillMount != NULL\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillMount();\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent && c.componentDidMount != NULL) {\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent &&\n\t\t\t\t\tnewType.getDerivedStateFromProps == NULL &&\n\t\t\t\t\tnewProps !== oldProps &&\n\t\t\t\t\tc.componentWillReceiveProps != NULL\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tnewVNode._original == oldVNode._original ||\n\t\t\t\t\t(!c._force &&\n\t\t\t\t\t\tc.shouldComponentUpdate != NULL &&\n\t\t\t\t\t\tc.shouldComponentUpdate(\n\t\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t\t) === false)\n\t\t\t\t) {\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\t\t\tif (newVNode._original != oldVNode._original) {\n\t\t\t\t\t\t// When we are dealing with a bail because of sCU we have to update\n\t\t\t\t\t\t// the props, state and dirty-state.\n\t\t\t\t\t\t// when we are dealing with strict-equality we don't as the child could still\n\t\t\t\t\t\t// be dirtied see #3883\n\t\t\t\t\t\tc.props = newProps;\n\t\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t\t\tc._dirty = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t\tnewVNode._children.some(vnode => {\n\t\t\t\t\t\tif (vnode) vnode._parent = newVNode;\n\t\t\t\t\t});\n\n\t\t\t\t\tEMPTY_ARR.push.apply(c._renderCallbacks, c._stateCallbacks);\n\t\t\t\t\tc._stateCallbacks = [];\n\n\t\t\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\t\t\tcommitQueue.push(c);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate != NULL) {\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent && c.componentDidUpdate != NULL) {\n\t\t\t\t\tc._renderCallbacks.push(() => {\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tc.context = componentContext;\n\t\t\tc.props = newProps;\n\t\t\tc._parentDom = parentDom;\n\t\t\tc._force = false;\n\n\t\t\tlet renderHook = options._render,\n\t\t\t\tcount = 0;\n\t\t\tif (isClassComponent) {\n\t\t\t\tc.state = c._nextState;\n\t\t\t\tc._dirty = false;\n\n\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\tEMPTY_ARR.push.apply(c._renderCallbacks, c._stateCallbacks);\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t} else {\n\t\t\t\tdo {\n\t\t\t\t\tc._dirty = false;\n\t\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\t\t// Handle setState called in render, see #2553\n\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t} while (c._dirty && ++count < 25);\n\t\t\t}\n\n\t\t\t// Handle setState called in render, see #2553\n\t\t\tc.state = c._nextState;\n\n\t\t\tif (c.getChildContext != NULL) {\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\n\t\t\t}\n\n\t\t\tif (isClassComponent && !isNew && c.getSnapshotBeforeUpdate != NULL) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tlet renderResult =\n\t\t\t\ttmp != NULL && tmp.type === Fragment && tmp.key == NULL\n\t\t\t\t\t? cloneNode(tmp.props.children)\n\t\t\t\t\t: tmp;\n\n\t\t\toldDom = diffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tisArray(renderResult) ? renderResult : [renderResult],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnamespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\toldDom,\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\tc.base = newVNode._dom;\n\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\t\tnewVNode._flags &= RESET_MODE;\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\tif (clearProcessingException) {\n\t\t\t\tc._pendingError = c._processingException = NULL;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tnewVNode._original = NULL;\n\t\t\t// if hydrating or creating initial tree, bailout preserves DOM:\n\t\t\tif (isHydrating || excessDomChildren != NULL) {\n\t\t\t\tif (e.then) {\n\t\t\t\t\tnewVNode._flags |= isHydrating\n\t\t\t\t\t\t? MODE_HYDRATE | MODE_SUSPENDED\n\t\t\t\t\t\t: MODE_SUSPENDED;\n\n\t\t\t\t\twhile (oldDom && oldDom.nodeType == 8 && oldDom.nextSibling) {\n\t\t\t\t\t\toldDom = oldDom.nextSibling;\n\t\t\t\t\t}\n\n\t\t\t\t\texcessDomChildren[excessDomChildren.indexOf(oldDom)] = NULL;\n\t\t\t\t\tnewVNode._dom = oldDom;\n\t\t\t\t} else {\n\t\t\t\t\tfor (let i = excessDomChildren.length; i--; ) {\n\t\t\t\t\t\tremoveNode(excessDomChildren[i]);\n\t\t\t\t\t}\n\t\t\t\t\tmarkAsForce(newVNode);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\tif (!e.then) markAsForce(newVNode);\n\t\t\t}\n\t\t\toptions._catchError(e, newVNode, oldVNode);\n\t\t}\n\t} else if (\n\t\texcessDomChildren == NULL &&\n\t\tnewVNode._original == oldVNode._original\n\t) {\n\t\tnewVNode._children = oldVNode._children;\n\t\tnewVNode._dom = oldVNode._dom;\n\t} else {\n\t\toldDom = newVNode._dom = diffElementNodes(\n\t\t\toldVNode._dom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\t}\n\n\tif ((tmp = options.diffed)) tmp(newVNode);\n\n\treturn newVNode._flags & MODE_SUSPENDED ? undefined : oldDom;\n}\n\nfunction markAsForce(vnode) {\n\tif (vnode) {\n\t\tif (vnode._component) vnode._component._force = true;\n\t\tif (vnode._children) vnode._children.some(markAsForce);\n\t}\n}\n\n/**\n * @param {Array<Component>} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {VNode} root\n */\nexport function commitRoot(commitQueue, root, refQueue) {\n\tfor (let i = 0; i < refQueue.length; i++) {\n\t\tapplyRef(refQueue[i], refQueue[++i], refQueue[++i]);\n\t}\n\n\tif (options._commit) options._commit(root, commitQueue);\n\n\tcommitQueue.some(c => {\n\t\ttry {\n\t\t\t// @ts-expect-error Reuse the commitQueue variable here so the type changes\n\t\t\tcommitQueue = c._renderCallbacks;\n\t\t\tc._renderCallbacks = [];\n\t\t\tcommitQueue.some(cb => {\n\t\t\t\t// @ts-expect-error See above comment on commitQueue\n\t\t\t\tcb.call(c);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t});\n}\n\nfunction cloneNode(node) {\n\tif (typeof node != 'object' || node == NULL || node._depth > 0) {\n\t\treturn node;\n\t}\n\n\tif (isArray(node)) {\n\t\treturn node.map(cloneNode);\n\t}\n\n\treturn assign({}, node);\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {PreactElement} dom The DOM element representing the virtual nodes\n * being diffed\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n * @returns {PreactElement}\n */\nfunction diffElementNodes(\n\tdom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\tisHydrating,\n\trefQueue\n) {\n\tlet oldProps = oldVNode.props || EMPTY_OBJ;\n\tlet newProps = newVNode.props;\n\tlet nodeType = /** @type {string} */ (newVNode.type);\n\t/** @type {any} */\n\tlet i;\n\t/** @type {{ __html?: string }} */\n\tlet newHtml;\n\t/** @type {{ __html?: string }} */\n\tlet oldHtml;\n\t/** @type {ComponentChildren} */\n\tlet newChildren;\n\tlet value;\n\tlet inputValue;\n\tlet checked;\n\n\t// Tracks entering and exiting namespaces when descending through the tree.\n\tif (nodeType == 'svg') namespace = SVG_NAMESPACE;\n\telse if (nodeType == 'math') namespace = MATH_NAMESPACE;\n\telse if (!namespace) namespace = XHTML_NAMESPACE;\n\n\tif (excessDomChildren != NULL) {\n\t\tfor (i = 0; i < excessDomChildren.length; i++) {\n\t\t\tvalue = excessDomChildren[i];\n\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\n\t\t\t// argument matches an element in excessDomChildren, remove it from\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\n\t\t\tif (\n\t\t\t\tvalue &&\n\t\t\t\t'setAttribute' in value == !!nodeType &&\n\t\t\t\t(nodeType ? value.localName == nodeType : value.nodeType == 3)\n\t\t\t) {\n\t\t\t\tdom = value;\n\t\t\t\texcessDomChildren[i] = NULL;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (dom == NULL) {\n\t\tif (nodeType == NULL) {\n\t\t\treturn document.createTextNode(newProps);\n\t\t}\n\n\t\tdom = document.createElementNS(\n\t\t\tnamespace,\n\t\t\tnodeType,\n\t\t\tnewProps.is && newProps\n\t\t);\n\n\t\t// we are creating a new node, so we can assume this is a new subtree (in\n\t\t// case we are hydrating), this deopts the hydrate\n\t\tif (isHydrating) {\n\t\t\tif (options._hydrationMismatch)\n\t\t\t\toptions._hydrationMismatch(newVNode, excessDomChildren);\n\t\t\tisHydrating = false;\n\t\t}\n\t\t// we created a new parent, so none of the previously attached children can be reused:\n\t\texcessDomChildren = NULL;\n\t}\n\n\tif (nodeType == NULL) {\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\n\t\tif (oldProps !== newProps && (!isHydrating || dom.data != newProps)) {\n\t\t\tdom.data = newProps;\n\t\t}\n\t} else {\n\t\t// If excessDomChildren was not null, repopulate it with the current element's children:\n\t\texcessDomChildren = excessDomChildren && slice.call(dom.childNodes);\n\n\t\t// If we are in a situation where we are not hydrating but are using\n\t\t// existing DOM (e.g. replaceNode) we should read the existing DOM\n\t\t// attributes to diff them\n\t\tif (!isHydrating && excessDomChildren != NULL) {\n\t\t\toldProps = {};\n\t\t\tfor (i = 0; i < dom.attributes.length; i++) {\n\t\t\t\tvalue = dom.attributes[i];\n\t\t\t\toldProps[value.name] = value.value;\n\t\t\t}\n\t\t}\n\n\t\tfor (i in oldProps) {\n\t\t\tvalue = oldProps[i];\n\t\t\tif (i == 'dangerouslySetInnerHTML') {\n\t\t\t\toldHtml = value;\n\t\t\t} else if (\n\t\t\t\ti != 'children' &&\n\t\t\t\t!(i in newProps) &&\n\t\t\t\t!(i == 'value' && 'defaultValue' in newProps) &&\n\t\t\t\t!(i == 'checked' && 'defaultChecked' in newProps)\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, NULL, value, namespace);\n\t\t\t}\n\t\t}\n\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\n\t\t// @TODO we should warn in debug mode when props don't match here.\n\t\tfor (i in newProps) {\n\t\t\tvalue = newProps[i];\n\t\t\tif (i == 'children') {\n\t\t\t\tnewChildren = value;\n\t\t\t} else if (i == 'dangerouslySetInnerHTML') {\n\t\t\t\tnewHtml = value;\n\t\t\t} else if (i == 'value') {\n\t\t\t\tinputValue = value;\n\t\t\t} else if (i == 'checked') {\n\t\t\t\tchecked = value;\n\t\t\t} else if (\n\t\t\t\t(!isHydrating || typeof value == 'function') &&\n\t\t\t\toldProps[i] !== value\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, value, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\t\tif (\n\t\t\t\t!isHydrating &&\n\t\t\t\t(!oldHtml ||\n\t\t\t\t\t(newHtml.__html != oldHtml.__html && newHtml.__html != dom.innerHTML))\n\t\t\t) {\n\t\t\t\tdom.innerHTML = newHtml.__html;\n\t\t\t}\n\n\t\t\tnewVNode._children = [];\n\t\t} else {\n\t\t\tif (oldHtml) dom.innerHTML = '';\n\n\t\t\tdiffChildren(\n\t\t\t\t// @ts-expect-error\n\t\t\t\tnewVNode.type == 'template' ? dom.content : dom,\n\t\t\t\tisArray(newChildren) ? newChildren : [newChildren],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnodeType == 'foreignObject' ? XHTML_NAMESPACE : namespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\texcessDomChildren\n\t\t\t\t\t? excessDomChildren[0]\n\t\t\t\t\t: oldVNode._children && getDomSibling(oldVNode, 0),\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\t// Remove children that are not part of any vnode.\n\t\t\tif (excessDomChildren != NULL) {\n\t\t\t\tfor (i = excessDomChildren.length; i--; ) {\n\t\t\t\t\tremoveNode(excessDomChildren[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// As above, don't diff props during hydration\n\t\tif (!isHydrating) {\n\t\t\ti = 'value';\n\t\t\tif (nodeType == 'progress' && inputValue == NULL) {\n\t\t\t\tdom.removeAttribute('value');\n\t\t\t} else if (\n\t\t\t\tinputValue != UNDEFINED &&\n\t\t\t\t// #2756 For the <progress>-element the initial value is 0,\n\t\t\t\t// despite the attribute not being present. When the attribute\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\n\t\t\t\t(inputValue !== dom[i] ||\n\t\t\t\t\t(nodeType == 'progress' && !inputValue) ||\n\t\t\t\t\t// This is only for IE 11 to fix <select> value not being updated.\n\t\t\t\t\t// To avoid a stale select value we need to set the option.value\n\t\t\t\t\t// again, which triggers IE11 to re-evaluate the select value\n\t\t\t\t\t(nodeType == 'option' && inputValue != oldProps[i]))\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, inputValue, oldProps[i], namespace);\n\t\t\t}\n\n\t\t\ti = 'checked';\n\t\t\tif (checked != UNDEFINED && checked != dom[i]) {\n\t\t\t\tsetProperty(dom, i, checked, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {Ref<any> & { _unmount?: unknown }} ref\n * @param {any} value\n * @param {VNode} vnode\n */\nexport function applyRef(ref, value, vnode) {\n\ttry {\n\t\tif (typeof ref == 'function') {\n\t\t\tlet hasRefUnmount = typeof ref._unmount == 'function';\n\t\t\tif (hasRefUnmount) {\n\t\t\t\t// @ts-ignore TS doesn't like moving narrowing checks into variables\n\t\t\t\tref._unmount();\n\t\t\t}\n\n\t\t\tif (!hasRefUnmount || value != NULL) {\n\t\t\t\t// Store the cleanup function on the function\n\t\t\t\t// instance object itself to avoid shape\n\t\t\t\t// transitioning vnode\n\t\t\t\tref._unmount = ref(value);\n\t\t\t}\n\t\t} else ref.current = value;\n\t} catch (e) {\n\t\toptions._catchError(e, vnode);\n\t}\n}\n\n/**\n * Unmount a virtual node from the tree and apply DOM changes\n * @param {VNode} vnode The virtual node to unmount\n * @param {VNode} parentVNode The parent of the VNode that initiated the unmount\n * @param {boolean} [skipRemove] Flag that indicates that a parent node of the\n * current element is already detached from the DOM.\n */\nexport function unmount(vnode, parentVNode, skipRemove) {\n\tlet r;\n\tif (options.unmount) options.unmount(vnode);\n\n\tif ((r = vnode.ref)) {\n\t\tif (!r.current || r.current == vnode._dom) {\n\t\t\tapplyRef(r, NULL, parentVNode);\n\t\t}\n\t}\n\n\tif ((r = vnode._component) != NULL) {\n\t\tif (r.componentWillUnmount) {\n\t\t\ttry {\n\t\t\t\tr.componentWillUnmount();\n\t\t\t} catch (e) {\n\t\t\t\toptions._catchError(e, parentVNode);\n\t\t\t}\n\t\t}\n\n\t\tr.base = r._parentDom = NULL;\n\t}\n\n\tif ((r = vnode._children)) {\n\t\tfor (let i = 0; i < r.length; i++) {\n\t\t\tif (r[i]) {\n\t\t\t\tunmount(\n\t\t\t\t\tr[i],\n\t\t\t\t\tparentVNode,\n\t\t\t\t\tskipRemove || typeof vnode.type != 'function'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!skipRemove) {\n\t\tremoveNode(vnode._dom);\n\t}\n\n\tvnode._component = vnode._parent = vnode._dom = UNDEFINED;\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n","import { EMPTY_OBJ, NULL } from './constants';\nimport { commitRoot, diff } from './diff/index';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\nimport { slice } from './util';\n\n/**\n * Render a Preact virtual node into a DOM element\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to render into\n * @param {import('./internal').PreactElement | object} [replaceNode] Optional: Attempt to re-use an\n * existing DOM tree rooted at `replaceNode`\n */\nexport function render(vnode, parentDom, replaceNode) {\n\t// https://github.com/preactjs/preact/issues/3794\n\tif (parentDom == document) {\n\t\tparentDom = document.documentElement;\n\t}\n\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// We abuse the `replaceNode` parameter in `hydrate()` to signal if we are in\n\t// hydration mode or not by passing the `hydrate` function instead of a DOM\n\t// element..\n\tlet isHydrating = typeof replaceNode == 'function';\n\n\t// To be able to support calling `render()` multiple times on the same\n\t// DOM node, we need to obtain a reference to the previous tree. We do\n\t// this by assigning a new `_children` property to DOM nodes which points\n\t// to the last rendered tree. By default this property is not present, which\n\t// means that we are mounting a new tree for the first time.\n\tlet oldVNode = isHydrating\n\t\t? NULL\n\t\t: (replaceNode && replaceNode._children) || parentDom._children;\n\n\tvnode = ((!isHydrating && replaceNode) || parentDom)._children =\n\t\tcreateElement(Fragment, NULL, [vnode]);\n\n\t// List of effects that need to be called after diffing.\n\tlet commitQueue = [],\n\t\trefQueue = [];\n\tdiff(\n\t\tparentDom,\n\t\t// Determine the new vnode tree and store it on the DOM element on\n\t\t// our custom `_children` property.\n\t\tvnode,\n\t\toldVNode || EMPTY_OBJ,\n\t\tEMPTY_OBJ,\n\t\tparentDom.namespaceURI,\n\t\t!isHydrating && replaceNode\n\t\t\t? [replaceNode]\n\t\t\t: oldVNode\n\t\t\t\t? NULL\n\t\t\t\t: parentDom.firstChild\n\t\t\t\t\t? slice.call(parentDom.childNodes)\n\t\t\t\t\t: NULL,\n\t\tcommitQueue,\n\t\t!isHydrating && replaceNode\n\t\t\t? replaceNode\n\t\t\t: oldVNode\n\t\t\t\t? oldVNode._dom\n\t\t\t\t: parentDom.firstChild,\n\t\tisHydrating,\n\t\trefQueue\n\t);\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, vnode, refQueue);\n}\n\n/**\n * Update an existing DOM element with data from a Preact virtual node\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to update\n */\nexport function hydrate(vnode, parentDom) {\n\trender(vnode, parentDom, hydrate);\n}\n","import { assign, slice } from './util';\nimport { createVNode } from './create-element';\nimport { NULL, UNDEFINED } from './constants';\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its\n * children.\n * @param {import('./internal').VNode} vnode The virtual DOM element to clone\n * @param {object} props Attributes/props to add when cloning\n * @param {Array<import('./internal').ComponentChildren>} rest Any additional arguments will be used\n * as replacement children.\n * @returns {import('./internal').VNode}\n */\nexport function cloneElement(vnode, props, children) {\n\tlet normalizedProps = assign({}, vnode.props),\n\t\tkey,\n\t\tref,\n\t\ti;\n\n\tlet defaultProps;\n\n\tif (vnode.type && vnode.type.defaultProps) {\n\t\tdefaultProps = vnode.type.defaultProps;\n\t}\n\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse if (props[i] === UNDEFINED && defaultProps != UNDEFINED) {\n\t\t\tnormalizedProps[i] = defaultProps[i];\n\t\t} else {\n\t\t\tnormalizedProps[i] = props[i];\n\t\t}\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\treturn createVNode(\n\t\tvnode.type,\n\t\tnormalizedProps,\n\t\tkey || vnode.key,\n\t\tref || vnode.ref,\n\t\tNULL\n\t);\n}\n","import { NULL } from '../constants';\n\n/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {import('../internal').VNode} vnode The vnode that threw the error that was caught (except\n * for unmounting when this parameter is the highest parent that was being\n * unmounted)\n * @param {import('../internal').VNode} [oldVNode]\n * @param {import('../internal').ErrorInfo} [errorInfo]\n */\nexport function _catchError(error, vnode, oldVNode, errorInfo) {\n\t/** @type {import('../internal').Component} */\n\tlet component,\n\t\t/** @type {import('../internal').ComponentType} */\n\t\tctor,\n\t\t/** @type {boolean} */\n\t\thandled;\n\n\tfor (; (vnode = vnode._parent); ) {\n\t\tif ((component = vnode._component) && !component._processingException) {\n\t\t\ttry {\n\t\t\t\tctor = component.constructor;\n\n\t\t\t\tif (ctor && ctor.getDerivedStateFromError != NULL) {\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\tif (component.componentDidCatch != NULL) {\n\t\t\t\t\tcomponent.componentDidCatch(error, errorInfo || {});\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\t// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.\n\t\t\t\tif (handled) {\n\t\t\t\t\treturn (component._pendingError = component);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow error;\n}\n","import { options as _options } from 'preact';\n\n/** @type {number} */\nlet currentIndex;\n\n/** @type {import('./internal').Component} */\nlet currentComponent;\n\n/** @type {import('./internal').Component} */\nlet previousComponent;\n\n/** @type {number} */\nlet currentHook = 0;\n\n/** @type {Array<import('./internal').Component>} */\nlet afterPaintEffects = [];\n\n// Cast to use internal Options type\nconst options = /** @type {import('./internal').Options} */ (_options);\n\nlet oldBeforeDiff = options._diff;\nlet oldBeforeRender = options._render;\nlet oldAfterDiff = options.diffed;\nlet oldCommit = options._commit;\nlet oldBeforeUnmount = options.unmount;\nlet oldRoot = options._root;\n\n// We take the minimum timeout for requestAnimationFrame to ensure that\n// the callback is invoked after the next frame. 35ms is based on a 30hz\n// refresh rate, which is the minimum rate for a smooth user experience.\nconst RAF_TIMEOUT = 35;\nlet prevRaf;\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions._diff = vnode => {\n\tcurrentComponent = null;\n\tif (oldBeforeDiff) oldBeforeDiff(vnode);\n};\n\noptions._root = (vnode, parentDom) => {\n\tif (vnode && parentDom._children && parentDom._children._mask) {\n\t\tvnode._mask = parentDom._children._mask;\n\t}\n\n\tif (oldRoot) oldRoot(vnode, parentDom);\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions._render = vnode => {\n\tif (oldBeforeRender) oldBeforeRender(vnode);\n\n\tcurrentComponent = vnode._component;\n\tcurrentIndex = 0;\n\n\tconst hooks = currentComponent.__hooks;\n\tif (hooks) {\n\t\tif (previousComponent === currentComponent) {\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentComponent._renderCallbacks = [];\n\t\t\thooks._list.some(hookItem => {\n\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t}\n\t\t\t\thookItem._pendingArgs = hookItem._nextValue = undefined;\n\t\t\t});\n\t\t} else {\n\t\t\thooks._pendingEffects.some(invokeCleanup);\n\t\t\thooks._pendingEffects.some(invokeEffect);\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentIndex = 0;\n\t\t}\n\t}\n\tpreviousComponent = currentComponent;\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.diffed = vnode => {\n\tif (oldAfterDiff) oldAfterDiff(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tif (c.__hooks._pendingEffects.length) afterPaint(afterPaintEffects.push(c));\n\t\tc.__hooks._list.some(hookItem => {\n\t\t\tif (hookItem._pendingArgs) {\n\t\t\t\thookItem._args = hookItem._pendingArgs;\n\t\t\t}\n\t\t\thookItem._pendingArgs = undefined;\n\t\t});\n\t}\n\tpreviousComponent = currentComponent = null;\n};\n\n// TODO: Improve typing of commitQueue parameter\n/** @type {(vnode: import('./internal').VNode, commitQueue: any) => void} */\noptions._commit = (vnode, commitQueue) => {\n\tcommitQueue.some(component => {\n\t\ttry {\n\t\t\tcomponent._renderCallbacks.some(invokeCleanup);\n\t\t\tcomponent._renderCallbacks = component._renderCallbacks.filter(cb =>\n\t\t\t\tcb._value ? invokeEffect(cb) : true\n\t\t\t);\n\t\t} catch (e) {\n\t\t\tcommitQueue.some(c => {\n\t\t\t\tif (c._renderCallbacks) c._renderCallbacks = [];\n\t\t\t});\n\t\t\tcommitQueue = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t});\n\n\tif (oldCommit) oldCommit(vnode, commitQueue);\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.unmount = vnode => {\n\tif (oldBeforeUnmount) oldBeforeUnmount(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tlet hasErrored;\n\t\tc.__hooks._list.some(s => {\n\t\t\ttry {\n\t\t\t\tinvokeCleanup(s);\n\t\t\t} catch (e) {\n\t\t\t\thasErrored = e;\n\t\t\t}\n\t\t});\n\t\tc.__hooks = undefined;\n\t\tif (hasErrored) options._catchError(hasErrored, c._vnode);\n\t}\n};\n\n/**\n * Get a hook's state from the currentComponent\n * @param {number} index The index of the hook to get\n * @param {number} type The index of the hook to get\n * @returns {any}\n */\nfunction getHookState(index, type) {\n\tif (options._hook) {\n\t\toptions._hook(currentComponent, index, currentHook || type);\n\t}\n\tcurrentHook = 0;\n\n\t// Largely inspired by:\n\t// * https://github.com/michael-klein/funcy.js/blob/f6be73468e6ec46b0ff5aa3cc4c9baf72a29025a/src/hooks/core_hooks.mjs\n\t// * https://github.com/michael-klein/funcy.js/blob/650beaa58c43c33a74820a3c98b3c7079cf2e333/src/renderer.mjs\n\t// Other implementations to look at:\n\t// * https://codesandbox.io/s/mnox05qp8\n\tconst hooks =\n\t\tcurrentComponent.__hooks ||\n\t\t(currentComponent.__hooks = {\n\t\t\t_list: [],\n\t\t\t_pendingEffects: []\n\t\t});\n\n\tif (index >= hooks._list.length) {\n\t\thooks._list.push({});\n\t}\n\n\treturn hooks._list[index];\n}\n\n/**\n * @template {unknown} S\n * @param {import('./index').Dispatch<import('./index').StateUpdater<S>>} [initialState]\n * @returns {[S, (state: S) => void]}\n */\nexport function useState(initialState) {\n\tcurrentHook = 1;\n\treturn useReducer(invokeOrReturn, initialState);\n}\n\n/**\n * @template {unknown} S\n * @template {unknown} A\n * @param {import('./index').Reducer<S, A>} reducer\n * @param {import('./index').Dispatch<import('./index').StateUpdater<S>>} initialState\n * @param {(initialState: any) => void} [init]\n * @returns {[ S, (state: S) => void ]}\n */\nexport function useReducer(reducer, initialState, init) {\n\t/** @type {import('./internal').ReducerHookState} */\n\tconst hookState = getHookState(currentIndex++, 2);\n\thookState._reducer = reducer;\n\tif (!hookState._component) {\n\t\thookState._value = [\n\t\t\t!init ? invokeOrReturn(undefined, initialState) : init(initialState),\n\n\t\t\taction => {\n\t\t\t\tconst currentValue = hookState._nextValue\n\t\t\t\t\t? hookState._nextValue[0]\n\t\t\t\t\t: hookState._value[0];\n\t\t\t\tconst nextValue = hookState._reducer(currentValue, action);\n\n\t\t\t\tif (currentValue !== nextValue) {\n\t\t\t\t\thookState._nextValue = [nextValue, hookState._value[1]];\n\t\t\t\t\thookState._component.setState({});\n\t\t\t\t}\n\t\t\t}\n\t\t];\n\n\t\thookState._component = currentComponent;\n\n\t\tif (!currentComponent._hasScuFromHooks) {\n\t\t\tcurrentComponent._hasScuFromHooks = true;\n\t\t\tlet prevScu = currentComponent.shouldComponentUpdate;\n\t\t\tconst prevCWU = currentComponent.componentWillUpdate;\n\n\t\t\t// If we're dealing with a forced update `shouldComponentUpdate` will\n\t\t\t// not be called. But we use that to update the hook values, so we\n\t\t\t// need to call it.\n\t\t\tcurrentComponent.componentWillUpdate = function (p, s, c) {\n\t\t\t\tif (this._force) {\n\t\t\t\t\tlet tmp = prevScu;\n\t\t\t\t\t// Clear to avoid other sCU hooks from being called\n\t\t\t\t\tprevScu = undefined;\n\t\t\t\t\tupdateHookState(p, s, c);\n\t\t\t\t\tprevScu = tmp;\n\t\t\t\t}\n\n\t\t\t\tif (prevCWU) prevCWU.call(this, p, s, c);\n\t\t\t};\n\n\t\t\t// This SCU has the purpose of bailing out after repeated updates\n\t\t\t// to stateful hooks.\n\t\t\t// we store the next value in _nextValue[0] and keep doing that for all\n\t\t\t// state setters, if we have next states and\n\t\t\t// all next states within a component end up being equal to their original state\n\t\t\t// we are safe to bail out for this specific component.\n\t\t\t/**\n\t\t\t *\n\t\t\t * @type {import('./internal').Component[\"shouldComponentUpdate\"]}\n\t\t\t */\n\t\t\t// @ts-ignore - We don't use TS to downtranspile\n\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\tfunction updateHookState(p, s, c) {\n\t\t\t\tif (!hookState._component.__hooks) return true;\n\n\t\t\t\tconst stateHooks = hookState._component.__hooks._list.filter(\n\t\t\t\t\tx => x._component\n\t\t\t\t);\n\n\t\t\t\tconst allHooksEmpty = stateHooks.every(x => !x._nextValue);\n\t\t\t\t// When we have no updated hooks in the component we invoke the previous SCU or\n\t\t\t\t// traverse the VDOM tree further.\n\t\t\t\tif (allHooksEmpty) {\n\t\t\t\t\treturn prevScu ? prevScu.call(this, p, s, c) : true;\n\t\t\t\t}\n\n\t\t\t\t// We check whether we have components with a nextValue set that\n\t\t\t\t// have values that aren't equal to one another this pushes\n\t\t\t\t// us to update further down the tree\n\t\t\t\tlet shouldUpdate = hookState._component.props !== p;\n\t\t\t\tstateHooks.some(hookItem => {\n\t\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\t\tconst currentValue = hookItem._value[0];\n\t\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t\t\thookItem._nextValue = undefined;\n\t\t\t\t\t\tif (currentValue !== hookItem._value[0]) shouldUpdate = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn prevScu\n\t\t\t\t\t? prevScu.call(this, p, s, c) || shouldUpdate\n\t\t\t\t\t: shouldUpdate;\n\t\t\t}\n\n\t\t\tcurrentComponent.shouldComponentUpdate = updateHookState;\n\t\t}\n\t}\n\n\treturn hookState._nextValue || hookState._value;\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 3);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent.__hooks._pendingEffects.push(state);\n\t}\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useLayoutEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 4);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent._renderCallbacks.push(state);\n\t}\n}\n\n/** @type {(initialValue: unknown) => unknown} */\nexport function useRef(initialValue) {\n\tcurrentHook = 5;\n\treturn useMemo(() => ({ current: initialValue }), []);\n}\n\n/**\n * @param {object} ref\n * @param {() => object} createHandle\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useImperativeHandle(ref, createHandle, args) {\n\tcurrentHook = 6;\n\tuseLayoutEffect(\n\t\t() => {\n\t\t\tif (typeof ref == 'function') {\n\t\t\t\tconst result = ref(createHandle());\n\t\t\t\treturn () => {\n\t\t\t\t\tref(null);\n\t\t\t\t\tif (result && typeof result == 'function') result();\n\t\t\t\t};\n\t\t\t} else if (ref) {\n\t\t\t\tref.current = createHandle();\n\t\t\t\treturn () => (ref.current = null);\n\t\t\t}\n\t\t},\n\t\targs == null ? args : args.concat(ref)\n\t);\n}\n\n/**\n * @template {unknown} T\n * @param {() => T} factory\n * @param {unknown[]} args\n * @returns {T}\n */\nexport function useMemo(factory, args) {\n\t/** @type {import('./internal').MemoHookState<T>} */\n\tconst state = getHookState(currentIndex++, 7);\n\tif (argsChanged(state._args, args)) {\n\t\tstate._value = factory();\n\t\tstate._args = args;\n\t\tstate._factory = factory;\n\t}\n\n\treturn state._value;\n}\n\n/**\n * @param {() => void} callback\n * @param {unknown[]} args\n * @returns {() => void}\n */\nexport function useCallback(callback, args) {\n\tcurrentHook = 8;\n\treturn useMemo(() => callback, args);\n}\n\n/**\n * @param {import('./internal').PreactContext} context\n */\nexport function useContext(context) {\n\tconst provider = currentComponent.context[context._id];\n\t// We could skip this call here, but than we'd not call\n\t// `options._hook`. We need to do that in order to make\n\t// the devtools aware of this hook.\n\t/** @type {import('./internal').ContextHookState} */\n\tconst state = getHookState(currentIndex++, 9);\n\t// The devtools needs access to the context object to\n\t// be able to pull of the default value when no provider\n\t// is present in the tree.\n\tstate._context = context;\n\tif (!provider) return context._defaultValue;\n\t// This is probably not safe to convert to \"!\"\n\tif (state._value == null) {\n\t\tstate._value = true;\n\t\tprovider.sub(currentComponent);\n\t}\n\treturn provider.props.value;\n}\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {<T>(value: T, cb?: (value: T) => string | number) => void}\n */\nexport function useDebugValue(value, formatter) {\n\tif (options.useDebugValue) {\n\t\toptions.useDebugValue(\n\t\t\tformatter ? formatter(value) : /** @type {any}*/ (value)\n\t\t);\n\t}\n}\n\n/**\n * @param {(error: unknown, errorInfo: import('preact').ErrorInfo) => void} cb\n * @returns {[unknown, () => void]}\n */\nexport function useErrorBoundary(cb) {\n\t/** @type {import('./internal').ErrorBoundaryHookState} */\n\tconst state = getHookState(currentIndex++, 10);\n\tconst errState = useState();\n\tstate._value = cb;\n\tif (!currentComponent.componentDidCatch) {\n\t\tcurrentComponent.componentDidCatch = (err, errorInfo) => {\n\t\t\tif (state._value) state._value(err, errorInfo);\n\t\t\terrState[1](err);\n\t\t};\n\t}\n\treturn [\n\t\terrState[0],\n\t\t() => {\n\t\t\terrState[1](undefined);\n\t\t}\n\t];\n}\n\n/** @type {() => string} */\nexport function useId() {\n\t/** @type {import('./internal').IdHookState} */\n\tconst state = getHookState(currentIndex++, 11);\n\tif (!state._value) {\n\t\t// Grab either the root node or the nearest async boundary node.\n\t\t/** @type {import('./internal').VNode} */\n\t\tlet root = currentComponent._vnode;\n\t\twhile (root !== null && !root._mask && root._parent !== null) {\n\t\t\troot = root._parent;\n\t\t}\n\n\t\tlet mask = root._mask || (root._mask = [0, 0]);\n\t\tstate._value = 'P' + mask[0] + '-' + mask[1]++;\n\t}\n\n\treturn state._value;\n}\n\n/**\n * After paint effects consumer.\n */\nfunction flushAfterPaintEffects() {\n\tlet component;\n\twhile ((component = afterPaintEffects.shift())) {\n\t\tconst hooks = component.__hooks;\n\t\tif (!component._parentDom || !hooks) continue;\n\t\ttry {\n\t\t\thooks._pendingEffects.some(invokeCleanup);\n\t\t\thooks._pendingEffects.some(invokeEffect);\n\t\t\thooks._pendingEffects = [];\n\t\t} catch (e) {\n\t\t\thooks._pendingEffects = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t}\n}\n\nlet HAS_RAF = typeof requestAnimationFrame == 'function';\n\n/**\n * Schedule a callback to be invoked after the browser has a chance to paint a new frame.\n * Do this by combining requestAnimationFrame (rAF) + setTimeout to invoke a callback after\n * the next browser frame.\n *\n * Also, schedule a timeout in parallel to the the rAF to ensure the callback is invoked\n * even if RAF doesn't fire (for example if the browser tab is not visible)\n *\n * @param {() => void} callback\n */\nfunction afterNextFrame(callback) {\n\tconst done = () => {\n\t\tclearTimeout(timeout);\n\t\tif (HAS_RAF) cancelAnimationFrame(raf);\n\t\tsetTimeout(callback);\n\t};\n\tconst timeout = setTimeout(done, RAF_TIMEOUT);\n\n\tlet raf;\n\tif (HAS_RAF) {\n\t\traf = requestAnimationFrame(done);\n\t}\n}\n\n// Note: if someone used options.debounceRendering = requestAnimationFrame,\n// then effects will ALWAYS run on the NEXT frame instead of the current one, incurring a ~16ms delay.\n// Perhaps this is not such a big deal.\n/**\n * Schedule afterPaintEffects flush after the browser paints\n * @param {number} newQueueLength\n * @returns {void}\n */\nfunction afterPaint(newQueueLength) {\n\tif (newQueueLength === 1 || prevRaf !== options.requestAnimationFrame) {\n\t\tprevRaf = options.requestAnimationFrame;\n\t\t(prevRaf || afterNextFrame)(flushAfterPaintEffects);\n\t}\n}\n\n/**\n * @param {import('./internal').HookState} hook\n * @returns {void}\n */\nfunction invokeCleanup(hook) {\n\t// A hook cleanup can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\tlet cleanup = hook._cleanup;\n\tif (typeof cleanup == 'function') {\n\t\thook._cleanup = undefined;\n\t\tcleanup();\n\t}\n\n\tcurrentComponent = comp;\n}\n\n/**\n * Invoke a Hook's effect\n * @param {import('./internal').EffectHookState} hook\n * @returns {void}\n */\nfunction invokeEffect(hook) {\n\t// A hook call can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\thook._cleanup = hook._value();\n\tcurrentComponent = comp;\n}\n\n/**\n * @param {unknown[]} oldArgs\n * @param {unknown[]} newArgs\n * @returns {boolean}\n */\nfunction argsChanged(oldArgs, newArgs) {\n\treturn (\n\t\t!oldArgs ||\n\t\toldArgs.length !== newArgs.length ||\n\t\tnewArgs.some((arg, index) => arg !== oldArgs[index])\n\t);\n}\n\n/**\n * @template Arg\n * @param {Arg} arg\n * @param {(arg: Arg) => any} f\n * @returns {any}\n */\nfunction invokeOrReturn(arg, f) {\n\treturn typeof f == 'function' ? f(arg) : f;\n}\n","const ENCODED_ENTITIES = /[\"&<]/;\n\n/** @param {string} str */\nexport function encodeEntities(str) {\n\t// Skip all work for strings with no entities needing encoding:\n\tif (str.length === 0 || ENCODED_ENTITIES.test(str) === false) return str;\n\n\tlet last = 0,\n\t\ti = 0,\n\t\tout = '',\n\t\tch = '';\n\n\t// Seek forward in str until the next entity char:\n\tfor (; i < str.length; i++) {\n\t\tswitch (str.charCodeAt(i)) {\n\t\t\tcase 34:\n\t\t\t\tch = '&quot;';\n\t\t\t\tbreak;\n\t\t\tcase 38:\n\t\t\t\tch = '&amp;';\n\t\t\t\tbreak;\n\t\t\tcase 60:\n\t\t\t\tch = '&lt;';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tcontinue;\n\t\t}\n\t\t// Append skipped/buffered characters and the encoded entity:\n\t\tif (i !== last) out += str.slice(last, i);\n\t\tout += ch;\n\t\t// Start the next seek/buffer after the entity's offset:\n\t\tlast = i + 1;\n\t}\n\tif (i !== last) out += str.slice(last, i);\n\treturn out;\n}\n","/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 2;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 1;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nexport const XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nexport const MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n\nexport const NULL = null;\nexport const UNDEFINED = undefined;\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL =\n\t/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n","import { options, Fragment } from 'preact';\nimport { encodeEntities } from './utils';\nimport { IS_NON_DIMENSIONAL } from '../../src/constants';\n\nlet vnodeId = 0;\n\nconst isArray = Array.isArray;\n\n/**\n * @fileoverview\n * This file exports various methods that implement Babel's \"automatic\" JSX runtime API:\n * - jsx(type, props, key)\n * - jsxs(type, props, key)\n * - jsxDEV(type, props, key, __source, __self)\n *\n * The implementation of createVNode here is optimized for performance.\n * Benchmarks: https://esbench.com/bench/5f6b54a0b4632100a7dcd2b3\n */\n\n/**\n * JSX.Element factory used by Babel's {runtime:\"automatic\"} JSX transform\n * @param {VNode['type']} type\n * @param {VNode['props']} props\n * @param {VNode['key']} [key]\n * @param {unknown} [isStaticChildren]\n * @param {unknown} [__source]\n * @param {unknown} [__self]\n */\nfunction createVNode(type, props, key, isStaticChildren, __source, __self) {\n\tif (!props) props = {};\n\t// We'll want to preserve `ref` in props to get rid of the need for\n\t// forwardRef components in the future, but that should happen via\n\t// a separate PR.\n\tlet normalizedProps = props,\n\t\tref,\n\t\ti;\n\n\tif ('ref' in normalizedProps) {\n\t\tnormalizedProps = {};\n\t\tfor (i in props) {\n\t\t\tif (i == 'ref') {\n\t\t\t\tref = props[i];\n\t\t\t} else {\n\t\t\t\tnormalizedProps[i] = props[i];\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @type {VNode & { __source: any; __self: any }} */\n\tconst vnode = {\n\t\ttype,\n\t\tprops: normalizedProps,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t_component: null,\n\t\tconstructor: undefined,\n\t\t_original: --vnodeId,\n\t\t_index: -1,\n\t\t_flags: 0,\n\t\t__source,\n\t\t__self\n\t};\n\n\t// If a Component VNode, check for and apply defaultProps.\n\t// Note: `type` is often a String, and can be `undefined` in development.\n\tif (typeof type === 'function' && (ref = type.defaultProps)) {\n\t\tfor (i in ref)\n\t\t\tif (normalizedProps[i] === undefined) {\n\t\t\t\tnormalizedProps[i] = ref[i];\n\t\t\t}\n\t}\n\n\tif (options.vnode) options.vnode(vnode);\n\treturn vnode;\n}\n\n/**\n * Create a template vnode. This function is not expected to be\n * used directly, but rather through a precompile JSX transform\n * @param {string[]} templates\n * @param {Array<string | null | VNode>} exprs\n * @returns {VNode}\n */\nfunction jsxTemplate(templates, ...exprs) {\n\tconst vnode = createVNode(Fragment, { tpl: templates, exprs });\n\t// Bypass render to string top level Fragment optimization\n\tvnode.key = vnode._vnode;\n\treturn vnode;\n}\n\nconst JS_TO_CSS = {};\nconst CSS_REGEX = /[A-Z]/g;\n\n/**\n * Unwrap potential signals.\n * @param {*} value\n * @returns {*}\n */\nfunction normalizeAttrValue(value) {\n\treturn value !== null &&\n\t\ttypeof value === 'object' &&\n\t\ttypeof value.valueOf === 'function'\n\t\t? value.valueOf()\n\t\t: value;\n}\n\n/**\n * Serialize an HTML attribute to a string. This function is not\n * expected to be used directly, but rather through a precompile\n * JSX transform\n * @param {string} name The attribute name\n * @param {*} value The attribute value\n * @returns {string}\n */\nfunction jsxAttr(name, value) {\n\tif (options.attr) {\n\t\tconst result = options.attr(name, value);\n\t\tif (typeof result === 'string') return result;\n\t}\n\n\tvalue = normalizeAttrValue(value);\n\n\tif (name === 'ref' || name === 'key') return '';\n\tif (name === 'style' && typeof value === 'object') {\n\t\tlet str = '';\n\t\tfor (let prop in value) {\n\t\t\tlet val = value[prop];\n\t\t\tif (val != null && val !== '') {\n\t\t\t\tconst name =\n\t\t\t\t\tprop[0] == '-'\n\t\t\t\t\t\t? prop\n\t\t\t\t\t\t: JS_TO_CSS[prop] ||\n\t\t\t\t\t\t\t(JS_TO_CSS[prop] = prop.replace(CSS_REGEX, '-$&').toLowerCase());\n\n\t\t\t\tlet suffix = ';';\n\t\t\t\tif (\n\t\t\t\t\ttypeof val === 'number' &&\n\t\t\t\t\t// Exclude custom-attributes\n\t\t\t\t\t!name.startsWith('--') &&\n\t\t\t\t\t!IS_NON_DIMENSIONAL.test(name)\n\t\t\t\t) {\n\t\t\t\t\tsuffix = 'px;';\n\t\t\t\t}\n\t\t\t\tstr = str + name + ':' + val + suffix;\n\t\t\t}\n\t\t}\n\t\treturn name + '=\"' + encodeEntities(str) + '\"';\n\t}\n\n\tif (\n\t\tvalue == null ||\n\t\tvalue === false ||\n\t\ttypeof value === 'function' ||\n\t\ttypeof value === 'object'\n\t) {\n\t\treturn '';\n\t} else if (value === true) return name;\n\n\treturn name + '=\"' + encodeEntities('' + value) + '\"';\n}\n\n/**\n * Escape a dynamic child passed to `jsxTemplate`. This function\n * is not expected to be used directly, but rather through a\n * precompile JSX transform\n * @param {*} value\n * @returns {string | null | VNode | Array<string | null | VNode>}\n */\nfunction jsxEscape(value) {\n\tif (\n\t\tvalue == null ||\n\t\ttypeof value === 'boolean' ||\n\t\ttypeof value === 'function'\n\t) {\n\t\treturn null;\n\t}\n\n\tif (typeof value === 'object') {\n\t\t// Check for VNode\n\t\tif (value.constructor === undefined) return value;\n\n\t\tif (isArray(value)) {\n\t\t\tfor (let i = 0; i < value.length; i++) {\n\t\t\t\tvalue[i] = jsxEscape(value[i]);\n\t\t\t}\n\t\t\treturn value;\n\t\t}\n\t}\n\n\treturn encodeEntities('' + value);\n}\n\nexport {\n\tcreateVNode as jsx,\n\tcreateVNode as jsxs,\n\tcreateVNode as jsxDEV,\n\tFragment,\n\t// precompiled JSX transform\n\tjsxTemplate,\n\tjsxAttr,\n\tjsxEscape\n};\n","import { h } from 'preact'\n\ninterface FabProps {\n label: string\n onClick: () => void\n}\n\nexport function Fab({ label, onClick }: FabProps) {\n return (\n <button type=\"button\" class=\"fab\" aria-label={label} onClick={onClick}>\n 💬\n </button>\n )\n}\n","import { h } from 'preact'\nimport { useState } from 'preact/hooks'\n\nimport type { FeedbackSeverity, FeedbackType } from '../types'\nimport type { StringKey } from './i18n'\n\nexport type FormStatus = 'idle' | 'submitting' | 'error' | 'success'\n\nexport interface FormValues {\n description: string\n feedback_type: FeedbackType\n severity: FeedbackSeverity\n}\n\ninterface FormProps {\n strings: Record<StringKey, string>\n onSubmit: (values: FormValues) => void\n onCancel: () => void\n status: FormStatus\n errorMessage?: string\n}\n\nconst TYPES: FeedbackType[] = ['bug', 'feature', 'question', 'praise', 'typo']\nconst SEVERITIES: FeedbackSeverity[] = ['blocker', 'high', 'medium', 'low']\n\nexport function Form({ strings, onSubmit, onCancel, status, errorMessage }: FormProps) {\n const [description, setDescription] = useState('')\n const [feedbackType, setFeedbackType] = useState<FeedbackType>('bug')\n const [severity, setSeverity] = useState<FeedbackSeverity>('medium')\n const [localError, setLocalError] = useState('')\n\n const submitting = status === 'submitting'\n const submitLabel = submitting ? strings['form.submitting'] : strings['form.submit']\n\n const handleSubmit = (e: Event) => {\n e.preventDefault()\n if (!description.trim()) {\n setLocalError(strings['form.description.placeholder'])\n return\n }\n setLocalError('')\n onSubmit({ description: description.trim(), feedback_type: feedbackType, severity })\n }\n\n return (\n <form onSubmit={handleSubmit}>\n <h2>{strings['form.title']}</h2>\n\n <div class=\"field\">\n <label for=\"mfb-desc\">{strings['form.description.label']}</label>\n <textarea\n id=\"mfb-desc\"\n value={description}\n placeholder={strings['form.description.placeholder']}\n onInput={(e) => setDescription((e.target as HTMLTextAreaElement).value)}\n />\n </div>\n\n <div class=\"row\">\n <div class=\"field\">\n <label for=\"mfb-type\">{strings['form.type.label']}</label>\n <select\n id=\"mfb-type\"\n value={feedbackType}\n onChange={(e) => setFeedbackType((e.target as HTMLSelectElement).value as FeedbackType)}\n >\n {TYPES.map((t) => <option value={t}>{strings[`type.${t}` as StringKey]}</option>)}\n </select>\n </div>\n <div class=\"field\">\n <label for=\"mfb-sev\">{strings['form.severity.label']}</label>\n <select\n id=\"mfb-sev\"\n value={severity}\n onChange={(e) => setSeverity((e.target as HTMLSelectElement).value as FeedbackSeverity)}\n >\n {SEVERITIES.map((s) => <option value={s}>{strings[`severity.${s}` as StringKey]}</option>)}\n </select>\n </div>\n </div>\n\n {localError && <div class=\"error\">{localError}</div>}\n {status === 'error' && errorMessage && <div class=\"error\">{errorMessage}</div>}\n {status === 'success' && <div class=\"success\">{strings['form.success']}</div>}\n\n <div class=\"actions\">\n <button type=\"button\" class=\"btn\" onClick={onCancel} disabled={submitting}>{strings['form.cancel']}</button>\n <button type=\"submit\" class=\"btn btn--primary\" disabled={submitting}>{submitLabel}</button>\n </div>\n </form>\n )\n}\n","import { h, type ComponentChildren } from 'preact'\n\ninterface ModalProps {\n onDismiss: () => void\n children: ComponentChildren\n}\n\nexport function Modal({ onDismiss, children }: ModalProps) {\n return (\n <div\n class=\"backdrop\"\n role=\"presentation\"\n onClick={(e) => { if (e.target === e.currentTarget) onDismiss() }}\n >\n <div class=\"modal\" role=\"dialog\" aria-modal=\"true\">{children}</div>\n </div>\n )\n}\n","export const WIDGET_STYLES = `\n:host {\n --mfb-accent: #3b82f6;\n --mfb-accent-contrast: #ffffff;\n --mfb-bg: #ffffff;\n --mfb-surface: #f9fafb;\n --mfb-text: #0a0a0a;\n --mfb-text-muted: #6b7280;\n --mfb-border: #e5e7eb;\n --mfb-radius: 8px;\n --mfb-font: system-ui, -apple-system, sans-serif;\n --mfb-z-index: 2147483640;\n\n all: initial;\n font-family: var(--mfb-font);\n color: var(--mfb-text);\n position: fixed;\n z-index: var(--mfb-z-index);\n}\n\n@media (prefers-color-scheme: dark) {\n :host {\n --mfb-bg: #111827;\n --mfb-surface: #1f2937;\n --mfb-text: #f9fafb;\n --mfb-text-muted: #9ca3af;\n --mfb-border: #374151;\n }\n}\n\n.fab {\n position: fixed;\n bottom: 24px;\n right: 24px;\n width: 52px;\n height: 52px;\n border-radius: 999px;\n background: var(--mfb-accent);\n color: var(--mfb-accent-contrast);\n border: none;\n cursor: pointer;\n box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);\n font-size: 22px;\n display: grid;\n place-items: center;\n}\n\n.fab:focus-visible { outline: 2px solid var(--mfb-accent); outline-offset: 2px; }\n\n.backdrop {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.45);\n display: grid;\n place-items: center;\n}\n\n.modal {\n background: var(--mfb-bg);\n border-radius: calc(var(--mfb-radius) * 1.5);\n box-shadow: 0 20px 48px rgba(0, 0, 0, 0.25);\n width: min(420px, 92vw);\n padding: 20px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\n.modal h2 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }\n\n.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }\n\n.field label { color: var(--mfb-text-muted); }\n\n.field input, .field select, .field textarea {\n font-family: inherit;\n font-size: 14px;\n color: inherit;\n padding: 8px 10px;\n border: 1px solid var(--mfb-border);\n border-radius: var(--mfb-radius);\n background: var(--mfb-surface);\n}\n\n.field textarea { min-height: 88px; resize: vertical; }\n\n.row { display: flex; gap: 8px; }\n.row > * { flex: 1; }\n\n.actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 8px; }\n\n.btn {\n padding: 8px 14px;\n border-radius: var(--mfb-radius);\n border: 1px solid var(--mfb-border);\n background: var(--mfb-bg);\n color: var(--mfb-text);\n font: inherit;\n cursor: pointer;\n}\n\n.btn--primary {\n background: var(--mfb-accent);\n color: var(--mfb-accent-contrast);\n border-color: var(--mfb-accent);\n}\n\n.btn[disabled] { opacity: 0.6; cursor: not-allowed; }\n\n.error { color: #dc2626; font-size: 13px; }\n.success { color: #059669; font-size: 13px; }\n`\n","import { h, render } from 'preact'\nimport { useCallback, useState } from 'preact/hooks'\n\nimport { Fab } from './Fab'\nimport { Form, type FormValues } from './Form'\nimport { Modal } from './Modal'\nimport { WIDGET_STYLES } from './styles'\nimport type { StringKey } from './i18n'\n\nexport interface MountOptions {\n host: HTMLElement\n strings: Record<StringKey, string>\n showFAB: boolean\n onSubmit: (values: FormValues) => Promise<void>\n}\n\nexport interface MountHandle {\n open(): void\n close(): void\n dispose(): void\n}\n\ntype State = { open: boolean; status: 'idle' | 'submitting' | 'error' | 'success'; error?: string }\n\nexport function mountWidget(options: MountOptions): MountHandle {\n const shadow = options.host.attachShadow({ mode: 'open' })\n const style = document.createElement('style')\n style.textContent = WIDGET_STYLES\n shadow.appendChild(style)\n const mountPoint = document.createElement('div')\n shadow.appendChild(mountPoint)\n\n let currentState: State = { open: false, status: 'idle' }\n\n function rerender(state: State) {\n currentState = state\n render(h(Root, { state }), mountPoint)\n }\n\n function Root({ state }: { state: State }) {\n const handleSubmit = useCallback(async (values: FormValues) => {\n rerender({ open: true, status: 'submitting' })\n try {\n await options.onSubmit(values)\n rerender({ open: true, status: 'success' })\n setTimeout(() => rerender({ open: false, status: 'idle' }), 1200)\n } catch (err) {\n rerender({ open: true, status: 'error', error: err instanceof Error ? err.message : String(err) })\n }\n }, [])\n\n return (\n <>\n {options.showFAB && (\n <Fab\n label={options.strings['fab.label']}\n onClick={() => rerender({ ...currentState, open: true })}\n />\n )}\n {state.open && (\n <Modal onDismiss={() => rerender({ open: false, status: 'idle' })}>\n <Form\n strings={options.strings}\n onSubmit={handleSubmit}\n onCancel={() => rerender({ open: false, status: 'idle' })}\n status={state.status}\n {...(state.error !== undefined && { errorMessage: state.error })}\n />\n </Modal>\n )}\n </>\n )\n }\n\n rerender(currentState)\n\n return {\n open() { rerender({ ...currentState, open: true }) },\n close() { rerender({ ...currentState, open: false, status: 'idle' }) },\n dispose() {\n render(null, mountPoint)\n options.host.innerHTML = ''\n },\n }\n}\n","import { createApiClient } from './api/client'\nimport { installCapture } from './capture'\nimport { takeScreenshot } from './screenshot'\nimport { resolveStrings } from './widget/i18n'\nimport { mountWidget } from './widget/mount'\nimport type { FeedbackApi, FeedbackConfig, ReportPayload, ReportTransformer, UserIdentity } from './types'\n\nexport interface InternalConfig extends FeedbackConfig {\n fetchImpl?: typeof fetch\n}\n\nexport function createFeedback(config: InternalConfig): FeedbackApi & { _registerTransformer(fn: ReportTransformer): void } {\n const env = config.env ?? 'prod'\n const strings = resolveStrings(config.translations ?? {})\n const capture = installCapture({\n ...(config.sanitizeUrl !== undefined && { sanitizeUrl: config.sanitizeUrl }),\n })\n const api = createApiClient({\n apiKey: config.apiKey,\n ...(config.endpoint !== undefined && { endpoint: config.endpoint }),\n ...(config.fetchImpl !== undefined && { fetch: config.fetchImpl }),\n ...(config.beforeSend !== undefined && { beforeSend: config.beforeSend }),\n })\n\n let user: UserIdentity | undefined = config.user\n let metadata: Record<string, unknown> = config.metadata ?? {}\n const transformers: ReportTransformer[] = []\n\n const host = document.createElement('div')\n host.className = 'mhosaic-feedback'\n if (config.attachTo) {\n const attach = typeof config.attachTo === 'string' ? document.querySelector(config.attachTo) : config.attachTo\n attach?.appendChild(host)\n } else {\n document.body.appendChild(host)\n }\n\n async function buildAndSubmit(values: { description: string; feedback_type?: string; severity?: string }) {\n const screenshot = await takeScreenshot(document.body, { mask: ['.mhosaic-feedback', '[data-mfb-mask]'] })\n const payload: ReportPayload = {\n description: values.description,\n feedback_type: (values.feedback_type ?? 'bug') as ReportPayload['feedback_type'],\n severity: (values.severity ?? 'medium') as ReportPayload['severity'],\n env,\n page_url: window.location.href,\n user_agent: navigator.userAgent,\n capture_method: screenshot ? 'html2canvas' : 'none',\n technical_context: capture.snapshot(),\n }\n if (screenshot) payload.screenshot = screenshot\n let finalPayload: ReportPayload = payload\n for (const t of transformers) finalPayload = await t(finalPayload)\n try {\n const result = await api.submitReport(finalPayload)\n config.onSubmitSuccess?.(result)\n capture.clear()\n return result\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err))\n config.onError?.(error)\n throw error\n }\n }\n\n const handle = mountWidget({\n host,\n strings,\n showFAB: config.showFAB ?? true,\n onSubmit: async (values) => { await buildAndSubmit(values) },\n })\n\n return {\n show() { handle.open() },\n hide() { handle.close() },\n open(opts) { handle.open(); void opts },\n async submit(partial) {\n return buildAndSubmit({\n description: partial.description,\n ...(partial.feedback_type !== undefined && { feedback_type: partial.feedback_type }),\n ...(partial.severity !== undefined && { severity: partial.severity }),\n })\n },\n identify(u) { user = u; void user },\n setMetadata(kv) { metadata = { ...metadata, ...kv }; void metadata },\n shutdown() {\n handle.dispose()\n capture.dispose()\n host.remove()\n },\n _registerTransformer(fn: ReportTransformer) { transformers.push(fn) },\n }\n}\n","import { createFeedback } from './core'\nimport type { FeedbackApi, FeedbackConfig } from './types'\n\ntype QueuedCall =\n | ['init', FeedbackConfig]\n | ['identify', NonNullable<FeedbackConfig['user']>]\n | ['setMetadata', Record<string, unknown>]\n | ['open', Parameters<FeedbackApi['open']>[0]]\n\ninterface WindowLike {\n Feedback?: {\n q?: QueuedCall[]\n (name: string, arg?: unknown): void\n }\n}\n\nconst w = window as unknown as WindowLike\n\nfunction resolveConfigFromScriptTag(): FeedbackConfig | null {\n const script = document.currentScript as HTMLScriptElement | null\n if (!script) return null\n const apiKey = script.dataset.key\n if (!apiKey) return null\n const env = script.dataset.env as FeedbackConfig['env'] | undefined\n return {\n apiKey,\n ...(env !== undefined && { env }),\n }\n}\n\nlet api: FeedbackApi | null = null\nconst pending: QueuedCall[] = w.Feedback?.q ?? []\n\nfunction handle(call: QueuedCall) {\n const [name, arg] = call\n if (name === 'init') {\n if (api) return\n api = createFeedback(arg as FeedbackConfig)\n return\n }\n if (!api) {\n pending.push(call)\n return\n }\n if (name === 'identify') api.identify(arg as NonNullable<FeedbackConfig['user']>)\n else if (name === 'setMetadata') api.setMetadata(arg as Record<string, unknown>)\n else if (name === 'open') api.open(arg as Parameters<FeedbackApi['open']>[0])\n}\n\nconst autoConfig = resolveConfigFromScriptTag()\nif (autoConfig) api = createFeedback(autoConfig)\n\nwhile (pending.length > 0) handle(pending.shift()!)\n\nconst FeedbackFn = Object.assign(\n function Feedback(name: string, arg?: unknown) {\n handle([name, arg] as QueuedCall)\n },\n { q: pending },\n)\n\nw.Feedback = FeedbackFn\n"],"mappings":"4X2BoGM,SAAUA,GAAiBC,EAAe,CAC5C,MACI,EAAEA,EAAM,OAAI,IAA8BA,EAAM,QAAU,UACzDA,EAAM,OAAI,IAA2B,CAAC,CAACC,GAA0BD,EAAM,IAAI,EAEpF,K3BvGaE,EAoDAC,GAIAC,GC1DAC,GAqBAC,EA8BPC,GAGAC,GACGC,GCvDHF,GAGAC,GACGC,GAIIC,GAuCAC,GASAC,GCnDAC,GAGAC,GAQAC,GAMAC,GAQAC,GAGAC,GAEAC,GAEAC,GAEAC,GAKAC,GACAC,GAaAC,GAMAC,GAGAC,GAEAC,GAEPC,GAQAC,GAQOC,MCvFPvB,GAGAC,GACGC,GCJIsB,GCMAC,GAGPC,GACAC,GACAC,GACAC,GACAC,GAEAC,GACAC,GACAC,GACAC,GACAC,GAEAC,GACAC,GACAC,GACAC,GACAC,GAEAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GAEAC,GACAC,EACAC,GACAC,GACAC,GAEAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GAEAC,GAgDOC,GACAC,EACAC,GACAC,GAEPC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GAEOC,GAyEPC,GAsDAC,GAeAC,GA4RAC,GAoCNC,GAgCaC,GCzfAC,GACAC,GACAC,GACAC,GAEPC,GACAC,GACAC,GACAC,GACAnB,GACAoB,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,EACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GAEAC,EACAC,GACAC,GAEAC,GACAC,GACAC,GACAC,GACAC,GAEAC,GAEAC,GAEAC,GAQAC,GAOAC,GAWAC,GAgBAC,GAsDAC,GAGAC,GAGAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GAGAC,GAGAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GAGAC,GAGAC,GACOC,GAEAC,GC1RAC,GAmHAC,GACAC,EACAC,EACAC,GACAC,GAGAC,GACAC,EAGAC,GAwBPC,GC7KOC,GCCAC,EAMAC,GAQAC,GAuEAC,GAEAC,EAMAC,GAMAC,GAMAC,GAQAC,EChHPC,GACAC,GACAC,GACAC,GAEOC,GAoBAC,GASAC,GA4CAC,GC5EAC,GAEAC,EAQAC,GAGAC,GAaAC,GAGAC,EAIAC,EAQAC,GASAC,GAUAC,GAKAC,GAeAC,GAeAC,GAeAC,GAeAC,GAUAC,GASAC,GAUAC,GAoBAC,GAyBAC,GAeAC,GAUAC,GAmBPC,GAoBAC,GAeAC,GAwBAC,GAqBOC,GA0BAC,GAcAC,GAYAC,GAYAC,GAYAC,GAWA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AG,EAAG,EAAG,EAAG,EAAG,EAAG,CACnD,EACD,OAAQ,CACJ,eACA,eACA,eACA,eACA,eACA,eACA,eACA,eACA,eACA,eACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,eACA,eACA,eACA,eACA,eACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,QACH,GAGCC,GAA2B,CAC7B,SAAU,CACN,IAAO,IAAM,IAAM,IAAM,IAAM,IAAM,IAAM,IAAM,IAAM,IAAM,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,IAAK,GAC1G,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,CAC3D,EACD,OAAQ,CACJ,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,SACA,QACH,GAGCC,GAAwB,CAC1B9f,EACAgvB,EACAD,EACAmL,EACAC,EACAC,IAEIp6B,EAAQgvB,GAAOhvB,EAAQ+uB,EAChBpO,GAAkB3gB,EAAOm6B,EAAUC,EAAO,OAAS,CAAC,EAI3DF,EAAQ,SAAS,OAAO,CAACG,EAAQC,EAASxS,IAAS,CAC/C,KAAO9nB,GAASs6B,GACZt6B,GAASs6B,EACTD,GAAUH,EAAQ,OAAOpS,CAAK,EAElC,OAAOuS,CACX,EAAG,EAAE,EAAID,EAIXra,GAAuC,CACzC/f,EACAu6B,EACAC,EACAC,IACQ,CACR,IAAIJ,EAAS,GAEb,GACSG,GACDx6B,IAEJq6B,EAASI,EAASz6B,CAAK,EAAIq6B,EAC3Br6B,GAASu6B,QACJv6B,EAAQu6B,GAAwBA,GAEzC,OAAOF,CACX,EAEMra,EAA8B,CAChChgB,EACA06B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,GAAI,KAAKO,CAAyC,CAC9E,CAEA,IAAME,GAAab,GAA2B,EAC1Ca,KAAYT,GAAMQ,GAAeC,EAAU,GAE/C,KAAON,GAAQ,OAAS,GAAGC,GAAOD,GAAQ,MAAM,CAAE,EAElD,IAAMO,GAAa,OAAO,OACxB,SAAkBJ,EAAcC,EAAe,CAC7CH,GAAO,CAACE,EAAMC,CAAG,CAAe,CAClC,EACA,CAAE,EAAGJ,EAAQ,CACf,EAEAR,GAAE,SAAWe","names":["isSupportedImage","value","SUPPORTED_IMAGE_FUNCTIONS","Bounds","parseBounds","parseDocumentSize","toCodePoints","fromCodePoint","chars","lookup","i","decode","polyUint16Array","polyUint32Array","UTRIE2_SHIFT_2","UTRIE2_SHIFT_1","UTRIE2_INDEX_SHIFT","UTRIE2_SHIFT_1_2","UTRIE2_LSCP_INDEX_2_OFFSET","UTRIE2_DATA_BLOCK_LENGTH","UTRIE2_DATA_MASK","UTRIE2_LSCP_INDEX_2_LENGTH","UTRIE2_INDEX_2_BMP_LENGTH","UTRIE2_UTF8_2B_INDEX_2_OFFSET","UTRIE2_UTF8_2B_INDEX_2_LENGTH","UTRIE2_INDEX_1_OFFSET","UTRIE2_OMITTED_BMP_INDEX_1_LENGTH","UTRIE2_INDEX_2_BLOCK_LENGTH","UTRIE2_INDEX_2_MASK","slice16","slice32","createTrieFromBase64","base64","LETTER_NUMBER_MODIFIER","BK","CR","LF","CM","NL","WJ","ZW","GL","SP","ZWJ","B2","BA","BB","HY","CB","CL","CP","EX","IN","NS","OP","QU","IS","NU","PO","PR","SY","AI","AL","CJ","EB","EM","H2","H3","HL","ID","JL","JV","JT","RI","SA","XX","ea_OP","BREAK_MANDATORY","BREAK_NOT_ALLOWED","BREAK_ALLOWED","UnicodeTrie","ALPHABETICS","HARD_LINE_BREAKS","SPACE","PREFIX_POSTFIX","LINE_BREAKS","KOREAN_SYLLABLE_BLOCK","HYPHEN","codePointsToCharacterClasses","isAdjacentWithSpaceIgnored","previousNonSpaceClassType","_lineBreakAtIndex","cssFormattedClasses","Break","LineBreaker","FLAG_UNRESTRICTED","FLAG_ID","FLAG_INTEGER","FLAG_NUMBER","LINE_FEED","SOLIDUS","REVERSE_SOLIDUS","CHARACTER_TABULATION","QUOTATION_MARK","EQUALS_SIGN","NUMBER_SIGN","DOLLAR_SIGN","PERCENTAGE_SIGN","APOSTROPHE","LEFT_PARENTHESIS","RIGHT_PARENTHESIS","LOW_LINE","HYPHEN_MINUS","EXCLAMATION_MARK","LESS_THAN_SIGN","GREATER_THAN_SIGN","COMMERCIAL_AT","LEFT_SQUARE_BRACKET","RIGHT_SQUARE_BRACKET","CIRCUMFLEX_ACCENT","LEFT_CURLY_BRACKET","QUESTION_MARK","RIGHT_CURLY_BRACKET","VERTICAL_LINE","TILDE","CONTROL","REPLACEMENT_CHARACTER","ASTERISK","PLUS_SIGN","COMMA","COLON","SEMICOLON","FULL_STOP","NULL","BACKSPACE","LINE_TABULATION","SHIFT_OUT","INFORMATION_SEPARATOR_ONE","DELETE","EOF","ZERO","a","e","f","u","z","A","E","F","U","Z","isDigit","isSurrogateCodePoint","isHex","isLowerCaseLetter","isUpperCaseLetter","isLetter","isNonASCIICodePoint","isWhiteSpace","isNameStartCodePoint","isNameCodePoint","isNonPrintableCodePoint","isValidEscape","isIdentifierStart","isNumberStart","stringToNumber","LEFT_PARENTHESIS_TOKEN","RIGHT_PARENTHESIS_TOKEN","COMMA_TOKEN","SUFFIX_MATCH_TOKEN","PREFIX_MATCH_TOKEN","COLUMN_TOKEN","DASH_MATCH_TOKEN","INCLUDE_MATCH_TOKEN","LEFT_CURLY_BRACKET_TOKEN","RIGHT_CURLY_BRACKET_TOKEN","SUBSTRING_MATCH_TOKEN","BAD_URL_TOKEN","BAD_STRING_TOKEN","CDO_TOKEN","CDC_TOKEN","COLON_TOKEN","SEMICOLON_TOKEN","LEFT_SQUARE_BRACKET_TOKEN","RIGHT_SQUARE_BRACKET_TOKEN","WHITESPACE_TOKEN","EOF_TOKEN","Tokenizer","Parser","isDimensionToken","isNumberToken","isIdentToken","isStringToken","isIdentWithValue","nonWhiteSpace","nonFunctionArgSeparator","parseFunctionArgs","isEndingTokenFor","isLength","isLengthPercentage","isCalcFunction","evaluateCalcToLengthPercentage","parseLengthPercentageTuple","ZERO_LENGTH","FIFTY_PERCENT","HUNDRED_PERCENT","getAbsoluteValueForTuple","getAbsoluteValue","DEG","GRAD","RAD","TURN","angle","isAngle","parseNamedSide","deg","isTransparent","asString","pack","getTokenColorValue","isRelativeTransform","clamp","multiplyMatrices","packSrgb","packSrgbLinear","packXYZ","packLab","packOkLab","packOkLch","packLch","extractHslComponents","packHSL","extractLchComponents","extractLabComponents","extractOkLchComponents","d65toD50","d50toD65","hue2rgb","hsl2rgb","lch2lab","oklab2xyz","lab2xyz","rgbToXyz","hslToXyz","labToXyz","lchToXyz","oklchToXyz","oklabToXyz","xyz50ToXYZ","xyzFromXYZ","xyz50FromXYZ","convertXyz","convertXyz50","xyz2rgbLinear","rgbLinear2xyz","srgbLinear2rgb","rgb2rgbLinear","srgbFromXYZ","srgbLinearFromXYZ","p3LinearToXyz","xyzToP3Linear","p32p3Linear","p3Linear2p3","p3ToXYZ","p3FromXYZ","convertP3","xyz2a98Linear","a98Linear2xyz","a982a98Linear","a98Linear2a98","a98FromXYZ","convertA98rgb","proPhotoLinearToXyz","xyzToProPhotoLinear","proPhotoToProPhotoLinear","proPhotoLinearToProPhoto","proPhotoToXYZ","proPhotoFromXYZ","convertProPhoto","_a","_b","rec20202rec2020Linear","rec2020Linear2rec2020","rec2020LinearToXyz","xyzToRec2020Linear","rec2020ToXYZ","rec2020FromXYZ","convertRec2020","color","hash2rgb","rgb","_color","SUPPORTED_COLOR_SPACES_ABSOLUTE","SUPPORTED_COLOR_SPACES_TO_XYZ","SUPPORTED_COLOR_SPACES_FROM_XYZ","SUPPORTED_COLOR_FUNCTIONS","parseColor","COLORS","backgroundClip","backgroundColor","parseColorStop","processColorStops","getAngleFromCorner","calculateGradientDirection","distance","findCorner","calculateRadius","linearGradient","prefixLinearGradient","webkitGradient","CLOSEST_SIDE","FARTHEST_SIDE","CLOSEST_CORNER","FARTHEST_CORNER","CIRCLE","ELLIPSE","COVER","CONTAIN","radialGradient","prefixRadialGradient","isLinearGradient","isRadialGradient","image","backgroundImage","backgroundOrigin","backgroundPosition","backgroundRepeat","parseBackgroundRepeat","BACKGROUND_SIZE","backgroundSize","isBackgroundSizeInfoToken","borderColorForSide","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderRadiusForSide","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","borderStyleForSide","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderWidthForSide","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","direction","display","parseDisplayValue","float","letterSpacing","LINE_BREAK","lineBreak","lineHeight","computeLineHeight","listStyleImage","listStylePosition","listStyleType","marginForSide","marginTop","marginRight","marginBottom","marginLeft","overflow","overflowWrap","paddingForSide","paddingTop","paddingRight","paddingBottom","paddingLeft","textAlign","position","textShadow","textTransform","transform","matrix","matrix3d","rotate","SUPPORTED_TRANSFORM_FUNCTIONS","DEFAULT_VALUE","DEFAULT","transformOrigin","visibility","WORD_BREAK","wordBreak","zIndex","time","opacity","textDecorationColor","textDecorationLine","textDecorationStyle","textDecorationThickness","textUnderlineOffset","fontFamily","fontSize","fontWeight","fontVariant","fontStyle","contains","content","counterIncrement","counterReset","duration","quotes","getQuote","boxShadow","paintOrder","webkitTextStrokeColor","webkitTextStrokeWidth","webkitLineClamp","objectFit","textOverflow","CSSParsedDeclaration","CSSParsedPseudoDeclaration","CSSParsedCounterDeclaration","parse","elementDebuggerAttribute","getElementDebugType","isDebugging","ElementContainer","Prepend","Control","Extend","SpacingMark","L","V","T","LV","LVT","Extended_Pictographic","codePointToClass","_graphemeBreakAtIndex","GraphemeBreaker","splitGraphemes","testRangeBounds","testIOSLineBreak","testCORS","testResponseType","testSVG","isGreenPixel","testForeignObject","createForeignObjectSVG","loadSerializedSVG","FEATURES","TextBounds","parseTextBounds","getWrapperBounds","createRange","segmentGraphemes","segmentWords","breakText","wordSeparators","breakWords","TextContainer","CAPITALIZE","capitalize","ImageElementContainer","CanvasElementContainer","SVGElementContainer","LIElementContainer","OLElementContainer","CHECKBOX_BORDER_RADIUS","RADIO_BORDER_RADIUS","reformatInputBounds","getInputValue","isPlaceholder","CHECKBOX","RADIO","PASSWORD","INPUT_COLOR","PLACEHOLDER_COLOR","InputElementContainer","SelectElementContainer","TextareaElementContainer","IFrameElementContainer","LIST_OWNERS","parseNodeTree","createContainer","parseTree","createsRealStackingContext","createsStackingContext","isTextNode","isElementNode","isHTMLElementNode","isSVGElementNode","isLIElement","isOLElement","isInputElement","isHTMLElement","isSVGElement","isBodyElement","isCanvasElement","isVideoElement","isImageElement","isIFrameElement","isStyleElement","isScriptElement","isTextareaElement","isSelectElement","isSlotElement","isCustomElement","CounterState","ROMAN_UPPER","ARMENIAN","HEBREW","GEORGIAN","createAdditiveCounter","createCounterStyleWithSymbolResolver","createCounterStyleFromRange","createCounterStyleFromSymbols","CJK_ZEROS","CJK_TEN_COEFFICIENTS","CJK_TEN_HIGH_COEFFICIENTS","CJK_HUNDRED_COEFFICIENTS","createCJKCounter","CHINESE_INFORMAL_MULTIPLIERS","CHINESE_FORMAL_MULTIPLIERS","JAPANESE_NEGATIVE","KOREAN_NEGATIVE","createCounterText","IGNORE_ATTRIBUTE","findParentShadowRoot","DocumentCloner","PseudoElementType","createIFrameContainer","imageReady","imagesReady","iframeLoader","ignoredStyleProperties","copyCSSStyles","serializeDoctype","restoreOwnerScroll","restoreNodeScroll","PSEUDO_BEFORE","PSEUDO_AFTER","PSEUDO_HIDE_ELEMENT_CLASS_BEFORE","PSEUDO_HIDE_ELEMENT_CLASS_AFTER","PSEUDO_HIDE_ELEMENT_STYLE","createPseudoHideStyles","createStyles","addBase","CacheStorage","Cache","INLINE_SVG","INLINE_BASE64","INLINE_IMG","isRenderable","isInlineImage","isInlineBase64Image","isBlobImage","isSVG","Vector","lerp","BezierCurve","isBezierCurve","BoundCurves","CORNER","getCurvePoints","calculateBorderBoxPath","calculateContentBoxPath","calculatePaddingBoxPath","TransformEffect","ClipEffect","OpacityEffect","isTransformEffect","isClipEffect","isOpacityEffect","equalPath","transformPath","StackingContext","ElementPaint","parseStackTree","processListItems","parseStackingContexts","parsePathForBorder","parsePathForBorderDoubleOuter","parsePathForBorderDoubleInner","parsePathForBorderStroke","createStrokePathFromCurves","createPathFromCurves","paddingBox","contentBox","calculateBackgroundPositioningArea","calculateBackgroundPaintingArea","calculateBackgroundRendering","isAuto","hasIntrinsicValue","calculateBackgroundSize","getBackgroundValueForIndex","calculateBackgroundRepeatPath","SMALL_IMAGE","SAMPLE_TEXT","FontMetrics","Renderer","MASK_OFFSET","CanvasRenderer","isTextInputElement","calculateBackgroundCurvedPaintingArea","canvasTextAlign","iOSBrokenFonts","fixIOSSystemFonts","ForeignObjectRenderer","Logger","Context","cspNonce","setCspNonce","html2canvas","renderElement","parseBackgroundColor","_Bounds","left","top","width","height","x","y","w","h","context","clientRect","domRectList","rects","domRect","rect","node","document","body","documentElement","str","codePoints","length","extra","_i","codeUnits","index","result","codePoint","bufferLength","len","p","encoded1","encoded2","encoded3","encoded4","buffer","bytes","view","start","end","_byteLength","view32","view16","headerLength","data","Trie","initialValue","errorValue","highStart","highValueIndex","ix","types","indices","categories","classType","prev","b","currentIndex","classTypes","current","next","n","type","indicies","forbiddenBreaks","beforeIndex","afterIndex","before","prevIndex","count","options","isLetterNumber","forbiddenBreakpoints","letterNumber","lastEnd","nextIndex","c1","c2","c3","c","sign","integers","int","fraction","fracd","frac","expsign","exponent","exp","chunk","tokens","token","flags","e1","e2","e3","a1","a2","a3","u1","u2","delta","digits","questionMarks","digit","endDigits","stringToken","amount","endingCodePoint","repr","number","unit","hex","hexCodePoint","_Parser","tokenizer","values","block","functionToken","cssFunction","args","arg","calcToken","contextValue","buildExpression","expression","nested","op","tuple","parent","_context","ident","alpha","blue","green","red","r","g","max","min","B","srgb_linear","l","hue","saturation","lightness","s","xyz","t1","t2","lab","LMSg","LMS","val","fy","fx","fz","k","rgb_linear","abs","p3l","p3","p3_linear","a98","mapped","prophoto_linear","rec","rec2020_linear","colorFunction","namedColor","token_1_value","color_space","colorSpaceFunction","extractComponent","posFromVal","parseCalc","parts","part","from_colorspace","to_colorspace","from","_c","fromColorToXyz","toColorFromXyz","toColorPack","from_color","from_final_colorspace","colorType","stop","stops","lineLength","first","last","processStops","previous","absoluteValue","gapBegin","gapLength","beforeGap","gapValue","corner","centerX","centerY","radian","halfWidth","halfHeight","halfLineLength","yDiff","xDiff","closest","stat","cx","cy","d","gradient","rx","ry","firstToken","angleType","colorStop","shape","size","isColorStop","isAtPosition","acc","background","imageFunction","v","side","style","bit","shadow","transformFunction","b1","b2","a4","b4","radians","cos","sin","origins","line","accumulator","results","increments","filtered","counter","increment","resets","reset","open","close","depth","quote","layers","declaration","overflowTuple","descriptor","parser","element","elementType","_codePoints","countRI","graphemeBreak","breaker","graphemes","bk","range","testElement","rangeBounds","rangeHeight","textList","offset","supports","text","boundAhead","img","canvas","ctx","greenImageSrc","svg","xmlns","foreignObject","resolve","reject","bounds","styles","textBounds","clientRects","subSegments","subOffset","subSegment","replacementNode","ownerDocument","wrapper","parentNode","segmenter","segment","words","word","m","p1","p2","input","option","iframe","documentBackgroundColor","bodyBackgroundColor","root","childNode","nextNode","container","name","counters","canReset","entry","counterNames","symbols","fallback","suffix","string","integer","codePointRangeLength","isNumeric","resolver","codePointRangeStart","codePointRangeEnd","numbers","multipliers","negativeSign","tmp","coefficient","appendSuffix","defaultSuffix","cjkSuffix","koreanSuffix","spaceSuffix","shadowRoot","windowSize","scrollX","scrollY","cloneWindow","documentClone","iframeLoad","onclone","referenceElement","baseUri","policy","rawHTML","trustedHTML","adoptedNode","clone","sheet","css","rule","cloned","clonedCanvas","clonedCtx","gl","attribs","video","blankCanvas","child","copyStyles","target","assignedNodes","slot","targetShadowRoot","slotElement","window","styleBefore","styleAfter","after","pseudoElt","anonymousReplacedElement","attr","counterStyle","counterState","counterType","delim","counterStates","separator","newClassName","customContainer","cloneIframeContainer","interval","property","doctype","targetELement","baseNode","headEle","_CacheStorage","url","link","src","_options","key","isSameOrigin","useCORS","useProxy","proxy","responseType","xhr","reader","queryString","timeout","_Vector","deltaX","deltaY","t","_BezierCurve","startControl","endControl","firstHalf","ab","bc","cd","abbc","bccd","dest","path","tlh","tlv","trh","trv","brh","brv","blh","blv","factors","maxFactor","topWidth","rightHeight","bottomWidth","leftHeight","r1","r2","kappa","ox","oy","xm","ym","curves","offsetX","offsetY","effect","deltaW","deltaH","point","origin","rad","rotateMatrix","borderBox","inFlow","effects","croplessEffects","stackingContext","realStackingContext","listItems","treatAsRealStackingContext","paintContainer","listOwnerItems","parentStack","stack","order","owner","elements","numbering","reversed","item","borderSide","outer1","outer2","inner1","inner2","intrinsicSize","backgroundPositioningArea","backgroundPaintingArea","backgroundImageSize","sizeWidth","sizeHeight","intrinsicWidth","intrinsicHeight","intrinsicProportion","second","hasIntrinsicProportion","hasIntrinsicWidth","hasIntrinsicHeight","hasIntrinsicDimensions","repeat","span","baseline","middle","_CanvasRenderer","paint","letter","textBound","paintOrderLayers","paintOrderLayer","thickness","underlineOffset","decorationStyle","gap","amplitude","wavelength","currentX","nextX","nextX2","maxWidth","ellipsisWidth","truncated","letters","letterWidth","variant","containerBounds","font","lines","currentLine","currentLineTop","tb","maxLines","lastLine","lastLineText","firstBound","availableWidth","truncatedText","shouldApplyEllipsis","needsEllipsis","firstTop","fullText","fullTextWidth","textShadows","box","sx","sy","sw","sh","dx","dy","dw","dh","boxRatio","imgRatio","containW","noneW","verticalOffset","fontSizeValue","paths","pattern","imageWidth","imageHeight","x0","x1","y0","y1","midX","midY","invF","curvePoints","outerPaths","innerPaths","hasBackground","borders","borderBoxArea","maskOffset","shadowPaintingArea","border","strokePaths","boxPaths","startX","startY","endX","endY","dashLength","spaceLength","useLineDash","multiplier","numberOfDashes","minSpace","maxSpace","path1","path2","clip","fontFamilies","id","enabled","_Context","windowBounds","nonce","opts","defaultView","resourceOptions","contextOptions","_d","windowOptions","_e","_f","_g","_h","foreignObjectRendering","cloneOptions","_j","documentCloner","clonedElement","renderOptions","_l","_k","_m","_n","_o","_p","_q","backgroundColorOverride","defaultBackgroundColor","SCALAR_FIELDS","createApiClient","options","_a","_b","endpoint","fetcher","submitReport","input","payload","form","field","response","text","SENSITIVE","sanitizeUrl","url","isAbsolute","isRootRelative","base","u","clean","value","name","e","collectDevice","_a","nav","connection","deviceMemory","referrer","safeStringify","arg","_k","v","e","installConsolePatch","buffer","levels","originals","level","original","args","message","entry","stack","fn","installFetchPatch","buffer","sanitize","original","input","init","start","url","method","response","err","installXhrPatch","Original","originalOpen","originalSend","body","ctx","e","installErrorHandlers","buffer","onError","e","stack","onRejection","reason","message","createPerformanceCollector","slowResourceMs","longTasks","slowResources","observer","list","entry","e","nav","navigation","RingBuffer","max","__publicField","item","installCapture","options","_a","maxConsole","maxNetwork","maxErrors","sanitize","sanitizeUrl","consoleBuf","RingBuffer","networkBuf","errorBuf","uninstallConsole","installConsolePatch","uninstallFetch","installFetchPatch","uninstallXhr","installXhrPatch","uninstallErrors","installErrorHandlers","perf","createPerformanceCollector","collectDevice","isMaskedElement","el","prepareMaskMatcher","selectors","joined","takeScreenshot","target","options","_a","html2canvas","matcher","canvas","resolve","e","DEFAULT_STRINGS","resolveStrings","overrides","slice","options","vnodeId","isValidElement","rerenderQueue","prevDebounce","defer","depthSort","_id","EVENT_DISPATCHED","EVENT_ATTACHED","CAPTURE_REGEX","eventClock","eventProxy","eventProxyCapture","i","EMPTY_OBJ","EMPTY_ARR","IS_NON_DIMENSIONAL","isArray","Array","assign","obj","props","removeNode","node","parentNode","removeChild","createElement","type","children","key","ref","normalizedProps","arguments","length","call","defaultProps","createVNode","original","vnode","__k","__","__b","__e","__c","constructor","__v","__i","__u","Fragment","props","children","BaseComponent","context","this","getDomSibling","vnode","childIndex","__","__i","sibling","__k","length","__e","type","renderComponent","component","__P","__d","oldVNode","__v","oldDom","commitQueue","refQueue","newVNode","assign","options","diff","__n","namespaceURI","__u","commitRoot","updateParentDomPointers","__c","base","some","child","enqueueRender","c","rerenderQueue","push","process","__r","prevDebounce","debounceRendering","defer","l","sort","depthSort","shift","diffChildren","parentDom","renderResult","newParentVNode","oldParentVNode","globalContext","namespace","excessDomChildren","isHydrating","i","childVNode","newDom","firstChildDom","result","shouldPlace","oldChildren","EMPTY_ARR","newChildrenLength","constructNewChildrenArray","EMPTY_OBJ","ref","applyRef","insert","nextSibling","skewedIndex","matchingIndex","oldChildrenLength","remainingOldChildren","skew","Array","constructor","String","createVNode","isArray","__b","key","findMatchingIndex","unmount","parentVNode","parentNode","insertBefore","nodeType","findMatchingIndex","childVNode","oldChildren","skewedIndex","remainingOldChildren","x","y","childIndex","key","type","oldVNode","matched","__u","length","setStyle","style","value","setProperty","IS_NON_DIMENSIONAL","test","dom","name","oldValue","namespace","useCapture","lowerCaseName","o","cssText","replace","CAPTURE_REGEX","toLowerCase","slice","l","EVENT_ATTACHED","eventClock","addEventListener","eventProxyCapture","eventProxy","removeEventListener","e","removeAttribute","setAttribute","createEventProxy","this","eventHandler","EVENT_DISPATCHED","options","event","diff","parentDom","newVNode","globalContext","excessDomChildren","commitQueue","oldDom","isHydrating","refQueue","tmp","c","isNew","oldProps","oldState","snapshot","clearProcessingException","newProps","isClassComponent","provider","componentContext","renderHook","count","renderResult","i","newType","constructor","__e","__b","outer","props","prototype","render","contextType","__c","__","__E","BaseComponent","doRender","sub","state","__n","__d","__h","_sb","__s","getDerivedStateFromProps","assign","__v","componentWillMount","componentDidMount","push","componentWillReceiveProps","shouldComponentUpdate","__k","some","vnode","EMPTY_ARR","apply","componentWillUpdate","componentDidUpdate","context","__P","__r","getChildContext","getSnapshotBeforeUpdate","Fragment","cloneNode","children","diffChildren","isArray","base","then","MODE_HYDRATE","nodeType","nextSibling","indexOf","removeNode","markAsForce","diffElementNodes","diffed","commitRoot","root","applyRef","cb","call","node","map","newHtml","oldHtml","newChildren","inputValue","checked","EMPTY_OBJ","localName","document","createTextNode","createElementNS","is","__m","data","childNodes","attributes","__html","innerHTML","content","getDomSibling","undefined","ref","hasRefUnmount","current","unmount","parentVNode","skipRemove","r","componentWillUnmount","replaceNode","documentElement","createElement","namespaceURI","firstChild","slice","EMPTY_ARR","options","__e","error","vnode","oldVNode","errorInfo","component","ctor","handled","__","__c","constructor","getDerivedStateFromError","setState","__d","componentDidCatch","__E","e","vnodeId","isValidElement","BaseComponent","prototype","update","callback","s","this","__s","state","assign","props","__v","_sb","push","enqueueRender","forceUpdate","__h","render","Fragment","rerenderQueue","defer","Promise","then","bind","resolve","setTimeout","depthSort","a","b","__b","process","__r","_id","Math","random","toString","EVENT_DISPATCHED","EVENT_ATTACHED","CAPTURE_REGEX","eventClock","eventProxy","createEventProxy","eventProxyCapture","i","currentIndex","currentComponent","previousComponent","prevRaf","currentHook","afterPaintEffects","options","_options","oldBeforeDiff","__b","oldBeforeRender","__r","oldAfterDiff","diffed","oldCommit","__c","oldBeforeUnmount","unmount","oldRoot","__","getHookState","index","type","__h","hooks","__H","length","push","useState","initialState","useReducer","invokeOrReturn","reducer","init","hookState","_reducer","action","currentValue","__N","nextValue","setState","__f","updateHookState","p","s","c","stateHooks","filter","x","every","prevScu","call","this","shouldUpdate","props","some","hookItem","shouldComponentUpdate","prevCWU","componentWillUpdate","__e","tmp","useMemo","factory","args","state","getHookState","currentIndex","argsChanged","__H","__","__h","useCallback","callback","currentHook","flushAfterPaintEffects","component","afterPaintEffects","shift","hooks","__H","__P","__h","some","invokeCleanup","invokeEffect","e","options","__e","__v","__b","vnode","currentComponent","oldBeforeDiff","__","parentDom","__k","__m","oldRoot","__r","oldBeforeRender","currentIndex","__c","previousComponent","hookItem","__N","_pendingArgs","diffed","oldAfterDiff","c","length","push","prevRaf","requestAnimationFrame","afterNextFrame","commitQueue","filter","cb","oldCommit","unmount","oldBeforeUnmount","hasErrored","s","HAS_RAF","callback","raf","done","clearTimeout","timeout","cancelAnimationFrame","setTimeout","hook","comp","cleanup","argsChanged","oldArgs","newArgs","arg","index","invokeOrReturn","f","vnodeId","createVNode","type","props","key","isStaticChildren","__source","__self","ref","i","normalizedProps","vnode","__k","__","__b","__e","__c","constructor","__v","vnodeId","__i","__u","defaultProps","options","Fab","label","onClick","u","TYPES","SEVERITIES","Form","strings","onSubmit","onCancel","status","errorMessage","description","setDescription","d","feedbackType","setFeedbackType","severity","setSeverity","localError","setLocalError","submitting","submitLabel","u","e","t","s","Modal","onDismiss","children","u","WIDGET_STYLES","mountWidget","options","shadow","style","WIDGET_STYLES","mountPoint","currentState","rerender","state","R","k","Root","handleSubmit","q","values","err","u","S","Fab","Modal","Form","createFeedback","config","_a","_b","_c","_d","env","strings","resolveStrings","capture","installCapture","api","createApiClient","user","metadata","transformers","host","attach","buildAndSubmit","values","screenshot","takeScreenshot","payload","finalPayload","t","result","err","error","handle","mountWidget","opts","partial","u","kv","fn","w","resolveConfigFromScriptTag","script","apiKey","env","api","_a","_b","pending","handle","call","name","arg","createFeedback","autoConfig","FeedbackFn"]}
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/layout/bounds.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/node_modules/src/Util.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/node_modules/css-line-break/node_modules/src/Util.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/node_modules/css-line-break/node_modules/src/Trie.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/node_modules/css-line-break/node_modules/utrie/node_modules/src/index.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/node_modules/src/linebreak-trie.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/node_modules/src/LineBreak.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/syntax/tokenizer.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/syntax/parser.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/length.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/length-percentage.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/angle.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/color-utilities.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/color-spaces/srgb.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/color-spaces/p3.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/color-spaces/a98.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/color-spaces/pro-photo.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/color-spaces/rec2020.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/color.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/background-clip.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/background-color.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/functions/gradient.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/functions/linear-gradient.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/functions/-prefix-linear-gradient.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/functions/-webkit-gradient.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/functions/radial-gradient.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/functions/-prefix-radial-gradient.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/image.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/background-image.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/background-origin.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/background-position.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/background-repeat.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/background-size.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/border-color.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/border-radius.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/border-style.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/border-width.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/color.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/direction.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/display.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/float.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/letter-spacing.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/line-break.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/line-height.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/list-style-image.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/list-style-position.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/list-style-type.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/margin.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/overflow.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/overflow-wrap.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/padding.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/text-align.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/position.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/text-shadow.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/text-transform.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/transform.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/transform-origin.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/rotate.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/visibility.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/word-break.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/z-index.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/time.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/opacity.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/text-decoration-color.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/text-decoration-line.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/text-decoration-style.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/text-decoration-thickness.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/text-underline-offset.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/font-family.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/font-size.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/font-weight.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/font-variant.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/font-style.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/core/bitwise.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/content.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/counter-increment.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/counter-reset.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/duration.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/quotes.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/box-shadow.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/paint-order.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/webkit-text-stroke-color.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/webkit-text-stroke-width.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/webkit-line-clamp.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/object-fit.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/property-descriptors/text-overflow.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/index.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/core/debugger.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/element-container.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/node_modules/src/grapheme-break-trie.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/node_modules/text-segmentation/node_modules/src/Util.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/node_modules/text-segmentation/node_modules/src/Trie.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/node_modules/text-segmentation/node_modules/utrie/node_modules/src/index.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/node_modules/src/GraphemeBreak.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/core/features.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/layout/text.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/text-container.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/replaced-elements/image-element-container.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/replaced-elements/canvas-element-container.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/replaced-elements/svg-element-container.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/elements/li-element-container.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/elements/ol-element-container.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/replaced-elements/input-element-container.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/elements/select-element-container.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/elements/textarea-element-container.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/replaced-elements/iframe-element-container.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/node-parser.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/css/types/functions/counter.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/dom/document-cloner.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/core/cache-storage.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/vector.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/bezier-curve.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/bound-curves.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/effects.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/path.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/stacking-context.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/border.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/box-sizing.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/background.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/core/util.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/font-metrics.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/renderer.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/canvas/canvas-renderer.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/render/canvas/foreignobject-renderer.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/core/logger.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/core/context.ts","../../../node_modules/.pnpm/html2canvas-pro@1.6.7/node_modules/html2canvas-pro/src/index.ts","../src/api/client.ts","../src/capture/urlSanitizer.ts","../src/capture/device.ts","../src/capture/console.ts","../src/capture/network.ts","../src/capture/errors.ts","../src/capture/performance.ts","../src/capture/ringBuffer.ts","../src/capture/index.ts","../src/screenshot/index.ts","../src/widget/i18n.ts","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/constants.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/util.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/options.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/create-element.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/component.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/diff/props.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/create-context.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/diff/children.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/diff/index.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/render.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/clone-element.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/diff/catch-error.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/hooks/src/index.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/jsx-runtime/src/utils.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/src/constants.js","../../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/jsx-runtime/src/index.js","../src/widget/Fab.tsx","../src/widget/Form.tsx","../src/widget/Modal.tsx","../src/widget/styles.ts","../src/widget/mount.tsx","../src/core.ts","../src/embed.ts"],"sourcesContent":["import { Context } from '../../core/context';\n\nexport class Bounds {\n constructor(\n readonly left: number,\n readonly top: number,\n readonly width: number,\n readonly height: number\n ) {}\n\n add(x: number, y: number, w: number, h: number): Bounds {\n return new Bounds(this.left + x, this.top + y, this.width + w, this.height + h);\n }\n\n static fromClientRect(context: Context, clientRect: ClientRect): Bounds {\n return new Bounds(\n clientRect.left + context.windowBounds.left,\n clientRect.top + context.windowBounds.top,\n clientRect.width,\n clientRect.height\n );\n }\n\n static fromDOMRectList(context: Context, domRectList: DOMRectList): Bounds {\n const rects = Array.from(domRectList);\n\n // First try to find a rect with non-zero width\n let domRect = rects.find((rect) => rect.width !== 0);\n\n // If not found, try to find a rect with non-zero height\n // This handles cases like inline-flex with single child where width might be 0\n if (!domRect) {\n domRect = rects.find((rect) => rect.height !== 0);\n }\n\n // If still not found but rects exist, use the first rect\n // Position info (left, top) might still be valid even if dimensions are 0\n if (!domRect && rects.length > 0) {\n domRect = rects[0];\n }\n\n return domRect\n ? new Bounds(\n domRect.left + context.windowBounds.left,\n domRect.top + context.windowBounds.top,\n domRect.width,\n domRect.height\n )\n : Bounds.EMPTY;\n }\n\n static EMPTY = new Bounds(0, 0, 0, 0);\n}\n\nexport const parseBounds = (context: Context, node: Element): Bounds => {\n return Bounds.fromClientRect(context, node.getBoundingClientRect());\n};\n\nexport const parseDocumentSize = (document: Document): Bounds => {\n const body = document.body;\n const documentElement = document.documentElement;\n\n if (!body || !documentElement) {\n throw new Error(`Unable to get document size`);\n }\n const width = Math.max(\n Math.max(body.scrollWidth, documentElement.scrollWidth),\n Math.max(body.offsetWidth, documentElement.offsetWidth),\n Math.max(body.clientWidth, documentElement.clientWidth)\n );\n\n const height = Math.max(\n Math.max(body.scrollHeight, documentElement.scrollHeight),\n Math.max(body.offsetHeight, documentElement.offsetHeight),\n Math.max(body.clientHeight, documentElement.clientHeight)\n );\n\n return new Bounds(0, 0, width, height);\n};\n","export const toCodePoints = (str: string): number[] => {\n const codePoints = [];\n let i = 0;\n const length = str.length;\n while (i < length) {\n const value = str.charCodeAt(i++);\n if (value >= 0xd800 && value <= 0xdbff && i < length) {\n const extra = str.charCodeAt(i++);\n if ((extra & 0xfc00) === 0xdc00) {\n codePoints.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000);\n } else {\n codePoints.push(value);\n i--;\n }\n } else {\n codePoints.push(value);\n }\n }\n return codePoints;\n};\n\nexport const fromCodePoint = (...codePoints: number[]): string => {\n if (String.fromCodePoint) {\n return String.fromCodePoint(...codePoints);\n }\n\n const length = codePoints.length;\n if (!length) {\n return '';\n }\n\n const codeUnits = [];\n\n let index = -1;\n let result = '';\n while (++index < length) {\n let codePoint = codePoints[index];\n if (codePoint <= 0xffff) {\n codeUnits.push(codePoint);\n } else {\n codePoint -= 0x10000;\n codeUnits.push((codePoint >> 10) + 0xd800, (codePoint % 0x400) + 0xdc00);\n }\n if (index + 1 === length || codeUnits.length > 0x4000) {\n result += String.fromCharCode(...codeUnits);\n codeUnits.length = 0;\n }\n }\n return result;\n};\n\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\n// Use a lookup table to find the index.\nconst lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\n\nexport const decode = (base64: string): ArrayBuffer | number[] => {\n let bufferLength = base64.length * 0.75,\n len = base64.length,\n i,\n p = 0,\n encoded1,\n encoded2,\n encoded3,\n encoded4;\n\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n\n const buffer =\n typeof ArrayBuffer !== 'undefined' &&\n typeof Uint8Array !== 'undefined' &&\n typeof Uint8Array.prototype.slice !== 'undefined'\n ? new ArrayBuffer(bufferLength)\n : new Array(bufferLength);\n const bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);\n\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n\n return buffer;\n};\n\nexport const polyUint16Array = (buffer: number[]): number[] => {\n const length = buffer.length;\n const bytes = [];\n for (let i = 0; i < length; i += 2) {\n bytes.push((buffer[i + 1] << 8) | buffer[i]);\n }\n return bytes;\n};\n\nexport const polyUint32Array = (buffer: number[]): number[] => {\n const length = buffer.length;\n const bytes = [];\n for (let i = 0; i < length; i += 4) {\n bytes.push((buffer[i + 3] << 24) | (buffer[i + 2] << 16) | (buffer[i + 1] << 8) | buffer[i]);\n }\n return bytes;\n};\n","const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\n// Use a lookup table to find the index.\nconst lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\n\nexport const decode = (base64: string): ArrayBuffer | number[] => {\n let bufferLength = base64.length * 0.75,\n len = base64.length,\n i,\n p = 0,\n encoded1,\n encoded2,\n encoded3,\n encoded4;\n\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n\n const buffer =\n typeof ArrayBuffer !== 'undefined' &&\n typeof Uint8Array !== 'undefined' &&\n typeof Uint8Array.prototype.slice !== 'undefined'\n ? new ArrayBuffer(bufferLength)\n : new Array(bufferLength);\n const bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);\n\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n\n return buffer;\n};\n\nexport const polyUint16Array = (buffer: number[]): number[] => {\n const length = buffer.length;\n const bytes = [];\n for (let i = 0; i < length; i += 2) {\n bytes.push((buffer[i + 1] << 8) | buffer[i]);\n }\n return bytes;\n};\n\nexport const polyUint32Array = (buffer: number[]): number[] => {\n const length = buffer.length;\n const bytes = [];\n for (let i = 0; i < length; i += 4) {\n bytes.push((buffer[i + 3] << 24) | (buffer[i + 2] << 16) | (buffer[i + 1] << 8) | buffer[i]);\n }\n return bytes;\n};\n","import {decode, polyUint16Array, polyUint32Array} from './Util';\n\nexport type int = number;\n\n/** Shift size for getting the index-2 table offset. */\nexport const UTRIE2_SHIFT_2 = 5;\n\n/** Shift size for getting the index-1 table offset. */\nexport const UTRIE2_SHIFT_1 = 6 + 5;\n\n/**\n * Shift size for shifting left the index array values.\n * Increases possible data size with 16-bit index values at the cost\n * of compactability.\n * This requires data blocks to be aligned by UTRIE2_DATA_GRANULARITY.\n */\nexport const UTRIE2_INDEX_SHIFT = 2;\n\n/**\n * Difference between the two shift sizes,\n * for getting an index-1 offset from an index-2 offset. 6=11-5\n */\nexport const UTRIE2_SHIFT_1_2 = UTRIE2_SHIFT_1 - UTRIE2_SHIFT_2;\n\n/**\n * The part of the index-2 table for U+D800..U+DBFF stores values for\n * lead surrogate code _units_ not code _points_.\n * Values for lead surrogate code _points_ are indexed with this portion of the table.\n * Length=32=0x20=0x400>>UTRIE2_SHIFT_2. (There are 1024=0x400 lead surrogates.)\n */\nexport const UTRIE2_LSCP_INDEX_2_OFFSET = 0x10000 >> UTRIE2_SHIFT_2;\n\n/** Number of entries in a data block. 32=0x20 */\nexport const UTRIE2_DATA_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_2;\n/** Mask for getting the lower bits for the in-data-block offset. */\nexport const UTRIE2_DATA_MASK = UTRIE2_DATA_BLOCK_LENGTH - 1;\n\nexport const UTRIE2_LSCP_INDEX_2_LENGTH = 0x400 >> UTRIE2_SHIFT_2;\n/** Count the lengths of both BMP pieces. 2080=0x820 */\nexport const UTRIE2_INDEX_2_BMP_LENGTH = UTRIE2_LSCP_INDEX_2_OFFSET + UTRIE2_LSCP_INDEX_2_LENGTH;\n/**\n * The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820.\n * Length 32=0x20 for lead bytes C0..DF, regardless of UTRIE2_SHIFT_2.\n */\nexport const UTRIE2_UTF8_2B_INDEX_2_OFFSET = UTRIE2_INDEX_2_BMP_LENGTH;\nexport const UTRIE2_UTF8_2B_INDEX_2_LENGTH = 0x800 >> 6; /* U+0800 is the first code point after 2-byte UTF-8 */\n/**\n * The index-1 table, only used for supplementary code points, at offset 2112=0x840.\n * Variable length, for code points up to highStart, where the last single-value range starts.\n * Maximum length 512=0x200=0x100000>>UTRIE2_SHIFT_1.\n * (For 0x100000 supplementary code points U+10000..U+10ffff.)\n *\n * The part of the index-2 table for supplementary code points starts\n * after this index-1 table.\n *\n * Both the index-1 table and the following part of the index-2 table\n * are omitted completely if there is only BMP data.\n */\nexport const UTRIE2_INDEX_1_OFFSET = UTRIE2_UTF8_2B_INDEX_2_OFFSET + UTRIE2_UTF8_2B_INDEX_2_LENGTH;\n\n/**\n * Number of index-1 entries for the BMP. 32=0x20\n * This part of the index-1 table is omitted from the serialized form.\n */\nexport const UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> UTRIE2_SHIFT_1;\n\n/** Number of entries in an index-2 block. 64=0x40 */\nexport const UTRIE2_INDEX_2_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_1_2;\n/** Mask for getting the lower bits for the in-index-2-block offset. */\nexport const UTRIE2_INDEX_2_MASK = UTRIE2_INDEX_2_BLOCK_LENGTH - 1;\n\nconst slice16 = (view: number[] | Uint16Array, start: number, end?: number) => {\n if (view.slice) {\n return view.slice(start, end);\n }\n\n return new Uint16Array(Array.prototype.slice.call(view, start, end));\n};\n\nconst slice32 = (view: number[] | Uint32Array, start: number, end?: number) => {\n if (view.slice) {\n return view.slice(start, end);\n }\n\n return new Uint32Array(Array.prototype.slice.call(view, start, end));\n};\n\nexport const createTrieFromBase64 = (base64: string, _byteLength: number): Trie => {\n const buffer = decode(base64);\n const view32 = Array.isArray(buffer) ? polyUint32Array(buffer) : new Uint32Array(buffer);\n const view16 = Array.isArray(buffer) ? polyUint16Array(buffer) : new Uint16Array(buffer);\n const headerLength = 24;\n\n const index = slice16(view16, headerLength / 2, view32[4] / 2);\n const data =\n view32[5] === 2\n ? slice16(view16, (headerLength + view32[4]) / 2)\n : slice32(view32, Math.ceil((headerLength + view32[4]) / 4));\n\n return new Trie(view32[0], view32[1], view32[2], view32[3], index, data);\n};\n\nexport class Trie {\n initialValue: int;\n errorValue: int;\n highStart: int;\n highValueIndex: int;\n index: Uint16Array | number[];\n data: Uint32Array | Uint16Array | number[];\n\n constructor(\n initialValue: int,\n errorValue: int,\n highStart: int,\n highValueIndex: int,\n index: Uint16Array | number[],\n data: Uint32Array | Uint16Array | number[]\n ) {\n this.initialValue = initialValue;\n this.errorValue = errorValue;\n this.highStart = highStart;\n this.highValueIndex = highValueIndex;\n this.index = index;\n this.data = data;\n }\n\n /**\n * Get the value for a code point as stored in the Trie.\n *\n * @param codePoint the code point\n * @return the value\n */\n get(codePoint: number): number {\n let ix;\n if (codePoint >= 0) {\n if (codePoint < 0x0d800 || (codePoint > 0x0dbff && codePoint <= 0x0ffff)) {\n // Ordinary BMP code point, excluding leading surrogates.\n // BMP uses a single level lookup. BMP index starts at offset 0 in the Trie2 index.\n // 16 bit data is stored in the index array itself.\n ix = this.index[codePoint >> UTRIE2_SHIFT_2];\n ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);\n return this.data[ix];\n }\n\n if (codePoint <= 0xffff) {\n // Lead Surrogate Code Point. A Separate index section is stored for\n // lead surrogate code units and code points.\n // The main index has the code unit data.\n // For this function, we need the code point data.\n // Note: this expression could be refactored for slightly improved efficiency, but\n // surrogate code points will be so rare in practice that it's not worth it.\n ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET + ((codePoint - 0xd800) >> UTRIE2_SHIFT_2)];\n ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);\n return this.data[ix];\n }\n\n if (codePoint < this.highStart) {\n // Supplemental code point, use two-level lookup.\n ix = UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> UTRIE2_SHIFT_1);\n ix = this.index[ix];\n ix += (codePoint >> UTRIE2_SHIFT_2) & UTRIE2_INDEX_2_MASK;\n ix = this.index[ix];\n ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);\n return this.data[ix];\n }\n if (codePoint <= 0x10ffff) {\n return this.data[this.highValueIndex];\n }\n }\n\n // Fall through. The code point is outside of the legal range of 0..0x10ffff.\n return this.errorValue;\n }\n}\n","const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\n// Use a lookup table to find the index.\nconst lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\n\nexport const encode = (arraybuffer: ArrayBuffer): string => {\n let bytes = new Uint8Array(arraybuffer),\n i,\n len = bytes.length,\n base64 = '';\n\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n\n return base64;\n};\n\nexport const decode = (base64: string): ArrayBuffer => {\n let bufferLength = base64.length * 0.75,\n len = base64.length,\n i,\n p = 0,\n encoded1,\n encoded2,\n encoded3,\n encoded4;\n\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n\n const arraybuffer = new ArrayBuffer(bufferLength),\n bytes = new Uint8Array(arraybuffer);\n\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n\n return arraybuffer;\n};\n","export const base64 =\n 'KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzg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HLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHL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AAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAG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LAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQ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LAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgAr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B4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQ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AQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQ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AAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==';\nexport const byteLength = 39664;\n","'use strict';\n\nimport {createTrieFromBase64} from 'utrie';\nimport {base64, byteLength} from './linebreak-trie';\nimport {fromCodePoint, toCodePoints} from './Util';\n\nexport const LETTER_NUMBER_MODIFIER = 50;\n\n// Non-tailorable Line Breaking Classes\nconst BK = 1; // Cause a line break (after)\nconst CR = 2; // Cause a line break (after), except between CR and LF\nconst LF = 3; // Cause a line break (after)\nconst CM = 4; // Prohibit a line break between the character and the preceding character\nconst NL = 5; // Cause a line break (after)\nconst SG = 6; // Do not occur in well-formed text\nconst WJ = 7; // Prohibit line breaks before and after\nconst ZW = 8; // Provide a break opportunity\nconst GL = 9; // Prohibit line breaks before and after\nconst SP = 10; // Enable indirect line breaks\nconst ZWJ = 11; // Prohibit line breaks within joiner sequences\n// Break Opportunities\nconst B2 = 12; // Provide a line break opportunity before and after the character\nconst BA = 13; // Generally provide a line break opportunity after the character\nconst BB = 14; // Generally provide a line break opportunity before the character\nconst HY = 15; // Provide a line break opportunity after the character, except in numeric context\nconst CB = 16; // Provide a line break opportunity contingent on additional information\n// Characters Prohibiting Certain Breaks\nconst CL = 17; // Prohibit line breaks before\nconst CP = 18; // Prohibit line breaks before\nconst EX = 19; // Prohibit line breaks before\nconst IN = 20; // Allow only indirect line breaks between pairs\nconst NS = 21; // Allow only indirect line breaks before\nconst OP = 22; // Prohibit line breaks after\nconst QU = 23; // Act like they are both opening and closing\n// Numeric Context\nconst IS = 24; // Prevent breaks after any and before numeric\nconst NU = 25; // Form numeric expressions for line breaking purposes\nconst PO = 26; // Do not break following a numeric expression\nconst PR = 27; // Do not break in front of a numeric expression\nconst SY = 28; // Prevent a break before; and allow a break after\n// Other Characters\nconst AI = 29; // Act like AL when the resolvedEAW is N; otherwise; act as ID\nconst AL = 30; // Are alphabetic characters or symbols that are used with alphabetic characters\nconst CJ = 31; // Treat as NS or ID for strict or normal breaking.\nconst EB = 32; // Do not break from following Emoji Modifier\nconst EM = 33; // Do not break from preceding Emoji Base\nconst H2 = 34; // Form Korean syllable blocks\nconst H3 = 35; // Form Korean syllable blocks\nconst HL = 36; // Do not break around a following hyphen; otherwise act as Alphabetic\nconst ID = 37; // Break before or after; except in some numeric context\nconst JL = 38; // Form Korean syllable blocks\nconst JV = 39; // Form Korean syllable blocks\nconst JT = 40; // Form Korean syllable blocks\nconst RI = 41; // Keep pairs together. For pairs; break before and after other classes\nconst SA = 42; // Provide a line break opportunity contingent on additional, language-specific context analysis\nconst XX = 43; // Have as yet unknown line breaking behavior or unassigned code positions\n\nconst ea_OP = [0x2329, 0xff08];\n\nexport const classes: {[key: string]: number} = {\n BK,\n CR,\n LF,\n CM,\n NL,\n SG,\n WJ,\n ZW,\n GL,\n SP,\n ZWJ,\n B2,\n BA,\n BB,\n HY,\n CB,\n CL,\n CP,\n EX,\n IN,\n NS,\n OP,\n QU,\n IS,\n NU,\n PO,\n PR,\n SY,\n AI,\n AL,\n CJ,\n EB,\n EM,\n H2,\n H3,\n HL,\n ID,\n JL,\n JV,\n JT,\n RI,\n SA,\n XX,\n};\n\nexport const BREAK_MANDATORY = '!';\nexport const BREAK_NOT_ALLOWED = '×';\nexport const BREAK_ALLOWED = '÷';\nexport const UnicodeTrie = createTrieFromBase64(base64, byteLength);\n\nconst ALPHABETICS = [AL, HL];\nconst HARD_LINE_BREAKS = [BK, CR, LF, NL];\nconst SPACE = [SP, ZW];\nconst PREFIX_POSTFIX = [PR, PO];\nconst LINE_BREAKS = HARD_LINE_BREAKS.concat(SPACE);\nconst KOREAN_SYLLABLE_BLOCK = [JL, JV, JT, H2, H3];\nconst HYPHEN = [HY, BA];\n\nexport const codePointsToCharacterClasses = (\n codePoints: number[],\n lineBreak: string = 'strict'\n): [number[], number[], boolean[]] => {\n const types: number[] = [];\n const indices: number[] = [];\n const categories: boolean[] = [];\n codePoints.forEach((codePoint, index) => {\n let classType = UnicodeTrie.get(codePoint);\n if (classType > LETTER_NUMBER_MODIFIER) {\n categories.push(true);\n classType -= LETTER_NUMBER_MODIFIER;\n } else {\n categories.push(false);\n }\n\n if (['normal', 'auto', 'loose'].indexOf(lineBreak) !== -1) {\n // U+2010, – U+2013, 〜 U+301C, ゠ U+30A0\n if ([0x2010, 0x2013, 0x301c, 0x30a0].indexOf(codePoint) !== -1) {\n indices.push(index);\n return types.push(CB);\n }\n }\n\n if (classType === CM || classType === ZWJ) {\n // LB10 Treat any remaining combining mark or ZWJ as AL.\n if (index === 0) {\n indices.push(index);\n return types.push(AL);\n }\n\n // LB9 Do not break a combining character sequence; treat it as if it has the line breaking class of\n // the base character in all of the following rules. Treat ZWJ as if it were CM.\n const prev = types[index - 1];\n if (LINE_BREAKS.indexOf(prev) === -1) {\n indices.push(indices[index - 1]);\n return types.push(prev);\n }\n indices.push(index);\n return types.push(AL);\n }\n\n indices.push(index);\n\n if (classType === CJ) {\n return types.push(lineBreak === 'strict' ? NS : ID);\n }\n\n if (classType === SA) {\n return types.push(AL);\n }\n\n if (classType === AI) {\n return types.push(AL);\n }\n\n // For supplementary characters, a useful default is to treat characters in the range 10000..1FFFD as AL\n // and characters in the ranges 20000..2FFFD and 30000..3FFFD as ID, until the implementation can be revised\n // to take into account the actual line breaking properties for these characters.\n if (classType === XX) {\n if ((codePoint >= 0x20000 && codePoint <= 0x2fffd) || (codePoint >= 0x30000 && codePoint <= 0x3fffd)) {\n return types.push(ID);\n } else {\n return types.push(AL);\n }\n }\n\n types.push(classType);\n });\n\n return [indices, types, categories];\n};\n\nconst isAdjacentWithSpaceIgnored = (\n a: number[] | number,\n b: number,\n currentIndex: number,\n classTypes: number[]\n): boolean => {\n const current = classTypes[currentIndex];\n if (Array.isArray(a) ? a.indexOf(current) !== -1 : a === current) {\n let i = currentIndex;\n while (i <= classTypes.length) {\n i++;\n let next = classTypes[i];\n\n if (next === b) {\n return true;\n }\n\n if (next !== SP) {\n break;\n }\n }\n }\n\n if (current === SP) {\n let i = currentIndex;\n\n while (i > 0) {\n i--;\n const prev = classTypes[i];\n\n if (Array.isArray(a) ? a.indexOf(prev) !== -1 : a === prev) {\n let n = currentIndex;\n while (n <= classTypes.length) {\n n++;\n let next = classTypes[n];\n\n if (next === b) {\n return true;\n }\n\n if (next !== SP) {\n break;\n }\n }\n }\n\n if (prev !== SP) {\n break;\n }\n }\n }\n return false;\n};\n\nconst previousNonSpaceClassType = (currentIndex: number, classTypes: number[]): number => {\n let i = currentIndex;\n while (i >= 0) {\n let type = classTypes[i];\n if (type === SP) {\n i--;\n } else {\n return type;\n }\n }\n return 0;\n};\n\nexport type BREAK_OPPORTUNITIES = typeof BREAK_NOT_ALLOWED | typeof BREAK_ALLOWED | typeof BREAK_MANDATORY;\n\nconst _lineBreakAtIndex = (\n codePoints: number[],\n classTypes: number[],\n indicies: number[],\n index: number,\n forbiddenBreaks?: boolean[]\n): BREAK_OPPORTUNITIES => {\n if (indicies[index] === 0) {\n return BREAK_NOT_ALLOWED;\n }\n\n let currentIndex = index - 1;\n if (Array.isArray(forbiddenBreaks) && forbiddenBreaks[currentIndex] === true) {\n return BREAK_NOT_ALLOWED;\n }\n\n let beforeIndex = currentIndex - 1;\n let afterIndex = currentIndex + 1;\n let current = classTypes[currentIndex];\n\n // LB4 Always break after hard line breaks.\n // LB5 Treat CR followed by LF, as well as CR, LF, and NL as hard line breaks.\n let before = beforeIndex >= 0 ? classTypes[beforeIndex] : 0;\n let next = classTypes[afterIndex];\n\n if (current === CR && next === LF) {\n return BREAK_NOT_ALLOWED;\n }\n\n if (HARD_LINE_BREAKS.indexOf(current) !== -1) {\n return BREAK_MANDATORY;\n }\n\n // LB6 Do not break before hard line breaks.\n if (HARD_LINE_BREAKS.indexOf(next) !== -1) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB7 Do not break before spaces or zero width space.\n if (SPACE.indexOf(next) !== -1) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB8 Break before any character following a zero-width space, even if one or more spaces intervene.\n if (previousNonSpaceClassType(currentIndex, classTypes) === ZW) {\n return BREAK_ALLOWED;\n }\n\n // LB8a Do not break after a zero width joiner.\n if (UnicodeTrie.get(codePoints[currentIndex]) === ZWJ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // zwj emojis\n if ((current === EB || current === EM) && UnicodeTrie.get(codePoints[afterIndex]) === ZWJ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB11 Do not break before or after Word joiner and related characters.\n if (current === WJ || next === WJ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB12 Do not break after NBSP and related characters.\n if (current === GL) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB12a Do not break before NBSP and related characters, except after spaces and hyphens.\n if ([SP, BA, HY].indexOf(current) === -1 && next === GL) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB13 Do not break before ‘]’ or ‘!’ or ‘;’ or ‘/’, even after spaces.\n if ([CL, CP, EX, IS, SY].indexOf(next) !== -1) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB14 Do not break after ‘[’, even after spaces.\n if (previousNonSpaceClassType(currentIndex, classTypes) === OP) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB15 Do not break within ‘”[’, even with intervening spaces.\n if (isAdjacentWithSpaceIgnored(QU, OP, currentIndex, classTypes)) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB16 Do not break between closing punctuation and a nonstarter (lb=NS), even with intervening spaces.\n if (isAdjacentWithSpaceIgnored([CL, CP], NS, currentIndex, classTypes)) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB17 Do not break within ‘——’, even with intervening spaces.\n if (isAdjacentWithSpaceIgnored(B2, B2, currentIndex, classTypes)) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB18 Break after spaces.\n if (current === SP) {\n return BREAK_ALLOWED;\n }\n\n // LB19 Do not break before or after quotation marks, such as ‘ ” ’.\n if (current === QU || next === QU) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB20 Break before and after unresolved CB.\n if (next === CB || current === CB) {\n return BREAK_ALLOWED;\n }\n\n // LB21 Do not break before hyphen-minus, other hyphens, fixed-width spaces, small kana, and other non-starters, or after acute accents.\n if ([BA, HY, NS].indexOf(next) !== -1 || current === BB) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB21a Don't break after Hebrew + Hyphen.\n if (before === HL && HYPHEN.indexOf(current) !== -1) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB21b Don’t break between Solidus and Hebrew letters.\n if (current === SY && next === HL) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB22 Do not break before ellipsis.\n if (next === IN) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB23 Do not break between digits and letters.\n if ((ALPHABETICS.indexOf(next) !== -1 && current === NU) || (ALPHABETICS.indexOf(current) !== -1 && next === NU)) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB23a Do not break between numeric prefixes and ideographs, or between ideographs and numeric postfixes.\n if (\n (current === PR && [ID, EB, EM].indexOf(next) !== -1) ||\n ([ID, EB, EM].indexOf(current) !== -1 && next === PO)\n ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB24 Do not break between numeric prefix/postfix and letters, or between letters and prefix/postfix.\n if (\n (ALPHABETICS.indexOf(current) !== -1 && PREFIX_POSTFIX.indexOf(next) !== -1) ||\n (PREFIX_POSTFIX.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1)\n ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB25 Do not break between the following pairs of classes relevant to numbers:\n if (\n // (PR | PO) × ( OP | HY )? NU\n ([PR, PO].indexOf(current) !== -1 &&\n (next === NU || ([OP, HY].indexOf(next) !== -1 && classTypes[afterIndex + 1] === NU))) ||\n // ( OP | HY ) × NU\n ([OP, HY].indexOf(current) !== -1 && next === NU) ||\n // NU ×\t(NU | SY | IS)\n (current === NU && [NU, SY, IS].indexOf(next) !== -1)\n ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // NU (NU | SY | IS)* × (NU | SY | IS | CL | CP)\n if ([NU, SY, IS, CL, CP].indexOf(next) !== -1) {\n let prevIndex = currentIndex;\n while (prevIndex >= 0) {\n let type = classTypes[prevIndex];\n if (type === NU) {\n return BREAK_NOT_ALLOWED;\n } else if ([SY, IS].indexOf(type) !== -1) {\n prevIndex--;\n } else {\n break;\n }\n }\n }\n\n // NU (NU | SY | IS)* (CL | CP)? × (PO | PR))\n if ([PR, PO].indexOf(next) !== -1) {\n let prevIndex = [CL, CP].indexOf(current) !== -1 ? beforeIndex : currentIndex;\n while (prevIndex >= 0) {\n let type = classTypes[prevIndex];\n if (type === NU) {\n return BREAK_NOT_ALLOWED;\n } else if ([SY, IS].indexOf(type) !== -1) {\n prevIndex--;\n } else {\n break;\n }\n }\n }\n\n // LB26 Do not break a Korean syllable.\n if (\n (JL === current && [JL, JV, H2, H3].indexOf(next) !== -1) ||\n ([JV, H2].indexOf(current) !== -1 && [JV, JT].indexOf(next) !== -1) ||\n ([JT, H3].indexOf(current) !== -1 && next === JT)\n ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB27 Treat a Korean Syllable Block the same as ID.\n if (\n (KOREAN_SYLLABLE_BLOCK.indexOf(current) !== -1 && [IN, PO].indexOf(next) !== -1) ||\n (KOREAN_SYLLABLE_BLOCK.indexOf(next) !== -1 && current === PR)\n ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB28 Do not break between alphabetics (“at”).\n if (ALPHABETICS.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB29 Do not break between numeric punctuation and alphabetics (“e.g.”).\n if (current === IS && ALPHABETICS.indexOf(next) !== -1) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB30 Do not break between letters, numbers, or ordinary symbols and opening or closing parentheses.\n if (\n (ALPHABETICS.concat(NU).indexOf(current) !== -1 &&\n next === OP &&\n ea_OP.indexOf(codePoints[afterIndex]) === -1) ||\n (ALPHABETICS.concat(NU).indexOf(next) !== -1 && current === CP)\n ) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB30a Break between two regional indicator symbols if and only if there are an even number of regional\n // indicators preceding the position of the break.\n if (current === RI && next === RI) {\n let i = indicies[currentIndex];\n let count = 1;\n while (i > 0) {\n i--;\n if (classTypes[i] === RI) {\n count++;\n } else {\n break;\n }\n }\n if (count % 2 !== 0) {\n return BREAK_NOT_ALLOWED;\n }\n }\n\n // LB30b Do not break between an emoji base and an emoji modifier.\n if (current === EB && next === EM) {\n return BREAK_NOT_ALLOWED;\n }\n\n return BREAK_ALLOWED;\n};\n\nexport const lineBreakAtIndex = (codePoints: number[], index: number): BREAK_OPPORTUNITIES => {\n // LB2 Never break at the start of text.\n if (index === 0) {\n return BREAK_NOT_ALLOWED;\n }\n\n // LB3 Always break at the end of text.\n if (index >= codePoints.length) {\n return BREAK_MANDATORY;\n }\n\n const [indices, classTypes] = codePointsToCharacterClasses(codePoints);\n\n return _lineBreakAtIndex(codePoints, classTypes, indices, index);\n};\n\nexport type LINE_BREAK = 'auto' | 'normal' | 'strict';\nexport type WORD_BREAK = 'normal' | 'break-all' | 'break-word' | 'keep-all';\n\ninterface IOptions {\n lineBreak?: LINE_BREAK;\n wordBreak?: WORD_BREAK;\n}\n\nconst cssFormattedClasses = (codePoints: number[], options?: IOptions): [number[], number[], boolean[] | undefined] => {\n if (!options) {\n options = {lineBreak: 'normal', wordBreak: 'normal'};\n }\n let [indicies, classTypes, isLetterNumber] = codePointsToCharacterClasses(codePoints, options.lineBreak);\n\n if (options.wordBreak === 'break-all' || options.wordBreak === 'break-word') {\n classTypes = classTypes.map((type) => ([NU, AL, SA].indexOf(type) !== -1 ? ID : type));\n }\n\n const forbiddenBreakpoints =\n options.wordBreak === 'keep-all'\n ? isLetterNumber.map((letterNumber, i) => {\n return letterNumber && codePoints[i] >= 0x4e00 && codePoints[i] <= 0x9fff;\n })\n : undefined;\n\n return [indicies, classTypes, forbiddenBreakpoints];\n};\n\nexport const inlineBreakOpportunities = (str: string, options?: IOptions): string => {\n const codePoints = toCodePoints(str);\n let output = BREAK_NOT_ALLOWED;\n const [indicies, classTypes, forbiddenBreakpoints] = cssFormattedClasses(codePoints, options);\n\n codePoints.forEach((codePoint, i) => {\n output +=\n fromCodePoint(codePoint) +\n (i >= codePoints.length - 1\n ? BREAK_MANDATORY\n : _lineBreakAtIndex(codePoints, classTypes, indicies, i + 1, forbiddenBreakpoints));\n });\n\n return output;\n};\n\nclass Break {\n private readonly codePoints: number[];\n readonly required: boolean;\n readonly start: number;\n readonly end: number;\n\n constructor(codePoints: number[], lineBreak: string, start: number, end: number) {\n this.codePoints = codePoints;\n this.required = lineBreak === BREAK_MANDATORY;\n this.start = start;\n this.end = end;\n }\n\n slice(): string {\n return fromCodePoint(...this.codePoints.slice(this.start, this.end));\n }\n}\n\nexport type LineBreak =\n | {\n done: true;\n value: null;\n }\n | {\n done: false;\n value: Break;\n };\n\ninterface ILineBreakIterator {\n next: () => LineBreak;\n}\n\nexport const LineBreaker = (str: string, options?: IOptions): ILineBreakIterator => {\n const codePoints = toCodePoints(str);\n const [indicies, classTypes, forbiddenBreakpoints] = cssFormattedClasses(codePoints, options);\n const length = codePoints.length;\n let lastEnd = 0;\n let nextIndex = 0;\n\n return {\n next: () => {\n if (nextIndex >= length) {\n return {done: true, value: null};\n }\n let lineBreak = BREAK_NOT_ALLOWED;\n while (\n nextIndex < length &&\n (lineBreak = _lineBreakAtIndex(codePoints, classTypes, indicies, ++nextIndex, forbiddenBreakpoints)) ===\n BREAK_NOT_ALLOWED\n ) {}\n\n if (lineBreak !== BREAK_NOT_ALLOWED || nextIndex === length) {\n const value = new Break(codePoints, lineBreak, lastEnd, nextIndex);\n lastEnd = nextIndex;\n return {value, done: false};\n }\n\n return {done: true, value: null};\n },\n };\n};\n","// https://www.w3.org/TR/css-syntax-3\n\nimport { fromCodePoint, toCodePoints } from 'css-line-break';\n\nexport const enum TokenType {\n STRING_TOKEN,\n BAD_STRING_TOKEN,\n LEFT_PARENTHESIS_TOKEN,\n RIGHT_PARENTHESIS_TOKEN,\n COMMA_TOKEN,\n HASH_TOKEN,\n DELIM_TOKEN,\n AT_KEYWORD_TOKEN,\n PREFIX_MATCH_TOKEN,\n DASH_MATCH_TOKEN,\n INCLUDE_MATCH_TOKEN,\n LEFT_CURLY_BRACKET_TOKEN,\n RIGHT_CURLY_BRACKET_TOKEN,\n SUFFIX_MATCH_TOKEN,\n SUBSTRING_MATCH_TOKEN,\n DIMENSION_TOKEN,\n PERCENTAGE_TOKEN,\n NUMBER_TOKEN,\n FUNCTION,\n FUNCTION_TOKEN,\n IDENT_TOKEN,\n COLUMN_TOKEN,\n URL_TOKEN,\n BAD_URL_TOKEN,\n CDC_TOKEN,\n CDO_TOKEN,\n COLON_TOKEN,\n SEMICOLON_TOKEN,\n LEFT_SQUARE_BRACKET_TOKEN,\n RIGHT_SQUARE_BRACKET_TOKEN,\n UNICODE_RANGE_TOKEN,\n WHITESPACE_TOKEN,\n EOF_TOKEN\n}\n\ninterface IToken {\n type: TokenType;\n}\n\nexport interface Token extends IToken {\n type:\n | TokenType.BAD_URL_TOKEN\n | TokenType.BAD_STRING_TOKEN\n | TokenType.LEFT_PARENTHESIS_TOKEN\n | TokenType.RIGHT_PARENTHESIS_TOKEN\n | TokenType.COMMA_TOKEN\n | TokenType.SUBSTRING_MATCH_TOKEN\n | TokenType.PREFIX_MATCH_TOKEN\n | TokenType.SUFFIX_MATCH_TOKEN\n | TokenType.COLON_TOKEN\n | TokenType.SEMICOLON_TOKEN\n | TokenType.LEFT_SQUARE_BRACKET_TOKEN\n | TokenType.RIGHT_SQUARE_BRACKET_TOKEN\n | TokenType.LEFT_CURLY_BRACKET_TOKEN\n | TokenType.RIGHT_CURLY_BRACKET_TOKEN\n | TokenType.DASH_MATCH_TOKEN\n | TokenType.INCLUDE_MATCH_TOKEN\n | TokenType.COLUMN_TOKEN\n | TokenType.WHITESPACE_TOKEN\n | TokenType.CDC_TOKEN\n | TokenType.CDO_TOKEN\n | TokenType.EOF_TOKEN;\n}\n\nexport interface StringValueToken extends IToken {\n type:\n | TokenType.STRING_TOKEN\n | TokenType.DELIM_TOKEN\n | TokenType.FUNCTION_TOKEN\n | TokenType.IDENT_TOKEN\n | TokenType.URL_TOKEN\n | TokenType.AT_KEYWORD_TOKEN;\n value: string;\n}\n\nexport interface HashToken extends IToken {\n type: TokenType.HASH_TOKEN;\n flags: number;\n value: string;\n}\n\nexport interface NumberValueToken extends IToken {\n type: TokenType.PERCENTAGE_TOKEN | TokenType.NUMBER_TOKEN;\n flags: number;\n number: number;\n}\n\nexport interface DimensionToken extends IToken {\n type: TokenType.DIMENSION_TOKEN;\n flags: number;\n unit: string;\n number: number;\n}\n\nexport interface UnicodeRangeToken extends IToken {\n type: TokenType.UNICODE_RANGE_TOKEN;\n start: number;\n end: number;\n}\n\nexport type CSSToken = Token | StringValueToken | NumberValueToken | DimensionToken | UnicodeRangeToken | HashToken;\n\nexport const FLAG_UNRESTRICTED = 1 << 0;\nexport const FLAG_ID = 1 << 1;\nexport const FLAG_INTEGER = 1 << 2;\nexport const FLAG_NUMBER = 1 << 3;\n\nconst LINE_FEED = 0x000a;\nconst SOLIDUS = 0x002f;\nconst REVERSE_SOLIDUS = 0x005c;\nconst CHARACTER_TABULATION = 0x0009;\nconst SPACE = 0x0020;\nconst QUOTATION_MARK = 0x0022;\nconst EQUALS_SIGN = 0x003d;\nconst NUMBER_SIGN = 0x0023;\nconst DOLLAR_SIGN = 0x0024;\nconst PERCENTAGE_SIGN = 0x0025;\nconst APOSTROPHE = 0x0027;\nconst LEFT_PARENTHESIS = 0x0028;\nconst RIGHT_PARENTHESIS = 0x0029;\nconst LOW_LINE = 0x005f;\nconst HYPHEN_MINUS = 0x002d;\nconst EXCLAMATION_MARK = 0x0021;\nconst LESS_THAN_SIGN = 0x003c;\nconst GREATER_THAN_SIGN = 0x003e;\nconst COMMERCIAL_AT = 0x0040;\nconst LEFT_SQUARE_BRACKET = 0x005b;\nconst RIGHT_SQUARE_BRACKET = 0x005d;\nconst CIRCUMFLEX_ACCENT = 0x003d;\nconst LEFT_CURLY_BRACKET = 0x007b;\nconst QUESTION_MARK = 0x003f;\nconst RIGHT_CURLY_BRACKET = 0x007d;\nconst VERTICAL_LINE = 0x007c;\nconst TILDE = 0x007e;\nconst CONTROL = 0x0080;\nconst REPLACEMENT_CHARACTER = 0xfffd;\nconst ASTERISK = 0x002a;\nconst PLUS_SIGN = 0x002b;\nconst COMMA = 0x002c;\nconst COLON = 0x003a;\nconst SEMICOLON = 0x003b;\nconst FULL_STOP = 0x002e;\nconst NULL = 0x0000;\nconst BACKSPACE = 0x0008;\nconst LINE_TABULATION = 0x000b;\nconst SHIFT_OUT = 0x000e;\nconst INFORMATION_SEPARATOR_ONE = 0x001f;\nconst DELETE = 0x007f;\nconst EOF = -1;\nconst ZERO = 0x0030;\nconst a = 0x0061;\nconst e = 0x0065;\nconst f = 0x0066;\nconst u = 0x0075;\nconst z = 0x007a;\nconst A = 0x0041;\nconst E = 0x0045;\nconst F = 0x0046;\nconst U = 0x0055;\nconst Z = 0x005a;\n\nconst isDigit = (codePoint: number) => codePoint >= ZERO && codePoint <= 0x0039;\nconst isSurrogateCodePoint = (codePoint: number) => codePoint >= 0xd800 && codePoint <= 0xdfff;\nconst isHex = (codePoint: number) =>\n isDigit(codePoint) || (codePoint >= A && codePoint <= F) || (codePoint >= a && codePoint <= f);\nconst isLowerCaseLetter = (codePoint: number) => codePoint >= a && codePoint <= z;\nconst isUpperCaseLetter = (codePoint: number) => codePoint >= A && codePoint <= Z;\nconst isLetter = (codePoint: number) => isLowerCaseLetter(codePoint) || isUpperCaseLetter(codePoint);\nconst isNonASCIICodePoint = (codePoint: number) => codePoint >= CONTROL;\nconst isWhiteSpace = (codePoint: number): boolean =>\n codePoint === LINE_FEED || codePoint === CHARACTER_TABULATION || codePoint === SPACE;\nconst isNameStartCodePoint = (codePoint: number): boolean =>\n isLetter(codePoint) || isNonASCIICodePoint(codePoint) || codePoint === LOW_LINE;\nconst isNameCodePoint = (codePoint: number): boolean =>\n isNameStartCodePoint(codePoint) || isDigit(codePoint) || codePoint === HYPHEN_MINUS;\nconst isNonPrintableCodePoint = (codePoint: number): boolean => {\n return (\n (codePoint >= NULL && codePoint <= BACKSPACE) ||\n codePoint === LINE_TABULATION ||\n (codePoint >= SHIFT_OUT && codePoint <= INFORMATION_SEPARATOR_ONE) ||\n codePoint === DELETE\n );\n};\nconst isValidEscape = (c1: number, c2: number): boolean => {\n if (c1 !== REVERSE_SOLIDUS) {\n return false;\n }\n\n return c2 !== LINE_FEED;\n};\nconst isIdentifierStart = (c1: number, c2: number, c3: number): boolean => {\n if (c1 === HYPHEN_MINUS) {\n return isNameStartCodePoint(c2) || isValidEscape(c2, c3);\n } else if (isNameStartCodePoint(c1)) {\n return true;\n } else if (c1 === REVERSE_SOLIDUS && isValidEscape(c1, c2)) {\n return true;\n }\n return false;\n};\n\nconst isNumberStart = (c1: number, c2: number, c3: number): boolean => {\n if (c1 === PLUS_SIGN || c1 === HYPHEN_MINUS) {\n if (isDigit(c2)) {\n return true;\n }\n\n return c2 === FULL_STOP && isDigit(c3);\n }\n\n if (c1 === FULL_STOP) {\n return isDigit(c2);\n }\n\n return isDigit(c1);\n};\n\nconst stringToNumber = (codePoints: number[]): number => {\n let c = 0;\n let sign = 1;\n if (codePoints[c] === PLUS_SIGN || codePoints[c] === HYPHEN_MINUS) {\n if (codePoints[c] === HYPHEN_MINUS) {\n sign = -1;\n }\n c++;\n }\n\n const integers = [];\n\n while (isDigit(codePoints[c])) {\n integers.push(codePoints[c++]);\n }\n\n const int = integers.length ? parseInt(fromCodePoint(...integers), 10) : 0;\n\n if (codePoints[c] === FULL_STOP) {\n c++;\n }\n\n const fraction = [];\n while (isDigit(codePoints[c])) {\n fraction.push(codePoints[c++]);\n }\n\n const fracd = fraction.length;\n const frac = fracd ? parseInt(fromCodePoint(...fraction), 10) : 0;\n\n if (codePoints[c] === E || codePoints[c] === e) {\n c++;\n }\n\n let expsign = 1;\n\n if (codePoints[c] === PLUS_SIGN || codePoints[c] === HYPHEN_MINUS) {\n if (codePoints[c] === HYPHEN_MINUS) {\n expsign = -1;\n }\n c++;\n }\n\n const exponent = [];\n\n while (isDigit(codePoints[c])) {\n exponent.push(codePoints[c++]);\n }\n\n const exp = exponent.length ? parseInt(fromCodePoint(...exponent), 10) : 0;\n\n return sign * (int + frac * Math.pow(10, -fracd)) * Math.pow(10, expsign * exp);\n};\n\nconst LEFT_PARENTHESIS_TOKEN: Token = {\n type: TokenType.LEFT_PARENTHESIS_TOKEN\n};\nconst RIGHT_PARENTHESIS_TOKEN: Token = {\n type: TokenType.RIGHT_PARENTHESIS_TOKEN\n};\nconst COMMA_TOKEN: Token = { type: TokenType.COMMA_TOKEN };\nconst SUFFIX_MATCH_TOKEN: Token = { type: TokenType.SUFFIX_MATCH_TOKEN };\nconst PREFIX_MATCH_TOKEN: Token = { type: TokenType.PREFIX_MATCH_TOKEN };\nconst COLUMN_TOKEN: Token = { type: TokenType.COLUMN_TOKEN };\nconst DASH_MATCH_TOKEN: Token = { type: TokenType.DASH_MATCH_TOKEN };\nconst INCLUDE_MATCH_TOKEN: Token = { type: TokenType.INCLUDE_MATCH_TOKEN };\nconst LEFT_CURLY_BRACKET_TOKEN: Token = {\n type: TokenType.LEFT_CURLY_BRACKET_TOKEN\n};\nconst RIGHT_CURLY_BRACKET_TOKEN: Token = {\n type: TokenType.RIGHT_CURLY_BRACKET_TOKEN\n};\nconst SUBSTRING_MATCH_TOKEN: Token = { type: TokenType.SUBSTRING_MATCH_TOKEN };\nconst BAD_URL_TOKEN: Token = { type: TokenType.BAD_URL_TOKEN };\nconst BAD_STRING_TOKEN: Token = { type: TokenType.BAD_STRING_TOKEN };\nconst CDO_TOKEN: Token = { type: TokenType.CDO_TOKEN };\nconst CDC_TOKEN: Token = { type: TokenType.CDC_TOKEN };\nconst COLON_TOKEN: Token = { type: TokenType.COLON_TOKEN };\nconst SEMICOLON_TOKEN: Token = { type: TokenType.SEMICOLON_TOKEN };\nconst LEFT_SQUARE_BRACKET_TOKEN: Token = {\n type: TokenType.LEFT_SQUARE_BRACKET_TOKEN\n};\nconst RIGHT_SQUARE_BRACKET_TOKEN: Token = {\n type: TokenType.RIGHT_SQUARE_BRACKET_TOKEN\n};\nconst WHITESPACE_TOKEN: Token = { type: TokenType.WHITESPACE_TOKEN };\nexport const EOF_TOKEN: Token = { type: TokenType.EOF_TOKEN };\n\nexport class Tokenizer {\n private _value: number[];\n\n constructor() {\n this._value = [];\n }\n\n write(chunk: string): void {\n this._value = this._value.concat(toCodePoints(chunk));\n }\n\n read(): CSSToken[] {\n const tokens = [];\n let token = this.consumeToken();\n while (token !== EOF_TOKEN) {\n tokens.push(token);\n token = this.consumeToken();\n }\n return tokens;\n }\n\n private consumeToken(): CSSToken {\n const codePoint = this.consumeCodePoint();\n\n switch (codePoint) {\n case QUOTATION_MARK:\n return this.consumeStringToken(QUOTATION_MARK);\n case NUMBER_SIGN:\n const c1 = this.peekCodePoint(0);\n const c2 = this.peekCodePoint(1);\n const c3 = this.peekCodePoint(2);\n if (isNameCodePoint(c1) || isValidEscape(c2, c3)) {\n const flags = isIdentifierStart(c1, c2, c3) ? FLAG_ID : FLAG_UNRESTRICTED;\n const value = this.consumeName();\n\n return { type: TokenType.HASH_TOKEN, value, flags };\n }\n break;\n case DOLLAR_SIGN:\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\n this.consumeCodePoint();\n return SUFFIX_MATCH_TOKEN;\n }\n break;\n case APOSTROPHE:\n return this.consumeStringToken(APOSTROPHE);\n case LEFT_PARENTHESIS:\n return LEFT_PARENTHESIS_TOKEN;\n case RIGHT_PARENTHESIS:\n return RIGHT_PARENTHESIS_TOKEN;\n case ASTERISK:\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\n this.consumeCodePoint();\n return SUBSTRING_MATCH_TOKEN;\n }\n break;\n case PLUS_SIGN:\n if (isNumberStart(codePoint, this.peekCodePoint(0), this.peekCodePoint(1))) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeNumericToken();\n }\n break;\n case COMMA:\n return COMMA_TOKEN;\n case HYPHEN_MINUS:\n const e1 = codePoint;\n const e2 = this.peekCodePoint(0);\n const e3 = this.peekCodePoint(1);\n\n if (isNumberStart(e1, e2, e3)) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeNumericToken();\n }\n\n if (isIdentifierStart(e1, e2, e3)) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeIdentLikeToken();\n }\n\n if (e2 === HYPHEN_MINUS && e3 === GREATER_THAN_SIGN) {\n this.consumeCodePoint();\n this.consumeCodePoint();\n return CDC_TOKEN;\n }\n break;\n\n case FULL_STOP:\n if (isNumberStart(codePoint, this.peekCodePoint(0), this.peekCodePoint(1))) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeNumericToken();\n }\n break;\n case SOLIDUS:\n if (this.peekCodePoint(0) === ASTERISK) {\n this.consumeCodePoint();\n while (true) {\n let c = this.consumeCodePoint();\n if (c === ASTERISK) {\n c = this.consumeCodePoint();\n if (c === SOLIDUS) {\n return this.consumeToken();\n }\n }\n if (c === EOF) {\n return this.consumeToken();\n }\n }\n }\n break;\n case COLON:\n return COLON_TOKEN;\n case SEMICOLON:\n return SEMICOLON_TOKEN;\n case LESS_THAN_SIGN:\n if (\n this.peekCodePoint(0) === EXCLAMATION_MARK &&\n this.peekCodePoint(1) === HYPHEN_MINUS &&\n this.peekCodePoint(2) === HYPHEN_MINUS\n ) {\n this.consumeCodePoint();\n this.consumeCodePoint();\n return CDO_TOKEN;\n }\n break;\n case COMMERCIAL_AT:\n const a1 = this.peekCodePoint(0);\n const a2 = this.peekCodePoint(1);\n const a3 = this.peekCodePoint(2);\n if (isIdentifierStart(a1, a2, a3)) {\n const value = this.consumeName();\n return { type: TokenType.AT_KEYWORD_TOKEN, value };\n }\n break;\n case LEFT_SQUARE_BRACKET:\n return LEFT_SQUARE_BRACKET_TOKEN;\n case REVERSE_SOLIDUS:\n if (isValidEscape(codePoint, this.peekCodePoint(0))) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeIdentLikeToken();\n }\n break;\n case RIGHT_SQUARE_BRACKET:\n return RIGHT_SQUARE_BRACKET_TOKEN;\n case CIRCUMFLEX_ACCENT:\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\n this.consumeCodePoint();\n return PREFIX_MATCH_TOKEN;\n }\n break;\n case LEFT_CURLY_BRACKET:\n return LEFT_CURLY_BRACKET_TOKEN;\n case RIGHT_CURLY_BRACKET:\n return RIGHT_CURLY_BRACKET_TOKEN;\n case u:\n case U:\n const u1 = this.peekCodePoint(0);\n const u2 = this.peekCodePoint(1);\n if (u1 === PLUS_SIGN && (isHex(u2) || u2 === QUESTION_MARK)) {\n this.consumeCodePoint();\n this.consumeUnicodeRangeToken();\n }\n this.reconsumeCodePoint(codePoint);\n return this.consumeIdentLikeToken();\n case VERTICAL_LINE:\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\n this.consumeCodePoint();\n return DASH_MATCH_TOKEN;\n }\n if (this.peekCodePoint(0) === VERTICAL_LINE) {\n this.consumeCodePoint();\n return COLUMN_TOKEN;\n }\n break;\n case TILDE:\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\n this.consumeCodePoint();\n return INCLUDE_MATCH_TOKEN;\n }\n break;\n case EOF:\n return EOF_TOKEN;\n }\n\n if (isWhiteSpace(codePoint)) {\n this.consumeWhiteSpace();\n return WHITESPACE_TOKEN;\n }\n\n if (isDigit(codePoint)) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeNumericToken();\n }\n\n if (isNameStartCodePoint(codePoint)) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeIdentLikeToken();\n }\n\n return { type: TokenType.DELIM_TOKEN, value: fromCodePoint(codePoint) };\n }\n\n private consumeCodePoint(): number {\n const value = this._value.shift();\n\n return typeof value === 'undefined' ? -1 : value;\n }\n\n private reconsumeCodePoint(codePoint: number) {\n this._value.unshift(codePoint);\n }\n\n private peekCodePoint(delta: number): number {\n if (delta >= this._value.length) {\n return -1;\n }\n\n return this._value[delta];\n }\n\n private consumeUnicodeRangeToken(): UnicodeRangeToken {\n const digits = [];\n let codePoint = this.consumeCodePoint();\n while (isHex(codePoint) && digits.length < 6) {\n digits.push(codePoint);\n codePoint = this.consumeCodePoint();\n }\n let questionMarks = false;\n while (codePoint === QUESTION_MARK && digits.length < 6) {\n digits.push(codePoint);\n codePoint = this.consumeCodePoint();\n questionMarks = true;\n }\n\n if (questionMarks) {\n const start = parseInt(\n fromCodePoint(...digits.map((digit) => (digit === QUESTION_MARK ? ZERO : digit))),\n 16\n );\n const end = parseInt(fromCodePoint(...digits.map((digit) => (digit === QUESTION_MARK ? F : digit))), 16);\n return { type: TokenType.UNICODE_RANGE_TOKEN, start, end };\n }\n\n const start = parseInt(fromCodePoint(...digits), 16);\n if (this.peekCodePoint(0) === HYPHEN_MINUS && isHex(this.peekCodePoint(1))) {\n this.consumeCodePoint();\n codePoint = this.consumeCodePoint();\n const endDigits = [];\n while (isHex(codePoint) && endDigits.length < 6) {\n endDigits.push(codePoint);\n codePoint = this.consumeCodePoint();\n }\n const end = parseInt(fromCodePoint(...endDigits), 16);\n\n return { type: TokenType.UNICODE_RANGE_TOKEN, start, end };\n } else {\n return { type: TokenType.UNICODE_RANGE_TOKEN, start, end: start };\n }\n }\n\n private consumeIdentLikeToken(): StringValueToken | Token {\n const value = this.consumeName();\n if (value.toLowerCase() === 'url' && this.peekCodePoint(0) === LEFT_PARENTHESIS) {\n this.consumeCodePoint();\n return this.consumeUrlToken();\n } else if (this.peekCodePoint(0) === LEFT_PARENTHESIS) {\n this.consumeCodePoint();\n return { type: TokenType.FUNCTION_TOKEN, value };\n }\n\n return { type: TokenType.IDENT_TOKEN, value };\n }\n\n private consumeUrlToken(): StringValueToken | Token {\n const value = [];\n this.consumeWhiteSpace();\n\n if (this.peekCodePoint(0) === EOF) {\n return { type: TokenType.URL_TOKEN, value: '' };\n }\n\n const next = this.peekCodePoint(0);\n if (next === APOSTROPHE || next === QUOTATION_MARK) {\n const stringToken = this.consumeStringToken(this.consumeCodePoint());\n if (stringToken.type === TokenType.STRING_TOKEN) {\n this.consumeWhiteSpace();\n\n if (this.peekCodePoint(0) === EOF || this.peekCodePoint(0) === RIGHT_PARENTHESIS) {\n this.consumeCodePoint();\n return { type: TokenType.URL_TOKEN, value: stringToken.value };\n }\n }\n\n this.consumeBadUrlRemnants();\n return BAD_URL_TOKEN;\n }\n\n while (true) {\n const codePoint = this.consumeCodePoint();\n if (codePoint === EOF || codePoint === RIGHT_PARENTHESIS) {\n return { type: TokenType.URL_TOKEN, value: fromCodePoint(...value) };\n } else if (isWhiteSpace(codePoint)) {\n this.consumeWhiteSpace();\n if (this.peekCodePoint(0) === EOF || this.peekCodePoint(0) === RIGHT_PARENTHESIS) {\n this.consumeCodePoint();\n return { type: TokenType.URL_TOKEN, value: fromCodePoint(...value) };\n }\n this.consumeBadUrlRemnants();\n return BAD_URL_TOKEN;\n } else if (\n codePoint === QUOTATION_MARK ||\n codePoint === APOSTROPHE ||\n codePoint === LEFT_PARENTHESIS ||\n isNonPrintableCodePoint(codePoint)\n ) {\n this.consumeBadUrlRemnants();\n return BAD_URL_TOKEN;\n } else if (codePoint === REVERSE_SOLIDUS) {\n if (isValidEscape(codePoint, this.peekCodePoint(0))) {\n value.push(this.consumeEscapedCodePoint());\n } else {\n this.consumeBadUrlRemnants();\n return BAD_URL_TOKEN;\n }\n } else {\n value.push(codePoint);\n }\n }\n }\n\n private consumeWhiteSpace(): void {\n while (isWhiteSpace(this.peekCodePoint(0))) {\n this.consumeCodePoint();\n }\n }\n\n private consumeBadUrlRemnants(): void {\n while (true) {\n const codePoint = this.consumeCodePoint();\n if (codePoint === RIGHT_PARENTHESIS || codePoint === EOF) {\n return;\n }\n\n if (isValidEscape(codePoint, this.peekCodePoint(0))) {\n this.consumeEscapedCodePoint();\n }\n }\n }\n\n private consumeStringSlice(count: number): string {\n const SLICE_STACK_SIZE = 50000;\n let value = '';\n while (count > 0) {\n const amount = Math.min(SLICE_STACK_SIZE, count);\n value += fromCodePoint(...this._value.splice(0, amount));\n count -= amount;\n }\n this._value.shift();\n\n return value;\n }\n\n private consumeStringToken(endingCodePoint: number): StringValueToken | Token {\n let value = '';\n let i = 0;\n\n do {\n const codePoint = this._value[i];\n if (codePoint === EOF || codePoint === undefined || codePoint === endingCodePoint) {\n value += this.consumeStringSlice(i);\n return { type: TokenType.STRING_TOKEN, value };\n }\n\n if (codePoint === LINE_FEED) {\n this._value.splice(0, i);\n return BAD_STRING_TOKEN;\n }\n\n if (codePoint === REVERSE_SOLIDUS) {\n const next = this._value[i + 1];\n if (next !== EOF && next !== undefined) {\n if (next === LINE_FEED) {\n value += this.consumeStringSlice(i);\n i = -1;\n this._value.shift();\n } else if (isValidEscape(codePoint, next)) {\n value += this.consumeStringSlice(i);\n value += fromCodePoint(this.consumeEscapedCodePoint());\n i = -1;\n }\n }\n }\n\n i++;\n } while (true);\n }\n\n private consumeNumber() {\n const repr = [];\n let type = FLAG_INTEGER;\n let c1 = this.peekCodePoint(0);\n if (c1 === PLUS_SIGN || c1 === HYPHEN_MINUS) {\n repr.push(this.consumeCodePoint());\n }\n\n while (isDigit(this.peekCodePoint(0))) {\n repr.push(this.consumeCodePoint());\n }\n c1 = this.peekCodePoint(0);\n let c2 = this.peekCodePoint(1);\n if (c1 === FULL_STOP && isDigit(c2)) {\n repr.push(this.consumeCodePoint(), this.consumeCodePoint());\n type = FLAG_NUMBER;\n while (isDigit(this.peekCodePoint(0))) {\n repr.push(this.consumeCodePoint());\n }\n }\n\n c1 = this.peekCodePoint(0);\n c2 = this.peekCodePoint(1);\n const c3 = this.peekCodePoint(2);\n if ((c1 === E || c1 === e) && (((c2 === PLUS_SIGN || c2 === HYPHEN_MINUS) && isDigit(c3)) || isDigit(c2))) {\n repr.push(this.consumeCodePoint(), this.consumeCodePoint());\n type = FLAG_NUMBER;\n while (isDigit(this.peekCodePoint(0))) {\n repr.push(this.consumeCodePoint());\n }\n }\n\n return [stringToNumber(repr), type];\n }\n\n private consumeNumericToken(): NumberValueToken | DimensionToken {\n const [number, flags] = this.consumeNumber();\n const c1 = this.peekCodePoint(0);\n const c2 = this.peekCodePoint(1);\n const c3 = this.peekCodePoint(2);\n\n if (isIdentifierStart(c1, c2, c3)) {\n const unit = this.consumeName();\n return { type: TokenType.DIMENSION_TOKEN, number, flags, unit };\n }\n\n if (c1 === PERCENTAGE_SIGN) {\n this.consumeCodePoint();\n return { type: TokenType.PERCENTAGE_TOKEN, number, flags };\n }\n\n return { type: TokenType.NUMBER_TOKEN, number, flags };\n }\n\n private consumeEscapedCodePoint(): number {\n const codePoint = this.consumeCodePoint();\n\n if (isHex(codePoint)) {\n let hex = fromCodePoint(codePoint);\n while (isHex(this.peekCodePoint(0)) && hex.length < 6) {\n hex += fromCodePoint(this.consumeCodePoint());\n }\n\n if (isWhiteSpace(this.peekCodePoint(0))) {\n this.consumeCodePoint();\n }\n\n const hexCodePoint = parseInt(hex, 16);\n\n if (hexCodePoint === 0 || isSurrogateCodePoint(hexCodePoint) || hexCodePoint > 0x10ffff) {\n return REPLACEMENT_CHARACTER;\n }\n\n return hexCodePoint;\n }\n\n if (codePoint === EOF) {\n return REPLACEMENT_CHARACTER;\n }\n\n return codePoint;\n }\n\n private consumeName(): string {\n let result = '';\n while (true) {\n const codePoint = this.consumeCodePoint();\n if (isNameCodePoint(codePoint)) {\n result += fromCodePoint(codePoint);\n } else if (isValidEscape(codePoint, this.peekCodePoint(0))) {\n result += fromCodePoint(this.consumeEscapedCodePoint());\n } else {\n this.reconsumeCodePoint(codePoint);\n return result;\n }\n }\n }\n}\n","import {\n CSSToken,\n DimensionToken,\n EOF_TOKEN,\n NumberValueToken,\n StringValueToken,\n Tokenizer,\n TokenType\n} from './tokenizer';\n\nexport type CSSBlockType =\n | TokenType.LEFT_PARENTHESIS_TOKEN\n | TokenType.LEFT_SQUARE_BRACKET_TOKEN\n | TokenType.LEFT_CURLY_BRACKET_TOKEN;\n\nexport interface CSSBlock {\n type: CSSBlockType;\n values: CSSValue[];\n}\n\nexport interface CSSFunction {\n type: TokenType.FUNCTION;\n name: string;\n values: CSSValue[];\n}\n\nexport type CSSValue = CSSFunction | CSSToken | CSSBlock;\n\nexport class Parser {\n private _tokens: CSSToken[];\n\n constructor(tokens: CSSToken[]) {\n this._tokens = tokens;\n }\n\n static create(value: string): Parser {\n const tokenizer = new Tokenizer();\n tokenizer.write(value);\n return new Parser(tokenizer.read());\n }\n\n static parseValue(value: string): CSSValue {\n return Parser.create(value).parseComponentValue();\n }\n\n static parseValues(value: string): CSSValue[] {\n return Parser.create(value).parseComponentValues();\n }\n\n parseComponentValue(): CSSValue {\n let token = this.consumeToken();\n while (token.type === TokenType.WHITESPACE_TOKEN) {\n token = this.consumeToken();\n }\n\n if (token.type === TokenType.EOF_TOKEN) {\n throw new SyntaxError(`Error parsing CSS component value, unexpected EOF`);\n }\n\n this.reconsumeToken(token);\n const value = this.consumeComponentValue();\n\n do {\n token = this.consumeToken();\n } while (token.type === TokenType.WHITESPACE_TOKEN);\n\n if (token.type === TokenType.EOF_TOKEN) {\n return value;\n }\n\n throw new SyntaxError(`Error parsing CSS component value, multiple values found when expecting only one`);\n }\n\n parseComponentValues(): CSSValue[] {\n const values = [];\n while (true) {\n const value = this.consumeComponentValue();\n if (value.type === TokenType.EOF_TOKEN) {\n return values;\n }\n values.push(value);\n values.push();\n }\n }\n\n private consumeComponentValue(): CSSValue {\n const token = this.consumeToken();\n\n switch (token.type) {\n case TokenType.LEFT_CURLY_BRACKET_TOKEN:\n case TokenType.LEFT_SQUARE_BRACKET_TOKEN:\n case TokenType.LEFT_PARENTHESIS_TOKEN:\n return this.consumeSimpleBlock(token.type);\n case TokenType.FUNCTION_TOKEN:\n return this.consumeFunction(token);\n }\n\n return token;\n }\n\n private consumeSimpleBlock(type: CSSBlockType): CSSBlock {\n const block: CSSBlock = { type, values: [] };\n\n let token = this.consumeToken();\n while (true) {\n if (token.type === TokenType.EOF_TOKEN || isEndingTokenFor(token, type)) {\n return block;\n }\n\n this.reconsumeToken(token);\n block.values.push(this.consumeComponentValue());\n token = this.consumeToken();\n }\n }\n\n private consumeFunction(functionToken: StringValueToken): CSSFunction {\n const cssFunction: CSSFunction = {\n name: functionToken.value,\n values: [],\n type: TokenType.FUNCTION\n };\n\n while (true) {\n const token = this.consumeToken();\n if (token.type === TokenType.EOF_TOKEN || token.type === TokenType.RIGHT_PARENTHESIS_TOKEN) {\n return cssFunction;\n }\n\n this.reconsumeToken(token);\n cssFunction.values.push(this.consumeComponentValue());\n }\n }\n\n private consumeToken(): CSSToken {\n const token = this._tokens.shift();\n return typeof token === 'undefined' ? EOF_TOKEN : token;\n }\n\n private reconsumeToken(token: CSSToken): void {\n this._tokens.unshift(token);\n }\n}\n\nexport const isDimensionToken = (token: CSSValue): token is DimensionToken => token.type === TokenType.DIMENSION_TOKEN;\nexport const isNumberToken = (token: CSSValue): token is NumberValueToken => token.type === TokenType.NUMBER_TOKEN;\nexport const isIdentToken = (token: CSSValue): token is StringValueToken => token.type === TokenType.IDENT_TOKEN;\nexport const isStringToken = (token: CSSValue): token is StringValueToken => token.type === TokenType.STRING_TOKEN;\nexport const isIdentWithValue = (token: CSSValue, value: string): boolean =>\n isIdentToken(token) && token.value === value;\n\nexport const nonWhiteSpace = (token: CSSValue): boolean => token.type !== TokenType.WHITESPACE_TOKEN;\nexport const nonFunctionArgSeparator = (token: CSSValue): boolean =>\n token.type !== TokenType.WHITESPACE_TOKEN && token.type !== TokenType.COMMA_TOKEN;\n\nexport const parseFunctionArgs = (tokens: CSSValue[]): CSSValue[][] => {\n const args: CSSValue[][] = [];\n let arg: CSSValue[] = [];\n tokens.forEach((token) => {\n if (token.type === TokenType.COMMA_TOKEN) {\n if (arg.length === 0) {\n throw new Error(`Error parsing function args, zero tokens for arg`);\n }\n args.push(arg);\n arg = [];\n return;\n }\n\n if (token.type !== TokenType.WHITESPACE_TOKEN) {\n arg.push(token);\n }\n });\n if (arg.length) {\n args.push(arg);\n }\n\n return args;\n};\n\nconst isEndingTokenFor = (token: CSSToken, type: CSSBlockType): boolean => {\n if (type === TokenType.LEFT_CURLY_BRACKET_TOKEN && token.type === TokenType.RIGHT_CURLY_BRACKET_TOKEN) {\n return true;\n }\n if (type === TokenType.LEFT_SQUARE_BRACKET_TOKEN && token.type === TokenType.RIGHT_SQUARE_BRACKET_TOKEN) {\n return true;\n }\n\n return type === TokenType.LEFT_PARENTHESIS_TOKEN && token.type === TokenType.RIGHT_PARENTHESIS_TOKEN;\n};\n","import { CSSValue } from '../syntax/parser';\nimport { DimensionToken, NumberValueToken, TokenType } from '../syntax/tokenizer';\n\nexport type Length = DimensionToken | NumberValueToken;\n\nexport const isLength = (token: CSSValue): token is Length =>\n token.type === TokenType.NUMBER_TOKEN || token.type === TokenType.DIMENSION_TOKEN;\n","import { DimensionToken, FLAG_INTEGER, NumberValueToken, TokenType } from '../syntax/tokenizer';\nimport { CSSValue, CSSFunction, isDimensionToken } from '../syntax/parser';\nimport { isLength } from './length';\nexport type LengthPercentage = DimensionToken | NumberValueToken;\nexport type LengthPercentageTuple = [LengthPercentage] | [LengthPercentage, LengthPercentage];\n\nexport const isLengthPercentage = (token: CSSValue): token is LengthPercentage =>\n token.type === TokenType.PERCENTAGE_TOKEN || isLength(token);\n\n/**\n * Check if a token is a calc() function\n */\nexport const isCalcFunction = (token: CSSValue): token is CSSFunction =>\n token.type === TokenType.FUNCTION && token.name === 'calc';\n\n/**\n * Evaluate a calc() expression and convert to LengthPercentage token\n * Supports basic arithmetic: +, -, *, /\n * Note: Percentages in calc() are converted based on a context value\n */\nexport const evaluateCalcToLengthPercentage = (calcToken: CSSFunction, contextValue = 0): LengthPercentage | null => {\n // Build expression string from tokens\n const buildExpression = (values: CSSValue[]): string | null => {\n let expression = '';\n\n for (const value of values) {\n if (value.type === TokenType.WHITESPACE_TOKEN) {\n continue;\n }\n\n if (value.type === TokenType.FUNCTION) {\n if (value.name === 'calc') {\n const nested = buildExpression(value.values);\n if (nested === null) return null;\n expression += `(${nested})`;\n } else {\n return null;\n }\n } else if (value.type === TokenType.NUMBER_TOKEN) {\n expression += value.number.toString();\n } else if (value.type === TokenType.DIMENSION_TOKEN) {\n // Convert units to px\n if (value.unit === 'px') {\n expression += value.number.toString();\n } else if (value.unit === 'rem' || value.unit === 'em') {\n expression += (value.number * 16).toString();\n } else {\n expression += value.number.toString();\n }\n } else if (value.type === TokenType.PERCENTAGE_TOKEN) {\n // Convert percentage to absolute value based on context\n expression += ((value.number / 100) * contextValue).toString();\n } else if (value.type === TokenType.DELIM_TOKEN) {\n const op = value.value;\n if (op === '+' || op === '-' || op === '*' || op === '/') {\n expression += ` ${op} `;\n } else if (op === '(') {\n expression += '(';\n } else if (op === ')') {\n expression += ')';\n }\n }\n }\n\n return expression;\n };\n\n try {\n const expression = buildExpression(calcToken.values);\n if (expression === null || expression.trim() === '') {\n return null;\n }\n\n // Evaluate the expression\n // Note: Using Function constructor (similar to color.ts line 185)\n const result = new Function('return ' + expression)();\n\n if (typeof result === 'number' && !isNaN(result)) {\n // Return as a number token in px\n return {\n type: TokenType.NUMBER_TOKEN,\n number: result,\n flags: FLAG_INTEGER\n };\n }\n } catch (e) {\n return null;\n }\n\n return null;\n};\nexport const parseLengthPercentageTuple = (tokens: LengthPercentage[]): LengthPercentageTuple =>\n tokens.length > 1 ? [tokens[0], tokens[1]] : [tokens[0]];\nexport const ZERO_LENGTH: NumberValueToken = {\n type: TokenType.NUMBER_TOKEN,\n number: 0,\n flags: FLAG_INTEGER\n};\n\nexport const FIFTY_PERCENT: NumberValueToken = {\n type: TokenType.PERCENTAGE_TOKEN,\n number: 50,\n flags: FLAG_INTEGER\n};\n\nexport const HUNDRED_PERCENT: NumberValueToken = {\n type: TokenType.PERCENTAGE_TOKEN,\n number: 100,\n flags: FLAG_INTEGER\n};\n\nexport const getAbsoluteValueForTuple = (\n tuple: LengthPercentageTuple,\n width: number,\n height: number\n): [number, number] => {\n const [x, y] = tuple;\n return [getAbsoluteValue(x, width), getAbsoluteValue(typeof y !== 'undefined' ? y : x, height)];\n};\nexport const getAbsoluteValue = (token: LengthPercentage, parent: number): number => {\n if (token.type === TokenType.PERCENTAGE_TOKEN) {\n return (token.number / 100) * parent;\n }\n\n if (isDimensionToken(token)) {\n switch (token.unit) {\n case 'rem':\n case 'em':\n return 16 * token.number; // TODO use correct font-size\n case 'px':\n default:\n return token.number;\n }\n }\n\n return token.number;\n};\n","import { CSSValue, isIdentToken } from '../syntax/parser';\nimport { TokenType } from '../syntax/tokenizer';\nimport { ITypeDescriptor } from '../ITypeDescriptor';\nimport { HUNDRED_PERCENT, ZERO_LENGTH } from './length-percentage';\nimport { GradientCorner } from './image';\nimport { Context } from '../../core/context';\n\nconst DEG = 'deg';\nconst GRAD = 'grad';\nconst RAD = 'rad';\nconst TURN = 'turn';\n\nexport const angle: ITypeDescriptor<number> = {\n name: 'angle',\n parse: (_context: Context, value: CSSValue): number => {\n if (value.type === TokenType.DIMENSION_TOKEN) {\n switch (value.unit) {\n case DEG:\n return (Math.PI * value.number) / 180;\n case GRAD:\n return (Math.PI / 200) * value.number;\n case RAD:\n return value.number;\n case TURN:\n return Math.PI * 2 * value.number;\n }\n }\n\n throw new Error(`Unsupported angle type`);\n }\n};\n\nexport const isAngle = (value: CSSValue): boolean => {\n if (value.type === TokenType.DIMENSION_TOKEN) {\n if (value.unit === DEG || value.unit === GRAD || value.unit === RAD || value.unit === TURN) {\n return true;\n }\n }\n return false;\n};\n\nexport const parseNamedSide = (tokens: CSSValue[]): number | GradientCorner => {\n const sideOrCorner = tokens\n .filter(isIdentToken)\n .map((ident) => ident.value)\n .join(' ');\n\n switch (sideOrCorner) {\n case 'to bottom right':\n case 'to right bottom':\n case 'left top':\n case 'top left':\n return [ZERO_LENGTH, ZERO_LENGTH];\n case 'to top':\n case 'bottom':\n return deg(0);\n case 'to bottom left':\n case 'to left bottom':\n case 'right top':\n case 'top right':\n return [ZERO_LENGTH, HUNDRED_PERCENT];\n case 'to right':\n case 'left':\n return deg(90);\n case 'to top left':\n case 'to left top':\n case 'right bottom':\n case 'bottom right':\n return [HUNDRED_PERCENT, HUNDRED_PERCENT];\n case 'to bottom':\n case 'top':\n return deg(180);\n case 'to top right':\n case 'to right top':\n case 'left bottom':\n case 'bottom left':\n return [HUNDRED_PERCENT, ZERO_LENGTH];\n case 'to left':\n case 'right':\n return deg(270);\n }\n\n return 0;\n};\n\nexport const deg = (deg: number): number => (Math.PI * deg) / 180;\n","import { Context } from '../../core/context';\nimport { CSSValue, isDimensionToken, isNumberToken, nonFunctionArgSeparator } from '../syntax/parser';\nimport { rgb2rgbLinear, rgbLinear2xyz, srgbLinear2rgb, xyz2rgbLinear } from './color-spaces/srgb';\nimport { TokenType } from '../syntax/tokenizer';\nimport { angle, deg } from './angle';\nimport { getAbsoluteValue, isLengthPercentage } from './length-percentage';\n\ntype Color = number;\n\nexport const isTransparent = (color: Color): boolean => (0xff & color) === 0;\n\nexport const asString = (color: Color): string => {\n const alpha = 0xff & color;\n const blue = 0xff & (color >> 8);\n const green = 0xff & (color >> 16);\n const red = 0xff & (color >> 24);\n return alpha < 255 ? `rgba(${red},${green},${blue},${alpha / 255})` : `rgb(${red},${green},${blue})`;\n};\n\nexport const pack = (r: number, g: number, b: number, a: number): Color =>\n ((r << 24) | (g << 16) | (b << 8) | (Math.round(a * 255) << 0)) >>> 0;\n\nexport const getTokenColorValue = (token: CSSValue, i: number): number => {\n if (token.type === TokenType.NUMBER_TOKEN) {\n return token.number;\n }\n\n if (token.type === TokenType.PERCENTAGE_TOKEN) {\n const max = i === 3 ? 1 : 255;\n return i === 3 ? (token.number / 100) * max : Math.round((token.number / 100) * max);\n }\n\n return 0;\n};\n\nexport const isRelativeTransform = (tokens: CSSValue[]): boolean =>\n (tokens[0].type === TokenType.IDENT_TOKEN ? tokens[0].value : 'unknown') === 'from';\n\nexport const clamp = (value: number, min: number, max: number) => {\n return Math.min(Math.max(value, min), max);\n};\n\nexport const multiplyMatrices = (A: number[], B: number[]): [number, number, number] => {\n return [\n A[0] * B[0] + A[1] * B[1] + A[2] * B[2],\n A[3] * B[0] + A[4] * B[1] + A[5] * B[2],\n A[6] * B[0] + A[7] * B[1] + A[8] * B[2]\n ];\n};\n\nexport const packSrgb = (args: number[]): number => {\n return pack(\n clamp(Math.round(args[0] * 255), 0, 255),\n clamp(Math.round(args[1] * 255), 0, 255),\n clamp(Math.round(args[2] * 255), 0, 255),\n clamp(args[3], 0, 1)\n );\n};\n\nexport const packSrgbLinear = ([r, g, b, a]: [number, number, number, number]): number => {\n const rgb = srgbLinear2rgb([r, g, b]);\n return pack(\n clamp(Math.round(rgb[0] * 255), 0, 255),\n clamp(Math.round(rgb[1] * 255), 0, 255),\n clamp(Math.round(rgb[2] * 255), 0, 255),\n a\n );\n};\n\nexport const packXYZ = (args: number[]): number => {\n const srgb_linear = xyz2rgbLinear([args[0], args[1], args[2]]);\n return packSrgbLinear([srgb_linear[0], srgb_linear[1], srgb_linear[2], args[3]]);\n};\n\nexport const packLab = (_context: Context, args: CSSValue[]): number => {\n if (isRelativeTransform(args.filter(nonFunctionArgSeparator))) {\n throw new Error('Relative color not supported for lab()');\n }\n const [l, a, b, alpha] = extractLabComponents(args),\n rgb = srgbLinear2rgb(xyz2rgbLinear(lab2xyz([l, a, b])));\n\n return pack(\n clamp(Math.round(rgb[0] * 255), 0, 255),\n clamp(Math.round(rgb[1] * 255), 0, 255),\n clamp(Math.round(rgb[2] * 255), 0, 255),\n alpha\n );\n};\n\nexport const packOkLab = (_context: Context, args: CSSValue[]): number => {\n if (isRelativeTransform(args.filter(nonFunctionArgSeparator))) {\n throw new Error('Relative color not supported for oklab()');\n }\n const [l, a, b, alpha] = extractLabComponents(args),\n rgb = srgbLinear2rgb(xyz2rgbLinear(oklab2xyz([l, a, b])));\n\n return pack(\n clamp(Math.round(rgb[0] * 255), 0, 255),\n clamp(Math.round(rgb[1] * 255), 0, 255),\n clamp(Math.round(rgb[2] * 255), 0, 255),\n alpha\n );\n};\n\nexport const packOkLch = (_context: Context, args: CSSValue[]): number => {\n if (isRelativeTransform(args.filter(nonFunctionArgSeparator))) {\n throw new Error('Relative color not supported for oklch()');\n }\n const [l, c, h, alpha] = extractOkLchComponents(args),\n rgb = srgbLinear2rgb(xyz2rgbLinear(oklab2xyz(lch2lab([l, c, h]))));\n\n return pack(\n clamp(Math.round(rgb[0] * 255), 0, 255),\n clamp(Math.round(rgb[1] * 255), 0, 255),\n clamp(Math.round(rgb[2] * 255), 0, 255),\n alpha\n );\n};\n\nexport const packLch = (_context: Context, args: CSSValue[]): number => {\n if (isRelativeTransform(args.filter(nonFunctionArgSeparator))) {\n throw new Error('Relative color not supported for lch()');\n }\n const [l, c, h, a] = extractLchComponents(args),\n rgb = srgbLinear2rgb(xyz2rgbLinear(lab2xyz(lch2lab([l, c, h]))));\n\n return pack(\n clamp(Math.round(rgb[0] * 255), 0, 255),\n clamp(Math.round(rgb[1] * 255), 0, 255),\n clamp(Math.round(rgb[2] * 255), 0, 255),\n a\n );\n};\n\nexport const extractHslComponents = (context: Context, args: CSSValue[]): [number, number, number, number] => {\n const tokens = args.filter(nonFunctionArgSeparator),\n [hue, saturation, lightness, alpha] = tokens,\n h = (hue.type === TokenType.NUMBER_TOKEN ? deg(hue.number) : angle.parse(context, hue)) / (Math.PI * 2),\n s = isLengthPercentage(saturation) ? saturation.number / 100 : 0,\n l = isLengthPercentage(lightness) ? lightness.number / 100 : 0,\n a = typeof alpha !== 'undefined' && isLengthPercentage(alpha) ? getAbsoluteValue(alpha, 1) : 1;\n return [h, s, l, a];\n};\n\nexport const packHSL = (context: Context, args: CSSValue[]): number => {\n if (isRelativeTransform(args)) {\n throw new Error('Relative color not supported for hsl()');\n }\n const [h, s, l, a] = extractHslComponents(context, args),\n rgb = hsl2rgb([h, s, l]);\n return pack(rgb[0] * 255, rgb[1] * 255, rgb[2] * 255, s === 0 ? 1 : a);\n};\n\nexport const extractLchComponents = (args: CSSValue[]): [number, number, number, number] => {\n const tokens = args.filter(nonFunctionArgSeparator),\n l = isLengthPercentage(tokens[0]) ? tokens[0].number : 0,\n c = isLengthPercentage(tokens[1]) ? tokens[1].number : 0,\n h = isNumberToken(tokens[2]) || isDimensionToken(tokens[2]) ? tokens[2].number : 0,\n a = typeof tokens[4] !== 'undefined' && isLengthPercentage(tokens[4]) ? getAbsoluteValue(tokens[4], 1) : 1;\n\n return [l, c, h, a];\n};\n\nexport const extractLabComponents = (args: CSSValue[]): [number, number, number, number] => {\n const tokens = args.filter(nonFunctionArgSeparator),\n l =\n tokens[0].type === TokenType.PERCENTAGE_TOKEN\n ? tokens[0].number / 100\n : isNumberToken(tokens[0])\n ? tokens[0].number\n : 0,\n a =\n tokens[1].type === TokenType.PERCENTAGE_TOKEN\n ? tokens[1].number / 100\n : isNumberToken(tokens[1])\n ? tokens[1].number\n : 0,\n b = isNumberToken(tokens[2]) || isDimensionToken(tokens[2]) ? tokens[2].number : 0,\n alpha = typeof tokens[4] !== 'undefined' && isLengthPercentage(tokens[4]) ? getAbsoluteValue(tokens[4], 1) : 1;\n\n return [l, a, b, alpha];\n};\n\nexport const extractOkLchComponents = (args: CSSValue[]): [number, number, number, number] => {\n const tokens = args.filter(nonFunctionArgSeparator),\n l =\n tokens[0].type === TokenType.PERCENTAGE_TOKEN\n ? tokens[0].number / 100\n : isNumberToken(tokens[0])\n ? tokens[0].number\n : 0,\n c =\n tokens[1].type === TokenType.PERCENTAGE_TOKEN\n ? tokens[1].number / 100\n : isNumberToken(tokens[1])\n ? tokens[1].number\n : 0,\n h = isNumberToken(tokens[2]) || isDimensionToken(tokens[2]) ? tokens[2].number : 0,\n a = typeof tokens[4] !== 'undefined' && isLengthPercentage(tokens[4]) ? getAbsoluteValue(tokens[4], 1) : 1;\n\n return [l, c, h, a];\n};\n\n/**\n * Convert D65 to D50\n *\n * @param xyz\n */\nexport const d65toD50 = (xyz: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 1.0479297925449969, 0.022946870601609652, -0.05019226628920524, 0.02962780877005599, 0.9904344267538799,\n -0.017073799063418826, -0.009243040646204504, 0.015055191490298152, 0.7518742814281371\n ],\n xyz\n );\n};\n\n/**\n * Convert D50 to D65\n *\n * @param xyz\n */\nexport const d50toD65 = (xyz: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 0.955473421488075, -0.02309845494876471, 0.06325924320057072, -0.0283697093338637, 1.0099953980813041,\n 0.021041441191917323, 0.012314014864481998, -0.020507649298898964, 1.330365926242124\n ],\n xyz\n );\n};\n\nexport const hue2rgb = (t1: number, t2: number, hue: number): number => {\n if (hue < 0) {\n hue += 1;\n }\n if (hue >= 1) {\n hue -= 1;\n }\n\n if (hue < 1 / 6) {\n return (t2 - t1) * hue * 6 + t1;\n } else if (hue < 1 / 2) {\n return t2;\n } else if (hue < 2 / 3) {\n return (t2 - t1) * 6 * (2 / 3 - hue) + t1;\n } else {\n return t1;\n }\n};\n\nconst hsl2rgb = ([h, s, l]: [number, number, number]): [number, number, number] => {\n if (s === 0) {\n return [l * 255, l * 255, l * 255];\n }\n const t2 = l <= 0.5 ? l * (s + 1) : l + s - l * s,\n t1 = l * 2 - t2,\n r = hue2rgb(t1, t2, h + 1 / 3),\n g = hue2rgb(t1, t2, h),\n b = hue2rgb(t1, t2, h - 1 / 3);\n\n return [r, g, b];\n};\n\n/**\n * Convert lch to OKLab\n *\n * @param l\n * @param c\n * @param h\n */\nconst lch2lab = ([l, c, h]: [number, number, number]): [number, number, number] => {\n if (c < 0) {\n c = 0;\n }\n if (isNaN(h)) {\n h = 0;\n }\n return [l, c * Math.cos((h * Math.PI) / 180), c * Math.sin((h * Math.PI) / 180)];\n};\n\n/**\n * Convert OKLab to XYZ relative to D65\n *\n * @param lab\n */\nconst oklab2xyz = (lab: [number, number, number]): [number, number, number] => {\n const LMSg = multiplyMatrices(\n [\n 1, 0.3963377773761749, 0.2158037573099136, 1, -0.1055613458156586, -0.0638541728258133, 1,\n -0.0894841775298119, -1.2914855480194092\n ],\n lab\n ),\n LMS = LMSg.map((val: number) => val ** 3);\n\n return multiplyMatrices(\n [\n 1.2268798758459243, -0.5578149944602171, 0.2813910456659647, -0.0405757452148008, 1.112286803280317,\n -0.0717110580655164, -0.0763729366746601, -0.4214933324022432, 1.5869240198367816\n ],\n LMS\n );\n};\n\n/**\n * Convert Lab to D50-adapted XYZ\n *\n * @param lab\n */\nconst lab2xyz = (lab: [number, number, number]): [number, number, number] => {\n const fy = (lab[0] + 16) / 116,\n fx = lab[1] / 500 + fy,\n fz = fy - lab[2] / 200,\n k = 24389 / 27,\n e = 24 / 116,\n xyz = [\n ((fx > e ? fx ** 3 : (116 * fx - 16) / k) * 0.3457) / 0.3585,\n lab[0] > 8 ? fy ** 3 : lab[0] / k,\n ((fz > e ? fz ** 3 : (116 * fz - 16) / k) * (1.0 - 0.3457 - 0.3585)) / 0.3585\n ];\n\n return d50toD65([xyz[0], xyz[1], xyz[2]]);\n};\n\n/**\n * Convert RGB to XYZ\n *\n * @param _context\n * @param args\n */\nexport const rgbToXyz = (_context: Context, args: CSSValue[]): [number, number, number, number] => {\n const tokens = args.filter(nonFunctionArgSeparator);\n\n if (tokens.length === 3) {\n const [r, g, b] = tokens.map(getTokenColorValue),\n rgb_linear = rgb2rgbLinear([r / 255, g / 255, b / 255]),\n [x, y, z] = rgbLinear2xyz([rgb_linear[0], rgb_linear[1], rgb_linear[2]]);\n return [x, y, z, 1];\n }\n\n if (tokens.length === 4) {\n const [r, g, b, a] = tokens.map(getTokenColorValue),\n rgb_linear = rgb2rgbLinear([r / 255, g / 255, b / 255]),\n [x, y, z] = rgbLinear2xyz([rgb_linear[0], rgb_linear[1], rgb_linear[2]]);\n return [x, y, z, a];\n }\n\n return [0, 0, 0, 1];\n};\n\n/**\n * HSL to XYZ\n *\n * @param context\n * @param args\n */\nexport const hslToXyz = (context: Context, args: CSSValue[]): [number, number, number, number] => {\n const [h, s, l, a] = extractHslComponents(context, args),\n rgb_linear = rgb2rgbLinear(hsl2rgb([h, s, l])),\n [x, y, z] = rgbLinear2xyz([rgb_linear[0], rgb_linear[1], rgb_linear[2]]);\n\n return [x, y, z, a];\n};\n\n/**\n * LAB to XYZ\n *\n * @param _context\n * @param args\n */\nexport const labToXyz = (_context: Context, args: CSSValue[]): [number, number, number, number] => {\n const [l, a, b, alpha] = extractLabComponents(args),\n [x, y, z] = lab2xyz([l, a, b]);\n return [x, y, z, alpha];\n};\n\n/**\n * LCH to XYZ\n *\n * @param _context\n * @param args\n */\nexport const lchToXyz = (_context: Context, args: CSSValue[]): [number, number, number, number] => {\n const [l, c, h, alpha] = extractLchComponents(args),\n [x, y, z] = lab2xyz(lch2lab([l, c, h]));\n return [x, y, z, alpha];\n};\n\n/**\n * OKLch to XYZ\n *\n * @param _context\n * @param args\n */\nexport const oklchToXyz = (_context: Context, args: CSSValue[]): [number, number, number, number] => {\n const [l, c, h, alpha] = extractOkLchComponents(args),\n [x, y, z] = oklab2xyz(lch2lab([l, c, h]));\n return [x, y, z, alpha];\n};\n\n/**\n * OKLab to XYZ\n *\n * @param _context\n * @param args\n */\nexport const oklabToXyz = (_context: Context, args: CSSValue[]): [number, number, number, number] => {\n const [l, c, h, alpha] = extractLabComponents(args),\n [x, y, z] = oklab2xyz([l, c, h]);\n return [x, y, z, alpha];\n};\n\n/**\n * XYZ-50 to XYZ\n *\n * @param args\n */\nexport const xyz50ToXYZ = (args: number[]): [number, number, number] => {\n return d50toD65([args[0], args[1], args[2]]);\n};\n\n/**\n * Does nothing, required for SUPPORTED_COLOR_SPACES_FROM_XYZ in the _color() function\n *\n * @param args\n */\nexport const xyzFromXYZ = (args: [number, number, number, number]): [number, number, number, number] => {\n return args;\n};\n\n/**\n * XYZ-65 to XYZ-50\n *\n * @param args\n */\nexport const xyz50FromXYZ = (args: [number, number, number, number]): [number, number, number, number] => {\n const [x, y, z] = d65toD50([args[0], args[2], args[3]]);\n return [x, y, z, args[3]];\n};\n\n/**\n * Convert XYZ to SRGB and Pack\n *\n * @param args\n */\nexport const convertXyz = (args: number[]): number => {\n return packXYZ([args[0], args[1], args[2], args[3]]);\n};\n\n/**\n * Convert XYZ-50 to SRGB and Pack\n *\n * @param args\n */\nexport const convertXyz50 = (args: number[]): number => {\n const xyz = xyz50ToXYZ([args[0], args[1], args[2]]);\n return packXYZ([xyz[0], xyz[1], xyz[2], args[3]]);\n};\n","/**\n * SRGB related functions\n */\n\nimport { clamp, multiplyMatrices } from '../color-utilities';\n\n/**\n * Convert XYZ to linear-light sRGB\n *\n * @param xyz\n */\nexport const xyz2rgbLinear = (xyz: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 3.2409699419045226, -1.537383177570094, -0.4986107602930034, -0.9692436362808796, 1.8759675015077202,\n 0.04155505740717559, 0.05563007969699366, -0.20397695888897652, 1.0569715142428786\n ],\n xyz\n );\n};\n\n/**\n * Convert XYZ to linear-light sRGB\n *\n * @param xyz\n */\nexport const rgbLinear2xyz = (xyz: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 0.41239079926595934, 0.357584339383878, 0.1804807884018343, 0.21263900587151027, 0.715168678767756,\n 0.07219231536073371, 0.01933081871559182, 0.11919477979462598, 0.9505321522496607\n ],\n xyz\n );\n};\n\n/**\n * Convert sRGB to RGB\n *\n * @param rgb\n */\nexport const srgbLinear2rgb = (rgb: [number, number, number]): number[] => {\n return rgb.map((c: number) => {\n const sign = c < 0 ? -1 : 1,\n abs = Math.abs(c);\n\n return abs > 0.0031308 ? sign * (1.055 * abs ** (1 / 2.4) - 0.055) : 12.92 * c;\n });\n};\n\n/**\n * Convert RGB to sRGB\n *\n * @param rgb\n */\nexport const rgb2rgbLinear = (rgb: [number, number, number]): number[] => {\n return rgb.map((c: number) => {\n const sign = c < 0 ? -1 : 1,\n abs = Math.abs(c);\n\n return abs <= 0.04045 ? c / 12.92 : sign * ((abs + 0.055) / 1.055) ** 2.4;\n });\n};\n\n/**\n * XYZ to SRGB\n *\n * @param args\n */\nexport const srgbFromXYZ = (args: [number, number, number, number]): [number, number, number, number] => {\n const [r, g, b] = srgbLinear2rgb(xyz2rgbLinear([args[0], args[1], args[2]]));\n return [r, g, b, args[3]];\n};\n\n/**\n * XYZ to SRGB-Linear\n * @param args\n */\nexport const srgbLinearFromXYZ = (args: [number, number, number, number]): [number, number, number, number] => {\n const [r, g, b] = xyz2rgbLinear([args[0], args[1], args[2]]);\n return [\n clamp(Math.round(r * 255), 0, 255),\n clamp(Math.round(g * 255), 0, 255),\n clamp(Math.round(b * 255), 0, 255),\n args[3]\n ];\n};\n","/**\n * Display-P3 related functions\n */\n\nimport { srgbLinear2rgb } from './srgb';\nimport { multiplyMatrices, packXYZ } from '../color-utilities';\n\n/**\n * Convert P3 Linear to xyz\n *\n * @param p3l\n */\nexport const p3LinearToXyz = (p3l: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 0.4865709486482162, 0.26566769316909306, 0.1982172852343625, 0.2289745640697488, 0.6917385218365064,\n 0.079286914093745, 0.0, 0.04511338185890264, 1.043944368900976\n ],\n p3l\n );\n};\n/**\n * Convert XYZ to P3 Linear\n *\n * @param xyz\n */\nexport const xyzToP3Linear = (xyz: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 2.493496911941425, -0.9313836179191239, -0.40271078445071684, -0.8294889695615747, 1.7626640603183463,\n 0.023624685841943577, 0.03584583024378447, -0.07617238926804182, 0.9568845240076872\n ],\n xyz\n );\n};\n\n/**\n * Convert P3 to P3 linear\n *\n * @param p3\n */\nexport const p32p3Linear = (p3: [number, number, number]): number[] => {\n return p3.map((c: number) => {\n const sign = c < 0 ? -1 : 1,\n abs = c * sign;\n\n if (abs <= 0.04045) {\n return c / 12.92;\n }\n\n return sign * ((c + 0.055) / 1.055) ** 2.4 || 0;\n });\n};\n\n/**\n * Convert P3 Linear to P3\n *\n * @param p3l\n */\nexport const p3Linear2p3 = (p3l: [number, number, number]): number[] => {\n return srgbLinear2rgb(p3l);\n};\n\n/**\n * Convert P3 to XYZ\n *\n * @param args\n */\nexport const p3ToXYZ = (args: number[]): number[] => {\n const p3_linear = p32p3Linear([args[0], args[1], args[2]]);\n return p3LinearToXyz([p3_linear[0], p3_linear[1], p3_linear[2]]);\n};\n\n/**\n * Convert XYZ to P3\n *\n * @param args\n */\nexport const p3FromXYZ = (args: [number, number, number, number]): [number, number, number, number] => {\n const [r, g, b] = p3Linear2p3(xyzToP3Linear([args[0], args[1], args[2]]));\n return [r, g, b, args[3]];\n};\n\n/**\n * Convert P3 to SRGB and Pack\n *\n * @param args\n */\nexport const convertP3 = (args: number[]): number => {\n const xyz = p3ToXYZ([args[0], args[1], args[2]]);\n return packXYZ([xyz[0], xyz[1], xyz[2], args[3]]);\n};\n","/**\n * A98-RGB related functions\n */\n\nimport { multiplyMatrices, packSrgbLinear } from '../color-utilities';\nimport { xyz2rgbLinear } from './srgb';\n\n/**\n * Convert XYZ to a98 linear\n *\n * @param xyz\n */\nexport const xyz2a98Linear = (xyz: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 2.0415879038107465, -0.5650069742788596, -0.34473135077832956, -0.9692436362808795, 1.8759675015077202,\n 0.04155505740717557, 0.013444280632031142, -0.11836239223101838, 1.0151749943912054\n ],\n xyz\n );\n};\n\n/**\n * Convert XYZ to a98 linear\n *\n * @param a98\n */\nexport const a98Linear2xyz = (a98: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 0.5766690429101305, 0.1855582379065463, 0.1882286462349947, 0.29734497525053605, 0.6273635662554661,\n 0.0752914584939978, 0.02703136138641234, 0.07068885253582723, 0.9913375368376388\n ],\n a98\n );\n};\n\n/**\n * Convert A98 RGB to rgb linear\n *\n * @param rgb\n */\nexport const a982a98Linear = (rgb: [number, number, number]): [number, number, number] => {\n const mapped = rgb.map((c: number) => {\n const sign = c < 0 ? -1 : 1,\n abs = Math.abs(c);\n return sign * abs ** (563 / 256);\n });\n\n return [mapped[0], mapped[1], mapped[2]];\n};\n\n/**\n * Convert A98 RGB Linear to A98\n *\n * @param rgb\n */\nexport const a98Linear2a98 = (rgb: [number, number, number]): [number, number, number] => {\n const mapped = rgb.map((c: number) => {\n const sign = c < 0 ? -1 : 1,\n abs = Math.abs(c);\n return sign * abs ** (256 / 563);\n });\n\n return [mapped[0], mapped[1], mapped[2]];\n};\n\n/**\n * Convert XYZ to A98\n *\n * @param args\n */\nexport const a98FromXYZ = (args: [number, number, number, number]): [number, number, number, number] => {\n const [r, g, b] = a98Linear2a98(xyz2a98Linear([args[0], args[1], args[2]]));\n return [r, g, b, args[3]];\n};\n\n/**\n * Convert A98 to XYZ and Pack\n *\n * @param args\n */\nexport const convertA98rgb = (args: number[]): number => {\n const srgb_linear = xyz2rgbLinear(a98Linear2xyz(a982a98Linear([args[0], args[1], args[2]])));\n return packSrgbLinear([srgb_linear[0], srgb_linear[1], srgb_linear[2], args[3]]);\n};\n","/**\n * Pro Photo related functions\n */\n\nimport { d50toD65, d65toD50, multiplyMatrices, packXYZ } from '../color-utilities';\n\n/**\n * Convert linear-light display-p3 to XYZ D65\n *\n * @param p3\n */\nexport const proPhotoLinearToXyz = (p3: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 0.7977666449006423, 0.13518129740053308, 0.0313477341283922, 0.2880748288194013, 0.711835234241873,\n 0.00008993693872564, 0.0, 0.0, 0.8251046025104602\n ],\n p3\n );\n};\n\n/**\n * Convert XYZ D65 to linear-light display-p3\n *\n * @param xyz\n */\nexport const xyzToProPhotoLinear = (xyz: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 1.3457868816471583, -0.25557208737979464, -0.05110186497554526, -0.5446307051249019, 1.5082477428451468,\n 0.02052744743642139, 0.0, 0.0, 1.2119675456389452\n ],\n xyz\n );\n};\n\n/**\n * Convert Pro-Photo to Pro-Photo Linear\n *\n * @param p3\n */\nexport const proPhotoToProPhotoLinear = (p3: [number, number, number]): number[] => {\n return p3.map((c: number) => {\n return c < 16 / 512 ? c / 16 : c ** 1.8;\n });\n};\n\n/**\n * Convert Pro-Photo Linear to Pro-Photo\n *\n * @param p3\n */\nexport const proPhotoLinearToProPhoto = (p3: [number, number, number]): number[] => {\n return p3.map((c: number) => {\n return c > 1 / 512 ? c ** (1 / 1.8) : c * 16;\n });\n};\n\n/**\n * Convert Pro-Photo to XYZ\n *\n * @param args\n */\nexport const proPhotoToXYZ = (args: number[]): [number, number, number] => {\n const prophoto_linear = proPhotoToProPhotoLinear([args[0], args[1], args[2]]);\n return d50toD65(proPhotoLinearToXyz([prophoto_linear[0], prophoto_linear[1], prophoto_linear[2]]));\n};\n\n/**\n * Convert XYZ to Pro-Photo\n *\n * @param args\n */\nexport const proPhotoFromXYZ = (args: [number, number, number, number]): [number, number, number, number] => {\n const [r, g, b] = proPhotoLinearToProPhoto(xyzToProPhotoLinear(d65toD50([args[0], args[1], args[2]])));\n return [r, g, b, args[3]];\n};\n\n/**\n * Convert Pro-Photo to XYZ and Pack\n *\n * @param args\n */\nexport const convertProPhoto = (args: number[]): number => {\n const xyz = proPhotoToXYZ([args[0], args[1], args[2]]);\n return packXYZ([xyz[0], xyz[1], xyz[2], args[3]]);\n};\n","/**\n * REC2020 related functions\n */\n\nimport { multiplyMatrices, packXYZ } from '../color-utilities';\n\nconst _a = 1.09929682680944;\nconst _b = 0.018053968510807;\n\n/**\n * Convert rec2020 to rec2020 linear\n *\n * @param rgb\n */\nexport const rec20202rec2020Linear = (rgb: [number, number, number]): number[] => {\n return rgb.map(function (c) {\n return c < _b * 4.5 ? c / 4.5 : Math.pow((c + _a - 1) / _a, 1 / 0.45);\n });\n};\n\n/**\n * Convert rec2020 linear to rec2020\n *\n * @param rgb\n */\nexport const rec2020Linear2rec2020 = (rgb: [number, number, number]): number[] => {\n return rgb.map(function (c) {\n return c >= _b ? _a * Math.pow(c, 0.45) - (_a - 1) : 4.5 * c;\n });\n};\n\n/**\n * Convert rec2020 linear to XYZ D65\n *\n * @param rec\n */\nexport const rec2020LinearToXyz = (rec: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 0.6369580483012914, 0.14461690358620832, 0.1688809751641721, 0.2627002120112671, 0.6779980715188708,\n 0.05930171646986196, 0.0, 0.028072693049087428, 1.060985057710791\n ],\n rec\n );\n};\n\n/**\n * Convert XYZ D65 to rec2020 linear\n *\n * @param xyz\n */\nexport const xyzToRec2020Linear = (xyz: [number, number, number]): [number, number, number] => {\n return multiplyMatrices(\n [\n 1.716651187971268, -0.355670783776392, -0.25336628137366, -0.666684351832489, 1.616481236634939,\n 0.0157685458139111, 0.017639857445311, -0.042770613257809, 0.942103121235474\n ],\n xyz\n );\n};\n\n/**\n * Convert Rec2020 to XYZ\n *\n * @param args\n */\nexport const rec2020ToXYZ = (args: number[]): [number, number, number] => {\n const rec2020_linear = rec20202rec2020Linear([args[0], args[1], args[2]]);\n return rec2020LinearToXyz([rec2020_linear[0], rec2020_linear[1], rec2020_linear[2]]);\n};\n\n/**\n * Convert XYZ to Rec2020\n *\n * @param args\n */\nexport const rec2020FromXYZ = (args: [number, number, number, number]): [number, number, number, number] => {\n const [r, g, b] = rec2020Linear2rec2020(xyzToRec2020Linear([args[0], args[1], args[2]]));\n return [r, g, b, args[3]];\n};\n\n/**\n * Convert Rec2020 to SRGB and Pack\n *\n * @param args\n */\nexport const convertRec2020 = (args: number[]): number => {\n const xyz = rec2020ToXYZ([args[0], args[1], args[2]]);\n return packXYZ([xyz[0], xyz[1], xyz[2], args[3]]);\n};\n","import { CSSValue, isIdentToken, isNumberToken, nonFunctionArgSeparator, Parser } from '../syntax/parser';\nimport { HashToken, TokenType } from '../syntax/tokenizer';\nimport { ITypeDescriptor } from '../ITypeDescriptor';\nimport { Context } from '../../core/context';\nimport { srgbFromXYZ, srgbLinearFromXYZ } from './color-spaces/srgb';\nimport {\n packSrgbLinear,\n packSrgb,\n packHSL,\n packLch,\n packOkLch,\n packOkLab,\n packLab,\n isRelativeTransform,\n pack,\n getTokenColorValue,\n convertXyz,\n convertXyz50,\n rgbToXyz,\n hslToXyz,\n labToXyz,\n lchToXyz,\n oklabToXyz,\n oklchToXyz,\n xyzFromXYZ,\n xyz50FromXYZ\n} from './color-utilities';\nimport { convertP3, p3FromXYZ } from './color-spaces/p3';\nimport { a98FromXYZ, convertA98rgb } from './color-spaces/a98';\nimport { convertProPhoto, proPhotoFromXYZ } from './color-spaces/pro-photo';\nimport { convertRec2020, rec2020FromXYZ } from './color-spaces/rec2020';\n\nexport type Color = number;\n\nexport const color: ITypeDescriptor<Color> = {\n name: 'color',\n parse: (context: Context, value: CSSValue): Color => {\n if (value.type === TokenType.FUNCTION) {\n const colorFunction = SUPPORTED_COLOR_FUNCTIONS[value.name];\n if (typeof colorFunction === 'undefined') {\n throw new Error(`Attempting to parse an unsupported color function \"${value.name}\"`);\n }\n return colorFunction(context, value.values);\n }\n\n if (value.type === TokenType.HASH_TOKEN) {\n const [r, g, b, a] = hash2rgb(value);\n return pack(r, g, b, a);\n }\n\n if (value.type === TokenType.IDENT_TOKEN) {\n const namedColor = COLORS[value.value.toUpperCase()];\n if (typeof namedColor !== 'undefined') {\n return namedColor;\n }\n }\n\n return COLORS.TRANSPARENT;\n }\n};\n\nconst hash2rgb = (token: HashToken): [number, number, number, number] => {\n if (token.value.length === 3) {\n const r = token.value.substring(0, 1);\n const g = token.value.substring(1, 2);\n const b = token.value.substring(2, 3);\n return [parseInt(r + r, 16), parseInt(g + g, 16), parseInt(b + b, 16), 1];\n }\n\n if (token.value.length === 4) {\n const r = token.value.substring(0, 1);\n const g = token.value.substring(1, 2);\n const b = token.value.substring(2, 3);\n const a = token.value.substring(3, 4);\n return [parseInt(r + r, 16), parseInt(g + g, 16), parseInt(b + b, 16), parseInt(a + a, 16) / 255];\n }\n\n if (token.value.length === 6) {\n const r = token.value.substring(0, 2);\n const g = token.value.substring(2, 4);\n const b = token.value.substring(4, 6);\n return [parseInt(r, 16), parseInt(g, 16), parseInt(b, 16), 1];\n }\n\n if (token.value.length === 8) {\n const r = token.value.substring(0, 2);\n const g = token.value.substring(2, 4);\n const b = token.value.substring(4, 6);\n const a = token.value.substring(6, 8);\n return [parseInt(r, 16), parseInt(g, 16), parseInt(b, 16), parseInt(a, 16) / 255];\n }\n\n return [0, 0, 0, 1];\n};\n\nconst rgb = (_context: Context, args: CSSValue[]): number => {\n const tokens = args.filter(nonFunctionArgSeparator);\n\n if (isRelativeTransform(tokens)) {\n throw new Error('Relative color not supported for rgb()');\n }\n\n if (tokens.length === 3) {\n const [r, g, b] = tokens.map(getTokenColorValue);\n return pack(r, g, b, 1);\n }\n\n if (tokens.length === 4) {\n const [r, g, b, a] = tokens.map(getTokenColorValue);\n return pack(r, g, b, a);\n }\n\n // Handle modern CSS syntax with / separator: rgb(r g b / alpha)\n // tokens[0] = r, tokens[1] = g, tokens[2] = b, tokens[3] = '/', tokens[4] = alpha\n if (tokens.length === 5 && tokens[3].type === TokenType.DELIM_TOKEN && tokens[3].value === '/') {\n const r = getTokenColorValue(tokens[0], 0);\n const g = getTokenColorValue(tokens[1], 1);\n const b = getTokenColorValue(tokens[2], 2);\n const a = getTokenColorValue(tokens[4], 3);\n return pack(r, g, b, a);\n }\n\n return 0;\n};\n\n/**\n * Handle the CSS color() function\n *\n * @param context\n * @param args\n */\nconst _color = (context: Context, args: CSSValue[]) => {\n const tokens = args.filter(nonFunctionArgSeparator),\n token_1_value = tokens[0].type === TokenType.IDENT_TOKEN ? tokens[0].value : 'unknown',\n is_absolute = !isRelativeTransform(tokens);\n\n if (is_absolute) {\n const color_space = token_1_value,\n colorSpaceFunction = SUPPORTED_COLOR_SPACES_ABSOLUTE[color_space];\n if (typeof colorSpaceFunction === 'undefined') {\n throw new Error(`Attempting to parse an unsupported color space \"${color_space}\" for color() function`);\n }\n const c1 = isNumberToken(tokens[1]) ? tokens[1].number : 0,\n c2 = isNumberToken(tokens[2]) ? tokens[2].number : 0,\n c3 = isNumberToken(tokens[3]) ? tokens[3].number : 0,\n a =\n tokens.length > 4 &&\n tokens[4].type === TokenType.DELIM_TOKEN &&\n tokens[4].value === '/' &&\n isNumberToken(tokens[5])\n ? tokens[5].number\n : 1;\n\n return colorSpaceFunction([c1, c2, c3, a]);\n } else {\n const extractComponent = (color: [number, number, number, number], token: CSSValue) => {\n if (isNumberToken(token)) {\n return token.number;\n }\n\n const posFromVal = (value: string): number => {\n return value === 'r' || value === 'x' ? 0 : value === 'g' || value === 'y' ? 1 : 2;\n };\n\n if (isIdentToken(token)) {\n const position = posFromVal(token.value);\n return color[position];\n }\n\n const parseCalc = (args: CSSValue[]): string => {\n const parts = args.filter(nonFunctionArgSeparator);\n let expression = '(';\n for (const part of parts) {\n expression +=\n part.type === TokenType.FUNCTION && part.name === 'calc'\n ? parseCalc(part.values)\n : isNumberToken(part)\n ? part.number\n : part.type === TokenType.DELIM_TOKEN || isIdentToken(part)\n ? part.value\n : '';\n }\n expression += ')';\n return expression;\n };\n\n if (token.type === TokenType.FUNCTION) {\n const args = token.values.filter(nonFunctionArgSeparator);\n if (token.name === 'calc') {\n const expression = parseCalc(args)\n .replace(/r|x/, color[0].toString())\n .replace(/g|y/, color[1].toString())\n .replace(/b|z/, color[2].toString());\n\n return new Function('return ' + expression)();\n }\n }\n\n return null;\n };\n\n const from_colorspace =\n tokens[1].type === TokenType.FUNCTION\n ? tokens[1].name\n : isIdentToken(tokens[1]) || tokens[1].type === TokenType.HASH_TOKEN\n ? 'rgb'\n : 'unknown',\n to_colorspace = isIdentToken(tokens[2]) ? tokens[2].value : 'unknown';\n\n let from =\n tokens[1].type === TokenType.FUNCTION ? tokens[1].values : isIdentToken(tokens[1]) ? [tokens[1]] : [];\n\n if (isIdentToken(tokens[1])) {\n const named_color = COLORS[tokens[1].value.toUpperCase()];\n if (typeof named_color === 'undefined') {\n throw new Error(`Attempting to use unknown color in relative color 'from'`);\n } else {\n const _c = parseColor(context, tokens[1].value),\n alpha = 0xff & _c,\n blue = 0xff & (_c >> 8),\n green = 0xff & (_c >> 16),\n red = 0xff & (_c >> 24);\n from = [\n { type: TokenType.NUMBER_TOKEN, number: red, flags: 1 },\n { type: TokenType.NUMBER_TOKEN, number: green, flags: 1 },\n { type: TokenType.NUMBER_TOKEN, number: blue, flags: 1 },\n { type: TokenType.NUMBER_TOKEN, number: alpha > 1 ? alpha / 255 : alpha, flags: 1 }\n ];\n }\n } else if (tokens[1].type === TokenType.HASH_TOKEN) {\n const [red, green, blue, alpha] = hash2rgb(tokens[1]);\n from = [\n { type: TokenType.NUMBER_TOKEN, number: red, flags: 1 },\n { type: TokenType.NUMBER_TOKEN, number: green, flags: 1 },\n { type: TokenType.NUMBER_TOKEN, number: blue, flags: 1 },\n { type: TokenType.NUMBER_TOKEN, number: alpha > 1 ? alpha / 255 : alpha, flags: 1 }\n ];\n }\n\n if (from.length === 0) {\n throw new Error(`Attempting to use unknown color in relative color 'from'`);\n }\n\n if (to_colorspace === 'unknown') {\n throw new Error(`Attempting to use unknown colorspace in relative color 'to'`);\n }\n\n const fromColorToXyz = SUPPORTED_COLOR_SPACES_TO_XYZ[from_colorspace],\n toColorFromXyz = SUPPORTED_COLOR_SPACES_FROM_XYZ[to_colorspace],\n toColorPack = SUPPORTED_COLOR_SPACES_ABSOLUTE[to_colorspace];\n\n if (typeof fromColorToXyz === 'undefined') {\n throw new Error(`Attempting to parse an unsupported color space \"${from_colorspace}\" for color() function`);\n }\n if (typeof toColorFromXyz === 'undefined') {\n throw new Error(`Attempting to parse an unsupported color space \"${to_colorspace}\" for color() function`);\n }\n\n const from_color: [number, number, number, number] = fromColorToXyz(context, from),\n from_final_colorspace: [number, number, number, number] = toColorFromXyz(from_color),\n c1 = extractComponent(from_final_colorspace, tokens[3]),\n c2 = extractComponent(from_final_colorspace, tokens[4]),\n c3 = extractComponent(from_final_colorspace, tokens[5]),\n a =\n tokens.length > 6 &&\n tokens[6].type === TokenType.DELIM_TOKEN &&\n tokens[6].value === '/' &&\n isNumberToken(tokens[7])\n ? tokens[7].number\n : 1;\n if (c1 === null || c2 === null || c3 === null) {\n throw new Error(`Invalid relative color in color() function`);\n }\n\n return toColorPack([c1, c2, c3, a]);\n }\n};\n\nconst SUPPORTED_COLOR_SPACES_ABSOLUTE: {\n [key: string]: (args: number[]) => number;\n} = {\n srgb: packSrgb,\n 'srgb-linear': packSrgbLinear,\n 'display-p3': convertP3,\n 'a98-rgb': convertA98rgb,\n 'prophoto-rgb': convertProPhoto,\n xyz: convertXyz,\n 'xyz-d50': convertXyz50,\n 'xyz-d65': convertXyz,\n rec2020: convertRec2020\n};\n\nconst SUPPORTED_COLOR_SPACES_TO_XYZ: {\n [key: string]: (context: Context, args: CSSValue[]) => [number, number, number, number];\n} = {\n rgb: rgbToXyz,\n hsl: hslToXyz,\n lab: labToXyz,\n lch: lchToXyz,\n oklab: oklabToXyz,\n oklch: oklchToXyz\n};\n\nconst SUPPORTED_COLOR_SPACES_FROM_XYZ: {\n [key: string]: (args: [number, number, number, number]) => [number, number, number, number];\n} = {\n srgb: srgbFromXYZ,\n 'srgb-linear': srgbLinearFromXYZ,\n 'display-p3': p3FromXYZ,\n 'a98-rgb': a98FromXYZ,\n 'prophoto-rgb': proPhotoFromXYZ,\n xyz: xyzFromXYZ,\n 'xyz-d50': xyz50FromXYZ,\n 'xyz-d65': xyzFromXYZ,\n rec2020: rec2020FromXYZ\n};\n\nconst SUPPORTED_COLOR_FUNCTIONS: {\n [key: string]: (context: Context, args: CSSValue[]) => number;\n} = {\n hsl: packHSL,\n hsla: packHSL,\n rgb: rgb,\n rgba: rgb,\n lch: packLch,\n oklch: packOkLch,\n oklab: packOkLab,\n lab: packLab,\n color: _color\n};\n\nexport const parseColor = (context: Context, value: string): Color =>\n color.parse(context, Parser.create(value).parseComponentValue());\n\nexport const COLORS: { [key: string]: Color } = {\n ALICEBLUE: 0xf0f8ffff,\n ANTIQUEWHITE: 0xfaebd7ff,\n AQUA: 0x00ffffff,\n AQUAMARINE: 0x7fffd4ff,\n AZURE: 0xf0ffffff,\n BEIGE: 0xf5f5dcff,\n BISQUE: 0xffe4c4ff,\n BLACK: 0x000000ff,\n BLANCHEDALMOND: 0xffebcdff,\n BLUE: 0x0000ffff,\n BLUEVIOLET: 0x8a2be2ff,\n BROWN: 0xa52a2aff,\n BURLYWOOD: 0xdeb887ff,\n CADETBLUE: 0x5f9ea0ff,\n CHARTREUSE: 0x7fff00ff,\n CHOCOLATE: 0xd2691eff,\n CORAL: 0xff7f50ff,\n CORNFLOWERBLUE: 0x6495edff,\n CORNSILK: 0xfff8dcff,\n CRIMSON: 0xdc143cff,\n CYAN: 0x00ffffff,\n DARKBLUE: 0x00008bff,\n DARKCYAN: 0x008b8bff,\n DARKGOLDENROD: 0xb886bbff,\n DARKGRAY: 0xa9a9a9ff,\n DARKGREEN: 0x006400ff,\n DARKGREY: 0xa9a9a9ff,\n DARKKHAKI: 0xbdb76bff,\n DARKMAGENTA: 0x8b008bff,\n DARKOLIVEGREEN: 0x556b2fff,\n DARKORANGE: 0xff8c00ff,\n DARKORCHID: 0x9932ccff,\n DARKRED: 0x8b0000ff,\n DARKSALMON: 0xe9967aff,\n DARKSEAGREEN: 0x8fbc8fff,\n DARKSLATEBLUE: 0x483d8bff,\n DARKSLATEGRAY: 0x2f4f4fff,\n DARKSLATEGREY: 0x2f4f4fff,\n DARKTURQUOISE: 0x00ced1ff,\n DARKVIOLET: 0x9400d3ff,\n DEEPPINK: 0xff1493ff,\n DEEPSKYBLUE: 0x00bfffff,\n DIMGRAY: 0x696969ff,\n DIMGREY: 0x696969ff,\n DODGERBLUE: 0x1e90ffff,\n FIREBRICK: 0xb22222ff,\n FLORALWHITE: 0xfffaf0ff,\n FORESTGREEN: 0x228b22ff,\n FUCHSIA: 0xff00ffff,\n GAINSBORO: 0xdcdcdcff,\n GHOSTWHITE: 0xf8f8ffff,\n GOLD: 0xffd700ff,\n GOLDENROD: 0xdaa520ff,\n GRAY: 0x808080ff,\n GREEN: 0x008000ff,\n GREENYELLOW: 0xadff2fff,\n GREY: 0x808080ff,\n HONEYDEW: 0xf0fff0ff,\n HOTPINK: 0xff69b4ff,\n INDIANRED: 0xcd5c5cff,\n INDIGO: 0x4b0082ff,\n IVORY: 0xfffff0ff,\n KHAKI: 0xf0e68cff,\n LAVENDER: 0xe6e6faff,\n LAVENDERBLUSH: 0xfff0f5ff,\n LAWNGREEN: 0x7cfc00ff,\n LEMONCHIFFON: 0xfffacdff,\n LIGHTBLUE: 0xadd8e6ff,\n LIGHTCORAL: 0xf08080ff,\n LIGHTCYAN: 0xe0ffffff,\n LIGHTGOLDENRODYELLOW: 0xfafad2ff,\n LIGHTGRAY: 0xd3d3d3ff,\n LIGHTGREEN: 0x90ee90ff,\n LIGHTGREY: 0xd3d3d3ff,\n LIGHTPINK: 0xffb6c1ff,\n LIGHTSALMON: 0xffa07aff,\n LIGHTSEAGREEN: 0x20b2aaff,\n LIGHTSKYBLUE: 0x87cefaff,\n LIGHTSLATEGRAY: 0x778899ff,\n LIGHTSLATEGREY: 0x778899ff,\n LIGHTSTEELBLUE: 0xb0c4deff,\n LIGHTYELLOW: 0xffffe0ff,\n LIME: 0x00ff00ff,\n LIMEGREEN: 0x32cd32ff,\n LINEN: 0xfaf0e6ff,\n MAGENTA: 0xff00ffff,\n MAROON: 0x800000ff,\n MEDIUMAQUAMARINE: 0x66cdaaff,\n MEDIUMBLUE: 0x0000cdff,\n MEDIUMORCHID: 0xba55d3ff,\n MEDIUMPURPLE: 0x9370dbff,\n MEDIUMSEAGREEN: 0x3cb371ff,\n MEDIUMSLATEBLUE: 0x7b68eeff,\n MEDIUMSPRINGGREEN: 0x00fa9aff,\n MEDIUMTURQUOISE: 0x48d1ccff,\n MEDIUMVIOLETRED: 0xc71585ff,\n MIDNIGHTBLUE: 0x191970ff,\n MINTCREAM: 0xf5fffaff,\n MISTYROSE: 0xffe4e1ff,\n MOCCASIN: 0xffe4b5ff,\n NAVAJOWHITE: 0xffdeadff,\n NAVY: 0x000080ff,\n OLDLACE: 0xfdf5e6ff,\n OLIVE: 0x808000ff,\n OLIVEDRAB: 0x6b8e23ff,\n ORANGE: 0xffa500ff,\n ORANGERED: 0xff4500ff,\n ORCHID: 0xda70d6ff,\n PALEGOLDENROD: 0xeee8aaff,\n PALEGREEN: 0x98fb98ff,\n PALETURQUOISE: 0xafeeeeff,\n PALEVIOLETRED: 0xdb7093ff,\n PAPAYAWHIP: 0xffefd5ff,\n PEACHPUFF: 0xffdab9ff,\n PERU: 0xcd853fff,\n PINK: 0xffc0cbff,\n PLUM: 0xdda0ddff,\n POWDERBLUE: 0xb0e0e6ff,\n PURPLE: 0x800080ff,\n REBECCAPURPLE: 0x663399ff,\n RED: 0xff0000ff,\n ROSYBROWN: 0xbc8f8fff,\n ROYALBLUE: 0x4169e1ff,\n SADDLEBROWN: 0x8b4513ff,\n SALMON: 0xfa8072ff,\n SANDYBROWN: 0xf4a460ff,\n SEAGREEN: 0x2e8b57ff,\n SEASHELL: 0xfff5eeff,\n SIENNA: 0xa0522dff,\n SILVER: 0xc0c0c0ff,\n SKYBLUE: 0x87ceebff,\n SLATEBLUE: 0x6a5acdff,\n SLATEGRAY: 0x708090ff,\n SLATEGREY: 0x708090ff,\n SNOW: 0xfffafaff,\n SPRINGGREEN: 0x00ff7fff,\n STEELBLUE: 0x4682b4ff,\n TAN: 0xd2b48cff,\n TEAL: 0x008080ff,\n THISTLE: 0xd8bfd8ff,\n TOMATO: 0xff6347ff,\n TRANSPARENT: 0x00000000,\n TURQUOISE: 0x40e0d0ff,\n VIOLET: 0xee82eeff,\n WHEAT: 0xf5deb3ff,\n WHITE: 0xffffffff,\n WHITESMOKE: 0xf5f5f5ff,\n YELLOW: 0xffff00ff,\n YELLOWGREEN: 0x9acd32ff\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\nexport const enum BACKGROUND_CLIP {\n BORDER_BOX = 0,\n PADDING_BOX = 1,\n CONTENT_BOX = 2\n}\n\nexport type BackgroundClip = BACKGROUND_CLIP[];\n\nexport const backgroundClip: IPropertyListDescriptor<BackgroundClip> = {\n name: 'background-clip',\n initialValue: 'border-box',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]): BackgroundClip => {\n return tokens.map((token) => {\n if (isIdentToken(token)) {\n switch (token.value) {\n case 'padding-box':\n return BACKGROUND_CLIP.PADDING_BOX;\n case 'content-box':\n return BACKGROUND_CLIP.CONTENT_BOX;\n }\n }\n return BACKGROUND_CLIP.BORDER_BOX;\n });\n }\n};\n","import { IPropertyTypeValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\n\nexport const backgroundColor: IPropertyTypeValueDescriptor = {\n name: `background-color`,\n initialValue: 'transparent',\n prefix: false,\n type: PropertyDescriptorParsingType.TYPE_VALUE,\n format: 'color'\n};\n","import { CSSValue } from '../../syntax/parser';\nimport {\n CSSRadialExtent,\n CSSRadialGradientImage,\n CSSRadialShape,\n GradientColorStop,\n GradientCorner,\n UnprocessedGradientColorStop\n} from '../image';\nimport { color as colorType } from '../color';\nimport { getAbsoluteValue, HUNDRED_PERCENT, isLengthPercentage, ZERO_LENGTH } from '../length-percentage';\nimport { Context } from '../../../core/context';\n\nexport const parseColorStop = (context: Context, args: CSSValue[]): UnprocessedGradientColorStop => {\n const color = colorType.parse(context, args[0]);\n const stop = args[1];\n return stop && isLengthPercentage(stop) ? { color, stop } : { color, stop: null };\n};\n\nexport const processColorStops = (stops: UnprocessedGradientColorStop[], lineLength: number): GradientColorStop[] => {\n const first = stops[0];\n const last = stops[stops.length - 1];\n if (first.stop === null) {\n first.stop = ZERO_LENGTH;\n }\n\n if (last.stop === null) {\n last.stop = HUNDRED_PERCENT;\n }\n\n const processStops: (number | null)[] = [];\n let previous = 0;\n for (let i = 0; i < stops.length; i++) {\n const stop = stops[i].stop;\n if (stop !== null) {\n const absoluteValue = getAbsoluteValue(stop, lineLength);\n if (absoluteValue > previous) {\n processStops.push(absoluteValue);\n } else {\n processStops.push(previous);\n }\n previous = absoluteValue;\n } else {\n processStops.push(null);\n }\n }\n\n let gapBegin = null;\n for (let i = 0; i < processStops.length; i++) {\n const stop = processStops[i];\n if (stop === null) {\n if (gapBegin === null) {\n gapBegin = i;\n }\n } else if (gapBegin !== null) {\n const gapLength = i - gapBegin;\n const beforeGap = processStops[gapBegin - 1] as number;\n const gapValue = (stop - beforeGap) / (gapLength + 1);\n for (let g = 1; g <= gapLength; g++) {\n processStops[gapBegin + g - 1] = gapValue * g;\n }\n gapBegin = null;\n }\n }\n\n return stops.map(({ color }, i) => {\n return { color, stop: Math.max(Math.min(1, (processStops[i] as number) / lineLength), 0) };\n });\n};\n\nconst getAngleFromCorner = (corner: GradientCorner, width: number, height: number): number => {\n const centerX = width / 2;\n const centerY = height / 2;\n const x = getAbsoluteValue(corner[0], width) - centerX;\n const y = centerY - getAbsoluteValue(corner[1], height);\n\n return (Math.atan2(y, x) + Math.PI * 2) % (Math.PI * 2);\n};\n\nexport const calculateGradientDirection = (\n angle: number | GradientCorner,\n width: number,\n height: number\n): [number, number, number, number, number] => {\n const radian = typeof angle === 'number' ? angle : getAngleFromCorner(angle, width, height);\n\n const lineLength = Math.abs(width * Math.sin(radian)) + Math.abs(height * Math.cos(radian));\n\n const halfWidth = width / 2;\n const halfHeight = height / 2;\n const halfLineLength = lineLength / 2;\n\n const yDiff = Math.sin(radian - Math.PI / 2) * halfLineLength;\n const xDiff = Math.cos(radian - Math.PI / 2) * halfLineLength;\n\n return [lineLength, halfWidth - xDiff, halfWidth + xDiff, halfHeight - yDiff, halfHeight + yDiff];\n};\n\nconst distance = (a: number, b: number): number => Math.sqrt(a * a + b * b);\n\nconst findCorner = (width: number, height: number, x: number, y: number, closest: boolean): [number, number] => {\n const corners = [\n [0, 0],\n [0, height],\n [width, 0],\n [width, height]\n ];\n\n return corners.reduce(\n (stat, corner) => {\n const [cx, cy] = corner;\n const d = distance(x - cx, y - cy);\n if (closest ? d < stat.optimumDistance : d > stat.optimumDistance) {\n return {\n optimumCorner: corner,\n optimumDistance: d\n };\n }\n\n return stat;\n },\n {\n optimumDistance: closest ? Infinity : -Infinity,\n optimumCorner: null\n }\n ).optimumCorner as [number, number];\n};\n\nexport const calculateRadius = (\n gradient: CSSRadialGradientImage,\n x: number,\n y: number,\n width: number,\n height: number\n): [number, number] => {\n let rx = 0;\n let ry = 0;\n\n switch (gradient.size) {\n case CSSRadialExtent.CLOSEST_SIDE:\n // The ending shape is sized so that that it exactly meets the side of the gradient box closest to the gradient’s center.\n // If the shape is an ellipse, it exactly meets the closest side in each dimension.\n if (gradient.shape === CSSRadialShape.CIRCLE) {\n rx = ry = Math.min(Math.abs(x), Math.abs(x - width), Math.abs(y), Math.abs(y - height));\n } else if (gradient.shape === CSSRadialShape.ELLIPSE) {\n rx = Math.min(Math.abs(x), Math.abs(x - width));\n ry = Math.min(Math.abs(y), Math.abs(y - height));\n }\n break;\n\n case CSSRadialExtent.CLOSEST_CORNER:\n // The ending shape is sized so that that it passes through the corner of the gradient box closest to the gradient’s center.\n // If the shape is an ellipse, the ending shape is given the same aspect-ratio it would have if closest-side were specified.\n if (gradient.shape === CSSRadialShape.CIRCLE) {\n rx = ry = Math.min(\n distance(x, y),\n distance(x, y - height),\n distance(x - width, y),\n distance(x - width, y - height)\n );\n } else if (gradient.shape === CSSRadialShape.ELLIPSE) {\n // Compute the ratio ry/rx (which is to be the same as for \"closest-side\")\n const c = Math.min(Math.abs(y), Math.abs(y - height)) / Math.min(Math.abs(x), Math.abs(x - width));\n const [cx, cy] = findCorner(width, height, x, y, true);\n rx = distance(cx - x, (cy - y) / c);\n ry = c * rx;\n }\n break;\n\n case CSSRadialExtent.FARTHEST_SIDE:\n // Same as closest-side, except the ending shape is sized based on the farthest side(s)\n if (gradient.shape === CSSRadialShape.CIRCLE) {\n rx = ry = Math.max(Math.abs(x), Math.abs(x - width), Math.abs(y), Math.abs(y - height));\n } else if (gradient.shape === CSSRadialShape.ELLIPSE) {\n rx = Math.max(Math.abs(x), Math.abs(x - width));\n ry = Math.max(Math.abs(y), Math.abs(y - height));\n }\n break;\n\n case CSSRadialExtent.FARTHEST_CORNER:\n // Same as closest-corner, except the ending shape is sized based on the farthest corner.\n // If the shape is an ellipse, the ending shape is given the same aspect ratio it would have if farthest-side were specified.\n if (gradient.shape === CSSRadialShape.CIRCLE) {\n rx = ry = Math.max(\n distance(x, y),\n distance(x, y - height),\n distance(x - width, y),\n distance(x - width, y - height)\n );\n } else if (gradient.shape === CSSRadialShape.ELLIPSE) {\n // Compute the ratio ry/rx (which is to be the same as for \"farthest-side\")\n const c = Math.max(Math.abs(y), Math.abs(y - height)) / Math.max(Math.abs(x), Math.abs(x - width));\n const [cx, cy] = findCorner(width, height, x, y, false);\n rx = distance(cx - x, (cy - y) / c);\n ry = c * rx;\n }\n break;\n }\n\n if (Array.isArray(gradient.size)) {\n rx = getAbsoluteValue(gradient.size[0], width);\n ry = gradient.size.length === 2 ? getAbsoluteValue(gradient.size[1], height) : rx;\n }\n\n return [rx, ry];\n};\n","import { CSSValue, parseFunctionArgs } from '../../syntax/parser';\nimport { TokenType } from '../../syntax/tokenizer';\nimport { isAngle, angle as angleType, parseNamedSide, deg } from '../angle';\nimport { CSSImageType, CSSLinearGradientImage, GradientCorner, UnprocessedGradientColorStop } from '../image';\nimport { parseColorStop } from './gradient';\nimport { Context } from '../../../core/context';\n\nexport const linearGradient = (context: Context, tokens: CSSValue[]): CSSLinearGradientImage => {\n let angle: number | GradientCorner = deg(180);\n const stops: UnprocessedGradientColorStop[] = [];\n\n parseFunctionArgs(tokens).forEach((arg, i) => {\n if (i === 0) {\n const firstToken = arg[0];\n if (firstToken.type === TokenType.IDENT_TOKEN && firstToken.value === 'to') {\n angle = parseNamedSide(arg);\n return;\n } else if (isAngle(firstToken)) {\n angle = angleType.parse(context, firstToken);\n return;\n }\n }\n const colorStop = parseColorStop(context, arg);\n stops.push(colorStop);\n });\n\n return { angle, stops, type: CSSImageType.LINEAR_GRADIENT };\n};\n","import { CSSValue, parseFunctionArgs } from '../../syntax/parser';\nimport { CSSImageType, CSSLinearGradientImage, GradientCorner, UnprocessedGradientColorStop } from '../image';\nimport { TokenType } from '../../syntax/tokenizer';\nimport { isAngle, angle as angleType, parseNamedSide, deg } from '../angle';\nimport { parseColorStop } from './gradient';\nimport { Context } from '../../../core/context';\n\nexport const prefixLinearGradient = (context: Context, tokens: CSSValue[]): CSSLinearGradientImage => {\n let angle: number | GradientCorner = deg(180);\n const stops: UnprocessedGradientColorStop[] = [];\n\n parseFunctionArgs(tokens).forEach((arg, i) => {\n if (i === 0) {\n const firstToken = arg[0];\n if (\n firstToken.type === TokenType.IDENT_TOKEN &&\n ['top', 'left', 'right', 'bottom'].indexOf(firstToken.value) !== -1\n ) {\n angle = parseNamedSide(arg);\n return;\n } else if (isAngle(firstToken)) {\n angle = (angleType.parse(context, firstToken) + deg(270)) % deg(360);\n return;\n }\n }\n const colorStop = parseColorStop(context, arg);\n stops.push(colorStop);\n });\n\n return {\n angle,\n stops,\n type: CSSImageType.LINEAR_GRADIENT\n };\n};\n","import { CSSValue, isIdentToken, isNumberToken, nonFunctionArgSeparator, parseFunctionArgs } from '../../syntax/parser';\nimport {\n CSSImageType,\n CSSLinearGradientImage,\n CSSRadialExtent,\n CSSRadialGradientImage,\n CSSRadialShape,\n CSSRadialSize,\n UnprocessedGradientColorStop\n} from '../image';\nimport { deg } from '../angle';\nimport { TokenType } from '../../syntax/tokenizer';\nimport { color as colorType } from '../color';\nimport { HUNDRED_PERCENT, LengthPercentage, ZERO_LENGTH } from '../length-percentage';\nimport { Context } from '../../../core/context';\n\nexport const webkitGradient = (\n context: Context,\n tokens: CSSValue[]\n): CSSLinearGradientImage | CSSRadialGradientImage => {\n const angle = deg(180);\n const stops: UnprocessedGradientColorStop[] = [];\n let type = CSSImageType.LINEAR_GRADIENT;\n const shape: CSSRadialShape = CSSRadialShape.CIRCLE;\n const size: CSSRadialSize = CSSRadialExtent.FARTHEST_CORNER;\n const position: LengthPercentage[] = [];\n parseFunctionArgs(tokens).forEach((arg, i) => {\n const firstToken = arg[0];\n if (i === 0) {\n if (isIdentToken(firstToken) && firstToken.value === 'linear') {\n type = CSSImageType.LINEAR_GRADIENT;\n return;\n } else if (isIdentToken(firstToken) && firstToken.value === 'radial') {\n type = CSSImageType.RADIAL_GRADIENT;\n return;\n }\n }\n\n if (firstToken.type === TokenType.FUNCTION) {\n if (firstToken.name === 'from') {\n const color = colorType.parse(context, firstToken.values[0]);\n stops.push({ stop: ZERO_LENGTH, color });\n } else if (firstToken.name === 'to') {\n const color = colorType.parse(context, firstToken.values[0]);\n stops.push({ stop: HUNDRED_PERCENT, color });\n } else if (firstToken.name === 'color-stop') {\n const values = firstToken.values.filter(nonFunctionArgSeparator);\n if (values.length === 2) {\n const color = colorType.parse(context, values[1]);\n const stop = values[0];\n if (isNumberToken(stop)) {\n stops.push({\n stop: { type: TokenType.PERCENTAGE_TOKEN, number: stop.number * 100, flags: stop.flags },\n color\n });\n }\n }\n }\n }\n });\n\n return type === CSSImageType.LINEAR_GRADIENT\n ? {\n angle: (angle + deg(180)) % deg(360),\n stops,\n type\n }\n : { size, shape, stops, position, type };\n};\n","import { CSSValue, isIdentToken, parseFunctionArgs } from '../../syntax/parser';\nimport {\n CSSImageType,\n CSSRadialExtent,\n CSSRadialGradientImage,\n CSSRadialShape,\n CSSRadialSize,\n UnprocessedGradientColorStop\n} from '../image';\nimport { parseColorStop } from './gradient';\nimport {\n FIFTY_PERCENT,\n HUNDRED_PERCENT,\n isLengthPercentage,\n LengthPercentage,\n ZERO_LENGTH\n} from '../length-percentage';\nimport { isLength } from '../length';\nimport { Context } from '../../../core/context';\nexport const CLOSEST_SIDE = 'closest-side';\nexport const FARTHEST_SIDE = 'farthest-side';\nexport const CLOSEST_CORNER = 'closest-corner';\nexport const FARTHEST_CORNER = 'farthest-corner';\nexport const CIRCLE = 'circle';\nexport const ELLIPSE = 'ellipse';\nexport const COVER = 'cover';\nexport const CONTAIN = 'contain';\n\nexport const radialGradient = (context: Context, tokens: CSSValue[]): CSSRadialGradientImage => {\n let shape: CSSRadialShape = CSSRadialShape.CIRCLE;\n let size: CSSRadialSize = CSSRadialExtent.FARTHEST_CORNER;\n const stops: UnprocessedGradientColorStop[] = [];\n const position: LengthPercentage[] = [];\n parseFunctionArgs(tokens).forEach((arg, i) => {\n let isColorStop = true;\n if (i === 0) {\n let isAtPosition = false;\n isColorStop = arg.reduce((acc, token) => {\n if (isAtPosition) {\n if (isIdentToken(token)) {\n switch (token.value) {\n case 'center':\n position.push(FIFTY_PERCENT);\n return acc;\n case 'top':\n case 'left':\n position.push(ZERO_LENGTH);\n return acc;\n case 'right':\n case 'bottom':\n position.push(HUNDRED_PERCENT);\n return acc;\n }\n } else if (isLengthPercentage(token) || isLength(token)) {\n position.push(token);\n }\n } else if (isIdentToken(token)) {\n switch (token.value) {\n case CIRCLE:\n shape = CSSRadialShape.CIRCLE;\n return false;\n case ELLIPSE:\n shape = CSSRadialShape.ELLIPSE;\n return false;\n case 'at':\n isAtPosition = true;\n return false;\n case CLOSEST_SIDE:\n size = CSSRadialExtent.CLOSEST_SIDE;\n return false;\n case COVER:\n case FARTHEST_SIDE:\n size = CSSRadialExtent.FARTHEST_SIDE;\n return false;\n case CONTAIN:\n case CLOSEST_CORNER:\n size = CSSRadialExtent.CLOSEST_CORNER;\n return false;\n case FARTHEST_CORNER:\n size = CSSRadialExtent.FARTHEST_CORNER;\n return false;\n }\n } else if (isLength(token) || isLengthPercentage(token)) {\n if (!Array.isArray(size)) {\n size = [];\n }\n size.push(token);\n return false;\n }\n return acc;\n }, isColorStop);\n }\n\n if (isColorStop) {\n const colorStop = parseColorStop(context, arg);\n stops.push(colorStop);\n }\n });\n\n return { size, shape, stops, position, type: CSSImageType.RADIAL_GRADIENT };\n};\n","import { CSSValue, isIdentToken, parseFunctionArgs } from '../../syntax/parser';\nimport {\n CSSImageType,\n CSSRadialExtent,\n CSSRadialGradientImage,\n CSSRadialShape,\n CSSRadialSize,\n UnprocessedGradientColorStop\n} from '../image';\nimport { parseColorStop } from './gradient';\nimport {\n FIFTY_PERCENT,\n HUNDRED_PERCENT,\n isLengthPercentage,\n LengthPercentage,\n ZERO_LENGTH\n} from '../length-percentage';\nimport { isLength } from '../length';\nimport {\n CIRCLE,\n CLOSEST_CORNER,\n CLOSEST_SIDE,\n CONTAIN,\n COVER,\n ELLIPSE,\n FARTHEST_CORNER,\n FARTHEST_SIDE\n} from './radial-gradient';\nimport { Context } from '../../../core/context';\n\nexport const prefixRadialGradient = (context: Context, tokens: CSSValue[]): CSSRadialGradientImage => {\n let shape: CSSRadialShape = CSSRadialShape.CIRCLE;\n let size: CSSRadialSize = CSSRadialExtent.FARTHEST_CORNER;\n const stops: UnprocessedGradientColorStop[] = [];\n const position: LengthPercentage[] = [];\n\n parseFunctionArgs(tokens).forEach((arg, i) => {\n let isColorStop = true;\n if (i === 0) {\n isColorStop = arg.reduce((acc, token) => {\n if (isIdentToken(token)) {\n switch (token.value) {\n case 'center':\n position.push(FIFTY_PERCENT);\n return false;\n case 'top':\n case 'left':\n position.push(ZERO_LENGTH);\n return false;\n case 'right':\n case 'bottom':\n position.push(HUNDRED_PERCENT);\n return false;\n }\n } else if (isLengthPercentage(token) || isLength(token)) {\n position.push(token);\n return false;\n }\n\n return acc;\n }, isColorStop);\n } else if (i === 1) {\n isColorStop = arg.reduce((acc, token) => {\n if (isIdentToken(token)) {\n switch (token.value) {\n case CIRCLE:\n shape = CSSRadialShape.CIRCLE;\n return false;\n case ELLIPSE:\n shape = CSSRadialShape.ELLIPSE;\n return false;\n case CONTAIN:\n case CLOSEST_SIDE:\n size = CSSRadialExtent.CLOSEST_SIDE;\n return false;\n case FARTHEST_SIDE:\n size = CSSRadialExtent.FARTHEST_SIDE;\n return false;\n case CLOSEST_CORNER:\n size = CSSRadialExtent.CLOSEST_CORNER;\n return false;\n case COVER:\n case FARTHEST_CORNER:\n size = CSSRadialExtent.FARTHEST_CORNER;\n return false;\n }\n } else if (isLength(token) || isLengthPercentage(token)) {\n if (!Array.isArray(size)) {\n size = [];\n }\n size.push(token);\n return false;\n }\n\n return acc;\n }, isColorStop);\n }\n\n if (isColorStop) {\n const colorStop = parseColorStop(context, arg);\n stops.push(colorStop);\n }\n });\n\n return { size, shape, stops, position, type: CSSImageType.RADIAL_GRADIENT };\n};\n","import { CSSValue } from '../syntax/parser';\nimport { TokenType } from '../syntax/tokenizer';\nimport { Color } from './color';\nimport { linearGradient } from './functions/linear-gradient';\nimport { prefixLinearGradient } from './functions/-prefix-linear-gradient';\nimport { ITypeDescriptor } from '../ITypeDescriptor';\nimport { LengthPercentage } from './length-percentage';\nimport { webkitGradient } from './functions/-webkit-gradient';\nimport { radialGradient } from './functions/radial-gradient';\nimport { prefixRadialGradient } from './functions/-prefix-radial-gradient';\nimport { Context } from '../../core/context';\n\nexport const enum CSSImageType {\n URL,\n LINEAR_GRADIENT,\n RADIAL_GRADIENT\n}\n\nexport const isLinearGradient = (background: ICSSImage): background is CSSLinearGradientImage => {\n return background.type === CSSImageType.LINEAR_GRADIENT;\n};\n\nexport const isRadialGradient = (background: ICSSImage): background is CSSRadialGradientImage => {\n return background.type === CSSImageType.RADIAL_GRADIENT;\n};\n\nexport interface UnprocessedGradientColorStop {\n color: Color;\n stop: LengthPercentage | null;\n}\n\nexport interface GradientColorStop {\n color: Color;\n stop: number;\n}\n\nexport interface ICSSImage {\n type: CSSImageType;\n}\n\nexport interface CSSURLImage extends ICSSImage {\n url: string;\n type: CSSImageType.URL;\n}\n\n// interface ICSSGeneratedImage extends ICSSImage {}\n\nexport type GradientCorner = [LengthPercentage, LengthPercentage];\n\ninterface ICSSGradientImage extends ICSSImage {\n stops: UnprocessedGradientColorStop[];\n}\n\nexport interface CSSLinearGradientImage extends ICSSGradientImage {\n angle: number | GradientCorner;\n type: CSSImageType.LINEAR_GRADIENT;\n}\n\nexport const enum CSSRadialShape {\n CIRCLE,\n ELLIPSE\n}\n\nexport const enum CSSRadialExtent {\n CLOSEST_SIDE,\n FARTHEST_SIDE,\n CLOSEST_CORNER,\n FARTHEST_CORNER\n}\n\nexport type CSSRadialSize = CSSRadialExtent | LengthPercentage[];\n\nexport interface CSSRadialGradientImage extends ICSSGradientImage {\n type: CSSImageType.RADIAL_GRADIENT;\n shape: CSSRadialShape;\n size: CSSRadialSize;\n position: LengthPercentage[];\n}\n\nexport const image: ITypeDescriptor<ICSSImage> = {\n name: 'image',\n parse: (context: Context, value: CSSValue): ICSSImage => {\n if (value.type === TokenType.URL_TOKEN) {\n const image: CSSURLImage = { url: value.value, type: CSSImageType.URL };\n context.cache.addImage(value.value);\n return image;\n }\n\n if (value.type === TokenType.FUNCTION) {\n const imageFunction = SUPPORTED_IMAGE_FUNCTIONS[value.name];\n if (typeof imageFunction === 'undefined') {\n throw new Error(`Attempting to parse an unsupported image function \"${value.name}\"`);\n }\n return imageFunction(context, value.values);\n }\n\n throw new Error(`Unsupported image type ${value.type}`);\n }\n};\n\nexport function isSupportedImage(value: CSSValue): boolean {\n return (\n !(value.type === TokenType.IDENT_TOKEN && value.value === 'none') &&\n (value.type !== TokenType.FUNCTION || !!SUPPORTED_IMAGE_FUNCTIONS[value.name])\n );\n}\n\nconst SUPPORTED_IMAGE_FUNCTIONS: Record<string, (context: Context, args: CSSValue[]) => ICSSImage> = {\n 'linear-gradient': linearGradient,\n '-moz-linear-gradient': prefixLinearGradient,\n '-ms-linear-gradient': prefixLinearGradient,\n '-o-linear-gradient': prefixLinearGradient,\n '-webkit-linear-gradient': prefixLinearGradient,\n 'radial-gradient': radialGradient,\n '-moz-radial-gradient': prefixRadialGradient,\n '-ms-radial-gradient': prefixRadialGradient,\n '-o-radial-gradient': prefixRadialGradient,\n '-webkit-radial-gradient': prefixRadialGradient,\n '-webkit-gradient': webkitGradient\n};\n","import { TokenType } from '../syntax/tokenizer';\nimport { ICSSImage, image, isSupportedImage } from '../types/image';\nimport { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, nonFunctionArgSeparator } from '../syntax/parser';\nimport { Context } from '../../core/context';\n\nexport const backgroundImage: IPropertyListDescriptor<ICSSImage[]> = {\n name: 'background-image',\n initialValue: 'none',\n type: PropertyDescriptorParsingType.LIST,\n prefix: false,\n parse: (context: Context, tokens: CSSValue[]) => {\n if (tokens.length === 0) {\n return [];\n }\n\n const first = tokens[0];\n\n if (first.type === TokenType.IDENT_TOKEN && first.value === 'none') {\n return [];\n }\n\n return tokens\n .filter((value) => nonFunctionArgSeparator(value) && isSupportedImage(value))\n .map((value) => image.parse(context, value));\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\n\nexport const enum BACKGROUND_ORIGIN {\n BORDER_BOX = 0,\n PADDING_BOX = 1,\n CONTENT_BOX = 2\n}\n\nexport type BackgroundOrigin = BACKGROUND_ORIGIN[];\n\nexport const backgroundOrigin: IPropertyListDescriptor<BackgroundOrigin> = {\n name: 'background-origin',\n initialValue: 'border-box',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]): BackgroundOrigin => {\n return tokens.map((token) => {\n if (isIdentToken(token)) {\n switch (token.value) {\n case 'padding-box':\n return BACKGROUND_ORIGIN.PADDING_BOX;\n case 'content-box':\n return BACKGROUND_ORIGIN.CONTENT_BOX;\n }\n }\n return BACKGROUND_ORIGIN.BORDER_BOX;\n });\n }\n};\n","import { PropertyDescriptorParsingType, IPropertyListDescriptor } from '../IPropertyDescriptor';\nimport { CSSValue, parseFunctionArgs } from '../syntax/parser';\nimport {\n isLengthPercentage,\n isCalcFunction,\n evaluateCalcToLengthPercentage,\n LengthPercentageTuple,\n parseLengthPercentageTuple\n} from '../types/length-percentage';\nimport { Context } from '../../core/context';\nexport type BackgroundPosition = BackgroundImagePosition[];\n\nexport type BackgroundImagePosition = LengthPercentageTuple;\n\nexport const backgroundPosition: IPropertyListDescriptor<BackgroundPosition> = {\n name: 'background-position',\n initialValue: '0% 0%',\n type: PropertyDescriptorParsingType.LIST,\n prefix: false,\n parse: (_context: Context, tokens: CSSValue[]): BackgroundPosition => {\n return parseFunctionArgs(tokens)\n .map((values: CSSValue[]) => {\n // Convert calc() to length-percentage tokens, keep other length-percentage as is\n return values\n .map((value) => {\n if (isCalcFunction(value)) {\n // For calc() at parse time, we can't know the container size\n // So we evaluate with 0 context which will work for px-only calc()\n // Percentage-based calc() will need special handling\n return evaluateCalcToLengthPercentage(value, 0);\n }\n return isLengthPercentage(value) ? value : null;\n })\n .filter((v): v is NonNullable<typeof v> => v !== null);\n })\n .map(parseLengthPercentageTuple);\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken, parseFunctionArgs } from '../syntax/parser';\nimport { Context } from '../../core/context';\nexport type BackgroundRepeat = BACKGROUND_REPEAT[];\n\nexport const enum BACKGROUND_REPEAT {\n REPEAT = 0,\n NO_REPEAT = 1,\n REPEAT_X = 2,\n REPEAT_Y = 3\n}\n\nexport const backgroundRepeat: IPropertyListDescriptor<BackgroundRepeat> = {\n name: 'background-repeat',\n initialValue: 'repeat',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]): BackgroundRepeat => {\n return parseFunctionArgs(tokens)\n .map((values) =>\n values\n .filter(isIdentToken)\n .map((token) => token.value)\n .join(' ')\n )\n .map(parseBackgroundRepeat);\n }\n};\n\nconst parseBackgroundRepeat = (value: string): BACKGROUND_REPEAT => {\n switch (value) {\n case 'no-repeat':\n return BACKGROUND_REPEAT.NO_REPEAT;\n case 'repeat-x':\n case 'repeat no-repeat':\n return BACKGROUND_REPEAT.REPEAT_X;\n case 'repeat-y':\n case 'no-repeat repeat':\n return BACKGROUND_REPEAT.REPEAT_Y;\n case 'repeat':\n default:\n return BACKGROUND_REPEAT.REPEAT;\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken, parseFunctionArgs } from '../syntax/parser';\nimport { isLengthPercentage, LengthPercentage } from '../types/length-percentage';\nimport { StringValueToken } from '../syntax/tokenizer';\nimport { Context } from '../../core/context';\n\nexport enum BACKGROUND_SIZE {\n AUTO = 'auto',\n CONTAIN = 'contain',\n COVER = 'cover'\n}\n\nexport type BackgroundSizeInfo = LengthPercentage | StringValueToken;\nexport type BackgroundSize = BackgroundSizeInfo[][];\n\nexport const backgroundSize: IPropertyListDescriptor<BackgroundSize> = {\n name: 'background-size',\n initialValue: '0',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]): BackgroundSize => {\n return parseFunctionArgs(tokens).map((values) => values.filter(isBackgroundSizeInfoToken));\n }\n};\n\nconst isBackgroundSizeInfoToken = (value: CSSValue): value is BackgroundSizeInfo =>\n isIdentToken(value) || isLengthPercentage(value);\n","import { IPropertyTypeValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nconst borderColorForSide = (side: string): IPropertyTypeValueDescriptor => ({\n name: `border-${side}-color`,\n initialValue: 'transparent',\n prefix: false,\n type: PropertyDescriptorParsingType.TYPE_VALUE,\n format: 'color'\n});\n\nexport const borderTopColor: IPropertyTypeValueDescriptor = borderColorForSide('top');\nexport const borderRightColor: IPropertyTypeValueDescriptor = borderColorForSide('right');\nexport const borderBottomColor: IPropertyTypeValueDescriptor = borderColorForSide('bottom');\nexport const borderLeftColor: IPropertyTypeValueDescriptor = borderColorForSide('left');\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue } from '../syntax/parser';\nimport { isLengthPercentage, LengthPercentageTuple, parseLengthPercentageTuple } from '../types/length-percentage';\nimport { Context } from '../../core/context';\nexport type BorderRadius = LengthPercentageTuple;\n\nconst borderRadiusForSide = (side: string): IPropertyListDescriptor<BorderRadius> => ({\n name: `border-radius-${side}`,\n initialValue: '0 0',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]): BorderRadius =>\n parseLengthPercentageTuple(tokens.filter(isLengthPercentage))\n});\n\nexport const borderTopLeftRadius: IPropertyListDescriptor<BorderRadius> = borderRadiusForSide('top-left');\nexport const borderTopRightRadius: IPropertyListDescriptor<BorderRadius> = borderRadiusForSide('top-right');\nexport const borderBottomRightRadius: IPropertyListDescriptor<BorderRadius> = borderRadiusForSide('bottom-right');\nexport const borderBottomLeftRadius: IPropertyListDescriptor<BorderRadius> = borderRadiusForSide('bottom-left');\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport const enum BORDER_STYLE {\n NONE = 0,\n SOLID = 1,\n DASHED = 2,\n DOTTED = 3,\n DOUBLE = 4\n}\n\nconst borderStyleForSide = (side: string): IPropertyIdentValueDescriptor<BORDER_STYLE> => ({\n name: `border-${side}-style`,\n initialValue: 'solid',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, style: string): BORDER_STYLE => {\n switch (style) {\n case 'none':\n return BORDER_STYLE.NONE;\n case 'dashed':\n return BORDER_STYLE.DASHED;\n case 'dotted':\n return BORDER_STYLE.DOTTED;\n case 'double':\n return BORDER_STYLE.DOUBLE;\n }\n return BORDER_STYLE.SOLID;\n }\n});\n\nexport const borderTopStyle: IPropertyIdentValueDescriptor<BORDER_STYLE> = borderStyleForSide('top');\nexport const borderRightStyle: IPropertyIdentValueDescriptor<BORDER_STYLE> = borderStyleForSide('right');\nexport const borderBottomStyle: IPropertyIdentValueDescriptor<BORDER_STYLE> = borderStyleForSide('bottom');\nexport const borderLeftStyle: IPropertyIdentValueDescriptor<BORDER_STYLE> = borderStyleForSide('left');\n","import { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isDimensionToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\nconst borderWidthForSide = (side: string): IPropertyValueDescriptor<number> => ({\n name: `border-${side}-width`,\n initialValue: '0',\n type: PropertyDescriptorParsingType.VALUE,\n prefix: false,\n parse: (_context: Context, token: CSSValue): number => {\n if (isDimensionToken(token)) {\n return token.number;\n }\n return 0;\n }\n});\n\nexport const borderTopWidth: IPropertyValueDescriptor<number> = borderWidthForSide('top');\nexport const borderRightWidth: IPropertyValueDescriptor<number> = borderWidthForSide('right');\nexport const borderBottomWidth: IPropertyValueDescriptor<number> = borderWidthForSide('bottom');\nexport const borderLeftWidth: IPropertyValueDescriptor<number> = borderWidthForSide('left');\n","import { IPropertyTypeValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\n\nexport const color: IPropertyTypeValueDescriptor = {\n name: `color`,\n initialValue: 'transparent',\n prefix: false,\n type: PropertyDescriptorParsingType.TYPE_VALUE,\n format: 'color'\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\n\nexport const enum DIRECTION {\n LTR = 0,\n RTL = 1\n}\n\nexport const direction: IPropertyIdentValueDescriptor<DIRECTION> = {\n name: 'direction',\n initialValue: 'ltr',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, direction: string) => {\n switch (direction) {\n case 'rtl':\n return DIRECTION.RTL;\n case 'ltr':\n default:\n return DIRECTION.LTR;\n }\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\nexport const enum DISPLAY {\n NONE = 0,\n BLOCK = 1 << 1,\n INLINE = 1 << 2,\n RUN_IN = 1 << 3,\n FLOW = 1 << 4,\n FLOW_ROOT = 1 << 5,\n TABLE = 1 << 6,\n FLEX = 1 << 7,\n GRID = 1 << 8,\n RUBY = 1 << 9,\n SUBGRID = 1 << 10,\n LIST_ITEM = 1 << 11,\n TABLE_ROW_GROUP = 1 << 12,\n TABLE_HEADER_GROUP = 1 << 13,\n TABLE_FOOTER_GROUP = 1 << 14,\n TABLE_ROW = 1 << 15,\n TABLE_CELL = 1 << 16,\n TABLE_COLUMN_GROUP = 1 << 17,\n TABLE_COLUMN = 1 << 18,\n TABLE_CAPTION = 1 << 19,\n RUBY_BASE = 1 << 20,\n RUBY_TEXT = 1 << 21,\n RUBY_BASE_CONTAINER = 1 << 22,\n RUBY_TEXT_CONTAINER = 1 << 23,\n CONTENTS = 1 << 24,\n INLINE_BLOCK = 1 << 25,\n INLINE_LIST_ITEM = 1 << 26,\n INLINE_TABLE = 1 << 27,\n INLINE_FLEX = 1 << 28,\n INLINE_GRID = 1 << 29\n}\n\nexport type Display = number;\n\nexport const display: IPropertyListDescriptor<Display> = {\n name: 'display',\n initialValue: 'inline-block',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]): Display => {\n return tokens.filter(isIdentToken).reduce((bit, token) => {\n return bit | parseDisplayValue(token.value);\n }, DISPLAY.NONE);\n }\n};\n\nconst parseDisplayValue = (display: string): Display => {\n switch (display) {\n case 'block':\n case '-webkit-box':\n return DISPLAY.BLOCK;\n case 'inline':\n return DISPLAY.INLINE;\n case 'run-in':\n return DISPLAY.RUN_IN;\n case 'flow':\n return DISPLAY.FLOW;\n case 'flow-root':\n return DISPLAY.FLOW_ROOT;\n case 'table':\n return DISPLAY.TABLE;\n case 'flex':\n case '-webkit-flex':\n return DISPLAY.FLEX;\n case 'grid':\n case '-ms-grid':\n return DISPLAY.GRID;\n case 'ruby':\n return DISPLAY.RUBY;\n case 'subgrid':\n return DISPLAY.SUBGRID;\n case 'list-item':\n return DISPLAY.LIST_ITEM;\n case 'table-row-group':\n return DISPLAY.TABLE_ROW_GROUP;\n case 'table-header-group':\n return DISPLAY.TABLE_HEADER_GROUP;\n case 'table-footer-group':\n return DISPLAY.TABLE_FOOTER_GROUP;\n case 'table-row':\n return DISPLAY.TABLE_ROW;\n case 'table-cell':\n return DISPLAY.TABLE_CELL;\n case 'table-column-group':\n return DISPLAY.TABLE_COLUMN_GROUP;\n case 'table-column':\n return DISPLAY.TABLE_COLUMN;\n case 'table-caption':\n return DISPLAY.TABLE_CAPTION;\n case 'ruby-base':\n return DISPLAY.RUBY_BASE;\n case 'ruby-text':\n return DISPLAY.RUBY_TEXT;\n case 'ruby-base-container':\n return DISPLAY.RUBY_BASE_CONTAINER;\n case 'ruby-text-container':\n return DISPLAY.RUBY_TEXT_CONTAINER;\n case 'contents':\n return DISPLAY.CONTENTS;\n case 'inline-block':\n return DISPLAY.INLINE_BLOCK;\n case 'inline-list-item':\n return DISPLAY.INLINE_LIST_ITEM;\n case 'inline-table':\n return DISPLAY.INLINE_TABLE;\n case 'inline-flex':\n return DISPLAY.INLINE_FLEX;\n case 'inline-grid':\n return DISPLAY.INLINE_GRID;\n }\n\n return DISPLAY.NONE;\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport const enum FLOAT {\n NONE = 0,\n LEFT = 1,\n RIGHT = 2,\n INLINE_START = 3,\n INLINE_END = 4\n}\n\nexport const float: IPropertyIdentValueDescriptor<FLOAT> = {\n name: 'float',\n initialValue: 'none',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, float: string) => {\n switch (float) {\n case 'left':\n return FLOAT.LEFT;\n case 'right':\n return FLOAT.RIGHT;\n case 'inline-start':\n return FLOAT.INLINE_START;\n case 'inline-end':\n return FLOAT.INLINE_END;\n }\n return FLOAT.NONE;\n }\n};\n","import { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue } from '../syntax/parser';\nimport { TokenType } from '../syntax/tokenizer';\nimport { Context } from '../../core/context';\nexport const letterSpacing: IPropertyValueDescriptor<number> = {\n name: 'letter-spacing',\n initialValue: '0',\n prefix: false,\n type: PropertyDescriptorParsingType.VALUE,\n parse: (_context: Context, token: CSSValue) => {\n if (token.type === TokenType.IDENT_TOKEN && token.value === 'normal') {\n return 0;\n }\n\n if (token.type === TokenType.NUMBER_TOKEN) {\n return token.number;\n }\n\n if (token.type === TokenType.DIMENSION_TOKEN) {\n return token.number;\n }\n\n return 0;\n }\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport enum LINE_BREAK {\n NORMAL = 'normal',\n STRICT = 'strict'\n}\n\nexport const lineBreak: IPropertyIdentValueDescriptor<LINE_BREAK> = {\n name: 'line-break',\n initialValue: 'normal',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, lineBreak: string): LINE_BREAK => {\n switch (lineBreak) {\n case 'strict':\n return LINE_BREAK.STRICT;\n case 'normal':\n default:\n return LINE_BREAK.NORMAL;\n }\n }\n};\n","import { IPropertyTokenValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken } from '../syntax/parser';\nimport { TokenType } from '../syntax/tokenizer';\nimport { getAbsoluteValue, isLengthPercentage } from '../types/length-percentage';\nexport const lineHeight: IPropertyTokenValueDescriptor = {\n name: 'line-height',\n initialValue: 'normal',\n prefix: false,\n type: PropertyDescriptorParsingType.TOKEN_VALUE\n};\n\nexport const computeLineHeight = (token: CSSValue, fontSize: number): number => {\n if (isIdentToken(token) && token.value === 'normal') {\n return 1.2 * fontSize;\n } else if (token.type === TokenType.NUMBER_TOKEN) {\n return fontSize * token.number;\n } else if (isLengthPercentage(token)) {\n return getAbsoluteValue(token, fontSize);\n }\n\n return fontSize;\n};\n","import { TokenType } from '../syntax/tokenizer';\nimport { ICSSImage, image } from '../types/image';\nimport { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue } from '../syntax/parser';\nimport { Context } from '../../core/context';\n\nexport const listStyleImage: IPropertyValueDescriptor<ICSSImage | null> = {\n name: 'list-style-image',\n initialValue: 'none',\n type: PropertyDescriptorParsingType.VALUE,\n prefix: false,\n parse: (context: Context, token: CSSValue) => {\n if (token.type === TokenType.IDENT_TOKEN && token.value === 'none') {\n return null;\n }\n\n return image.parse(context, token);\n }\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport const enum LIST_STYLE_POSITION {\n INSIDE = 0,\n OUTSIDE = 1\n}\n\nexport const listStylePosition: IPropertyIdentValueDescriptor<LIST_STYLE_POSITION> = {\n name: 'list-style-position',\n initialValue: 'outside',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, position: string) => {\n switch (position) {\n case 'inside':\n return LIST_STYLE_POSITION.INSIDE;\n case 'outside':\n default:\n return LIST_STYLE_POSITION.OUTSIDE;\n }\n }\n};\n","import { Context } from '../../core/context';\nimport { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nexport const enum LIST_STYLE_TYPE {\n NONE = -1,\n DISC = 0,\n CIRCLE = 1,\n SQUARE = 2,\n DECIMAL = 3,\n CJK_DECIMAL = 4,\n DECIMAL_LEADING_ZERO = 5,\n LOWER_ROMAN = 6,\n UPPER_ROMAN = 7,\n LOWER_GREEK = 8,\n LOWER_ALPHA = 9,\n UPPER_ALPHA = 10,\n ARABIC_INDIC = 11,\n ARMENIAN = 12,\n BENGALI = 13,\n CAMBODIAN = 14,\n CJK_EARTHLY_BRANCH = 15,\n CJK_HEAVENLY_STEM = 16,\n CJK_IDEOGRAPHIC = 17,\n DEVANAGARI = 18,\n ETHIOPIC_NUMERIC = 19,\n GEORGIAN = 20,\n GUJARATI = 21,\n GURMUKHI = 22,\n HIRAGANA = 23,\n HIRAGANA_IROHA = 24,\n JAPANESE_FORMAL = 25,\n JAPANESE_INFORMAL = 26,\n KANNADA = 27,\n KATAKANA = 28,\n KATAKANA_IROHA = 29,\n KHMER = 30,\n KOREAN_HANGUL_FORMAL = 31,\n KOREAN_HANJA_FORMAL = 32,\n KOREAN_HANJA_INFORMAL = 33,\n LAO = 34,\n LOWER_ARMENIAN = 35,\n MALAYALAM = 36,\n MONGOLIAN = 37,\n MYANMAR = 38,\n ORIYA = 39,\n PERSIAN = 40,\n SIMP_CHINESE_FORMAL = 41,\n SIMP_CHINESE_INFORMAL = 42,\n TAMIL = 43,\n TELUGU = 44,\n THAI = 45,\n TIBETAN = 46,\n TRAD_CHINESE_FORMAL = 47,\n TRAD_CHINESE_INFORMAL = 48,\n UPPER_ARMENIAN = 49,\n DISCLOSURE_OPEN = 50,\n DISCLOSURE_CLOSED = 51,\n // This was originally 22, duplicating GURMUKHI.\n HEBREW = 52\n}\n\nexport const listStyleType: IPropertyIdentValueDescriptor<LIST_STYLE_TYPE> = {\n name: 'list-style-type',\n initialValue: 'none',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, type: string) => {\n switch (type) {\n case 'disc':\n return LIST_STYLE_TYPE.DISC;\n case 'circle':\n return LIST_STYLE_TYPE.CIRCLE;\n case 'square':\n return LIST_STYLE_TYPE.SQUARE;\n case 'decimal':\n return LIST_STYLE_TYPE.DECIMAL;\n case 'cjk-decimal':\n return LIST_STYLE_TYPE.CJK_DECIMAL;\n case 'decimal-leading-zero':\n return LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO;\n case 'lower-roman':\n return LIST_STYLE_TYPE.LOWER_ROMAN;\n case 'upper-roman':\n return LIST_STYLE_TYPE.UPPER_ROMAN;\n case 'lower-greek':\n return LIST_STYLE_TYPE.LOWER_GREEK;\n case 'lower-alpha':\n return LIST_STYLE_TYPE.LOWER_ALPHA;\n case 'upper-alpha':\n return LIST_STYLE_TYPE.UPPER_ALPHA;\n case 'arabic-indic':\n return LIST_STYLE_TYPE.ARABIC_INDIC;\n case 'armenian':\n return LIST_STYLE_TYPE.ARMENIAN;\n case 'bengali':\n return LIST_STYLE_TYPE.BENGALI;\n case 'cambodian':\n return LIST_STYLE_TYPE.CAMBODIAN;\n case 'cjk-earthly-branch':\n return LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH;\n case 'cjk-heavenly-stem':\n return LIST_STYLE_TYPE.CJK_HEAVENLY_STEM;\n case 'cjk-ideographic':\n return LIST_STYLE_TYPE.CJK_IDEOGRAPHIC;\n case 'devanagari':\n return LIST_STYLE_TYPE.DEVANAGARI;\n case 'ethiopic-numeric':\n return LIST_STYLE_TYPE.ETHIOPIC_NUMERIC;\n case 'georgian':\n return LIST_STYLE_TYPE.GEORGIAN;\n case 'gujarati':\n return LIST_STYLE_TYPE.GUJARATI;\n case 'gurmukhi':\n return LIST_STYLE_TYPE.GURMUKHI;\n case 'hebrew':\n return LIST_STYLE_TYPE.HEBREW;\n case 'hiragana':\n return LIST_STYLE_TYPE.HIRAGANA;\n case 'hiragana-iroha':\n return LIST_STYLE_TYPE.HIRAGANA_IROHA;\n case 'japanese-formal':\n return LIST_STYLE_TYPE.JAPANESE_FORMAL;\n case 'japanese-informal':\n return LIST_STYLE_TYPE.JAPANESE_INFORMAL;\n case 'kannada':\n return LIST_STYLE_TYPE.KANNADA;\n case 'katakana':\n return LIST_STYLE_TYPE.KATAKANA;\n case 'katakana-iroha':\n return LIST_STYLE_TYPE.KATAKANA_IROHA;\n case 'khmer':\n return LIST_STYLE_TYPE.KHMER;\n case 'korean-hangul-formal':\n return LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL;\n case 'korean-hanja-formal':\n return LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL;\n case 'korean-hanja-informal':\n return LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL;\n case 'lao':\n return LIST_STYLE_TYPE.LAO;\n case 'lower-armenian':\n return LIST_STYLE_TYPE.LOWER_ARMENIAN;\n case 'malayalam':\n return LIST_STYLE_TYPE.MALAYALAM;\n case 'mongolian':\n return LIST_STYLE_TYPE.MONGOLIAN;\n case 'myanmar':\n return LIST_STYLE_TYPE.MYANMAR;\n case 'oriya':\n return LIST_STYLE_TYPE.ORIYA;\n case 'persian':\n return LIST_STYLE_TYPE.PERSIAN;\n case 'simp-chinese-formal':\n return LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL;\n case 'simp-chinese-informal':\n return LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL;\n case 'tamil':\n return LIST_STYLE_TYPE.TAMIL;\n case 'telugu':\n return LIST_STYLE_TYPE.TELUGU;\n case 'thai':\n return LIST_STYLE_TYPE.THAI;\n case 'tibetan':\n return LIST_STYLE_TYPE.TIBETAN;\n case 'trad-chinese-formal':\n return LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL;\n case 'trad-chinese-informal':\n return LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL;\n case 'upper-armenian':\n return LIST_STYLE_TYPE.UPPER_ARMENIAN;\n case 'disclosure-open':\n return LIST_STYLE_TYPE.DISCLOSURE_OPEN;\n case 'disclosure-closed':\n return LIST_STYLE_TYPE.DISCLOSURE_CLOSED;\n case 'none':\n default:\n return LIST_STYLE_TYPE.NONE;\n }\n }\n};\n","import { IPropertyTokenValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\n\nconst marginForSide = (side: string): IPropertyTokenValueDescriptor => ({\n name: `margin-${side}`,\n initialValue: '0',\n prefix: false,\n type: PropertyDescriptorParsingType.TOKEN_VALUE\n});\n\nexport const marginTop: IPropertyTokenValueDescriptor = marginForSide('top');\nexport const marginRight: IPropertyTokenValueDescriptor = marginForSide('right');\nexport const marginBottom: IPropertyTokenValueDescriptor = marginForSide('bottom');\nexport const marginLeft: IPropertyTokenValueDescriptor = marginForSide('left');\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\nexport const enum OVERFLOW {\n VISIBLE = 0,\n HIDDEN = 1,\n SCROLL = 2,\n CLIP = 3,\n AUTO = 4\n}\n\nexport const overflow: IPropertyListDescriptor<OVERFLOW[]> = {\n name: 'overflow',\n initialValue: 'visible',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]): OVERFLOW[] => {\n return tokens.filter(isIdentToken).map((overflow) => {\n switch (overflow.value) {\n case 'hidden':\n return OVERFLOW.HIDDEN;\n case 'scroll':\n return OVERFLOW.SCROLL;\n case 'clip':\n return OVERFLOW.CLIP;\n case 'auto':\n return OVERFLOW.AUTO;\n case 'visible':\n default:\n return OVERFLOW.VISIBLE;\n }\n });\n }\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport const enum OVERFLOW_WRAP {\n NORMAL = 'normal',\n BREAK_WORD = 'break-word'\n}\n\nexport const overflowWrap: IPropertyIdentValueDescriptor<OVERFLOW_WRAP> = {\n name: 'overflow-wrap',\n initialValue: 'normal',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, overflow: string) => {\n switch (overflow) {\n case 'break-word':\n return OVERFLOW_WRAP.BREAK_WORD;\n case 'normal':\n default:\n return OVERFLOW_WRAP.NORMAL;\n }\n }\n};\n","import { IPropertyTypeValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\n\nconst paddingForSide = (side: string): IPropertyTypeValueDescriptor => ({\n name: `padding-${side}`,\n initialValue: '0',\n prefix: false,\n type: PropertyDescriptorParsingType.TYPE_VALUE,\n format: 'length-percentage'\n});\n\nexport const paddingTop: IPropertyTypeValueDescriptor = paddingForSide('top');\nexport const paddingRight: IPropertyTypeValueDescriptor = paddingForSide('right');\nexport const paddingBottom: IPropertyTypeValueDescriptor = paddingForSide('bottom');\nexport const paddingLeft: IPropertyTypeValueDescriptor = paddingForSide('left');\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport const enum TEXT_ALIGN {\n LEFT = 0,\n CENTER = 1,\n RIGHT = 2\n}\n\nexport const textAlign: IPropertyIdentValueDescriptor<TEXT_ALIGN> = {\n name: 'text-align',\n initialValue: 'left',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, textAlign: string) => {\n switch (textAlign) {\n case 'right':\n return TEXT_ALIGN.RIGHT;\n case 'center':\n case 'justify':\n return TEXT_ALIGN.CENTER;\n case 'left':\n default:\n return TEXT_ALIGN.LEFT;\n }\n }\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport const enum POSITION {\n STATIC = 0,\n RELATIVE = 1,\n ABSOLUTE = 2,\n FIXED = 3,\n STICKY = 4\n}\n\nexport const position: IPropertyIdentValueDescriptor<POSITION> = {\n name: 'position',\n initialValue: 'static',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, position: string) => {\n switch (position) {\n case 'relative':\n return POSITION.RELATIVE;\n case 'absolute':\n return POSITION.ABSOLUTE;\n case 'fixed':\n return POSITION.FIXED;\n case 'sticky':\n return POSITION.STICKY;\n }\n\n return POSITION.STATIC;\n }\n};\n","import { PropertyDescriptorParsingType, IPropertyListDescriptor } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentWithValue, parseFunctionArgs } from '../syntax/parser';\nimport { ZERO_LENGTH } from '../types/length-percentage';\nimport { color, Color, COLORS } from '../types/color';\nimport { isLength, Length } from '../types/length';\nimport { Context } from '../../core/context';\n\nexport type TextShadow = TextShadowItem[];\ninterface TextShadowItem {\n color: Color;\n offsetX: Length;\n offsetY: Length;\n blur: Length;\n}\n\nexport const textShadow: IPropertyListDescriptor<TextShadow> = {\n name: 'text-shadow',\n initialValue: 'none',\n type: PropertyDescriptorParsingType.LIST,\n prefix: false,\n parse: (context: Context, tokens: CSSValue[]): TextShadow => {\n if (tokens.length === 1 && isIdentWithValue(tokens[0], 'none')) {\n return [];\n }\n\n return parseFunctionArgs(tokens).map((values: CSSValue[]) => {\n const shadow: TextShadowItem = {\n color: COLORS.TRANSPARENT,\n offsetX: ZERO_LENGTH,\n offsetY: ZERO_LENGTH,\n blur: ZERO_LENGTH\n };\n let c = 0;\n for (let i = 0; i < values.length; i++) {\n const token = values[i];\n if (isLength(token)) {\n if (c === 0) {\n shadow.offsetX = token;\n } else if (c === 1) {\n shadow.offsetY = token;\n } else {\n shadow.blur = token;\n }\n c++;\n } else {\n shadow.color = color.parse(context, token);\n }\n }\n return shadow;\n });\n }\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport const enum TEXT_TRANSFORM {\n NONE = 0,\n LOWERCASE = 1,\n UPPERCASE = 2,\n CAPITALIZE = 3\n}\n\nexport const textTransform: IPropertyIdentValueDescriptor<TEXT_TRANSFORM> = {\n name: 'text-transform',\n initialValue: 'none',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, textTransform: string) => {\n switch (textTransform) {\n case 'uppercase':\n return TEXT_TRANSFORM.UPPERCASE;\n case 'lowercase':\n return TEXT_TRANSFORM.LOWERCASE;\n case 'capitalize':\n return TEXT_TRANSFORM.CAPITALIZE;\n }\n\n return TEXT_TRANSFORM.NONE;\n }\n};\n","import { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue } from '../syntax/parser';\nimport { NumberValueToken, TokenType } from '../syntax/tokenizer';\nimport { Context } from '../../core/context';\nimport { angle } from '../types/angle';\nexport type Matrix = [number, number, number, number, number, number];\nexport type Transform = Matrix | null;\n\nexport const transform: IPropertyValueDescriptor<Transform> = {\n name: 'transform',\n initialValue: 'none',\n prefix: true,\n type: PropertyDescriptorParsingType.VALUE,\n parse: (_context: Context, token: CSSValue) => {\n if (token.type === TokenType.IDENT_TOKEN && token.value === 'none') {\n return null;\n }\n\n if (token.type === TokenType.FUNCTION) {\n const transformFunction = SUPPORTED_TRANSFORM_FUNCTIONS[token.name];\n if (typeof transformFunction === 'undefined') {\n throw new Error(`Attempting to parse an unsupported transform function \"${token.name}\"`);\n }\n return transformFunction(_context, token.values);\n }\n\n return null;\n }\n};\n\nconst matrix = (_context: Context, args: CSSValue[]): Transform => {\n const values = args.filter((arg) => arg.type === TokenType.NUMBER_TOKEN).map((arg: NumberValueToken) => arg.number);\n\n return values.length === 6 ? (values as Matrix) : null;\n};\n\n// doesn't support 3D transforms at the moment\nconst matrix3d = (_context: Context, args: CSSValue[]): Transform => {\n const values = args.filter((arg) => arg.type === TokenType.NUMBER_TOKEN).map((arg: NumberValueToken) => arg.number);\n\n const [a1, b1, {}, {}, a2, b2, {}, {}, {}, {}, {}, {}, a4, b4, {}, {}] = values;\n\n return values.length === 16 ? [a1, b1, a2, b2, a4, b4] : null;\n};\n\nconst rotate = (context: Context, args: CSSValue[]): Transform => {\n if (args.length !== 1) {\n return null;\n }\n\n const arg = args[0];\n let radians = 0;\n\n if (arg.type === TokenType.NUMBER_TOKEN && arg.number === 0) {\n radians = 0;\n } else if (arg.type === TokenType.DIMENSION_TOKEN) {\n radians = angle.parse(context, arg);\n } else {\n return null;\n }\n\n const cos = Math.cos(radians);\n const sin = Math.sin(radians);\n\n return [cos, sin, -sin, cos, 0, 0];\n};\n\nconst SUPPORTED_TRANSFORM_FUNCTIONS: {\n [key: string]: (context: Context, args: CSSValue[]) => Transform;\n} = {\n matrix: matrix,\n matrix3d: matrix3d,\n rotate: rotate\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue } from '../syntax/parser';\nimport { isLengthPercentage, LengthPercentage } from '../types/length-percentage';\nimport { FLAG_INTEGER, TokenType } from '../syntax/tokenizer';\nimport { Context } from '../../core/context';\nexport type TransformOrigin = [LengthPercentage, LengthPercentage];\n\nconst DEFAULT_VALUE: LengthPercentage = {\n type: TokenType.PERCENTAGE_TOKEN,\n number: 50,\n flags: FLAG_INTEGER\n};\nconst DEFAULT: TransformOrigin = [DEFAULT_VALUE, DEFAULT_VALUE];\n\nexport const transformOrigin: IPropertyListDescriptor<TransformOrigin> = {\n name: 'transform-origin',\n initialValue: '50% 50%',\n prefix: true,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]) => {\n const origins: LengthPercentage[] = tokens.filter(isLengthPercentage);\n\n if (origins.length !== 2) {\n return DEFAULT;\n }\n\n return [origins[0], origins[1]];\n }\n};\n","import { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue } from '../syntax/parser';\nimport { TokenType } from '../syntax/tokenizer';\nimport { Context } from '../../core/context';\nimport { angle } from '../types/angle';\n\nexport type Rotate = number | null;\n\nexport const rotate: IPropertyValueDescriptor<Rotate> = {\n name: 'rotate',\n initialValue: 'none',\n prefix: false,\n type: PropertyDescriptorParsingType.VALUE,\n parse: (_context: Context, token: CSSValue): Rotate => {\n if (token.type === TokenType.IDENT_TOKEN && token.value === 'none') {\n return null;\n }\n\n if (token.type === TokenType.NUMBER_TOKEN) {\n if (token.number === 0) {\n return 0;\n }\n }\n\n if (token.type === TokenType.DIMENSION_TOKEN) {\n // Parse angle and convert to degrees for storage\n const radians = angle.parse(_context, token);\n // Store as degrees for consistency\n return (radians * 180) / Math.PI;\n }\n\n return null;\n }\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport const enum VISIBILITY {\n VISIBLE = 0,\n HIDDEN = 1,\n COLLAPSE = 2\n}\n\nexport const visibility: IPropertyIdentValueDescriptor<VISIBILITY> = {\n name: 'visible',\n initialValue: 'none',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, visibility: string) => {\n switch (visibility) {\n case 'hidden':\n return VISIBILITY.HIDDEN;\n case 'collapse':\n return VISIBILITY.COLLAPSE;\n case 'visible':\n default:\n return VISIBILITY.VISIBLE;\n }\n }\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport enum WORD_BREAK {\n NORMAL = 'normal',\n BREAK_ALL = 'break-all',\n KEEP_ALL = 'keep-all'\n}\n\nexport const wordBreak: IPropertyIdentValueDescriptor<WORD_BREAK> = {\n name: 'word-break',\n initialValue: 'normal',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, wordBreak: string): WORD_BREAK => {\n switch (wordBreak) {\n case 'break-all':\n return WORD_BREAK.BREAK_ALL;\n case 'keep-all':\n return WORD_BREAK.KEEP_ALL;\n case 'normal':\n default:\n return WORD_BREAK.NORMAL;\n }\n }\n};\n","import { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isNumberToken } from '../syntax/parser';\nimport { TokenType } from '../syntax/tokenizer';\nimport { Context } from '../../core/context';\n\ninterface zIndex {\n order: number;\n auto: boolean;\n}\n\nexport const zIndex: IPropertyValueDescriptor<zIndex> = {\n name: 'z-index',\n initialValue: 'auto',\n prefix: false,\n type: PropertyDescriptorParsingType.VALUE,\n parse: (_context: Context, token: CSSValue): zIndex => {\n if (token.type === TokenType.IDENT_TOKEN) {\n return { auto: true, order: 0 };\n }\n\n if (isNumberToken(token)) {\n return { auto: false, order: token.number };\n }\n\n throw new Error(`Invalid z-index number parsed`);\n }\n};\n","import { CSSValue } from '../syntax/parser';\nimport { TokenType } from '../syntax/tokenizer';\nimport { ITypeDescriptor } from '../ITypeDescriptor';\nimport { Context } from '../../core/context';\n\nexport const time: ITypeDescriptor<number> = {\n name: 'time',\n parse: (_context: Context, value: CSSValue): number => {\n if (value.type === TokenType.DIMENSION_TOKEN) {\n switch (value.unit.toLowerCase()) {\n case 's':\n return 1000 * value.number;\n case 'ms':\n return value.number;\n }\n }\n\n throw new Error(`Unsupported time type`);\n }\n};\n","import { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isNumberToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\nexport const opacity: IPropertyValueDescriptor<number> = {\n name: 'opacity',\n initialValue: '1',\n type: PropertyDescriptorParsingType.VALUE,\n prefix: false,\n parse: (_context: Context, token: CSSValue): number => {\n if (isNumberToken(token)) {\n return token.number;\n }\n return 1;\n }\n};\n","import { IPropertyTypeValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\n\nexport const textDecorationColor: IPropertyTypeValueDescriptor = {\n name: `text-decoration-color`,\n initialValue: 'transparent',\n prefix: false,\n type: PropertyDescriptorParsingType.TYPE_VALUE,\n format: 'color'\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\n\nexport const enum TEXT_DECORATION_LINE {\n NONE = 0,\n UNDERLINE = 1,\n OVERLINE = 2,\n LINE_THROUGH = 3,\n BLINK = 4\n}\n\nexport type TextDecorationLine = TEXT_DECORATION_LINE[];\n\nexport const textDecorationLine: IPropertyListDescriptor<TextDecorationLine> = {\n name: 'text-decoration-line',\n initialValue: 'none',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]): TextDecorationLine => {\n return tokens\n .filter(isIdentToken)\n .map((token) => {\n switch (token.value) {\n case 'underline':\n return TEXT_DECORATION_LINE.UNDERLINE;\n case 'overline':\n return TEXT_DECORATION_LINE.OVERLINE;\n case 'line-through':\n return TEXT_DECORATION_LINE.LINE_THROUGH;\n case 'none':\n return TEXT_DECORATION_LINE.BLINK;\n }\n return TEXT_DECORATION_LINE.NONE;\n })\n .filter((line) => line !== TEXT_DECORATION_LINE.NONE);\n }\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\n\nexport const enum TEXT_DECORATION_STYLE {\n SOLID = 0,\n DOUBLE = 1,\n DOTTED = 2,\n DASHED = 3,\n WAVY = 4\n}\n\nexport const textDecorationStyle: IPropertyIdentValueDescriptor<TEXT_DECORATION_STYLE> = {\n name: 'text-decoration-style',\n initialValue: 'solid',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, style: string): TEXT_DECORATION_STYLE => {\n switch (style) {\n case 'double':\n return TEXT_DECORATION_STYLE.DOUBLE;\n case 'dotted':\n return TEXT_DECORATION_STYLE.DOTTED;\n case 'dashed':\n return TEXT_DECORATION_STYLE.DASHED;\n case 'wavy':\n return TEXT_DECORATION_STYLE.WAVY;\n case 'solid':\n default:\n return TEXT_DECORATION_STYLE.SOLID;\n }\n }\n};\n","import { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken, isDimensionToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\n\nexport type TextDecorationThickness = number | 'auto' | 'from-font';\n\nexport const textDecorationThickness: IPropertyValueDescriptor<TextDecorationThickness> = {\n name: 'text-decoration-thickness',\n initialValue: 'auto',\n prefix: false,\n type: PropertyDescriptorParsingType.VALUE,\n parse: (_context: Context, token: CSSValue): TextDecorationThickness => {\n if (isIdentToken(token)) {\n switch (token.value) {\n case 'auto':\n return 'auto';\n case 'from-font':\n return 'from-font';\n }\n }\n\n if (isDimensionToken(token)) {\n // Convert to pixels\n return token.number;\n }\n\n // Default to auto\n return 'auto';\n }\n};\n","import { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken, isDimensionToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\n\nexport type TextUnderlineOffset = number | 'auto';\n\nexport const textUnderlineOffset: IPropertyValueDescriptor<TextUnderlineOffset> = {\n name: 'text-underline-offset',\n initialValue: 'auto',\n prefix: false,\n type: PropertyDescriptorParsingType.VALUE,\n parse: (_context: Context, token: CSSValue): TextUnderlineOffset => {\n if (isIdentToken(token)) {\n if (token.value === 'auto') {\n return 'auto';\n }\n }\n\n if (isDimensionToken(token)) {\n // Return pixel value\n return token.number;\n }\n\n // Default to auto\n return 'auto';\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue } from '../syntax/parser';\nimport { TokenType } from '../syntax/tokenizer';\nimport { Context } from '../../core/context';\n\nexport type FONT_FAMILY = string;\n\nexport type FontFamily = FONT_FAMILY[];\n\nexport const fontFamily: IPropertyListDescriptor<FontFamily> = {\n name: `font-family`,\n initialValue: '',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]) => {\n const accumulator: string[] = [];\n const results: string[] = [];\n tokens.forEach((token) => {\n switch (token.type) {\n case TokenType.IDENT_TOKEN:\n case TokenType.STRING_TOKEN:\n accumulator.push(token.value);\n break;\n case TokenType.NUMBER_TOKEN:\n accumulator.push(token.number.toString());\n break;\n case TokenType.COMMA_TOKEN:\n results.push(accumulator.join(' '));\n accumulator.length = 0;\n break;\n }\n });\n if (accumulator.length) {\n results.push(accumulator.join(' '));\n }\n return results.map((result) => (result.indexOf(' ') === -1 ? result : `'${result}'`));\n }\n};\n","import { IPropertyTypeValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\n\nexport const fontSize: IPropertyTypeValueDescriptor = {\n name: `font-size`,\n initialValue: '0',\n prefix: false,\n type: PropertyDescriptorParsingType.TYPE_VALUE,\n format: 'length'\n};\n","import { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken, isNumberToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\nexport const fontWeight: IPropertyValueDescriptor<number> = {\n name: 'font-weight',\n initialValue: 'normal',\n type: PropertyDescriptorParsingType.VALUE,\n prefix: false,\n parse: (_context: Context, token: CSSValue): number => {\n if (isNumberToken(token)) {\n return token.number;\n }\n\n if (isIdentToken(token)) {\n switch (token.value) {\n case 'bold':\n return 700;\n case 'normal':\n default:\n return 400;\n }\n }\n\n return 400;\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\nexport const fontVariant: IPropertyListDescriptor<string[]> = {\n name: 'font-variant',\n initialValue: 'none',\n type: PropertyDescriptorParsingType.LIST,\n prefix: false,\n parse: (_context: Context, tokens: CSSValue[]): string[] => {\n return tokens.filter(isIdentToken).map((token) => token.value);\n }\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport const enum FONT_STYLE {\n NORMAL = 'normal',\n ITALIC = 'italic',\n OBLIQUE = 'oblique'\n}\n\nexport const fontStyle: IPropertyIdentValueDescriptor<FONT_STYLE> = {\n name: 'font-style',\n initialValue: 'normal',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, overflow: string) => {\n switch (overflow) {\n case 'oblique':\n return FONT_STYLE.OBLIQUE;\n case 'italic':\n return FONT_STYLE.ITALIC;\n case 'normal':\n default:\n return FONT_STYLE.NORMAL;\n }\n }\n};\n","export const contains = (bit: number, value: number): boolean => (bit & value) !== 0;\n","import { TokenType } from '../syntax/tokenizer';\nimport { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue } from '../syntax/parser';\nimport { Context } from '../../core/context';\n\nexport type Content = CSSValue[];\n\nexport const content: IPropertyListDescriptor<Content> = {\n name: 'content',\n initialValue: 'none',\n type: PropertyDescriptorParsingType.LIST,\n prefix: false,\n parse: (_context: Context, tokens: CSSValue[]) => {\n if (tokens.length === 0) {\n return [];\n }\n\n const first = tokens[0];\n\n if (first.type === TokenType.IDENT_TOKEN && first.value === 'none') {\n return [];\n }\n\n return tokens;\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isNumberToken, nonWhiteSpace } from '../syntax/parser';\nimport { TokenType } from '../syntax/tokenizer';\nimport { Context } from '../../core/context';\n\nexport interface COUNTER_INCREMENT {\n counter: string;\n increment: number;\n}\n\nexport type CounterIncrement = COUNTER_INCREMENT[] | null;\n\nexport const counterIncrement: IPropertyListDescriptor<CounterIncrement> = {\n name: 'counter-increment',\n initialValue: 'none',\n prefix: true,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]) => {\n if (tokens.length === 0) {\n return null;\n }\n\n const first = tokens[0];\n\n if (first.type === TokenType.IDENT_TOKEN && first.value === 'none') {\n return null;\n }\n\n const increments = [];\n const filtered = tokens.filter(nonWhiteSpace);\n\n for (let i = 0; i < filtered.length; i++) {\n const counter = filtered[i];\n const next = filtered[i + 1];\n if (counter.type === TokenType.IDENT_TOKEN) {\n const increment = next && isNumberToken(next) ? next.number : 1;\n increments.push({ counter: counter.value, increment });\n }\n }\n\n return increments;\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken, isNumberToken, nonWhiteSpace } from '../syntax/parser';\nimport { Context } from '../../core/context';\n\nexport interface COUNTER_RESET {\n counter: string;\n reset: number;\n}\n\nexport type CounterReset = COUNTER_RESET[];\n\nexport const counterReset: IPropertyListDescriptor<CounterReset> = {\n name: 'counter-reset',\n initialValue: 'none',\n prefix: true,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]) => {\n if (tokens.length === 0) {\n return [];\n }\n\n const resets = [];\n const filtered = tokens.filter(nonWhiteSpace);\n\n for (let i = 0; i < filtered.length; i++) {\n const counter = filtered[i];\n const next = filtered[i + 1];\n if (isIdentToken(counter) && counter.value !== 'none') {\n const reset = next && isNumberToken(next) ? next.number : 0;\n resets.push({ counter: counter.value, reset });\n }\n }\n\n return resets;\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nimport { CSSValue, isDimensionToken } from '../syntax/parser';\nimport { time } from '../types/time';\n\nexport const duration: IPropertyListDescriptor<number[]> = {\n name: 'duration',\n initialValue: '0s',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (context: Context, tokens: CSSValue[]) => {\n return tokens.filter(isDimensionToken).map((token) => time.parse(context, token));\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isStringToken } from '../syntax/parser';\nimport { TokenType } from '../syntax/tokenizer';\nimport { Context } from '../../core/context';\n\nexport interface QUOTE {\n open: string;\n close: string;\n}\n\nexport type Quotes = QUOTE[] | null;\n\nexport const quotes: IPropertyListDescriptor<Quotes> = {\n name: 'quotes',\n initialValue: 'none',\n prefix: true,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]) => {\n if (tokens.length === 0) {\n return null;\n }\n\n const first = tokens[0];\n\n if (first.type === TokenType.IDENT_TOKEN && first.value === 'none') {\n return null;\n }\n\n const quotes = [];\n const filtered = tokens.filter(isStringToken);\n\n if (filtered.length % 2 !== 0) {\n return null;\n }\n\n for (let i = 0; i < filtered.length; i += 2) {\n const open = filtered[i].value;\n const close = filtered[i + 1].value;\n quotes.push({ open, close });\n }\n\n return quotes;\n }\n};\n\nexport const getQuote = (quotes: Quotes, depth: number, open: boolean): string => {\n if (!quotes) {\n return '';\n }\n\n const quote = quotes[Math.min(depth, quotes.length - 1)];\n if (!quote) {\n return '';\n }\n\n return open ? quote.open : quote.close;\n};\n","import { PropertyDescriptorParsingType, IPropertyListDescriptor } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentWithValue, parseFunctionArgs } from '../syntax/parser';\nimport { ZERO_LENGTH } from '../types/length-percentage';\nimport { color, Color } from '../types/color';\nimport { isLength, Length } from '../types/length';\nimport { Context } from '../../core/context';\n\nexport type BoxShadow = BoxShadowItem[];\ninterface BoxShadowItem {\n inset: boolean;\n color: Color;\n offsetX: Length;\n offsetY: Length;\n blur: Length;\n spread: Length;\n}\n\nexport const boxShadow: IPropertyListDescriptor<BoxShadow> = {\n name: 'box-shadow',\n initialValue: 'none',\n type: PropertyDescriptorParsingType.LIST,\n prefix: false,\n parse: (context: Context, tokens: CSSValue[]): BoxShadow => {\n if (tokens.length === 1 && isIdentWithValue(tokens[0], 'none')) {\n return [];\n }\n\n return parseFunctionArgs(tokens).map((values: CSSValue[]) => {\n const shadow: BoxShadowItem = {\n color: 0x000000ff,\n offsetX: ZERO_LENGTH,\n offsetY: ZERO_LENGTH,\n blur: ZERO_LENGTH,\n spread: ZERO_LENGTH,\n inset: false\n };\n let c = 0;\n for (let i = 0; i < values.length; i++) {\n const token = values[i];\n if (isIdentWithValue(token, 'inset')) {\n shadow.inset = true;\n } else if (isLength(token)) {\n if (c === 0) {\n shadow.offsetX = token;\n } else if (c === 1) {\n shadow.offsetY = token;\n } else if (c === 2) {\n shadow.blur = token;\n } else {\n shadow.spread = token;\n }\n c++;\n } else {\n shadow.color = color.parse(context, token);\n }\n }\n return shadow;\n });\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\nexport const enum PAINT_ORDER_LAYER {\n FILL,\n STROKE,\n MARKERS\n}\n\nexport type PaintOrder = PAINT_ORDER_LAYER[];\n\nexport const paintOrder: IPropertyListDescriptor<PaintOrder> = {\n name: 'paint-order',\n initialValue: 'normal',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]): PaintOrder => {\n const DEFAULT_VALUE = [PAINT_ORDER_LAYER.FILL, PAINT_ORDER_LAYER.STROKE, PAINT_ORDER_LAYER.MARKERS];\n const layers: PaintOrder = [];\n\n tokens.filter(isIdentToken).forEach((token) => {\n switch (token.value) {\n case 'stroke':\n layers.push(PAINT_ORDER_LAYER.STROKE);\n break;\n case 'fill':\n layers.push(PAINT_ORDER_LAYER.FILL);\n break;\n case 'markers':\n layers.push(PAINT_ORDER_LAYER.MARKERS);\n break;\n }\n });\n DEFAULT_VALUE.forEach((value) => {\n if (layers.indexOf(value) === -1) {\n layers.push(value);\n }\n });\n\n return layers;\n }\n};\n","import { IPropertyTypeValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nexport const webkitTextStrokeColor: IPropertyTypeValueDescriptor = {\n name: `-webkit-text-stroke-color`,\n initialValue: 'currentcolor',\n prefix: false,\n type: PropertyDescriptorParsingType.TYPE_VALUE,\n format: 'color'\n};\n","import { CSSValue, isDimensionToken } from '../syntax/parser';\nimport { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\nexport const webkitTextStrokeWidth: IPropertyValueDescriptor<number> = {\n name: `-webkit-text-stroke-width`,\n initialValue: '0',\n type: PropertyDescriptorParsingType.VALUE,\n prefix: false,\n parse: (_context: Context, token: CSSValue): number => {\n if (isDimensionToken(token)) {\n return token.number;\n }\n return 0;\n }\n};\n","import { IPropertyValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue } from '../syntax/parser';\nimport { TokenType } from '../syntax/tokenizer';\nimport { Context } from '../../core/context';\n\n/**\n * -webkit-line-clamp property descriptor\n * Used with display: -webkit-box and -webkit-box-orient: vertical\n * to limit text to a specific number of lines\n */\nexport const webkitLineClamp: IPropertyValueDescriptor<number> = {\n name: '-webkit-line-clamp',\n initialValue: 'none',\n prefix: true,\n type: PropertyDescriptorParsingType.VALUE,\n parse: (_context: Context, token: CSSValue) => {\n // 'none' means no line clamping\n if (token.type === TokenType.IDENT_TOKEN && token.value === 'none') {\n return 0;\n }\n\n // Number value specifies the number of lines\n if (token.type === TokenType.NUMBER_TOKEN) {\n return Math.max(0, Math.floor(token.number));\n }\n\n // Default to 0 (no clamping)\n return 0;\n }\n};\n","import { IPropertyListDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { CSSValue, isIdentToken } from '../syntax/parser';\nimport { Context } from '../../core/context';\nexport const enum OBJECT_FIT {\n FILL = 0,\n CONTAIN = 1 << 1,\n COVER = 1 << 2,\n NONE = 1 << 3,\n SCALE_DOWN = 1 << 4\n}\n\nexport type ObjectFit = number;\n\nexport const objectFit: IPropertyListDescriptor<ObjectFit> = {\n name: 'objectFit',\n initialValue: 'fill',\n prefix: false,\n type: PropertyDescriptorParsingType.LIST,\n parse: (_context: Context, tokens: CSSValue[]): ObjectFit => {\n return tokens.filter(isIdentToken).reduce((bit, token) => {\n return bit | parseDisplayValue(token.value);\n }, OBJECT_FIT.FILL);\n }\n};\n\nconst parseDisplayValue = (display: string): ObjectFit => {\n switch (display) {\n case 'contain':\n return OBJECT_FIT.CONTAIN;\n case 'cover':\n return OBJECT_FIT.COVER;\n case 'none':\n return OBJECT_FIT.NONE;\n case 'scale-down':\n return OBJECT_FIT.SCALE_DOWN;\n }\n\n return OBJECT_FIT.FILL;\n};\n","import { IPropertyIdentValueDescriptor, PropertyDescriptorParsingType } from '../IPropertyDescriptor';\nimport { Context } from '../../core/context';\n\nexport const enum TEXT_OVERFLOW {\n CLIP = 0,\n ELLIPSIS = 1\n}\n\nexport const textOverflow: IPropertyIdentValueDescriptor<TEXT_OVERFLOW> = {\n name: 'text-overflow',\n initialValue: 'clip',\n prefix: false,\n type: PropertyDescriptorParsingType.IDENT_VALUE,\n parse: (_context: Context, textOverflow: string) => {\n switch (textOverflow) {\n case 'ellipsis':\n return TEXT_OVERFLOW.ELLIPSIS;\n case 'clip':\n default:\n return TEXT_OVERFLOW.CLIP;\n }\n }\n};\n","import { CSSPropertyDescriptor, PropertyDescriptorParsingType } from './IPropertyDescriptor';\nimport { backgroundClip } from './property-descriptors/background-clip';\nimport { backgroundColor } from './property-descriptors/background-color';\nimport { backgroundImage } from './property-descriptors/background-image';\nimport { backgroundOrigin } from './property-descriptors/background-origin';\nimport { backgroundPosition } from './property-descriptors/background-position';\nimport { backgroundRepeat } from './property-descriptors/background-repeat';\nimport { backgroundSize } from './property-descriptors/background-size';\nimport {\n borderBottomColor,\n borderLeftColor,\n borderRightColor,\n borderTopColor\n} from './property-descriptors/border-color';\nimport {\n borderBottomLeftRadius,\n borderBottomRightRadius,\n borderTopLeftRadius,\n borderTopRightRadius\n} from './property-descriptors/border-radius';\nimport {\n borderBottomStyle,\n borderLeftStyle,\n borderRightStyle,\n borderTopStyle\n} from './property-descriptors/border-style';\nimport {\n borderBottomWidth,\n borderLeftWidth,\n borderRightWidth,\n borderTopWidth\n} from './property-descriptors/border-width';\nimport { color } from './property-descriptors/color';\nimport { direction } from './property-descriptors/direction';\nimport { display, DISPLAY } from './property-descriptors/display';\nimport { float, FLOAT } from './property-descriptors/float';\nimport { letterSpacing } from './property-descriptors/letter-spacing';\nimport { lineBreak } from './property-descriptors/line-break';\nimport { lineHeight } from './property-descriptors/line-height';\nimport { listStyleImage } from './property-descriptors/list-style-image';\nimport { listStylePosition } from './property-descriptors/list-style-position';\nimport { listStyleType } from './property-descriptors/list-style-type';\nimport { marginBottom, marginLeft, marginRight, marginTop } from './property-descriptors/margin';\nimport { overflow, OVERFLOW } from './property-descriptors/overflow';\nimport { overflowWrap } from './property-descriptors/overflow-wrap';\nimport { paddingBottom, paddingLeft, paddingRight, paddingTop } from './property-descriptors/padding';\nimport { textAlign } from './property-descriptors/text-align';\nimport { position, POSITION } from './property-descriptors/position';\nimport { textShadow } from './property-descriptors/text-shadow';\nimport { textTransform } from './property-descriptors/text-transform';\nimport { transform } from './property-descriptors/transform';\nimport { transformOrigin } from './property-descriptors/transform-origin';\nimport { rotate } from './property-descriptors/rotate';\nimport { visibility, VISIBILITY } from './property-descriptors/visibility';\nimport { wordBreak } from './property-descriptors/word-break';\nimport { zIndex } from './property-descriptors/z-index';\nimport { CSSValue, isIdentToken, Parser } from './syntax/parser';\nimport { Tokenizer } from './syntax/tokenizer';\nimport { Color, color as colorType } from './types/color';\nimport { isTransparent } from './types/color-utilities';\nimport { angle } from './types/angle';\nimport { image } from './types/image';\nimport { time } from './types/time';\nimport { opacity } from './property-descriptors/opacity';\nimport { textDecorationColor } from './property-descriptors/text-decoration-color';\nimport { textDecorationLine } from './property-descriptors/text-decoration-line';\nimport { textDecorationStyle } from './property-descriptors/text-decoration-style';\nimport { textDecorationThickness } from './property-descriptors/text-decoration-thickness';\nimport { textUnderlineOffset } from './property-descriptors/text-underline-offset';\nimport { isLengthPercentage, LengthPercentage, ZERO_LENGTH } from './types/length-percentage';\nimport { fontFamily } from './property-descriptors/font-family';\nimport { fontSize } from './property-descriptors/font-size';\nimport { isLength } from './types/length';\nimport { fontWeight } from './property-descriptors/font-weight';\nimport { fontVariant } from './property-descriptors/font-variant';\nimport { fontStyle } from './property-descriptors/font-style';\nimport { contains } from '../core/bitwise';\nimport { content } from './property-descriptors/content';\nimport { counterIncrement } from './property-descriptors/counter-increment';\nimport { counterReset } from './property-descriptors/counter-reset';\nimport { duration } from './property-descriptors/duration';\nimport { quotes } from './property-descriptors/quotes';\nimport { boxShadow } from './property-descriptors/box-shadow';\nimport { paintOrder } from './property-descriptors/paint-order';\nimport { webkitTextStrokeColor } from './property-descriptors/webkit-text-stroke-color';\nimport { webkitTextStrokeWidth } from './property-descriptors/webkit-text-stroke-width';\nimport { webkitLineClamp } from './property-descriptors/webkit-line-clamp';\nimport { Context } from '../core/context';\nimport { objectFit } from './property-descriptors/object-fit';\nimport { textOverflow } from './property-descriptors/text-overflow';\n\nexport class CSSParsedDeclaration {\n animationDuration: ReturnType<typeof duration.parse>;\n backgroundClip: ReturnType<typeof backgroundClip.parse>;\n backgroundColor: Color;\n backgroundImage: ReturnType<typeof backgroundImage.parse>;\n backgroundOrigin: ReturnType<typeof backgroundOrigin.parse>;\n backgroundPosition: ReturnType<typeof backgroundPosition.parse>;\n backgroundRepeat: ReturnType<typeof backgroundRepeat.parse>;\n backgroundSize: ReturnType<typeof backgroundSize.parse>;\n borderTopColor: Color;\n borderRightColor: Color;\n borderBottomColor: Color;\n borderLeftColor: Color;\n borderTopLeftRadius: ReturnType<typeof borderTopLeftRadius.parse>;\n borderTopRightRadius: ReturnType<typeof borderTopRightRadius.parse>;\n borderBottomRightRadius: ReturnType<typeof borderBottomRightRadius.parse>;\n borderBottomLeftRadius: ReturnType<typeof borderBottomLeftRadius.parse>;\n borderTopStyle: ReturnType<typeof borderTopStyle.parse>;\n borderRightStyle: ReturnType<typeof borderRightStyle.parse>;\n borderBottomStyle: ReturnType<typeof borderBottomStyle.parse>;\n borderLeftStyle: ReturnType<typeof borderLeftStyle.parse>;\n borderTopWidth: ReturnType<typeof borderTopWidth.parse>;\n borderRightWidth: ReturnType<typeof borderRightWidth.parse>;\n borderBottomWidth: ReturnType<typeof borderBottomWidth.parse>;\n borderLeftWidth: ReturnType<typeof borderLeftWidth.parse>;\n boxShadow: ReturnType<typeof boxShadow.parse>;\n color: Color;\n direction: ReturnType<typeof direction.parse>;\n display: ReturnType<typeof display.parse>;\n float: ReturnType<typeof float.parse>;\n fontFamily: ReturnType<typeof fontFamily.parse>;\n fontSize: LengthPercentage;\n fontStyle: ReturnType<typeof fontStyle.parse>;\n fontVariant: ReturnType<typeof fontVariant.parse>;\n fontWeight: ReturnType<typeof fontWeight.parse>;\n letterSpacing: ReturnType<typeof letterSpacing.parse>;\n lineBreak: ReturnType<typeof lineBreak.parse>;\n lineHeight: CSSValue;\n listStyleImage: ReturnType<typeof listStyleImage.parse>;\n listStylePosition: ReturnType<typeof listStylePosition.parse>;\n listStyleType: ReturnType<typeof listStyleType.parse>;\n marginTop: CSSValue;\n marginRight: CSSValue;\n marginBottom: CSSValue;\n marginLeft: CSSValue;\n opacity: ReturnType<typeof opacity.parse>;\n overflowX: OVERFLOW;\n overflowY: OVERFLOW;\n overflowWrap: ReturnType<typeof overflowWrap.parse>;\n paddingTop: LengthPercentage;\n paddingRight: LengthPercentage;\n paddingBottom: LengthPercentage;\n paddingLeft: LengthPercentage;\n paintOrder: ReturnType<typeof paintOrder.parse>;\n position: ReturnType<typeof position.parse>;\n textAlign: ReturnType<typeof textAlign.parse>;\n textDecorationColor: Color;\n textDecorationLine: ReturnType<typeof textDecorationLine.parse>;\n textDecorationStyle: ReturnType<typeof textDecorationStyle.parse>;\n textDecorationThickness: ReturnType<typeof textDecorationThickness.parse>;\n textUnderlineOffset: ReturnType<typeof textUnderlineOffset.parse>;\n textShadow: ReturnType<typeof textShadow.parse>;\n textTransform: ReturnType<typeof textTransform.parse>;\n textOverflow: ReturnType<typeof textOverflow.parse>;\n transform: ReturnType<typeof transform.parse>;\n transformOrigin: ReturnType<typeof transformOrigin.parse>;\n rotate: ReturnType<typeof rotate.parse>;\n visibility: ReturnType<typeof visibility.parse>;\n webkitTextStrokeColor: Color;\n webkitTextStrokeWidth: ReturnType<typeof webkitTextStrokeWidth.parse>;\n webkitLineClamp: ReturnType<typeof webkitLineClamp.parse>;\n wordBreak: ReturnType<typeof wordBreak.parse>;\n zIndex: ReturnType<typeof zIndex.parse>;\n objectFit: ReturnType<typeof objectFit.parse>;\n\n constructor(context: Context, declaration: CSSStyleDeclaration) {\n this.animationDuration = parse(context, duration, declaration.animationDuration);\n this.backgroundClip = parse(context, backgroundClip, declaration.backgroundClip);\n this.backgroundColor = parse(context, backgroundColor, declaration.backgroundColor);\n this.backgroundImage = parse(context, backgroundImage, declaration.backgroundImage);\n this.backgroundOrigin = parse(context, backgroundOrigin, declaration.backgroundOrigin);\n this.backgroundPosition = parse(context, backgroundPosition, declaration.backgroundPosition);\n this.backgroundRepeat = parse(context, backgroundRepeat, declaration.backgroundRepeat);\n this.backgroundSize = parse(context, backgroundSize, declaration.backgroundSize);\n this.borderTopColor = parse(context, borderTopColor, declaration.borderTopColor);\n this.borderRightColor = parse(context, borderRightColor, declaration.borderRightColor);\n this.borderBottomColor = parse(context, borderBottomColor, declaration.borderBottomColor);\n this.borderLeftColor = parse(context, borderLeftColor, declaration.borderLeftColor);\n this.borderTopLeftRadius = parse(context, borderTopLeftRadius, declaration.borderTopLeftRadius);\n this.borderTopRightRadius = parse(context, borderTopRightRadius, declaration.borderTopRightRadius);\n this.borderBottomRightRadius = parse(context, borderBottomRightRadius, declaration.borderBottomRightRadius);\n this.borderBottomLeftRadius = parse(context, borderBottomLeftRadius, declaration.borderBottomLeftRadius);\n this.borderTopStyle = parse(context, borderTopStyle, declaration.borderTopStyle);\n this.borderRightStyle = parse(context, borderRightStyle, declaration.borderRightStyle);\n this.borderBottomStyle = parse(context, borderBottomStyle, declaration.borderBottomStyle);\n this.borderLeftStyle = parse(context, borderLeftStyle, declaration.borderLeftStyle);\n this.borderTopWidth = parse(context, borderTopWidth, declaration.borderTopWidth);\n this.borderRightWidth = parse(context, borderRightWidth, declaration.borderRightWidth);\n this.borderBottomWidth = parse(context, borderBottomWidth, declaration.borderBottomWidth);\n this.borderLeftWidth = parse(context, borderLeftWidth, declaration.borderLeftWidth);\n this.boxShadow = parse(context, boxShadow, declaration.boxShadow);\n this.color = parse(context, color, declaration.color);\n this.direction = parse(context, direction, declaration.direction);\n this.display = parse(context, display, declaration.display);\n this.float = parse(context, float, declaration.cssFloat);\n this.fontFamily = parse(context, fontFamily, declaration.fontFamily);\n this.fontSize = parse(context, fontSize, declaration.fontSize);\n this.fontStyle = parse(context, fontStyle, declaration.fontStyle);\n this.fontVariant = parse(context, fontVariant, declaration.fontVariant);\n this.fontWeight = parse(context, fontWeight, declaration.fontWeight);\n this.letterSpacing = parse(context, letterSpacing, declaration.letterSpacing);\n this.lineBreak = parse(context, lineBreak, declaration.lineBreak);\n this.lineHeight = parse(context, lineHeight, declaration.lineHeight);\n this.listStyleImage = parse(context, listStyleImage, declaration.listStyleImage);\n this.listStylePosition = parse(context, listStylePosition, declaration.listStylePosition);\n this.listStyleType = parse(context, listStyleType, declaration.listStyleType);\n this.marginTop = parse(context, marginTop, declaration.marginTop);\n this.marginRight = parse(context, marginRight, declaration.marginRight);\n this.marginBottom = parse(context, marginBottom, declaration.marginBottom);\n this.marginLeft = parse(context, marginLeft, declaration.marginLeft);\n this.opacity = parse(context, opacity, declaration.opacity);\n const overflowTuple = parse(context, overflow, declaration.overflow);\n this.overflowX = overflowTuple[0];\n this.overflowY = overflowTuple[overflowTuple.length > 1 ? 1 : 0];\n this.overflowWrap = parse(context, overflowWrap, declaration.overflowWrap);\n this.paddingTop = parse(context, paddingTop, declaration.paddingTop);\n this.paddingRight = parse(context, paddingRight, declaration.paddingRight);\n this.paddingBottom = parse(context, paddingBottom, declaration.paddingBottom);\n this.paddingLeft = parse(context, paddingLeft, declaration.paddingLeft);\n this.paintOrder = parse(context, paintOrder, declaration.paintOrder);\n this.position = parse(context, position, declaration.position);\n this.textAlign = parse(context, textAlign, declaration.textAlign);\n this.textDecorationColor = parse(\n context,\n textDecorationColor,\n declaration.textDecorationColor ?? declaration.color\n );\n this.textDecorationLine = parse(\n context,\n textDecorationLine,\n declaration.textDecorationLine ?? declaration.textDecoration\n );\n this.textDecorationStyle = parse(context, textDecorationStyle, declaration.textDecorationStyle);\n this.textDecorationThickness = parse(context, textDecorationThickness, declaration.textDecorationThickness);\n this.textUnderlineOffset = parse(context, textUnderlineOffset, declaration.textUnderlineOffset);\n this.textShadow = parse(context, textShadow, declaration.textShadow);\n this.textTransform = parse(context, textTransform, declaration.textTransform);\n this.textOverflow = parse(context, textOverflow, declaration.textOverflow);\n this.transform = parse(context, transform, declaration.transform);\n this.transformOrigin = parse(context, transformOrigin, declaration.transformOrigin);\n this.rotate = parse(context, rotate, declaration.rotate);\n this.visibility = parse(context, visibility, declaration.visibility);\n this.webkitTextStrokeColor = parse(context, webkitTextStrokeColor, declaration.webkitTextStrokeColor);\n this.webkitTextStrokeWidth = parse(context, webkitTextStrokeWidth, declaration.webkitTextStrokeWidth);\n this.webkitLineClamp = parse(context, webkitLineClamp, declaration.webkitLineClamp);\n this.wordBreak = parse(context, wordBreak, declaration.wordBreak);\n this.zIndex = parse(context, zIndex, declaration.zIndex);\n this.objectFit = parse(context, objectFit, declaration.objectFit);\n }\n\n isVisible(): boolean {\n return this.display > 0 && this.opacity > 0 && this.visibility === VISIBILITY.VISIBLE;\n }\n\n isTransparent(): boolean {\n return isTransparent(this.backgroundColor);\n }\n\n isTransformed(): boolean {\n return this.transform !== null || this.rotate !== null;\n }\n\n isPositioned(): boolean {\n return this.position !== POSITION.STATIC;\n }\n\n isPositionedWithZIndex(): boolean {\n return this.isPositioned() && !this.zIndex.auto;\n }\n\n isFloating(): boolean {\n return this.float !== FLOAT.NONE;\n }\n\n isInlineLevel(): boolean {\n return (\n contains(this.display, DISPLAY.INLINE) ||\n contains(this.display, DISPLAY.INLINE_BLOCK) ||\n contains(this.display, DISPLAY.INLINE_FLEX) ||\n contains(this.display, DISPLAY.INLINE_GRID) ||\n contains(this.display, DISPLAY.INLINE_LIST_ITEM) ||\n contains(this.display, DISPLAY.INLINE_TABLE)\n );\n }\n}\n\nexport class CSSParsedPseudoDeclaration {\n content: ReturnType<typeof content.parse>;\n quotes: ReturnType<typeof quotes.parse>;\n\n constructor(context: Context, declaration: CSSStyleDeclaration) {\n this.content = parse(context, content, declaration.content);\n this.quotes = parse(context, quotes, declaration.quotes);\n }\n}\n\nexport class CSSParsedCounterDeclaration {\n counterIncrement: ReturnType<typeof counterIncrement.parse>;\n counterReset: ReturnType<typeof counterReset.parse>;\n\n constructor(context: Context, declaration: CSSStyleDeclaration) {\n this.counterIncrement = parse(context, counterIncrement, declaration.counterIncrement);\n this.counterReset = parse(context, counterReset, declaration.counterReset);\n }\n}\n\nconst parse = (context: Context, descriptor: CSSPropertyDescriptor<any>, style?: string | null) => {\n const tokenizer = new Tokenizer();\n const value = style !== null && typeof style !== 'undefined' ? style.toString() : descriptor.initialValue;\n tokenizer.write(value);\n const parser = new Parser(tokenizer.read());\n switch (descriptor.type) {\n case PropertyDescriptorParsingType.IDENT_VALUE:\n const token = parser.parseComponentValue();\n return descriptor.parse(context, isIdentToken(token) ? token.value : descriptor.initialValue);\n case PropertyDescriptorParsingType.VALUE:\n return descriptor.parse(context, parser.parseComponentValue());\n case PropertyDescriptorParsingType.LIST:\n return descriptor.parse(context, parser.parseComponentValues());\n case PropertyDescriptorParsingType.TOKEN_VALUE:\n return parser.parseComponentValue();\n case PropertyDescriptorParsingType.TYPE_VALUE:\n switch (descriptor.format) {\n case 'angle':\n return angle.parse(context, parser.parseComponentValue());\n case 'color':\n return colorType.parse(context, parser.parseComponentValue());\n case 'image':\n return image.parse(context, parser.parseComponentValue());\n case 'length':\n const length = parser.parseComponentValue();\n return isLength(length) ? length : ZERO_LENGTH;\n case 'length-percentage':\n const value = parser.parseComponentValue();\n return isLengthPercentage(value) ? value : ZERO_LENGTH;\n case 'time':\n return time.parse(context, parser.parseComponentValue());\n }\n break;\n }\n};\n","const elementDebuggerAttribute = 'data-html2canvas-debug';\nexport const enum DebuggerType {\n NONE,\n ALL,\n CLONE,\n PARSE,\n RENDER\n}\n\nconst getElementDebugType = (element: Element): DebuggerType => {\n const attribute = element.getAttribute(elementDebuggerAttribute);\n switch (attribute) {\n case 'all':\n return DebuggerType.ALL;\n case 'clone':\n return DebuggerType.CLONE;\n case 'parse':\n return DebuggerType.PARSE;\n case 'render':\n return DebuggerType.RENDER;\n default:\n return DebuggerType.NONE;\n }\n};\n\nexport const isDebugging = (element: Element, type: Omit<DebuggerType, DebuggerType.NONE>): boolean => {\n const elementType = getElementDebugType(element);\n return elementType === DebuggerType.ALL || type === elementType;\n};\n","import { CSSParsedDeclaration } from '../css/index';\nimport { TextContainer } from './text-container';\nimport { Bounds, parseBounds } from '../css/layout/bounds';\nimport { isHTMLElementNode } from './node-parser';\nimport { Context } from '../core/context';\nimport { DebuggerType, isDebugging } from '../core/debugger';\n\nexport const enum FLAGS {\n CREATES_STACKING_CONTEXT = 1 << 1,\n CREATES_REAL_STACKING_CONTEXT = 1 << 2,\n IS_LIST_OWNER = 1 << 3,\n DEBUG_RENDER = 1 << 4\n}\n\nexport class ElementContainer {\n readonly styles: CSSParsedDeclaration;\n readonly textNodes: TextContainer[] = [];\n readonly elements: ElementContainer[] = [];\n bounds: Bounds;\n flags = 0;\n\n constructor(\n protected readonly context: Context,\n element: Element\n ) {\n if (isDebugging(element, DebuggerType.PARSE)) {\n debugger;\n }\n\n this.styles = new CSSParsedDeclaration(context, window.getComputedStyle(element, null));\n\n if (isHTMLElementNode(element)) {\n if (this.styles.animationDuration.some((duration) => duration > 0)) {\n element.style.animationDuration = '0s';\n }\n\n if (this.styles.transform !== null) {\n // getBoundingClientRect takes transforms into account\n element.style.transform = 'none';\n }\n\n if (this.styles.rotate !== null) {\n // Handle rotate property similarly to transform\n element.style.rotate = 'none';\n }\n }\n\n this.bounds = parseBounds(this.context, element);\n\n if (isDebugging(element, DebuggerType.RENDER)) {\n this.flags |= FLAGS.DEBUG_RENDER;\n }\n }\n}\n","export const base64 =\n 'AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAC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wU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVA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pgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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DEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\n// Use a lookup table to find the index.\nconst lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\n\nexport const decode = (base64: string): ArrayBuffer | number[] => {\n let bufferLength = base64.length * 0.75,\n len = base64.length,\n i,\n p = 0,\n encoded1,\n encoded2,\n encoded3,\n encoded4;\n\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n\n const buffer =\n typeof ArrayBuffer !== 'undefined' &&\n typeof Uint8Array !== 'undefined' &&\n typeof Uint8Array.prototype.slice !== 'undefined'\n ? new ArrayBuffer(bufferLength)\n : new Array(bufferLength);\n const bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);\n\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n\n return buffer;\n};\n\nexport const polyUint16Array = (buffer: number[]): number[] => {\n const length = buffer.length;\n const bytes = [];\n for (let i = 0; i < length; i += 2) {\n bytes.push((buffer[i + 1] << 8) | buffer[i]);\n }\n return bytes;\n};\n\nexport const polyUint32Array = (buffer: number[]): number[] => {\n const length = buffer.length;\n const bytes = [];\n for (let i = 0; i < length; i += 4) {\n bytes.push((buffer[i + 3] << 24) | (buffer[i + 2] << 16) | (buffer[i + 1] << 8) | buffer[i]);\n }\n return bytes;\n};\n","import {decode, polyUint16Array, polyUint32Array} from './Util';\n\nexport type int = number;\n\n/** Shift size for getting the index-2 table offset. */\nexport const UTRIE2_SHIFT_2 = 5;\n\n/** Shift size for getting the index-1 table offset. */\nexport const UTRIE2_SHIFT_1 = 6 + 5;\n\n/**\n * Shift size for shifting left the index array values.\n * Increases possible data size with 16-bit index values at the cost\n * of compactability.\n * This requires data blocks to be aligned by UTRIE2_DATA_GRANULARITY.\n */\nexport const UTRIE2_INDEX_SHIFT = 2;\n\n/**\n * Difference between the two shift sizes,\n * for getting an index-1 offset from an index-2 offset. 6=11-5\n */\nexport const UTRIE2_SHIFT_1_2 = UTRIE2_SHIFT_1 - UTRIE2_SHIFT_2;\n\n/**\n * The part of the index-2 table for U+D800..U+DBFF stores values for\n * lead surrogate code _units_ not code _points_.\n * Values for lead surrogate code _points_ are indexed with this portion of the table.\n * Length=32=0x20=0x400>>UTRIE2_SHIFT_2. (There are 1024=0x400 lead surrogates.)\n */\nexport const UTRIE2_LSCP_INDEX_2_OFFSET = 0x10000 >> UTRIE2_SHIFT_2;\n\n/** Number of entries in a data block. 32=0x20 */\nexport const UTRIE2_DATA_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_2;\n/** Mask for getting the lower bits for the in-data-block offset. */\nexport const UTRIE2_DATA_MASK = UTRIE2_DATA_BLOCK_LENGTH - 1;\n\nexport const UTRIE2_LSCP_INDEX_2_LENGTH = 0x400 >> UTRIE2_SHIFT_2;\n/** Count the lengths of both BMP pieces. 2080=0x820 */\nexport const UTRIE2_INDEX_2_BMP_LENGTH = UTRIE2_LSCP_INDEX_2_OFFSET + UTRIE2_LSCP_INDEX_2_LENGTH;\n/**\n * The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820.\n * Length 32=0x20 for lead bytes C0..DF, regardless of UTRIE2_SHIFT_2.\n */\nexport const UTRIE2_UTF8_2B_INDEX_2_OFFSET = UTRIE2_INDEX_2_BMP_LENGTH;\nexport const UTRIE2_UTF8_2B_INDEX_2_LENGTH = 0x800 >> 6; /* U+0800 is the first code point after 2-byte UTF-8 */\n/**\n * The index-1 table, only used for supplementary code points, at offset 2112=0x840.\n * Variable length, for code points up to highStart, where the last single-value range starts.\n * Maximum length 512=0x200=0x100000>>UTRIE2_SHIFT_1.\n * (For 0x100000 supplementary code points U+10000..U+10ffff.)\n *\n * The part of the index-2 table for supplementary code points starts\n * after this index-1 table.\n *\n * Both the index-1 table and the following part of the index-2 table\n * are omitted completely if there is only BMP data.\n */\nexport const UTRIE2_INDEX_1_OFFSET = UTRIE2_UTF8_2B_INDEX_2_OFFSET + UTRIE2_UTF8_2B_INDEX_2_LENGTH;\n\n/**\n * Number of index-1 entries for the BMP. 32=0x20\n * This part of the index-1 table is omitted from the serialized form.\n */\nexport const UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> UTRIE2_SHIFT_1;\n\n/** Number of entries in an index-2 block. 64=0x40 */\nexport const UTRIE2_INDEX_2_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_1_2;\n/** Mask for getting the lower bits for the in-index-2-block offset. */\nexport const UTRIE2_INDEX_2_MASK = UTRIE2_INDEX_2_BLOCK_LENGTH - 1;\n\nconst slice16 = (view: number[] | Uint16Array, start: number, end?: number) => {\n if (view.slice) {\n return view.slice(start, end);\n }\n\n return new Uint16Array(Array.prototype.slice.call(view, start, end));\n};\n\nconst slice32 = (view: number[] | Uint32Array, start: number, end?: number) => {\n if (view.slice) {\n return view.slice(start, end);\n }\n\n return new Uint32Array(Array.prototype.slice.call(view, start, end));\n};\n\nexport const createTrieFromBase64 = (base64: string, _byteLength: number): Trie => {\n const buffer = decode(base64);\n const view32 = Array.isArray(buffer) ? polyUint32Array(buffer) : new Uint32Array(buffer);\n const view16 = Array.isArray(buffer) ? polyUint16Array(buffer) : new Uint16Array(buffer);\n const headerLength = 24;\n\n const index = slice16(view16, headerLength / 2, view32[4] / 2);\n const data =\n view32[5] === 2\n ? slice16(view16, (headerLength + view32[4]) / 2)\n : slice32(view32, Math.ceil((headerLength + view32[4]) / 4));\n\n return new Trie(view32[0], view32[1], view32[2], view32[3], index, data);\n};\n\nexport class Trie {\n initialValue: int;\n errorValue: int;\n highStart: int;\n highValueIndex: int;\n index: Uint16Array | number[];\n data: Uint32Array | Uint16Array | number[];\n\n constructor(\n initialValue: int,\n errorValue: int,\n highStart: int,\n highValueIndex: int,\n index: Uint16Array | number[],\n data: Uint32Array | Uint16Array | number[]\n ) {\n this.initialValue = initialValue;\n this.errorValue = errorValue;\n this.highStart = highStart;\n this.highValueIndex = highValueIndex;\n this.index = index;\n this.data = data;\n }\n\n /**\n * Get the value for a code point as stored in the Trie.\n *\n * @param codePoint the code point\n * @return the value\n */\n get(codePoint: number): number {\n let ix;\n if (codePoint >= 0) {\n if (codePoint < 0x0d800 || (codePoint > 0x0dbff && codePoint <= 0x0ffff)) {\n // Ordinary BMP code point, excluding leading surrogates.\n // BMP uses a single level lookup. BMP index starts at offset 0 in the Trie2 index.\n // 16 bit data is stored in the index array itself.\n ix = this.index[codePoint >> UTRIE2_SHIFT_2];\n ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);\n return this.data[ix];\n }\n\n if (codePoint <= 0xffff) {\n // Lead Surrogate Code Point. A Separate index section is stored for\n // lead surrogate code units and code points.\n // The main index has the code unit data.\n // For this function, we need the code point data.\n // Note: this expression could be refactored for slightly improved efficiency, but\n // surrogate code points will be so rare in practice that it's not worth it.\n ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET + ((codePoint - 0xd800) >> UTRIE2_SHIFT_2)];\n ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);\n return this.data[ix];\n }\n\n if (codePoint < this.highStart) {\n // Supplemental code point, use two-level lookup.\n ix = UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> UTRIE2_SHIFT_1);\n ix = this.index[ix];\n ix += (codePoint >> UTRIE2_SHIFT_2) & UTRIE2_INDEX_2_MASK;\n ix = this.index[ix];\n ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);\n return this.data[ix];\n }\n if (codePoint <= 0x10ffff) {\n return this.data[this.highValueIndex];\n }\n }\n\n // Fall through. The code point is outside of the legal range of 0..0x10ffff.\n return this.errorValue;\n }\n}\n","const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\n// Use a lookup table to find the index.\nconst lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\n\nexport const encode = (arraybuffer: ArrayBuffer): string => {\n let bytes = new Uint8Array(arraybuffer),\n i,\n len = bytes.length,\n base64 = '';\n\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n\n return base64;\n};\n\nexport const decode = (base64: string): ArrayBuffer => {\n let bufferLength = base64.length * 0.75,\n len = base64.length,\n i,\n p = 0,\n encoded1,\n encoded2,\n encoded3,\n encoded4;\n\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n\n const arraybuffer = new ArrayBuffer(bufferLength),\n bytes = new Uint8Array(arraybuffer);\n\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n\n return arraybuffer;\n};\n","import {base64, byteLength} from './grapheme-break-trie';\nimport {createTrieFromBase64} from 'utrie';\n\nconst Other = 0;\nconst Prepend = 1;\nconst CR = 2;\nconst LF = 3;\nconst Control = 4;\nconst Extend = 5;\nconst Regional_Indicator = 6;\nconst SpacingMark = 7;\nconst L = 8;\nconst V = 9;\nconst T = 10;\nconst LV = 11;\nconst LVT = 12;\nconst ZWJ = 13;\nconst Extended_Pictographic = 14;\nconst RI = 15;\n\nexport const classes: {[key: string]: number} = {\n Other,\n Prepend,\n CR,\n LF,\n Control,\n Extend,\n Regional_Indicator,\n SpacingMark,\n L,\n V,\n T,\n LV,\n LVT,\n ZWJ,\n Extended_Pictographic,\n RI,\n};\n\nexport const toCodePoints = (str: string): number[] => {\n const codePoints = [];\n let i = 0;\n const length = str.length;\n while (i < length) {\n const value = str.charCodeAt(i++);\n if (value >= 0xd800 && value <= 0xdbff && i < length) {\n const extra = str.charCodeAt(i++);\n if ((extra & 0xfc00) === 0xdc00) {\n codePoints.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000);\n } else {\n codePoints.push(value);\n i--;\n }\n } else {\n codePoints.push(value);\n }\n }\n return codePoints;\n};\n\nexport const fromCodePoint = (...codePoints: number[]): string => {\n if (String.fromCodePoint) {\n return String.fromCodePoint(...codePoints);\n }\n\n const length = codePoints.length;\n if (!length) {\n return '';\n }\n\n const codeUnits = [];\n\n let index = -1;\n let result = '';\n while (++index < length) {\n let codePoint = codePoints[index];\n if (codePoint <= 0xffff) {\n codeUnits.push(codePoint);\n } else {\n codePoint -= 0x10000;\n codeUnits.push((codePoint >> 10) + 0xd800, (codePoint % 0x400) + 0xdc00);\n }\n if (index + 1 === length || codeUnits.length > 0x4000) {\n result += String.fromCharCode(...codeUnits);\n codeUnits.length = 0;\n }\n }\n return result;\n};\n\nexport const UnicodeTrie = createTrieFromBase64(base64, byteLength);\n\nexport const BREAK_NOT_ALLOWED = '×';\nexport const BREAK_ALLOWED = '÷';\n\nexport type BREAK_OPPORTUNITIES = typeof BREAK_NOT_ALLOWED | typeof BREAK_ALLOWED;\n\nexport const codePointToClass = (codePoint: number): number => UnicodeTrie.get(codePoint);\n\nconst _graphemeBreakAtIndex = (_codePoints: number[], classTypes: number[], index: number): BREAK_OPPORTUNITIES => {\n let prevIndex = index - 2;\n let prev = classTypes[prevIndex];\n const current = classTypes[index - 1];\n const next = classTypes[index];\n // GB3 Do not break between a CR and LF\n if (current === CR && next === LF) {\n return BREAK_NOT_ALLOWED;\n }\n\n // GB4 Otherwise, break before and after controls.\n if (current === CR || current === LF || current === Control) {\n return BREAK_ALLOWED;\n }\n\n // GB5\n if (next === CR || next === LF || next === Control) {\n return BREAK_ALLOWED;\n }\n\n // Do not break Hangul syllable sequences.\n // GB6\n if (current === L && [L, V, LV, LVT].indexOf(next) !== -1) {\n return BREAK_NOT_ALLOWED;\n }\n\n // GB7\n if ((current === LV || current === V) && (next === V || next === T)) {\n return BREAK_NOT_ALLOWED;\n }\n\n // GB8\n if ((current === LVT || current === T) && next === T) {\n return BREAK_NOT_ALLOWED;\n }\n\n // GB9 Do not break before extending characters or ZWJ.\n if (next === ZWJ || next === Extend) {\n return BREAK_NOT_ALLOWED;\n }\n // Do not break before SpacingMarks, or after Prepend characters.\n // GB9a\n if (next === SpacingMark) {\n return BREAK_NOT_ALLOWED;\n }\n\n // GB9a\n if (current === Prepend) {\n return BREAK_NOT_ALLOWED;\n }\n\n // GB11 Do not break within emoji modifier sequences or emoji zwj sequences.\n if (current === ZWJ && next === Extended_Pictographic) {\n while (prev === Extend) {\n prev = classTypes[--prevIndex];\n }\n if (prev === Extended_Pictographic) {\n return BREAK_NOT_ALLOWED;\n }\n }\n\n // GB12 Do not break within emoji flag sequences.\n // That is, do not break between regional indicator (RI) symbols\n // if there is an odd number of RI characters before the break point.\n if (current === RI && next === RI) {\n let countRI = 0;\n while (prev === RI) {\n countRI++;\n prev = classTypes[--prevIndex];\n }\n if (countRI % 2 === 0) {\n return BREAK_NOT_ALLOWED;\n }\n }\n\n return BREAK_ALLOWED;\n};\n\nexport const graphemeBreakAtIndex = (codePoints: number[], index: number): BREAK_OPPORTUNITIES => {\n // GB1 Break at the start and end of text, unless the text is empty.\n if (index === 0) {\n return BREAK_ALLOWED;\n }\n\n // GB2\n if (index >= codePoints.length) {\n return BREAK_ALLOWED;\n }\n\n const classTypes = codePoints.map(codePointToClass);\n return _graphemeBreakAtIndex(codePoints, classTypes, index);\n};\n\nexport const GraphemeBreaker = (str: string) => {\n const codePoints = toCodePoints(str);\n const length = codePoints.length;\n let index = 0;\n let lastEnd = 0;\n const classTypes = codePoints.map(codePointToClass);\n\n return {\n next: () => {\n if (index >= length) {\n return {done: true, value: null};\n }\n\n let graphemeBreak = BREAK_NOT_ALLOWED;\n while (\n index < length &&\n (graphemeBreak = _graphemeBreakAtIndex(codePoints, classTypes, ++index)) === BREAK_NOT_ALLOWED\n ) {}\n\n if (graphemeBreak !== BREAK_NOT_ALLOWED || index === length) {\n const value = fromCodePoint.apply(null, codePoints.slice(lastEnd, index));\n lastEnd = index;\n return {value, done: false};\n }\n\n return {done: true, value: null};\n while (index < length) {}\n\n return {done: true, value: null};\n },\n };\n};\n\nexport const splitGraphemes = (str: string): string[] => {\n const breaker = GraphemeBreaker(str);\n\n const graphemes = [];\n let bk;\n\n while (!(bk = breaker.next()).done) {\n if (bk.value) {\n graphemes.push(bk.value.slice());\n }\n }\n\n return graphemes;\n};\n","import { fromCodePoint, toCodePoints } from 'css-line-break';\n\nconst testRangeBounds = (document: Document) => {\n const TEST_HEIGHT = 123;\n\n if (document.createRange) {\n const range = document.createRange();\n if (range.getBoundingClientRect) {\n const testElement = document.createElement('boundtest');\n testElement.style.height = `${TEST_HEIGHT}px`;\n testElement.style.display = 'block';\n document.body.appendChild(testElement);\n\n range.selectNode(testElement);\n const rangeBounds = range.getBoundingClientRect();\n const rangeHeight = Math.round(rangeBounds.height);\n document.body.removeChild(testElement);\n if (rangeHeight === TEST_HEIGHT) {\n return true;\n }\n }\n }\n\n return false;\n};\n\nconst testIOSLineBreak = (document: Document) => {\n const testElement = document.createElement('boundtest');\n testElement.style.width = '50px';\n testElement.style.display = 'block';\n testElement.style.fontSize = '12px';\n testElement.style.letterSpacing = '0px';\n testElement.style.wordSpacing = '0px';\n document.body.appendChild(testElement);\n const range = document.createRange();\n\n testElement.innerHTML = typeof ''.repeat === 'function' ? '&#128104;'.repeat(10) : '';\n\n const node = testElement.firstChild as Text;\n\n const textList = toCodePoints(node.data).map((i) => fromCodePoint(i));\n let offset = 0;\n let prev: DOMRect = {} as DOMRect;\n\n // ios 13 does not handle range getBoundingClientRect line changes correctly #2177\n const supports = textList.every((text, i) => {\n range.setStart(node, offset);\n range.setEnd(node, offset + text.length);\n const rect = range.getBoundingClientRect();\n\n offset += text.length;\n const boundAhead = rect.x > prev.x || rect.y > prev.y;\n\n prev = rect;\n if (i === 0) {\n return true;\n }\n\n return boundAhead;\n });\n\n document.body.removeChild(testElement);\n return supports;\n};\n\nconst testCORS = (): boolean => typeof new Image().crossOrigin !== 'undefined';\n\nconst testResponseType = (): boolean => typeof new XMLHttpRequest().responseType === 'string';\n\nconst testSVG = (document: Document): boolean => {\n const img = new Image();\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n if (!ctx) {\n return false;\n }\n\n img.src = `data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>`;\n\n try {\n ctx.drawImage(img, 0, 0);\n canvas.toDataURL();\n } catch (e) {\n return false;\n }\n return true;\n};\n\nconst isGreenPixel = (data: Uint8ClampedArray): boolean =>\n data[0] === 0 && data[1] === 255 && data[2] === 0 && data[3] === 255;\n\nconst testForeignObject = (document: Document): Promise<boolean> => {\n const canvas = document.createElement('canvas');\n const size = 100;\n canvas.width = size;\n canvas.height = size;\n const ctx = canvas.getContext('2d');\n if (!ctx) {\n return Promise.reject(false);\n }\n ctx.fillStyle = 'rgb(0, 255, 0)';\n ctx.fillRect(0, 0, size, size);\n\n const img = new Image();\n const greenImageSrc = canvas.toDataURL();\n img.src = greenImageSrc;\n const svg = createForeignObjectSVG(size, size, 0, 0, img);\n ctx.fillStyle = 'red';\n ctx.fillRect(0, 0, size, size);\n\n return loadSerializedSVG(svg)\n .then((img: HTMLImageElement) => {\n ctx.drawImage(img, 0, 0);\n const data = ctx.getImageData(0, 0, size, size).data;\n ctx.fillStyle = 'red';\n ctx.fillRect(0, 0, size, size);\n\n const node = document.createElement('div');\n node.style.backgroundImage = `url(${greenImageSrc})`;\n node.style.height = `${size}px`;\n // Firefox 55 does not render inline <img /> tags\n return isGreenPixel(data)\n ? loadSerializedSVG(createForeignObjectSVG(size, size, 0, 0, node))\n : Promise.reject(false);\n })\n .then((img: HTMLImageElement) => {\n ctx.drawImage(img, 0, 0);\n // Edge does not render background-images\n return isGreenPixel(ctx.getImageData(0, 0, size, size).data);\n })\n .catch(() => false);\n};\n\nexport const createForeignObjectSVG = (\n width: number,\n height: number,\n x: number,\n y: number,\n node: Node\n): SVGForeignObjectElement => {\n const xmlns = 'http://www.w3.org/2000/svg';\n const svg = document.createElementNS(xmlns, 'svg');\n const foreignObject = document.createElementNS(xmlns, 'foreignObject');\n svg.setAttributeNS(null, 'width', width.toString());\n svg.setAttributeNS(null, 'height', height.toString());\n\n foreignObject.setAttributeNS(null, 'width', '100%');\n foreignObject.setAttributeNS(null, 'height', '100%');\n foreignObject.setAttributeNS(null, 'x', x.toString());\n foreignObject.setAttributeNS(null, 'y', y.toString());\n foreignObject.setAttributeNS(null, 'externalResourcesRequired', 'true');\n svg.appendChild(foreignObject);\n\n foreignObject.appendChild(node);\n\n return svg;\n};\n\nexport const loadSerializedSVG = (svg: Node): Promise<HTMLImageElement> => {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => resolve(img);\n img.onerror = reject;\n\n img.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(svg))}`;\n });\n};\n\nexport const FEATURES = {\n get SUPPORT_RANGE_BOUNDS(): boolean {\n 'use strict';\n const value = testRangeBounds(document);\n Object.defineProperty(FEATURES, 'SUPPORT_RANGE_BOUNDS', { value });\n return value;\n },\n get SUPPORT_WORD_BREAKING(): boolean {\n 'use strict';\n const value = FEATURES.SUPPORT_RANGE_BOUNDS && testIOSLineBreak(document);\n Object.defineProperty(FEATURES, 'SUPPORT_WORD_BREAKING', { value });\n return value;\n },\n get SUPPORT_SVG_DRAWING(): boolean {\n 'use strict';\n const value = testSVG(document);\n Object.defineProperty(FEATURES, 'SUPPORT_SVG_DRAWING', { value });\n return value;\n },\n get SUPPORT_FOREIGNOBJECT_DRAWING(): Promise<boolean> {\n 'use strict';\n const value =\n typeof Array.from === 'function' && typeof window.fetch === 'function'\n ? testForeignObject(document)\n : Promise.resolve(false);\n Object.defineProperty(FEATURES, 'SUPPORT_FOREIGNOBJECT_DRAWING', { value });\n return value;\n },\n get SUPPORT_CORS_IMAGES(): boolean {\n 'use strict';\n const value = testCORS();\n Object.defineProperty(FEATURES, 'SUPPORT_CORS_IMAGES', { value });\n return value;\n },\n get SUPPORT_RESPONSE_TYPE(): boolean {\n 'use strict';\n const value = testResponseType();\n Object.defineProperty(FEATURES, 'SUPPORT_RESPONSE_TYPE', { value });\n return value;\n },\n get SUPPORT_CORS_XHR(): boolean {\n 'use strict';\n const value = 'withCredentials' in new XMLHttpRequest();\n Object.defineProperty(FEATURES, 'SUPPORT_CORS_XHR', { value });\n return value;\n },\n get SUPPORT_NATIVE_TEXT_SEGMENTATION(): boolean {\n 'use strict';\n\n const value = !!(typeof Intl !== 'undefined' && (Intl as any).Segmenter);\n Object.defineProperty(FEATURES, 'SUPPORT_NATIVE_TEXT_SEGMENTATION', { value });\n return value;\n }\n};\n","import { OVERFLOW_WRAP } from '../property-descriptors/overflow-wrap';\nimport { CSSParsedDeclaration } from '../index';\nimport { fromCodePoint, LineBreaker, toCodePoints } from 'css-line-break';\nimport { splitGraphemes } from 'text-segmentation';\nimport { Bounds, parseBounds } from './bounds';\nimport { FEATURES } from '../../core/features';\nimport { Context } from '../../core/context';\n\nexport class TextBounds {\n readonly text: string;\n readonly bounds: Bounds;\n\n constructor(text: string, bounds: Bounds) {\n this.text = text;\n this.bounds = bounds;\n }\n}\n\nexport const parseTextBounds = (\n context: Context,\n value: string,\n styles: CSSParsedDeclaration,\n node: Text\n): TextBounds[] => {\n const textList = breakText(value, styles);\n const textBounds: TextBounds[] = [];\n let offset = 0;\n textList.forEach((text) => {\n if (styles.textDecorationLine.length || text.trim().length > 0) {\n if (FEATURES.SUPPORT_RANGE_BOUNDS) {\n const clientRects = createRange(node, offset, text.length).getClientRects();\n if (clientRects.length > 1) {\n const subSegments = segmentGraphemes(text);\n let subOffset = 0;\n subSegments.forEach((subSegment) => {\n textBounds.push(\n new TextBounds(\n subSegment,\n Bounds.fromDOMRectList(\n context,\n createRange(node, subOffset + offset, subSegment.length).getClientRects()\n )\n )\n );\n subOffset += subSegment.length;\n });\n } else {\n textBounds.push(new TextBounds(text, Bounds.fromDOMRectList(context, clientRects)));\n }\n } else {\n const replacementNode = node.splitText(text.length);\n textBounds.push(new TextBounds(text, getWrapperBounds(context, node)));\n node = replacementNode;\n }\n } else if (!FEATURES.SUPPORT_RANGE_BOUNDS) {\n node = node.splitText(text.length);\n }\n offset += text.length;\n });\n\n return textBounds;\n};\n\nconst getWrapperBounds = (context: Context, node: Text): Bounds => {\n const ownerDocument = node.ownerDocument;\n if (ownerDocument) {\n const wrapper = ownerDocument.createElement('html2canvaswrapper');\n wrapper.appendChild(node.cloneNode(true));\n const parentNode = node.parentNode;\n if (parentNode) {\n parentNode.replaceChild(wrapper, node);\n const bounds = parseBounds(context, wrapper);\n if (wrapper.firstChild) {\n parentNode.replaceChild(wrapper.firstChild, wrapper);\n }\n return bounds;\n }\n }\n\n return Bounds.EMPTY;\n};\n\nconst createRange = (node: Text, offset: number, length: number): Range => {\n const ownerDocument = node.ownerDocument;\n if (!ownerDocument) {\n throw new Error('Node has no owner document');\n }\n const range = ownerDocument.createRange();\n range.setStart(node, offset);\n range.setEnd(node, offset + length);\n return range;\n};\n\nexport const segmentGraphemes = (value: string): string[] => {\n if (FEATURES.SUPPORT_NATIVE_TEXT_SEGMENTATION) {\n const segmenter = new (Intl as any).Segmenter(void 0, { granularity: 'grapheme' });\n\n return Array.from(segmenter.segment(value)).map((segment: any) => segment.segment);\n }\n\n return splitGraphemes(value);\n};\n\nconst segmentWords = (value: string, styles: CSSParsedDeclaration): string[] => {\n if (FEATURES.SUPPORT_NATIVE_TEXT_SEGMENTATION) {\n const segmenter = new (Intl as any).Segmenter(void 0, {\n granularity: 'word'\n });\n\n return Array.from(segmenter.segment(value)).map((segment: any) => segment.segment);\n }\n\n return breakWords(value, styles);\n};\n\nconst breakText = (value: string, styles: CSSParsedDeclaration): string[] => {\n return styles.letterSpacing !== 0 ? segmentGraphemes(value) : segmentWords(value, styles);\n};\n\n// https://drafts.csswg.org/css-text/#word-separator\nconst wordSeparators = [0x0020, 0x00a0, 0x1361, 0x10100, 0x10101, 0x1039, 0x1091];\n\nconst breakWords = (str: string, styles: CSSParsedDeclaration): string[] => {\n const breaker = LineBreaker(str, {\n lineBreak: styles.lineBreak,\n wordBreak: styles.overflowWrap === OVERFLOW_WRAP.BREAK_WORD ? 'break-word' : styles.wordBreak\n });\n\n const words = [];\n let bk;\n\n while (!(bk = breaker.next()).done) {\n if (bk.value) {\n const value = bk.value.slice();\n const codePoints = toCodePoints(value);\n let word = '';\n codePoints.forEach((codePoint) => {\n if (wordSeparators.indexOf(codePoint) === -1) {\n word += fromCodePoint(codePoint);\n } else {\n if (word.length) {\n words.push(word);\n }\n words.push(fromCodePoint(codePoint));\n word = '';\n }\n });\n\n if (word.length) {\n words.push(word);\n }\n }\n }\n\n return words;\n};\n","import { CSSParsedDeclaration } from '../css/index';\nimport { TEXT_TRANSFORM } from '../css/property-descriptors/text-transform';\nimport { parseTextBounds, TextBounds } from '../css/layout/text';\nimport { Context } from '../core/context';\n\nexport class TextContainer {\n text: string;\n textBounds: TextBounds[];\n\n constructor(context: Context, node: Text, styles: CSSParsedDeclaration) {\n this.text = transform(node.data, styles.textTransform);\n this.textBounds = parseTextBounds(context, this.text, styles, node);\n }\n}\n\nconst transform = (text: string, transform: TEXT_TRANSFORM) => {\n switch (transform) {\n case TEXT_TRANSFORM.LOWERCASE:\n return text.toLowerCase();\n case TEXT_TRANSFORM.CAPITALIZE:\n return text.replace(CAPITALIZE, capitalize);\n case TEXT_TRANSFORM.UPPERCASE:\n return text.toUpperCase();\n default:\n return text;\n }\n};\n\nconst CAPITALIZE = /(^|\\s|:|-|\\(|\\))([a-z])/g;\n\nconst capitalize = (m: string, p1: string, p2: string) => {\n if (m.length > 0) {\n return p1 + p2.toUpperCase();\n }\n\n return m;\n};\n","import { ElementContainer } from '../element-container';\nimport { Context } from '../../core/context';\n\nexport class ImageElementContainer extends ElementContainer {\n src: string;\n intrinsicWidth: number;\n intrinsicHeight: number;\n\n constructor(context: Context, img: HTMLImageElement) {\n super(context, img);\n this.src = img.currentSrc || img.src;\n this.intrinsicWidth = img.naturalWidth;\n this.intrinsicHeight = img.naturalHeight;\n this.context.cache.addImage(this.src);\n }\n}\n","import { ElementContainer } from '../element-container';\nimport { Context } from '../../core/context';\n\nexport class CanvasElementContainer extends ElementContainer {\n canvas: HTMLCanvasElement;\n intrinsicWidth: number;\n intrinsicHeight: number;\n\n constructor(context: Context, canvas: HTMLCanvasElement) {\n super(context, canvas);\n this.canvas = canvas;\n this.intrinsicWidth = canvas.width;\n this.intrinsicHeight = canvas.height;\n }\n}\n","import { ElementContainer } from '../element-container';\nimport { parseBounds } from '../../css/layout/bounds';\nimport { Context } from '../../core/context';\n\nexport class SVGElementContainer extends ElementContainer {\n svg: string;\n intrinsicWidth: number;\n intrinsicHeight: number;\n\n constructor(context: Context, img: SVGSVGElement) {\n super(context, img);\n const s = new XMLSerializer();\n const bounds = parseBounds(context, img);\n img.setAttribute('width', `${bounds.width}px`);\n img.setAttribute('height', `${bounds.height}px`);\n\n this.svg = `data:image/svg+xml,${encodeURIComponent(s.serializeToString(img))}`;\n this.intrinsicWidth = img.width.baseVal.value;\n this.intrinsicHeight = img.height.baseVal.value;\n\n this.context.cache.addImage(this.svg);\n }\n}\n","import { ElementContainer } from '../element-container';\nimport { Context } from '../../core/context';\nexport class LIElementContainer extends ElementContainer {\n readonly value: number;\n\n constructor(context: Context, element: HTMLLIElement) {\n super(context, element);\n this.value = element.value;\n }\n}\n","import { ElementContainer } from '../element-container';\nimport { Context } from '../../core/context';\nexport class OLElementContainer extends ElementContainer {\n readonly start: number;\n readonly reversed: boolean;\n\n constructor(context: Context, element: HTMLOListElement) {\n super(context, element);\n this.start = element.start;\n this.reversed = typeof element.reversed === 'boolean' && element.reversed === true;\n }\n}\n","import { ElementContainer } from '../element-container';\nimport { BORDER_STYLE } from '../../css/property-descriptors/border-style';\nimport { BACKGROUND_CLIP } from '../../css/property-descriptors/background-clip';\nimport { BACKGROUND_ORIGIN } from '../../css/property-descriptors/background-origin';\nimport { TokenType } from '../../css/syntax/tokenizer';\nimport { LengthPercentageTuple } from '../../css/types/length-percentage';\nimport { Bounds } from '../../css/layout/bounds';\nimport { Context } from '../../core/context';\n\nconst CHECKBOX_BORDER_RADIUS: LengthPercentageTuple = [\n {\n type: TokenType.DIMENSION_TOKEN,\n flags: 0,\n unit: 'px',\n number: 3\n }\n];\n\nconst RADIO_BORDER_RADIUS: LengthPercentageTuple = [\n {\n type: TokenType.PERCENTAGE_TOKEN,\n flags: 0,\n number: 50\n }\n];\n\nconst reformatInputBounds = (bounds: Bounds): Bounds => {\n if (bounds.width > bounds.height) {\n return new Bounds(bounds.left + (bounds.width - bounds.height) / 2, bounds.top, bounds.height, bounds.height);\n } else if (bounds.width < bounds.height) {\n return new Bounds(bounds.left, bounds.top + (bounds.height - bounds.width) / 2, bounds.width, bounds.width);\n }\n return bounds;\n};\n\nconst getInputValue = (node: HTMLInputElement): string => {\n const value = node.type === PASSWORD ? new Array(node.value.length + 1).join('\\u2022') : node.value;\n\n return value.length === 0 ? node.placeholder || '' : value;\n};\n\nconst isPlaceholder = (node: HTMLInputElement): boolean => {\n return node.value.length === 0 && !!node.placeholder;\n};\n\nexport const CHECKBOX = 'checkbox';\nexport const RADIO = 'radio';\nexport const PASSWORD = 'password';\nexport const INPUT_COLOR = 0x2a2a2aff;\n// Default placeholder color (similar to browsers: rgba(117, 117, 117, 1) or #757575)\nexport const PLACEHOLDER_COLOR = 0x757575ff;\n\nexport class InputElementContainer extends ElementContainer {\n readonly type: string;\n readonly checked: boolean;\n readonly value: string;\n readonly isPlaceholder: boolean;\n\n constructor(context: Context, input: HTMLInputElement) {\n super(context, input);\n this.type = input.type.toLowerCase();\n this.checked = input.checked;\n this.value = getInputValue(input);\n this.isPlaceholder = isPlaceholder(input);\n\n if (this.type === CHECKBOX || this.type === RADIO) {\n this.styles.backgroundColor = 0xdededeff;\n this.styles.borderTopColor =\n this.styles.borderRightColor =\n this.styles.borderBottomColor =\n this.styles.borderLeftColor =\n 0xa5a5a5ff;\n this.styles.borderTopWidth =\n this.styles.borderRightWidth =\n this.styles.borderBottomWidth =\n this.styles.borderLeftWidth =\n 1;\n this.styles.borderTopStyle =\n this.styles.borderRightStyle =\n this.styles.borderBottomStyle =\n this.styles.borderLeftStyle =\n BORDER_STYLE.SOLID;\n this.styles.backgroundClip = [BACKGROUND_CLIP.BORDER_BOX];\n this.styles.backgroundOrigin = [BACKGROUND_ORIGIN.BORDER_BOX];\n this.bounds = reformatInputBounds(this.bounds);\n }\n\n switch (this.type) {\n case CHECKBOX:\n this.styles.borderTopRightRadius =\n this.styles.borderTopLeftRadius =\n this.styles.borderBottomRightRadius =\n this.styles.borderBottomLeftRadius =\n CHECKBOX_BORDER_RADIUS;\n break;\n case RADIO:\n this.styles.borderTopRightRadius =\n this.styles.borderTopLeftRadius =\n this.styles.borderBottomRightRadius =\n this.styles.borderBottomLeftRadius =\n RADIO_BORDER_RADIUS;\n break;\n }\n }\n}\n","import { ElementContainer } from '../element-container';\nimport { Context } from '../../core/context';\nexport class SelectElementContainer extends ElementContainer {\n readonly value: string;\n constructor(context: Context, element: HTMLSelectElement) {\n super(context, element);\n const option = element.options[element.selectedIndex || 0];\n this.value = option ? option.text || '' : '';\n }\n}\n","import { ElementContainer } from '../element-container';\nimport { Context } from '../../core/context';\nexport class TextareaElementContainer extends ElementContainer {\n readonly value: string;\n constructor(context: Context, element: HTMLTextAreaElement) {\n super(context, element);\n this.value = element.value;\n }\n}\n","import { ElementContainer } from '../element-container';\nimport { parseTree } from '../node-parser';\nimport { Color, parseColor, COLORS } from '../../css/types/color';\nimport { isTransparent } from '../../css/types/color-utilities';\nimport { Context } from '../../core/context';\n\nexport class IFrameElementContainer extends ElementContainer {\n src: string;\n width: number;\n height: number;\n tree?: ElementContainer;\n backgroundColor: Color;\n\n constructor(context: Context, iframe: HTMLIFrameElement) {\n super(context, iframe);\n this.src = iframe.src;\n this.width = parseInt(iframe.width, 10) || 0;\n this.height = parseInt(iframe.height, 10) || 0;\n this.backgroundColor = this.styles.backgroundColor;\n try {\n if (\n iframe.contentWindow &&\n iframe.contentWindow.document &&\n iframe.contentWindow.document.documentElement\n ) {\n this.tree = parseTree(context, iframe.contentWindow.document.documentElement);\n\n // http://www.w3.org/TR/css3-background/#special-backgrounds\n const documentBackgroundColor = iframe.contentWindow.document.documentElement\n ? parseColor(\n context,\n getComputedStyle(iframe.contentWindow.document.documentElement).backgroundColor as string\n )\n : COLORS.TRANSPARENT;\n const bodyBackgroundColor = iframe.contentWindow.document.body\n ? parseColor(\n context,\n getComputedStyle(iframe.contentWindow.document.body).backgroundColor as string\n )\n : COLORS.TRANSPARENT;\n\n this.backgroundColor = isTransparent(documentBackgroundColor)\n ? isTransparent(bodyBackgroundColor)\n ? this.styles.backgroundColor\n : bodyBackgroundColor\n : documentBackgroundColor;\n }\n } catch (e) {}\n }\n}\n","import { CSSParsedDeclaration } from '../css';\nimport { ElementContainer, FLAGS } from './element-container';\nimport { TextContainer } from './text-container';\nimport { ImageElementContainer } from './replaced-elements/image-element-container';\nimport { CanvasElementContainer } from './replaced-elements/canvas-element-container';\nimport { SVGElementContainer } from './replaced-elements/svg-element-container';\nimport { LIElementContainer } from './elements/li-element-container';\nimport { OLElementContainer } from './elements/ol-element-container';\nimport { InputElementContainer } from './replaced-elements/input-element-container';\nimport { SelectElementContainer } from './elements/select-element-container';\nimport { TextareaElementContainer } from './elements/textarea-element-container';\nimport { IFrameElementContainer } from './replaced-elements/iframe-element-container';\nimport { Context } from '../core/context';\nimport { contains } from '../core/bitwise';\nimport { DISPLAY } from '../css/property-descriptors/display';\n\nconst LIST_OWNERS = ['OL', 'UL', 'MENU'];\n\nconst parseNodeTree = (context: Context, node: Node, parent: ElementContainer, root: ElementContainer) => {\n for (let childNode = node.firstChild, nextNode; childNode; childNode = nextNode) {\n nextNode = childNode.nextSibling;\n\n // Fixes #2238 #1624 - Fix the issue of TextNode content being overlooked in rendering due to being perceived as blank by trim().\n if (isTextNode(childNode) && childNode.data.length > 0) {\n parent.textNodes.push(new TextContainer(context, childNode, parent.styles));\n } else if (isElementNode(childNode)) {\n if (isSlotElement(childNode) && childNode.assignedNodes) {\n childNode.assignedNodes().forEach((childNode) => parseNodeTree(context, childNode, parent, root));\n } else {\n const container = createContainer(context, childNode);\n if (container.styles.isVisible()) {\n if (createsRealStackingContext(childNode, container, root)) {\n container.flags |= FLAGS.CREATES_REAL_STACKING_CONTEXT;\n } else if (createsStackingContext(container.styles)) {\n container.flags |= FLAGS.CREATES_STACKING_CONTEXT;\n }\n\n if (LIST_OWNERS.indexOf(childNode.tagName) !== -1) {\n container.flags |= FLAGS.IS_LIST_OWNER;\n }\n\n parent.elements.push(container);\n childNode.slot;\n if (childNode.shadowRoot) {\n parseNodeTree(context, childNode.shadowRoot, container, root);\n } else if (\n !isTextareaElement(childNode) &&\n !isSVGElement(childNode) &&\n !isSelectElement(childNode)\n ) {\n parseNodeTree(context, childNode, container, root);\n }\n }\n }\n }\n }\n};\n\nconst createContainer = (context: Context, element: Element): ElementContainer => {\n if (isImageElement(element)) {\n return new ImageElementContainer(context, element);\n }\n\n if (isCanvasElement(element)) {\n return new CanvasElementContainer(context, element);\n }\n\n if (isSVGElement(element)) {\n return new SVGElementContainer(context, element);\n }\n\n if (isLIElement(element)) {\n return new LIElementContainer(context, element);\n }\n\n if (isOLElement(element)) {\n return new OLElementContainer(context, element);\n }\n\n if (isInputElement(element)) {\n return new InputElementContainer(context, element);\n }\n\n if (isSelectElement(element)) {\n return new SelectElementContainer(context, element);\n }\n\n if (isTextareaElement(element)) {\n return new TextareaElementContainer(context, element);\n }\n\n if (isIFrameElement(element)) {\n return new IFrameElementContainer(context, element);\n }\n\n return new ElementContainer(context, element);\n};\n\nexport const parseTree = (context: Context, element: HTMLElement): ElementContainer => {\n const container = createContainer(context, element);\n container.flags |= FLAGS.CREATES_REAL_STACKING_CONTEXT;\n parseNodeTree(context, element, container, container);\n return container;\n};\n\nconst createsRealStackingContext = (node: Element, container: ElementContainer, root: ElementContainer): boolean => {\n return (\n container.styles.isPositionedWithZIndex() ||\n container.styles.opacity < 1 ||\n container.styles.isTransformed() ||\n (isBodyElement(node) && root.styles.isTransparent())\n );\n};\n\nconst createsStackingContext = (styles: CSSParsedDeclaration): boolean => {\n // Positioned and floating elements create stacking contexts\n if (styles.isPositioned() || styles.isFloating()) {\n return true;\n }\n\n // Fix for Issue #137: Inline-level containers (inline-flex, inline-block, etc.)\n // should create stacking contexts to prevent their children from being added\n // to the parent's stacking context, which causes rendering order issues\n return (\n contains(styles.display, DISPLAY.INLINE_FLEX) ||\n contains(styles.display, DISPLAY.INLINE_BLOCK) ||\n contains(styles.display, DISPLAY.INLINE_GRID) ||\n contains(styles.display, DISPLAY.INLINE_TABLE)\n );\n};\n\nexport const isTextNode = (node: Node): node is Text => node.nodeType === Node.TEXT_NODE;\nexport const isElementNode = (node: Node): node is Element => node.nodeType === Node.ELEMENT_NODE;\nexport const isHTMLElementNode = (node: Node): node is HTMLElement =>\n isElementNode(node) && typeof (node as HTMLElement).style !== 'undefined' && !isSVGElementNode(node);\nexport const isSVGElementNode = (element: Element): element is SVGElement =>\n typeof (element as SVGElement).className === 'object';\nexport const isLIElement = (node: Element): node is HTMLLIElement => node.tagName === 'LI';\nexport const isOLElement = (node: Element): node is HTMLOListElement => node.tagName === 'OL';\nexport const isInputElement = (node: Element): node is HTMLInputElement => node.tagName === 'INPUT';\nexport const isHTMLElement = (node: Element): node is HTMLHtmlElement => node.tagName === 'HTML';\nexport const isSVGElement = (node: Element): node is SVGSVGElement => node.tagName === 'svg';\nexport const isBodyElement = (node: Element): node is HTMLBodyElement => node.tagName === 'BODY';\nexport const isCanvasElement = (node: Element): node is HTMLCanvasElement => node.tagName === 'CANVAS';\nexport const isVideoElement = (node: Element): node is HTMLVideoElement => node.tagName === 'VIDEO';\nexport const isImageElement = (node: Element): node is HTMLImageElement => node.tagName === 'IMG';\nexport const isIFrameElement = (node: Element): node is HTMLIFrameElement => node.tagName === 'IFRAME';\nexport const isStyleElement = (node: Element): node is HTMLStyleElement => node.tagName === 'STYLE';\nexport const isScriptElement = (node: Element): node is HTMLScriptElement => node.tagName === 'SCRIPT';\nexport const isTextareaElement = (node: Element): node is HTMLTextAreaElement => node.tagName === 'TEXTAREA';\nexport const isSelectElement = (node: Element): node is HTMLSelectElement => node.tagName === 'SELECT';\nexport const isSlotElement = (node: Element): node is HTMLSlotElement => node.tagName === 'SLOT';\n// https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\nexport const isCustomElement = (node: Element): node is HTMLElement => node.tagName.indexOf('-') > 0;\n","import { LIST_STYLE_TYPE } from '../../property-descriptors/list-style-type';\nimport { fromCodePoint } from 'css-line-break';\nimport { contains } from '../../../core/bitwise';\nimport { CSSParsedCounterDeclaration } from '../../index';\n\nexport class CounterState {\n private readonly counters: { [key: string]: number[] } = {};\n\n getCounterValue(name: string): number {\n const counter = this.counters[name];\n\n if (counter && counter.length) {\n return counter[counter.length - 1];\n }\n return 1;\n }\n\n getCounterValues(name: string): readonly number[] {\n const counter = this.counters[name];\n return counter ? counter : [];\n }\n\n pop(counters: string[]): void {\n counters.forEach((counter) => this.counters[counter].pop());\n }\n\n parse(style: CSSParsedCounterDeclaration): string[] {\n const counterIncrement = style.counterIncrement;\n const counterReset = style.counterReset;\n let canReset = true;\n\n if (counterIncrement !== null) {\n counterIncrement.forEach((entry) => {\n const counter = this.counters[entry.counter];\n if (counter && entry.increment !== 0) {\n canReset = false;\n if (!counter.length) {\n counter.push(1);\n }\n counter[Math.max(0, counter.length - 1)] += entry.increment;\n }\n });\n }\n\n const counterNames: string[] = [];\n if (canReset) {\n counterReset.forEach((entry) => {\n let counter = this.counters[entry.counter];\n counterNames.push(entry.counter);\n if (!counter) {\n counter = this.counters[entry.counter] = [];\n }\n counter.push(entry.reset);\n });\n }\n\n return counterNames;\n }\n}\n\ninterface CounterSymbols {\n integers: number[];\n values: string[];\n}\n\nconst ROMAN_UPPER: CounterSymbols = {\n integers: [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1],\n values: ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']\n};\n\nconst ARMENIAN: CounterSymbols = {\n integers: [\n 9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70,\n 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1\n ],\n values: [\n 'Ք',\n 'Փ',\n 'Ւ',\n 'Ց',\n 'Ր',\n 'Տ',\n 'Վ',\n 'Ս',\n 'Ռ',\n 'Ջ',\n 'Պ',\n 'Չ',\n 'Ո',\n 'Շ',\n 'Ն',\n 'Յ',\n 'Մ',\n 'Ճ',\n 'Ղ',\n 'Ձ',\n 'Հ',\n 'Կ',\n 'Ծ',\n 'Խ',\n 'Լ',\n 'Ի',\n 'Ժ',\n 'Թ',\n 'Ը',\n 'Է',\n 'Զ',\n 'Ե',\n 'Դ',\n 'Գ',\n 'Բ',\n 'Ա'\n ]\n};\n\nconst HEBREW: CounterSymbols = {\n integers: [\n 10000, 9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20,\n 19, 18, 17, 16, 15, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1\n ],\n values: [\n 'י׳',\n 'ט׳',\n 'ח׳',\n 'ז׳',\n 'ו׳',\n 'ה׳',\n 'ד׳',\n 'ג׳',\n 'ב׳',\n 'א׳',\n 'ת',\n 'ש',\n 'ר',\n 'ק',\n 'צ',\n 'פ',\n 'ע',\n 'ס',\n 'נ',\n 'מ',\n 'ל',\n 'כ',\n 'יט',\n 'יח',\n 'יז',\n 'טז',\n 'טו',\n 'י',\n 'ט',\n 'ח',\n 'ז',\n 'ו',\n 'ה',\n 'ד',\n 'ג',\n 'ב',\n 'א'\n ]\n};\n\nconst GEORGIAN: CounterSymbols = {\n integers: [\n 10000, 9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90,\n 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1\n ],\n values: [\n 'ჵ',\n 'ჰ',\n 'ჯ',\n 'ჴ',\n 'ხ',\n 'ჭ',\n 'წ',\n 'ძ',\n 'ც',\n 'ჩ',\n 'შ',\n 'ყ',\n 'ღ',\n 'ქ',\n 'ფ',\n 'ჳ',\n 'ტ',\n 'ს',\n 'რ',\n 'ჟ',\n 'პ',\n 'ო',\n 'ჲ',\n 'ნ',\n 'მ',\n 'ლ',\n 'კ',\n 'ი',\n 'თ',\n 'ჱ',\n 'ზ',\n 'ვ',\n 'ე',\n 'დ',\n 'გ',\n 'ბ',\n 'ა'\n ]\n};\n\nconst createAdditiveCounter = (\n value: number,\n min: number,\n max: number,\n symbols: CounterSymbols,\n fallback: LIST_STYLE_TYPE,\n suffix: string\n) => {\n if (value < min || value > max) {\n return createCounterText(value, fallback, suffix.length > 0);\n }\n\n return (\n symbols.integers.reduce((string, integer, index) => {\n while (value >= integer) {\n value -= integer;\n string += symbols.values[index];\n }\n return string;\n }, '') + suffix\n );\n};\n\nconst createCounterStyleWithSymbolResolver = (\n value: number,\n codePointRangeLength: number,\n isNumeric: boolean,\n resolver: (codePoint: number) => string\n): string => {\n let string = '';\n\n do {\n if (!isNumeric) {\n value--;\n }\n string = resolver(value) + string;\n value /= codePointRangeLength;\n } while (value * codePointRangeLength >= codePointRangeLength);\n\n return string;\n};\n\nconst createCounterStyleFromRange = (\n value: number,\n codePointRangeStart: number,\n codePointRangeEnd: number,\n isNumeric: boolean,\n suffix: string\n): string => {\n const codePointRangeLength = codePointRangeEnd - codePointRangeStart + 1;\n\n return (\n (value < 0 ? '-' : '') +\n (createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, isNumeric, (codePoint) =>\n fromCodePoint(Math.floor(codePoint % codePointRangeLength) + codePointRangeStart)\n ) +\n suffix)\n );\n};\n\nconst createCounterStyleFromSymbols = (value: number, symbols: string, suffix = '. '): string => {\n const codePointRangeLength = symbols.length;\n return (\n createCounterStyleWithSymbolResolver(\n Math.abs(value),\n codePointRangeLength,\n false,\n (codePoint) => symbols[Math.floor(codePoint % codePointRangeLength)]\n ) + suffix\n );\n};\n\nconst CJK_ZEROS = 1 << 0;\nconst CJK_TEN_COEFFICIENTS = 1 << 1;\nconst CJK_TEN_HIGH_COEFFICIENTS = 1 << 2;\nconst CJK_HUNDRED_COEFFICIENTS = 1 << 3;\n\nconst createCJKCounter = (\n value: number,\n numbers: string,\n multipliers: string,\n negativeSign: string,\n suffix: string,\n flags: number\n): string => {\n if (value < -9999 || value > 9999) {\n return createCounterText(value, LIST_STYLE_TYPE.CJK_DECIMAL, suffix.length > 0);\n }\n let tmp = Math.abs(value);\n let string = suffix;\n\n if (tmp === 0) {\n return numbers[0] + string;\n }\n\n for (let digit = 0; tmp > 0 && digit <= 4; digit++) {\n const coefficient = tmp % 10;\n\n if (coefficient === 0 && contains(flags, CJK_ZEROS) && string !== '') {\n string = numbers[coefficient] + string;\n } else if (\n coefficient > 1 ||\n (coefficient === 1 && digit === 0) ||\n (coefficient === 1 && digit === 1 && contains(flags, CJK_TEN_COEFFICIENTS)) ||\n (coefficient === 1 && digit === 1 && contains(flags, CJK_TEN_HIGH_COEFFICIENTS) && value > 100) ||\n (coefficient === 1 && digit > 1 && contains(flags, CJK_HUNDRED_COEFFICIENTS))\n ) {\n string = numbers[coefficient] + (digit > 0 ? multipliers[digit - 1] : '') + string;\n } else if (coefficient === 1 && digit > 0) {\n string = multipliers[digit - 1] + string;\n }\n tmp = Math.floor(tmp / 10);\n }\n\n return (value < 0 ? negativeSign : '') + string;\n};\n\nconst CHINESE_INFORMAL_MULTIPLIERS = '十百千萬';\nconst CHINESE_FORMAL_MULTIPLIERS = '拾佰仟萬';\nconst JAPANESE_NEGATIVE = 'マイナス';\nconst KOREAN_NEGATIVE = '마이너스';\n\nexport const createCounterText = (value: number, type: LIST_STYLE_TYPE, appendSuffix: boolean): string => {\n const defaultSuffix = appendSuffix ? '. ' : '';\n const cjkSuffix = appendSuffix ? '、' : '';\n const koreanSuffix = appendSuffix ? ', ' : '';\n const spaceSuffix = appendSuffix ? ' ' : '';\n switch (type) {\n case LIST_STYLE_TYPE.DISC:\n return '•' + spaceSuffix;\n case LIST_STYLE_TYPE.CIRCLE:\n return '◦' + spaceSuffix;\n case LIST_STYLE_TYPE.SQUARE:\n return '◾' + spaceSuffix;\n case LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO:\n const string = createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);\n return string.length < 4 ? `0${string}` : string;\n case LIST_STYLE_TYPE.CJK_DECIMAL:\n return createCounterStyleFromSymbols(value, '〇一二三四五六七八九', cjkSuffix);\n case LIST_STYLE_TYPE.LOWER_ROMAN:\n return createAdditiveCounter(\n value,\n 1,\n 3999,\n ROMAN_UPPER,\n LIST_STYLE_TYPE.DECIMAL,\n defaultSuffix\n ).toLowerCase();\n case LIST_STYLE_TYPE.UPPER_ROMAN:\n return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, LIST_STYLE_TYPE.DECIMAL, defaultSuffix);\n case LIST_STYLE_TYPE.LOWER_GREEK:\n return createCounterStyleFromRange(value, 945, 969, false, defaultSuffix);\n case LIST_STYLE_TYPE.LOWER_ALPHA:\n return createCounterStyleFromRange(value, 97, 122, false, defaultSuffix);\n case LIST_STYLE_TYPE.UPPER_ALPHA:\n return createCounterStyleFromRange(value, 65, 90, false, defaultSuffix);\n case LIST_STYLE_TYPE.ARABIC_INDIC:\n return createCounterStyleFromRange(value, 1632, 1641, true, defaultSuffix);\n case LIST_STYLE_TYPE.ARMENIAN:\n case LIST_STYLE_TYPE.UPPER_ARMENIAN:\n return createAdditiveCounter(value, 1, 9999, ARMENIAN, LIST_STYLE_TYPE.DECIMAL, defaultSuffix);\n case LIST_STYLE_TYPE.LOWER_ARMENIAN:\n return createAdditiveCounter(\n value,\n 1,\n 9999,\n ARMENIAN,\n LIST_STYLE_TYPE.DECIMAL,\n defaultSuffix\n ).toLowerCase();\n case LIST_STYLE_TYPE.BENGALI:\n return createCounterStyleFromRange(value, 2534, 2543, true, defaultSuffix);\n case LIST_STYLE_TYPE.CAMBODIAN:\n case LIST_STYLE_TYPE.KHMER:\n return createCounterStyleFromRange(value, 6112, 6121, true, defaultSuffix);\n case LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH:\n return createCounterStyleFromSymbols(value, '子丑寅卯辰巳午未申酉戌亥', cjkSuffix);\n case LIST_STYLE_TYPE.CJK_HEAVENLY_STEM:\n return createCounterStyleFromSymbols(value, '甲乙丙丁戊己庚辛壬癸', cjkSuffix);\n case LIST_STYLE_TYPE.CJK_IDEOGRAPHIC:\n case LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL:\n return createCJKCounter(\n value,\n '零一二三四五六七八九',\n CHINESE_INFORMAL_MULTIPLIERS,\n '負',\n cjkSuffix,\n CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS\n );\n case LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL:\n return createCJKCounter(\n value,\n '零壹貳參肆伍陸柒捌玖',\n CHINESE_FORMAL_MULTIPLIERS,\n '負',\n cjkSuffix,\n CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS\n );\n case LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL:\n return createCJKCounter(\n value,\n '零一二三四五六七八九',\n CHINESE_INFORMAL_MULTIPLIERS,\n '负',\n cjkSuffix,\n CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS\n );\n case LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL:\n return createCJKCounter(\n value,\n '零壹贰叁肆伍陆柒捌玖',\n CHINESE_FORMAL_MULTIPLIERS,\n '负',\n cjkSuffix,\n CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS\n );\n case LIST_STYLE_TYPE.JAPANESE_INFORMAL:\n return createCJKCounter(value, '〇一二三四五六七八九', '十百千万', JAPANESE_NEGATIVE, cjkSuffix, 0);\n case LIST_STYLE_TYPE.JAPANESE_FORMAL:\n return createCJKCounter(\n value,\n '零壱弐参四伍六七八九',\n '拾百千万',\n JAPANESE_NEGATIVE,\n cjkSuffix,\n CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS\n );\n case LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL:\n return createCJKCounter(\n value,\n '영일이삼사오육칠팔구',\n '십백천만',\n KOREAN_NEGATIVE,\n koreanSuffix,\n CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS\n );\n case LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL:\n return createCJKCounter(value, '零一二三四五六七八九', '十百千萬', KOREAN_NEGATIVE, koreanSuffix, 0);\n case LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL:\n return createCJKCounter(\n value,\n '零壹貳參四五六七八九',\n '拾百千',\n KOREAN_NEGATIVE,\n koreanSuffix,\n CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS\n );\n case LIST_STYLE_TYPE.DEVANAGARI:\n return createCounterStyleFromRange(value, 0x966, 0x96f, true, defaultSuffix);\n case LIST_STYLE_TYPE.GEORGIAN:\n return createAdditiveCounter(value, 1, 19999, GEORGIAN, LIST_STYLE_TYPE.DECIMAL, defaultSuffix);\n case LIST_STYLE_TYPE.GUJARATI:\n return createCounterStyleFromRange(value, 0xae6, 0xaef, true, defaultSuffix);\n case LIST_STYLE_TYPE.GURMUKHI:\n return createCounterStyleFromRange(value, 0xa66, 0xa6f, true, defaultSuffix);\n case LIST_STYLE_TYPE.HEBREW:\n return createAdditiveCounter(value, 1, 10999, HEBREW, LIST_STYLE_TYPE.DECIMAL, defaultSuffix);\n case LIST_STYLE_TYPE.HIRAGANA:\n return createCounterStyleFromSymbols(\n value,\n 'あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん'\n );\n case LIST_STYLE_TYPE.HIRAGANA_IROHA:\n return createCounterStyleFromSymbols(\n value,\n 'いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす'\n );\n case LIST_STYLE_TYPE.KANNADA:\n return createCounterStyleFromRange(value, 0xce6, 0xcef, true, defaultSuffix);\n case LIST_STYLE_TYPE.KATAKANA:\n return createCounterStyleFromSymbols(\n value,\n 'アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン',\n cjkSuffix\n );\n case LIST_STYLE_TYPE.KATAKANA_IROHA:\n return createCounterStyleFromSymbols(\n value,\n 'イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス',\n cjkSuffix\n );\n case LIST_STYLE_TYPE.LAO:\n return createCounterStyleFromRange(value, 0xed0, 0xed9, true, defaultSuffix);\n case LIST_STYLE_TYPE.MONGOLIAN:\n return createCounterStyleFromRange(value, 0x1810, 0x1819, true, defaultSuffix);\n case LIST_STYLE_TYPE.MYANMAR:\n return createCounterStyleFromRange(value, 0x1040, 0x1049, true, defaultSuffix);\n case LIST_STYLE_TYPE.ORIYA:\n return createCounterStyleFromRange(value, 0xb66, 0xb6f, true, defaultSuffix);\n case LIST_STYLE_TYPE.PERSIAN:\n return createCounterStyleFromRange(value, 0x6f0, 0x6f9, true, defaultSuffix);\n case LIST_STYLE_TYPE.TAMIL:\n return createCounterStyleFromRange(value, 0xbe6, 0xbef, true, defaultSuffix);\n case LIST_STYLE_TYPE.TELUGU:\n return createCounterStyleFromRange(value, 0xc66, 0xc6f, true, defaultSuffix);\n case LIST_STYLE_TYPE.THAI:\n return createCounterStyleFromRange(value, 0xe50, 0xe59, true, defaultSuffix);\n case LIST_STYLE_TYPE.TIBETAN:\n return createCounterStyleFromRange(value, 0xf20, 0xf29, true, defaultSuffix);\n case LIST_STYLE_TYPE.DECIMAL:\n default:\n return createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);\n }\n};\n","import { Bounds } from '../css/layout/bounds';\nimport {\n isBodyElement,\n isCanvasElement,\n isCustomElement,\n isElementNode,\n isHTMLElementNode,\n isIFrameElement,\n isImageElement,\n isScriptElement,\n isSelectElement,\n isSlotElement,\n isStyleElement,\n isSVGElementNode,\n isTextareaElement,\n isTextNode,\n isVideoElement\n} from './node-parser';\nimport { isIdentToken, nonFunctionArgSeparator } from '../css/syntax/parser';\nimport { TokenType } from '../css/syntax/tokenizer';\nimport { CounterState, createCounterText } from '../css/types/functions/counter';\nimport { LIST_STYLE_TYPE, listStyleType } from '../css/property-descriptors/list-style-type';\nimport { CSSParsedCounterDeclaration, CSSParsedPseudoDeclaration } from '../css/index';\nimport { getQuote } from '../css/property-descriptors/quotes';\nimport { Context } from '../core/context';\nimport { DebuggerType, isDebugging } from '../core/debugger';\n\nexport interface CloneOptions {\n ignoreElements?: (element: Element) => boolean;\n onclone?: (document: Document, element: HTMLElement) => void;\n allowTaint?: boolean;\n iframeContainer?: HTMLElement | ShadowRoot;\n}\n\nexport interface WindowOptions {\n scrollX: number;\n scrollY: number;\n windowWidth: number;\n windowHeight: number;\n}\n\nexport type CloneConfigurations = CloneOptions & {\n inlineImages: boolean;\n copyStyles: boolean;\n cspNonce?: string;\n};\n\nconst IGNORE_ATTRIBUTE = 'data-html2canvas-ignore';\n\n/**\n * Find the parent ShadowRoot of an element, if any\n * @param element - The element to check\n * @returns The parent ShadowRoot or null\n */\nconst findParentShadowRoot = (element: Element): ShadowRoot | null => {\n let current: Node | null = element;\n while (current) {\n // Check if we've reached a shadow root boundary\n if (current.parentNode && (current.parentNode as ShadowRoot).host) {\n return current.parentNode as ShadowRoot;\n }\n // Use getRootNode to check if we're in a shadow root\n const root = current.getRootNode();\n if (root && root !== current.ownerDocument && (root as ShadowRoot).host) {\n return root as ShadowRoot;\n }\n current = current.parentNode;\n }\n return null;\n};\n\nexport class DocumentCloner {\n private readonly scrolledElements: [Element, number, number][];\n private readonly referenceElement: HTMLElement;\n clonedReferenceElement?: HTMLElement;\n private readonly documentElement: HTMLElement;\n private readonly counters: CounterState;\n private quoteDepth: number;\n\n constructor(\n private readonly context: Context,\n element: HTMLElement,\n private readonly options: CloneConfigurations\n ) {\n this.scrolledElements = [];\n this.referenceElement = element;\n this.counters = new CounterState();\n this.quoteDepth = 0;\n if (!element.ownerDocument) {\n throw new Error('Cloned element does not have an owner document');\n }\n\n // Auto-detect Shadow Root if not explicitly provided\n if (!this.options.iframeContainer) {\n const shadowRoot = findParentShadowRoot(element);\n if (shadowRoot) {\n this.options.iframeContainer = shadowRoot;\n }\n }\n\n this.documentElement = this.cloneNode(element.ownerDocument.documentElement, false) as HTMLElement;\n }\n\n toIFrame(ownerDocument: Document, windowSize: Bounds): Promise<HTMLIFrameElement> {\n const iframe: HTMLIFrameElement = createIFrameContainer(\n ownerDocument,\n windowSize,\n this.options.iframeContainer\n );\n\n if (!iframe.contentWindow) {\n return Promise.reject(`Unable to find iframe window`);\n }\n\n const scrollX = (ownerDocument.defaultView as Window).pageXOffset;\n const scrollY = (ownerDocument.defaultView as Window).pageYOffset;\n\n const cloneWindow = iframe.contentWindow;\n const documentClone: Document = cloneWindow.document;\n\n /* Chrome doesn't detect relative background-images assigned in inline <style> sheets when fetched through getComputedStyle\n if window url is about:blank, we can assign the url to current by writing onto the document\n */\n\n const iframeLoad = iframeLoader(iframe).then(async () => {\n this.scrolledElements.forEach(restoreNodeScroll);\n if (cloneWindow) {\n cloneWindow.scrollTo(windowSize.left, windowSize.top);\n if (\n /(iPad|iPhone|iPod)/g.test(navigator.userAgent) &&\n (cloneWindow.scrollY !== windowSize.top || cloneWindow.scrollX !== windowSize.left)\n ) {\n this.context.logger.warn('Unable to restore scroll position for cloned document');\n this.context.windowBounds = this.context.windowBounds.add(\n cloneWindow.scrollX - windowSize.left,\n cloneWindow.scrollY - windowSize.top,\n 0,\n 0\n );\n }\n }\n\n const onclone = this.options.onclone;\n\n const referenceElement = this.clonedReferenceElement;\n\n if (typeof referenceElement === 'undefined') {\n return Promise.reject(`Error finding the ${this.referenceElement.nodeName} in the cloned document`);\n }\n\n if (documentClone.fonts && documentClone.fonts.ready) {\n await documentClone.fonts.ready;\n }\n\n if (/(AppleWebKit)/g.test(navigator.userAgent)) {\n await imagesReady(documentClone);\n }\n\n if (typeof onclone === 'function') {\n return Promise.resolve()\n .then(() => onclone(documentClone, referenceElement))\n .then(() => iframe);\n }\n\n return iframe;\n });\n /**\n * The baseURI of the document will be lost after documentClone.open().\n * We save it before open() to preserve the original base URI for resource resolution.\n * */\n const baseUri = documentClone.baseURI;\n documentClone.open();\n try {\n // fixing \"This document requires 'TrustedHTML' assignment. The action has been blocked.\" error\n // @ts-ignore\n const policy = trustedTypes.createPolicy('my-policy', {\n createHTML: (string: string) => string\n });\n const rawHTML = serializeDoctype(document.doctype) + '<html></html>';\n const trustedHTML = policy.createHTML(rawHTML);\n documentClone.write(trustedHTML);\n } catch (e) {\n // if browser does not support trustedTypes\n documentClone.write(serializeDoctype(document.doctype) + '<html></html>');\n }\n // Chrome scrolls the parent document for some reason after the write to the cloned window???\n restoreOwnerScroll(this.referenceElement.ownerDocument, scrollX, scrollY);\n /**\n * Note: adoptNode() should be called AFTER documentClone.open() and close()\n *\n * In Chrome, calling adoptNode() before or during open/write may cause\n * styles with uppercase characters in class names (e.g. \".MyClass\") to not apply correctly.\n *\n * Fix:\n * - Make sure adoptNode() is called after documentClone.open() and close()\n * - This allows Chrome to properly match and apply all CSS rules including mixed-case class selectors.\n * */\n const adoptedNode = documentClone.adoptNode(this.documentElement);\n addBase(adoptedNode, baseUri);\n documentClone.replaceChild(adoptedNode, documentClone.documentElement);\n documentClone.close();\n\n return iframeLoad;\n }\n\n createElementClone<T extends HTMLElement | SVGElement>(node: T): HTMLElement | SVGElement {\n if (isDebugging(node, DebuggerType.CLONE)) {\n debugger;\n }\n if (isCanvasElement(node)) {\n return this.createCanvasClone(node);\n }\n if (isVideoElement(node)) {\n return this.createVideoClone(node);\n }\n if (isStyleElement(node)) {\n return this.createStyleClone(node);\n }\n\n const clone = node.cloneNode(false) as T;\n if (isImageElement(clone)) {\n if (isImageElement(node) && node.currentSrc && node.currentSrc !== node.src) {\n clone.src = node.currentSrc;\n clone.srcset = '';\n }\n\n if (clone.loading === 'lazy') {\n clone.loading = 'eager';\n }\n }\n\n if (isCustomElement(clone)) {\n return this.createCustomElementClone(clone);\n }\n\n return clone;\n }\n\n createCustomElementClone(node: HTMLElement): HTMLElement {\n const clone = document.createElement('div');\n clone.className = node.className;\n copyCSSStyles(node.style, clone);\n\n // Clone shadow DOM if it exists\n // Fix for Issue #108: This is critical for Web Components with slots to work correctly\n if (node.shadowRoot) {\n try {\n clone.attachShadow({ mode: 'open' });\n // The actual shadow DOM content will be cloned in cloneChildNodes\n } catch (e) {\n // Some elements cannot have shadow roots attached\n // This can happen if the element doesn't support shadow DOM\n this.context.logger.error('Failed to attach shadow root to custom element clone:', e);\n }\n }\n\n return clone;\n }\n\n createStyleClone(node: HTMLStyleElement): HTMLStyleElement {\n try {\n const sheet = node.sheet as CSSStyleSheet | undefined;\n if (sheet && sheet.cssRules) {\n const css: string = [].slice.call(sheet.cssRules, 0).reduce((css: string, rule: CSSRule) => {\n if (rule && typeof rule.cssText === 'string') {\n return css + rule.cssText;\n }\n return css;\n }, '');\n const style = node.cloneNode(false) as HTMLStyleElement;\n style.textContent = css;\n if (this.options.cspNonce) {\n style.nonce = this.options.cspNonce;\n }\n return style;\n }\n } catch (e) {\n // accessing node.sheet.cssRules throws a DOMException\n this.context.logger.error('Unable to access cssRules property', e);\n if (e.name !== 'SecurityError') {\n throw e;\n }\n }\n const cloned = node.cloneNode(false) as HTMLStyleElement;\n if (this.options.cspNonce) {\n cloned.nonce = this.options.cspNonce;\n }\n return cloned;\n }\n\n createCanvasClone(canvas: HTMLCanvasElement): HTMLImageElement | HTMLCanvasElement {\n if (this.options.inlineImages && canvas.ownerDocument) {\n const img = canvas.ownerDocument.createElement('img');\n try {\n img.src = canvas.toDataURL();\n return img;\n } catch (e) {\n this.context.logger.info(`Unable to inline canvas contents, canvas is tainted`, canvas);\n }\n }\n\n const clonedCanvas = canvas.cloneNode(false) as HTMLCanvasElement;\n\n try {\n clonedCanvas.width = canvas.width;\n clonedCanvas.height = canvas.height;\n const ctx = canvas.getContext('2d');\n const clonedCtx = clonedCanvas.getContext('2d', { willReadFrequently: true }) as CanvasRenderingContext2D;\n if (clonedCtx) {\n if (!this.options.allowTaint && ctx) {\n clonedCtx.putImageData(ctx.getImageData(0, 0, canvas.width, canvas.height), 0, 0);\n } else {\n const gl = canvas.getContext('webgl2') ?? canvas.getContext('webgl');\n if (gl) {\n const attribs = gl.getContextAttributes();\n if (attribs?.preserveDrawingBuffer === false) {\n this.context.logger.warn(\n 'Unable to clone WebGL context as it has preserveDrawingBuffer=false',\n canvas\n );\n }\n }\n\n clonedCtx.drawImage(canvas, 0, 0);\n }\n }\n return clonedCanvas;\n } catch (e) {\n this.context.logger.info(`Unable to clone canvas as it is tainted`, canvas);\n }\n\n return clonedCanvas;\n }\n\n createVideoClone(video: HTMLVideoElement): HTMLCanvasElement {\n const canvas = video.ownerDocument.createElement('canvas');\n\n canvas.width = video.offsetWidth;\n canvas.height = video.offsetHeight;\n const ctx = canvas.getContext('2d');\n\n try {\n if (ctx) {\n ctx.drawImage(video, 0, 0, canvas.width, canvas.height);\n if (!this.options.allowTaint) {\n ctx.getImageData(0, 0, canvas.width, canvas.height);\n }\n }\n return canvas;\n } catch (e) {\n this.context.logger.info(`Unable to clone video as it is tainted`, video);\n }\n\n const blankCanvas = video.ownerDocument.createElement('canvas');\n\n blankCanvas.width = video.offsetWidth;\n blankCanvas.height = video.offsetHeight;\n return blankCanvas;\n }\n\n appendChildNode(clone: HTMLElement | SVGElement, child: Node, copyStyles: boolean): void {\n if (\n !isElementNode(child) ||\n (!isScriptElement(child) &&\n !child.hasAttribute(IGNORE_ATTRIBUTE) &&\n (typeof this.options.ignoreElements !== 'function' || !this.options.ignoreElements(child)))\n ) {\n if (!this.options.copyStyles || !isElementNode(child) || !isStyleElement(child)) {\n clone.appendChild(this.cloneNode(child, copyStyles));\n }\n }\n }\n\n /**\n * Check if a child node should be cloned based on filtering rules\n * Filters out: scripts, ignored elements, and optionally styles\n */\n private shouldCloneChild(child: Node): boolean {\n return (\n !isElementNode(child) ||\n (!isScriptElement(child) &&\n !child.hasAttribute(IGNORE_ATTRIBUTE) &&\n (typeof this.options.ignoreElements !== 'function' || !this.options.ignoreElements(child)))\n );\n }\n\n /**\n * Check if a style element should be cloned based on copyStyles option\n */\n private shouldCloneStyleElement(child: Node): boolean {\n return !this.options.copyStyles || !isElementNode(child) || !isStyleElement(child);\n }\n\n /**\n * Safely append a cloned child to a target, applying all filtering rules\n */\n private safeAppendClonedChild(\n target: ShadowRoot | HTMLElement | SVGElement,\n child: Node,\n copyStyles: boolean\n ): void {\n if (this.shouldCloneChild(child) && this.shouldCloneStyleElement(child)) {\n target.appendChild(this.cloneNode(child, copyStyles));\n }\n }\n\n /**\n * Clone assigned nodes from a slot element to the target\n */\n private cloneAssignedNodes(assignedNodes: Node[], target: ShadowRoot, copyStyles: boolean): void {\n assignedNodes.forEach((node) => {\n this.safeAppendClonedChild(target, node, copyStyles);\n });\n }\n\n /**\n * Clone fallback content from a slot element when no nodes are assigned\n */\n private cloneSlotFallbackContent(slot: Element, target: ShadowRoot, copyStyles: boolean): void {\n for (let child = slot.firstChild; child; child = child.nextSibling) {\n this.safeAppendClonedChild(target, child, copyStyles);\n }\n }\n\n /**\n * Handle cloning of a slot element, including assigned nodes or fallback content\n */\n private cloneSlotElement(slot: Element, targetShadowRoot: ShadowRoot, copyStyles: boolean): void {\n if (!isSlotElement(slot)) {\n return;\n }\n\n const slotElement = slot as HTMLSlotElement;\n\n // Defensive check: ensure assignedNodes method exists\n if (typeof slotElement.assignedNodes !== 'function') {\n this.context.logger.warn('HTMLSlotElement.assignedNodes is not available', slot);\n this.cloneSlotFallbackContent(slot, targetShadowRoot, copyStyles);\n return;\n }\n\n const assignedNodes = slotElement.assignedNodes();\n\n // Defensive check: ensure assignedNodes returns an array\n if (!assignedNodes || !Array.isArray(assignedNodes)) {\n this.context.logger.warn('assignedNodes() did not return a valid array', slot);\n this.cloneSlotFallbackContent(slot, targetShadowRoot, copyStyles);\n return;\n }\n\n if (assignedNodes.length > 0) {\n // Clone assigned nodes\n this.cloneAssignedNodes(assignedNodes, targetShadowRoot, copyStyles);\n } else {\n // Clone fallback content\n this.cloneSlotFallbackContent(slot, targetShadowRoot, copyStyles);\n }\n }\n\n /**\n * Clone shadow DOM children to the target shadow root\n */\n private cloneShadowDOMChildren(shadowRoot: ShadowRoot, targetShadowRoot: ShadowRoot, copyStyles: boolean): void {\n for (let child = shadowRoot.firstChild; child; child = child.nextSibling) {\n if (isElementNode(child) && isSlotElement(child)) {\n // Handle slot elements specially\n this.cloneSlotElement(child, targetShadowRoot, copyStyles);\n } else {\n // Clone regular elements\n this.safeAppendClonedChild(targetShadowRoot, child, copyStyles);\n }\n }\n }\n\n /**\n * Clone light DOM children to the target element\n */\n private cloneLightDOMChildren(node: Element, clone: HTMLElement | SVGElement, copyStyles: boolean): void {\n for (let child = node.firstChild; child; child = child.nextSibling) {\n this.appendChildNode(clone, child, copyStyles);\n }\n }\n\n /**\n * Clone slot element as light DOM when shadow root creation failed\n */\n private cloneSlotElementAsLightDOM(slot: Element, clone: HTMLElement | SVGElement, copyStyles: boolean): void {\n if (!isSlotElement(slot)) {\n return;\n }\n\n const slotElement = slot as HTMLSlotElement;\n\n if (typeof slotElement.assignedNodes !== 'function') {\n // Fallback: clone slot's children\n for (let child = slot.firstChild; child; child = child.nextSibling) {\n this.appendChildNode(clone, child, copyStyles);\n }\n return;\n }\n\n const assignedNodes = slotElement.assignedNodes();\n\n if (assignedNodes && Array.isArray(assignedNodes) && assignedNodes.length > 0) {\n // Clone assigned nodes as light DOM\n assignedNodes.forEach((node) => this.appendChildNode(clone, node, copyStyles));\n } else {\n // Clone fallback content as light DOM\n for (let child = slot.firstChild; child; child = child.nextSibling) {\n this.appendChildNode(clone, child, copyStyles);\n }\n }\n }\n\n /**\n * Clone shadow DOM content as light DOM when shadow root creation failed\n * This is a fallback mechanism to ensure content is not lost\n */\n private cloneShadowDOMAsLightDOM(\n shadowRoot: ShadowRoot,\n clone: HTMLElement | SVGElement,\n copyStyles: boolean\n ): void {\n for (let child = shadowRoot.firstChild; child; child = child.nextSibling) {\n if (isElementNode(child) && isSlotElement(child)) {\n this.cloneSlotElementAsLightDOM(child, clone, copyStyles);\n } else {\n this.appendChildNode(clone, child, copyStyles);\n }\n }\n }\n\n /**\n * Clone child nodes from source element to clone element\n * Handles shadow DOM, slots, and light DOM appropriately\n */\n cloneChildNodes(node: Element, clone: HTMLElement | SVGElement, copyStyles: boolean): void {\n if (node.shadowRoot && clone.shadowRoot) {\n // Both original and clone have shadow roots - clone shadow DOM content\n this.cloneShadowDOMChildren(node.shadowRoot, clone.shadowRoot, copyStyles);\n // Also clone light DOM (slot content sources)\n this.cloneLightDOMChildren(node, clone, copyStyles);\n } else if (node.shadowRoot && !clone.shadowRoot) {\n // Original has shadow root but clone doesn't (creation failed)\n // Fallback: clone shadow DOM content as light DOM to preserve content\n this.cloneShadowDOMAsLightDOM(node.shadowRoot, clone, copyStyles);\n } else {\n // No shadow DOM - just clone light DOM children\n this.cloneLightDOMChildren(node, clone, copyStyles);\n }\n }\n\n cloneNode(node: Node, copyStyles: boolean): Node {\n if (isTextNode(node)) {\n return document.createTextNode(node.data);\n }\n\n if (!node.ownerDocument) {\n return node.cloneNode(false);\n }\n\n const window = node.ownerDocument.defaultView;\n\n if (window && isElementNode(node) && (isHTMLElementNode(node) || isSVGElementNode(node))) {\n const clone = this.createElementClone(node);\n clone.style.transitionProperty = 'none';\n\n const style = window.getComputedStyle(node);\n const styleBefore = window.getComputedStyle(node, ':before');\n const styleAfter = window.getComputedStyle(node, ':after');\n\n if (this.referenceElement === node && isHTMLElementNode(clone)) {\n this.clonedReferenceElement = clone;\n }\n if (isBodyElement(clone)) {\n createPseudoHideStyles(clone, this.options.cspNonce);\n }\n\n const counters = this.counters.parse(new CSSParsedCounterDeclaration(this.context, style));\n const before = this.resolvePseudoContent(node, clone, styleBefore, PseudoElementType.BEFORE);\n\n if (isCustomElement(node)) {\n copyStyles = true;\n }\n\n if (!isVideoElement(node)) {\n this.cloneChildNodes(node, clone, copyStyles);\n }\n\n if (before) {\n clone.insertBefore(before, clone.firstChild);\n }\n\n const after = this.resolvePseudoContent(node, clone, styleAfter, PseudoElementType.AFTER);\n if (after) {\n clone.appendChild(after);\n }\n\n this.counters.pop(counters);\n\n if (\n (style && (this.options.copyStyles || isSVGElementNode(node)) && !isIFrameElement(node)) ||\n copyStyles\n ) {\n copyCSSStyles(style, clone);\n }\n\n if (node.scrollTop !== 0 || node.scrollLeft !== 0) {\n this.scrolledElements.push([clone, node.scrollLeft, node.scrollTop]);\n }\n\n if (\n (isTextareaElement(node) || isSelectElement(node)) &&\n (isTextareaElement(clone) || isSelectElement(clone))\n ) {\n clone.value = node.value;\n }\n\n return clone;\n }\n\n return node.cloneNode(false);\n }\n\n resolvePseudoContent(\n node: Element,\n clone: Element,\n style: CSSStyleDeclaration,\n pseudoElt: PseudoElementType\n ): HTMLElement | void {\n if (!style) {\n return;\n }\n\n const value = style.content;\n const document = clone.ownerDocument;\n if (!document || !value || value === 'none' || value === '-moz-alt-content' || style.display === 'none') {\n return;\n }\n\n this.counters.parse(new CSSParsedCounterDeclaration(this.context, style));\n const declaration = new CSSParsedPseudoDeclaration(this.context, style);\n\n const anonymousReplacedElement = document.createElement('html2canvaspseudoelement');\n copyCSSStyles(style, anonymousReplacedElement);\n\n declaration.content.forEach((token) => {\n if (token.type === TokenType.STRING_TOKEN) {\n anonymousReplacedElement.appendChild(document.createTextNode(token.value));\n } else if (token.type === TokenType.URL_TOKEN) {\n const img = document.createElement('img');\n img.src = token.value;\n img.style.opacity = '1';\n anonymousReplacedElement.appendChild(img);\n } else if (token.type === TokenType.FUNCTION) {\n if (token.name === 'attr') {\n const attr = token.values.filter(isIdentToken);\n if (attr.length) {\n anonymousReplacedElement.appendChild(\n document.createTextNode(node.getAttribute(attr[0].value) || '')\n );\n }\n } else if (token.name === 'counter') {\n const [counter, counterStyle] = token.values.filter(nonFunctionArgSeparator);\n if (counter && isIdentToken(counter)) {\n const counterState = this.counters.getCounterValue(counter.value);\n const counterType =\n counterStyle && isIdentToken(counterStyle)\n ? listStyleType.parse(this.context, counterStyle.value)\n : LIST_STYLE_TYPE.DECIMAL;\n\n anonymousReplacedElement.appendChild(\n document.createTextNode(createCounterText(counterState, counterType, false))\n );\n }\n } else if (token.name === 'counters') {\n const [counter, delim, counterStyle] = token.values.filter(nonFunctionArgSeparator);\n if (counter && isIdentToken(counter)) {\n const counterStates = this.counters.getCounterValues(counter.value);\n const counterType =\n counterStyle && isIdentToken(counterStyle)\n ? listStyleType.parse(this.context, counterStyle.value)\n : LIST_STYLE_TYPE.DECIMAL;\n const separator = delim && delim.type === TokenType.STRING_TOKEN ? delim.value : '';\n const text = counterStates\n .map((value) => createCounterText(value, counterType, false))\n .join(separator);\n\n anonymousReplacedElement.appendChild(document.createTextNode(text));\n }\n } else {\n // console.log('FUNCTION_TOKEN', token);\n }\n } else if (token.type === TokenType.IDENT_TOKEN) {\n switch (token.value) {\n case 'open-quote':\n anonymousReplacedElement.appendChild(\n document.createTextNode(getQuote(declaration.quotes, this.quoteDepth++, true))\n );\n break;\n case 'close-quote':\n anonymousReplacedElement.appendChild(\n document.createTextNode(getQuote(declaration.quotes, --this.quoteDepth, false))\n );\n break;\n default:\n // safari doesn't parse string tokens correctly because of lack of quotes\n anonymousReplacedElement.appendChild(document.createTextNode(token.value));\n }\n }\n });\n\n anonymousReplacedElement.className = `${PSEUDO_HIDE_ELEMENT_CLASS_BEFORE} ${PSEUDO_HIDE_ELEMENT_CLASS_AFTER}`;\n const newClassName =\n pseudoElt === PseudoElementType.BEFORE\n ? ` ${PSEUDO_HIDE_ELEMENT_CLASS_BEFORE}`\n : ` ${PSEUDO_HIDE_ELEMENT_CLASS_AFTER}`;\n\n if (isSVGElementNode(clone)) {\n clone.className.baseValue += newClassName;\n } else {\n clone.className += newClassName;\n }\n\n return anonymousReplacedElement;\n }\n\n static destroy(container: HTMLIFrameElement): boolean {\n if (container.parentNode) {\n container.parentNode.removeChild(container);\n return true;\n }\n return false;\n }\n}\n\nenum PseudoElementType {\n BEFORE,\n AFTER\n}\n\nconst createIFrameContainer = (\n ownerDocument: Document,\n bounds: Bounds,\n customContainer?: HTMLElement | ShadowRoot\n): HTMLIFrameElement => {\n const cloneIframeContainer = ownerDocument.createElement('iframe');\n\n cloneIframeContainer.className = 'html2canvas-container';\n cloneIframeContainer.style.visibility = 'hidden';\n cloneIframeContainer.style.position = 'fixed';\n cloneIframeContainer.style.left = '-10000px';\n cloneIframeContainer.style.top = '0px';\n cloneIframeContainer.style.border = '0';\n cloneIframeContainer.width = bounds.width.toString();\n cloneIframeContainer.height = bounds.height.toString();\n cloneIframeContainer.scrolling = 'no'; // ios won't scroll without it\n cloneIframeContainer.setAttribute(IGNORE_ATTRIBUTE, 'true');\n\n // Use custom container if provided, otherwise use body\n const container = customContainer || ownerDocument.body;\n container.appendChild(cloneIframeContainer);\n\n return cloneIframeContainer;\n};\n\nconst imageReady = (img: HTMLImageElement): Promise<Event | void | string> => {\n return new Promise((resolve) => {\n if (img.complete) {\n resolve();\n return;\n }\n if (!img.src) {\n resolve();\n return;\n }\n img.onload = resolve;\n img.onerror = resolve;\n });\n};\n\nconst imagesReady = (document: HTMLDocument): Promise<unknown[]> => {\n return Promise.all([].slice.call(document.images, 0).map(imageReady));\n};\n\nconst iframeLoader = (iframe: HTMLIFrameElement): Promise<HTMLIFrameElement> => {\n return new Promise((resolve, reject) => {\n const cloneWindow = iframe.contentWindow;\n\n if (!cloneWindow) {\n return reject(`No window assigned for iframe`);\n }\n\n const documentClone = cloneWindow.document;\n\n cloneWindow.onload = iframe.onload = () => {\n cloneWindow.onload = iframe.onload = null;\n const interval = setInterval(() => {\n if (documentClone.body.childNodes.length > 0 && documentClone.readyState === 'complete') {\n clearInterval(interval);\n resolve(iframe);\n }\n }, 50);\n };\n });\n};\n\nconst ignoredStyleProperties = [\n 'all', // #2476\n 'd', // #2483\n 'content' // Safari shows pseudoelements if content is set\n];\n\nexport const copyCSSStyles = <T extends HTMLElement | SVGElement>(style: CSSStyleDeclaration, target: T): T => {\n // Edge does not provide value for cssText\n for (let i = style.length - 1; i >= 0; i--) {\n const property = style.item(i);\n // fix: Chrome_138 ignore custom properties\n if (ignoredStyleProperties.indexOf(property) === -1 && !property.startsWith('--')) {\n target.style.setProperty(property, style.getPropertyValue(property));\n }\n }\n return target;\n};\n\nconst serializeDoctype = (doctype?: DocumentType | null): string => {\n let str = '';\n if (doctype) {\n str += '<!DOCTYPE ';\n if (doctype.name) {\n str += doctype.name;\n }\n\n if (doctype.internalSubset) {\n str += doctype.internalSubset;\n }\n\n if (doctype.publicId) {\n str += `\"${doctype.publicId}\"`;\n }\n\n if (doctype.systemId) {\n str += `\"${doctype.systemId}\"`;\n }\n\n str += '>';\n }\n\n return str;\n};\n\nconst restoreOwnerScroll = (ownerDocument: Document | null, x: number, y: number) => {\n if (\n ownerDocument &&\n ownerDocument.defaultView &&\n (x !== ownerDocument.defaultView.pageXOffset || y !== ownerDocument.defaultView.pageYOffset)\n ) {\n ownerDocument.defaultView.scrollTo(x, y);\n }\n};\n\nconst restoreNodeScroll = ([element, x, y]: [HTMLElement, number, number]) => {\n element.scrollLeft = x;\n element.scrollTop = y;\n};\n\nconst PSEUDO_BEFORE = ':before';\nconst PSEUDO_AFTER = ':after';\nconst PSEUDO_HIDE_ELEMENT_CLASS_BEFORE = '___html2canvas___pseudoelement_before';\nconst PSEUDO_HIDE_ELEMENT_CLASS_AFTER = '___html2canvas___pseudoelement_after';\n\nconst PSEUDO_HIDE_ELEMENT_STYLE = `{\n content: \"\" !important;\n display: none !important;\n}`;\n\nconst createPseudoHideStyles = (body: HTMLElement, cspNonce?: string) => {\n createStyles(\n body,\n `.${PSEUDO_HIDE_ELEMENT_CLASS_BEFORE}${PSEUDO_BEFORE}${PSEUDO_HIDE_ELEMENT_STYLE}\n .${PSEUDO_HIDE_ELEMENT_CLASS_AFTER}${PSEUDO_AFTER}${PSEUDO_HIDE_ELEMENT_STYLE}`,\n cspNonce\n );\n};\n\nconst createStyles = (body: HTMLElement, styles: string, cspNonce?: string) => {\n const document = body.ownerDocument;\n if (document) {\n const style = document.createElement('style');\n style.textContent = styles;\n if (cspNonce) {\n style.nonce = cspNonce;\n }\n body.appendChild(style);\n }\n};\n\nconst addBase = (targetELement: HTMLElement, baseUri: string) => {\n const baseNode = targetELement.ownerDocument.createElement('base');\n baseNode.href = baseUri;\n const headEle = targetELement.getElementsByTagName('head').item(0);\n headEle?.insertBefore(baseNode, headEle?.firstChild ?? null);\n};\n","import { FEATURES } from './features';\nimport { Context } from './context';\n\nexport class CacheStorage {\n private static _link?: HTMLAnchorElement;\n private static _origin = 'about:blank';\n\n static getOrigin(url: string): string {\n const link = CacheStorage._link;\n if (!link) {\n return 'about:blank';\n }\n\n link.href = url;\n link.href = link.href; // IE9, LOL! - http://jsfiddle.net/niklasvh/2e48b/\n return link.protocol + link.hostname + link.port;\n }\n\n static isSameOrigin(src: string): boolean {\n return CacheStorage.getOrigin(src) === CacheStorage._origin;\n }\n\n static setContext(window: Window): void {\n CacheStorage._link = window.document.createElement('a');\n CacheStorage._origin = CacheStorage.getOrigin(window.location.href);\n }\n}\n\nexport interface ResourceOptions {\n imageTimeout: number;\n useCORS: boolean;\n allowTaint: boolean;\n proxy?: string;\n customIsSameOrigin?: (this: void, src: string, oldFn: (src: string) => boolean) => boolean | Promise<boolean>;\n}\n\nexport class Cache {\n private readonly _cache: { [key: string]: Promise<any> } = {};\n\n constructor(\n private readonly context: Context,\n private readonly _options: ResourceOptions\n ) {}\n\n addImage(src: string): Promise<void> {\n const result = Promise.resolve();\n if (this.has(src)) {\n return result;\n }\n\n if (isBlobImage(src) || isRenderable(src)) {\n (this._cache[src] = this.loadImage(src)).catch(() => {\n // prevent unhandled rejection\n });\n return result;\n }\n\n return result;\n }\n\n match(src: string): Promise<any> {\n return this._cache[src];\n }\n\n private async loadImage(key: string) {\n const isSameOrigin: boolean =\n typeof this._options.customIsSameOrigin === 'function'\n ? await this._options.customIsSameOrigin(key, CacheStorage.isSameOrigin)\n : CacheStorage.isSameOrigin(key);\n const useCORS =\n !isInlineImage(key) && this._options.useCORS === true && FEATURES.SUPPORT_CORS_IMAGES && !isSameOrigin;\n const useProxy =\n !isInlineImage(key) &&\n !isSameOrigin &&\n !isBlobImage(key) &&\n typeof this._options.proxy === 'string' &&\n FEATURES.SUPPORT_CORS_XHR &&\n !useCORS;\n if (\n !isSameOrigin &&\n this._options.allowTaint === false &&\n !isInlineImage(key) &&\n !isBlobImage(key) &&\n !useProxy &&\n !useCORS\n ) {\n return;\n }\n\n let src = key;\n if (useProxy) {\n src = await this.proxy(src);\n }\n\n this.context.logger.debug(`Added image ${key.substring(0, 256)}`);\n\n return await new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => resolve(img);\n img.onerror = reject;\n //ios safari 10.3 taints canvas with data urls unless crossOrigin is set to anonymous\n if (isInlineBase64Image(src) || useCORS) {\n img.crossOrigin = 'anonymous';\n }\n img.src = src;\n if (img.complete === true) {\n // Inline XML images may fail to parse, throwing an Error later on\n setTimeout(() => resolve(img), 500);\n }\n if (this._options.imageTimeout > 0) {\n setTimeout(\n () => reject(`Timed out (${this._options.imageTimeout}ms) loading image`),\n this._options.imageTimeout\n );\n }\n });\n }\n\n private has(key: string): boolean {\n return typeof this._cache[key] !== 'undefined';\n }\n\n keys(): Promise<string[]> {\n return Promise.resolve(Object.keys(this._cache));\n }\n\n private proxy(src: string): Promise<string> {\n const proxy = this._options.proxy;\n\n if (!proxy) {\n throw new Error('No proxy defined');\n }\n\n const key = src.substring(0, 256);\n\n return new Promise((resolve, reject) => {\n const responseType = FEATURES.SUPPORT_RESPONSE_TYPE ? 'blob' : 'text';\n const xhr = new XMLHttpRequest();\n xhr.onload = () => {\n if (xhr.status === 200) {\n if (responseType === 'text') {\n resolve(xhr.response);\n } else {\n const reader = new FileReader();\n reader.addEventListener('load', () => resolve(reader.result as string), false);\n reader.addEventListener('error', (e) => reject(e), false);\n reader.readAsDataURL(xhr.response);\n }\n } else {\n reject(`Failed to proxy resource ${key} with status code ${xhr.status}`);\n }\n };\n\n xhr.onerror = reject;\n const queryString = proxy.indexOf('?') > -1 ? '&' : '?';\n xhr.open('GET', `${proxy}${queryString}url=${encodeURIComponent(src)}&responseType=${responseType}`);\n\n if (responseType !== 'text' && xhr instanceof XMLHttpRequest) {\n xhr.responseType = responseType;\n }\n\n if (this._options.imageTimeout) {\n const timeout = this._options.imageTimeout;\n xhr.timeout = timeout;\n xhr.ontimeout = () => reject(`Timed out (${timeout}ms) proxying ${key}`);\n }\n\n xhr.send();\n });\n }\n}\n\nconst INLINE_SVG = /^data:image\\/svg\\+xml/i;\nconst INLINE_BASE64 = /^data:image\\/.*;base64,/i;\nconst INLINE_IMG = /^data:image\\/.*/i;\n\nconst isRenderable = (src: string): boolean => FEATURES.SUPPORT_SVG_DRAWING || !isSVG(src);\nconst isInlineImage = (src: string): boolean => INLINE_IMG.test(src);\nconst isInlineBase64Image = (src: string): boolean => INLINE_BASE64.test(src);\nconst isBlobImage = (src: string): boolean => src.substr(0, 4) === 'blob';\n\nconst isSVG = (src: string): boolean => src.substr(-3).toLowerCase() === 'svg' || INLINE_SVG.test(src);\n","import { IPath, Path, PathType } from './path';\n\nexport class Vector implements IPath {\n type: PathType;\n x: number;\n y: number;\n\n constructor(x: number, y: number) {\n this.type = PathType.VECTOR;\n this.x = x;\n this.y = y;\n }\n\n add(deltaX: number, deltaY: number): Vector {\n return new Vector(this.x + deltaX, this.y + deltaY);\n }\n}\n\nexport const isVector = (path: Path): path is Vector => path.type === PathType.VECTOR;\n","import { Vector } from './vector';\nimport { IPath, PathType, Path } from './path';\n\nconst lerp = (a: Vector, b: Vector, t: number): Vector => {\n return new Vector(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t);\n};\n\nexport class BezierCurve implements IPath {\n type: PathType;\n start: Vector;\n startControl: Vector;\n endControl: Vector;\n end: Vector;\n\n constructor(start: Vector, startControl: Vector, endControl: Vector, end: Vector) {\n this.type = PathType.BEZIER_CURVE;\n this.start = start;\n this.startControl = startControl;\n this.endControl = endControl;\n this.end = end;\n }\n\n subdivide(t: number, firstHalf: boolean): BezierCurve {\n const ab = lerp(this.start, this.startControl, t);\n const bc = lerp(this.startControl, this.endControl, t);\n const cd = lerp(this.endControl, this.end, t);\n const abbc = lerp(ab, bc, t);\n const bccd = lerp(bc, cd, t);\n const dest = lerp(abbc, bccd, t);\n return firstHalf ? new BezierCurve(this.start, ab, abbc, dest) : new BezierCurve(dest, bccd, cd, this.end);\n }\n\n add(deltaX: number, deltaY: number): BezierCurve {\n return new BezierCurve(\n this.start.add(deltaX, deltaY),\n this.startControl.add(deltaX, deltaY),\n this.endControl.add(deltaX, deltaY),\n this.end.add(deltaX, deltaY)\n );\n }\n\n reverse(): BezierCurve {\n return new BezierCurve(this.end, this.endControl, this.startControl, this.start);\n }\n}\n\nexport const isBezierCurve = (path: Path): path is BezierCurve => path.type === PathType.BEZIER_CURVE;\n","import { ElementContainer } from '../dom/element-container';\nimport { getAbsoluteValue, getAbsoluteValueForTuple } from '../css/types/length-percentage';\nimport { Vector } from './vector';\nimport { BezierCurve } from './bezier-curve';\nimport { Path } from './path';\n\nexport class BoundCurves {\n readonly topLeftBorderDoubleOuterBox: Path;\n readonly topRightBorderDoubleOuterBox: Path;\n readonly bottomRightBorderDoubleOuterBox: Path;\n readonly bottomLeftBorderDoubleOuterBox: Path;\n readonly topLeftBorderDoubleInnerBox: Path;\n readonly topRightBorderDoubleInnerBox: Path;\n readonly bottomRightBorderDoubleInnerBox: Path;\n readonly bottomLeftBorderDoubleInnerBox: Path;\n readonly topLeftBorderStroke: Path;\n readonly topRightBorderStroke: Path;\n readonly bottomRightBorderStroke: Path;\n readonly bottomLeftBorderStroke: Path;\n readonly topLeftBorderBox: Path;\n readonly topRightBorderBox: Path;\n readonly bottomRightBorderBox: Path;\n readonly bottomLeftBorderBox: Path;\n readonly topLeftPaddingBox: Path;\n readonly topRightPaddingBox: Path;\n readonly bottomRightPaddingBox: Path;\n readonly bottomLeftPaddingBox: Path;\n readonly topLeftContentBox: Path;\n readonly topRightContentBox: Path;\n readonly bottomRightContentBox: Path;\n readonly bottomLeftContentBox: Path;\n\n constructor(element: ElementContainer) {\n const styles = element.styles;\n const bounds = element.bounds;\n\n let [tlh, tlv] = getAbsoluteValueForTuple(styles.borderTopLeftRadius, bounds.width, bounds.height);\n let [trh, trv] = getAbsoluteValueForTuple(styles.borderTopRightRadius, bounds.width, bounds.height);\n let [brh, brv] = getAbsoluteValueForTuple(styles.borderBottomRightRadius, bounds.width, bounds.height);\n let [blh, blv] = getAbsoluteValueForTuple(styles.borderBottomLeftRadius, bounds.width, bounds.height);\n\n const factors = [];\n factors.push((tlh + trh) / bounds.width);\n factors.push((blh + brh) / bounds.width);\n factors.push((tlv + blv) / bounds.height);\n factors.push((trv + brv) / bounds.height);\n const maxFactor = Math.max(...factors);\n\n if (maxFactor > 1) {\n tlh /= maxFactor;\n tlv /= maxFactor;\n trh /= maxFactor;\n trv /= maxFactor;\n brh /= maxFactor;\n brv /= maxFactor;\n blh /= maxFactor;\n blv /= maxFactor;\n }\n\n const topWidth = bounds.width - trh;\n const rightHeight = bounds.height - brv;\n const bottomWidth = bounds.width - brh;\n const leftHeight = bounds.height - blv;\n\n const borderTopWidth = styles.borderTopWidth;\n const borderRightWidth = styles.borderRightWidth;\n const borderBottomWidth = styles.borderBottomWidth;\n const borderLeftWidth = styles.borderLeftWidth;\n\n const paddingTop = getAbsoluteValue(styles.paddingTop, element.bounds.width);\n const paddingRight = getAbsoluteValue(styles.paddingRight, element.bounds.width);\n const paddingBottom = getAbsoluteValue(styles.paddingBottom, element.bounds.width);\n const paddingLeft = getAbsoluteValue(styles.paddingLeft, element.bounds.width);\n\n this.topLeftBorderDoubleOuterBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(\n bounds.left + borderLeftWidth / 3,\n bounds.top + borderTopWidth / 3,\n tlh - borderLeftWidth / 3,\n tlv - borderTopWidth / 3,\n CORNER.TOP_LEFT\n )\n : new Vector(bounds.left + borderLeftWidth / 3, bounds.top + borderTopWidth / 3);\n this.topRightBorderDoubleOuterBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(\n bounds.left + topWidth,\n bounds.top + borderTopWidth / 3,\n trh - borderRightWidth / 3,\n trv - borderTopWidth / 3,\n CORNER.TOP_RIGHT\n )\n : new Vector(bounds.left + bounds.width - borderRightWidth / 3, bounds.top + borderTopWidth / 3);\n this.bottomRightBorderDoubleOuterBox =\n brh > 0 || brv > 0\n ? getCurvePoints(\n bounds.left + bottomWidth,\n bounds.top + rightHeight,\n brh - borderRightWidth / 3,\n brv - borderBottomWidth / 3,\n CORNER.BOTTOM_RIGHT\n )\n : new Vector(\n bounds.left + bounds.width - borderRightWidth / 3,\n bounds.top + bounds.height - borderBottomWidth / 3\n );\n this.bottomLeftBorderDoubleOuterBox =\n blh > 0 || blv > 0\n ? getCurvePoints(\n bounds.left + borderLeftWidth / 3,\n bounds.top + leftHeight,\n blh - borderLeftWidth / 3,\n blv - borderBottomWidth / 3,\n CORNER.BOTTOM_LEFT\n )\n : new Vector(bounds.left + borderLeftWidth / 3, bounds.top + bounds.height - borderBottomWidth / 3);\n this.topLeftBorderDoubleInnerBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(\n bounds.left + (borderLeftWidth * 2) / 3,\n bounds.top + (borderTopWidth * 2) / 3,\n tlh - (borderLeftWidth * 2) / 3,\n tlv - (borderTopWidth * 2) / 3,\n CORNER.TOP_LEFT\n )\n : new Vector(bounds.left + (borderLeftWidth * 2) / 3, bounds.top + (borderTopWidth * 2) / 3);\n this.topRightBorderDoubleInnerBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(\n bounds.left + topWidth,\n bounds.top + (borderTopWidth * 2) / 3,\n trh - (borderRightWidth * 2) / 3,\n trv - (borderTopWidth * 2) / 3,\n CORNER.TOP_RIGHT\n )\n : new Vector(\n bounds.left + bounds.width - (borderRightWidth * 2) / 3,\n bounds.top + (borderTopWidth * 2) / 3\n );\n this.bottomRightBorderDoubleInnerBox =\n brh > 0 || brv > 0\n ? getCurvePoints(\n bounds.left + bottomWidth,\n bounds.top + rightHeight,\n brh - (borderRightWidth * 2) / 3,\n brv - (borderBottomWidth * 2) / 3,\n CORNER.BOTTOM_RIGHT\n )\n : new Vector(\n bounds.left + bounds.width - (borderRightWidth * 2) / 3,\n bounds.top + bounds.height - (borderBottomWidth * 2) / 3\n );\n this.bottomLeftBorderDoubleInnerBox =\n blh > 0 || blv > 0\n ? getCurvePoints(\n bounds.left + (borderLeftWidth * 2) / 3,\n bounds.top + leftHeight,\n blh - (borderLeftWidth * 2) / 3,\n blv - (borderBottomWidth * 2) / 3,\n CORNER.BOTTOM_LEFT\n )\n : new Vector(\n bounds.left + (borderLeftWidth * 2) / 3,\n bounds.top + bounds.height - (borderBottomWidth * 2) / 3\n );\n this.topLeftBorderStroke =\n tlh > 0 || tlv > 0\n ? getCurvePoints(\n bounds.left + borderLeftWidth / 2,\n bounds.top + borderTopWidth / 2,\n tlh - borderLeftWidth / 2,\n tlv - borderTopWidth / 2,\n CORNER.TOP_LEFT\n )\n : new Vector(bounds.left + borderLeftWidth / 2, bounds.top + borderTopWidth / 2);\n this.topRightBorderStroke =\n tlh > 0 || tlv > 0\n ? getCurvePoints(\n bounds.left + topWidth,\n bounds.top + borderTopWidth / 2,\n trh - borderRightWidth / 2,\n trv - borderTopWidth / 2,\n CORNER.TOP_RIGHT\n )\n : new Vector(bounds.left + bounds.width - borderRightWidth / 2, bounds.top + borderTopWidth / 2);\n this.bottomRightBorderStroke =\n brh > 0 || brv > 0\n ? getCurvePoints(\n bounds.left + bottomWidth,\n bounds.top + rightHeight,\n brh - borderRightWidth / 2,\n brv - borderBottomWidth / 2,\n CORNER.BOTTOM_RIGHT\n )\n : new Vector(\n bounds.left + bounds.width - borderRightWidth / 2,\n bounds.top + bounds.height - borderBottomWidth / 2\n );\n this.bottomLeftBorderStroke =\n blh > 0 || blv > 0\n ? getCurvePoints(\n bounds.left + borderLeftWidth / 2,\n bounds.top + leftHeight,\n blh - borderLeftWidth / 2,\n blv - borderBottomWidth / 2,\n CORNER.BOTTOM_LEFT\n )\n : new Vector(bounds.left + borderLeftWidth / 2, bounds.top + bounds.height - borderBottomWidth / 2);\n this.topLeftBorderBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(bounds.left, bounds.top, tlh, tlv, CORNER.TOP_LEFT)\n : new Vector(bounds.left, bounds.top);\n this.topRightBorderBox =\n trh > 0 || trv > 0\n ? getCurvePoints(bounds.left + topWidth, bounds.top, trh, trv, CORNER.TOP_RIGHT)\n : new Vector(bounds.left + bounds.width, bounds.top);\n this.bottomRightBorderBox =\n brh > 0 || brv > 0\n ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh, brv, CORNER.BOTTOM_RIGHT)\n : new Vector(bounds.left + bounds.width, bounds.top + bounds.height);\n this.bottomLeftBorderBox =\n blh > 0 || blv > 0\n ? getCurvePoints(bounds.left, bounds.top + leftHeight, blh, blv, CORNER.BOTTOM_LEFT)\n : new Vector(bounds.left, bounds.top + bounds.height);\n this.topLeftPaddingBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(\n bounds.left + borderLeftWidth,\n bounds.top + borderTopWidth,\n Math.max(0, tlh - borderLeftWidth),\n Math.max(0, tlv - borderTopWidth),\n CORNER.TOP_LEFT\n )\n : new Vector(bounds.left + borderLeftWidth, bounds.top + borderTopWidth);\n this.topRightPaddingBox =\n trh > 0 || trv > 0\n ? getCurvePoints(\n bounds.left + Math.min(topWidth, bounds.width - borderRightWidth),\n bounds.top + borderTopWidth,\n topWidth > bounds.width + borderRightWidth ? 0 : Math.max(0, trh - borderRightWidth),\n Math.max(0, trv - borderTopWidth),\n CORNER.TOP_RIGHT\n )\n : new Vector(bounds.left + bounds.width - borderRightWidth, bounds.top + borderTopWidth);\n this.bottomRightPaddingBox =\n brh > 0 || brv > 0\n ? getCurvePoints(\n bounds.left + Math.min(bottomWidth, bounds.width - borderLeftWidth),\n bounds.top + Math.min(rightHeight, bounds.height - borderBottomWidth),\n Math.max(0, brh - borderRightWidth),\n Math.max(0, brv - borderBottomWidth),\n CORNER.BOTTOM_RIGHT\n )\n : new Vector(\n bounds.left + bounds.width - borderRightWidth,\n bounds.top + bounds.height - borderBottomWidth\n );\n this.bottomLeftPaddingBox =\n blh > 0 || blv > 0\n ? getCurvePoints(\n bounds.left + borderLeftWidth,\n bounds.top + Math.min(leftHeight, bounds.height - borderBottomWidth),\n Math.max(0, blh - borderLeftWidth),\n Math.max(0, blv - borderBottomWidth),\n CORNER.BOTTOM_LEFT\n )\n : new Vector(bounds.left + borderLeftWidth, bounds.top + bounds.height - borderBottomWidth);\n this.topLeftContentBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(\n bounds.left + borderLeftWidth + paddingLeft,\n bounds.top + borderTopWidth + paddingTop,\n Math.max(0, tlh - (borderLeftWidth + paddingLeft)),\n Math.max(0, tlv - (borderTopWidth + paddingTop)),\n CORNER.TOP_LEFT\n )\n : new Vector(bounds.left + borderLeftWidth + paddingLeft, bounds.top + borderTopWidth + paddingTop);\n this.topRightContentBox =\n trh > 0 || trv > 0\n ? getCurvePoints(\n bounds.left + Math.min(topWidth, bounds.width + borderLeftWidth + paddingLeft),\n bounds.top + borderTopWidth + paddingTop,\n topWidth > bounds.width + borderLeftWidth + paddingLeft ? 0 : trh - borderLeftWidth + paddingLeft,\n trv - (borderTopWidth + paddingTop),\n CORNER.TOP_RIGHT\n )\n : new Vector(\n bounds.left + bounds.width - (borderRightWidth + paddingRight),\n bounds.top + borderTopWidth + paddingTop\n );\n this.bottomRightContentBox =\n brh > 0 || brv > 0\n ? getCurvePoints(\n bounds.left + Math.min(bottomWidth, bounds.width - (borderLeftWidth + paddingLeft)),\n bounds.top + Math.min(rightHeight, bounds.height + borderTopWidth + paddingTop),\n Math.max(0, brh - (borderRightWidth + paddingRight)),\n brv - (borderBottomWidth + paddingBottom),\n CORNER.BOTTOM_RIGHT\n )\n : new Vector(\n bounds.left + bounds.width - (borderRightWidth + paddingRight),\n bounds.top + bounds.height - (borderBottomWidth + paddingBottom)\n );\n this.bottomLeftContentBox =\n blh > 0 || blv > 0\n ? getCurvePoints(\n bounds.left + borderLeftWidth + paddingLeft,\n bounds.top + leftHeight,\n Math.max(0, blh - (borderLeftWidth + paddingLeft)),\n blv - (borderBottomWidth + paddingBottom),\n CORNER.BOTTOM_LEFT\n )\n : new Vector(\n bounds.left + borderLeftWidth + paddingLeft,\n bounds.top + bounds.height - (borderBottomWidth + paddingBottom)\n );\n }\n}\n\nenum CORNER {\n TOP_LEFT = 0,\n TOP_RIGHT = 1,\n BOTTOM_RIGHT = 2,\n BOTTOM_LEFT = 3\n}\n\nconst getCurvePoints = (x: number, y: number, r1: number, r2: number, position: CORNER): BezierCurve => {\n const kappa = 4 * ((Math.sqrt(2) - 1) / 3);\n const ox = r1 * kappa; // control point offset horizontal\n const oy = r2 * kappa; // control point offset vertical\n const xm = x + r1; // x-middle\n const ym = y + r2; // y-middle\n\n switch (position) {\n case CORNER.TOP_LEFT:\n return new BezierCurve(\n new Vector(x, ym),\n new Vector(x, ym - oy),\n new Vector(xm - ox, y),\n new Vector(xm, y)\n );\n case CORNER.TOP_RIGHT:\n return new BezierCurve(\n new Vector(x, y),\n new Vector(x + ox, y),\n new Vector(xm, ym - oy),\n new Vector(xm, ym)\n );\n case CORNER.BOTTOM_RIGHT:\n return new BezierCurve(\n new Vector(xm, y),\n new Vector(xm, y + oy),\n new Vector(x + ox, ym),\n new Vector(x, ym)\n );\n case CORNER.BOTTOM_LEFT:\n default:\n return new BezierCurve(\n new Vector(xm, ym),\n new Vector(xm - ox, ym),\n new Vector(x, y + oy),\n new Vector(x, y)\n );\n }\n};\n\nexport const calculateBorderBoxPath = (curves: BoundCurves): Path[] => {\n return [curves.topLeftBorderBox, curves.topRightBorderBox, curves.bottomRightBorderBox, curves.bottomLeftBorderBox];\n};\n\nexport const calculateContentBoxPath = (curves: BoundCurves): Path[] => {\n return [\n curves.topLeftContentBox,\n curves.topRightContentBox,\n curves.bottomRightContentBox,\n curves.bottomLeftContentBox\n ];\n};\n\nexport const calculatePaddingBoxPath = (curves: BoundCurves): Path[] => {\n return [\n curves.topLeftPaddingBox,\n curves.topRightPaddingBox,\n curves.bottomRightPaddingBox,\n curves.bottomLeftPaddingBox\n ];\n};\n","import { Matrix } from '../css/property-descriptors/transform';\nimport { Path } from './path';\n\nexport const enum EffectType {\n TRANSFORM = 0,\n CLIP = 1,\n OPACITY = 2\n}\n\nexport const enum EffectTarget {\n BACKGROUND_BORDERS = 1 << 1,\n CONTENT = 1 << 2\n}\n\nexport interface IElementEffect {\n readonly type: EffectType;\n readonly target: number;\n}\n\nexport class TransformEffect implements IElementEffect {\n readonly type: EffectType = EffectType.TRANSFORM;\n readonly target: number = EffectTarget.BACKGROUND_BORDERS | EffectTarget.CONTENT;\n\n constructor(\n readonly offsetX: number,\n readonly offsetY: number,\n readonly matrix: Matrix\n ) {}\n}\n\nexport class ClipEffect implements IElementEffect {\n readonly type: EffectType = EffectType.CLIP;\n\n constructor(\n readonly path: Path[],\n readonly target: EffectTarget\n ) {}\n}\n\nexport class OpacityEffect implements IElementEffect {\n readonly type: EffectType = EffectType.OPACITY;\n readonly target: number = EffectTarget.BACKGROUND_BORDERS | EffectTarget.CONTENT;\n\n constructor(readonly opacity: number) {}\n}\n\nexport const isTransformEffect = (effect: IElementEffect): effect is TransformEffect =>\n effect.type === EffectType.TRANSFORM;\nexport const isClipEffect = (effect: IElementEffect): effect is ClipEffect => effect.type === EffectType.CLIP;\nexport const isOpacityEffect = (effect: IElementEffect): effect is OpacityEffect => effect.type === EffectType.OPACITY;\n","import { BezierCurve } from './bezier-curve';\nimport { Vector } from './vector';\nexport const enum PathType {\n VECTOR = 0,\n BEZIER_CURVE = 1\n}\n\nexport interface IPath {\n type: PathType;\n add(deltaX: number, deltaY: number): IPath;\n}\n\nexport const equalPath = (a: Path[], b: Path[]): boolean => {\n if (a.length === b.length) {\n return a.some((v, i) => v === b[i]);\n }\n\n return false;\n};\n\nexport const transformPath = (path: Path[], deltaX: number, deltaY: number, deltaW: number, deltaH: number): Path[] => {\n return path.map((point, index) => {\n switch (index) {\n case 0:\n return point.add(deltaX, deltaY);\n case 1:\n return point.add(deltaX + deltaW, deltaY);\n case 2:\n return point.add(deltaX + deltaW, deltaY + deltaH);\n case 3:\n return point.add(deltaX, deltaY + deltaH);\n }\n return point;\n });\n};\n\nexport type Path = Vector | BezierCurve;\n","import { ElementContainer, FLAGS } from '../dom/element-container';\nimport { contains } from '../core/bitwise';\nimport { BoundCurves, calculateBorderBoxPath, calculatePaddingBoxPath } from './bound-curves';\nimport { ClipEffect, EffectTarget, IElementEffect, isClipEffect, OpacityEffect, TransformEffect } from './effects';\nimport { Matrix } from '../css/property-descriptors/transform';\nimport { OVERFLOW } from '../css/property-descriptors/overflow';\nimport { equalPath } from './path';\nimport { DISPLAY } from '../css/property-descriptors/display';\nimport { OLElementContainer } from '../dom/elements/ol-element-container';\nimport { LIElementContainer } from '../dom/elements/li-element-container';\nimport { createCounterText } from '../css/types/functions/counter';\nimport { POSITION } from '../css/property-descriptors/position';\nimport { getAbsoluteValue } from '../css/types/length-percentage';\n\nexport class StackingContext {\n element: ElementPaint;\n negativeZIndex: StackingContext[];\n zeroOrAutoZIndexOrTransformedOrOpacity: StackingContext[];\n positiveZIndex: StackingContext[];\n nonPositionedFloats: StackingContext[];\n nonPositionedInlineLevel: StackingContext[];\n inlineLevel: ElementPaint[];\n nonInlineLevel: ElementPaint[];\n\n constructor(container: ElementPaint) {\n this.element = container;\n this.inlineLevel = [];\n this.nonInlineLevel = [];\n this.negativeZIndex = [];\n this.zeroOrAutoZIndexOrTransformedOrOpacity = [];\n this.positiveZIndex = [];\n this.nonPositionedFloats = [];\n this.nonPositionedInlineLevel = [];\n }\n}\n\nexport class ElementPaint {\n readonly effects: IElementEffect[] = [];\n readonly curves: BoundCurves;\n listValue?: string;\n\n constructor(\n readonly container: ElementContainer,\n readonly parent: ElementPaint | null\n ) {\n this.curves = new BoundCurves(this.container);\n if (this.container.styles.opacity < 1) {\n this.effects.push(new OpacityEffect(this.container.styles.opacity));\n }\n\n if (this.container.styles.rotate !== null) {\n const origin = this.container.styles.transformOrigin;\n const offsetX = this.container.bounds.left + getAbsoluteValue(origin[0], this.container.bounds.width);\n const offsetY = this.container.bounds.top + getAbsoluteValue(origin[1], this.container.bounds.height);\n // Apply rotate property if present\n const angle = this.container.styles.rotate;\n const rad = (angle * Math.PI) / 180;\n const cos = Math.cos(rad);\n const sin = Math.sin(rad);\n const rotateMatrix: Matrix = [cos, sin, -sin, cos, 0, 0];\n this.effects.push(new TransformEffect(offsetX, offsetY, rotateMatrix));\n }\n\n if (this.container.styles.transform !== null) {\n const origin = this.container.styles.transformOrigin;\n const offsetX = this.container.bounds.left + getAbsoluteValue(origin[0], this.container.bounds.width);\n const offsetY = this.container.bounds.top + getAbsoluteValue(origin[1], this.container.bounds.height);\n const matrix = this.container.styles.transform;\n this.effects.push(new TransformEffect(offsetX, offsetY, matrix));\n }\n\n if (this.container.styles.overflowX !== OVERFLOW.VISIBLE) {\n const borderBox = calculateBorderBoxPath(this.curves);\n const paddingBox = calculatePaddingBoxPath(this.curves);\n\n if (equalPath(borderBox, paddingBox)) {\n this.effects.push(new ClipEffect(borderBox, EffectTarget.BACKGROUND_BORDERS | EffectTarget.CONTENT));\n } else {\n this.effects.push(new ClipEffect(borderBox, EffectTarget.BACKGROUND_BORDERS));\n this.effects.push(new ClipEffect(paddingBox, EffectTarget.CONTENT));\n }\n }\n }\n\n getEffects(target: EffectTarget): IElementEffect[] {\n let inFlow = [POSITION.ABSOLUTE, POSITION.FIXED].indexOf(this.container.styles.position) === -1;\n let parent = this.parent;\n const effects = this.effects.slice(0);\n while (parent) {\n const croplessEffects = parent.effects.filter((effect) => !isClipEffect(effect));\n if (inFlow || parent.container.styles.position !== POSITION.STATIC || !parent.parent) {\n inFlow = [POSITION.ABSOLUTE, POSITION.FIXED].indexOf(parent.container.styles.position) === -1;\n if (parent.container.styles.overflowX !== OVERFLOW.VISIBLE) {\n const borderBox = calculateBorderBoxPath(parent.curves);\n const paddingBox = calculatePaddingBoxPath(parent.curves);\n if (!equalPath(borderBox, paddingBox)) {\n effects.unshift(\n new ClipEffect(paddingBox, EffectTarget.BACKGROUND_BORDERS | EffectTarget.CONTENT)\n );\n }\n }\n effects.unshift(...croplessEffects);\n } else {\n effects.unshift(...croplessEffects);\n }\n\n parent = parent.parent;\n }\n\n return effects.filter((effect) => contains(effect.target, target));\n }\n}\n\nconst parseStackTree = (\n parent: ElementPaint,\n stackingContext: StackingContext,\n realStackingContext: StackingContext,\n listItems: ElementPaint[]\n) => {\n parent.container.elements.forEach((child) => {\n const treatAsRealStackingContext = contains(child.flags, FLAGS.CREATES_REAL_STACKING_CONTEXT);\n const createsStackingContext = contains(child.flags, FLAGS.CREATES_STACKING_CONTEXT);\n const paintContainer = new ElementPaint(child, parent);\n if (contains(child.styles.display, DISPLAY.LIST_ITEM)) {\n listItems.push(paintContainer);\n }\n\n const listOwnerItems = contains(child.flags, FLAGS.IS_LIST_OWNER) ? [] : listItems;\n\n if (treatAsRealStackingContext || createsStackingContext) {\n const parentStack =\n treatAsRealStackingContext || child.styles.isPositioned() ? realStackingContext : stackingContext;\n\n const stack = new StackingContext(paintContainer);\n\n if (child.styles.isPositioned() || child.styles.opacity < 1 || child.styles.isTransformed()) {\n const order = child.styles.zIndex.order;\n if (order < 0) {\n let index = 0;\n\n parentStack.negativeZIndex.some((current, i) => {\n if (order > current.element.container.styles.zIndex.order) {\n index = i;\n return false;\n } else if (index > 0) {\n return true;\n }\n\n return false;\n });\n parentStack.negativeZIndex.splice(index, 0, stack);\n } else if (order > 0) {\n let index = 0;\n parentStack.positiveZIndex.some((current, i) => {\n if (order >= current.element.container.styles.zIndex.order) {\n index = i + 1;\n return false;\n } else if (index > 0) {\n return true;\n }\n\n return false;\n });\n parentStack.positiveZIndex.splice(index, 0, stack);\n } else {\n parentStack.zeroOrAutoZIndexOrTransformedOrOpacity.push(stack);\n }\n } else {\n if (child.styles.isFloating()) {\n parentStack.nonPositionedFloats.push(stack);\n } else {\n parentStack.nonPositionedInlineLevel.push(stack);\n }\n }\n\n parseStackTree(\n paintContainer,\n stack,\n treatAsRealStackingContext ? stack : realStackingContext,\n listOwnerItems\n );\n } else {\n if (child.styles.isInlineLevel()) {\n stackingContext.inlineLevel.push(paintContainer);\n } else {\n stackingContext.nonInlineLevel.push(paintContainer);\n }\n\n parseStackTree(paintContainer, stackingContext, realStackingContext, listOwnerItems);\n }\n\n if (contains(child.flags, FLAGS.IS_LIST_OWNER)) {\n processListItems(child, listOwnerItems);\n }\n });\n};\n\nconst processListItems = (owner: ElementContainer, elements: ElementPaint[]) => {\n let numbering = owner instanceof OLElementContainer ? owner.start : 1;\n const reversed = owner instanceof OLElementContainer ? owner.reversed : false;\n for (let i = 0; i < elements.length; i++) {\n const item = elements[i];\n if (\n item.container instanceof LIElementContainer &&\n typeof item.container.value === 'number' &&\n item.container.value !== 0\n ) {\n numbering = item.container.value;\n }\n\n item.listValue = createCounterText(numbering, item.container.styles.listStyleType, true);\n\n numbering += reversed ? -1 : 1;\n }\n};\n\nexport const parseStackingContexts = (container: ElementContainer): StackingContext => {\n const paintContainer = new ElementPaint(container, null);\n const root = new StackingContext(paintContainer);\n const listItems: ElementPaint[] = [];\n parseStackTree(paintContainer, root, root, listItems);\n processListItems(paintContainer.container, listItems);\n return root;\n};\n","import { Path } from './path';\nimport { BoundCurves } from './bound-curves';\nimport { isBezierCurve } from './bezier-curve';\n\nexport const parsePathForBorder = (curves: BoundCurves, borderSide: number): Path[] => {\n switch (borderSide) {\n case 0:\n return createPathFromCurves(\n curves.topLeftBorderBox,\n curves.topLeftPaddingBox,\n curves.topRightBorderBox,\n curves.topRightPaddingBox\n );\n case 1:\n return createPathFromCurves(\n curves.topRightBorderBox,\n curves.topRightPaddingBox,\n curves.bottomRightBorderBox,\n curves.bottomRightPaddingBox\n );\n case 2:\n return createPathFromCurves(\n curves.bottomRightBorderBox,\n curves.bottomRightPaddingBox,\n curves.bottomLeftBorderBox,\n curves.bottomLeftPaddingBox\n );\n case 3:\n default:\n return createPathFromCurves(\n curves.bottomLeftBorderBox,\n curves.bottomLeftPaddingBox,\n curves.topLeftBorderBox,\n curves.topLeftPaddingBox\n );\n }\n};\n\nexport const parsePathForBorderDoubleOuter = (curves: BoundCurves, borderSide: number): Path[] => {\n switch (borderSide) {\n case 0:\n return createPathFromCurves(\n curves.topLeftBorderBox,\n curves.topLeftBorderDoubleOuterBox,\n curves.topRightBorderBox,\n curves.topRightBorderDoubleOuterBox\n );\n case 1:\n return createPathFromCurves(\n curves.topRightBorderBox,\n curves.topRightBorderDoubleOuterBox,\n curves.bottomRightBorderBox,\n curves.bottomRightBorderDoubleOuterBox\n );\n case 2:\n return createPathFromCurves(\n curves.bottomRightBorderBox,\n curves.bottomRightBorderDoubleOuterBox,\n curves.bottomLeftBorderBox,\n curves.bottomLeftBorderDoubleOuterBox\n );\n case 3:\n default:\n return createPathFromCurves(\n curves.bottomLeftBorderBox,\n curves.bottomLeftBorderDoubleOuterBox,\n curves.topLeftBorderBox,\n curves.topLeftBorderDoubleOuterBox\n );\n }\n};\n\nexport const parsePathForBorderDoubleInner = (curves: BoundCurves, borderSide: number): Path[] => {\n switch (borderSide) {\n case 0:\n return createPathFromCurves(\n curves.topLeftBorderDoubleInnerBox,\n curves.topLeftPaddingBox,\n curves.topRightBorderDoubleInnerBox,\n curves.topRightPaddingBox\n );\n case 1:\n return createPathFromCurves(\n curves.topRightBorderDoubleInnerBox,\n curves.topRightPaddingBox,\n curves.bottomRightBorderDoubleInnerBox,\n curves.bottomRightPaddingBox\n );\n case 2:\n return createPathFromCurves(\n curves.bottomRightBorderDoubleInnerBox,\n curves.bottomRightPaddingBox,\n curves.bottomLeftBorderDoubleInnerBox,\n curves.bottomLeftPaddingBox\n );\n case 3:\n default:\n return createPathFromCurves(\n curves.bottomLeftBorderDoubleInnerBox,\n curves.bottomLeftPaddingBox,\n curves.topLeftBorderDoubleInnerBox,\n curves.topLeftPaddingBox\n );\n }\n};\n\nexport const parsePathForBorderStroke = (curves: BoundCurves, borderSide: number): Path[] => {\n switch (borderSide) {\n case 0:\n return createStrokePathFromCurves(curves.topLeftBorderStroke, curves.topRightBorderStroke);\n case 1:\n return createStrokePathFromCurves(curves.topRightBorderStroke, curves.bottomRightBorderStroke);\n case 2:\n return createStrokePathFromCurves(curves.bottomRightBorderStroke, curves.bottomLeftBorderStroke);\n case 3:\n default:\n return createStrokePathFromCurves(curves.bottomLeftBorderStroke, curves.topLeftBorderStroke);\n }\n};\n\nconst createStrokePathFromCurves = (outer1: Path, outer2: Path): Path[] => {\n const path = [];\n if (isBezierCurve(outer1)) {\n path.push(outer1.subdivide(0.5, false));\n } else {\n path.push(outer1);\n }\n\n if (isBezierCurve(outer2)) {\n path.push(outer2.subdivide(0.5, true));\n } else {\n path.push(outer2);\n }\n\n return path;\n};\n\nconst createPathFromCurves = (outer1: Path, inner1: Path, outer2: Path, inner2: Path): Path[] => {\n const path = [];\n if (isBezierCurve(outer1)) {\n path.push(outer1.subdivide(0.5, false));\n } else {\n path.push(outer1);\n }\n\n if (isBezierCurve(outer2)) {\n path.push(outer2.subdivide(0.5, true));\n } else {\n path.push(outer2);\n }\n\n if (isBezierCurve(inner2)) {\n path.push(inner2.subdivide(0.5, true).reverse());\n } else {\n path.push(inner2);\n }\n\n if (isBezierCurve(inner1)) {\n path.push(inner1.subdivide(0.5, false).reverse());\n } else {\n path.push(inner1);\n }\n\n return path;\n};\n","import { getAbsoluteValue } from '../css/types/length-percentage';\nimport { Bounds } from '../css/layout/bounds';\nimport { ElementContainer } from '../dom/element-container';\n\nexport const paddingBox = (element: ElementContainer): Bounds => {\n const bounds = element.bounds;\n const styles = element.styles;\n return bounds.add(\n styles.borderLeftWidth,\n styles.borderTopWidth,\n -(styles.borderRightWidth + styles.borderLeftWidth),\n -(styles.borderTopWidth + styles.borderBottomWidth)\n );\n};\n\nexport const contentBox = (element: ElementContainer): Bounds => {\n const styles = element.styles;\n const bounds = element.bounds;\n\n const paddingLeft = getAbsoluteValue(styles.paddingLeft, bounds.width);\n const paddingRight = getAbsoluteValue(styles.paddingRight, bounds.width);\n const paddingTop = getAbsoluteValue(styles.paddingTop, bounds.width);\n const paddingBottom = getAbsoluteValue(styles.paddingBottom, bounds.width);\n\n return bounds.add(\n paddingLeft + styles.borderLeftWidth,\n paddingTop + styles.borderTopWidth,\n -(styles.borderRightWidth + styles.borderLeftWidth + paddingLeft + paddingRight),\n -(styles.borderTopWidth + styles.borderBottomWidth + paddingTop + paddingBottom)\n );\n};\n","import { Bounds } from '../css/layout/bounds';\nimport { BACKGROUND_ORIGIN } from '../css/property-descriptors/background-origin';\nimport { ElementContainer } from '../dom/element-container';\nimport { BACKGROUND_SIZE, BackgroundSizeInfo } from '../css/property-descriptors/background-size';\nimport { Vector } from './vector';\nimport { BACKGROUND_REPEAT } from '../css/property-descriptors/background-repeat';\nimport { getAbsoluteValue, getAbsoluteValueForTuple, isLengthPercentage } from '../css/types/length-percentage';\nimport { CSSValue, isIdentToken } from '../css/syntax/parser';\nimport { contentBox, paddingBox } from './box-sizing';\nimport { Path } from './path';\nimport { BACKGROUND_CLIP } from '../css/property-descriptors/background-clip';\n\nexport const calculateBackgroundPositioningArea = (\n backgroundOrigin: BACKGROUND_ORIGIN,\n element: ElementContainer\n): Bounds => {\n if (backgroundOrigin === BACKGROUND_ORIGIN.BORDER_BOX) {\n return element.bounds;\n }\n\n if (backgroundOrigin === BACKGROUND_ORIGIN.CONTENT_BOX) {\n return contentBox(element);\n }\n\n return paddingBox(element);\n};\n\nexport const calculateBackgroundPaintingArea = (backgroundClip: BACKGROUND_CLIP, element: ElementContainer): Bounds => {\n if (backgroundClip === BACKGROUND_CLIP.BORDER_BOX) {\n return element.bounds;\n }\n\n if (backgroundClip === BACKGROUND_CLIP.CONTENT_BOX) {\n return contentBox(element);\n }\n\n return paddingBox(element);\n};\n\nexport const calculateBackgroundRendering = (\n container: ElementContainer,\n index: number,\n intrinsicSize: [number | null, number | null, number | null]\n): [Path[], number, number, number, number] => {\n const backgroundPositioningArea = calculateBackgroundPositioningArea(\n getBackgroundValueForIndex(container.styles.backgroundOrigin, index),\n container\n );\n\n const backgroundPaintingArea = calculateBackgroundPaintingArea(\n getBackgroundValueForIndex(container.styles.backgroundClip, index),\n container\n );\n\n const backgroundImageSize = calculateBackgroundSize(\n getBackgroundValueForIndex(container.styles.backgroundSize, index),\n intrinsicSize,\n backgroundPositioningArea\n );\n\n let [sizeWidth, sizeHeight] = backgroundImageSize;\n\n const position = getAbsoluteValueForTuple(\n getBackgroundValueForIndex(container.styles.backgroundPosition, index),\n backgroundPositioningArea.width - sizeWidth,\n backgroundPositioningArea.height - sizeHeight\n );\n\n const path = calculateBackgroundRepeatPath(\n getBackgroundValueForIndex(container.styles.backgroundRepeat, index),\n position,\n backgroundImageSize,\n backgroundPositioningArea,\n backgroundPaintingArea\n );\n\n const offsetX = Math.round(backgroundPositioningArea.left + position[0]);\n const offsetY = Math.round(backgroundPositioningArea.top + position[1]);\n\n sizeWidth = Math.max(1, sizeWidth);\n sizeHeight = Math.max(1, sizeHeight);\n\n return [path, offsetX, offsetY, sizeWidth, sizeHeight];\n};\n\nexport const isAuto = (token: CSSValue): boolean => isIdentToken(token) && token.value === BACKGROUND_SIZE.AUTO;\n\nconst hasIntrinsicValue = (value: number | null): value is number => typeof value === 'number';\n\nexport const calculateBackgroundSize = (\n size: BackgroundSizeInfo[],\n [intrinsicWidth, intrinsicHeight, intrinsicProportion]: [number | null, number | null, number | null],\n bounds: Bounds\n): [number, number] => {\n const [first, second] = size;\n\n if (!first) {\n return [0, 0];\n }\n\n if (isLengthPercentage(first) && second && isLengthPercentage(second)) {\n return [getAbsoluteValue(first, bounds.width), getAbsoluteValue(second, bounds.height)];\n }\n\n const hasIntrinsicProportion = hasIntrinsicValue(intrinsicProportion);\n\n if (isIdentToken(first) && (first.value === BACKGROUND_SIZE.CONTAIN || first.value === BACKGROUND_SIZE.COVER)) {\n if (hasIntrinsicValue(intrinsicProportion)) {\n const targetRatio = bounds.width / bounds.height;\n\n return targetRatio < intrinsicProportion !== (first.value === BACKGROUND_SIZE.COVER)\n ? [bounds.width, bounds.width / intrinsicProportion]\n : [bounds.height * intrinsicProportion, bounds.height];\n }\n\n return [bounds.width, bounds.height];\n }\n\n const hasIntrinsicWidth = hasIntrinsicValue(intrinsicWidth);\n const hasIntrinsicHeight = hasIntrinsicValue(intrinsicHeight);\n const hasIntrinsicDimensions = hasIntrinsicWidth || hasIntrinsicHeight;\n\n // If the background-size is auto or auto auto:\n if (isAuto(first) && (!second || isAuto(second))) {\n // If the image has both horizontal and vertical intrinsic dimensions, it's rendered at that size.\n if (hasIntrinsicWidth && hasIntrinsicHeight) {\n return [intrinsicWidth as number, intrinsicHeight as number];\n }\n\n // If the image has no intrinsic dimensions and has no intrinsic proportions,\n // it's rendered at the size of the background positioning area.\n\n if (!hasIntrinsicProportion && !hasIntrinsicDimensions) {\n return [bounds.width, bounds.height];\n }\n\n // TODO If the image has no intrinsic dimensions but has intrinsic proportions, it's rendered as if contain had been specified instead.\n\n // If the image has only one intrinsic dimension and has intrinsic proportions, it's rendered at the size corresponding to that one dimension.\n // The other dimension is computed using the specified dimension and the intrinsic proportions.\n if (hasIntrinsicDimensions && hasIntrinsicProportion) {\n const width = hasIntrinsicWidth\n ? (intrinsicWidth as number)\n : (intrinsicHeight as number) * (intrinsicProportion as number);\n const height = hasIntrinsicHeight\n ? (intrinsicHeight as number)\n : (intrinsicWidth as number) / (intrinsicProportion as number);\n return [width, height];\n }\n\n // If the image has only one intrinsic dimension but has no intrinsic proportions,\n // it's rendered using the specified dimension and the other dimension of the background positioning area.\n const width = hasIntrinsicWidth ? (intrinsicWidth as number) : bounds.width;\n const height = hasIntrinsicHeight ? (intrinsicHeight as number) : bounds.height;\n return [width, height];\n }\n\n // If the image has intrinsic proportions, it's stretched to the specified dimension.\n // The unspecified dimension is computed using the specified dimension and the intrinsic proportions.\n if (hasIntrinsicProportion) {\n let width = 0;\n let height = 0;\n if (isLengthPercentage(first)) {\n width = getAbsoluteValue(first, bounds.width);\n } else if (isLengthPercentage(second)) {\n height = getAbsoluteValue(second, bounds.height);\n }\n\n if (isAuto(first)) {\n width = height * (intrinsicProportion as number);\n } else if (!second || isAuto(second)) {\n height = width / (intrinsicProportion as number);\n }\n\n return [width, height];\n }\n\n // If the image has no intrinsic proportions, it's stretched to the specified dimension.\n // The unspecified dimension is computed using the image's corresponding intrinsic dimension,\n // if there is one. If there is no such intrinsic dimension,\n // it becomes the corresponding dimension of the background positioning area.\n\n let width = null;\n let height = null;\n\n if (isLengthPercentage(first)) {\n width = getAbsoluteValue(first, bounds.width);\n } else if (second && isLengthPercentage(second)) {\n height = getAbsoluteValue(second, bounds.height);\n }\n\n if (width !== null && (!second || isAuto(second))) {\n height =\n hasIntrinsicWidth && hasIntrinsicHeight\n ? (width / (intrinsicWidth as number)) * (intrinsicHeight as number)\n : bounds.height;\n }\n\n if (height !== null && isAuto(first)) {\n width =\n hasIntrinsicWidth && hasIntrinsicHeight\n ? (height / (intrinsicHeight as number)) * (intrinsicWidth as number)\n : bounds.width;\n }\n\n if (width !== null && height !== null) {\n return [width, height];\n }\n\n throw new Error(`Unable to calculate background-size for element`);\n};\n\nexport const getBackgroundValueForIndex = <T>(values: T[], index: number): T => {\n const value = values[index];\n if (typeof value === 'undefined') {\n return values[0];\n }\n\n return value;\n};\n\nexport const calculateBackgroundRepeatPath = (\n repeat: BACKGROUND_REPEAT,\n [x, y]: [number, number],\n [width, height]: [number, number],\n backgroundPositioningArea: Bounds,\n backgroundPaintingArea: Bounds\n): [Vector, Vector, Vector, Vector] => {\n switch (repeat) {\n case BACKGROUND_REPEAT.REPEAT_X:\n return [\n new Vector(Math.round(backgroundPositioningArea.left), Math.round(backgroundPositioningArea.top + y)),\n new Vector(\n Math.round(backgroundPositioningArea.left + backgroundPositioningArea.width),\n Math.round(backgroundPositioningArea.top + y)\n ),\n new Vector(\n Math.round(backgroundPositioningArea.left + backgroundPositioningArea.width),\n Math.round(height + backgroundPositioningArea.top + y)\n ),\n new Vector(\n Math.round(backgroundPositioningArea.left),\n Math.round(height + backgroundPositioningArea.top + y)\n )\n ];\n case BACKGROUND_REPEAT.REPEAT_Y:\n return [\n new Vector(Math.round(backgroundPositioningArea.left + x), Math.round(backgroundPositioningArea.top)),\n new Vector(\n Math.round(backgroundPositioningArea.left + x + width),\n Math.round(backgroundPositioningArea.top)\n ),\n new Vector(\n Math.round(backgroundPositioningArea.left + x + width),\n Math.round(backgroundPositioningArea.height + backgroundPositioningArea.top)\n ),\n new Vector(\n Math.round(backgroundPositioningArea.left + x),\n Math.round(backgroundPositioningArea.height + backgroundPositioningArea.top)\n )\n ];\n case BACKGROUND_REPEAT.NO_REPEAT:\n return [\n new Vector(\n Math.round(backgroundPositioningArea.left + x),\n Math.round(backgroundPositioningArea.top + y)\n ),\n new Vector(\n Math.round(backgroundPositioningArea.left + x + width),\n Math.round(backgroundPositioningArea.top + y)\n ),\n new Vector(\n Math.round(backgroundPositioningArea.left + x + width),\n Math.round(backgroundPositioningArea.top + y + height)\n ),\n new Vector(\n Math.round(backgroundPositioningArea.left + x),\n Math.round(backgroundPositioningArea.top + y + height)\n )\n ];\n default:\n return [\n new Vector(Math.round(backgroundPaintingArea.left), Math.round(backgroundPaintingArea.top)),\n new Vector(\n Math.round(backgroundPaintingArea.left + backgroundPaintingArea.width),\n Math.round(backgroundPaintingArea.top)\n ),\n new Vector(\n Math.round(backgroundPaintingArea.left + backgroundPaintingArea.width),\n Math.round(backgroundPaintingArea.height + backgroundPaintingArea.top)\n ),\n new Vector(\n Math.round(backgroundPaintingArea.left),\n Math.round(backgroundPaintingArea.height + backgroundPaintingArea.top)\n )\n ];\n }\n};\n","export const SMALL_IMAGE = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';\n","import { SMALL_IMAGE } from '../core/util';\nexport interface FontMetric {\n baseline: number;\n middle: number;\n}\n\nconst SAMPLE_TEXT = 'Hidden Text';\n\nexport class FontMetrics {\n private readonly _data: { [key: string]: FontMetric };\n private readonly _document: Document;\n\n constructor(document: Document) {\n this._data = {};\n this._document = document;\n }\n\n private parseMetrics(fontFamily: string, fontSize: string): FontMetric {\n const container = this._document.createElement('div');\n const img = this._document.createElement('img');\n const span = this._document.createElement('span');\n\n const body = this._document.body as HTMLBodyElement;\n\n container.style.visibility = 'hidden';\n container.style.fontFamily = fontFamily;\n container.style.fontSize = fontSize;\n container.style.margin = '0';\n container.style.padding = '0';\n container.style.whiteSpace = 'nowrap';\n\n body.appendChild(container);\n\n img.src = SMALL_IMAGE;\n img.width = 1;\n img.height = 1;\n\n img.style.margin = '0';\n img.style.padding = '0';\n img.style.verticalAlign = 'baseline';\n\n span.style.fontFamily = fontFamily;\n span.style.fontSize = fontSize;\n span.style.margin = '0';\n span.style.padding = '0';\n\n span.appendChild(this._document.createTextNode(SAMPLE_TEXT));\n container.appendChild(span);\n container.appendChild(img);\n const baseline = img.offsetTop - span.offsetTop + 2;\n\n container.removeChild(span);\n container.appendChild(this._document.createTextNode(SAMPLE_TEXT));\n\n container.style.lineHeight = 'normal';\n img.style.verticalAlign = 'super';\n\n const middle = img.offsetTop - container.offsetTop + 2;\n\n body.removeChild(container);\n\n return { baseline, middle };\n }\n getMetrics(fontFamily: string, fontSize: string): FontMetric {\n const key = `${fontFamily} ${fontSize}`;\n if (typeof this._data[key] === 'undefined') {\n this._data[key] = this.parseMetrics(fontFamily, fontSize);\n }\n\n return this._data[key];\n }\n}\n","import { Context } from '../core/context';\nimport { RenderConfigurations } from './canvas/canvas-renderer';\n\nexport class Renderer {\n constructor(\n protected readonly context: Context,\n protected readonly options: RenderConfigurations\n ) {}\n}\n","import { ElementPaint, parseStackingContexts, StackingContext } from '../stacking-context';\nimport { Color } from '../../css/types/color';\nimport { asString, isTransparent } from '../../css/types/color-utilities';\nimport { ElementContainer, FLAGS } from '../../dom/element-container';\nimport { BORDER_STYLE } from '../../css/property-descriptors/border-style';\nimport { CSSParsedDeclaration } from '../../css';\nimport { TextContainer } from '../../dom/text-container';\nimport { Path, transformPath } from '../path';\nimport { BACKGROUND_CLIP } from '../../css/property-descriptors/background-clip';\nimport { BoundCurves, calculateBorderBoxPath, calculateContentBoxPath, calculatePaddingBoxPath } from '../bound-curves';\nimport { BezierCurve, isBezierCurve } from '../bezier-curve';\nimport { Vector } from '../vector';\nimport { CSSImageType, CSSURLImage, isLinearGradient, isRadialGradient } from '../../css/types/image';\nimport {\n parsePathForBorder,\n parsePathForBorderDoubleInner,\n parsePathForBorderDoubleOuter,\n parsePathForBorderStroke\n} from '../border';\nimport { calculateBackgroundRendering, getBackgroundValueForIndex } from '../background';\nimport { isDimensionToken } from '../../css/syntax/parser';\nimport { segmentGraphemes, TextBounds } from '../../css/layout/text';\nimport { ImageElementContainer } from '../../dom/replaced-elements/image-element-container';\nimport { contentBox } from '../box-sizing';\nimport { CanvasElementContainer } from '../../dom/replaced-elements/canvas-element-container';\nimport { SVGElementContainer } from '../../dom/replaced-elements/svg-element-container';\nimport { ReplacedElementContainer } from '../../dom/replaced-elements';\nimport { EffectTarget, IElementEffect, isClipEffect, isOpacityEffect, isTransformEffect } from '../effects';\nimport { contains } from '../../core/bitwise';\nimport { calculateGradientDirection, calculateRadius, processColorStops } from '../../css/types/functions/gradient';\nimport { FIFTY_PERCENT, getAbsoluteValue } from '../../css/types/length-percentage';\nimport { TEXT_DECORATION_LINE } from '../../css/property-descriptors/text-decoration-line';\nimport { TEXT_DECORATION_STYLE } from '../../css/property-descriptors/text-decoration-style';\nimport { FontMetrics } from '../font-metrics';\nimport { DISPLAY } from '../../css/property-descriptors/display';\nimport { Bounds } from '../../css/layout/bounds';\nimport { LIST_STYLE_TYPE } from '../../css/property-descriptors/list-style-type';\nimport { computeLineHeight } from '../../css/property-descriptors/line-height';\nimport {\n CHECKBOX,\n INPUT_COLOR,\n PLACEHOLDER_COLOR,\n InputElementContainer,\n RADIO\n} from '../../dom/replaced-elements/input-element-container';\nimport { TEXT_ALIGN } from '../../css/property-descriptors/text-align';\nimport { TextareaElementContainer } from '../../dom/elements/textarea-element-container';\nimport { SelectElementContainer } from '../../dom/elements/select-element-container';\nimport { IFrameElementContainer } from '../../dom/replaced-elements/iframe-element-container';\nimport { TextShadow } from '../../css/property-descriptors/text-shadow';\nimport { PAINT_ORDER_LAYER } from '../../css/property-descriptors/paint-order';\nimport { Renderer } from '../renderer';\nimport { Context } from '../../core/context';\nimport { DIRECTION } from '../../css/property-descriptors/direction';\nimport { OBJECT_FIT } from '../../css/property-descriptors/object-fit';\nimport { TEXT_OVERFLOW } from '../../css/property-descriptors/text-overflow';\nimport { OVERFLOW } from '../../css/property-descriptors/overflow';\n\nexport type RenderConfigurations = RenderOptions & {\n backgroundColor: Color | null;\n};\n\nexport interface RenderOptions {\n scale: number;\n canvas?: HTMLCanvasElement;\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nconst MASK_OFFSET = 10000;\n\nexport class CanvasRenderer extends Renderer {\n canvas: HTMLCanvasElement;\n ctx: CanvasRenderingContext2D;\n private readonly _activeEffects: IElementEffect[] = [];\n private readonly fontMetrics: FontMetrics;\n\n constructor(context: Context, options: RenderConfigurations) {\n super(context, options);\n this.canvas = options.canvas ? options.canvas : document.createElement('canvas');\n this.ctx = this.canvas.getContext('2d') as CanvasRenderingContext2D;\n if (!options.canvas) {\n this.canvas.width = Math.floor(options.width * options.scale);\n this.canvas.height = Math.floor(options.height * options.scale);\n this.canvas.style.width = `${options.width}px`;\n this.canvas.style.height = `${options.height}px`;\n }\n this.fontMetrics = new FontMetrics(document);\n this.ctx.scale(this.options.scale, this.options.scale);\n this.ctx.translate(-options.x, -options.y);\n this.ctx.textBaseline = 'bottom';\n this._activeEffects = [];\n this.context.logger.debug(\n `Canvas renderer initialized (${options.width}x${options.height}) with scale ${options.scale}`\n );\n }\n\n applyEffects(effects: IElementEffect[]): void {\n while (this._activeEffects.length) {\n this.popEffect();\n }\n\n effects.forEach((effect) => this.applyEffect(effect));\n }\n\n applyEffect(effect: IElementEffect): void {\n this.ctx.save();\n if (isOpacityEffect(effect)) {\n this.ctx.globalAlpha = effect.opacity;\n }\n\n if (isTransformEffect(effect)) {\n this.ctx.translate(effect.offsetX, effect.offsetY);\n this.ctx.transform(\n effect.matrix[0],\n effect.matrix[1],\n effect.matrix[2],\n effect.matrix[3],\n effect.matrix[4],\n effect.matrix[5]\n );\n this.ctx.translate(-effect.offsetX, -effect.offsetY);\n }\n\n if (isClipEffect(effect)) {\n this.path(effect.path);\n this.ctx.clip();\n }\n\n this._activeEffects.push(effect);\n }\n\n popEffect(): void {\n this._activeEffects.pop();\n this.ctx.restore();\n }\n\n async renderStack(stack: StackingContext): Promise<void> {\n const styles = stack.element.container.styles;\n if (styles.isVisible()) {\n await this.renderStackContent(stack);\n }\n }\n\n async renderNode(paint: ElementPaint): Promise<void> {\n if (contains(paint.container.flags, FLAGS.DEBUG_RENDER)) {\n debugger;\n }\n\n if (paint.container.styles.isVisible()) {\n await this.renderNodeBackgroundAndBorders(paint);\n await this.renderNodeContent(paint);\n }\n }\n\n renderTextWithLetterSpacing(text: TextBounds, letterSpacing: number, baseline: number): void {\n if (letterSpacing === 0) {\n // Use alphabetic baseline for consistent text positioning across browsers\n // Issue #129: text.bounds.top + text.bounds.height causes text to render too low\n this.ctx.fillText(text.text, text.bounds.left, text.bounds.top + baseline);\n } else {\n const letters = segmentGraphemes(text.text);\n letters.reduce((left, letter) => {\n this.ctx.fillText(letter, left, text.bounds.top + baseline);\n\n return left + this.ctx.measureText(letter).width;\n }, text.bounds.left);\n }\n }\n\n /**\n * Helper method to render text with paint order support\n * Reduces code duplication in line-clamp and normal rendering\n */\n private renderTextBoundWithPaintOrder(\n textBound: TextBounds,\n styles: CSSParsedDeclaration,\n paintOrderLayers: number[]\n ): void {\n paintOrderLayers.forEach((paintOrderLayer: number) => {\n switch (paintOrderLayer) {\n case PAINT_ORDER_LAYER.FILL:\n this.ctx.fillStyle = asString(styles.color);\n this.renderTextWithLetterSpacing(textBound, styles.letterSpacing, styles.fontSize.number);\n break;\n case PAINT_ORDER_LAYER.STROKE:\n if (styles.webkitTextStrokeWidth && textBound.text.trim().length) {\n this.ctx.strokeStyle = asString(styles.webkitTextStrokeColor);\n this.ctx.lineWidth = styles.webkitTextStrokeWidth;\n this.ctx.lineJoin = !!(window as any).chrome ? 'miter' : 'round';\n this.renderTextWithLetterSpacing(textBound, styles.letterSpacing, styles.fontSize.number);\n }\n break;\n }\n });\n }\n\n private renderTextDecoration(bounds: Bounds, styles: CSSParsedDeclaration): void {\n this.ctx.fillStyle = asString(styles.textDecorationColor || styles.color);\n\n // Calculate decoration line thickness\n let thickness = 1; // default\n if (typeof styles.textDecorationThickness === 'number') {\n thickness = styles.textDecorationThickness;\n } else if (styles.textDecorationThickness === 'from-font') {\n // Use a reasonable default based on font size\n thickness = Math.max(1, Math.floor(styles.fontSize.number * 0.05));\n }\n // 'auto' uses default thickness of 1\n\n // Calculate underline offset\n let underlineOffset = 0;\n if (typeof styles.textUnderlineOffset === 'number') {\n // It's a pixel value\n underlineOffset = styles.textUnderlineOffset;\n }\n // 'auto' uses default offset of 0\n\n const decorationStyle = styles.textDecorationStyle;\n\n styles.textDecorationLine.forEach((textDecorationLine) => {\n let y = 0;\n\n switch (textDecorationLine) {\n case TEXT_DECORATION_LINE.UNDERLINE:\n y = bounds.top + bounds.height - thickness + underlineOffset;\n break;\n case TEXT_DECORATION_LINE.OVERLINE:\n y = bounds.top;\n break;\n case TEXT_DECORATION_LINE.LINE_THROUGH:\n y = bounds.top + (bounds.height / 2 - thickness / 2);\n break;\n default:\n return;\n }\n\n this.drawDecorationLine(bounds.left, y, bounds.width, thickness, decorationStyle);\n });\n }\n\n private drawDecorationLine(x: number, y: number, width: number, thickness: number, style: number): void {\n switch (style) {\n case TEXT_DECORATION_STYLE.SOLID:\n // Solid line (default)\n this.ctx.fillRect(x, y, width, thickness);\n break;\n\n case TEXT_DECORATION_STYLE.DOUBLE:\n // Double line\n const gap = Math.max(1, thickness);\n this.ctx.fillRect(x, y, width, thickness);\n this.ctx.fillRect(x, y + thickness + gap, width, thickness);\n break;\n\n case TEXT_DECORATION_STYLE.DOTTED:\n // Dotted line\n this.ctx.save();\n this.ctx.beginPath();\n this.ctx.setLineDash([thickness, thickness * 2]);\n this.ctx.lineWidth = thickness;\n this.ctx.strokeStyle = this.ctx.fillStyle;\n this.ctx.moveTo(x, y + thickness / 2);\n this.ctx.lineTo(x + width, y + thickness / 2);\n this.ctx.stroke();\n this.ctx.restore();\n break;\n\n case TEXT_DECORATION_STYLE.DASHED:\n // Dashed line\n this.ctx.save();\n this.ctx.beginPath();\n this.ctx.setLineDash([thickness * 3, thickness * 2]);\n this.ctx.lineWidth = thickness;\n this.ctx.strokeStyle = this.ctx.fillStyle;\n this.ctx.moveTo(x, y + thickness / 2);\n this.ctx.lineTo(x + width, y + thickness / 2);\n this.ctx.stroke();\n this.ctx.restore();\n break;\n\n case TEXT_DECORATION_STYLE.WAVY:\n // Wavy line (approximation using quadratic curves)\n this.ctx.save();\n this.ctx.beginPath();\n this.ctx.lineWidth = thickness;\n this.ctx.strokeStyle = this.ctx.fillStyle;\n\n const amplitude = thickness * 2;\n const wavelength = thickness * 4;\n let currentX = x;\n\n this.ctx.moveTo(currentX, y + thickness / 2);\n\n while (currentX < x + width) {\n const nextX = Math.min(currentX + wavelength / 2, x + width);\n this.ctx.quadraticCurveTo(\n currentX + wavelength / 4,\n y + thickness / 2 - amplitude,\n nextX,\n y + thickness / 2\n );\n currentX = nextX;\n\n if (currentX < x + width) {\n const nextX2 = Math.min(currentX + wavelength / 2, x + width);\n this.ctx.quadraticCurveTo(\n currentX + wavelength / 4,\n y + thickness / 2 + amplitude,\n nextX2,\n y + thickness / 2\n );\n currentX = nextX2;\n }\n }\n\n this.ctx.stroke();\n this.ctx.restore();\n break;\n\n default:\n // Fallback to solid\n this.ctx.fillRect(x, y, width, thickness);\n }\n }\n\n // Helper method to truncate text and add ellipsis if needed\n private truncateTextWithEllipsis(text: string, maxWidth: number, letterSpacing: number): string {\n const ellipsis = '...';\n const ellipsisWidth = this.ctx.measureText(ellipsis).width;\n\n if (letterSpacing === 0) {\n let truncated = text;\n while (this.ctx.measureText(truncated).width + ellipsisWidth > maxWidth && truncated.length > 0) {\n truncated = truncated.slice(0, -1);\n }\n return truncated + ellipsis;\n } else {\n const letters = segmentGraphemes(text);\n let width = ellipsisWidth;\n let result: string[] = [];\n\n for (const letter of letters) {\n const letterWidth = this.ctx.measureText(letter).width + letterSpacing;\n if (width + letterWidth > maxWidth) {\n break;\n }\n result.push(letter);\n width += letterWidth;\n }\n\n return result.join('') + ellipsis;\n }\n }\n\n private createFontStyle(styles: CSSParsedDeclaration): string[] {\n const fontVariant = styles.fontVariant\n .filter((variant) => variant === 'normal' || variant === 'small-caps')\n .join('');\n const fontFamily = fixIOSSystemFonts(styles.fontFamily).join(', ');\n const fontSize = isDimensionToken(styles.fontSize)\n ? `${styles.fontSize.number}${styles.fontSize.unit}`\n : `${styles.fontSize.number}px`;\n\n return [\n [styles.fontStyle, fontVariant, styles.fontWeight, fontSize, fontFamily].join(' '),\n fontFamily,\n fontSize\n ];\n }\n\n async renderTextNode(text: TextContainer, styles: CSSParsedDeclaration, containerBounds?: Bounds): Promise<void> {\n const [font] = this.createFontStyle(styles);\n\n this.ctx.font = font;\n\n this.ctx.direction = styles.direction === DIRECTION.RTL ? 'rtl' : 'ltr';\n this.ctx.textAlign = 'left';\n this.ctx.textBaseline = 'alphabetic';\n const paintOrder = styles.paintOrder;\n\n // Calculate line height for text layout detection (used by both line-clamp and ellipsis)\n const lineHeight = styles.fontSize.number * 1.5;\n\n // Check if we need to apply -webkit-line-clamp\n // This limits text to a specific number of lines with ellipsis\n const shouldApplyLineClamp =\n styles.webkitLineClamp > 0 &&\n (styles.display & DISPLAY.BLOCK) !== 0 &&\n styles.overflowY === OVERFLOW.HIDDEN &&\n text.textBounds.length > 0;\n\n if (shouldApplyLineClamp) {\n // Group text bounds by lines based on their Y position\n const lines: TextBounds[][] = [];\n let currentLine: TextBounds[] = [];\n let currentLineTop = text.textBounds[0].bounds.top;\n\n text.textBounds.forEach((tb) => {\n // If this text bound is on a different line, start a new line\n if (Math.abs(tb.bounds.top - currentLineTop) >= lineHeight * 0.5) {\n if (currentLine.length > 0) {\n lines.push(currentLine);\n }\n currentLine = [tb];\n currentLineTop = tb.bounds.top;\n } else {\n currentLine.push(tb);\n }\n });\n\n // Don't forget the last line\n if (currentLine.length > 0) {\n lines.push(currentLine);\n }\n\n // Only render up to webkitLineClamp lines\n const maxLines = styles.webkitLineClamp;\n if (lines.length > maxLines) {\n // Render only the first (maxLines - 1) complete lines\n for (let i = 0; i < maxLines - 1; i++) {\n lines[i].forEach((textBound) => {\n this.renderTextBoundWithPaintOrder(textBound, styles, paintOrder);\n });\n }\n\n // For the last line, truncate with ellipsis\n const lastLine = lines[maxLines - 1];\n if (lastLine && lastLine.length > 0 && containerBounds) {\n const lastLineText = lastLine.map((tb) => tb.text).join('');\n const firstBound = lastLine[0];\n const availableWidth = containerBounds.width - (firstBound.bounds.left - containerBounds.left);\n const truncatedText = this.truncateTextWithEllipsis(\n lastLineText,\n availableWidth,\n styles.letterSpacing\n );\n\n paintOrder.forEach((paintOrderLayer) => {\n switch (paintOrderLayer) {\n case PAINT_ORDER_LAYER.FILL:\n this.ctx.fillStyle = asString(styles.color);\n if (styles.letterSpacing === 0) {\n this.ctx.fillText(\n truncatedText,\n firstBound.bounds.left,\n firstBound.bounds.top + styles.fontSize.number\n );\n } else {\n const letters = segmentGraphemes(truncatedText);\n letters.reduce((left, letter) => {\n this.ctx.fillText(letter, left, firstBound.bounds.top + styles.fontSize.number);\n return left + this.ctx.measureText(letter).width + styles.letterSpacing;\n }, firstBound.bounds.left);\n }\n break;\n case PAINT_ORDER_LAYER.STROKE:\n if (styles.webkitTextStrokeWidth && truncatedText.trim().length) {\n this.ctx.strokeStyle = asString(styles.webkitTextStrokeColor);\n this.ctx.lineWidth = styles.webkitTextStrokeWidth;\n this.ctx.lineJoin = !!(window as any).chrome ? 'miter' : 'round';\n if (styles.letterSpacing === 0) {\n this.ctx.strokeText(\n truncatedText,\n firstBound.bounds.left,\n firstBound.bounds.top + styles.fontSize.number\n );\n } else {\n const letters = segmentGraphemes(truncatedText);\n letters.reduce((left, letter) => {\n this.ctx.strokeText(\n letter,\n left,\n firstBound.bounds.top + styles.fontSize.number\n );\n return left + this.ctx.measureText(letter).width + styles.letterSpacing;\n }, firstBound.bounds.left);\n }\n }\n break;\n }\n });\n }\n return; // Don't render anything else\n }\n // If lines.length <= maxLines, fall through to normal rendering\n }\n\n // Check if we need to apply text-overflow: ellipsis\n // Issue #203: Only apply ellipsis for single-line text overflow\n // Multi-line text truncation (like -webkit-line-clamp) should not be affected\n const shouldApplyEllipsis =\n styles.textOverflow === TEXT_OVERFLOW.ELLIPSIS &&\n containerBounds &&\n styles.overflowX === OVERFLOW.HIDDEN &&\n text.textBounds.length > 0;\n\n // Calculate total text width if ellipsis might be needed\n let needsEllipsis = false;\n let truncatedText = '';\n if (shouldApplyEllipsis) {\n // Check if all text bounds are on approximately the same line (single-line scenario)\n // For multi-line text (like -webkit-line-clamp), textBounds will have different Y positions\n const firstTop = text.textBounds[0].bounds.top;\n const isSingleLine = text.textBounds.every((tb) => Math.abs(tb.bounds.top - firstTop) < lineHeight * 0.5);\n\n if (isSingleLine) {\n // Measure the full text content\n // Note: text.textBounds may contain whitespace characters from HTML formatting\n // We need to collapse them like the browser does for white-space: nowrap\n let fullText = text.textBounds.map((tb) => tb.text).join('');\n\n // Collapse whitespace: replace sequences of whitespace (including newlines) with single spaces\n // and trim leading/trailing whitespace\n fullText = fullText.replace(/\\s+/g, ' ').trim();\n\n const fullTextWidth = this.ctx.measureText(fullText).width;\n const availableWidth = containerBounds.width;\n\n if (fullTextWidth > availableWidth) {\n needsEllipsis = true;\n truncatedText = this.truncateTextWithEllipsis(fullText, availableWidth, styles.letterSpacing);\n }\n }\n }\n\n // If ellipsis is needed, render the truncated text once\n if (needsEllipsis) {\n const firstBound = text.textBounds[0];\n paintOrder.forEach((paintOrderLayer) => {\n switch (paintOrderLayer) {\n case PAINT_ORDER_LAYER.FILL:\n this.ctx.fillStyle = asString(styles.color);\n\n if (styles.letterSpacing === 0) {\n this.ctx.fillText(\n truncatedText,\n firstBound.bounds.left,\n firstBound.bounds.top + styles.fontSize.number\n );\n } else {\n const letters = segmentGraphemes(truncatedText);\n letters.reduce((left, letter) => {\n this.ctx.fillText(letter, left, firstBound.bounds.top + styles.fontSize.number);\n return left + this.ctx.measureText(letter).width + styles.letterSpacing;\n }, firstBound.bounds.left);\n }\n\n const textShadows: TextShadow = styles.textShadow;\n if (textShadows.length && truncatedText.trim().length) {\n textShadows\n .slice(0)\n .reverse()\n .forEach((textShadow) => {\n this.ctx.shadowColor = asString(textShadow.color);\n this.ctx.shadowOffsetX = textShadow.offsetX.number * this.options.scale;\n this.ctx.shadowOffsetY = textShadow.offsetY.number * this.options.scale;\n this.ctx.shadowBlur = textShadow.blur.number;\n\n if (styles.letterSpacing === 0) {\n this.ctx.fillText(\n truncatedText,\n firstBound.bounds.left,\n firstBound.bounds.top + styles.fontSize.number\n );\n } else {\n const letters = segmentGraphemes(truncatedText);\n letters.reduce((left, letter) => {\n this.ctx.fillText(\n letter,\n left,\n firstBound.bounds.top + styles.fontSize.number\n );\n return left + this.ctx.measureText(letter).width + styles.letterSpacing;\n }, firstBound.bounds.left);\n }\n });\n\n this.ctx.shadowColor = '';\n this.ctx.shadowOffsetX = 0;\n this.ctx.shadowOffsetY = 0;\n this.ctx.shadowBlur = 0;\n }\n break;\n case PAINT_ORDER_LAYER.STROKE:\n if (styles.webkitTextStrokeWidth && truncatedText.trim().length) {\n this.ctx.strokeStyle = asString(styles.webkitTextStrokeColor);\n this.ctx.lineWidth = styles.webkitTextStrokeWidth;\n this.ctx.lineJoin = !!(window as any).chrome ? 'miter' : 'round';\n\n if (styles.letterSpacing === 0) {\n this.ctx.strokeText(\n truncatedText,\n firstBound.bounds.left,\n firstBound.bounds.top + styles.fontSize.number\n );\n } else {\n const letters = segmentGraphemes(truncatedText);\n letters.reduce((left, letter) => {\n this.ctx.strokeText(letter, left, firstBound.bounds.top + styles.fontSize.number);\n return left + this.ctx.measureText(letter).width + styles.letterSpacing;\n }, firstBound.bounds.left);\n }\n }\n break;\n }\n });\n return;\n }\n\n // Normal rendering (no ellipsis needed)\n text.textBounds.forEach((text) => {\n paintOrder.forEach((paintOrderLayer) => {\n switch (paintOrderLayer) {\n case PAINT_ORDER_LAYER.FILL:\n this.ctx.fillStyle = asString(styles.color);\n this.renderTextWithLetterSpacing(text, styles.letterSpacing, styles.fontSize.number);\n const textShadows: TextShadow = styles.textShadow;\n\n if (textShadows.length && text.text.trim().length) {\n textShadows\n .slice(0)\n .reverse()\n .forEach((textShadow) => {\n this.ctx.shadowColor = asString(textShadow.color);\n this.ctx.shadowOffsetX = textShadow.offsetX.number * this.options.scale;\n this.ctx.shadowOffsetY = textShadow.offsetY.number * this.options.scale;\n this.ctx.shadowBlur = textShadow.blur.number;\n\n this.renderTextWithLetterSpacing(\n text,\n styles.letterSpacing,\n styles.fontSize.number\n );\n });\n\n this.ctx.shadowColor = '';\n this.ctx.shadowOffsetX = 0;\n this.ctx.shadowOffsetY = 0;\n this.ctx.shadowBlur = 0;\n }\n\n if (styles.textDecorationLine.length) {\n this.renderTextDecoration(text.bounds, styles);\n }\n break;\n case PAINT_ORDER_LAYER.STROKE:\n if (styles.webkitTextStrokeWidth && text.text.trim().length) {\n this.ctx.strokeStyle = asString(styles.webkitTextStrokeColor);\n this.ctx.lineWidth = styles.webkitTextStrokeWidth;\n\n this.ctx.lineJoin = !!(window as any).chrome ? 'miter' : 'round';\n // Issue #110: Use baseline (fontSize) for consistent positioning with fill\n // Previously used text.bounds.height which caused stroke to render too low\n const baseline = styles.fontSize.number;\n if (styles.letterSpacing === 0) {\n this.ctx.strokeText(text.text, text.bounds.left, text.bounds.top + baseline);\n } else {\n const letters = segmentGraphemes(text.text);\n letters.reduce((left, letter) => {\n this.ctx.strokeText(letter, left, text.bounds.top + baseline);\n return left + this.ctx.measureText(letter).width;\n }, text.bounds.left);\n }\n }\n this.ctx.strokeStyle = '';\n this.ctx.lineWidth = 0;\n this.ctx.lineJoin = 'miter';\n break;\n }\n });\n });\n }\n\n renderReplacedElement(\n container: ReplacedElementContainer,\n curves: BoundCurves,\n image: HTMLImageElement | HTMLCanvasElement\n ): void {\n const intrinsicWidth = (image as HTMLImageElement).naturalWidth || container.intrinsicWidth;\n const intrinsicHeight = (image as HTMLImageElement).naturalHeight || container.intrinsicHeight;\n if (image && intrinsicWidth > 0 && intrinsicHeight > 0) {\n const box = contentBox(container);\n const path = calculatePaddingBoxPath(curves);\n this.path(path);\n this.ctx.save();\n this.ctx.clip();\n let sx = 0,\n sy = 0,\n sw: number = intrinsicWidth,\n sh: number = intrinsicHeight,\n dx: number = box.left,\n dy: number = box.top,\n dw: number = box.width,\n dh: number = box.height;\n const { objectFit } = container.styles;\n const boxRatio = dw / dh;\n const imgRatio = sw / sh;\n if (objectFit === OBJECT_FIT.CONTAIN) {\n if (imgRatio > boxRatio) {\n dh = dw / imgRatio;\n dy += (box.height - dh) / 2;\n } else {\n dw = dh * imgRatio;\n dx += (box.width - dw) / 2;\n }\n } else if (objectFit === OBJECT_FIT.COVER) {\n if (imgRatio > boxRatio) {\n sw = sh * boxRatio;\n sx += (intrinsicWidth - sw) / 2;\n } else {\n sh = sw / boxRatio;\n sy += (intrinsicHeight - sh) / 2;\n }\n } else if (objectFit === OBJECT_FIT.NONE) {\n if (sw > dw) {\n sx += (sw - dw) / 2;\n sw = dw;\n } else {\n dx += (dw - sw) / 2;\n dw = sw;\n }\n if (sh > dh) {\n sy += (sh - dh) / 2;\n sh = dh;\n } else {\n dy += (dh - sh) / 2;\n dh = sh;\n }\n } else if (objectFit === OBJECT_FIT.SCALE_DOWN) {\n const containW = imgRatio > boxRatio ? dw : dh * imgRatio;\n const noneW = sw > dw ? sw : dw;\n if (containW < noneW) {\n if (imgRatio > boxRatio) {\n dh = dw / imgRatio;\n dy += (box.height - dh) / 2;\n } else {\n dw = dh * imgRatio;\n dx += (box.width - dw) / 2;\n }\n } else {\n if (sw > dw) {\n sx += (sw - dw) / 2;\n sw = dw;\n } else {\n dx += (dw - sw) / 2;\n dw = sw;\n }\n if (sh > dh) {\n sy += (sh - dh) / 2;\n sh = dh;\n } else {\n dy += (dh - sh) / 2;\n dh = sh;\n }\n }\n }\n this.ctx.drawImage(image, sx, sy, sw, sh, dx, dy, dw, dh);\n this.ctx.restore();\n }\n }\n\n async renderNodeContent(paint: ElementPaint): Promise<void> {\n this.applyEffects(paint.getEffects(EffectTarget.CONTENT));\n const container = paint.container;\n const curves = paint.curves;\n const styles = container.styles;\n // Use content box for text overflow calculation (excludes padding and border)\n // This matches browser behavior where text-overflow uses the content width\n const textBounds = contentBox(container);\n for (const child of container.textNodes) {\n await this.renderTextNode(child, styles, textBounds);\n }\n\n if (container instanceof ImageElementContainer) {\n try {\n const image = await this.context.cache.match(container.src);\n this.renderReplacedElement(container, curves, image);\n } catch (e) {\n this.context.logger.error(`Error loading image ${container.src}`);\n }\n }\n\n if (container instanceof CanvasElementContainer) {\n this.renderReplacedElement(container, curves, container.canvas);\n }\n\n if (container instanceof SVGElementContainer) {\n try {\n const image = await this.context.cache.match(container.svg);\n this.renderReplacedElement(container, curves, image);\n } catch (e) {\n this.context.logger.error(`Error loading svg ${container.svg.substring(0, 255)}`);\n }\n }\n\n if (container instanceof IFrameElementContainer && container.tree) {\n const iframeRenderer = new CanvasRenderer(this.context, {\n scale: this.options.scale,\n backgroundColor: container.backgroundColor,\n x: 0,\n y: 0,\n width: container.width,\n height: container.height\n });\n\n const canvas = await iframeRenderer.render(container.tree);\n if (container.width && container.height) {\n this.ctx.drawImage(\n canvas,\n 0,\n 0,\n container.width,\n container.height,\n container.bounds.left,\n container.bounds.top,\n container.bounds.width,\n container.bounds.height\n );\n }\n }\n\n if (container instanceof InputElementContainer) {\n const size = Math.min(container.bounds.width, container.bounds.height);\n\n if (container.type === CHECKBOX) {\n if (container.checked) {\n this.ctx.save();\n this.path([\n new Vector(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79),\n new Vector(container.bounds.left + size * 0.16, container.bounds.top + size * 0.5549),\n new Vector(container.bounds.left + size * 0.27347, container.bounds.top + size * 0.44071),\n new Vector(container.bounds.left + size * 0.39694, container.bounds.top + size * 0.5649),\n new Vector(container.bounds.left + size * 0.72983, container.bounds.top + size * 0.23),\n new Vector(container.bounds.left + size * 0.84, container.bounds.top + size * 0.34085),\n new Vector(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79)\n ]);\n\n this.ctx.fillStyle = asString(INPUT_COLOR);\n this.ctx.fill();\n this.ctx.restore();\n }\n } else if (container.type === RADIO) {\n if (container.checked) {\n this.ctx.save();\n this.ctx.beginPath();\n this.ctx.arc(\n container.bounds.left + size / 2,\n container.bounds.top + size / 2,\n size / 4,\n 0,\n Math.PI * 2,\n true\n );\n this.ctx.fillStyle = asString(INPUT_COLOR);\n this.ctx.fill();\n this.ctx.restore();\n }\n }\n }\n\n if (isTextInputElement(container) && container.value.length) {\n const [font, fontFamily, fontSize] = this.createFontStyle(styles);\n const { baseline } = this.fontMetrics.getMetrics(fontFamily, fontSize);\n\n this.ctx.font = font;\n\n // Fix for Issue #92: Use placeholder color when rendering placeholder text\n const isPlaceholder = container instanceof InputElementContainer && container.isPlaceholder;\n this.ctx.fillStyle = isPlaceholder ? asString(PLACEHOLDER_COLOR) : asString(styles.color);\n\n this.ctx.textBaseline = 'alphabetic';\n this.ctx.textAlign = canvasTextAlign(container.styles.textAlign);\n\n const bounds = contentBox(container);\n\n let x = 0;\n\n switch (container.styles.textAlign) {\n case TEXT_ALIGN.CENTER:\n x += bounds.width / 2;\n break;\n case TEXT_ALIGN.RIGHT:\n x += bounds.width;\n break;\n }\n\n // Fix for Issue #92: Position text vertically centered in single-line input\n // Only apply vertical centering for InputElementContainer, not for textarea or select\n let verticalOffset = 0;\n if (container instanceof InputElementContainer) {\n const fontSizeValue = getAbsoluteValue(styles.fontSize, 0);\n verticalOffset = (bounds.height - fontSizeValue) / 2;\n }\n\n // Create text bounds with horizontal and vertical offsets\n // Height is not modified as it doesn't affect text rendering position\n const textBounds = bounds.add(x, verticalOffset, 0, 0);\n\n this.ctx.save();\n this.path([\n new Vector(bounds.left, bounds.top),\n new Vector(bounds.left + bounds.width, bounds.top),\n new Vector(bounds.left + bounds.width, bounds.top + bounds.height),\n new Vector(bounds.left, bounds.top + bounds.height)\n ]);\n\n this.ctx.clip();\n\n this.renderTextWithLetterSpacing(\n new TextBounds(container.value, textBounds),\n styles.letterSpacing,\n baseline\n );\n this.ctx.restore();\n this.ctx.textBaseline = 'alphabetic';\n this.ctx.textAlign = 'left';\n }\n\n if (contains(container.styles.display, DISPLAY.LIST_ITEM)) {\n if (container.styles.listStyleImage !== null) {\n const img = container.styles.listStyleImage;\n if (img.type === CSSImageType.URL) {\n let image;\n const url = (img as CSSURLImage).url;\n try {\n image = await this.context.cache.match(url);\n this.ctx.drawImage(image, container.bounds.left - (image.width + 10), container.bounds.top);\n } catch (e) {\n this.context.logger.error(`Error loading list-style-image ${url}`);\n }\n }\n } else if (paint.listValue && container.styles.listStyleType !== LIST_STYLE_TYPE.NONE) {\n const [font] = this.createFontStyle(styles);\n\n this.ctx.font = font;\n this.ctx.fillStyle = asString(styles.color);\n\n this.ctx.textBaseline = 'middle';\n this.ctx.textAlign = 'right';\n const bounds = new Bounds(\n container.bounds.left,\n container.bounds.top + getAbsoluteValue(container.styles.paddingTop, container.bounds.width),\n container.bounds.width,\n computeLineHeight(styles.lineHeight, styles.fontSize.number) / 2 + 1\n );\n\n this.renderTextWithLetterSpacing(\n new TextBounds(paint.listValue, bounds),\n styles.letterSpacing,\n computeLineHeight(styles.lineHeight, styles.fontSize.number) / 2 + 2\n );\n this.ctx.textBaseline = 'bottom';\n this.ctx.textAlign = 'left';\n }\n }\n }\n\n async renderStackContent(stack: StackingContext): Promise<void> {\n if (contains(stack.element.container.flags, FLAGS.DEBUG_RENDER)) {\n debugger;\n }\n // https://www.w3.org/TR/css-position-3/#painting-order\n // 1. the background and borders of the element forming the stacking context.\n await this.renderNodeBackgroundAndBorders(stack.element);\n // 2. the child stacking contexts with negative stack levels (most negative first).\n for (const child of stack.negativeZIndex) {\n await this.renderStack(child);\n }\n // 3. For all its in-flow, non-positioned, block-level descendants in tree order:\n await this.renderNodeContent(stack.element);\n\n for (const child of stack.nonInlineLevel) {\n await this.renderNode(child);\n }\n // 4. All non-positioned floating descendants, in tree order. For each one of these,\n // treat the element as if it created a new stacking context, but any positioned descendants and descendants\n // which actually create a new stacking context should be considered part of the parent stacking context,\n // not this new one.\n for (const child of stack.nonPositionedFloats) {\n await this.renderStack(child);\n }\n // 5. the in-flow, inline-level, non-positioned descendants, including inline tables and inline blocks.\n for (const child of stack.nonPositionedInlineLevel) {\n await this.renderStack(child);\n }\n for (const child of stack.inlineLevel) {\n await this.renderNode(child);\n }\n // 6. All positioned, opacity or transform descendants, in tree order that fall into the following categories:\n // All positioned descendants with 'z-index: auto' or 'z-index: 0', in tree order.\n // For those with 'z-index: auto', treat the element as if it created a new stacking context,\n // but any positioned descendants and descendants which actually create a new stacking context should be\n // considered part of the parent stacking context, not this new one. For those with 'z-index: 0',\n // treat the stacking context generated atomically.\n //\n // All opacity descendants with opacity less than 1\n //\n // All transform descendants with transform other than none\n for (const child of stack.zeroOrAutoZIndexOrTransformedOrOpacity) {\n await this.renderStack(child);\n }\n // 7. Stacking contexts formed by positioned descendants with z-indices greater than or equal to 1 in z-index\n // order (smallest first) then tree order.\n for (const child of stack.positiveZIndex) {\n await this.renderStack(child);\n }\n }\n\n mask(paths: Path[]): void {\n this.ctx.beginPath();\n this.ctx.moveTo(0, 0);\n // Use logical dimensions (options.width/height) instead of canvas pixel dimensions\n // because context has already been scaled by this.options.scale\n // Fix for Issue #126: Using canvas pixel dimensions causes broken output\n this.ctx.lineTo(this.options.width, 0);\n this.ctx.lineTo(this.options.width, this.options.height);\n this.ctx.lineTo(0, this.options.height);\n this.ctx.lineTo(0, 0);\n this.formatPath(paths.slice(0).reverse());\n this.ctx.closePath();\n }\n\n path(paths: Path[]): void {\n this.ctx.beginPath();\n this.formatPath(paths);\n this.ctx.closePath();\n }\n\n formatPath(paths: Path[]): void {\n paths.forEach((point, index) => {\n const start: Vector = isBezierCurve(point) ? point.start : point;\n if (index === 0) {\n this.ctx.moveTo(start.x, start.y);\n } else {\n this.ctx.lineTo(start.x, start.y);\n }\n\n if (isBezierCurve(point)) {\n this.ctx.bezierCurveTo(\n point.startControl.x,\n point.startControl.y,\n point.endControl.x,\n point.endControl.y,\n point.end.x,\n point.end.y\n );\n }\n });\n }\n\n renderRepeat(path: Path[], pattern: CanvasPattern | CanvasGradient, offsetX: number, offsetY: number): void {\n this.path(path);\n this.ctx.fillStyle = pattern;\n this.ctx.translate(offsetX, offsetY);\n this.ctx.fill();\n this.ctx.translate(-offsetX, -offsetY);\n }\n\n resizeImage(image: HTMLImageElement, width: number, height: number): HTMLCanvasElement | HTMLImageElement {\n // https://github.com/niklasvh/html2canvas/pull/2911\n // if (image.width === width && image.height === height) {\n // return image;\n // }\n\n const ownerDocument = this.canvas.ownerDocument ?? document;\n const canvas = ownerDocument.createElement('canvas');\n canvas.width = Math.max(1, width);\n canvas.height = Math.max(1, height);\n const ctx = canvas.getContext('2d') as CanvasRenderingContext2D;\n ctx.drawImage(image, 0, 0, image.width, image.height, 0, 0, width, height);\n return canvas;\n }\n\n async renderBackgroundImage(container: ElementContainer): Promise<void> {\n let index = container.styles.backgroundImage.length - 1;\n for (const backgroundImage of container.styles.backgroundImage.slice(0).reverse()) {\n if (backgroundImage.type === CSSImageType.URL) {\n let image;\n const url = (backgroundImage as CSSURLImage).url;\n try {\n image = await this.context.cache.match(url);\n } catch (e) {\n this.context.logger.error(`Error loading background-image ${url}`);\n }\n\n if (image) {\n const imageWidth = isNaN(image.width) || image.width === 0 ? 1 : image.width;\n const imageHeight = isNaN(image.height) || image.height === 0 ? 1 : image.height;\n const [path, x, y, width, height] = calculateBackgroundRendering(container, index, [\n imageWidth,\n imageHeight,\n imageWidth / imageHeight\n ]);\n const pattern = this.ctx.createPattern(\n this.resizeImage(image, width, height),\n 'repeat'\n ) as CanvasPattern;\n this.renderRepeat(path, pattern, x, y);\n }\n } else if (isLinearGradient(backgroundImage)) {\n const [path, x, y, width, height] = calculateBackgroundRendering(container, index, [null, null, null]);\n const [lineLength, x0, x1, y0, y1] = calculateGradientDirection(backgroundImage.angle, width, height);\n\n const canvas = document.createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n const ctx = canvas.getContext('2d') as CanvasRenderingContext2D;\n const gradient = ctx.createLinearGradient(x0, y0, x1, y1);\n\n processColorStops(backgroundImage.stops, lineLength || 1).forEach((colorStop) =>\n gradient.addColorStop(colorStop.stop, asString(colorStop.color))\n );\n\n ctx.fillStyle = gradient;\n ctx.fillRect(0, 0, width, height);\n if (width > 0 && height > 0) {\n const pattern = this.ctx.createPattern(canvas, 'repeat') as CanvasPattern;\n this.renderRepeat(path, pattern, x, y);\n }\n } else if (isRadialGradient(backgroundImage)) {\n const [path, left, top, width, height] = calculateBackgroundRendering(container, index, [\n null,\n null,\n null\n ]);\n const position = backgroundImage.position.length === 0 ? [FIFTY_PERCENT] : backgroundImage.position;\n const x = getAbsoluteValue(position[0], width);\n const y = getAbsoluteValue(position[position.length - 1], height);\n\n let [rx, ry] = calculateRadius(backgroundImage, x, y, width, height);\n // Handle edge case where radial gradient size is 0\n // Use a minimum value of 0.01 to ensure gradient is still rendered\n if (rx === 0 || ry === 0) {\n rx = Math.max(rx, 0.01);\n ry = Math.max(ry, 0.01);\n }\n if (rx > 0 && ry > 0) {\n const radialGradient = this.ctx.createRadialGradient(left + x, top + y, 0, left + x, top + y, rx);\n\n processColorStops(backgroundImage.stops, rx * 2).forEach((colorStop) =>\n radialGradient.addColorStop(colorStop.stop, asString(colorStop.color))\n );\n\n this.path(path);\n this.ctx.fillStyle = radialGradient;\n if (rx !== ry) {\n // transforms for elliptical radial gradient\n const midX = container.bounds.left + 0.5 * container.bounds.width;\n const midY = container.bounds.top + 0.5 * container.bounds.height;\n const f = ry / rx;\n const invF = 1 / f;\n\n this.ctx.save();\n this.ctx.translate(midX, midY);\n this.ctx.transform(1, 0, 0, f, 0, 0);\n this.ctx.translate(-midX, -midY);\n\n this.ctx.fillRect(left, invF * (top - midY) + midY, width, height * invF);\n this.ctx.restore();\n } else {\n this.ctx.fill();\n }\n }\n }\n index--;\n }\n }\n\n async renderSolidBorder(color: Color, side: number, curvePoints: BoundCurves): Promise<void> {\n this.path(parsePathForBorder(curvePoints, side));\n this.ctx.fillStyle = asString(color);\n this.ctx.fill();\n }\n\n async renderDoubleBorder(color: Color, width: number, side: number, curvePoints: BoundCurves): Promise<void> {\n if (width < 3) {\n await this.renderSolidBorder(color, side, curvePoints);\n return;\n }\n\n const outerPaths = parsePathForBorderDoubleOuter(curvePoints, side);\n this.path(outerPaths);\n this.ctx.fillStyle = asString(color);\n this.ctx.fill();\n const innerPaths = parsePathForBorderDoubleInner(curvePoints, side);\n this.path(innerPaths);\n this.ctx.fill();\n }\n\n async renderNodeBackgroundAndBorders(paint: ElementPaint): Promise<void> {\n this.applyEffects(paint.getEffects(EffectTarget.BACKGROUND_BORDERS));\n const styles = paint.container.styles;\n const hasBackground = !isTransparent(styles.backgroundColor) || styles.backgroundImage.length;\n\n const borders = [\n { style: styles.borderTopStyle, color: styles.borderTopColor, width: styles.borderTopWidth },\n { style: styles.borderRightStyle, color: styles.borderRightColor, width: styles.borderRightWidth },\n { style: styles.borderBottomStyle, color: styles.borderBottomColor, width: styles.borderBottomWidth },\n { style: styles.borderLeftStyle, color: styles.borderLeftColor, width: styles.borderLeftWidth }\n ];\n\n const backgroundPaintingArea = calculateBackgroundCurvedPaintingArea(\n getBackgroundValueForIndex(styles.backgroundClip, 0),\n paint.curves\n );\n\n if (hasBackground || styles.boxShadow.length) {\n this.ctx.save();\n this.path(backgroundPaintingArea);\n this.ctx.clip();\n\n if (!isTransparent(styles.backgroundColor)) {\n this.ctx.fillStyle = asString(styles.backgroundColor);\n this.ctx.fill();\n }\n\n await this.renderBackgroundImage(paint.container);\n\n this.ctx.restore();\n\n styles.boxShadow\n .slice(0)\n .reverse()\n .forEach((shadow) => {\n this.ctx.save();\n const borderBoxArea = calculateBorderBoxPath(paint.curves);\n const maskOffset = shadow.inset ? 0 : MASK_OFFSET;\n const shadowPaintingArea = transformPath(\n borderBoxArea,\n -maskOffset + (shadow.inset ? 1 : -1) * shadow.spread.number,\n (shadow.inset ? 1 : -1) * shadow.spread.number,\n shadow.spread.number * (shadow.inset ? -2 : 2),\n shadow.spread.number * (shadow.inset ? -2 : 2)\n );\n\n if (shadow.inset) {\n this.path(borderBoxArea);\n this.ctx.clip();\n this.mask(shadowPaintingArea);\n } else {\n this.mask(borderBoxArea);\n this.ctx.clip();\n this.path(shadowPaintingArea);\n }\n\n this.ctx.shadowOffsetX = shadow.offsetX.number + maskOffset;\n this.ctx.shadowOffsetY = shadow.offsetY.number;\n this.ctx.shadowColor = asString(shadow.color);\n this.ctx.shadowBlur = shadow.blur.number;\n this.ctx.fillStyle = shadow.inset ? asString(shadow.color) : 'rgba(0,0,0,1)';\n\n this.ctx.fill();\n this.ctx.restore();\n });\n }\n\n let side = 0;\n for (const border of borders) {\n if (border.style !== BORDER_STYLE.NONE && !isTransparent(border.color) && border.width > 0) {\n if (border.style === BORDER_STYLE.DASHED) {\n await this.renderDashedDottedBorder(\n border.color,\n border.width,\n side,\n paint.curves,\n BORDER_STYLE.DASHED\n );\n } else if (border.style === BORDER_STYLE.DOTTED) {\n await this.renderDashedDottedBorder(\n border.color,\n border.width,\n side,\n paint.curves,\n BORDER_STYLE.DOTTED\n );\n } else if (border.style === BORDER_STYLE.DOUBLE) {\n await this.renderDoubleBorder(border.color, border.width, side, paint.curves);\n } else {\n await this.renderSolidBorder(border.color, side, paint.curves);\n }\n }\n side++;\n }\n }\n\n async renderDashedDottedBorder(\n color: Color,\n width: number,\n side: number,\n curvePoints: BoundCurves,\n style: BORDER_STYLE\n ): Promise<void> {\n this.ctx.save();\n\n const strokePaths = parsePathForBorderStroke(curvePoints, side);\n const boxPaths = parsePathForBorder(curvePoints, side);\n\n if (style === BORDER_STYLE.DASHED) {\n this.path(boxPaths);\n this.ctx.clip();\n }\n\n let startX, startY, endX, endY;\n if (isBezierCurve(boxPaths[0])) {\n startX = (boxPaths[0] as BezierCurve).start.x;\n startY = (boxPaths[0] as BezierCurve).start.y;\n } else {\n startX = (boxPaths[0] as Vector).x;\n startY = (boxPaths[0] as Vector).y;\n }\n if (isBezierCurve(boxPaths[1])) {\n endX = (boxPaths[1] as BezierCurve).end.x;\n endY = (boxPaths[1] as BezierCurve).end.y;\n } else {\n endX = (boxPaths[1] as Vector).x;\n endY = (boxPaths[1] as Vector).y;\n }\n\n let length;\n if (side === 0 || side === 2) {\n length = Math.abs(startX - endX);\n } else {\n length = Math.abs(startY - endY);\n }\n\n this.ctx.beginPath();\n if (style === BORDER_STYLE.DOTTED) {\n this.formatPath(strokePaths);\n } else {\n this.formatPath(boxPaths.slice(0, 2));\n }\n\n let dashLength = width < 3 ? width * 3 : width * 2;\n let spaceLength = width < 3 ? width * 2 : width;\n if (style === BORDER_STYLE.DOTTED) {\n dashLength = width;\n spaceLength = width;\n }\n\n let useLineDash = true;\n if (length <= dashLength * 2) {\n useLineDash = false;\n } else if (length <= dashLength * 2 + spaceLength) {\n const multiplier = length / (2 * dashLength + spaceLength);\n dashLength *= multiplier;\n spaceLength *= multiplier;\n } else {\n const numberOfDashes = Math.floor((length + spaceLength) / (dashLength + spaceLength));\n const minSpace = (length - numberOfDashes * dashLength) / (numberOfDashes - 1);\n const maxSpace = (length - (numberOfDashes + 1) * dashLength) / numberOfDashes;\n spaceLength =\n maxSpace <= 0 || Math.abs(spaceLength - minSpace) < Math.abs(spaceLength - maxSpace)\n ? minSpace\n : maxSpace;\n }\n\n if (useLineDash) {\n if (style === BORDER_STYLE.DOTTED) {\n this.ctx.setLineDash([0, dashLength + spaceLength]);\n } else {\n this.ctx.setLineDash([dashLength, spaceLength]);\n }\n }\n\n if (style === BORDER_STYLE.DOTTED) {\n this.ctx.lineCap = 'round';\n this.ctx.lineWidth = width;\n } else {\n this.ctx.lineWidth = width * 2 + 1.1;\n }\n this.ctx.strokeStyle = asString(color);\n this.ctx.stroke();\n this.ctx.setLineDash([]);\n\n // dashed round edge gap\n if (style === BORDER_STYLE.DASHED) {\n if (isBezierCurve(boxPaths[0])) {\n const path1 = boxPaths[3] as BezierCurve;\n const path2 = boxPaths[0] as BezierCurve;\n this.ctx.beginPath();\n this.formatPath([new Vector(path1.end.x, path1.end.y), new Vector(path2.start.x, path2.start.y)]);\n this.ctx.stroke();\n }\n if (isBezierCurve(boxPaths[1])) {\n const path1 = boxPaths[1] as BezierCurve;\n const path2 = boxPaths[2] as BezierCurve;\n this.ctx.beginPath();\n this.formatPath([new Vector(path1.end.x, path1.end.y), new Vector(path2.start.x, path2.start.y)]);\n this.ctx.stroke();\n }\n }\n\n this.ctx.restore();\n }\n\n async render(element: ElementContainer): Promise<HTMLCanvasElement> {\n if (this.options.backgroundColor) {\n this.ctx.fillStyle = asString(this.options.backgroundColor);\n this.ctx.fillRect(this.options.x, this.options.y, this.options.width, this.options.height);\n }\n\n const stack = parseStackingContexts(element);\n\n await this.renderStack(stack);\n this.applyEffects([]);\n return this.canvas;\n }\n}\n\nconst isTextInputElement = (\n container: ElementContainer\n): container is InputElementContainer | TextareaElementContainer | SelectElementContainer => {\n if (container instanceof TextareaElementContainer) {\n return true;\n } else if (container instanceof SelectElementContainer) {\n return true;\n } else if (container instanceof InputElementContainer && container.type !== RADIO && container.type !== CHECKBOX) {\n return true;\n }\n return false;\n};\n\nconst calculateBackgroundCurvedPaintingArea = (clip: BACKGROUND_CLIP, curves: BoundCurves): Path[] => {\n switch (clip) {\n case BACKGROUND_CLIP.BORDER_BOX:\n return calculateBorderBoxPath(curves);\n case BACKGROUND_CLIP.CONTENT_BOX:\n return calculateContentBoxPath(curves);\n case BACKGROUND_CLIP.PADDING_BOX:\n default:\n return calculatePaddingBoxPath(curves);\n }\n};\n\nconst canvasTextAlign = (textAlign: TEXT_ALIGN): CanvasTextAlign => {\n switch (textAlign) {\n case TEXT_ALIGN.CENTER:\n return 'center';\n case TEXT_ALIGN.RIGHT:\n return 'right';\n case TEXT_ALIGN.LEFT:\n default:\n return 'left';\n }\n};\n\n// see https://github.com/niklasvh/html2canvas/pull/2645\nconst iOSBrokenFonts = ['-apple-system', 'system-ui'];\n\nconst fixIOSSystemFonts = (fontFamilies: string[]): string[] => {\n return /iPhone OS 15_(0|1)/.test(window.navigator.userAgent)\n ? fontFamilies.filter((fontFamily) => iOSBrokenFonts.indexOf(fontFamily) === -1)\n : fontFamilies;\n};\n","import { RenderConfigurations } from './canvas-renderer';\nimport { createForeignObjectSVG } from '../../core/features';\nimport { asString } from '../../css/types/color-utilities';\nimport { Renderer } from '../renderer';\nimport { Context } from '../../core/context';\n\nexport class ForeignObjectRenderer extends Renderer {\n canvas: HTMLCanvasElement;\n ctx: CanvasRenderingContext2D;\n options: RenderConfigurations;\n\n constructor(context: Context, options: RenderConfigurations) {\n super(context, options);\n this.canvas = options.canvas ? options.canvas : document.createElement('canvas');\n this.ctx = this.canvas.getContext('2d') as CanvasRenderingContext2D;\n this.options = options;\n this.canvas.width = Math.floor(options.width * options.scale);\n this.canvas.height = Math.floor(options.height * options.scale);\n this.canvas.style.width = `${options.width}px`;\n this.canvas.style.height = `${options.height}px`;\n\n this.ctx.scale(this.options.scale, this.options.scale);\n this.ctx.translate(-options.x, -options.y);\n this.context.logger.debug(\n `EXPERIMENTAL ForeignObject renderer initialized (${options.width}x${options.height} at ${options.x},${options.y}) with scale ${options.scale}`\n );\n }\n\n async render(element: HTMLElement): Promise<HTMLCanvasElement> {\n const svg = createForeignObjectSVG(\n this.options.width * this.options.scale,\n this.options.height * this.options.scale,\n this.options.scale,\n this.options.scale,\n element\n );\n\n const img = await loadSerializedSVG(svg);\n\n if (this.options.backgroundColor) {\n this.ctx.fillStyle = asString(this.options.backgroundColor);\n this.ctx.fillRect(0, 0, this.options.width * this.options.scale, this.options.height * this.options.scale);\n }\n\n this.ctx.drawImage(img, -this.options.x * this.options.scale, -this.options.y * this.options.scale);\n\n return this.canvas;\n }\n}\n\nexport const loadSerializedSVG = (svg: Node): Promise<HTMLImageElement> =>\n new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => {\n resolve(img);\n };\n img.onerror = reject;\n\n img.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(svg))}`;\n });\n","export interface LoggerOptions {\n id: string;\n enabled: boolean;\n}\n\nexport class Logger {\n static instances: { [key: string]: Logger } = {};\n\n private readonly id: string;\n private readonly enabled: boolean;\n private readonly start: number;\n\n constructor({ id, enabled }: LoggerOptions) {\n this.id = id;\n this.enabled = enabled;\n this.start = Date.now();\n }\n\n debug(...args: unknown[]): void {\n if (this.enabled) {\n // eslint-disable-next-line no-console\n if (typeof window !== 'undefined' && window.console && typeof console.debug === 'function') {\n // eslint-disable-next-line no-console\n console.debug(this.id, `${this.getTime()}ms`, ...args);\n } else {\n this.info(...args);\n }\n }\n }\n\n getTime(): number {\n return Date.now() - this.start;\n }\n\n info(...args: unknown[]): void {\n if (this.enabled) {\n // eslint-disable-next-line no-console\n if (typeof window !== 'undefined' && window.console && typeof console.info === 'function') {\n // eslint-disable-next-line no-console\n console.info(this.id, `${this.getTime()}ms`, ...args);\n }\n }\n }\n\n warn(...args: unknown[]): void {\n if (this.enabled) {\n if (typeof window !== 'undefined' && window.console && typeof console.warn === 'function') {\n console.warn(this.id, `${this.getTime()}ms`, ...args);\n } else {\n this.info(...args);\n }\n }\n }\n\n error(...args: unknown[]): void {\n if (this.enabled) {\n if (typeof window !== 'undefined' && window.console && typeof console.error === 'function') {\n console.error(this.id, `${this.getTime()}ms`, ...args);\n } else {\n this.info(...args);\n }\n }\n }\n}\n","import { Logger } from './logger';\nimport { Cache, ResourceOptions } from './cache-storage';\nimport { Bounds } from '../css/layout/bounds';\n\nexport type ContextOptions = {\n logging: boolean;\n cache?: Cache;\n} & ResourceOptions;\n\nexport class Context {\n private readonly instanceName = `#${Context.instanceCount++}`;\n readonly logger: Logger;\n readonly cache: Cache;\n\n private static instanceCount = 1;\n\n constructor(\n options: ContextOptions,\n public windowBounds: Bounds\n ) {\n this.logger = new Logger({ id: this.instanceName, enabled: options.logging });\n this.cache = options.cache ?? new Cache(this, options);\n }\n}\n","import { Bounds, parseBounds, parseDocumentSize } from './css/layout/bounds';\nimport { COLORS, parseColor } from './css/types/color';\nimport { isTransparent } from './css/types/color-utilities';\nimport { CloneConfigurations, CloneOptions, DocumentCloner, WindowOptions } from './dom/document-cloner';\nimport { isBodyElement, isHTMLElement, parseTree } from './dom/node-parser';\nimport { CacheStorage } from './core/cache-storage';\nimport { CanvasRenderer, RenderConfigurations, RenderOptions } from './render/canvas/canvas-renderer';\nimport { ForeignObjectRenderer } from './render/canvas/foreignobject-renderer';\nimport { Context, ContextOptions } from './core/context';\n\nexport type Options = CloneOptions &\n WindowOptions &\n RenderOptions &\n ContextOptions & {\n backgroundColor: string | null;\n foreignObjectRendering: boolean;\n removeContainer?: boolean;\n };\n\nlet cspNonce: string | undefined;\n\nconst setCspNonce = (nonce: string) => {\n cspNonce = nonce;\n};\n\nconst html2canvas = (element: HTMLElement, options: Partial<Options> = {}): Promise<HTMLCanvasElement> => {\n return renderElement(element, options);\n};\n\nhtml2canvas.setCspNonce = setCspNonce;\n\nexport default html2canvas;\nexport { html2canvas, setCspNonce };\n\nif (typeof window !== 'undefined') {\n CacheStorage.setContext(window);\n}\n\nconst renderElement = async (element: HTMLElement, opts: Partial<Options>): Promise<HTMLCanvasElement> => {\n if (!element || typeof element !== 'object') {\n return Promise.reject('Invalid element provided as first argument');\n }\n const ownerDocument = element.ownerDocument;\n\n if (!ownerDocument) {\n throw new Error(`Element is not attached to a Document`);\n }\n\n const defaultView = ownerDocument.defaultView;\n\n if (!defaultView) {\n throw new Error(`Document is not attached to a Window`);\n }\n\n const resourceOptions = {\n allowTaint: opts.allowTaint ?? false,\n imageTimeout: opts.imageTimeout ?? 15000,\n proxy: opts.proxy,\n useCORS: opts.useCORS ?? false,\n customIsSameOrigin: opts.customIsSameOrigin\n };\n\n const contextOptions = {\n logging: opts.logging ?? true,\n cache: opts.cache,\n ...resourceOptions\n };\n\n const windowOptions = {\n windowWidth: opts.windowWidth ?? defaultView.innerWidth,\n windowHeight: opts.windowHeight ?? defaultView.innerHeight,\n scrollX: opts.scrollX ?? defaultView.pageXOffset,\n scrollY: opts.scrollY ?? defaultView.pageYOffset\n };\n\n const windowBounds = new Bounds(\n windowOptions.scrollX,\n windowOptions.scrollY,\n windowOptions.windowWidth,\n windowOptions.windowHeight\n );\n\n const context = new Context(contextOptions, windowBounds);\n\n const foreignObjectRendering = opts.foreignObjectRendering ?? false;\n\n const cloneOptions: CloneConfigurations = {\n allowTaint: opts.allowTaint ?? false,\n onclone: opts.onclone,\n ignoreElements: opts.ignoreElements,\n iframeContainer: opts.iframeContainer,\n inlineImages: foreignObjectRendering,\n copyStyles: foreignObjectRendering,\n cspNonce\n };\n\n context.logger.debug(\n `Starting document clone with size ${windowBounds.width}x${\n windowBounds.height\n } scrolled to ${-windowBounds.left},${-windowBounds.top}`\n );\n\n const documentCloner = new DocumentCloner(context, element, cloneOptions);\n const clonedElement = documentCloner.clonedReferenceElement;\n if (!clonedElement) {\n return Promise.reject(`Unable to find element in cloned iframe`);\n }\n\n const container = await documentCloner.toIFrame(ownerDocument, windowBounds);\n\n const { width, height, left, top } =\n isBodyElement(clonedElement) || isHTMLElement(clonedElement)\n ? parseDocumentSize(clonedElement.ownerDocument)\n : parseBounds(context, clonedElement);\n\n const backgroundColor = parseBackgroundColor(context, clonedElement, opts.backgroundColor);\n\n const renderOptions: RenderConfigurations = {\n canvas: opts.canvas,\n backgroundColor,\n scale: opts.scale ?? defaultView.devicePixelRatio ?? 1,\n x: (opts.x ?? 0) + left,\n y: (opts.y ?? 0) + top,\n width: opts.width ?? Math.ceil(width),\n height: opts.height ?? Math.ceil(height)\n };\n\n let canvas;\n\n if (foreignObjectRendering) {\n context.logger.debug(`Document cloned, using foreign object rendering`);\n const renderer = new ForeignObjectRenderer(context, renderOptions);\n canvas = await renderer.render(clonedElement);\n } else {\n context.logger.debug(\n `Document cloned, element located at ${left},${top} with size ${width}x${height} using computed rendering`\n );\n\n context.logger.debug(`Starting DOM parsing`);\n const root = parseTree(context, clonedElement);\n\n if (backgroundColor === root.styles.backgroundColor) {\n root.styles.backgroundColor = COLORS.TRANSPARENT;\n }\n\n context.logger.debug(\n `Starting renderer for element at ${renderOptions.x},${renderOptions.y} with size ${renderOptions.width}x${renderOptions.height}`\n );\n\n const renderer = new CanvasRenderer(context, renderOptions);\n canvas = await renderer.render(root);\n }\n\n if (opts.removeContainer ?? true) {\n if (!DocumentCloner.destroy(container)) {\n context.logger.error(`Cannot detach cloned iframe as it is not in the DOM anymore`);\n }\n }\n\n context.logger.debug(`Finished rendering`);\n return canvas;\n};\n\nconst parseBackgroundColor = (context: Context, element: HTMLElement, backgroundColorOverride?: string | null) => {\n const ownerDocument = element.ownerDocument;\n // http://www.w3.org/TR/css3-background/#special-backgrounds\n const documentBackgroundColor = ownerDocument.documentElement\n ? parseColor(context, getComputedStyle(ownerDocument.documentElement).backgroundColor as string)\n : COLORS.TRANSPARENT;\n const bodyBackgroundColor = ownerDocument.body\n ? parseColor(context, getComputedStyle(ownerDocument.body).backgroundColor as string)\n : COLORS.TRANSPARENT;\n\n const defaultBackgroundColor =\n typeof backgroundColorOverride === 'string'\n ? parseColor(context, backgroundColorOverride)\n : backgroundColorOverride === null\n ? COLORS.TRANSPARENT\n : 0xffffffff;\n\n return element === ownerDocument.documentElement\n ? isTransparent(documentBackgroundColor)\n ? isTransparent(bodyBackgroundColor)\n ? defaultBackgroundColor\n : bodyBackgroundColor\n : documentBackgroundColor\n : defaultBackgroundColor;\n};\n","import type { ReportPayload, SubmittedReport } from '../types'\n\nexport interface ApiClientOptions {\n apiKey: string\n endpoint: string\n fetch?: typeof fetch\n beforeSend?: (payload: ReportPayload) => ReportPayload | false | Promise<ReportPayload | false>\n}\n\nexport interface ApiClient {\n submitReport(payload: ReportPayload): Promise<SubmittedReport>\n}\n\nconst SCALAR_FIELDS: Array<keyof ReportPayload> = [\n 'description', 'feedback_type', 'severity', 'env', 'page_url', 'user_agent', 'capture_method',\n]\n\nexport function createApiClient(options: ApiClientOptions): ApiClient {\n // No silent fallback to a hardcoded host — a misconfigured deploy used\n // to leak reports to https://core.mhosaic.com (which doesn't even\n // resolve). Failing fast at construction makes the misconfig obvious.\n const endpoint = (options.endpoint ?? '').replace(/\\/+$/, '')\n if (!endpoint) {\n throw new Error(\n '[mhosaic-feedback] `endpoint` is required (e.g. \"https://feedback.example.com\").',\n )\n }\n const fetcher = options.fetch ?? globalThis.fetch\n\n async function submitReport(input: ReportPayload): Promise<SubmittedReport> {\n let payload: ReportPayload | false = input\n if (options.beforeSend) payload = await options.beforeSend(input)\n if (payload === false) throw new Error('Submission cancelled by beforeSend')\n\n const form = new FormData()\n for (const field of SCALAR_FIELDS) {\n form.append(field, String(payload[field]))\n }\n form.append('technical_context', JSON.stringify(payload.technical_context))\n if (payload.screenshot) form.append('screenshot', payload.screenshot, 'screenshot.png')\n\n const response = await fetcher(`${endpoint}/api/feedback/v1/reports/`, {\n method: 'POST',\n headers: { Authorization: `Bearer ${options.apiKey}` },\n body: form,\n })\n if (!response.ok) {\n const text = await response.text().catch(() => '')\n throw new Error(`Feedback submit failed: ${response.status} ${text}`)\n }\n return response.json() as Promise<SubmittedReport>\n }\n\n return { submitReport }\n}\n","const SENSITIVE = /token|key|password|secret|auth|session|sig/i\n\nexport function sanitizeUrl(url: string): string {\n try {\n // Accept absolute URLs or root-relative paths; reject everything else\n const isAbsolute = /^https?:\\/\\//i.test(url)\n const isRootRelative = url.startsWith('/')\n if (!isAbsolute && !isRootRelative) return url\n\n const base = typeof window !== 'undefined' ? window.location.origin : 'http://localhost'\n const u = new URL(url, base)\n const clean = new URLSearchParams()\n u.searchParams.forEach((value, name) => {\n clean.set(name, SENSITIVE.test(name) ? '[redacted]' : value)\n })\n u.search = clean.toString()\n return u.toString()\n } catch {\n return url\n }\n}\n","import type { DeviceContext } from '../types'\n\nexport function collectDevice(): DeviceContext {\n const nav = navigator as Navigator & { connection?: { effectiveType?: string }; deviceMemory?: number }\n const connection = nav.connection?.effectiveType\n const deviceMemory = nav.deviceMemory\n const referrer = document.referrer || undefined\n return {\n viewport: { w: window.innerWidth, h: window.innerHeight, dpr: window.devicePixelRatio || 1 },\n screen: { w: window.screen.width, h: window.screen.height },\n platform: nav.platform,\n language: nav.language,\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n timezoneOffset: new Date().getTimezoneOffset(),\n ...(connection !== undefined && { connection }),\n online: nav.onLine,\n ...(deviceMemory !== undefined && { deviceMemory }),\n hardwareConcurrency: nav.hardwareConcurrency,\n ...(referrer !== undefined && { referrer }),\n title: document.title,\n pathname: window.location.pathname,\n }\n}\n","import type { RingBuffer } from './ringBuffer'\nimport type { ConsoleEntry } from '../types'\n\ntype ConsoleLevel = 'log' | 'info' | 'warn' | 'error' | 'debug'\n\nfunction safeStringify(arg: unknown): string {\n if (arg == null) return String(arg)\n if (typeof arg === 'string') return arg\n if (typeof arg === 'number' || typeof arg === 'boolean') return String(arg)\n if (arg instanceof Error) return `${arg.name}: ${arg.message}`\n if (arg instanceof Element) return `<${arg.tagName.toLowerCase()}>`\n try {\n return JSON.stringify(arg, (_k, v) => (typeof v === 'bigint' ? v.toString() : v))\n } catch {\n try { return String(arg) } catch { return '[unserializable]' }\n }\n}\n\nexport function installConsolePatch(buffer: RingBuffer<ConsoleEntry>): () => void {\n const levels: ConsoleLevel[] = ['log', 'info', 'warn', 'error', 'debug']\n const originals: Partial<Record<ConsoleLevel, (...args: unknown[]) => void>> = {}\n for (const level of levels) {\n const original = console[level] as ((...args: unknown[]) => void) | undefined\n if (typeof original !== 'function') continue\n originals[level] = original\n console[level] = function patched(...args: unknown[]) {\n try {\n const message = args.map(safeStringify).join(' ').slice(0, 2000)\n const entry: ConsoleEntry = { level, message, ts: Date.now() }\n if (level === 'error') {\n const stack = new Error().stack\n if (stack) entry.stack = stack.split('\\n').slice(2, 8).join('\\n')\n }\n buffer.push(entry)\n } catch { /* never break console */ }\n original.apply(console, args)\n }\n }\n return () => {\n for (const [level, fn] of Object.entries(originals)) {\n (console as unknown as Record<string, (...args: unknown[]) => void>)[level] = fn\n }\n }\n}\n","import type { RingBuffer } from './ringBuffer'\nimport type { NetworkEntry } from '../types'\n\nexport function installFetchPatch(buffer: RingBuffer<NetworkEntry>, sanitize: (url: string) => string): () => void {\n if (typeof window === 'undefined' || typeof window.fetch !== 'function') return () => {}\n const original = window.fetch.bind(window)\n window.fetch = async function patched(input: RequestInfo | URL, init?: RequestInit) {\n const start = performance.now()\n const url = typeof input === 'string' ? input : input instanceof URL ? input.toString() : input.url\n const method = (init?.method || (input instanceof Request ? input.method : 'GET')).toUpperCase()\n try {\n const response = await original(input, init)\n buffer.push({ url: sanitize(url), method, status: response.status, durationMs: Math.round(performance.now() - start), ts: Date.now() })\n return response\n } catch (err) {\n buffer.push({\n url: sanitize(url), method, status: 0,\n durationMs: Math.round(performance.now() - start),\n ts: Date.now(),\n error: err instanceof Error ? err.message : String(err),\n })\n throw err\n }\n }\n return () => { window.fetch = original }\n}\n\nexport function installXhrPatch(buffer: RingBuffer<NetworkEntry>, sanitize: (url: string) => string): () => void {\n if (typeof window === 'undefined' || typeof window.XMLHttpRequest !== 'function') return () => {}\n const Original = window.XMLHttpRequest\n const originalOpen = Original.prototype.open\n const originalSend = Original.prototype.send\n\n Original.prototype.open = function patchedOpen(this: XMLHttpRequest & { __mfb?: { method: string; url: string; start: number } }, method: string, url: string | URL) {\n this.__mfb = { method: method.toUpperCase(), url: typeof url === 'string' ? url : url.toString(), start: performance.now() }\n return originalOpen.apply(this, arguments as unknown as Parameters<typeof originalOpen>)\n }\n\n Original.prototype.send = function patchedSend(this: XMLHttpRequest & { __mfb?: { method: string; url: string; start: number } }, body?: Document | XMLHttpRequestBodyInit | null) {\n this.addEventListener('loadend', () => {\n try {\n const ctx = this.__mfb\n if (!ctx) return\n buffer.push({\n url: sanitize(ctx.url),\n method: ctx.method,\n status: this.status,\n durationMs: Math.round(performance.now() - ctx.start),\n ts: Date.now(),\n })\n } catch { /* noop */ }\n })\n return originalSend.call(this, body ?? null)\n }\n\n return () => {\n Original.prototype.open = originalOpen\n Original.prototype.send = originalSend\n }\n}\n","import type { RingBuffer } from './ringBuffer'\nimport type { ErrorEntry } from '../types'\n\nexport function installErrorHandlers(buffer: RingBuffer<ErrorEntry>): () => void {\n if (typeof window === 'undefined') return () => {}\n const onError = (e: ErrorEvent) => {\n const stack = e.error instanceof Error ? e.error.stack : undefined\n buffer.push({\n message: e.message || 'Unknown error',\n ...(stack !== undefined && { stack }),\n ts: Date.now(),\n source: 'window.error',\n })\n }\n const onRejection = (e: PromiseRejectionEvent) => {\n const reason = e.reason\n const message =\n reason instanceof Error ? reason.message :\n typeof reason === 'string' ? reason :\n (() => { try { return JSON.stringify(reason) } catch { return String(reason) } })()\n const stack = reason instanceof Error ? reason.stack : undefined\n buffer.push({\n message,\n ...(stack !== undefined && { stack }),\n ts: Date.now(),\n source: 'unhandledrejection',\n })\n }\n window.addEventListener('error', onError)\n window.addEventListener('unhandledrejection', onRejection)\n return () => {\n window.removeEventListener('error', onError)\n window.removeEventListener('unhandledrejection', onRejection)\n }\n}\n","export interface PerformanceSnapshot {\n navigation?: { type: string; duration: number }\n longTasks: { duration: number; startTime: number }[]\n slowResources: { name: string; duration: number; initiatorType: string }[]\n}\n\nexport function createPerformanceCollector(slowResourceMs = 1000) {\n const longTasks: PerformanceSnapshot['longTasks'] = []\n const slowResources: PerformanceSnapshot['slowResources'] = []\n let observer: PerformanceObserver | null = null\n\n if (typeof PerformanceObserver !== 'undefined') {\n try {\n observer = new PerformanceObserver((list) => {\n for (const entry of list.getEntries()) {\n if (entry.entryType === 'longtask') {\n longTasks.push({ duration: entry.duration, startTime: entry.startTime })\n while (longTasks.length > 20) longTasks.shift()\n } else if (entry.entryType === 'resource') {\n const e = entry as PerformanceResourceTiming\n if (e.duration > slowResourceMs) {\n slowResources.push({ name: e.name, duration: e.duration, initiatorType: e.initiatorType })\n while (slowResources.length > 20) slowResources.shift()\n }\n }\n }\n })\n observer.observe({ entryTypes: ['longtask', 'resource'] })\n } catch { /* unsupported */ }\n }\n\n return {\n snapshot(): PerformanceSnapshot {\n const nav = typeof performance !== 'undefined' ? performance.getEntriesByType('navigation')[0] as PerformanceNavigationTiming | undefined : undefined\n const navigation = nav ? { type: nav.type, duration: nav.duration } : undefined\n return {\n ...(navigation !== undefined && { navigation }),\n longTasks: longTasks.slice(),\n slowResources: slowResources.slice(),\n }\n },\n dispose() { observer?.disconnect() },\n }\n}\n","export class RingBuffer<T> {\n private items: T[] = []\n constructor(private readonly max: number) {}\n\n push(item: T): void {\n this.items.push(item)\n while (this.items.length > this.max) this.items.shift()\n }\n\n snapshot(): T[] {\n return this.items.slice()\n }\n\n clear(): void {\n this.items.length = 0\n }\n}\n","import { sanitizeUrl } from './urlSanitizer'\nimport { collectDevice } from './device'\nimport { installConsolePatch } from './console'\nimport { installFetchPatch, installXhrPatch } from './network'\nimport { installErrorHandlers } from './errors'\nimport { createPerformanceCollector } from './performance'\nimport { RingBuffer } from './ringBuffer'\nimport type { CapturedContext, ConsoleEntry, ErrorEntry, NetworkEntry } from '../types'\n\nexport interface CaptureOptions {\n sanitizeUrl?: (url: string) => string\n maxConsole?: number\n maxNetwork?: number\n maxErrors?: number\n}\n\nexport interface CaptureHandle {\n snapshot(): CapturedContext\n clear(): void\n dispose(): void\n}\n\nexport function installCapture(options: CaptureOptions = {}): CaptureHandle {\n const { maxConsole = 50, maxNetwork = 50, maxErrors = 20 } = options\n const sanitize = options.sanitizeUrl ?? sanitizeUrl\n\n const consoleBuf = new RingBuffer<ConsoleEntry>(maxConsole)\n const networkBuf = new RingBuffer<NetworkEntry>(maxNetwork)\n const errorBuf = new RingBuffer<ErrorEntry>(maxErrors)\n\n const uninstallConsole = installConsolePatch(consoleBuf)\n const uninstallFetch = installFetchPatch(networkBuf, sanitize)\n const uninstallXhr = installXhrPatch(networkBuf, sanitize)\n const uninstallErrors = installErrorHandlers(errorBuf)\n const perf = createPerformanceCollector()\n\n return {\n snapshot(): CapturedContext {\n return {\n consoleLogs: consoleBuf.snapshot(),\n networkRequests: networkBuf.snapshot(),\n errors: errorBuf.snapshot(),\n device: collectDevice(),\n capturedAt: Date.now(),\n }\n },\n clear() {\n consoleBuf.clear(); networkBuf.clear(); errorBuf.clear()\n },\n dispose() {\n uninstallConsole(); uninstallFetch(); uninstallXhr(); uninstallErrors()\n perf.dispose()\n },\n }\n}\n","export function isMaskedElement(el: Element): boolean {\n return el.hasAttribute('data-mfb-mask') || el.classList.contains('mfb-mask')\n}\n\nexport function prepareMaskMatcher(selectors: string[]): (el: Element) => boolean {\n const joined = selectors.join(',').trim()\n if (!joined) return isMaskedElement\n return (el: Element) => isMaskedElement(el) || el.matches(joined)\n}\n\nexport interface ScreenshotOptions {\n mask?: string[]\n maxBytes?: number\n}\n\nexport async function takeScreenshot(target: Element, options: ScreenshotOptions = {}): Promise<Blob | null> {\n if (typeof document === 'undefined') return null\n try {\n const html2canvas = (await import('html2canvas-pro')).default\n const matcher = prepareMaskMatcher(options.mask ?? [])\n const canvas = await html2canvas(target as HTMLElement, {\n ignoreElements: (el) => matcher(el),\n useCORS: true,\n logging: false,\n backgroundColor: null,\n })\n return await new Promise<Blob | null>((resolve) => canvas.toBlob(resolve, 'image/png'))\n } catch {\n return null\n }\n}\n","export const DEFAULT_STRINGS = {\n 'fab.label': 'Send feedback',\n 'form.title': 'Send feedback',\n 'form.description.label': 'What happened?',\n 'form.description.placeholder': 'Describe the issue or idea in one or two sentences.',\n 'form.type.label': 'Type',\n 'form.severity.label': 'Severity',\n 'form.submit': 'Send',\n 'form.cancel': 'Cancel',\n 'form.submitting': 'Sending…',\n 'form.success': 'Thanks — your feedback was sent.',\n 'form.error': 'Could not send. Please try again.',\n 'type.bug': 'Bug',\n 'type.feature': 'Feature request',\n 'type.question': 'Question',\n 'type.praise': 'Praise',\n 'type.typo': 'Typo',\n 'severity.blocker': 'Blocker',\n 'severity.high': 'High',\n 'severity.medium': 'Medium',\n 'severity.low': 'Low',\n}\n\nexport type StringKey = keyof typeof DEFAULT_STRINGS\n\nconst FRENCH_STRINGS: Record<StringKey, string> = {\n 'fab.label': 'Envoyer un commentaire',\n 'form.title': 'Envoyer un commentaire',\n 'form.description.label': 'Qu’est-il arrivé ?',\n 'form.description.placeholder': 'Décrivez le problème ou l’idée en une ou deux phrases.',\n 'form.type.label': 'Type',\n 'form.severity.label': 'Sévérité',\n 'form.submit': 'Envoyer',\n 'form.cancel': 'Annuler',\n 'form.submitting': 'Envoi…',\n 'form.success': 'Merci — votre commentaire a été envoyé.',\n 'form.error': 'Échec d’envoi. Veuillez réessayer.',\n 'type.bug': 'Bogue',\n 'type.feature': 'Suggestion',\n 'type.question': 'Question',\n 'type.praise': 'Compliment',\n 'type.typo': 'Coquille',\n 'severity.blocker': 'Bloquant',\n 'severity.high': 'Élevée',\n 'severity.medium': 'Moyenne',\n 'severity.low': 'Faible',\n}\n\nconst LOCALE_PACKS: Record<string, Record<StringKey, string>> = {\n fr: FRENCH_STRINGS,\n}\n\ninterface ResolveOptions {\n locale?: string\n}\n\nfunction packFor(locale: string | undefined): Record<StringKey, string> | null {\n if (!locale) return null\n // Match the language subtag only (fr-CA, fr-FR → fr).\n const tag = locale.toLowerCase().split(/[-_]/)[0]!\n return LOCALE_PACKS[tag] ?? null\n}\n\nexport function resolveStrings(\n overrides: Record<string, string>,\n options: ResolveOptions = {},\n): Record<StringKey, string> {\n const localePack = packFor(options.locale) ?? {}\n return {\n ...DEFAULT_STRINGS,\n ...localePack,\n ...overrides,\n } as Record<StringKey, string>\n}\n","/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 2;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 1;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nexport const XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nexport const MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n\nexport const NULL = null;\nexport const UNDEFINED = undefined;\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL =\n\t/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n","import { EMPTY_ARR } from './constants';\n\nexport const isArray = Array.isArray;\n\n/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\t// @ts-expect-error We change the type of `obj` to be `O & P`\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Remove a child node from its parent if attached. This is a workaround for\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\n * is smaller than including a dedicated polyfill.\n * @param {import('./index').ContainerNode} node The node to remove\n */\nexport function removeNode(node) {\n\tif (node && node.parentNode) node.parentNode.removeChild(node);\n}\n\nexport const slice = EMPTY_ARR.slice;\n","import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {import('./internal').Options}\n */\nconst options = {\n\t_catchError\n};\n\nexport default options;\n","import { slice } from './util';\nimport options from './options';\nimport { NULL, UNDEFINED } from './constants';\n\nlet vnodeId = 0;\n\n/**\n * Create an virtual node (used for JSX)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component constructor for this\n * virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array<import('.').ComponentChildren>} [children] The children of the\n * virtual node\n * @returns {import('./internal').VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\tkey,\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != NULL) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === UNDEFINED) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(type, normalizedProps, key, ref, NULL);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {import('./internal').VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {import('./internal').VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\t/** @type {import('./internal').VNode} */\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: NULL,\n\t\t_parent: NULL,\n\t\t_depth: 0,\n\t\t_dom: NULL,\n\t\t_component: NULL,\n\t\tconstructor: UNDEFINED,\n\t\t_original: original == NULL ? ++vnodeId : original,\n\t\t_index: -1,\n\t\t_flags: 0\n\t};\n\n\t// Only invoke the vnode hook if this was *not* a direct copy:\n\tif (original == NULL && options.vnode != NULL) options.vnode(vnode);\n\n\treturn vnode;\n}\n\nexport function createRef() {\n\treturn { current: NULL };\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != NULL && vnode.constructor === UNDEFINED;\n","import { assign } from './util';\nimport { diff, commitRoot } from './diff/index';\nimport options from './options';\nimport { Fragment } from './create-element';\nimport { MODE_HYDRATE, NULL } from './constants';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function BaseComponent(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @this {import('./internal').Component}\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nBaseComponent.prototype.setState = function (update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != NULL && this._nextState != this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == NULL) return;\n\n\tif (this._vnode) {\n\t\tif (callback) {\n\t\t\tthis._stateCallbacks.push(callback);\n\t\t}\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @this {import('./internal').Component}\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nBaseComponent.prototype.forceUpdate = function (callback) {\n\tif (this._vnode) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._force = true;\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](https://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {ComponentChildren | void}\n */\nBaseComponent.prototype.render = Fragment;\n\n/**\n * @param {import('./internal').VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, childIndex) {\n\tif (childIndex == NULL) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn vnode._parent\n\t\t\t? getDomSibling(vnode._parent, vnode._index + 1)\n\t\t\t: NULL;\n\t}\n\n\tlet sibling;\n\tfor (; childIndex < vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling != NULL && sibling._dom != NULL) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We must resume from this vnode's sibling (in it's parent _children array)\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search)\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : NULL;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {import('./internal').Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tif (component._parentDom && component._dirty) {\n\t\tlet oldVNode = component._vnode,\n\t\t\toldDom = oldVNode._dom,\n\t\t\tcommitQueue = [],\n\t\t\trefQueue = [],\n\t\t\tnewVNode = assign({}, oldVNode);\n\t\tnewVNode._original = oldVNode._original + 1;\n\t\tif (options.vnode) options.vnode(newVNode);\n\n\t\tdiff(\n\t\t\tcomponent._parentDom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tcomponent._parentDom.namespaceURI,\n\t\t\toldVNode._flags & MODE_HYDRATE ? [oldDom] : NULL,\n\t\t\tcommitQueue,\n\t\t\toldDom == NULL ? getDomSibling(oldVNode) : oldDom,\n\t\t\t!!(oldVNode._flags & MODE_HYDRATE),\n\t\t\trefQueue\n\t\t);\n\n\t\tnewVNode._original = oldVNode._original;\n\t\tnewVNode._parent._children[newVNode._index] = newVNode;\n\t\tcommitRoot(commitQueue, newVNode, refQueue);\n\t\toldVNode._dom = oldVNode._parent = null;\n\n\t\tif (newVNode._dom != oldDom) {\n\t\t\tupdateParentDomPointers(newVNode);\n\t\t}\n\t}\n}\n\n/**\n * @param {import('./internal').VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\tif ((vnode = vnode._parent) != NULL && vnode._component != NULL) {\n\t\tvnode._dom = vnode._component.base = NULL;\n\t\tvnode._children.some(child => {\n\t\t\tif (child != NULL && child._dom != NULL) {\n\t\t\t\treturn (vnode._dom = vnode._component.base = child._dom);\n\t\t\t}\n\t\t});\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array<import('./internal').Component>}\n */\nlet rerenderQueue = [];\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\nconst defer =\n\ttypeof Promise == 'function'\n\t\t? Promise.prototype.then.bind(Promise.resolve())\n\t\t: setTimeout;\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./internal').Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!c._dirty &&\n\t\t\t(c._dirty = true) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce != options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/**\n * @param {import('./internal').Component} a\n * @param {import('./internal').Component} b\n */\nconst depthSort = (a, b) => a._vnode._depth - b._vnode._depth;\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\ttry {\n\t\tlet c,\n\t\t\tl = 1;\n\n\t\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t\t// process() calls from getting scheduled while `queue` is still being consumed.\n\t\twhile (rerenderQueue.length) {\n\t\t\t// Keep the rerender queue sorted by (depth, insertion order). The queue\n\t\t\t// will initially be sorted on the first iteration only if it has more than 1 item.\n\t\t\t//\n\t\t\t// New items can be added to the queue e.g. when rerendering a provider, so we want to\n\t\t\t// keep the order from top to bottom with those new items so we can handle them in a\n\t\t\t// single pass\n\t\t\tif (rerenderQueue.length > l) {\n\t\t\t\trerenderQueue.sort(depthSort);\n\t\t\t}\n\n\t\t\tc = rerenderQueue.shift();\n\t\t\tl = rerenderQueue.length;\n\n\t\t\trenderComponent(c);\n\t\t}\n\t} finally {\n\t\trerenderQueue.length = process._rerenderCount = 0;\n\t}\n}\n\nprocess._rerenderCount = 0;\n","import { IS_NON_DIMENSIONAL, NULL, SVG_NAMESPACE } from '../constants';\nimport options from '../options';\n\n// Per-instance unique key for event clock stamps. Each Preact copy on the page\n// gets its own random suffix so that `_dispatched` / `_attached` properties on\n// shared event objects and handler functions cannot collide across instances.\n// ~1 in 60M collision odds - if you have that many praect versions on the page,\n// you deserve some weird bugs.\n// In 11 we can replace this with a\n// Symbol\nlet _id = Math.random().toString(8),\n\tEVENT_DISPATCHED = '__d' + _id,\n\tEVENT_ATTACHED = '__a' + _id;\n\nfunction setStyle(style, key, value) {\n\tif (key[0] == '-') {\n\t\tstyle.setProperty(key, value == NULL ? '' : value);\n\t} else if (value == NULL) {\n\t\tstyle[key] = '';\n\t} else if (typeof value != 'number' || IS_NON_DIMENSIONAL.test(key)) {\n\t\tstyle[key] = value;\n\t} else {\n\t\tstyle[key] = value + 'px';\n\t}\n}\n\nconst CAPTURE_REGEX = /(PointerCapture)$|Capture$/i;\n\n// A logical clock to solve issues like https://github.com/preactjs/preact/issues/3927.\n// When the DOM performs an event it leaves micro-ticks in between bubbling up which means that\n// an event can trigger on a newly reated DOM-node while the event bubbles up.\n//\n// Originally inspired by Vue\n// (https://github.com/vuejs/core/blob/caeb8a68811a1b0f79/packages/runtime-dom/src/modules/events.ts#L90-L101),\n// but modified to use a logical clock instead of Date.now() in case event handlers get attached\n// and events get dispatched during the same millisecond.\n//\n// The clock is incremented after each new event dispatch. This allows 1 000 000 new events\n// per second for over 280 years before the value reaches Number.MAX_SAFE_INTEGER (2**53 - 1).\nlet eventClock = 0;\n\n/**\n * Set a property value on a DOM node\n * @param {import('../internal').PreactElement} dom The DOM node to modify\n * @param {string} name The name of the property to set\n * @param {*} value The value to set the property to\n * @param {*} oldValue The old value the property had\n * @param {string} namespace Whether or not this DOM node is an SVG node or not\n */\nexport function setProperty(dom, name, value, oldValue, namespace) {\n\tlet useCapture;\n\n\to: if (name == 'style') {\n\t\tif (typeof value == 'string') {\n\t\t\tdom.style.cssText = value;\n\t\t} else {\n\t\t\tif (typeof oldValue == 'string') {\n\t\t\t\tdom.style.cssText = oldValue = '';\n\t\t\t}\n\n\t\t\tif (oldValue) {\n\t\t\t\tfor (name in oldValue) {\n\t\t\t\t\tif (!(value && name in value)) {\n\t\t\t\t\t\tsetStyle(dom.style, name, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (value) {\n\t\t\t\tfor (name in value) {\n\t\t\t\t\tif (!oldValue || value[name] != oldValue[name]) {\n\t\t\t\t\t\tsetStyle(dom.style, name, value[name]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6\n\telse if (name[0] == 'o' && name[1] == 'n') {\n\t\tuseCapture = name != (name = name.replace(CAPTURE_REGEX, '$1'));\n\t\tconst lowerCaseName = name.toLowerCase();\n\n\t\t// Infer correct casing for DOM built-in events:\n\t\tif (lowerCaseName in dom || name == 'onFocusOut' || name == 'onFocusIn')\n\t\t\tname = lowerCaseName.slice(2);\n\t\telse name = name.slice(2);\n\n\t\tif (!dom._listeners) dom._listeners = {};\n\t\tdom._listeners[name + useCapture] = value;\n\n\t\tif (value) {\n\t\t\tif (!oldValue) {\n\t\t\t\tvalue[EVENT_ATTACHED] = eventClock;\n\t\t\t\tdom.addEventListener(\n\t\t\t\t\tname,\n\t\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\t\tuseCapture\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tvalue[EVENT_ATTACHED] = oldValue[EVENT_ATTACHED];\n\t\t\t}\n\t\t} else {\n\t\t\tdom.removeEventListener(\n\t\t\t\tname,\n\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\tuseCapture\n\t\t\t);\n\t\t}\n\t} else {\n\t\tif (namespace == SVG_NAMESPACE) {\n\t\t\t// Normalize incorrect prop usage for SVG:\n\t\t\t// - xlink:href / xlinkHref --> href (xlink:href was removed from SVG and isn't needed)\n\t\t\t// - className --> class\n\t\t\tname = name.replace(/xlink(H|:h)/, 'h').replace(/sName$/, 's');\n\t\t} else if (\n\t\t\tname != 'width' &&\n\t\t\tname != 'height' &&\n\t\t\tname != 'href' &&\n\t\t\tname != 'list' &&\n\t\t\tname != 'form' &&\n\t\t\t// Default value in browsers is `-1` and an empty string is\n\t\t\t// cast to `0` instead\n\t\t\tname != 'tabIndex' &&\n\t\t\tname != 'download' &&\n\t\t\tname != 'rowSpan' &&\n\t\t\tname != 'colSpan' &&\n\t\t\tname != 'role' &&\n\t\t\tname != 'popover' &&\n\t\t\tname in dom\n\t\t) {\n\t\t\ttry {\n\t\t\t\tdom[name] = value == NULL ? '' : value;\n\t\t\t\t// labelled break is 1b smaller here than a return statement (sorry)\n\t\t\t\tbreak o;\n\t\t\t} catch (e) {}\n\t\t}\n\n\t\t// aria- and data- attributes have no boolean representation.\n\t\t// A `false` value is different from the attribute not being\n\t\t// present, so we can't remove it. For non-boolean aria\n\t\t// attributes we could treat false as a removal, but the\n\t\t// amount of exceptions would cost too many bytes. On top of\n\t\t// that other frameworks generally stringify `false`.\n\n\t\tif (typeof value == 'function') {\n\t\t\t// never serialize functions as attribute values\n\t\t} else if (value != NULL && (value !== false || name[4] == '-')) {\n\t\t\tdom.setAttribute(name, name == 'popover' && value == true ? '' : value);\n\t\t} else {\n\t\t\tdom.removeAttribute(name);\n\t\t}\n\t}\n}\n\n/**\n * Create an event proxy function.\n * @param {boolean} useCapture Is the event handler for the capture phase.\n * @private\n */\nfunction createEventProxy(useCapture) {\n\t/**\n\t * Proxy an event to hooked event handlers\n\t * @param {import('../internal').PreactEvent} e The event object from the browser\n\t * @private\n\t */\n\treturn function (e) {\n\t\tif (this._listeners) {\n\t\t\tconst eventHandler = this._listeners[e.type + useCapture];\n\t\t\tif (e[EVENT_DISPATCHED] == NULL) {\n\t\t\t\te[EVENT_DISPATCHED] = eventClock++;\n\n\t\t\t\t// When `e[EVENT_DISPATCHED]` is smaller than the time when the targeted event\n\t\t\t\t// handler was attached we know we have bubbled up to an element that was added\n\t\t\t\t// during patching the DOM.\n\t\t\t} else if (e[EVENT_DISPATCHED] < eventHandler[EVENT_ATTACHED]) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn eventHandler(options.event ? options.event(e) : e);\n\t\t}\n\t};\n}\n\nconst eventProxy = createEventProxy(false);\nconst eventProxyCapture = createEventProxy(true);\n","import { enqueueRender } from './component';\nimport { NULL } from './constants';\n\nexport let i = 0;\n\nexport function createContext(defaultValue) {\n\tfunction Context(props) {\n\t\tif (!this.getChildContext) {\n\t\t\t/** @type {Set<import('./internal').Component> | null} */\n\t\t\tlet subs = new Set();\n\t\t\tlet ctx = {};\n\t\t\tctx[Context._id] = this;\n\n\t\t\tthis.getChildContext = () => ctx;\n\n\t\t\tthis.componentWillUnmount = () => {\n\t\t\t\tsubs = NULL;\n\t\t\t};\n\n\t\t\tthis.shouldComponentUpdate = function (_props) {\n\t\t\t\t// @ts-expect-error even\n\t\t\t\tif (this.props.value != _props.value) {\n\t\t\t\t\tsubs.forEach(c => {\n\t\t\t\t\t\tc._force = true;\n\t\t\t\t\t\tenqueueRender(c);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.sub = c => {\n\t\t\t\tsubs.add(c);\n\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\tif (subs) {\n\t\t\t\t\t\tsubs.delete(c);\n\t\t\t\t\t}\n\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\treturn props.children;\n\t}\n\n\tContext._id = '__cC' + i++;\n\tContext._defaultValue = defaultValue;\n\n\t/** @type {import('./internal').FunctionComponent} */\n\tContext.Consumer = (props, contextValue) => {\n\t\treturn props.children(contextValue);\n\t};\n\n\t// we could also get rid of _contextRef entirely\n\tContext.Provider =\n\t\tContext._contextRef =\n\t\tContext.Consumer.contextType =\n\t\t\tContext;\n\n\treturn Context;\n}\n","import { diff, unmount, applyRef } from './index';\nimport { createVNode, Fragment } from '../create-element';\nimport {\n\tEMPTY_OBJ,\n\tEMPTY_ARR,\n\tINSERT_VNODE,\n\tMATCHED,\n\tUNDEFINED,\n\tNULL\n} from '../constants';\nimport { isArray } from '../util';\nimport { getDomSibling } from '../component';\n\n/**\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\n\n/**\n * Diff the children of a virtual node\n * @param {PreactElement} parentDom The DOM element whose children are being\n * diffed\n * @param {ComponentChildren[]} renderResult\n * @param {VNode} newParentVNode The new virtual node whose children should be\n * diff'ed against oldParentVNode\n * @param {VNode} oldParentVNode The old virtual node whose children should be\n * diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diffChildren(\n\tparentDom,\n\trenderResult,\n\tnewParentVNode,\n\toldParentVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\tlet i,\n\t\t/** @type {VNode} */\n\t\toldVNode,\n\t\t/** @type {VNode} */\n\t\tchildVNode,\n\t\t/** @type {PreactElement} */\n\t\tnewDom,\n\t\t/** @type {PreactElement} */\n\t\tfirstChildDom;\n\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`.\n\t/** @type {VNode[]} */\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\n\n\tlet newChildrenLength = renderResult.length;\n\n\toldDom = constructNewChildrenArray(\n\t\tnewParentVNode,\n\t\trenderResult,\n\t\toldChildren,\n\t\toldDom,\n\t\tnewChildrenLength\n\t);\n\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\tchildVNode = newParentVNode._children[i];\n\t\tif (childVNode == NULL) continue;\n\n\t\t// At this point, constructNewChildrenArray has assigned _index to be the\n\t\t// matchingIndex for this VNode's oldVNode (or -1 if there is no oldVNode).\n\t\toldVNode =\n\t\t\t(childVNode._index != -1 && oldChildren[childVNode._index]) || EMPTY_OBJ;\n\n\t\t// Update childVNode._index to its final index\n\t\tchildVNode._index = i;\n\n\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\tlet result = diff(\n\t\t\tparentDom,\n\t\t\tchildVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\toldDom,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\n\t\t// Adjust DOM nodes\n\t\tnewDom = childVNode._dom;\n\t\tif (childVNode.ref && oldVNode.ref != childVNode.ref) {\n\t\t\tif (oldVNode.ref) {\n\t\t\t\tapplyRef(oldVNode.ref, NULL, childVNode);\n\t\t\t}\n\t\t\trefQueue.push(\n\t\t\t\tchildVNode.ref,\n\t\t\t\tchildVNode._component || newDom,\n\t\t\t\tchildVNode\n\t\t\t);\n\t\t}\n\n\t\tif (firstChildDom == NULL && newDom != NULL) {\n\t\t\tfirstChildDom = newDom;\n\t\t}\n\n\t\tlet shouldPlace = !!(childVNode._flags & INSERT_VNODE);\n\t\tif (shouldPlace || oldVNode._children === childVNode._children) {\n\t\t\toldDom = insert(childVNode, oldDom, parentDom, shouldPlace);\n\n\t\t\t// When a matched VNode is physically moved via INSERT_VNODE, its old\n\t\t\t// _dom pointer becomes a stale positional reference. Clear it so that\n\t\t\t// getDomSibling (called from nested diffs) won't return this stale\n\t\t\t// reference and mis-place subsequent DOM nodes. See #5065.\n\t\t\tif (shouldPlace && oldVNode._dom) {\n\t\t\t\toldVNode._dom = NULL;\n\t\t\t}\n\t\t} else if (typeof childVNode.type == 'function' && result !== UNDEFINED) {\n\t\t\toldDom = result;\n\t\t} else if (newDom) {\n\t\t\toldDom = newDom.nextSibling;\n\t\t}\n\n\t\t// Unset diffing flags\n\t\tchildVNode._flags &= ~(INSERT_VNODE | MATCHED);\n\t}\n\n\tnewParentVNode._dom = firstChildDom;\n\n\treturn oldDom;\n}\n\n/**\n * @param {VNode} newParentVNode\n * @param {ComponentChildren[]} renderResult\n * @param {VNode[]} oldChildren\n */\nfunction constructNewChildrenArray(\n\tnewParentVNode,\n\trenderResult,\n\toldChildren,\n\toldDom,\n\tnewChildrenLength\n) {\n\t/** @type {number} */\n\tlet i;\n\t/** @type {VNode} */\n\tlet childVNode;\n\t/** @type {VNode} */\n\tlet oldVNode;\n\n\tlet oldChildrenLength = oldChildren.length,\n\t\tremainingOldChildren = oldChildrenLength;\n\n\tlet skew = 0;\n\n\tnewParentVNode._children = new Array(newChildrenLength);\n\tfor (i = 0; i < newChildrenLength; i++) {\n\t\t// @ts-expect-error We are reusing the childVNode variable to hold both the\n\t\t// pre and post normalized childVNode\n\t\tchildVNode = renderResult[i];\n\n\t\tif (\n\t\t\tchildVNode == NULL ||\n\t\t\ttypeof childVNode == 'boolean' ||\n\t\t\ttypeof childVNode == 'function'\n\t\t) {\n\t\t\tnewParentVNode._children[i] = NULL;\n\t\t\tcontinue;\n\t\t}\n\t\t// If this newVNode is being reused (e.g. <div>{reuse}{reuse}</div>) in the same diff,\n\t\t// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have\n\t\t// it's own DOM & etc. pointers\n\t\telse if (\n\t\t\ttypeof childVNode == 'string' ||\n\t\t\ttypeof childVNode == 'number' ||\n\t\t\t// eslint-disable-next-line valid-typeof\n\t\t\ttypeof childVNode == 'bigint' ||\n\t\t\tchildVNode.constructor == String\n\t\t) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tNULL,\n\t\t\t\tchildVNode,\n\t\t\t\tNULL,\n\t\t\t\tNULL,\n\t\t\t\tNULL\n\t\t\t);\n\t\t} else if (isArray(childVNode)) {\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tFragment,\n\t\t\t\t{ children: childVNode },\n\t\t\t\tNULL,\n\t\t\t\tNULL,\n\t\t\t\tNULL\n\t\t\t);\n\t\t} else if (childVNode.constructor === UNDEFINED && childVNode._depth > 0) {\n\t\t\t// VNode is already in use, clone it. This can happen in the following\n\t\t\t// scenario:\n\t\t\t// const reuse = <div />\n\t\t\t// <div>{reuse}<span />{reuse}</div>\n\t\t\tchildVNode = newParentVNode._children[i] = createVNode(\n\t\t\t\tchildVNode.type,\n\t\t\t\tchildVNode.props,\n\t\t\t\tchildVNode.key,\n\t\t\t\tchildVNode.ref ? childVNode.ref : NULL,\n\t\t\t\tchildVNode._original\n\t\t\t);\n\t\t} else {\n\t\t\tnewParentVNode._children[i] = childVNode;\n\t\t}\n\n\t\tconst skewedIndex = i + skew;\n\t\tchildVNode._parent = newParentVNode;\n\t\tchildVNode._depth = newParentVNode._depth + 1;\n\n\t\t// Temporarily store the matchingIndex on the _index property so we can pull\n\t\t// out the oldVNode in diffChildren. We'll override this to the VNode's\n\t\t// final index after using this property to get the oldVNode\n\t\tconst matchingIndex = (childVNode._index = findMatchingIndex(\n\t\t\tchildVNode,\n\t\t\toldChildren,\n\t\t\tskewedIndex,\n\t\t\tremainingOldChildren\n\t\t));\n\n\t\toldVNode = NULL;\n\t\tif (matchingIndex != -1) {\n\t\t\toldVNode = oldChildren[matchingIndex];\n\t\t\tremainingOldChildren--;\n\t\t\tif (oldVNode) {\n\t\t\t\toldVNode._flags |= MATCHED;\n\t\t\t}\n\t\t}\n\n\t\t// Here, we define isMounting for the purposes of the skew diffing\n\t\t// algorithm. Nodes that are unsuspending are considered mounting and we detect\n\t\t// this by checking if oldVNode._original == null\n\t\tconst isMounting = oldVNode == NULL || oldVNode._original == NULL;\n\n\t\tif (isMounting) {\n\t\t\tif (matchingIndex == -1) {\n\t\t\t\t// When the array of children is growing we need to decrease the skew\n\t\t\t\t// as we are adding a new element to the array.\n\t\t\t\t// Example:\n\t\t\t\t// [1, 2, 3] --> [0, 1, 2, 3]\n\t\t\t\t// oldChildren newChildren\n\t\t\t\t//\n\t\t\t\t// The new element is at index 0, so our skew is 0,\n\t\t\t\t// we need to decrease the skew as we are adding a new element.\n\t\t\t\t// The decrease will cause us to compare the element at position 1\n\t\t\t\t// with value 1 with the element at position 0 with value 0.\n\t\t\t\t//\n\t\t\t\t// A linear concept is applied when the array is shrinking,\n\t\t\t\t// if the length is unchanged we can assume that no skew\n\t\t\t\t// changes are needed.\n\t\t\t\tif (newChildrenLength > oldChildrenLength) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else if (newChildrenLength < oldChildrenLength) {\n\t\t\t\t\tskew++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we are mounting a DOM VNode, mark it for insertion\n\t\t\tif (typeof childVNode.type != 'function') {\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t} else if (matchingIndex != skewedIndex) {\n\t\t\t// When we move elements around i.e. [0, 1, 2] --> [1, 0, 2]\n\t\t\t// --> we diff 1, we find it at position 1 while our skewed index is 0 and our skew is 0\n\t\t\t// we set the skew to 1 as we found an offset.\n\t\t\t// --> we diff 0, we find it at position 0 while our skewed index is at 2 and our skew is 1\n\t\t\t// this makes us increase the skew again.\n\t\t\t// --> we diff 2, we find it at position 2 while our skewed index is at 4 and our skew is 2\n\t\t\t//\n\t\t\t// this becomes an optimization question where currently we see a 1 element offset as an insertion\n\t\t\t// or deletion i.e. we optimize for [0, 1, 2] --> [9, 0, 1, 2]\n\t\t\t// while a more than 1 offset we see as a swap.\n\t\t\t// We could probably build heuristics for having an optimized course of action here as well, but\n\t\t\t// might go at the cost of some bytes.\n\t\t\t//\n\t\t\t// If we wanted to optimize for i.e. only swaps we'd just do the last two code-branches and have\n\t\t\t// only the first item be a re-scouting and all the others fall in their skewed counter-part.\n\t\t\t// We could also further optimize for swaps\n\t\t\tif (matchingIndex == skewedIndex - 1) {\n\t\t\t\tskew--;\n\t\t\t} else if (matchingIndex == skewedIndex + 1) {\n\t\t\t\tskew++;\n\t\t\t} else {\n\t\t\t\tif (matchingIndex > skewedIndex) {\n\t\t\t\t\tskew--;\n\t\t\t\t} else {\n\t\t\t\t\tskew++;\n\t\t\t\t}\n\n\t\t\t\t// Move this VNode's DOM if the original index (matchingIndex) doesn't\n\t\t\t\t// match the new skew index (i + new skew)\n\t\t\t\t// In the former two branches we know that it matches after skewing\n\t\t\t\tchildVNode._flags |= INSERT_VNODE;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove remaining oldChildren if there are any. Loop forwards so that as we\n\t// unmount DOM from the beginning of the oldChildren, we can adjust oldDom to\n\t// point to the next child, which needs to be the first DOM node that won't be\n\t// unmounted.\n\tif (remainingOldChildren) {\n\t\tfor (i = 0; i < oldChildrenLength; i++) {\n\t\t\toldVNode = oldChildren[i];\n\t\t\tif (oldVNode != NULL && (oldVNode._flags & MATCHED) == 0) {\n\t\t\t\tif (oldVNode._dom == oldDom) {\n\t\t\t\t\toldDom = getDomSibling(oldVNode);\n\t\t\t\t}\n\n\t\t\t\tunmount(oldVNode, oldVNode);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn oldDom;\n}\n\n/**\n * @param {VNode} parentVNode\n * @param {PreactElement} oldDom\n * @param {PreactElement} parentDom\n * @param {boolean} shouldPlace\n * @returns {PreactElement}\n */\nfunction insert(parentVNode, oldDom, parentDom, shouldPlace) {\n\t// Note: VNodes in nested suspended trees may be missing _children.\n\n\tif (typeof parentVNode.type == 'function') {\n\t\tlet children = parentVNode._children;\n\t\tfor (let i = 0; children && i < children.length; i++) {\n\t\t\tif (children[i]) {\n\t\t\t\t// If we enter this code path on sCU bailout, where we copy\n\t\t\t\t// oldVNode._children to newVNode._children, we need to update the old\n\t\t\t\t// children's _parent pointer to point to the newVNode (parentVNode\n\t\t\t\t// here).\n\t\t\t\tchildren[i]._parent = parentVNode;\n\t\t\t\toldDom = insert(children[i], oldDom, parentDom, shouldPlace);\n\t\t\t}\n\t\t}\n\n\t\treturn oldDom;\n\t} else if (parentVNode._dom != oldDom) {\n\t\tif (shouldPlace) {\n\t\t\tif (oldDom && parentVNode.type && !oldDom.parentNode) {\n\t\t\t\toldDom = getDomSibling(parentVNode);\n\t\t\t}\n\t\t\tparentDom.insertBefore(parentVNode._dom, oldDom || NULL);\n\t\t}\n\t\toldDom = parentVNode._dom;\n\t}\n\n\tdo {\n\t\toldDom = oldDom && oldDom.nextSibling;\n\t} while (oldDom != NULL && oldDom.nodeType == 8);\n\n\treturn oldDom;\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {ComponentChildren} children The unflattened children of a virtual\n * node\n * @returns {VNode[]}\n */\nexport function toChildArray(children, out) {\n\tout = out || [];\n\tif (children == NULL || typeof children == 'boolean') {\n\t} else if (isArray(children)) {\n\t\tchildren.some(child => {\n\t\t\ttoChildArray(child, out);\n\t\t});\n\t} else {\n\t\tout.push(children);\n\t}\n\treturn out;\n}\n\n/**\n * @param {VNode} childVNode\n * @param {VNode[]} oldChildren\n * @param {number} skewedIndex\n * @param {number} remainingOldChildren\n * @returns {number}\n */\nfunction findMatchingIndex(\n\tchildVNode,\n\toldChildren,\n\tskewedIndex,\n\tremainingOldChildren\n) {\n\tconst key = childVNode.key;\n\tconst type = childVNode.type;\n\tlet oldVNode = oldChildren[skewedIndex];\n\tconst matched = oldVNode != NULL && (oldVNode._flags & MATCHED) == 0;\n\n\t// We only need to perform a search if there are more children\n\t// (remainingOldChildren) to search. However, if the oldVNode we just looked\n\t// at skewedIndex was not already used in this diff, then there must be at\n\t// least 1 other (so greater than 1) remainingOldChildren to attempt to match\n\t// against. So the following condition checks that ensuring\n\t// remainingOldChildren > 1 if the oldVNode is not already used/matched. Else\n\t// if the oldVNode was null or matched, then there could needs to be at least\n\t// 1 (aka `remainingOldChildren > 0`) children to find and compare against.\n\t//\n\t// If there is an unkeyed functional VNode, that isn't a built-in like our Fragment,\n\t// we should not search as we risk re-using state of an unrelated VNode. (reverted for now)\n\tlet shouldSearch =\n\t\t// (typeof type != 'function' || type === Fragment || key) &&\n\t\tremainingOldChildren > (matched ? 1 : 0);\n\n\tif (\n\t\t(oldVNode === NULL && key == null) ||\n\t\t(matched && key == oldVNode.key && type == oldVNode.type)\n\t) {\n\t\treturn skewedIndex;\n\t} else if (shouldSearch) {\n\t\tlet x = skewedIndex - 1;\n\t\tlet y = skewedIndex + 1;\n\t\twhile (x >= 0 || y < oldChildren.length) {\n\t\t\tconst childIndex = x >= 0 ? x-- : y++;\n\t\t\toldVNode = oldChildren[childIndex];\n\t\t\tif (\n\t\t\t\toldVNode != NULL &&\n\t\t\t\t(oldVNode._flags & MATCHED) == 0 &&\n\t\t\t\tkey == oldVNode.key &&\n\t\t\t\ttype == oldVNode.type\n\t\t\t) {\n\t\t\t\treturn childIndex;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn -1;\n}\n","import {\n\tEMPTY_ARR,\n\tEMPTY_OBJ,\n\tMATH_NAMESPACE,\n\tMODE_HYDRATE,\n\tMODE_SUSPENDED,\n\tNULL,\n\tRESET_MODE,\n\tSVG_NAMESPACE,\n\tUNDEFINED,\n\tXHTML_NAMESPACE\n} from '../constants';\nimport { BaseComponent, getDomSibling } from '../component';\nimport { Fragment } from '../create-element';\nimport { diffChildren } from './children';\nimport { setProperty } from './props';\nimport { assign, isArray, removeNode, slice } from '../util';\nimport options from '../options';\n\n/**\n * @typedef {import('../internal').ComponentChildren} ComponentChildren\n * @typedef {import('../internal').Component} Component\n * @typedef {import('../internal').PreactElement} PreactElement\n * @typedef {import('../internal').VNode} VNode\n */\n\n/**\n * @template {any} T\n * @typedef {import('../internal').Ref<T>} Ref<T>\n */\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {PreactElement} parentDom The parent of the DOM element\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object. Modified by\n * getChildContext\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {PreactElement} oldDom The current attached DOM element any new dom\n * elements should be placed around. Likely `null` on first render (except when\n * hydrating). Can be a sibling DOM element when diffing Fragments that have\n * siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n */\nexport function diff(\n\tparentDom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating,\n\trefQueue\n) {\n\t/** @type {any} */\n\tlet tmp,\n\t\tnewType = newVNode.type;\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== UNDEFINED) return NULL;\n\n\t// If the previous diff bailed out, resume creating/hydrating.\n\tif (oldVNode._flags & MODE_SUSPENDED) {\n\t\tisHydrating = !!(oldVNode._flags & MODE_HYDRATE);\n\t\toldDom = newVNode._dom = oldVNode._dom;\n\t\texcessDomChildren = [oldDom];\n\t}\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\touter: if (typeof newType == 'function') {\n\t\ttry {\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\n\t\t\tlet newProps = newVNode.props;\n\t\t\tconst isClassComponent = newType.prototype && newType.prototype.render;\n\n\t\t\t// Necessary for createContext api. Setting this property will pass\n\t\t\t// the context value as `this.context` just for this component.\n\t\t\ttmp = newType.contextType;\n\t\t\tlet provider = tmp && globalContext[tmp._id];\n\t\t\tlet componentContext = tmp\n\t\t\t\t? provider\n\t\t\t\t\t? provider.props.value\n\t\t\t\t\t: tmp._defaultValue\n\t\t\t\t: globalContext;\n\n\t\t\t// Get component and set it to `c`\n\t\t\tif (oldVNode._component) {\n\t\t\t\tc = newVNode._component = oldVNode._component;\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\n\t\t\t} else {\n\t\t\t\t// Instantiate the new component\n\t\t\t\tif (isClassComponent) {\n\t\t\t\t\t// @ts-expect-error The check above verifies that newType is suppose to be constructed\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\n\t\t\t\t} else {\n\t\t\t\t\t// @ts-expect-error Trust me, Component implements the interface we want\n\t\t\t\t\tnewVNode._component = c = new BaseComponent(\n\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t);\n\t\t\t\t\tc.constructor = newType;\n\t\t\t\t\tc.render = doRender;\n\t\t\t\t}\n\t\t\t\tif (provider) provider.sub(c);\n\n\t\t\t\tif (!c.state) c.state = {};\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tisNew = c._dirty = true;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t}\n\n\t\t\t// Invoke getDerivedStateFromProps\n\t\t\tif (isClassComponent && c._nextState == NULL) {\n\t\t\t\tc._nextState = c.state;\n\t\t\t}\n\n\t\t\tif (isClassComponent && newType.getDerivedStateFromProps != NULL) {\n\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t}\n\n\t\t\t\tassign(\n\t\t\t\t\tc._nextState,\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\toldProps = c.props;\n\t\t\toldState = c.state;\n\t\t\tc._vnode = newVNode;\n\n\t\t\t// Invoke pre-render lifecycle methods\n\t\t\tif (isNew) {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent &&\n\t\t\t\t\tnewType.getDerivedStateFromProps == NULL &&\n\t\t\t\t\tc.componentWillMount != NULL\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillMount();\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent && c.componentDidMount != NULL) {\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tisClassComponent &&\n\t\t\t\t\tnewType.getDerivedStateFromProps == NULL &&\n\t\t\t\t\tnewProps !== oldProps &&\n\t\t\t\t\tc.componentWillReceiveProps != NULL\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tnewVNode._original == oldVNode._original ||\n\t\t\t\t\t(!c._force &&\n\t\t\t\t\t\tc.shouldComponentUpdate != NULL &&\n\t\t\t\t\t\tc.shouldComponentUpdate(\n\t\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t\t) === false)\n\t\t\t\t) {\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\t\t\tif (newVNode._original != oldVNode._original) {\n\t\t\t\t\t\t// When we are dealing with a bail because of sCU we have to update\n\t\t\t\t\t\t// the props, state and dirty-state.\n\t\t\t\t\t\t// when we are dealing with strict-equality we don't as the child could still\n\t\t\t\t\t\t// be dirtied see #3883\n\t\t\t\t\t\tc.props = newProps;\n\t\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t\t\tc._dirty = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t\tnewVNode._children.some(vnode => {\n\t\t\t\t\t\tif (vnode) vnode._parent = newVNode;\n\t\t\t\t\t});\n\n\t\t\t\t\tEMPTY_ARR.push.apply(c._renderCallbacks, c._stateCallbacks);\n\t\t\t\t\tc._stateCallbacks = [];\n\n\t\t\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\t\t\tcommitQueue.push(c);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate != NULL) {\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (isClassComponent && c.componentDidUpdate != NULL) {\n\t\t\t\t\tc._renderCallbacks.push(() => {\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tc.context = componentContext;\n\t\t\tc.props = newProps;\n\t\t\tc._parentDom = parentDom;\n\t\t\tc._force = false;\n\n\t\t\tlet renderHook = options._render,\n\t\t\t\tcount = 0;\n\t\t\tif (isClassComponent) {\n\t\t\t\tc.state = c._nextState;\n\t\t\t\tc._dirty = false;\n\n\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\tEMPTY_ARR.push.apply(c._renderCallbacks, c._stateCallbacks);\n\t\t\t\tc._stateCallbacks = [];\n\t\t\t} else {\n\t\t\t\tdo {\n\t\t\t\t\tc._dirty = false;\n\t\t\t\t\tif (renderHook) renderHook(newVNode);\n\n\t\t\t\t\ttmp = c.render(c.props, c.state, c.context);\n\n\t\t\t\t\t// Handle setState called in render, see #2553\n\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t} while (c._dirty && ++count < 25);\n\t\t\t}\n\n\t\t\t// Handle setState called in render, see #2553\n\t\t\tc.state = c._nextState;\n\n\t\t\tif (c.getChildContext != NULL) {\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\n\t\t\t}\n\n\t\t\tif (isClassComponent && !isNew && c.getSnapshotBeforeUpdate != NULL) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tlet renderResult =\n\t\t\t\ttmp != NULL && tmp.type === Fragment && tmp.key == NULL\n\t\t\t\t\t? cloneNode(tmp.props.children)\n\t\t\t\t\t: tmp;\n\n\t\t\toldDom = diffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tisArray(renderResult) ? renderResult : [renderResult],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnamespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\toldDom,\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\tc.base = newVNode._dom;\n\n\t\t\t// We successfully rendered this VNode, unset any stored hydration/bailout state:\n\t\t\tnewVNode._flags &= RESET_MODE;\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\tif (clearProcessingException) {\n\t\t\t\tc._pendingError = c._processingException = NULL;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tnewVNode._original = NULL;\n\t\t\t// if hydrating or creating initial tree, bailout preserves DOM:\n\t\t\tif (isHydrating || excessDomChildren != NULL) {\n\t\t\t\tif (e.then) {\n\t\t\t\t\tnewVNode._flags |= isHydrating\n\t\t\t\t\t\t? MODE_HYDRATE | MODE_SUSPENDED\n\t\t\t\t\t\t: MODE_SUSPENDED;\n\n\t\t\t\t\twhile (oldDom && oldDom.nodeType == 8 && oldDom.nextSibling) {\n\t\t\t\t\t\toldDom = oldDom.nextSibling;\n\t\t\t\t\t}\n\n\t\t\t\t\texcessDomChildren[excessDomChildren.indexOf(oldDom)] = NULL;\n\t\t\t\t\tnewVNode._dom = oldDom;\n\t\t\t\t} else {\n\t\t\t\t\tfor (let i = excessDomChildren.length; i--; ) {\n\t\t\t\t\t\tremoveNode(excessDomChildren[i]);\n\t\t\t\t\t}\n\t\t\t\t\tmarkAsForce(newVNode);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\tif (!e.then) markAsForce(newVNode);\n\t\t\t}\n\t\t\toptions._catchError(e, newVNode, oldVNode);\n\t\t}\n\t} else if (\n\t\texcessDomChildren == NULL &&\n\t\tnewVNode._original == oldVNode._original\n\t) {\n\t\tnewVNode._children = oldVNode._children;\n\t\tnewVNode._dom = oldVNode._dom;\n\t} else {\n\t\toldDom = newVNode._dom = diffElementNodes(\n\t\t\toldVNode._dom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tglobalContext,\n\t\t\tnamespace,\n\t\t\texcessDomChildren,\n\t\t\tcommitQueue,\n\t\t\tisHydrating,\n\t\t\trefQueue\n\t\t);\n\t}\n\n\tif ((tmp = options.diffed)) tmp(newVNode);\n\n\treturn newVNode._flags & MODE_SUSPENDED ? undefined : oldDom;\n}\n\nfunction markAsForce(vnode) {\n\tif (vnode) {\n\t\tif (vnode._component) vnode._component._force = true;\n\t\tif (vnode._children) vnode._children.some(markAsForce);\n\t}\n}\n\n/**\n * @param {Array<Component>} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {VNode} root\n */\nexport function commitRoot(commitQueue, root, refQueue) {\n\tfor (let i = 0; i < refQueue.length; i++) {\n\t\tapplyRef(refQueue[i], refQueue[++i], refQueue[++i]);\n\t}\n\n\tif (options._commit) options._commit(root, commitQueue);\n\n\tcommitQueue.some(c => {\n\t\ttry {\n\t\t\t// @ts-expect-error Reuse the commitQueue variable here so the type changes\n\t\t\tcommitQueue = c._renderCallbacks;\n\t\t\tc._renderCallbacks = [];\n\t\t\tcommitQueue.some(cb => {\n\t\t\t\t// @ts-expect-error See above comment on commitQueue\n\t\t\t\tcb.call(c);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t});\n}\n\nfunction cloneNode(node) {\n\tif (typeof node != 'object' || node == NULL || node._depth > 0) {\n\t\treturn node;\n\t}\n\n\tif (isArray(node)) {\n\t\treturn node.map(cloneNode);\n\t}\n\n\treturn assign({}, node);\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {PreactElement} dom The DOM element representing the virtual nodes\n * being diffed\n * @param {VNode} newVNode The new virtual node\n * @param {VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object\n * @param {string} namespace Current namespace of the DOM node (HTML, SVG, or MathML)\n * @param {Array<PreactElement>} excessDomChildren\n * @param {Array<Component>} commitQueue List of components which have callbacks\n * to invoke in commitRoot\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @param {any[]} refQueue an array of elements needed to invoke refs\n * @returns {PreactElement}\n */\nfunction diffElementNodes(\n\tdom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tnamespace,\n\texcessDomChildren,\n\tcommitQueue,\n\tisHydrating,\n\trefQueue\n) {\n\tlet oldProps = oldVNode.props || EMPTY_OBJ;\n\tlet newProps = newVNode.props;\n\tlet nodeType = /** @type {string} */ (newVNode.type);\n\t/** @type {any} */\n\tlet i;\n\t/** @type {{ __html?: string }} */\n\tlet newHtml;\n\t/** @type {{ __html?: string }} */\n\tlet oldHtml;\n\t/** @type {ComponentChildren} */\n\tlet newChildren;\n\tlet value;\n\tlet inputValue;\n\tlet checked;\n\n\t// Tracks entering and exiting namespaces when descending through the tree.\n\tif (nodeType == 'svg') namespace = SVG_NAMESPACE;\n\telse if (nodeType == 'math') namespace = MATH_NAMESPACE;\n\telse if (!namespace) namespace = XHTML_NAMESPACE;\n\n\tif (excessDomChildren != NULL) {\n\t\tfor (i = 0; i < excessDomChildren.length; i++) {\n\t\t\tvalue = excessDomChildren[i];\n\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\n\t\t\t// argument matches an element in excessDomChildren, remove it from\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\n\t\t\tif (\n\t\t\t\tvalue &&\n\t\t\t\t'setAttribute' in value == !!nodeType &&\n\t\t\t\t(nodeType ? value.localName == nodeType : value.nodeType == 3)\n\t\t\t) {\n\t\t\t\tdom = value;\n\t\t\t\texcessDomChildren[i] = NULL;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (dom == NULL) {\n\t\tif (nodeType == NULL) {\n\t\t\treturn document.createTextNode(newProps);\n\t\t}\n\n\t\tdom = document.createElementNS(\n\t\t\tnamespace,\n\t\t\tnodeType,\n\t\t\tnewProps.is && newProps\n\t\t);\n\n\t\t// we are creating a new node, so we can assume this is a new subtree (in\n\t\t// case we are hydrating), this deopts the hydrate\n\t\tif (isHydrating) {\n\t\t\tif (options._hydrationMismatch)\n\t\t\t\toptions._hydrationMismatch(newVNode, excessDomChildren);\n\t\t\tisHydrating = false;\n\t\t}\n\t\t// we created a new parent, so none of the previously attached children can be reused:\n\t\texcessDomChildren = NULL;\n\t}\n\n\tif (nodeType == NULL) {\n\t\t// During hydration, we still have to split merged text from SSR'd HTML.\n\t\tif (oldProps !== newProps && (!isHydrating || dom.data != newProps)) {\n\t\t\tdom.data = newProps;\n\t\t}\n\t} else {\n\t\t// If excessDomChildren was not null, repopulate it with the current element's children:\n\t\texcessDomChildren = excessDomChildren && slice.call(dom.childNodes);\n\n\t\t// If we are in a situation where we are not hydrating but are using\n\t\t// existing DOM (e.g. replaceNode) we should read the existing DOM\n\t\t// attributes to diff them\n\t\tif (!isHydrating && excessDomChildren != NULL) {\n\t\t\toldProps = {};\n\t\t\tfor (i = 0; i < dom.attributes.length; i++) {\n\t\t\t\tvalue = dom.attributes[i];\n\t\t\t\toldProps[value.name] = value.value;\n\t\t\t}\n\t\t}\n\n\t\tfor (i in oldProps) {\n\t\t\tvalue = oldProps[i];\n\t\t\tif (i == 'dangerouslySetInnerHTML') {\n\t\t\t\toldHtml = value;\n\t\t\t} else if (\n\t\t\t\ti != 'children' &&\n\t\t\t\t!(i in newProps) &&\n\t\t\t\t!(i == 'value' && 'defaultValue' in newProps) &&\n\t\t\t\t!(i == 'checked' && 'defaultChecked' in newProps)\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, NULL, value, namespace);\n\t\t\t}\n\t\t}\n\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\n\t\t// @TODO we should warn in debug mode when props don't match here.\n\t\tfor (i in newProps) {\n\t\t\tvalue = newProps[i];\n\t\t\tif (i == 'children') {\n\t\t\t\tnewChildren = value;\n\t\t\t} else if (i == 'dangerouslySetInnerHTML') {\n\t\t\t\tnewHtml = value;\n\t\t\t} else if (i == 'value') {\n\t\t\t\tinputValue = value;\n\t\t\t} else if (i == 'checked') {\n\t\t\t\tchecked = value;\n\t\t\t} else if (\n\t\t\t\t(!isHydrating || typeof value == 'function') &&\n\t\t\t\toldProps[i] !== value\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, value, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\t\tif (\n\t\t\t\t!isHydrating &&\n\t\t\t\t(!oldHtml ||\n\t\t\t\t\t(newHtml.__html != oldHtml.__html && newHtml.__html != dom.innerHTML))\n\t\t\t) {\n\t\t\t\tdom.innerHTML = newHtml.__html;\n\t\t\t}\n\n\t\t\tnewVNode._children = [];\n\t\t} else {\n\t\t\tif (oldHtml) dom.innerHTML = '';\n\n\t\t\tdiffChildren(\n\t\t\t\t// @ts-expect-error\n\t\t\t\tnewVNode.type == 'template' ? dom.content : dom,\n\t\t\t\tisArray(newChildren) ? newChildren : [newChildren],\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnodeType == 'foreignObject' ? XHTML_NAMESPACE : namespace,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\texcessDomChildren\n\t\t\t\t\t? excessDomChildren[0]\n\t\t\t\t\t: oldVNode._children && getDomSibling(oldVNode, 0),\n\t\t\t\tisHydrating,\n\t\t\t\trefQueue\n\t\t\t);\n\n\t\t\t// Remove children that are not part of any vnode.\n\t\t\tif (excessDomChildren != NULL) {\n\t\t\t\tfor (i = excessDomChildren.length; i--; ) {\n\t\t\t\t\tremoveNode(excessDomChildren[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// As above, don't diff props during hydration\n\t\tif (!isHydrating) {\n\t\t\ti = 'value';\n\t\t\tif (nodeType == 'progress' && inputValue == NULL) {\n\t\t\t\tdom.removeAttribute('value');\n\t\t\t} else if (\n\t\t\t\tinputValue != UNDEFINED &&\n\t\t\t\t// #2756 For the <progress>-element the initial value is 0,\n\t\t\t\t// despite the attribute not being present. When the attribute\n\t\t\t\t// is missing the progress bar is treated as indeterminate.\n\t\t\t\t// To fix that we'll always update it when it is 0 for progress elements\n\t\t\t\t(inputValue !== dom[i] ||\n\t\t\t\t\t(nodeType == 'progress' && !inputValue) ||\n\t\t\t\t\t// This is only for IE 11 to fix <select> value not being updated.\n\t\t\t\t\t// To avoid a stale select value we need to set the option.value\n\t\t\t\t\t// again, which triggers IE11 to re-evaluate the select value\n\t\t\t\t\t(nodeType == 'option' && inputValue != oldProps[i]))\n\t\t\t) {\n\t\t\t\tsetProperty(dom, i, inputValue, oldProps[i], namespace);\n\t\t\t}\n\n\t\t\ti = 'checked';\n\t\t\tif (checked != UNDEFINED && checked != dom[i]) {\n\t\t\t\tsetProperty(dom, i, checked, oldProps[i], namespace);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {Ref<any> & { _unmount?: unknown }} ref\n * @param {any} value\n * @param {VNode} vnode\n */\nexport function applyRef(ref, value, vnode) {\n\ttry {\n\t\tif (typeof ref == 'function') {\n\t\t\tlet hasRefUnmount = typeof ref._unmount == 'function';\n\t\t\tif (hasRefUnmount) {\n\t\t\t\t// @ts-ignore TS doesn't like moving narrowing checks into variables\n\t\t\t\tref._unmount();\n\t\t\t}\n\n\t\t\tif (!hasRefUnmount || value != NULL) {\n\t\t\t\t// Store the cleanup function on the function\n\t\t\t\t// instance object itself to avoid shape\n\t\t\t\t// transitioning vnode\n\t\t\t\tref._unmount = ref(value);\n\t\t\t}\n\t\t} else ref.current = value;\n\t} catch (e) {\n\t\toptions._catchError(e, vnode);\n\t}\n}\n\n/**\n * Unmount a virtual node from the tree and apply DOM changes\n * @param {VNode} vnode The virtual node to unmount\n * @param {VNode} parentVNode The parent of the VNode that initiated the unmount\n * @param {boolean} [skipRemove] Flag that indicates that a parent node of the\n * current element is already detached from the DOM.\n */\nexport function unmount(vnode, parentVNode, skipRemove) {\n\tlet r;\n\tif (options.unmount) options.unmount(vnode);\n\n\tif ((r = vnode.ref)) {\n\t\tif (!r.current || r.current == vnode._dom) {\n\t\t\tapplyRef(r, NULL, parentVNode);\n\t\t}\n\t}\n\n\tif ((r = vnode._component) != NULL) {\n\t\tif (r.componentWillUnmount) {\n\t\t\ttry {\n\t\t\t\tr.componentWillUnmount();\n\t\t\t} catch (e) {\n\t\t\t\toptions._catchError(e, parentVNode);\n\t\t\t}\n\t\t}\n\n\t\tr.base = r._parentDom = NULL;\n\t}\n\n\tif ((r = vnode._children)) {\n\t\tfor (let i = 0; i < r.length; i++) {\n\t\t\tif (r[i]) {\n\t\t\t\tunmount(\n\t\t\t\t\tr[i],\n\t\t\t\t\tparentVNode,\n\t\t\t\t\tskipRemove || typeof vnode.type != 'function'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!skipRemove) {\n\t\tremoveNode(vnode._dom);\n\t}\n\n\tvnode._component = vnode._parent = vnode._dom = UNDEFINED;\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n","import { EMPTY_OBJ, NULL } from './constants';\nimport { commitRoot, diff } from './diff/index';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\nimport { slice } from './util';\n\n/**\n * Render a Preact virtual node into a DOM element\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to render into\n * @param {import('./internal').PreactElement | object} [replaceNode] Optional: Attempt to re-use an\n * existing DOM tree rooted at `replaceNode`\n */\nexport function render(vnode, parentDom, replaceNode) {\n\t// https://github.com/preactjs/preact/issues/3794\n\tif (parentDom == document) {\n\t\tparentDom = document.documentElement;\n\t}\n\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// We abuse the `replaceNode` parameter in `hydrate()` to signal if we are in\n\t// hydration mode or not by passing the `hydrate` function instead of a DOM\n\t// element..\n\tlet isHydrating = typeof replaceNode == 'function';\n\n\t// To be able to support calling `render()` multiple times on the same\n\t// DOM node, we need to obtain a reference to the previous tree. We do\n\t// this by assigning a new `_children` property to DOM nodes which points\n\t// to the last rendered tree. By default this property is not present, which\n\t// means that we are mounting a new tree for the first time.\n\tlet oldVNode = isHydrating\n\t\t? NULL\n\t\t: (replaceNode && replaceNode._children) || parentDom._children;\n\n\tvnode = ((!isHydrating && replaceNode) || parentDom)._children =\n\t\tcreateElement(Fragment, NULL, [vnode]);\n\n\t// List of effects that need to be called after diffing.\n\tlet commitQueue = [],\n\t\trefQueue = [];\n\tdiff(\n\t\tparentDom,\n\t\t// Determine the new vnode tree and store it on the DOM element on\n\t\t// our custom `_children` property.\n\t\tvnode,\n\t\toldVNode || EMPTY_OBJ,\n\t\tEMPTY_OBJ,\n\t\tparentDom.namespaceURI,\n\t\t!isHydrating && replaceNode\n\t\t\t? [replaceNode]\n\t\t\t: oldVNode\n\t\t\t\t? NULL\n\t\t\t\t: parentDom.firstChild\n\t\t\t\t\t? slice.call(parentDom.childNodes)\n\t\t\t\t\t: NULL,\n\t\tcommitQueue,\n\t\t!isHydrating && replaceNode\n\t\t\t? replaceNode\n\t\t\t: oldVNode\n\t\t\t\t? oldVNode._dom\n\t\t\t\t: parentDom.firstChild,\n\t\tisHydrating,\n\t\trefQueue\n\t);\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, vnode, refQueue);\n}\n\n/**\n * Update an existing DOM element with data from a Preact virtual node\n * @param {import('./internal').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to update\n */\nexport function hydrate(vnode, parentDom) {\n\trender(vnode, parentDom, hydrate);\n}\n","import { assign, slice } from './util';\nimport { createVNode } from './create-element';\nimport { NULL, UNDEFINED } from './constants';\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its\n * children.\n * @param {import('./internal').VNode} vnode The virtual DOM element to clone\n * @param {object} props Attributes/props to add when cloning\n * @param {Array<import('./internal').ComponentChildren>} rest Any additional arguments will be used\n * as replacement children.\n * @returns {import('./internal').VNode}\n */\nexport function cloneElement(vnode, props, children) {\n\tlet normalizedProps = assign({}, vnode.props),\n\t\tkey,\n\t\tref,\n\t\ti;\n\n\tlet defaultProps;\n\n\tif (vnode.type && vnode.type.defaultProps) {\n\t\tdefaultProps = vnode.type.defaultProps;\n\t}\n\n\tfor (i in props) {\n\t\tif (i == 'key') key = props[i];\n\t\telse if (i == 'ref') ref = props[i];\n\t\telse if (props[i] === UNDEFINED && defaultProps != UNDEFINED) {\n\t\t\tnormalizedProps[i] = defaultProps[i];\n\t\t} else {\n\t\t\tnormalizedProps[i] = props[i];\n\t\t}\n\t}\n\n\tif (arguments.length > 2) {\n\t\tnormalizedProps.children =\n\t\t\targuments.length > 3 ? slice.call(arguments, 2) : children;\n\t}\n\n\treturn createVNode(\n\t\tvnode.type,\n\t\tnormalizedProps,\n\t\tkey || vnode.key,\n\t\tref || vnode.ref,\n\t\tNULL\n\t);\n}\n","import { NULL } from '../constants';\n\n/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {import('../internal').VNode} vnode The vnode that threw the error that was caught (except\n * for unmounting when this parameter is the highest parent that was being\n * unmounted)\n * @param {import('../internal').VNode} [oldVNode]\n * @param {import('../internal').ErrorInfo} [errorInfo]\n */\nexport function _catchError(error, vnode, oldVNode, errorInfo) {\n\t/** @type {import('../internal').Component} */\n\tlet component,\n\t\t/** @type {import('../internal').ComponentType} */\n\t\tctor,\n\t\t/** @type {boolean} */\n\t\thandled;\n\n\tfor (; (vnode = vnode._parent); ) {\n\t\tif ((component = vnode._component) && !component._processingException) {\n\t\t\ttry {\n\t\t\t\tctor = component.constructor;\n\n\t\t\t\tif (ctor && ctor.getDerivedStateFromError != NULL) {\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\tif (component.componentDidCatch != NULL) {\n\t\t\t\t\tcomponent.componentDidCatch(error, errorInfo || {});\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\t// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.\n\t\t\t\tif (handled) {\n\t\t\t\t\treturn (component._pendingError = component);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow error;\n}\n","import { options as _options } from 'preact';\n\n/** @type {number} */\nlet currentIndex;\n\n/** @type {import('./internal').Component} */\nlet currentComponent;\n\n/** @type {import('./internal').Component} */\nlet previousComponent;\n\n/** @type {number} */\nlet currentHook = 0;\n\n/** @type {Array<import('./internal').Component>} */\nlet afterPaintEffects = [];\n\n// Cast to use internal Options type\nconst options = /** @type {import('./internal').Options} */ (_options);\n\nlet oldBeforeDiff = options._diff;\nlet oldBeforeRender = options._render;\nlet oldAfterDiff = options.diffed;\nlet oldCommit = options._commit;\nlet oldBeforeUnmount = options.unmount;\nlet oldRoot = options._root;\n\n// We take the minimum timeout for requestAnimationFrame to ensure that\n// the callback is invoked after the next frame. 35ms is based on a 30hz\n// refresh rate, which is the minimum rate for a smooth user experience.\nconst RAF_TIMEOUT = 35;\nlet prevRaf;\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions._diff = vnode => {\n\tcurrentComponent = null;\n\tif (oldBeforeDiff) oldBeforeDiff(vnode);\n};\n\noptions._root = (vnode, parentDom) => {\n\tif (vnode && parentDom._children && parentDom._children._mask) {\n\t\tvnode._mask = parentDom._children._mask;\n\t}\n\n\tif (oldRoot) oldRoot(vnode, parentDom);\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions._render = vnode => {\n\tif (oldBeforeRender) oldBeforeRender(vnode);\n\n\tcurrentComponent = vnode._component;\n\tcurrentIndex = 0;\n\n\tconst hooks = currentComponent.__hooks;\n\tif (hooks) {\n\t\tif (previousComponent === currentComponent) {\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentComponent._renderCallbacks = [];\n\t\t\thooks._list.some(hookItem => {\n\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t}\n\t\t\t\thookItem._pendingArgs = hookItem._nextValue = undefined;\n\t\t\t});\n\t\t} else {\n\t\t\thooks._pendingEffects.some(invokeCleanup);\n\t\t\thooks._pendingEffects.some(invokeEffect);\n\t\t\thooks._pendingEffects = [];\n\t\t\tcurrentIndex = 0;\n\t\t}\n\t}\n\tpreviousComponent = currentComponent;\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.diffed = vnode => {\n\tif (oldAfterDiff) oldAfterDiff(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tif (c.__hooks._pendingEffects.length) afterPaint(afterPaintEffects.push(c));\n\t\tc.__hooks._list.some(hookItem => {\n\t\t\tif (hookItem._pendingArgs) {\n\t\t\t\thookItem._args = hookItem._pendingArgs;\n\t\t\t}\n\t\t\thookItem._pendingArgs = undefined;\n\t\t});\n\t}\n\tpreviousComponent = currentComponent = null;\n};\n\n// TODO: Improve typing of commitQueue parameter\n/** @type {(vnode: import('./internal').VNode, commitQueue: any) => void} */\noptions._commit = (vnode, commitQueue) => {\n\tcommitQueue.some(component => {\n\t\ttry {\n\t\t\tcomponent._renderCallbacks.some(invokeCleanup);\n\t\t\tcomponent._renderCallbacks = component._renderCallbacks.filter(cb =>\n\t\t\t\tcb._value ? invokeEffect(cb) : true\n\t\t\t);\n\t\t} catch (e) {\n\t\t\tcommitQueue.some(c => {\n\t\t\t\tif (c._renderCallbacks) c._renderCallbacks = [];\n\t\t\t});\n\t\t\tcommitQueue = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t});\n\n\tif (oldCommit) oldCommit(vnode, commitQueue);\n};\n\n/** @type {(vnode: import('./internal').VNode) => void} */\noptions.unmount = vnode => {\n\tif (oldBeforeUnmount) oldBeforeUnmount(vnode);\n\n\tconst c = vnode._component;\n\tif (c && c.__hooks) {\n\t\tlet hasErrored;\n\t\tc.__hooks._list.some(s => {\n\t\t\ttry {\n\t\t\t\tinvokeCleanup(s);\n\t\t\t} catch (e) {\n\t\t\t\thasErrored = e;\n\t\t\t}\n\t\t});\n\t\tc.__hooks = undefined;\n\t\tif (hasErrored) options._catchError(hasErrored, c._vnode);\n\t}\n};\n\n/**\n * Get a hook's state from the currentComponent\n * @param {number} index The index of the hook to get\n * @param {number} type The index of the hook to get\n * @returns {any}\n */\nfunction getHookState(index, type) {\n\tif (options._hook) {\n\t\toptions._hook(currentComponent, index, currentHook || type);\n\t}\n\tcurrentHook = 0;\n\n\t// Largely inspired by:\n\t// * https://github.com/michael-klein/funcy.js/blob/f6be73468e6ec46b0ff5aa3cc4c9baf72a29025a/src/hooks/core_hooks.mjs\n\t// * https://github.com/michael-klein/funcy.js/blob/650beaa58c43c33a74820a3c98b3c7079cf2e333/src/renderer.mjs\n\t// Other implementations to look at:\n\t// * https://codesandbox.io/s/mnox05qp8\n\tconst hooks =\n\t\tcurrentComponent.__hooks ||\n\t\t(currentComponent.__hooks = {\n\t\t\t_list: [],\n\t\t\t_pendingEffects: []\n\t\t});\n\n\tif (index >= hooks._list.length) {\n\t\thooks._list.push({});\n\t}\n\n\treturn hooks._list[index];\n}\n\n/**\n * @template {unknown} S\n * @param {import('./index').Dispatch<import('./index').StateUpdater<S>>} [initialState]\n * @returns {[S, (state: S) => void]}\n */\nexport function useState(initialState) {\n\tcurrentHook = 1;\n\treturn useReducer(invokeOrReturn, initialState);\n}\n\n/**\n * @template {unknown} S\n * @template {unknown} A\n * @param {import('./index').Reducer<S, A>} reducer\n * @param {import('./index').Dispatch<import('./index').StateUpdater<S>>} initialState\n * @param {(initialState: any) => void} [init]\n * @returns {[ S, (state: S) => void ]}\n */\nexport function useReducer(reducer, initialState, init) {\n\t/** @type {import('./internal').ReducerHookState} */\n\tconst hookState = getHookState(currentIndex++, 2);\n\thookState._reducer = reducer;\n\tif (!hookState._component) {\n\t\thookState._value = [\n\t\t\t!init ? invokeOrReturn(undefined, initialState) : init(initialState),\n\n\t\t\taction => {\n\t\t\t\tconst currentValue = hookState._nextValue\n\t\t\t\t\t? hookState._nextValue[0]\n\t\t\t\t\t: hookState._value[0];\n\t\t\t\tconst nextValue = hookState._reducer(currentValue, action);\n\n\t\t\t\tif (currentValue !== nextValue) {\n\t\t\t\t\thookState._nextValue = [nextValue, hookState._value[1]];\n\t\t\t\t\thookState._component.setState({});\n\t\t\t\t}\n\t\t\t}\n\t\t];\n\n\t\thookState._component = currentComponent;\n\n\t\tif (!currentComponent._hasScuFromHooks) {\n\t\t\tcurrentComponent._hasScuFromHooks = true;\n\t\t\tlet prevScu = currentComponent.shouldComponentUpdate;\n\t\t\tconst prevCWU = currentComponent.componentWillUpdate;\n\n\t\t\t// If we're dealing with a forced update `shouldComponentUpdate` will\n\t\t\t// not be called. But we use that to update the hook values, so we\n\t\t\t// need to call it.\n\t\t\tcurrentComponent.componentWillUpdate = function (p, s, c) {\n\t\t\t\tif (this._force) {\n\t\t\t\t\tlet tmp = prevScu;\n\t\t\t\t\t// Clear to avoid other sCU hooks from being called\n\t\t\t\t\tprevScu = undefined;\n\t\t\t\t\tupdateHookState(p, s, c);\n\t\t\t\t\tprevScu = tmp;\n\t\t\t\t}\n\n\t\t\t\tif (prevCWU) prevCWU.call(this, p, s, c);\n\t\t\t};\n\n\t\t\t// This SCU has the purpose of bailing out after repeated updates\n\t\t\t// to stateful hooks.\n\t\t\t// we store the next value in _nextValue[0] and keep doing that for all\n\t\t\t// state setters, if we have next states and\n\t\t\t// all next states within a component end up being equal to their original state\n\t\t\t// we are safe to bail out for this specific component.\n\t\t\t/**\n\t\t\t *\n\t\t\t * @type {import('./internal').Component[\"shouldComponentUpdate\"]}\n\t\t\t */\n\t\t\t// @ts-ignore - We don't use TS to downtranspile\n\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\tfunction updateHookState(p, s, c) {\n\t\t\t\tif (!hookState._component.__hooks) return true;\n\n\t\t\t\tconst stateHooks = hookState._component.__hooks._list.filter(\n\t\t\t\t\tx => x._component\n\t\t\t\t);\n\n\t\t\t\tconst allHooksEmpty = stateHooks.every(x => !x._nextValue);\n\t\t\t\t// When we have no updated hooks in the component we invoke the previous SCU or\n\t\t\t\t// traverse the VDOM tree further.\n\t\t\t\tif (allHooksEmpty) {\n\t\t\t\t\treturn prevScu ? prevScu.call(this, p, s, c) : true;\n\t\t\t\t}\n\n\t\t\t\t// We check whether we have components with a nextValue set that\n\t\t\t\t// have values that aren't equal to one another this pushes\n\t\t\t\t// us to update further down the tree\n\t\t\t\tlet shouldUpdate = hookState._component.props !== p;\n\t\t\t\tstateHooks.some(hookItem => {\n\t\t\t\t\tif (hookItem._nextValue) {\n\t\t\t\t\t\tconst currentValue = hookItem._value[0];\n\t\t\t\t\t\thookItem._value = hookItem._nextValue;\n\t\t\t\t\t\thookItem._nextValue = undefined;\n\t\t\t\t\t\tif (currentValue !== hookItem._value[0]) shouldUpdate = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn prevScu\n\t\t\t\t\t? prevScu.call(this, p, s, c) || shouldUpdate\n\t\t\t\t\t: shouldUpdate;\n\t\t\t}\n\n\t\t\tcurrentComponent.shouldComponentUpdate = updateHookState;\n\t\t}\n\t}\n\n\treturn hookState._nextValue || hookState._value;\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 3);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent.__hooks._pendingEffects.push(state);\n\t}\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useLayoutEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 4);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._pendingArgs = args;\n\n\t\tcurrentComponent._renderCallbacks.push(state);\n\t}\n}\n\n/** @type {(initialValue: unknown) => unknown} */\nexport function useRef(initialValue) {\n\tcurrentHook = 5;\n\treturn useMemo(() => ({ current: initialValue }), []);\n}\n\n/**\n * @param {object} ref\n * @param {() => object} createHandle\n * @param {unknown[]} args\n * @returns {void}\n */\nexport function useImperativeHandle(ref, createHandle, args) {\n\tcurrentHook = 6;\n\tuseLayoutEffect(\n\t\t() => {\n\t\t\tif (typeof ref == 'function') {\n\t\t\t\tconst result = ref(createHandle());\n\t\t\t\treturn () => {\n\t\t\t\t\tref(null);\n\t\t\t\t\tif (result && typeof result == 'function') result();\n\t\t\t\t};\n\t\t\t} else if (ref) {\n\t\t\t\tref.current = createHandle();\n\t\t\t\treturn () => (ref.current = null);\n\t\t\t}\n\t\t},\n\t\targs == null ? args : args.concat(ref)\n\t);\n}\n\n/**\n * @template {unknown} T\n * @param {() => T} factory\n * @param {unknown[]} args\n * @returns {T}\n */\nexport function useMemo(factory, args) {\n\t/** @type {import('./internal').MemoHookState<T>} */\n\tconst state = getHookState(currentIndex++, 7);\n\tif (argsChanged(state._args, args)) {\n\t\tstate._value = factory();\n\t\tstate._args = args;\n\t\tstate._factory = factory;\n\t}\n\n\treturn state._value;\n}\n\n/**\n * @param {() => void} callback\n * @param {unknown[]} args\n * @returns {() => void}\n */\nexport function useCallback(callback, args) {\n\tcurrentHook = 8;\n\treturn useMemo(() => callback, args);\n}\n\n/**\n * @param {import('./internal').PreactContext} context\n */\nexport function useContext(context) {\n\tconst provider = currentComponent.context[context._id];\n\t// We could skip this call here, but than we'd not call\n\t// `options._hook`. We need to do that in order to make\n\t// the devtools aware of this hook.\n\t/** @type {import('./internal').ContextHookState} */\n\tconst state = getHookState(currentIndex++, 9);\n\t// The devtools needs access to the context object to\n\t// be able to pull of the default value when no provider\n\t// is present in the tree.\n\tstate._context = context;\n\tif (!provider) return context._defaultValue;\n\t// This is probably not safe to convert to \"!\"\n\tif (state._value == null) {\n\t\tstate._value = true;\n\t\tprovider.sub(currentComponent);\n\t}\n\treturn provider.props.value;\n}\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {<T>(value: T, cb?: (value: T) => string | number) => void}\n */\nexport function useDebugValue(value, formatter) {\n\tif (options.useDebugValue) {\n\t\toptions.useDebugValue(\n\t\t\tformatter ? formatter(value) : /** @type {any}*/ (value)\n\t\t);\n\t}\n}\n\n/**\n * @param {(error: unknown, errorInfo: import('preact').ErrorInfo) => void} cb\n * @returns {[unknown, () => void]}\n */\nexport function useErrorBoundary(cb) {\n\t/** @type {import('./internal').ErrorBoundaryHookState} */\n\tconst state = getHookState(currentIndex++, 10);\n\tconst errState = useState();\n\tstate._value = cb;\n\tif (!currentComponent.componentDidCatch) {\n\t\tcurrentComponent.componentDidCatch = (err, errorInfo) => {\n\t\t\tif (state._value) state._value(err, errorInfo);\n\t\t\terrState[1](err);\n\t\t};\n\t}\n\treturn [\n\t\terrState[0],\n\t\t() => {\n\t\t\terrState[1](undefined);\n\t\t}\n\t];\n}\n\n/** @type {() => string} */\nexport function useId() {\n\t/** @type {import('./internal').IdHookState} */\n\tconst state = getHookState(currentIndex++, 11);\n\tif (!state._value) {\n\t\t// Grab either the root node or the nearest async boundary node.\n\t\t/** @type {import('./internal').VNode} */\n\t\tlet root = currentComponent._vnode;\n\t\twhile (root !== null && !root._mask && root._parent !== null) {\n\t\t\troot = root._parent;\n\t\t}\n\n\t\tlet mask = root._mask || (root._mask = [0, 0]);\n\t\tstate._value = 'P' + mask[0] + '-' + mask[1]++;\n\t}\n\n\treturn state._value;\n}\n\n/**\n * After paint effects consumer.\n */\nfunction flushAfterPaintEffects() {\n\tlet component;\n\twhile ((component = afterPaintEffects.shift())) {\n\t\tconst hooks = component.__hooks;\n\t\tif (!component._parentDom || !hooks) continue;\n\t\ttry {\n\t\t\thooks._pendingEffects.some(invokeCleanup);\n\t\t\thooks._pendingEffects.some(invokeEffect);\n\t\t\thooks._pendingEffects = [];\n\t\t} catch (e) {\n\t\t\thooks._pendingEffects = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t}\n}\n\nlet HAS_RAF = typeof requestAnimationFrame == 'function';\n\n/**\n * Schedule a callback to be invoked after the browser has a chance to paint a new frame.\n * Do this by combining requestAnimationFrame (rAF) + setTimeout to invoke a callback after\n * the next browser frame.\n *\n * Also, schedule a timeout in parallel to the the rAF to ensure the callback is invoked\n * even if RAF doesn't fire (for example if the browser tab is not visible)\n *\n * @param {() => void} callback\n */\nfunction afterNextFrame(callback) {\n\tconst done = () => {\n\t\tclearTimeout(timeout);\n\t\tif (HAS_RAF) cancelAnimationFrame(raf);\n\t\tsetTimeout(callback);\n\t};\n\tconst timeout = setTimeout(done, RAF_TIMEOUT);\n\n\tlet raf;\n\tif (HAS_RAF) {\n\t\traf = requestAnimationFrame(done);\n\t}\n}\n\n// Note: if someone used options.debounceRendering = requestAnimationFrame,\n// then effects will ALWAYS run on the NEXT frame instead of the current one, incurring a ~16ms delay.\n// Perhaps this is not such a big deal.\n/**\n * Schedule afterPaintEffects flush after the browser paints\n * @param {number} newQueueLength\n * @returns {void}\n */\nfunction afterPaint(newQueueLength) {\n\tif (newQueueLength === 1 || prevRaf !== options.requestAnimationFrame) {\n\t\tprevRaf = options.requestAnimationFrame;\n\t\t(prevRaf || afterNextFrame)(flushAfterPaintEffects);\n\t}\n}\n\n/**\n * @param {import('./internal').HookState} hook\n * @returns {void}\n */\nfunction invokeCleanup(hook) {\n\t// A hook cleanup can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\tlet cleanup = hook._cleanup;\n\tif (typeof cleanup == 'function') {\n\t\thook._cleanup = undefined;\n\t\tcleanup();\n\t}\n\n\tcurrentComponent = comp;\n}\n\n/**\n * Invoke a Hook's effect\n * @param {import('./internal').EffectHookState} hook\n * @returns {void}\n */\nfunction invokeEffect(hook) {\n\t// A hook call can introduce a call to render which creates a new root, this will call options.vnode\n\t// and move the currentComponent away.\n\tconst comp = currentComponent;\n\thook._cleanup = hook._value();\n\tcurrentComponent = comp;\n}\n\n/**\n * @param {unknown[]} oldArgs\n * @param {unknown[]} newArgs\n * @returns {boolean}\n */\nfunction argsChanged(oldArgs, newArgs) {\n\treturn (\n\t\t!oldArgs ||\n\t\toldArgs.length !== newArgs.length ||\n\t\tnewArgs.some((arg, index) => arg !== oldArgs[index])\n\t);\n}\n\n/**\n * @template Arg\n * @param {Arg} arg\n * @param {(arg: Arg) => any} f\n * @returns {any}\n */\nfunction invokeOrReturn(arg, f) {\n\treturn typeof f == 'function' ? f(arg) : f;\n}\n","const ENCODED_ENTITIES = /[\"&<]/;\n\n/** @param {string} str */\nexport function encodeEntities(str) {\n\t// Skip all work for strings with no entities needing encoding:\n\tif (str.length === 0 || ENCODED_ENTITIES.test(str) === false) return str;\n\n\tlet last = 0,\n\t\ti = 0,\n\t\tout = '',\n\t\tch = '';\n\n\t// Seek forward in str until the next entity char:\n\tfor (; i < str.length; i++) {\n\t\tswitch (str.charCodeAt(i)) {\n\t\t\tcase 34:\n\t\t\t\tch = '&quot;';\n\t\t\t\tbreak;\n\t\t\tcase 38:\n\t\t\t\tch = '&amp;';\n\t\t\t\tbreak;\n\t\t\tcase 60:\n\t\t\t\tch = '&lt;';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tcontinue;\n\t\t}\n\t\t// Append skipped/buffered characters and the encoded entity:\n\t\tif (i !== last) out += str.slice(last, i);\n\t\tout += ch;\n\t\t// Start the next seek/buffer after the entity's offset:\n\t\tlast = i + 1;\n\t}\n\tif (i !== last) out += str.slice(last, i);\n\treturn out;\n}\n","/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 2;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 1;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nexport const XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nexport const MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n\nexport const NULL = null;\nexport const UNDEFINED = undefined;\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL =\n\t/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n","import { options, Fragment } from 'preact';\nimport { encodeEntities } from './utils';\nimport { IS_NON_DIMENSIONAL } from '../../src/constants';\n\nlet vnodeId = 0;\n\nconst isArray = Array.isArray;\n\n/**\n * @fileoverview\n * This file exports various methods that implement Babel's \"automatic\" JSX runtime API:\n * - jsx(type, props, key)\n * - jsxs(type, props, key)\n * - jsxDEV(type, props, key, __source, __self)\n *\n * The implementation of createVNode here is optimized for performance.\n * Benchmarks: https://esbench.com/bench/5f6b54a0b4632100a7dcd2b3\n */\n\n/**\n * JSX.Element factory used by Babel's {runtime:\"automatic\"} JSX transform\n * @param {VNode['type']} type\n * @param {VNode['props']} props\n * @param {VNode['key']} [key]\n * @param {unknown} [isStaticChildren]\n * @param {unknown} [__source]\n * @param {unknown} [__self]\n */\nfunction createVNode(type, props, key, isStaticChildren, __source, __self) {\n\tif (!props) props = {};\n\t// We'll want to preserve `ref` in props to get rid of the need for\n\t// forwardRef components in the future, but that should happen via\n\t// a separate PR.\n\tlet normalizedProps = props,\n\t\tref,\n\t\ti;\n\n\tif ('ref' in normalizedProps) {\n\t\tnormalizedProps = {};\n\t\tfor (i in props) {\n\t\t\tif (i == 'ref') {\n\t\t\t\tref = props[i];\n\t\t\t} else {\n\t\t\t\tnormalizedProps[i] = props[i];\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @type {VNode & { __source: any; __self: any }} */\n\tconst vnode = {\n\t\ttype,\n\t\tprops: normalizedProps,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t_component: null,\n\t\tconstructor: undefined,\n\t\t_original: --vnodeId,\n\t\t_index: -1,\n\t\t_flags: 0,\n\t\t__source,\n\t\t__self\n\t};\n\n\t// If a Component VNode, check for and apply defaultProps.\n\t// Note: `type` is often a String, and can be `undefined` in development.\n\tif (typeof type === 'function' && (ref = type.defaultProps)) {\n\t\tfor (i in ref)\n\t\t\tif (normalizedProps[i] === undefined) {\n\t\t\t\tnormalizedProps[i] = ref[i];\n\t\t\t}\n\t}\n\n\tif (options.vnode) options.vnode(vnode);\n\treturn vnode;\n}\n\n/**\n * Create a template vnode. This function is not expected to be\n * used directly, but rather through a precompile JSX transform\n * @param {string[]} templates\n * @param {Array<string | null | VNode>} exprs\n * @returns {VNode}\n */\nfunction jsxTemplate(templates, ...exprs) {\n\tconst vnode = createVNode(Fragment, { tpl: templates, exprs });\n\t// Bypass render to string top level Fragment optimization\n\tvnode.key = vnode._vnode;\n\treturn vnode;\n}\n\nconst JS_TO_CSS = {};\nconst CSS_REGEX = /[A-Z]/g;\n\n/**\n * Unwrap potential signals.\n * @param {*} value\n * @returns {*}\n */\nfunction normalizeAttrValue(value) {\n\treturn value !== null &&\n\t\ttypeof value === 'object' &&\n\t\ttypeof value.valueOf === 'function'\n\t\t? value.valueOf()\n\t\t: value;\n}\n\n/**\n * Serialize an HTML attribute to a string. This function is not\n * expected to be used directly, but rather through a precompile\n * JSX transform\n * @param {string} name The attribute name\n * @param {*} value The attribute value\n * @returns {string}\n */\nfunction jsxAttr(name, value) {\n\tif (options.attr) {\n\t\tconst result = options.attr(name, value);\n\t\tif (typeof result === 'string') return result;\n\t}\n\n\tvalue = normalizeAttrValue(value);\n\n\tif (name === 'ref' || name === 'key') return '';\n\tif (name === 'style' && typeof value === 'object') {\n\t\tlet str = '';\n\t\tfor (let prop in value) {\n\t\t\tlet val = value[prop];\n\t\t\tif (val != null && val !== '') {\n\t\t\t\tconst name =\n\t\t\t\t\tprop[0] == '-'\n\t\t\t\t\t\t? prop\n\t\t\t\t\t\t: JS_TO_CSS[prop] ||\n\t\t\t\t\t\t\t(JS_TO_CSS[prop] = prop.replace(CSS_REGEX, '-$&').toLowerCase());\n\n\t\t\t\tlet suffix = ';';\n\t\t\t\tif (\n\t\t\t\t\ttypeof val === 'number' &&\n\t\t\t\t\t// Exclude custom-attributes\n\t\t\t\t\t!name.startsWith('--') &&\n\t\t\t\t\t!IS_NON_DIMENSIONAL.test(name)\n\t\t\t\t) {\n\t\t\t\t\tsuffix = 'px;';\n\t\t\t\t}\n\t\t\t\tstr = str + name + ':' + val + suffix;\n\t\t\t}\n\t\t}\n\t\treturn name + '=\"' + encodeEntities(str) + '\"';\n\t}\n\n\tif (\n\t\tvalue == null ||\n\t\tvalue === false ||\n\t\ttypeof value === 'function' ||\n\t\ttypeof value === 'object'\n\t) {\n\t\treturn '';\n\t} else if (value === true) return name;\n\n\treturn name + '=\"' + encodeEntities('' + value) + '\"';\n}\n\n/**\n * Escape a dynamic child passed to `jsxTemplate`. This function\n * is not expected to be used directly, but rather through a\n * precompile JSX transform\n * @param {*} value\n * @returns {string | null | VNode | Array<string | null | VNode>}\n */\nfunction jsxEscape(value) {\n\tif (\n\t\tvalue == null ||\n\t\ttypeof value === 'boolean' ||\n\t\ttypeof value === 'function'\n\t) {\n\t\treturn null;\n\t}\n\n\tif (typeof value === 'object') {\n\t\t// Check for VNode\n\t\tif (value.constructor === undefined) return value;\n\n\t\tif (isArray(value)) {\n\t\t\tfor (let i = 0; i < value.length; i++) {\n\t\t\t\tvalue[i] = jsxEscape(value[i]);\n\t\t\t}\n\t\t\treturn value;\n\t\t}\n\t}\n\n\treturn encodeEntities('' + value);\n}\n\nexport {\n\tcreateVNode as jsx,\n\tcreateVNode as jsxs,\n\tcreateVNode as jsxDEV,\n\tFragment,\n\t// precompiled JSX transform\n\tjsxTemplate,\n\tjsxAttr,\n\tjsxEscape\n};\n","import { h } from 'preact'\n\ninterface FabProps {\n label: string\n onClick: () => void\n}\n\nexport function Fab({ label, onClick }: FabProps) {\n return (\n <button type=\"button\" class=\"fab\" aria-label={label} onClick={onClick}>\n 💬\n </button>\n )\n}\n","import { h } from 'preact'\nimport { useState } from 'preact/hooks'\n\nimport type { FeedbackSeverity, FeedbackType } from '../types'\nimport type { StringKey } from './i18n'\n\nexport type FormStatus = 'idle' | 'submitting' | 'error' | 'success'\n\nexport interface FormValues {\n description: string\n feedback_type: FeedbackType\n severity: FeedbackSeverity\n}\n\ninterface FormProps {\n strings: Record<StringKey, string>\n onSubmit: (values: FormValues) => void\n onCancel: () => void\n status: FormStatus\n errorMessage?: string\n}\n\nconst TYPES: FeedbackType[] = ['bug', 'feature', 'question', 'praise', 'typo']\nconst SEVERITIES: FeedbackSeverity[] = ['blocker', 'high', 'medium', 'low']\n\nexport function Form({ strings, onSubmit, onCancel, status, errorMessage }: FormProps) {\n const [description, setDescription] = useState('')\n const [feedbackType, setFeedbackType] = useState<FeedbackType>('bug')\n const [severity, setSeverity] = useState<FeedbackSeverity>('medium')\n const [localError, setLocalError] = useState('')\n\n const submitting = status === 'submitting'\n const submitLabel = submitting ? strings['form.submitting'] : strings['form.submit']\n\n const handleSubmit = (e: Event) => {\n e.preventDefault()\n if (!description.trim()) {\n setLocalError(strings['form.description.placeholder'])\n return\n }\n setLocalError('')\n onSubmit({ description: description.trim(), feedback_type: feedbackType, severity })\n }\n\n return (\n <form onSubmit={handleSubmit}>\n <h2>{strings['form.title']}</h2>\n\n <div class=\"field\">\n <label for=\"mfb-desc\">{strings['form.description.label']}</label>\n <textarea\n id=\"mfb-desc\"\n value={description}\n placeholder={strings['form.description.placeholder']}\n onInput={(e) => setDescription((e.target as HTMLTextAreaElement).value)}\n />\n </div>\n\n <div class=\"row\">\n <div class=\"field\">\n <label for=\"mfb-type\">{strings['form.type.label']}</label>\n <select\n id=\"mfb-type\"\n value={feedbackType}\n onChange={(e) => setFeedbackType((e.target as HTMLSelectElement).value as FeedbackType)}\n >\n {TYPES.map((t) => <option value={t}>{strings[`type.${t}` as StringKey]}</option>)}\n </select>\n </div>\n <div class=\"field\">\n <label for=\"mfb-sev\">{strings['form.severity.label']}</label>\n <select\n id=\"mfb-sev\"\n value={severity}\n onChange={(e) => setSeverity((e.target as HTMLSelectElement).value as FeedbackSeverity)}\n >\n {SEVERITIES.map((s) => <option value={s}>{strings[`severity.${s}` as StringKey]}</option>)}\n </select>\n </div>\n </div>\n\n {localError && <div class=\"error\">{localError}</div>}\n {status === 'error' && errorMessage && <div class=\"error\">{errorMessage}</div>}\n {status === 'success' && <div class=\"success\">{strings['form.success']}</div>}\n\n <div class=\"actions\">\n <button type=\"button\" class=\"btn\" onClick={onCancel} disabled={submitting}>{strings['form.cancel']}</button>\n <button type=\"submit\" class=\"btn btn--primary\" disabled={submitting}>{submitLabel}</button>\n </div>\n </form>\n )\n}\n","import { h, type ComponentChildren } from 'preact'\n\ninterface ModalProps {\n onDismiss: () => void\n children: ComponentChildren\n}\n\nexport function Modal({ onDismiss, children }: ModalProps) {\n return (\n <div\n class=\"backdrop\"\n role=\"presentation\"\n onClick={(e) => { if (e.target === e.currentTarget) onDismiss() }}\n >\n <div class=\"modal\" role=\"dialog\" aria-modal=\"true\">{children}</div>\n </div>\n )\n}\n","export const WIDGET_STYLES = `\n:host {\n --mfb-accent: #3b82f6;\n --mfb-accent-contrast: #ffffff;\n --mfb-bg: #ffffff;\n --mfb-surface: #f9fafb;\n --mfb-text: #0a0a0a;\n --mfb-text-muted: #6b7280;\n --mfb-border: #e5e7eb;\n --mfb-radius: 8px;\n --mfb-font: system-ui, -apple-system, sans-serif;\n --mfb-z-index: 2147483640;\n\n all: initial;\n font-family: var(--mfb-font);\n color: var(--mfb-text);\n position: fixed;\n z-index: var(--mfb-z-index);\n}\n\n@media (prefers-color-scheme: dark) {\n :host {\n --mfb-bg: #111827;\n --mfb-surface: #1f2937;\n --mfb-text: #f9fafb;\n --mfb-text-muted: #9ca3af;\n --mfb-border: #374151;\n }\n}\n\n.fab {\n position: fixed;\n bottom: 24px;\n right: 24px;\n width: 52px;\n height: 52px;\n border-radius: 999px;\n background: var(--mfb-accent);\n color: var(--mfb-accent-contrast);\n border: none;\n cursor: pointer;\n box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);\n font-size: 22px;\n display: grid;\n place-items: center;\n}\n\n.fab:focus-visible { outline: 2px solid var(--mfb-accent); outline-offset: 2px; }\n\n.backdrop {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.45);\n display: grid;\n place-items: center;\n}\n\n.modal {\n background: var(--mfb-bg);\n border-radius: calc(var(--mfb-radius) * 1.5);\n box-shadow: 0 20px 48px rgba(0, 0, 0, 0.25);\n width: min(420px, 92vw);\n padding: 20px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\n.modal h2 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }\n\n.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }\n\n.field label { color: var(--mfb-text-muted); }\n\n.field input, .field select, .field textarea {\n font-family: inherit;\n font-size: 14px;\n color: inherit;\n padding: 8px 10px;\n border: 1px solid var(--mfb-border);\n border-radius: var(--mfb-radius);\n background: var(--mfb-surface);\n}\n\n.field textarea { min-height: 88px; resize: vertical; }\n\n.row { display: flex; gap: 8px; }\n.row > * { flex: 1; }\n\n.actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 8px; }\n\n.btn {\n padding: 8px 14px;\n border-radius: var(--mfb-radius);\n border: 1px solid var(--mfb-border);\n background: var(--mfb-bg);\n color: var(--mfb-text);\n font: inherit;\n cursor: pointer;\n}\n\n.btn--primary {\n background: var(--mfb-accent);\n color: var(--mfb-accent-contrast);\n border-color: var(--mfb-accent);\n}\n\n.btn[disabled] { opacity: 0.6; cursor: not-allowed; }\n\n.error { color: #dc2626; font-size: 13px; }\n.success { color: #059669; font-size: 13px; }\n`\n","import { h, render } from 'preact'\nimport { useCallback, useState } from 'preact/hooks'\n\nimport { Fab } from './Fab'\nimport { Form, type FormValues } from './Form'\nimport { Modal } from './Modal'\nimport { WIDGET_STYLES } from './styles'\nimport type { StringKey } from './i18n'\n\nexport interface MountOptions {\n host: HTMLElement\n strings: Record<StringKey, string>\n showFAB: boolean\n onSubmit: (values: FormValues) => Promise<void>\n}\n\nexport interface MountHandle {\n open(): void\n close(): void\n dispose(): void\n}\n\ntype State = { open: boolean; status: 'idle' | 'submitting' | 'error' | 'success'; error?: string }\n\nexport function mountWidget(options: MountOptions): MountHandle {\n const shadow = options.host.attachShadow({ mode: 'open' })\n const style = document.createElement('style')\n style.textContent = WIDGET_STYLES\n shadow.appendChild(style)\n const mountPoint = document.createElement('div')\n shadow.appendChild(mountPoint)\n\n let currentState: State = { open: false, status: 'idle' }\n\n function rerender(state: State) {\n currentState = state\n render(h(Root, { state }), mountPoint)\n }\n\n function Root({ state }: { state: State }) {\n const handleSubmit = useCallback(async (values: FormValues) => {\n rerender({ open: true, status: 'submitting' })\n try {\n await options.onSubmit(values)\n rerender({ open: true, status: 'success' })\n setTimeout(() => rerender({ open: false, status: 'idle' }), 1200)\n } catch (err) {\n rerender({ open: true, status: 'error', error: err instanceof Error ? err.message : String(err) })\n }\n }, [])\n\n return (\n <>\n {options.showFAB && (\n <Fab\n label={options.strings['fab.label']}\n onClick={() => rerender({ ...currentState, open: true })}\n />\n )}\n {state.open && (\n <Modal onDismiss={() => rerender({ open: false, status: 'idle' })}>\n <Form\n strings={options.strings}\n onSubmit={handleSubmit}\n onCancel={() => rerender({ open: false, status: 'idle' })}\n status={state.status}\n {...(state.error !== undefined && { errorMessage: state.error })}\n />\n </Modal>\n )}\n </>\n )\n }\n\n rerender(currentState)\n\n return {\n open() { rerender({ ...currentState, open: true }) },\n close() { rerender({ ...currentState, open: false, status: 'idle' }) },\n dispose() {\n render(null, mountPoint)\n options.host.innerHTML = ''\n },\n }\n}\n","import { createApiClient } from './api/client'\nimport { installCapture } from './capture'\nimport { takeScreenshot } from './screenshot'\nimport { resolveStrings } from './widget/i18n'\nimport { mountWidget } from './widget/mount'\nimport type { FeedbackApi, FeedbackConfig, ReportPayload, ReportTransformer, UserIdentity } from './types'\n\nexport interface InternalConfig extends FeedbackConfig {\n fetchImpl?: typeof fetch\n}\n\ninterface WindowWithGlobal extends Window {\n mhosaicFeedback?: FeedbackApi\n}\n\nexport function createFeedback(config: InternalConfig): FeedbackApi & { _registerTransformer(fn: ReportTransformer): void } {\n const env = config.env ?? 'prod'\n const locale =\n config.locale ?? (typeof navigator !== 'undefined' ? navigator.language : undefined)\n const strings = resolveStrings(\n config.translations ?? {},\n locale !== undefined ? { locale } : {},\n )\n const capture = installCapture({\n ...(config.sanitizeUrl !== undefined && { sanitizeUrl: config.sanitizeUrl }),\n })\n const api = createApiClient({\n apiKey: config.apiKey,\n endpoint: config.endpoint,\n ...(config.fetchImpl !== undefined && { fetch: config.fetchImpl }),\n ...(config.beforeSend !== undefined && { beforeSend: config.beforeSend }),\n })\n\n let user: UserIdentity | undefined = config.user\n let metadata: Record<string, unknown> = config.metadata ?? {}\n const transformers: ReportTransformer[] = []\n\n const host = document.createElement('div')\n host.className = 'mhosaic-feedback'\n if (config.attachTo) {\n const attach = typeof config.attachTo === 'string' ? document.querySelector(config.attachTo) : config.attachTo\n attach?.appendChild(host)\n } else {\n document.body.appendChild(host)\n }\n\n async function buildAndSubmit(values: { description: string; feedback_type?: string; severity?: string }) {\n const screenshot = await takeScreenshot(document.body, { mask: ['.mhosaic-feedback', '[data-mfb-mask]'] })\n const payload: ReportPayload = {\n description: values.description,\n feedback_type: (values.feedback_type ?? 'bug') as ReportPayload['feedback_type'],\n severity: (values.severity ?? 'medium') as ReportPayload['severity'],\n env,\n page_url: window.location.href,\n user_agent: navigator.userAgent,\n capture_method: screenshot ? 'html2canvas' : 'none',\n technical_context: capture.snapshot(),\n }\n if (screenshot) payload.screenshot = screenshot\n let finalPayload: ReportPayload = payload\n for (const t of transformers) finalPayload = await t(finalPayload)\n try {\n const result = await api.submitReport(finalPayload)\n config.onSubmitSuccess?.(result)\n capture.clear()\n return result\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err))\n config.onError?.(error)\n throw error\n }\n }\n\n const handle = mountWidget({\n host,\n strings,\n showFAB: config.showFAB ?? true,\n onSubmit: async (values) => { await buildAndSubmit(values) },\n })\n\n const instance: FeedbackApi & { _registerTransformer(fn: ReportTransformer): void } = {\n show() { handle.open() },\n hide() { handle.close() },\n open(opts) { handle.open(); void opts },\n async submit(partial) {\n return buildAndSubmit({\n description: partial.description,\n ...(partial.feedback_type !== undefined && { feedback_type: partial.feedback_type }),\n ...(partial.severity !== undefined && { severity: partial.severity }),\n })\n },\n identify(u) { user = u; void user },\n setMetadata(kv) { metadata = { ...metadata, ...kv }; void metadata },\n shutdown() {\n handle.dispose()\n capture.dispose()\n host.remove()\n // Only release the global if it still points at *us* — otherwise a\n // newer instance has taken ownership and we mustn't blow it away.\n const w = window as unknown as WindowWithGlobal\n if (w.mhosaicFeedback === instance) {\n delete w.mhosaicFeedback\n }\n },\n _registerTransformer(fn: ReportTransformer) { transformers.push(fn) },\n }\n\n // Expose the instance globally for ad-hoc callers (DevTools, docs pages,\n // help-widget integrations). The most-recently-created instance wins.\n ;(window as unknown as WindowWithGlobal).mhosaicFeedback = instance\n\n return instance\n}\n","import { createFeedback } from './core'\nimport type { FeedbackApi, FeedbackConfig } from './types'\n\ntype QueuedCall =\n | ['init', FeedbackConfig]\n | ['identify', NonNullable<FeedbackConfig['user']>]\n | ['setMetadata', Record<string, unknown>]\n | ['open', Parameters<FeedbackApi['open']>[0]]\n\ninterface WindowLike {\n Feedback?: {\n q?: QueuedCall[]\n (name: string, arg?: unknown): void\n }\n}\n\nconst w = window as unknown as WindowLike\n\nfunction resolveConfigFromScriptTag(): FeedbackConfig | null {\n const script = document.currentScript as HTMLScriptElement | null\n if (!script) return null\n const apiKey = script.dataset.key\n const endpoint = script.dataset.endpoint\n if (!apiKey || !endpoint) return null\n const env = script.dataset.env as FeedbackConfig['env'] | undefined\n return {\n apiKey,\n endpoint,\n ...(env !== undefined && { env }),\n }\n}\n\nlet api: FeedbackApi | null = null\nconst pending: QueuedCall[] = w.Feedback?.q ?? []\n\nfunction handle(call: QueuedCall) {\n const [name, arg] = call\n if (name === 'init') {\n if (api) return\n api = createFeedback(arg as FeedbackConfig)\n return\n }\n if (!api) {\n pending.push(call)\n return\n }\n if (name === 'identify') api.identify(arg as NonNullable<FeedbackConfig['user']>)\n else if (name === 'setMetadata') api.setMetadata(arg as Record<string, unknown>)\n else if (name === 'open') api.open(arg as Parameters<FeedbackApi['open']>[0])\n}\n\nconst autoConfig = resolveConfigFromScriptTag()\nif (autoConfig) api = createFeedback(autoConfig)\n\nwhile (pending.length > 0) handle(pending.shift()!)\n\nconst FeedbackFn = Object.assign(\n function Feedback(name: string, arg?: unknown) {\n handle([name, arg] as QueuedCall)\n },\n { q: pending },\n)\n\nw.Feedback = FeedbackFn\n"],"mappings":"4X2BoGM,SAAUA,GAAiBC,EAAe,CAC5C,MACI,EAAEA,EAAM,OAAI,IAA8BA,EAAM,QAAU,UACzDA,EAAM,OAAI,IAA2B,CAAC,CAACC,GAA0BD,EAAM,IAAI,EAEpF,K3BvGaE,EAoDAC,GAIAC,GC1DAC,GAqBAC,EA8BPC,GAGAC,GACGC,GCvDHF,GAGAC,GACGC,GAIIC,GAuCAC,GASAC,GCnDAC,GAGAC,GAQAC,GAMAC,GAQAC,GAGAC,GAEAC,GAEAC,GAEAC,GAKAC,GACAC,GAaAC,GAMAC,GAGAC,GAEAC,GAEPC,GAQAC,GAQOC,MCvFPvB,GAGAC,GACGC,GCJIsB,GCMAC,GAGPC,GACAC,GACAC,GACAC,GACAC,GAEAC,GACAC,GACAC,GACAC,GACAC,GAEAC,GACAC,GACAC,GACAC,GACAC,GAEAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GAEAC,GACAC,EACAC,GACAC,GACAC,GAEAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GAEAC,GAgDOC,GACAC,EACAC,GACAC,GAEPC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GAEOC,GAyEPC,GAsDAC,GAeAC,GA4RAC,GAoCNC,GAgCaC,GCzfAC,GACAC,GACAC,GACAC,GAEPC,GACAC,GACAC,GACAC,GACAnB,GACAoB,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,EACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,G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C,IAAQ,QAAa,CAAE,IAAAA,CAAI,CACjC,CACF,CAEA,IAAIC,GAA0B,KAhC9BC,GAAAC,GAiCMC,IAAwBD,IAAAD,GAAAP,GAAE,WAAF,YAAAO,GAAY,IAAZ,KAAAC,GAAiB,CAAC,EAEhD,SAASE,GAAOC,EAAkB,CAChC,GAAM,CAACC,EAAMC,CAAG,EAAIF,EACpB,GAAIC,IAAS,OAAQ,CACnB,GAAIN,GAAK,OACTA,GAAMQ,GAAeD,CAAqB,EAC1C,MACF,CACA,GAAI,CAACP,GAAK,CACRG,GAAQ,KAAKE,CAAI,EACjB,MACF,CACIC,IAAS,WAAYN,GAAI,SAASO,CAA0C,EACvED,IAAS,cAAeN,GAAI,YAAYO,CAA8B,EACtED,IAAS,QAAQN,GAAI,KAAKO,CAAyC,CAC9E,CAEA,IAAME,GAAad,GAA2B,EAC1Cc,KAAYT,GAAMQ,GAAeC,EAAU,GAE/C,KAAON,GAAQ,OAAS,GAAGC,GAAOD,GAAQ,MAAM,CAAE,EAElD,IAAMO,GAAa,OAAO,OACxB,SAAkBJ,EAAcC,EAAe,CAC7CH,GAAO,CAACE,EAAMC,CAAG,CAAe,CAClC,EACA,CAAE,EAAGJ,EAAQ,CACf,EAEAT,GAAE,SAAWgB","names":["isSupportedImage","value","SUPPORTED_IMAGE_FUNCTIONS","Bounds","parseBounds","parseDocumentSize","toCodePoints","fromCodePoint","chars","lookup","i","decode","polyUint16Array","polyUint32Array","UTRIE2_SHIFT_2","UTRIE2_SHIFT_1","UTRIE2_INDEX_SHIFT","UTRIE2_SHIFT_1_2","UTRIE2_LSCP_INDEX_2_OFFSET","UTRIE2_DATA_BLOCK_LENGTH","UTRIE2_DATA_MASK","UTRIE2_LSCP_INDEX_2_LENGTH","UTRIE2_INDEX_2_BMP_LENGTH","UTRIE2_UTF8_2B_INDEX_2_OFFSET","UTRIE2_UTF8_2B_INDEX_2_LENGTH","UTRIE2_INDEX_1_OFFSET","UTRIE2_OMITTED_BMP_INDEX_1_LENGTH","UTRIE2_INDEX_2_BLOCK_LENGTH","UTRIE2_INDEX_2_MASK","slice16","slice32","createTrieFromBase64","base64","LETTER_NUMBER_MODIFIER","BK","CR","LF","CM","NL","WJ","ZW","GL","SP","ZWJ","B2","BA","BB","HY","CB","CL","CP","EX","IN","NS","OP","QU","IS","NU","PO","PR","SY","AI","AL","CJ","EB","EM","H2","H3","HL","ID","JL","JV","JT","RI","SA","XX","ea_OP","BREAK_MANDATORY","BREAK_NOT_ALLOWED","BREAK_ALLOWED","UnicodeTrie","ALPHABETICS","HARD_LINE_BREAKS","SPACE","PREFIX_POSTFIX","LINE_BREAKS","KOREAN_SYLLABLE_BLOCK","HYPHEN","codePointsToCharacterClasses","isAdjacentWithSpaceIgnored","previousNonSpaceClassType","_lineBreakAtIndex","cssFormattedClasses","Break","LineBreaker","FLAG_UNRESTRICTED","FLAG_ID","FLAG_INTEGER","FLAG_NUMBER","LINE_FEED","SOLIDUS","REVERSE_SOLIDUS","CHARACTER_TABULATION","QUOTATION_MARK","EQUALS_SIGN","NUMBER_SIGN","DOLLAR_SIGN","PERCENTAGE_SIGN","APOSTROPHE","LEFT_PARENTHESIS","RIGHT_PARENTHESIS","LOW_LINE","HYPHEN_MINUS","EXCLAMATION_MARK","LESS_THAN_SIGN","GREATER_THAN_SIGN","COMMERCIAL_AT","LEFT_SQUARE_BRACKET","RIGHT_SQUARE_BRACKET","CIRCUMFLEX_ACCENT","LEFT_CURLY_BRACKET","QUESTION_MARK","RIGHT_CURLY_BRACKET","VERTICAL_LINE","TILDE","CONTROL","REPLACEMENT_CHARACTER","ASTERISK","PLUS_SIGN","COMMA","COLON","SEMICOLON","FULL_STOP","NULL","BACKSPACE","LINE_TABULATION","SHIFT_OUT","INFORMATION_SEPARATOR_ONE","DELETE","EOF","ZERO","a","e","f","u","z","A","E","F","U","Z","isDigit","isSurrogateCodePoint","isHex","isLowerCaseLetter","isUpperCaseLetter","isLetter","isNonASCIICodePoint","isWhiteSpace","isNameStartCodePoint","isNameCodePoint","isNonPrintableCodePoint","isValidEscape","isIdentifierStart","isNumberStart","stringToNumber","LEFT_PARENTHESIS_TOKEN","RIGHT_PARENTHESIS_TOKEN","COMMA_TOKEN","SUFFIX_MATCH_TOKEN","PREFIX_MATCH_TOKEN","COLUMN_TOKEN","DASH_MATCH_TOKEN","INCLUDE_MATCH_TOKEN","LEFT_CURLY_BRACKET_TOKEN","RIGHT_CURLY_BRACKET_TOKEN","SUBSTRING_MATCH_TOKEN","BAD_URL_TOKEN","BAD_STRING_TOKEN","CDO_TOKEN","CDC_TOKEN","COLON_TOKEN","SEMICOLON_TOKEN","LEFT_SQUARE_BRACKET_TOKEN","RIGHT_SQUARE_BRACKET_TOKEN","WHITESPACE_TOKEN","EOF_TOKEN","Tokenizer","Parser","isDimensionToken","isNumberToken","isIdentToken","isStringToken","isIdentWithValue","nonWhiteSpace","nonFunctionArgSeparator","parseFunctionArgs","isEndingTokenFor","isLength","isLengthPercentage","isCalcFunction","evaluateCalcToLengthPercentage","parseLengthPercentageTuple","ZERO_LENGTH","FIFTY_PERCENT","HUNDRED_PERCENT","getAbsoluteValueForTuple","getAbsoluteValue","DEG","GRAD","RAD","TURN","angle","isAngle","parseNamedSide","deg","isTransparent","asString","pack","getTokenColorValue","isRelativeTransform","clamp","multiplyMatrices","packSrgb","packSrgbLinear","packXYZ","packLab","packOkLab","packOkLch","packLch","extractHslComponents","packHSL","extractLchComponents","extractLabComponents","extractOkLchComponents","d65toD50","d50toD65","hue2rgb","hsl2rgb","lch2lab","oklab2xyz","lab2xyz","rgbToXyz","hslToXyz","labToXyz","lchToXyz","oklchToXyz","oklabToXyz","xyz50ToXYZ","xyzFromXYZ","xyz50FromXYZ","convertXyz","convertXyz50","xyz2rgbLinear","rgbLinear2xyz","srgbLinear2rgb","rgb2rgbLinear","srgbFromXYZ","srgbLinearFromXYZ","p3LinearToXyz","xyzToP3Linear","p32p3Linear","p3Linear2p3","p3ToXYZ","p3FromXYZ","convertP3","xyz2a98Linear","a98Linear2xyz","a982a98Linear","a98Linear2a98","a98FromXYZ","convertA98rgb","proPhotoLinearToXyz","xyzToProPhotoLinear","proPhotoToProPhotoLinear","proPhotoLinearToProPhoto","proPhotoToXYZ","proPhotoFromXYZ","convertProPhoto","_a","_b","rec20202rec2020Linear","rec2020Linear2rec2020","rec2020LinearToXyz","xyzToRec2020Linear","rec2020ToXYZ","rec2020FromXYZ","convertRec2020","color","hash2rgb","rgb","_color","SUPPORTED_COLOR_SPACES_ABSOLUTE","SUPPORTED_COLOR_SPACES_TO_XYZ","SUPPORTED_COLOR_SPACES_FROM_XYZ","SUPPORTED_COLOR_FUNCTIONS","parseColor","COLORS","backgroundClip","backgroundColor","parseColorStop","processColorStops","getAngleFromCorner","calculateGradientDirection","distance","findCorner","calculateRadius","linearGradient","prefixLinearGradient","webkitGradient","CLOSEST_SIDE","FARTHEST_SIDE","CLOSEST_CORNER","FARTHEST_CORNER","CIRCLE","ELLIPSE","COVER","CONTAIN","radialGradient","prefixRadialGradient","isLinearGradient","isRadialGradient","image","backgroundImage","backgroundOrigin","backgroundPosition","backgroundRepeat","parseBackgroundRepeat","BACKGROUND_SIZE","backgroundSize","isBackgroundSizeInfoToken","borderColorForSide","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderRadiusForSide","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","borderStyleForSide","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderWidthForSide","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","direction","display","parseDisplayValue","float","letterSpacing","LINE_BREAK","lineBreak","lineHeight","computeLineHeight","listStyleImage","listStylePosition","listStyleType","marginForSide","marginTop","marginRight","marginBottom","marginLeft","overflow","overflowWrap","paddingForSide","paddingTop","paddingRight","paddingBottom","paddingLeft","textAlign","position","textShadow","textTransform","transform","matrix","matrix3d","rotate","SUPPORTED_TRANSFORM_FUNCTIONS","DEFAULT_VALUE","DEFAULT","transformOrigin","visibility","WORD_BREAK","wordBreak","zIndex","time","opacity","textDecorationColor","textDecorationLine","textDecorationStyle","textDecorationThickness","textUnderlineOffset","fontFamily","fontSize","fontWeight","fontVariant","fontStyle","contains","content","counterIncrement","counterReset","duration","quotes","getQuote","boxShadow","paintOrder","webkitTextStrokeColor","webkitTextStrokeWidth","webkitLineClamp","objectFit","textOverflow","CSSParsedDeclaration","CSSParsedPseudoDeclaration","CSSParsedCounterDeclaration","parse","elementDebuggerAttribute","getElementDebugType","isDebugging","ElementContainer","Prepend","Control","Extend","SpacingMark","L","V","T","LV","LVT","Extended_Pictographic","codePointToClass","_graphemeBreakAtIndex","GraphemeBreaker","splitGraphemes","testRangeBounds","testIOSLineBreak","testCORS","testResponseType","testSVG","isGreenPixel","testForeignObject","createForeignObjectSVG","loadSerializedSVG","FEATURES","TextBounds","parseTextBounds","getWrapperBounds","createRange","segmentGraphemes","segmentWords","breakText","wordSeparators","breakWords","TextContainer","CAPITALIZE","capitalize","ImageElementContainer","CanvasElementContainer","SVGElementContainer","LIElementContainer","OLElementContainer","CHECKBOX_BORDER_RADIUS","RADIO_BORDER_RADIUS","reformatInputBounds","getInputValue","isPlaceholder","CHECKBOX","RADIO","PASSWORD","INPUT_COLOR","PLACEHOLDER_COLOR","InputElementContainer","SelectElementContainer","TextareaElementContainer","IFrameElementContainer","LIST_OWNERS","parseNodeTree","createContainer","parseTree","createsRealStackingContext","createsStackingContext","isTextNode","isElementNode","isHTMLElementNode","isSVGElementNode","isLIElement","isOLElement","isInputElement","isHTMLElement","isSVGElement","isBodyElement","isCanvasElement","isVideoElement","isImageElement","isIFrameElement","isStyleElement","isScriptElement","isTextareaElement","isSelectElement","isSlotElement","isCustomElement","CounterState","ROMAN_UPPER","ARMENIAN","HEBREW","GEORGIAN","createAdditiveCounter","createCounterStyleWithSymbolResolver","createCounterStyleFromRange","createCounterStyleFromSymbols","CJK_ZEROS","CJK_TEN_COEFFICIENTS","CJK_TEN_HIGH_COEFFICIENTS","CJK_HUNDRED_COEFFICIENTS","createCJKCounter","CHINESE_INFORMAL_MULTIPLIERS","CHINESE_FORMAL_MULTIPLIERS","JAPANESE_NEGATIVE","KOREAN_NEGATIVE","createCounterText","IGNORE_ATTRIBUTE","findParentShadowRoot","DocumentCloner","PseudoElementType","createIFrameContainer","imageReady","imagesReady","iframeLoader","ignoredStyleProperties","copyCSSStyles","serializeDoctype","restoreOwnerScroll","restoreNodeScroll","PSEUDO_BEFORE","PSEUDO_AFTER","PSEUDO_HIDE_ELEMENT_CLASS_BEFORE","PSEUDO_HIDE_ELEMENT_CLASS_AFTER","PSEUDO_HIDE_ELEMENT_STYLE","createPseudoHideStyles","createStyles","addBase","CacheStorage","Cache","INLINE_SVG","INLINE_BASE64","INLINE_IMG","isRenderable","isInlineImage","isInlineBase64Image","isBlobImage","isSVG","Vector","lerp","BezierCurve","isBezierCurve","BoundCurves","CORNER","getCurvePoints","calculateBorderBoxPath","calculateContentBoxPath","calculatePaddingBoxPath","TransformEffect","ClipEffect","OpacityEffect","isTransformEffect","isClipEffect","isOpacityEffect","equalPath","transformPath","StackingContext","ElementPaint","parseStackTree","processListItems","parseStackingContexts","parsePathForBorder","parsePathForBorderDoubleOuter","parsePathForBorderDoubleInner","parsePathForBorderStroke","createStrokePathFromCurves","createPathFromCurves","paddingBox","contentBox","calculateBackgroundPositioningArea","calculateBackgroundPaintingArea","calculateBackgroundRendering","isAuto","hasIntrinsicValue","calculateBackgroundSize","getBackgroundValueForIndex","calculateBackgroundRepeatPath","SMALL_IMAGE","SAMPLE_TEXT","FontMetrics","Renderer","MASK_OFFSET","CanvasRenderer","isTextInputElement","calculateBackgroundCurvedPaintingArea","canvasTextAlign","iOSBrokenFonts","fixIOSSystemFonts","ForeignObjectRenderer","Logger","Context","cspNonce","setCspNonce","html2canvas","renderElement","parseBackgroundColor","_Bounds","left","top","width","height","x","y","w","h","context","clientRect","domRectList","rects","domRect","rect","node","document","body","documentElement","str","codePoints","length","extra","_i","codeUnits","index","result","codePoint","bufferLength","len","p","encoded1","encoded2","encoded3","encoded4","buffer","bytes","view","start","end","_byteLength","view32","view16","headerLength","data","Trie","initialValue","errorValue","highStart","highValueIndex","ix","types","indices","categories","classType","prev","b","currentIndex","classTypes","current","next","n","type","indicies","forbiddenBreaks","beforeIndex","afterIndex","before","prevIndex","count","options","isLetterNumber","forbiddenBreakpoints","letterNumber","lastEnd","nextIndex","c1","c2","c3","c","sign","integers","int","fraction","fracd","frac","expsign","exponent","exp","chunk","tokens","token","flags","e1","e2","e3","a1","a2","a3","u1","u2","delta","digits","questionMarks","digit","endDigits","stringToken","amount","endingCodePoint","repr","number","unit","hex","hexCodePoint","_Parser","tokenizer","values","block","functionToken","cssFunction","args","arg","calcToken","contextValue","buildExpression","expression","nested","op","tuple","parent","_context","ident","alpha","blue","green","red","r","g","max","min","B","srgb_linear","l","hue","saturation","lightness","s","xyz","t1","t2","lab","LMSg","LMS","val","fy","fx","fz","k","rgb_linear","abs","p3l","p3","p3_linear","a98","mapped","prophoto_linear","rec","rec2020_linear","colorFunction","namedColor","token_1_value","color_space","colorSpaceFunction","extractComponent","posFromVal","parseCalc","parts","part","from_colorspace","to_colorspace","from","_c","fromColorToXyz","toColorFromXyz","toColorPack","from_color","from_final_colorspace","colorType","stop","stops","lineLength","first","last","processStops","previous","absoluteValue","gapBegin","gapLength","beforeGap","gapValue","corner","centerX","centerY","radian","halfWidth","halfHeight","halfLineLength","yDiff","xDiff","closest","stat","cx","cy","d","gradient","rx","ry","firstToken","angleType","colorStop","shape","size","isColorStop","isAtPosition","acc","background","imageFunction","v","side","style","bit","shadow","transformFunction","b1","b2","a4","b4","radians","cos","sin","origins","line","accumulator","results","increments","filtered","counter","increment","resets","reset","open","close","depth","quote","layers","declaration","overflowTuple","descriptor","parser","element","elementType","_codePoints","countRI","graphemeBreak","breaker","graphemes","bk","range","testElement","rangeBounds","rangeHeight","textList","offset","supports","text","boundAhead","img","canvas","ctx","greenImageSrc","svg","xmlns","foreignObject","resolve","reject","bounds","styles","textBounds","clientRects","subSegments","subOffset","subSegment","replacementNode","ownerDocument","wrapper","parentNode","segmenter","segment","words","word","m","p1","p2","input","option","iframe","documentBackgroundColor","bodyBackgroundColor","root","childNode","nextNode","container","name","counters","canReset","entry","counterNames","symbols","fallback","suffix","string","integer","codePointRangeLength","isNumeric","resolver","codePointRangeStart","codePointRangeEnd","numbers","multipliers","negativeSign","tmp","coefficient","appendSuffix","defaultSuffix","cjkSuffix","koreanSuffix","spaceSuffix","shadowRoot","windowSize","scrollX","scrollY","cloneWindow","documentClone","iframeLoad","onclone","referenceElement","baseUri","policy","rawHTML","trustedHTML","adoptedNode","clone","sheet","css","rule","cloned","clonedCanvas","clonedCtx","gl","attribs","video","blankCanvas","child","copyStyles","target","assignedNodes","slot","targetShadowRoot","slotElement","window","styleBefore","styleAfter","after","pseudoElt","anonymousReplacedElement","attr","counterStyle","counterState","counterType","delim","counterStates","separator","newClassName","customContainer","cloneIframeContainer","interval","property","doctype","targetELement","baseNode","headEle","_CacheStorage","url","link","src","_options","key","isSameOrigin","useCORS","useProxy","proxy","responseType","xhr","reader","queryString","timeout","_Vector","deltaX","deltaY","t","_BezierCurve","startControl","endControl","firstHalf","ab","bc","cd","abbc","bccd","dest","path","tlh","tlv","trh","trv","brh","brv","blh","blv","factors","maxFactor","topWidth","rightHeight","bottomWidth","leftHeight","r1","r2","kappa","ox","oy","xm","ym","curves","offsetX","offsetY","effect","deltaW","deltaH","point","origin","rad","rotateMatrix","borderBox","inFlow","effects","croplessEffects","stackingContext","realStackingContext","listItems","treatAsRealStackingContext","paintContainer","listOwnerItems","parentStack","stack","order","owner","elements","numbering","reversed","item","borderSide","outer1","outer2","inner1","inner2","intrinsicSize","backgroundPositioningArea","backgroundPaintingArea","backgroundImageSize","sizeWidth","sizeHeight","intrinsicWidth","intrinsicHeight","intrinsicProportion","second","hasIntrinsicProportion","hasIntrinsicWidth","hasIntrinsicHeight","hasIntrinsicDimensions","repeat","span","baseline","middle","_CanvasRenderer","paint","letter","textBound","paintOrderLayers","paintOrderLayer","thickness","underlineOffset","decorationStyle","gap","amplitude","wavelength","currentX","nextX","nextX2","maxWidth","ellipsisWidth","truncated","letters","letterWidth","variant","containerBounds","font","lines","currentLine","currentLineTop","tb","maxLines","lastLine","lastLineText","firstBound","availableWidth","truncatedText","shouldApplyEllipsis","needsEllipsis","firstTop","fullText","fullTextWidth","textShadows","box","sx","sy","sw","sh","dx","dy","dw","dh","boxRatio","imgRatio","containW","noneW","verticalOffset","fontSizeValue","paths","pattern","imageWidth","imageHeight","x0","x1","y0","y1","midX","midY","invF","curvePoints","outerPaths","innerPaths","hasBackground","borders","borderBoxArea","maskOffset","shadowPaintingArea","border","strokePaths","boxPaths","startX","startY","endX","endY","dashLength","spaceLength","useLineDash","multiplier","numberOfDashes","minSpace","maxSpace","path1","path2","clip","fontFamilies","id","enabled","_Context","windowBounds","nonce","opts","defaultView","resourceOptions","contextOptions","_d","windowOptions","_e","_f","_g","_h","foreignObjectRendering","cloneOptions","_j","documentCloner","clonedElement","renderOptions","_l","_k","_m","_n","_o","_p","_q","backgroundColorOverride","defaultBackgroundColor","SCALAR_FIELDS","createApiClient","options","_a","_b","endpoint","fetcher","submitReport","input","payload","form","field","response","text","SENSITIVE","sanitizeUrl","url","isAbsolute","isRootRelative","base","u","clean","value","name","e","collectDevice","_a","nav","connection","deviceMemory","referrer","safeStringify","arg","_k","v","e","installConsolePatch","buffer","levels","originals","level","original","args","message","entry","stack","fn","installFetchPatch","buffer","sanitize","original","input","init","start","url","method","response","err","installXhrPatch","Original","originalOpen","originalSend","body","ctx","e","installErrorHandlers","buffer","onError","e","stack","onRejection","reason","message","createPerformanceCollector","slowResourceMs","longTasks","slowResources","observer","list","entry","e","nav","navigation","RingBuffer","max","__publicField","item","installCapture","options","_a","maxConsole","maxNetwork","maxErrors","sanitize","sanitizeUrl","consoleBuf","RingBuffer","networkBuf","errorBuf","uninstallConsole","installConsolePatch","uninstallFetch","installFetchPatch","uninstallXhr","installXhrPatch","uninstallErrors","installErrorHandlers","perf","createPerformanceCollector","collectDevice","isMaskedElement","el","prepareMaskMatcher","selectors","joined","takeScreenshot","target","options","_a","html2canvas","matcher","canvas","resolve","e","DEFAULT_STRINGS","FRENCH_STRINGS","LOCALE_PACKS","packFor","locale","_a","tag","resolveStrings","overrides","options","localePack","slice","options","vnodeId","isValidElement","rerenderQueue","prevDebounce","defer","depthSort","_id","EVENT_DISPATCHED","EVENT_ATTACHED","CAPTURE_REGEX","eventClock","eventProxy","eventProxyCapture","i","EMPTY_OBJ","EMPTY_ARR","IS_NON_DIMENSIONAL","isArray","Array","assign","obj","props","removeNode","node","parentNode","removeChild","createElement","type","children","key","ref","normalizedProps","arguments","length","call","defaultProps","createVNode","original","vnode","__k","__","__b","__e","__c","constructor","__v","__i","__u","Fragment","props","children","BaseComponent","context","this","getDomSibling","vnode","childIndex","__","__i","sibling","__k","length","__e","type","renderComponent","component","__P","__d","oldVNode","__v","oldDom","commitQueue","refQueue","newVNode","assign","options","diff","__n","namespaceURI","__u","commitRoot","updateParentDomPointers","__c","base","some","child","enqueueRender","c","rerenderQueue","push","process","__r","prevDebounce","debounceRendering","defer","l","sort","depthSort","shift","diffChildren","parentDom","renderResult","newParentVNode","oldParentVNode","globalContext","namespace","excessDomChildren","isHydrating","i","childVNode","newDom","firstChildDom","result","shouldPlace","oldChildren","EMPTY_ARR","newChildrenLength","constructNewChildrenArray","EMPTY_OBJ","ref","applyRef","insert","nextSibling","skewedIndex","matchingIndex","oldChildrenLength","remainingOldChildren","skew","Array","constructor","String","createVNode","isArray","__b","key","findMatchingIndex","unmount","parentVNode","parentNode","insertBefore","nodeType","findMatchingIndex","childVNode","oldChildren","skewedIndex","remainingOldChildren","x","y","childIndex","key","type","oldVNode","matched","__u","length","setStyle","style","value","setProperty","IS_NON_DIMENSIONAL","test","dom","name","oldValue","namespace","useCapture","lowerCaseName","o","cssText","replace","CAPTURE_REGEX","toLowerCase","slice","l","EVENT_ATTACHED","eventClock","addEventListener","eventProxyCapture","eventProxy","removeEventListener","e","removeAttribute","setAttribute","createEventProxy","this","eventHandler","EVENT_DISPATCHED","options","event","diff","parentDom","newVNode","globalContext","excessDomChildren","commitQueue","oldDom","isHydrating","refQueue","tmp","c","isNew","oldProps","oldState","snapshot","clearProcessingException","newProps","isClassComponent","provider","componentContext","renderHook","count","renderResult","i","newType","constructor","__e","__b","outer","props","prototype","render","contextType","__c","__","__E","BaseComponent","doRender","sub","state","__n","__d","__h","_sb","__s","getDerivedStateFromProps","assign","__v","componentWillMount","componentDidMount","push","componentWillReceiveProps","shouldComponentUpdate","__k","some","vnode","EMPTY_ARR","apply","componentWillUpdate","componentDidUpdate","context","__P","__r","getChildContext","getSnapshotBeforeUpdate","Fragment","cloneNode","children","diffChildren","isArray","base","then","MODE_HYDRATE","nodeType","nextSibling","indexOf","removeNode","markAsForce","diffElementNodes","diffed","commitRoot","root","applyRef","cb","call","node","map","newHtml","oldHtml","newChildren","inputValue","checked","EMPTY_OBJ","localName","document","createTextNode","createElementNS","is","__m","data","childNodes","attributes","__html","innerHTML","content","getDomSibling","undefined","ref","hasRefUnmount","current","unmount","parentVNode","skipRemove","r","componentWillUnmount","replaceNode","documentElement","createElement","namespaceURI","firstChild","slice","EMPTY_ARR","options","__e","error","vnode","oldVNode","errorInfo","component","ctor","handled","__","__c","constructor","getDerivedStateFromError","setState","__d","componentDidCatch","__E","e","vnodeId","isValidElement","BaseComponent","prototype","update","callback","s","this","__s","state","assign","props","__v","_sb","push","enqueueRender","forceUpdate","__h","render","Fragment","rerenderQueue","defer","Promise","then","bind","resolve","setTimeout","depthSort","a","b","__b","process","__r","_id","Math","random","toString","EVENT_DISPATCHED","EVENT_ATTACHED","CAPTURE_REGEX","eventClock","eventProxy","createEventProxy","eventProxyCapture","i","currentIndex","currentComponent","previousComponent","prevRaf","currentHook","afterPaintEffects","options","_options","oldBeforeDiff","__b","oldBeforeRender","__r","oldAfterDiff","diffed","oldCommit","__c","oldBeforeUnmount","unmount","oldRoot","__","getHookState","index","type","__h","hooks","__H","length","push","useState","initialState","useReducer","invokeOrReturn","reducer","init","hookState","_reducer","action","currentValue","__N","nextValue","setState","__f","updateHookState","p","s","c","stateHooks","filter","x","every","prevScu","call","this","shouldUpdate","props","some","hookItem","shouldComponentUpdate","prevCWU","componentWillUpdate","__e","tmp","useMemo","factory","args","state","getHookState","currentIndex","argsChanged","__H","__","__h","useCallback","callback","currentHook","flushAfterPaintEffects","component","afterPaintEffects","shift","hooks","__H","__P","__h","some","invokeCleanup","invokeEffect","e","options","__e","__v","__b","vnode","currentComponent","oldBeforeDiff","__","parentDom","__k","__m","oldRoot","__r","oldBeforeRender","currentIndex","__c","previousComponent","hookItem","__N","_pendingArgs","diffed","oldAfterDiff","c","length","push","prevRaf","requestAnimationFrame","afterNextFrame","commitQueue","filter","cb","oldCommit","unmount","oldBeforeUnmount","hasErrored","s","HAS_RAF","callback","raf","done","clearTimeout","timeout","cancelAnimationFrame","setTimeout","hook","comp","cleanup","argsChanged","oldArgs","newArgs","arg","index","invokeOrReturn","f","vnodeId","createVNode","type","props","key","isStaticChildren","__source","__self","ref","i","normalizedProps","vnode","__k","__","__b","__e","__c","constructor","__v","vnodeId","__i","__u","defaultProps","options","Fab","label","onClick","u","TYPES","SEVERITIES","Form","strings","onSubmit","onCancel","status","errorMessage","description","setDescription","d","feedbackType","setFeedbackType","severity","setSeverity","localError","setLocalError","submitting","submitLabel","u","e","t","s","Modal","onDismiss","children","u","WIDGET_STYLES","mountWidget","options","shadow","style","WIDGET_STYLES","mountPoint","currentState","rerender","state","R","k","Root","handleSubmit","q","values","err","u","S","Fab","Modal","Form","createFeedback","config","_a","_b","_c","_d","_e","env","locale","strings","resolveStrings","capture","installCapture","api","createApiClient","user","metadata","transformers","host","attach","buildAndSubmit","values","screenshot","takeScreenshot","payload","finalPayload","t","result","err","error","handle","mountWidget","instance","opts","partial","u","kv","w","fn","w","resolveConfigFromScriptTag","script","apiKey","endpoint","env","api","_a","_b","pending","handle","call","name","arg","createFeedback","autoConfig","FeedbackFn"]}