- commit
- c44ec37fbace8e1c630d24fbad5d0b293d753304
- parent
- 9366112e06dec4579491c33f09ea1b85f356937d
- author
- Dami <dami.etoile@gmail.com>
@@ -0,0 +1,14 @@
1+2+<html lang="en">3+ <head>4+ <meta charset="UTF-8">5+ <meta6+ http-equiv="Content-Security-Policy"7+ content="default-src 'none'; script-src *; style-src 'unsafe-inline'; img-src data:; font-src data:; connect-src 'none'; worker-src 'none'; frame-src 'none'"8+ >9+ <title>diagram.zip renderer</title>10+ </head>11+ <body>12+ <script src="/diagram.zip/renderer-frame.js"></script>13+ </body>14+</html>@@ -0,0 +1,121 @@
1+const CHANNEL = 'diagram.zip:renderer:v1'2+const FRAME_URL = '/diagram.zip/renderer-frame.html'3+const RENDER_TIMEOUT = 20_0004+5+export const CLIENT_RENDERER_IDS = Object.freeze(['mermaid'])6+7+function abortError(reason) {8+ if (reason?.name === 'AbortError') return reason9+ return new DOMException('Render superseded.', 'AbortError')10+}11+12+export class RendererFrame {13+ constructor({ documentObject = document, windowObject = window, frameUrl = FRAME_URL } = {}) {14+ this.document = documentObject15+ this.window = windowObject16+ this.frameUrl = frameUrl17+ this.frame = null18+ this.ready = null19+ this.resolveReady = null20+ this.rejectReady = null21+ this.sequence = 022+ this.pending = new Map()23+ this.handleMessage = event => this.receive(event)24+ this.window.addEventListener('message', this.handleMessage)25+ }26+27+ ensureFrame() {28+ if (this.frame) return this.ready29+ const frame = this.document.createElement('iframe')30+ frame.title = 'Diagram renderer'31+ frame.setAttribute('sandbox', 'allow-scripts')32+ frame.setAttribute('aria-hidden', 'true')33+ frame.tabIndex = -134+ Object.assign(frame.style, {35+ position: 'fixed',36+ left: '-200vw',37+ top: '0',38+ width: '1280px',39+ height: '800px',40+ border: '0',41+ pointerEvents: 'none',42+ visibility: 'hidden',43+ })44+ this.ready = new Promise((resolve, reject) => {45+ this.resolveReady = resolve46+ this.rejectReady = reject47+ })48+ frame.addEventListener('error', () => this.rejectReady?.(new Error('The client renderer could not be loaded.')), { once: true })49+ frame.src = this.frameUrl50+ this.frame = frame51+ this.document.body.append(frame)52+ return this.ready53+ }54+55+ receive(event) {56+ if (!this.frame || event.source !== this.frame.contentWindow || event.data?.channel !== CHANNEL) return57+ if (event.data.type === 'ready') {58+ this.resolveReady?.()59+ this.resolveReady = null60+ this.rejectReady = null61+ return62+ }63+ if (event.data.type !== 'result') return64+ const pending = this.pending.get(event.data.requestId)65+ if (!pending) return66+ this.pending.delete(event.data.requestId)67+ pending.finish()68+ if (event.data.ok && typeof event.data.svg === 'string') {69+ pending.resolve({ body: event.data.svg, version: event.data.version, runtime: 'client' })70+ } else {71+ pending.reject(new Error(event.data.error || 'Client rendering failed.'))72+ }73+ }74+75+ async render(engine, source, signal) {76+ let loadTimeout77+ try {78+ await Promise.race([79+ this.ensureFrame(),80+ new Promise((_, reject) => {81+ loadTimeout = setTimeout(() => reject(new Error('The client renderer timed out while loading.')), RENDER_TIMEOUT)82+ }),83+ ])84+ } finally {85+ clearTimeout(loadTimeout)86+ }87+ if (signal.aborted) throw abortError(signal.reason)88+ const requestId = `${Date.now().toString(36)}-${++this.sequence}`89+ return new Promise((resolve, reject) => {90+ const timeout = setTimeout(() => {91+ this.pending.delete(requestId)92+ signal.removeEventListener('abort', onAbort)93+ reject(new Error('The client renderer timed out.'))94+ }, RENDER_TIMEOUT)95+ const onAbort = () => {96+ this.pending.delete(requestId)97+ clearTimeout(timeout)98+ reject(abortError(signal.reason))99+ }100+ const finish = () => {101+ clearTimeout(timeout)102+ signal.removeEventListener('abort', onAbort)103+ }104+ signal.addEventListener('abort', onAbort, { once: true })105+ this.pending.set(requestId, { resolve, reject, finish })106+ this.frame.contentWindow.postMessage({ channel: CHANNEL, type: 'render', requestId, engine, source }, '*')107+ })108+ }109+}110+111+let sharedFrame112+113+export function clientAdapterFor(engine) {114+ if (!CLIENT_RENDERER_IDS.includes(engine)) return null115+ sharedFrame ??= new RendererFrame()116+ return {117+ id: engine,118+ runtime: 'client',119+ render: ({ source }, signal) => sharedFrame.render(engine, source, signal),120+ }121+}@@ -0,0 +1,244 @@
1+import { SaxesParser } from 'saxes'2+3+const MAX_SVG_LENGTH = 4_194_3044+const BLOCKED_ELEMENTS = new Set(['script', 'iframe', 'object', 'embed', 'audio', 'video'])5+const FOREIGN_OBJECT_ELEMENTS = new Set([6+ 'foreignobject', 'div', 'span', 'p', 'br', 'b', 'strong', 'i', 'em', 'small', 'sub', 'sup', 'code', 'ul', 'ol', 'li', 'a',7+])8+const SAFE_DATA_IMAGE = /^data:image\/(?:png|jpeg|gif|webp);base64,[a-z0-9+/=\s]+$/i9+const SAFE_DATA_FONT = /^data:(?:font\/(?:woff2?|opentype|truetype)|application\/(?:x-)?font-woff2?);base64,[a-z0-9+/=\s]+$/i10+11+export class ClientSvgError extends Error {12+ constructor(message) {13+ super(message)14+ this.name = 'ClientSvgError'15+ }16+}17+18+function safeCssReference(value) {19+ const normalized = value.trim()20+ return normalized.startsWith('#') || SAFE_DATA_IMAGE.test(normalized) || SAFE_DATA_FONT.test(normalized)21+}22+23+function unsafeCss(value) {24+ if (/@import|expression\s*\(|javascript\s*:|data\s*:\s*text\/html|behavior\s*:|-moz-binding/i.test(value)) return true25+ const urlPattern = /url\s*\(\s*(['"]?)(.*?)\1\s*\)/gi26+ for (const match of value.matchAll(urlPattern)) {27+ if (!safeCssReference(match[2] ?? '')) return true28+ }29+ return /url\s*\(/i.test(value.replace(urlPattern, ''))30+}31+32+function safeReference(value) {33+ const normalized = value.trim()34+ return normalized.startsWith('#') || SAFE_DATA_IMAGE.test(normalized)35+}36+37+function safeAttribute(name, value) {38+ const normalizedName = name.toLowerCase()39+ if (normalizedName.startsWith('on')) return false40+ if (normalizedName === 'href' || normalizedName === 'xlink:href' || normalizedName === 'src') return safeReference(value)41+ if (['style', 'filter', 'fill', 'stroke', 'clip-path', 'mask'].includes(normalizedName)) return !unsafeCss(value)42+ if (normalizedName === 'xml:base') return false43+ return !/javascript\s*:/i.test(value)44+}45+46+function escapeText(value) {47+ return value.replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>')48+}49+50+function escapeAttribute(value) {51+ return escapeText(value).replaceAll('"', '"')52+}53+54+function serialize(node) {55+ if (node.type === 'text') return escapeText(node.value)56+ const attributes = [...node.attributes].map(([name, value]) => ` ${name}="${escapeAttribute(value)}"`).join('')57+ return `<${node.name}${attributes}>${node.children.map(serialize).join('')}</${node.name}>`58+}59+60+function localName(element) {61+ return element.name.toLowerCase().split(':').at(-1) ?? element.name.toLowerCase()62+}63+64+function numericDimension(value) {65+ if (value === undefined || !/^-?\d+(?:\.\d+)?(?:px)?$/.test(value.trim())) return null66+ const parsed = Number.parseFloat(value)67+ return Number.isFinite(parsed) && parsed > 0 ? parsed : null68+}69+70+function presentationBounds(root) {71+ const viewBox = root.attributes.get('viewBox')?.trim().split(/[\s,]+/).map(Number)72+ if (viewBox?.length === 4 && viewBox.every(Number.isFinite) && viewBox[2] > 0 && viewBox[3] > 0) return viewBox73+ const width = numericDimension(root.attributes.get('width'))74+ const height = numericDimension(root.attributes.get('height'))75+ return width !== null && height !== null ? [0, 0, width, height] : null76+}77+78+function styleValue(element, property) {79+ const style = element.attributes.get('style')80+ if (!style) return null81+ for (const declaration of style.split(';')) {82+ const separator = declaration.indexOf(':')83+ if (separator >= 0 && declaration.slice(0, separator).trim().toLowerCase() === property) {84+ return declaration.slice(separator + 1).trim()85+ }86+ }87+ return null88+}89+90+function whiteFill(element) {91+ const fill = (element.attributes.get('fill') ?? styleValue(element, 'fill') ?? '').replaceAll(' ', '').toLowerCase()92+ return fill === 'white' || fill === '#fff' || fill === '#ffffff' || fill === 'rgb(255,255,255)'93+}94+95+function numericCoordinate(value) {96+ if (value === undefined || !/^-?\d+(?:\.\d+)?$/.test(value.trim())) return null97+ const number = Number(value)98+ return Number.isFinite(number) ? number : null99+}100+101+function rectCoversBounds(element, bounds) {102+ const widthValue = element.attributes.get('width')?.trim()103+ const heightValue = element.attributes.get('height')?.trim()104+ if (widthValue === '100%' && heightValue === '100%') return true105+ const x = numericCoordinate(element.attributes.get('x') ?? '0')106+ const y = numericCoordinate(element.attributes.get('y') ?? '0')107+ const width = numericCoordinate(widthValue)108+ const height = numericCoordinate(heightValue)109+ if ([x, y, width, height].some(value => value === null)) return false110+ const [boundX, boundY, boundWidth, boundHeight] = bounds111+ const tolerance = 0.01112+ return x <= boundX + tolerance113+ && y <= boundY + tolerance114+ && x + width >= boundX + boundWidth - tolerance115+ && y + height >= boundY + boundHeight - tolerance116+}117+118+function rendererBackdrop(element, bounds, engine) {119+ const name = localName(element)120+ const classes = new Set((element.attributes.get('class') ?? '').toLowerCase().split(/\s+/))121+ if (name === 'rect' && classes.has('backdrop')) return true122+ if (name === 'rect' && bounds !== null && whiteFill(element) && rectCoversBounds(element, bounds)) return true123+ return engine === 'graphviz' && name === 'polygon' && whiteFill(element) && (element.attributes.get('stroke') ?? '').toLowerCase() === 'none'124+}125+126+function removeRendererBackdrops(element, inheritedBounds, engine) {127+ const bounds = localName(element) === 'svg' ? presentationBounds(element) ?? inheritedBounds : inheritedBounds128+ element.children = element.children.filter(child => {129+ if (child.type === 'text') return true130+ if (rendererBackdrop(child, bounds, engine)) return false131+ removeRendererBackdrops(child, bounds, engine)132+ return true133+ })134+}135+136+function applyRootBackgroundStyle(root, background) {137+ const declarations = (root.attributes.get('style') ?? '')138+ .split(';')139+ .map(value => value.trim())140+ .filter(Boolean)141+ .filter(value => !/^background(?:-color)?\s*:/i.test(value))142+ declarations.push(`background-color:${background}`)143+ root.attributes.set('style', `${declarations.join(';')};`)144+}145+146+function element(name, attributes = [], children = []) {147+ return { type: 'element', name, attributes: new Map(attributes), children }148+}149+150+function decorate(root, metadata, presentation, engine) {151+ const additions = []152+ let frame = null153+ if (metadata.title) additions.push(element('title', [], [{ type: 'text', value: metadata.title }]))154+ if (metadata.description) additions.push(element('desc', [], [{ type: 'text', value: metadata.description }]))155+ const bounds = presentationBounds(root)156+ if ((presentation.padding || presentation.background || presentation.frame) && bounds === null) {157+ throw new ClientSvgError('Renderer output has no usable SVG dimensions for presentation settings.')158+ }159+ if (bounds !== null) {160+ const [x, y, width, height] = bounds161+ const padding = presentation.padding162+ const next = [x - padding, y - padding, width + padding * 2, height + padding * 2]163+ root.attributes.set('viewBox', next.join(' '))164+ if (root.attributes.has('width')) root.attributes.set('width', String(next[2]))165+ if (root.attributes.has('height')) root.attributes.set('height', String(next[3]))166+ if (presentation.background) {167+ additions.push(element('rect', [168+ ['x', String(next[0])], ['y', String(next[1])], ['width', String(next[2])], ['height', String(next[3])], ['fill', presentation.background],169+ ]))170+ }171+ if (presentation.frame) {172+ frame = element('rect', [173+ ['x', String(next[0] + 0.5)], ['y', String(next[1] + 0.5)],174+ ['width', String(Math.max(0, next[2] - 1))], ['height', String(Math.max(0, next[3] - 1))],175+ ['fill', 'none'], ['stroke', '#000000'], ['stroke-width', '1'], ['vector-effect', 'non-scaling-stroke'],176+ ])177+ }178+ }179+ if (presentation.background) {180+ removeRendererBackdrops(root, bounds, engine)181+ applyRootBackgroundStyle(root, presentation.background)182+ }183+ root.children.unshift(...additions)184+ if (frame) root.children.push(frame)185+}186+187+export function sanitizeAndDecorateSvg(source, metadata, presentation, engine) {188+ if (source.length > MAX_SVG_LENGTH) throw new ClientSvgError('Rendered SVG is too large.')189+ let root = null190+ const stack = []191+ let skippedDepth = 0192+ let parseError = null193+ const parser = new SaxesParser({ xmlns: true })194+195+ parser.on('doctype', value => {196+ if (value.includes('[')) parseError = new Error('Internal DOCTYPE subsets are not allowed')197+ })198+ parser.on('opentag', tag => {199+ const tagLocalName = tag.local.toLowerCase()200+ const insideForeignObject = tagLocalName === 'foreignobject' || stack.some(item => localName(item) === 'foreignobject')201+ if (skippedDepth > 0 || BLOCKED_ELEMENTS.has(tagLocalName) || (insideForeignObject && !FOREIGN_OBJECT_ELEMENTS.has(tagLocalName))) {202+ skippedDepth++203+ return204+ }205+ const next = element(tag.name)206+ for (const attribute of Object.values(tag.attributes)) {207+ if (safeAttribute(attribute.name, attribute.value)) next.attributes.set(attribute.name, attribute.value)208+ }209+ const parent = stack.at(-1)210+ if (parent) parent.children.push(next)211+ else if (root === null) root = next212+ else parseError = new Error('Multiple root elements')213+ stack.push(next)214+ })215+ const appendText = value => {216+ if (skippedDepth > 0 || value === '') return217+ const parent = stack.at(-1)218+ if (parent) {219+ if (localName(parent) === 'style' && unsafeCss(value)) throw new ClientSvgError('Renderer output contains unsafe CSS.')220+ parent.children.push({ type: 'text', value })221+ } else if (value.trim() !== '') {222+ parseError = new Error('Text outside root element')223+ }224+ }225+ parser.on('text', appendText)226+ parser.on('cdata', appendText)227+ parser.on('closetag', () => {228+ if (skippedDepth > 0) skippedDepth--229+ else stack.pop()230+ })231+ parser.on('error', error => { parseError = error })232+233+ try {234+ parser.write(source).close()235+ } catch (error) {236+ if (error instanceof ClientSvgError) throw error237+ parseError = error238+ }239+ if (parseError !== null || root === null || localName(root) !== 'svg') {240+ throw new ClientSvgError('Renderer returned invalid SVG.')241+ }242+ decorate(root, metadata, presentation, engine)243+ return serialize(root)244+}@@ -1,3 +1,6 @@
1+import { clientAdapterFor } from './client-renderers.js'2+import { sanitizeAndDecorateSvg } from './client-svg.js'3+14 function clamp(value, minimum, maximum) {25 return Math.min(Math.max(value, minimum), maximum)36 }@@ -78,18 +81,23 @@ export class PreviewController {
7881 this.stage.style.setProperty('--render-background', 'var(--preview-bg)')7982 8083 try {81- const response = await fetch('/render/v1/svg', {82- method: 'POST',83- headers: { Accept: 'image/svg+xml', 'Content-Type': 'application/json' },84- body: JSON.stringify({ engine: type, source, format: 'svg', options, metadata: meta, presentation }),85- signal: abortController.signal,86- })87- if (requestNumber !== this.requestNumber) return88- if (!response.ok) {89- throw new Error(await this.errorMessage(response))84+ const clientAdapter = clientAdapterFor(type)85+ let sourceSvg86+ if (clientAdapter) {87+ try {88+ const rendered = await clientAdapter.render({ type, source, options }, abortController.signal)89+ sourceSvg = sanitizeAndDecorateSvg(rendered.body, meta, presentation, type)90+ this.status.dataset.cache = 'browser'91+ this.status.dataset.renderer = rendered.runtime92+ } catch (error) {93+ if (error.name === 'AbortError') throw error94+ sourceSvg = await this.renderThroughGateway({ type, source, options, meta, presentation }, abortController.signal)95+ }96+ } else {97+ sourceSvg = await this.renderThroughGateway({ type, source, options, meta, presentation }, abortController.signal)9098 }91- this.status.dataset.cache = response.headers.get('X-Diagram-Cache')?.toLowerCase() ?? 'browser'92- const { blob, background } = this.normalizedSvgBlob(await response.text())99+ if (requestNumber !== this.requestNumber) return100+ const { blob, background } = this.normalizedSvgBlob(sourceSvg)93101 this.latestRenderKey = renderKey94102 this.latestSvgBlob = blob95103 this.imageFallbackUrl = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(await blob.text())}`@@ -111,6 +119,19 @@ export class PreviewController {
111119 }112120 }113121 122+ async renderThroughGateway({ type, source, options, meta, presentation }, signal) {123+ const response = await fetch('/render/v1/svg', {124+ method: 'POST',125+ headers: { Accept: 'image/svg+xml', 'Content-Type': 'application/json' },126+ body: JSON.stringify({ engine: type, source, format: 'svg', options, metadata: meta, presentation }),127+ signal,128+ })129+ if (!response.ok) throw new Error(await this.errorMessage(response))130+ this.status.dataset.cache = response.headers.get('X-Diagram-Cache')?.toLowerCase() ?? 'miss'131+ this.status.dataset.renderer = response.headers.get('X-Diagram-Renderer')?.toLowerCase() ?? 'gateway'132+ return response.text()133+ }134+114135 retryBlockedImage() {115136 if (this.image.src !== this.activeImageUrl) return116137 if (this.imageFallbackUrl && this.activeImageUrl.startsWith('blob:')) {@@ -0,0 +1,43 @@
1+import mermaid from 'mermaid'2+3+const CHANNEL = 'diagram.zip:renderer:v1'4+const VERSION = 'mermaid@11.17.0'5+6+mermaid.initialize({7+ startOnLoad: false,8+ securityLevel: 'strict',9+ suppressErrorRendering: true,10+ maxTextSize: 100_000,11+ maxEdges: 5_000,12+ flowchart: { useMaxWidth: false },13+})14+15+let queue = Promise.resolve()16+17+async function render(message) {18+ if (message.engine !== 'mermaid') throw new Error(`No client renderer for ${message.engine}.`)19+ const id = `diagramzip-${message.requestId.replace(/[^a-zA-Z0-9_-]/g, '')}`20+ const { svg } = await mermaid.render(id, message.source)21+ return { svg, version: VERSION }22+}23+24+window.addEventListener('message', event => {25+ if (event.source !== parent || event.data?.channel !== CHANNEL || event.data?.type !== 'render') return26+ const message = event.data27+ queue = queue.then(async () => {28+ try {29+ const result = await render(message)30+ parent.postMessage({ channel: CHANNEL, type: 'result', requestId: message.requestId, ok: true, ...result }, '*')31+ } catch (error) {32+ parent.postMessage({33+ channel: CHANNEL,34+ type: 'result',35+ requestId: message.requestId,36+ ok: false,37+ error: error instanceof Error ? error.message.slice(0, 500) : 'Client rendering failed.',38+ }, '*')39+ }40+ })41+})42+43+parent.postMessage({ channel: CHANNEL, type: 'ready' }, '*')@@ -0,0 +1,54 @@
1+import assert from 'node:assert/strict'2+import test from 'node:test'3+import { CLIENT_RENDERER_IDS, RendererFrame, clientAdapterFor } from '../src/client-renderers.js'4+5+const CHANNEL = 'diagram.zip:renderer:v1'6+7+function fakeBrowser() {8+ let listener9+ const attributes = new Map()10+ const contentWindow = {11+ postMessage(message) {12+ queueMicrotask(() => listener({13+ source: contentWindow,14+ data: { channel: CHANNEL, type: 'result', requestId: message.requestId, ok: true, svg: '<svg/>', version: 'mermaid@test' },15+ }))16+ },17+ }18+ const frame = {19+ style: {},20+ contentWindow,21+ setAttribute(name, value) { attributes.set(name, value) },22+ addEventListener() {},23+ }24+ const windowObject = { addEventListener(_name, callback) { listener = callback } }25+ const documentObject = {26+ createElement() { return frame },27+ body: { append() { queueMicrotask(() => listener({ source: contentWindow, data: { channel: CHANNEL, type: 'ready' } })) } },28+ }29+ return { attributes, documentObject, frame, windowObject }30+}31+32+test('registers Mermaid as the first client-native renderer', () => {33+ assert.deepEqual(CLIENT_RENDERER_IDS, ['mermaid'])34+ assert.equal(clientAdapterFor('graphviz'), null)35+})36+37+test('renders through a script-only unique-origin frame', async () => {38+ const browser = fakeBrowser()39+ const renderer = new RendererFrame(browser)40+ const result = await renderer.render('mermaid', 'flowchart LR\nA-->B', new AbortController().signal)41+ assert.equal(result.body, '<svg/>')42+ assert.equal(result.runtime, 'client')43+ assert.equal(result.version, 'mermaid@test')44+ assert.equal(browser.attributes.get('sandbox'), 'allow-scripts')45+ assert.equal(browser.attributes.has('allow-same-origin'), false)46+})47+48+test('ignores renderer messages from any other window', async () => {49+ const browser = fakeBrowser()50+ const renderer = new RendererFrame(browser)51+ const render = renderer.render('mermaid', 'flowchart LR\nA-->B', new AbortController().signal)52+ renderer.receive({ source: {}, data: { channel: CHANNEL, type: 'result', requestId: 'forged', ok: true, svg: '<script/>' } })53+ assert.equal((await render).body, '<svg/>')54+})@@ -0,0 +1,50 @@
1+import assert from 'node:assert/strict'2+import test from 'node:test'3+import { ClientSvgError, sanitizeAndDecorateSvg } from '../src/client-svg.js'4+5+const metadata = { title: 'Client preview', description: 'Rendered locally' }6+const presentation = { background: '#f3f3f3', padding: 16, frame: true }7+8+test('sanitizes and decorates a client-rendered SVG', () => {9+ const source = `<svg xmlns="http://www.w3.org/2000/svg" width="100" height="50" viewBox="0 0 100 50">10+ <script>alert(1)</script>11+ <image href="https://example.com/tracker.png" onload="alert(1)" />12+ <foreignObject><div xmlns="http://www.w3.org/1999/xhtml"><span>Alice Agent</span><img src="https://example.com/x" /></div></foreignObject>13+ <style><![CDATA[@keyframes dashdraw{to{stroke-dashoffset:0}} .edge{animation:dashdraw 2s linear infinite}]]></style>14+ <rect x="10" y="10" width="20" height="10" fill="white" stroke="black" />15+ </svg>`16+17+ const rendered = sanitizeAndDecorateSvg(source, metadata, presentation, 'mermaid')18+ assert.match(rendered, /<title>Client preview<\/title>/)19+ assert.match(rendered, /<desc>Rendered locally<\/desc>/)20+ assert.match(rendered, /viewBox="-16 -16 132 82"/)21+ assert.match(rendered, /fill="#f3f3f3"/)22+ assert.match(rendered, /Alice Agent/)23+ assert.match(rendered, /@keyframes dashdraw/)24+ assert.match(rendered, /vector-effect="non-scaling-stroke"/)25+ assert.match(rendered, /width="20" height="10" fill="white" stroke="black"/)26+ assert.doesNotMatch(rendered, /<script|<img|https:\/\/example\.com|onload=/)27+})28+29+test('rejects unsafe client-rendered CSS', () => {30+ assert.throws(31+ () => sanitizeAndDecorateSvg(32+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><style>rect{fill:url(https://example.com/x)}</style></svg>',33+ { title: '', description: '' },34+ { background: '', padding: 0, frame: false },35+ 'mermaid',36+ ),37+ ClientSvgError,38+ )39+})40+41+test('removes a full renderer backdrop but preserves internal white shapes', () => {42+ const rendered = sanitizeAndDecorateSvg(43+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 50"><rect width="100%" height="100%" fill="white"/><rect x="10" y="10" width="20" height="10" fill="white" stroke="black"/></svg>',44+ { title: '', description: '' },45+ { background: '#222222', padding: 0, frame: false },46+ 'mermaid',47+ )48+ assert.doesNotMatch(rendered, /width="100%"/)49+ assert.match(rendered, /width="20" height="10" fill="white" stroke="black"/)50+})@@ -0,0 +1,18 @@
1+import { defineConfig } from 'vite'2+import { resolve } from 'node:path'3+4+export default defineConfig({5+ build: {6+ outDir: resolve(import.meta.dirname, '../server/src/main/resources/web/diagramzip'),7+ emptyOutDir: false,8+ lib: {9+ entry: resolve(import.meta.dirname, 'src/renderer-frame.js'),10+ name: 'DiagramZipRendererFrame',11+ formats: ['iife'],12+ fileName: () => 'renderer-frame.js',13+ },14+ rollupOptions: {15+ output: { inlineDynamicImports: true },16+ },17+ },18+})@@ -16,7 +16,9 @@
1616 "@lezer/highlight": "^1.2.3",1717 "blocked-at": "^1.2.0",1818 "codemirror": "^6.0.2",19- "pako": "^3.0.1"19+ "mermaid": "11.17.0",20+ "pako": "^3.0.1",21+ "saxes": "6.0.0"2022 },2123 "devDependencies": {2224 "vite": "^8.2.2"@@ -25,6 +27,31 @@
2527 "node": ">=24"2628 }2729 },30+ "node_modules/@antfu/install-pkg": {31+ "version": "1.1.0",32+ "resolved": "https://registry.npmjs.org/@antfu/install-pkg/-/install-pkg-1.1.0.tgz",33+ "integrity": "sha512-MGQsmw10ZyI+EJo45CdSER4zEb+p31LpDAFp2Z3gkSd1yqVZGi0Ebx++YTEMonJy4oChEMLsxZ64j8FH6sSqtQ==",34+ "license": "MIT",35+ "dependencies": {36+ "package-manager-detector": "^1.3.0",37+ "tinyexec": "^1.0.1"38+ },39+ "funding": {40+ "url": "https://github.com/sponsors/antfu"41+ }42+ },43+ "node_modules/@braintree/sanitize-url": {44+ "version": "7.1.2",45+ "resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-7.1.2.tgz",46+ "integrity": "sha512-jigsZK+sMF/cuiB7sERuo9V7N9jx+dhmHHnQyDSVdpZwVutaBu7WvNYqMDLSgFgfB30n452TP3vjDAvFC973mA==",47+ "license": "MIT"48+ },49+ "node_modules/@chevrotain/types": {50+ "version": "11.1.2",51+ "resolved": "https://registry.npmjs.org/@chevrotain/types/-/types-11.1.2.tgz",52+ "integrity": "sha512-U+HFai5+zmJCkK86QsaJtoITlboZHBqrVketcO2ROv865xfCMSFpELQoz1GkX5GzME8pTa+3kbKrZHQtI0gdbw==",53+ "license": "Apache-2.0"54+ },2855 "node_modules/@codemirror/autocomplete": {2956 "version": "6.20.3",3057 "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.20.3.tgz",@@ -159,6 +186,23 @@
159186 "w3c-keyname": "^2.2.4"160187 }161188 },189+ "node_modules/@iconify/types": {190+ "version": "2.0.0",191+ "resolved": "https://registry.npmjs.org/@iconify/types/-/types-2.0.0.tgz",192+ "integrity": "sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==",193+ "license": "MIT"194+ },195+ "node_modules/@iconify/utils": {196+ "version": "3.1.4",197+ "resolved": "https://registry.npmjs.org/@iconify/utils/-/utils-3.1.4.tgz",198+ "integrity": "sha512-b1S7B1k9ohZ+iNTi2ATxbRYG9fTrJmUT0rc46bvVnNxqNRGW7dyo/vRREwyniI5IRN2RSJHDcm+s3BjWrSAjHw==",199+ "license": "MIT",200+ "dependencies": {201+ "@antfu/install-pkg": "^1.1.0",202+ "@iconify/types": "^2.0.0",203+ "import-meta-resolve": "^4.2.0"204+ }205+ },162206 "node_modules/@lezer/common": {163207 "version": "1.5.2",164208 "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.5.2.tgz",@@ -222,6 +266,15 @@
222266 "integrity": "sha512-FY+MKLBoTsLNJF/eLWaOsXGdz6uh3Iu1axjPf6TUq92IYumcTcXWHoS747JARLkcdlJ/Waiaxc5wQfFO8jC6NA==",223267 "license": "MIT"224268 },269+ "node_modules/@mermaid-js/parser": {270+ "version": "1.2.1",271+ "resolved": "https://registry.npmjs.org/@mermaid-js/parser/-/parser-1.2.1.tgz",272+ "integrity": "sha512-n12NohV3mrUyUL2o93IgG/ifeW9FTyeJn3zDxkhwa8MJ9Fxg3HQMlA3RiGmD/3UnJvheztkjjQAjA2T4LmUcpw==",273+ "license": "MIT",274+ "dependencies": {275+ "@chevrotain/types": "~11.1.2"276+ }277+ },225278 "node_modules/@oxc-project/types": {226279 "version": "0.146.0",227280 "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.146.0.tgz",@@ -512,6 +565,282 @@
512565 "dev": true,513566 "license": "MIT"514567 },568+ "node_modules/@types/d3": {569+ "version": "7.4.3",570+ "resolved": "https://registry.npmjs.org/@types/d3/-/d3-7.4.3.tgz",571+ "integrity": "sha512-lZXZ9ckh5R8uiFVt8ogUNf+pIrK4EsWrx2Np75WvF/eTpJ0FMHNhjXk8CKEx/+gpHbNQyJWehbFaTvqmHWB3ww==",572+ "license": "MIT",573+ "dependencies": {574+ "@types/d3-array": "*",575+ "@types/d3-axis": "*",576+ "@types/d3-brush": "*",577+ "@types/d3-chord": "*",578+ "@types/d3-color": "*",579+ "@types/d3-contour": "*",580+ "@types/d3-delaunay": "*",581+ "@types/d3-dispatch": "*",582+ "@types/d3-drag": "*",583+ "@types/d3-dsv": "*",584+ "@types/d3-ease": "*",585+ "@types/d3-fetch": "*",586+ "@types/d3-force": "*",587+ "@types/d3-format": "*",588+ "@types/d3-geo": "*",589+ "@types/d3-hierarchy": "*",590+ "@types/d3-interpolate": "*",591+ "@types/d3-path": "*",592+ "@types/d3-polygon": "*",593+ "@types/d3-quadtree": "*",594+ "@types/d3-random": "*",595+ "@types/d3-scale": "*",596+ "@types/d3-scale-chromatic": "*",597+ "@types/d3-selection": "*",598+ "@types/d3-shape": "*",599+ "@types/d3-time": "*",600+ "@types/d3-time-format": "*",601+ "@types/d3-timer": "*",602+ "@types/d3-transition": "*",603+ "@types/d3-zoom": "*"604+ }605+ },606+ "node_modules/@types/d3-array": {607+ "version": "3.2.2",608+ "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.2.2.tgz",609+ "integrity": "sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw==",610+ "license": "MIT"611+ },612+ "node_modules/@types/d3-axis": {613+ "version": "3.0.6",614+ "resolved": "https://registry.npmjs.org/@types/d3-axis/-/d3-axis-3.0.6.tgz",615+ "integrity": "sha512-pYeijfZuBd87T0hGn0FO1vQ/cgLk6E1ALJjfkC0oJ8cbwkZl3TpgS8bVBLZN+2jjGgg38epgxb2zmoGtSfvgMw==",616+ "license": "MIT",617+ "dependencies": {618+ "@types/d3-selection": "*"619+ }620+ },621+ "node_modules/@types/d3-brush": {622+ "version": "3.0.6",623+ "resolved": "https://registry.npmjs.org/@types/d3-brush/-/d3-brush-3.0.6.tgz",624+ "integrity": "sha512-nH60IZNNxEcrh6L1ZSMNA28rj27ut/2ZmI3r96Zd+1jrZD++zD3LsMIjWlvg4AYrHn/Pqz4CF3veCxGjtbqt7A==",625+ "license": "MIT",626+ "dependencies": {627+ "@types/d3-selection": "*"628+ }629+ },630+ "node_modules/@types/d3-chord": {631+ "version": "3.0.6",632+ "resolved": "https://registry.npmjs.org/@types/d3-chord/-/d3-chord-3.0.6.tgz",633+ "integrity": "sha512-LFYWWd8nwfwEmTZG9PfQxd17HbNPksHBiJHaKuY1XeqscXacsS2tyoo6OdRsjf+NQYeB6XrNL3a25E3gH69lcg==",634+ "license": "MIT"635+ },636+ "node_modules/@types/d3-color": {637+ "version": "3.1.3",638+ "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-3.1.3.tgz",639+ "integrity": "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==",640+ "license": "MIT"641+ },642+ "node_modules/@types/d3-contour": {643+ "version": "3.0.6",644+ "resolved": "https://registry.npmjs.org/@types/d3-contour/-/d3-contour-3.0.6.tgz",645+ "integrity": "sha512-BjzLgXGnCWjUSYGfH1cpdo41/hgdWETu4YxpezoztawmqsvCeep+8QGfiY6YbDvfgHz/DkjeIkkZVJavB4a3rg==",646+ "license": "MIT",647+ "dependencies": {648+ "@types/d3-array": "*",649+ "@types/geojson": "*"650+ }651+ },652+ "node_modules/@types/d3-delaunay": {653+ "version": "6.0.4",654+ "resolved": "https://registry.npmjs.org/@types/d3-delaunay/-/d3-delaunay-6.0.4.tgz",655+ "integrity": "sha512-ZMaSKu4THYCU6sV64Lhg6qjf1orxBthaC161plr5KuPHo3CNm8DTHiLw/5Eq2b6TsNP0W0iJrUOFscY6Q450Hw==",656+ "license": "MIT"657+ },658+ "node_modules/@types/d3-dispatch": {659+ "version": "3.0.7",660+ "resolved": "https://registry.npmjs.org/@types/d3-dispatch/-/d3-dispatch-3.0.7.tgz",661+ "integrity": "sha512-5o9OIAdKkhN1QItV2oqaE5KMIiXAvDWBDPrD85e58Qlz1c1kI/J0NcqbEG88CoTwJrYe7ntUCVfeUl2UJKbWgA==",662+ "license": "MIT"663+ },664+ "node_modules/@types/d3-drag": {665+ "version": "3.0.7",666+ "resolved": "https://registry.npmjs.org/@types/d3-drag/-/d3-drag-3.0.7.tgz",667+ "integrity": "sha512-HE3jVKlzU9AaMazNufooRJ5ZpWmLIoc90A37WU2JMmeq28w1FQqCZswHZ3xR+SuxYftzHq6WU6KJHvqxKzTxxQ==",668+ "license": "MIT",669+ "dependencies": {670+ "@types/d3-selection": "*"671+ }672+ },673+ "node_modules/@types/d3-dsv": {674+ "version": "3.0.7",675+ "resolved": "https://registry.npmjs.org/@types/d3-dsv/-/d3-dsv-3.0.7.tgz",676+ "integrity": "sha512-n6QBF9/+XASqcKK6waudgL0pf/S5XHPPI8APyMLLUHd8NqouBGLsU8MgtO7NINGtPBtk9Kko/W4ea0oAspwh9g==",677+ "license": "MIT"678+ },679+ "node_modules/@types/d3-ease": {680+ "version": "3.0.2",681+ "resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-3.0.2.tgz",682+ "integrity": "sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==",683+ "license": "MIT"684+ },685+ "node_modules/@types/d3-fetch": {686+ "version": "3.0.7",687+ "resolved": "https://registry.npmjs.org/@types/d3-fetch/-/d3-fetch-3.0.7.tgz",688+ "integrity": "sha512-fTAfNmxSb9SOWNB9IoG5c8Hg6R+AzUHDRlsXsDZsNp6sxAEOP0tkP3gKkNSO/qmHPoBFTxNrjDprVHDQDvo5aA==",689+ "license": "MIT",690+ "dependencies": {691+ "@types/d3-dsv": "*"692+ }693+ },694+ "node_modules/@types/d3-force": {695+ "version": "3.0.10",696+ "resolved": "https://registry.npmjs.org/@types/d3-force/-/d3-force-3.0.10.tgz",697+ "integrity": "sha512-ZYeSaCF3p73RdOKcjj+swRlZfnYpK1EbaDiYICEEp5Q6sUiqFaFQ9qgoshp5CzIyyb/yD09kD9o2zEltCexlgw==",698+ "license": "MIT"699+ },700+ "node_modules/@types/d3-format": {701+ "version": "3.0.4",702+ "resolved": "https://registry.npmjs.org/@types/d3-format/-/d3-format-3.0.4.tgz",703+ "integrity": "sha512-fALi2aI6shfg7vM5KiR1wNJnZ7r6UuggVqtDA+xiEdPZQwy/trcQaHnwShLuLdta2rTymCNpxYTiMZX/e09F4g==",704+ "license": "MIT"705+ },706+ "node_modules/@types/d3-geo": {707+ "version": "3.1.1",708+ "resolved": "https://registry.npmjs.org/@types/d3-geo/-/d3-geo-3.1.1.tgz",709+ "integrity": "sha512-65Emv9fQiQQqphLlRkuQ5ypPsOmWPhtBGCMv61JDPEPMvsx+gzhGf74yw1a78xFKPj6zw4AgQICJoQv0vK9M2w==",710+ "license": "MIT",711+ "dependencies": {712+ "@types/geojson": "*"713+ }714+ },715+ "node_modules/@types/d3-hierarchy": {716+ "version": "3.1.7",717+ "resolved": "https://registry.npmjs.org/@types/d3-hierarchy/-/d3-hierarchy-3.1.7.tgz",718+ "integrity": "sha512-tJFtNoYBtRtkNysX1Xq4sxtjK8YgoWUNpIiUee0/jHGRwqvzYxkq0hGVbbOGSz+JgFxxRu4K8nb3YpG3CMARtg==",719+ "license": "MIT"720+ },721+ "node_modules/@types/d3-interpolate": {722+ "version": "3.0.4",723+ "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-3.0.4.tgz",724+ "integrity": "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==",725+ "license": "MIT",726+ "dependencies": {727+ "@types/d3-color": "*"728+ }729+ },730+ "node_modules/@types/d3-path": {731+ "version": "3.1.1",732+ "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-3.1.1.tgz",733+ "integrity": "sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg==",734+ "license": "MIT"735+ },736+ "node_modules/@types/d3-polygon": {737+ "version": "3.0.2",738+ "resolved": "https://registry.npmjs.org/@types/d3-polygon/-/d3-polygon-3.0.2.tgz",739+ "integrity": "sha512-ZuWOtMaHCkN9xoeEMr1ubW2nGWsp4nIql+OPQRstu4ypeZ+zk3YKqQT0CXVe/PYqrKpZAi+J9mTs05TKwjXSRA==",740+ "license": "MIT"741+ },742+ "node_modules/@types/d3-quadtree": {743+ "version": "3.0.6",744+ "resolved": "https://registry.npmjs.org/@types/d3-quadtree/-/d3-quadtree-3.0.6.tgz",745+ "integrity": "sha512-oUzyO1/Zm6rsxKRHA1vH0NEDG58HrT5icx/azi9MF1TWdtttWl0UIUsjEQBBh+SIkrpd21ZjEv7ptxWys1ncsg==",746+ "license": "MIT"747+ },748+ "node_modules/@types/d3-random": {749+ "version": "3.0.4",750+ "resolved": "https://registry.npmjs.org/@types/d3-random/-/d3-random-3.0.4.tgz",751+ "integrity": "sha512-UHYId5WTCx4L4YNel7NU00XUXXgvgpgZOvp10PuvsQENjMDXhh2RyFc0KBjO7B45ne4Ha1yVH7ii0vnzKkuzWA==",752+ "license": "MIT"753+ },754+ "node_modules/@types/d3-scale": {755+ "version": "4.0.9",756+ "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.9.tgz",757+ "integrity": "sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw==",758+ "license": "MIT",759+ "dependencies": {760+ "@types/d3-time": "*"761+ }762+ },763+ "node_modules/@types/d3-scale-chromatic": {764+ "version": "3.1.0",765+ "resolved": "https://registry.npmjs.org/@types/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz",766+ "integrity": "sha512-iWMJgwkK7yTRmWqRB5plb1kadXyQ5Sj8V/zYlFGMUBbIPKQScw+Dku9cAAMgJG+z5GYDoMjWGLVOvjghDEFnKQ==",767+ "license": "MIT"768+ },769+ "node_modules/@types/d3-selection": {770+ "version": "3.0.11",771+ "resolved": "https://registry.npmjs.org/@types/d3-selection/-/d3-selection-3.0.11.tgz",772+ "integrity": "sha512-bhAXu23DJWsrI45xafYpkQ4NtcKMwWnAC/vKrd2l+nxMFuvOT3XMYTIj2opv8vq8AO5Yh7Qac/nSeP/3zjTK0w==",773+ "license": "MIT"774+ },775+ "node_modules/@types/d3-shape": {776+ "version": "3.1.8",777+ "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-3.1.8.tgz",778+ "integrity": "sha512-lae0iWfcDeR7qt7rA88BNiqdvPS5pFVPpo5OfjElwNaT2yyekbM0C9vK+yqBqEmHr6lDkRnYNoTBYlAgJa7a4w==",779+ "license": "MIT",780+ "dependencies": {781+ "@types/d3-path": "*"782+ }783+ },784+ "node_modules/@types/d3-time": {785+ "version": "3.0.4",786+ "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.4.tgz",787+ "integrity": "sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==",788+ "license": "MIT"789+ },790+ "node_modules/@types/d3-time-format": {791+ "version": "4.0.3",792+ "resolved": "https://registry.npmjs.org/@types/d3-time-format/-/d3-time-format-4.0.3.tgz",793+ "integrity": "sha512-5xg9rC+wWL8kdDj153qZcsJ0FWiFt0J5RB6LYUNZjwSnesfblqrI/bJ1wBdJ8OQfncgbJG5+2F+qfqnqyzYxyg==",794+ "license": "MIT"795+ },796+ "node_modules/@types/d3-timer": {797+ "version": "3.0.2",798+ "resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-3.0.2.tgz",799+ "integrity": "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==",800+ "license": "MIT"801+ },802+ "node_modules/@types/d3-transition": {803+ "version": "3.0.9",804+ "resolved": "https://registry.npmjs.org/@types/d3-transition/-/d3-transition-3.0.9.tgz",805+ "integrity": "sha512-uZS5shfxzO3rGlu0cC3bjmMFKsXv+SmZZcgp0KD22ts4uGXp5EVYGzu/0YdwZeKmddhcAccYtREJKkPfXkZuCg==",806+ "license": "MIT",807+ "dependencies": {808+ "@types/d3-selection": "*"809+ }810+ },811+ "node_modules/@types/d3-zoom": {812+ "version": "3.0.8",813+ "resolved": "https://registry.npmjs.org/@types/d3-zoom/-/d3-zoom-3.0.8.tgz",814+ "integrity": "sha512-iqMC4/YlFCSlO8+2Ii1GGGliCAY4XdeG748w5vQUbevlbDu0zSjH/+jojorQVBK/se0j6DUFNPBGSqD3YWYnDw==",815+ "license": "MIT",816+ "dependencies": {817+ "@types/d3-interpolate": "*",818+ "@types/d3-selection": "*"819+ }820+ },821+ "node_modules/@types/geojson": {822+ "version": "7946.0.16",823+ "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz",824+ "integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==",825+ "license": "MIT"826+ },827+ "node_modules/@types/trusted-types": {828+ "version": "2.0.7",829+ "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz",830+ "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==",831+ "license": "MIT",832+ "optional": true833+ },834+ "node_modules/@upsetjs/venn.js": {835+ "version": "2.0.0",836+ "resolved": "https://registry.npmjs.org/@upsetjs/venn.js/-/venn.js-2.0.0.tgz",837+ "integrity": "sha512-WbBhLrooyePuQ1VZxrJjtLvTc4NVfpOyKx0sKqioq9bX1C1m7Jgykkn8gLrtwumBioXIqam8DLxp88Adbue6Hw==",838+ "license": "MIT",839+ "optionalDependencies": {840+ "d3-selection": "^3.0.0",841+ "d3-transition": "^3.0.1"842+ }843+ },515844 "node_modules/blocked-at": {516845 "version": "1.2.0",517846 "resolved": "https://registry.npmjs.org/blocked-at/-/blocked-at-1.2.0.tgz",@@ -533,12 +862,544 @@
533862 "@codemirror/view": "^6.0.0"534863 }535864 },865+ "node_modules/commander": {866+ "version": "7.2.0",867+ "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",868+ "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",869+ "license": "MIT",870+ "engines": {871+ "node": ">= 10"872+ }873+ },874+ "node_modules/cose-base": {875+ "version": "1.0.3",876+ "resolved": "https://registry.npmjs.org/cose-base/-/cose-base-1.0.3.tgz",877+ "integrity": "sha512-s9whTXInMSgAp/NVXVNuVxVKzGH2qck3aQlVHxDCdAEPgtMKwc4Wq6/QKhgdEdgbLSi9rBTAcPoRa6JpiG4ksg==",878+ "license": "MIT",879+ "dependencies": {880+ "layout-base": "^1.0.0"881+ }882+ },536883 "node_modules/crelt": {537884 "version": "1.0.7",538885 "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.7.tgz",539886 "integrity": "sha512-aK6BbWfhf4U/wCcLHKPJl/xa6VkVstRaPywWtMKGwuOLc/wZTyQYuoxgvZnNsBvv7Kg3YTBQYYBCggcviQczuA==",540887 "license": "MIT"541888 },889+ "node_modules/cytoscape": {890+ "version": "3.34.1",891+ "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.34.1.tgz",892+ "integrity": "sha512-Lr0RvH9H75y9ar8h9Toy6u4lxRSCcxUq+hHcQ26sVWo6BnaQp1gwEZOYqwuYTZhyW7npyKnNLP8oJ2p1/3OZ7g==",893+ "license": "MIT",894+ "engines": {895+ "node": ">=0.10"896+ }897+ },898+ "node_modules/cytoscape-cose-bilkent": {899+ "version": "4.1.0",900+ "resolved": "https://registry.npmjs.org/cytoscape-cose-bilkent/-/cytoscape-cose-bilkent-4.1.0.tgz",901+ "integrity": "sha512-wgQlVIUJF13Quxiv5e1gstZ08rnZj2XaLHGoFMYXz7SkNfCDOOteKBE6SYRfA9WxxI/iBc3ajfDoc6hb/MRAHQ==",902+ "license": "MIT",903+ "dependencies": {904+ "cose-base": "^1.0.0"905+ },906+ "peerDependencies": {907+ "cytoscape": "^3.2.0"908+ }909+ },910+ "node_modules/cytoscape-fcose": {911+ "version": "2.2.0",912+ "resolved": "https://registry.npmjs.org/cytoscape-fcose/-/cytoscape-fcose-2.2.0.tgz",913+ "integrity": "sha512-ki1/VuRIHFCzxWNrsshHYPs6L7TvLu3DL+TyIGEsRcvVERmxokbf5Gdk7mFxZnTdiGtnA4cfSmjZJMviqSuZrQ==",914+ "license": "MIT",915+ "dependencies": {916+ "cose-base": "^2.2.0"917+ },918+ "peerDependencies": {919+ "cytoscape": "^3.2.0"920+ }921+ },922+ "node_modules/cytoscape-fcose/node_modules/cose-base": {923+ "version": "2.2.0",924+ "resolved": "https://registry.npmjs.org/cose-base/-/cose-base-2.2.0.tgz",925+ "integrity": "sha512-AzlgcsCbUMymkADOJtQm3wO9S3ltPfYOFD5033keQn9NJzIbtnZj+UdBJe7DYml/8TdbtHJW3j58SOnKhWY/5g==",926+ "license": "MIT",927+ "dependencies": {928+ "layout-base": "^2.0.0"929+ }930+ },931+ "node_modules/cytoscape-fcose/node_modules/layout-base": {932+ "version": "2.0.1",933+ "resolved": "https://registry.npmjs.org/layout-base/-/layout-base-2.0.1.tgz",934+ "integrity": "sha512-dp3s92+uNI1hWIpPGH3jK2kxE2lMjdXdr+DH8ynZHpd6PUlH6x6cbuXnoMmiNumznqaNO31xu9e79F0uuZ0JFg==",935+ "license": "MIT"936+ },937+ "node_modules/d3": {938+ "version": "7.9.0",939+ "resolved": "https://registry.npmjs.org/d3/-/d3-7.9.0.tgz",940+ "integrity": "sha512-e1U46jVP+w7Iut8Jt8ri1YsPOvFpg46k+K8TpCb0P+zjCkjkPnV7WzfDJzMHy1LnA+wj5pLT1wjO901gLXeEhA==",941+ "license": "ISC",942+ "dependencies": {943+ "d3-array": "3",944+ "d3-axis": "3",945+ "d3-brush": "3",946+ "d3-chord": "3",947+ "d3-color": "3",948+ "d3-contour": "4",949+ "d3-delaunay": "6",950+ "d3-dispatch": "3",951+ "d3-drag": "3",952+ "d3-dsv": "3",953+ "d3-ease": "3",954+ "d3-fetch": "3",955+ "d3-force": "3",956+ "d3-format": "3",957+ "d3-geo": "3",958+ "d3-hierarchy": "3",959+ "d3-interpolate": "3",960+ "d3-path": "3",961+ "d3-polygon": "3",962+ "d3-quadtree": "3",963+ "d3-random": "3",964+ "d3-scale": "4",965+ "d3-scale-chromatic": "3",966+ "d3-selection": "3",967+ "d3-shape": "3",968+ "d3-time": "3",969+ "d3-time-format": "4",970+ "d3-timer": "3",971+ "d3-transition": "3",972+ "d3-zoom": "3"973+ },974+ "engines": {975+ "node": ">=12"976+ }977+ },978+ "node_modules/d3-array": {979+ "version": "3.2.4",980+ "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz",981+ "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==",982+ "license": "ISC",983+ "dependencies": {984+ "internmap": "1 - 2"985+ },986+ "engines": {987+ "node": ">=12"988+ }989+ },990+ "node_modules/d3-axis": {991+ "version": "3.0.0",992+ "resolved": "https://registry.npmjs.org/d3-axis/-/d3-axis-3.0.0.tgz",993+ "integrity": "sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw==",994+ "license": "ISC",995+ "engines": {996+ "node": ">=12"997+ }998+ },999+ "node_modules/d3-brush": {1000+ "version": "3.0.0",1001+ "resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-3.0.0.tgz",1002+ "integrity": "sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ==",1003+ "license": "ISC",1004+ "dependencies": {1005+ "d3-dispatch": "1 - 3",1006+ "d3-drag": "2 - 3",1007+ "d3-interpolate": "1 - 3",1008+ "d3-selection": "3",1009+ "d3-transition": "3"1010+ },1011+ "engines": {1012+ "node": ">=12"1013+ }1014+ },1015+ "node_modules/d3-chord": {1016+ "version": "3.0.1",1017+ "resolved": "https://registry.npmjs.org/d3-chord/-/d3-chord-3.0.1.tgz",1018+ "integrity": "sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g==",1019+ "license": "ISC",1020+ "dependencies": {1021+ "d3-path": "1 - 3"1022+ },1023+ "engines": {1024+ "node": ">=12"1025+ }1026+ },1027+ "node_modules/d3-color": {1028+ "version": "3.1.0",1029+ "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz",1030+ "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==",1031+ "license": "ISC",1032+ "engines": {1033+ "node": ">=12"1034+ }1035+ },1036+ "node_modules/d3-contour": {1037+ "version": "4.0.2",1038+ "resolved": "https://registry.npmjs.org/d3-contour/-/d3-contour-4.0.2.tgz",1039+ "integrity": "sha512-4EzFTRIikzs47RGmdxbeUvLWtGedDUNkTcmzoeyg4sP/dvCexO47AaQL7VKy/gul85TOxw+IBgA8US2xwbToNA==",1040+ "license": "ISC",1041+ "dependencies": {1042+ "d3-array": "^3.2.0"1043+ },1044+ "engines": {1045+ "node": ">=12"1046+ }1047+ },1048+ "node_modules/d3-delaunay": {1049+ "version": "6.0.4",1050+ "resolved": "https://registry.npmjs.org/d3-delaunay/-/d3-delaunay-6.0.4.tgz",1051+ "integrity": "sha512-mdjtIZ1XLAM8bm/hx3WwjfHt6Sggek7qH043O8KEjDXN40xi3vx/6pYSVTwLjEgiXQTbvaouWKynLBiUZ6SK6A==",1052+ "license": "ISC",1053+ "dependencies": {1054+ "delaunator": "5"1055+ },1056+ "engines": {1057+ "node": ">=12"1058+ }1059+ },1060+ "node_modules/d3-dispatch": {1061+ "version": "3.0.1",1062+ "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz",1063+ "integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==",1064+ "license": "ISC",1065+ "engines": {1066+ "node": ">=12"1067+ }1068+ },1069+ "node_modules/d3-drag": {1070+ "version": "3.0.0",1071+ "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz",1072+ "integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==",1073+ "license": "ISC",1074+ "dependencies": {1075+ "d3-dispatch": "1 - 3",1076+ "d3-selection": "3"1077+ },1078+ "engines": {1079+ "node": ">=12"1080+ }1081+ },1082+ "node_modules/d3-dsv": {1083+ "version": "3.0.1",1084+ "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-3.0.1.tgz",1085+ "integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==",1086+ "license": "ISC",1087+ "dependencies": {1088+ "commander": "7",1089+ "iconv-lite": "0.6",1090+ "rw": "1"1091+ },1092+ "bin": {1093+ "csv2json": "bin/dsv2json.js",1094+ "csv2tsv": "bin/dsv2dsv.js",1095+ "dsv2dsv": "bin/dsv2dsv.js",1096+ "dsv2json": "bin/dsv2json.js",1097+ "json2csv": "bin/json2dsv.js",1098+ "json2dsv": "bin/json2dsv.js",1099+ "json2tsv": "bin/json2dsv.js",1100+ "tsv2csv": "bin/dsv2dsv.js",1101+ "tsv2json": "bin/dsv2json.js"1102+ },1103+ "engines": {1104+ "node": ">=12"1105+ }1106+ },1107+ "node_modules/d3-ease": {1108+ "version": "3.0.1",1109+ "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz",1110+ "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==",1111+ "license": "BSD-3-Clause",1112+ "engines": {1113+ "node": ">=12"1114+ }1115+ },1116+ "node_modules/d3-fetch": {1117+ "version": "3.0.1",1118+ "resolved": "https://registry.npmjs.org/d3-fetch/-/d3-fetch-3.0.1.tgz",1119+ "integrity": "sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw==",1120+ "license": "ISC",1121+ "dependencies": {1122+ "d3-dsv": "1 - 3"1123+ },1124+ "engines": {1125+ "node": ">=12"1126+ }1127+ },1128+ "node_modules/d3-force": {1129+ "version": "3.0.0",1130+ "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-3.0.0.tgz",1131+ "integrity": "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==",1132+ "license": "ISC",1133+ "dependencies": {1134+ "d3-dispatch": "1 - 3",1135+ "d3-quadtree": "1 - 3",1136+ "d3-timer": "1 - 3"1137+ },1138+ "engines": {1139+ "node": ">=12"1140+ }1141+ },1142+ "node_modules/d3-format": {1143+ "version": "3.1.2",1144+ "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.2.tgz",1145+ "integrity": "sha512-AJDdYOdnyRDV5b6ArilzCPPwc1ejkHcoyFarqlPqT7zRYjhavcT3uSrqcMvsgh2CgoPbK3RCwyHaVyxYcP2Arg==",1146+ "license": "ISC",1147+ "engines": {1148+ "node": ">=12"1149+ }1150+ },1151+ "node_modules/d3-geo": {1152+ "version": "3.1.1",1153+ "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-3.1.1.tgz",1154+ "integrity": "sha512-637ln3gXKXOwhalDzinUgY83KzNWZRKbYubaG+fGVuc/dxO64RRljtCTnf5ecMyE1RIdtqpkVcq0IbtU2S8j2Q==",1155+ "license": "ISC",1156+ "dependencies": {1157+ "d3-array": "2.5.0 - 3"1158+ },1159+ "engines": {1160+ "node": ">=12"1161+ }1162+ },1163+ "node_modules/d3-hierarchy": {1164+ "version": "3.1.2",1165+ "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz",1166+ "integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==",1167+ "license": "ISC",1168+ "engines": {1169+ "node": ">=12"1170+ }1171+ },1172+ "node_modules/d3-interpolate": {1173+ "version": "3.0.1",1174+ "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz",1175+ "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==",1176+ "license": "ISC",1177+ "dependencies": {1178+ "d3-color": "1 - 3"1179+ },1180+ "engines": {1181+ "node": ">=12"1182+ }1183+ },1184+ "node_modules/d3-path": {1185+ "version": "3.1.0",1186+ "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz",1187+ "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==",1188+ "license": "ISC",1189+ "engines": {1190+ "node": ">=12"1191+ }1192+ },1193+ "node_modules/d3-polygon": {1194+ "version": "3.0.1",1195+ "resolved": "https://registry.npmjs.org/d3-polygon/-/d3-polygon-3.0.1.tgz",1196+ "integrity": "sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg==",1197+ "license": "ISC",1198+ "engines": {1199+ "node": ">=12"1200+ }1201+ },1202+ "node_modules/d3-quadtree": {1203+ "version": "3.0.1",1204+ "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-3.0.1.tgz",1205+ "integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==",1206+ "license": "ISC",1207+ "engines": {1208+ "node": ">=12"1209+ }1210+ },1211+ "node_modules/d3-random": {1212+ "version": "3.0.1",1213+ "resolved": "https://registry.npmjs.org/d3-random/-/d3-random-3.0.1.tgz",1214+ "integrity": "sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ==",1215+ "license": "ISC",1216+ "engines": {1217+ "node": ">=12"1218+ }1219+ },1220+ "node_modules/d3-sankey": {1221+ "version": "0.12.3",1222+ "resolved": "https://registry.npmjs.org/d3-sankey/-/d3-sankey-0.12.3.tgz",1223+ "integrity": "sha512-nQhsBRmM19Ax5xEIPLMY9ZmJ/cDvd1BG3UVvt5h3WRxKg5zGRbvnteTyWAbzeSvlh3tW7ZEmq4VwR5mB3tutmQ==",1224+ "license": "BSD-3-Clause",1225+ "dependencies": {1226+ "d3-array": "1 - 2",1227+ "d3-shape": "^1.2.0"1228+ }1229+ },1230+ "node_modules/d3-sankey/node_modules/d3-array": {1231+ "version": "2.12.1",1232+ "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz",1233+ "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==",1234+ "license": "BSD-3-Clause",1235+ "dependencies": {1236+ "internmap": "^1.0.0"1237+ }1238+ },1239+ "node_modules/d3-sankey/node_modules/d3-path": {1240+ "version": "1.0.9",1241+ "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-1.0.9.tgz",1242+ "integrity": "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg==",1243+ "license": "BSD-3-Clause"1244+ },1245+ "node_modules/d3-sankey/node_modules/d3-shape": {1246+ "version": "1.3.7",1247+ "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-1.3.7.tgz",1248+ "integrity": "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw==",1249+ "license": "BSD-3-Clause",1250+ "dependencies": {1251+ "d3-path": "1"1252+ }1253+ },1254+ "node_modules/d3-sankey/node_modules/internmap": {1255+ "version": "1.0.1",1256+ "resolved": "https://registry.npmjs.org/internmap/-/internmap-1.0.1.tgz",1257+ "integrity": "sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==",1258+ "license": "ISC"1259+ },1260+ "node_modules/d3-scale": {1261+ "version": "4.0.2",1262+ "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz",1263+ "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==",1264+ "license": "ISC",1265+ "dependencies": {1266+ "d3-array": "2.10.0 - 3",1267+ "d3-format": "1 - 3",1268+ "d3-interpolate": "1.2.0 - 3",1269+ "d3-time": "2.1.1 - 3",1270+ "d3-time-format": "2 - 4"1271+ },1272+ "engines": {1273+ "node": ">=12"1274+ }1275+ },1276+ "node_modules/d3-scale-chromatic": {1277+ "version": "3.1.0",1278+ "resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz",1279+ "integrity": "sha512-A3s5PWiZ9YCXFye1o246KoscMWqf8BsD9eRiJ3He7C9OBaxKhAd5TFCdEx/7VbKtxxTsu//1mMJFrEt572cEyQ==",1280+ "license": "ISC",1281+ "dependencies": {1282+ "d3-color": "1 - 3",1283+ "d3-interpolate": "1 - 3"1284+ },1285+ "engines": {1286+ "node": ">=12"1287+ }1288+ },1289+ "node_modules/d3-selection": {1290+ "version": "3.0.0",1291+ "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz",1292+ "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==",1293+ "license": "ISC",1294+ "engines": {1295+ "node": ">=12"1296+ }1297+ },1298+ "node_modules/d3-shape": {1299+ "version": "3.2.0",1300+ "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz",1301+ "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==",1302+ "license": "ISC",1303+ "dependencies": {1304+ "d3-path": "^3.1.0"1305+ },1306+ "engines": {1307+ "node": ">=12"1308+ }1309+ },1310+ "node_modules/d3-time": {1311+ "version": "3.1.0",1312+ "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz",1313+ "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==",1314+ "license": "ISC",1315+ "dependencies": {1316+ "d3-array": "2 - 3"1317+ },1318+ "engines": {1319+ "node": ">=12"1320+ }1321+ },1322+ "node_modules/d3-time-format": {1323+ "version": "4.1.0",1324+ "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz",1325+ "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==",1326+ "license": "ISC",1327+ "dependencies": {1328+ "d3-time": "1 - 3"1329+ },1330+ "engines": {1331+ "node": ">=12"1332+ }1333+ },1334+ "node_modules/d3-timer": {1335+ "version": "3.0.1",1336+ "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz",1337+ "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==",1338+ "license": "ISC",1339+ "engines": {1340+ "node": ">=12"1341+ }1342+ },1343+ "node_modules/d3-transition": {1344+ "version": "3.0.1",1345+ "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.1.tgz",1346+ "integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==",1347+ "license": "ISC",1348+ "dependencies": {1349+ "d3-color": "1 - 3",1350+ "d3-dispatch": "1 - 3",1351+ "d3-ease": "1 - 3",1352+ "d3-interpolate": "1 - 3",1353+ "d3-timer": "1 - 3"1354+ },1355+ "engines": {1356+ "node": ">=12"1357+ },1358+ "peerDependencies": {1359+ "d3-selection": "2 - 3"1360+ }1361+ },1362+ "node_modules/d3-zoom": {1363+ "version": "3.0.0",1364+ "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz",1365+ "integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==",1366+ "license": "ISC",1367+ "dependencies": {1368+ "d3-dispatch": "1 - 3",1369+ "d3-drag": "2 - 3",1370+ "d3-interpolate": "1 - 3",1371+ "d3-selection": "2 - 3",1372+ "d3-transition": "2 - 3"1373+ },1374+ "engines": {1375+ "node": ">=12"1376+ }1377+ },1378+ "node_modules/dagre-d3-es": {1379+ "version": "7.0.14",1380+ "resolved": "https://registry.npmjs.org/dagre-d3-es/-/dagre-d3-es-7.0.14.tgz",1381+ "integrity": "sha512-P4rFMVq9ESWqmOgK+dlXvOtLwYg0i7u0HBGJER0LZDJT2VHIPAMZ/riPxqJceWMStH5+E61QxFra9kIS3AqdMg==",1382+ "license": "MIT",1383+ "dependencies": {1384+ "d3": "^7.9.0",1385+ "lodash-es": "^4.17.21"1386+ }1387+ },1388+ "node_modules/dayjs": {1389+ "version": "1.11.23",1390+ "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.23.tgz",1391+ "integrity": "sha512-QDTCU0M0MxR3hQfnlDJfwekQiaanm1ubOD231u73WBckQ/fsamwRLiE2GBz6D3a/xF1NgfiDLJjXBa1hYOYTtQ==",1392+ "license": "MIT"1393+ },1394+ "node_modules/delaunator": {1395+ "version": "5.1.0",1396+ "resolved": "https://registry.npmjs.org/delaunator/-/delaunator-5.1.0.tgz",1397+ "integrity": "sha512-AGrQ4QSgssa1NGmWmLPqN5NY2KajF5MqxetNEO+o0n3ZwZZeTmt7bBnvzHWrmkZFxGgr4HdyFgelzgi06otLuQ==",1398+ "license": "ISC",1399+ "dependencies": {1400+ "robust-predicates": "^3.0.2"1401+ }1402+ },5421403 "node_modules/detect-libc": {5431404 "version": "2.1.2",5441405 "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",@@ -549,6 +1410,36 @@
5491410 "node": ">=8"5501411 }5511412 },1413+ "node_modules/dompurify": {1414+ "version": "3.4.14",1415+ "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.14.tgz",1416+ "integrity": "sha512-dVoH9z+MY+C9IilgGCk3YfFqjLi3fChm2OiKJMzh6axrJ5qwxqWaZamgmHrpv22CN/KdbZJuGEGgfQoL00LTdg==",1417+ "license": "(MPL-2.0 OR Apache-2.0)",1418+ "optionalDependencies": {1419+ "@types/trusted-types": "^2.0.7"1420+ }1421+ },1422+ "node_modules/es-toolkit": {1423+ "version": "1.51.0",1424+ "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.51.0.tgz",1425+ "integrity": "sha512-zC2lQGkM7QX+Gm6iM3+WIdZJzthsEd14LvRNJneSO2hzyz/zNBENR8+YXWo1cKxgPBtV6ksPYHELbcwBRzmdCw==",1426+ "license": "MIT",1427+ "workspaces": [1428+ "docs",1429+ "benchmarks",1430+ "tests/types",1431+ "tests/browser-compat"1432+ ]1433+ },1434+ "node_modules/fastdom": {1435+ "version": "1.0.12",1436+ "resolved": "https://registry.npmjs.org/fastdom/-/fastdom-1.0.12.tgz",1437+ "integrity": "sha512-LB+xjSTEbjHE1cWsxu+tN2Xqr1kpi+V9aADI7sVM5ZMaXyYGPHULQMzpJMYqOTULK/73pUkWVzzObFRBkPr+hg==",1438+ "license": "MIT",1439+ "dependencies": {1440+ "strictdom": "^1.0.1"1441+ }1442+ },5521443 "node_modules/fdir": {5531444 "version": "6.5.0",5541445 "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",@@ -582,6 +1473,79 @@
5821473 "node": "^8.16.0 || ^10.6.0 || >=11.0.0"5831474 }5841475 },1476+ "node_modules/hachure-fill": {1477+ "version": "0.5.2",1478+ "resolved": "https://registry.npmjs.org/hachure-fill/-/hachure-fill-0.5.2.tgz",1479+ "integrity": "sha512-3GKBOn+m2LX9iq+JC1064cSFprJY4jL1jCXTcpnfER5HYE2l/4EfWSGzkPa/ZDBmYI0ZOEj5VHV/eKnPGkHuOg==",1480+ "license": "MIT"1481+ },1482+ "node_modules/iconv-lite": {1483+ "version": "0.6.3",1484+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",1485+ "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",1486+ "license": "MIT",1487+ "dependencies": {1488+ "safer-buffer": ">= 2.1.2 < 3.0.0"1489+ },1490+ "engines": {1491+ "node": ">=0.10.0"1492+ }1493+ },1494+ "node_modules/import-meta-resolve": {1495+ "version": "4.2.0",1496+ "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.2.0.tgz",1497+ "integrity": "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==",1498+ "license": "MIT",1499+ "funding": {1500+ "type": "github",1501+ "url": "https://github.com/sponsors/wooorm"1502+ }1503+ },1504+ "node_modules/internmap": {1505+ "version": "2.0.3",1506+ "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz",1507+ "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==",1508+ "license": "ISC",1509+ "engines": {1510+ "node": ">=12"1511+ }1512+ },1513+ "node_modules/katex": {1514+ "version": "0.16.47",1515+ "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.47.tgz",1516+ "integrity": "sha512-Eeo8Ys1doU1z+x8AZsPpQu+p/QcZBI5PeOo7QGQdy2x2m0MU/hYagBbGOmXwr5KVbEfVuWv9LpnQWeehogurjg==",1517+ "funding": [1518+ "https://opencollective.com/katex",1519+ "https://github.com/sponsors/katex"1520+ ],1521+ "license": "MIT",1522+ "dependencies": {1523+ "commander": "^8.3.0"1524+ },1525+ "bin": {1526+ "katex": "cli.js"1527+ }1528+ },1529+ "node_modules/katex/node_modules/commander": {1530+ "version": "8.3.0",1531+ "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz",1532+ "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==",1533+ "license": "MIT",1534+ "engines": {1535+ "node": ">= 12"1536+ }1537+ },1538+ "node_modules/khroma": {1539+ "version": "2.1.0",1540+ "resolved": "https://registry.npmjs.org/khroma/-/khroma-2.1.0.tgz",1541+ "integrity": "sha512-Ls993zuzfayK269Svk9hzpeGUKob/sIgZzyHYdjQoAdQetRKpOLj+k/QQQ/6Qi0Yz65mlROrfd+Ev+1+7dz9Kw=="1542+ },1543+ "node_modules/layout-base": {1544+ "version": "1.0.2",1545+ "resolved": "https://registry.npmjs.org/layout-base/-/layout-base-1.0.2.tgz",1546+ "integrity": "sha512-8h2oVEZNktL4BH2JCOI90iD1yXwL6iNW7KcCKT2QZgQJR2vbqDsldCTPRU9NifTCqHZci57XvQQ15YTu+sTYPg==",1547+ "license": "MIT"1548+ },5851549 "node_modules/lightningcss": {5861550 "version": "1.33.0",5871551 "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz",@@ -855,6 +1819,54 @@
8551819 "url": "https://opencollective.com/parcel"8561820 }8571821 },1822+ "node_modules/lodash-es": {1823+ "version": "4.18.1",1824+ "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.18.1.tgz",1825+ "integrity": "sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==",1826+ "license": "MIT"1827+ },1828+ "node_modules/marked": {1829+ "version": "16.4.2",1830+ "resolved": "https://registry.npmjs.org/marked/-/marked-16.4.2.tgz",1831+ "integrity": "sha512-TI3V8YYWvkVf3KJe1dRkpnjs68JUPyEa5vjKrp1XEEJUAOaQc+Qj+L1qWbPd0SJuAdQkFU0h73sXXqwDYxsiDA==",1832+ "license": "MIT",1833+ "bin": {1834+ "marked": "bin/marked.js"1835+ },1836+ "engines": {1837+ "node": ">= 20"1838+ }1839+ },1840+ "node_modules/mermaid": {1841+ "version": "11.17.0",1842+ "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-11.17.0.tgz",1843+ "integrity": "sha512-Jo9N377Wb4MSnHFPTbLi2SxFpsQl4eVHoxnW5U1Md9EazvgMp3s+4ohDxr81YNTgbn5Kj7HJ3yslrSJ52kwpbA==",1844+ "license": "MIT",1845+ "dependencies": {1846+ "@braintree/sanitize-url": "^7.1.2",1847+ "@iconify/utils": "^3.0.2",1848+ "@mermaid-js/parser": "^1.2.1",1849+ "@types/d3": "^7.4.3",1850+ "@upsetjs/venn.js": "^2.0.0",1851+ "cytoscape": "^3.34.0",1852+ "cytoscape-cose-bilkent": "^4.1.0",1853+ "cytoscape-fcose": "^2.2.0",1854+ "d3": "^7.9.0",1855+ "d3-sankey": "^0.12.3",1856+ "dagre-d3-es": "7.0.14",1857+ "dayjs": "^1.11.21",1858+ "dompurify": "^3.3.3",1859+ "es-toolkit": "^1.45.1",1860+ "fastdom": "1.0.12",1861+ "katex": "^0.16.47",1862+ "khroma": "^2.1.0",1863+ "marked": "^16.3.0",1864+ "roughjs": "^4.6.6",1865+ "stylis": "^4.3.6",1866+ "ts-dedent": "^2.2.0",1867+ "uuid": "^11.1.0 || ^12 || ^13 || ^14.0.0"1868+ }1869+ },8581870 "node_modules/nanoid": {8591871 "version": "3.3.18",8601872 "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz",@@ -874,6 +1886,12 @@
8741886 "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"8751887 }8761888 },1889+ "node_modules/package-manager-detector": {1890+ "version": "1.8.0",1891+ "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-1.8.0.tgz",1892+ "integrity": "sha512-yQA4H19AmPEoMUeavPMDIe1higySl/gH/yaQrkT/s07Qp+7pp2hYz30N3z2l5BkjVkF9Ow6o0wjJamm2y7Sn0A==",1893+ "license": "MIT"1894+ },8771895 "node_modules/pako": {8781896 "version": "3.0.1",8791897 "resolved": "https://registry.npmjs.org/pako/-/pako-3.0.1.tgz",@@ -890,6 +1908,12 @@
8901908 ],8911909 "license": "(MIT AND Zlib)"8921910 },1911+ "node_modules/path-data-parser": {1912+ "version": "0.1.0",1913+ "resolved": "https://registry.npmjs.org/path-data-parser/-/path-data-parser-0.1.0.tgz",1914+ "integrity": "sha512-NOnmBpt5Y2RWbuv0LMzsayp3lVylAHLPUTut412ZA3l+C4uw4ZVkQbjShYCQ8TCpUMdPapr4YjUqLYD6v68j+w==",1915+ "license": "MIT"1916+ },8931917 "node_modules/picocolors": {8941918 "version": "1.1.1",8951919 "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",@@ -910,6 +1934,22 @@
9101934 "url": "https://github.com/sponsors/jonschlinkert"9111935 }9121936 },1937+ "node_modules/points-on-curve": {1938+ "version": "0.2.0",1939+ "resolved": "https://registry.npmjs.org/points-on-curve/-/points-on-curve-0.2.0.tgz",1940+ "integrity": "sha512-0mYKnYYe9ZcqMCWhUjItv/oHjvgEsfKvnUTg8sAtnHr3GVy7rGkXCb6d5cSyqrWqL4k81b9CPg3urd+T7aop3A==",1941+ "license": "MIT"1942+ },1943+ "node_modules/points-on-path": {1944+ "version": "0.2.1",1945+ "resolved": "https://registry.npmjs.org/points-on-path/-/points-on-path-0.2.1.tgz",1946+ "integrity": "sha512-25ClnWWuw7JbWZcgqY/gJ4FQWadKxGWk+3kR/7kD0tCaDtPPMj7oHu2ToLaVhfpnHrZzYby2w6tUA0eOIuUg8g==",1947+ "license": "MIT",1948+ "dependencies": {1949+ "path-data-parser": "0.1.0",1950+ "points-on-curve": "0.2.0"1951+ }1952+ },9131953 "node_modules/postcss": {9141954 "version": "8.5.26",9151955 "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.26.tgz",@@ -939,6 +1979,12 @@
9391979 "node": "^10 || ^12 || >=14"9401980 }9411981 },1982+ "node_modules/robust-predicates": {1983+ "version": "3.0.3",1984+ "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.3.tgz",1985+ "integrity": "sha512-NS3levdsRIUOmiJ8FZWCP7LG3QpJyrs/TE0Zpf1yvZu8cAJJ6QMW92H1c7kWpdIHo8RvmLxN/o2JXTKHp74lUA==",1986+ "license": "Unlicense"1987+ },9421988 "node_modules/rolldown": {9431989 "version": "1.2.5",9441990 "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.5.tgz",@@ -973,6 +2019,42 @@
9732019 "@rolldown/binding-win32-x64-msvc": "1.2.5"9742020 }9752021 },2022+ "node_modules/roughjs": {2023+ "version": "4.6.6",2024+ "resolved": "https://registry.npmjs.org/roughjs/-/roughjs-4.6.6.tgz",2025+ "integrity": "sha512-ZUz/69+SYpFN/g/lUlo2FXcIjRkSu3nDarreVdGGndHEBJ6cXPdKguS8JGxwj5HA5xIbVKSmLgr5b3AWxtRfvQ==",2026+ "license": "MIT",2027+ "dependencies": {2028+ "hachure-fill": "^0.5.2",2029+ "path-data-parser": "^0.1.0",2030+ "points-on-curve": "^0.2.0",2031+ "points-on-path": "^0.2.1"2032+ }2033+ },2034+ "node_modules/rw": {2035+ "version": "1.3.3",2036+ "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz",2037+ "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==",2038+ "license": "BSD-3-Clause"2039+ },2040+ "node_modules/safer-buffer": {2041+ "version": "2.1.2",2042+ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",2043+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",2044+ "license": "MIT"2045+ },2046+ "node_modules/saxes": {2047+ "version": "6.0.0",2048+ "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz",2049+ "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==",2050+ "license": "ISC",2051+ "dependencies": {2052+ "xmlchars": "^2.2.0"2053+ },2054+ "engines": {2055+ "node": ">=v12.22.7"2056+ }2057+ },9762058 "node_modules/source-map-js": {9772059 "version": "1.2.1",9782060 "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",@@ -983,12 +2065,33 @@
9832065 "node": ">=0.10.0"9842066 }9852067 },2068+ "node_modules/strictdom": {2069+ "version": "1.0.1",2070+ "resolved": "https://registry.npmjs.org/strictdom/-/strictdom-1.0.1.tgz",2071+ "integrity": "sha512-cEmp9QeXXRmjj/rVp9oyiqcvyocWab/HaoN4+bwFeZ7QzykJD6L3yD4v12K1x0tHpqRqVpJevN3gW7kyM39Bqg==",2072+ "license": "MIT"2073+ },9862074 "node_modules/style-mod": {9872075 "version": "4.1.3",9882076 "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.3.tgz",9892077 "integrity": "sha512-i/n8VsZydrugj3Iuzll8+x/00GH2vnYsk1eomD8QiRrSAeW6ItbCQDtfXCeJHd0iwiNagqjQkvpvREEPtW3IoQ==",9902078 "license": "MIT"9912079 },2080+ "node_modules/stylis": {2081+ "version": "4.4.0",2082+ "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.4.0.tgz",2083+ "integrity": "sha512-5Z9ZpRzfuH6l/UAvCPAPUo3665Nk2wLaZU3x+TLHKVzIz33+sbJqbtrYoC3KD4/uVOr2Zp+L0LySezP9OHV9yA==",2084+ "license": "MIT"2085+ },2086+ "node_modules/tinyexec": {2087+ "version": "1.3.0",2088+ "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.0.tgz",2089+ "integrity": "sha512-QKAl9m8gWWGHV8jZcPeym6j+XULi6tOf1mT83WYJ4Lk2ytW/uwAWkrP0uFsdoYMdueVJ0qs26wZ+23xeB4ibNQ==",2090+ "license": "MIT",2091+ "engines": {2092+ "node": ">=18"2093+ }2094+ },9922095 "node_modules/tinyglobby": {9932096 "version": "0.2.17",9942097 "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz",@@ -1006,6 +2109,28 @@
10062109 "url": "https://github.com/sponsors/SuperchupuDev"10072110 }10082111 },2112+ "node_modules/ts-dedent": {2113+ "version": "2.3.0",2114+ "resolved": "https://registry.npmjs.org/ts-dedent/-/ts-dedent-2.3.0.tgz",2115+ "integrity": "sha512-JfJeIHke7y2egdGGgRAvpCwYFUsHlM2gPcrVOxFkznt/4uzQ7HFmvE63iFHVLBJNDuyDOQgijDK/tXH/f6Msjg==",2116+ "license": "MIT",2117+ "engines": {2118+ "node": ">=6.10"2119+ }2120+ },2121+ "node_modules/uuid": {2122+ "version": "14.0.2",2123+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.2.tgz",2124+ "integrity": "sha512-xZe/16rV4aa+HGSOCiY2YeLT1OybRLrrkL/Rqaq7p7GMVXjFh+6wN4oMYgjFmnSnhY8t6Xpdl2l9qmnHYuMHwQ==",2125+ "funding": [2126+ "https://github.com/sponsors/broofa",2127+ "https://github.com/sponsors/ctavan"2128+ ],2129+ "license": "MIT",2130+ "bin": {2131+ "uuid": "dist-node/bin/uuid"2132+ }2133+ },10092134 "node_modules/vite": {10102135 "version": "8.2.2",10112136 "resolved": "https://registry.npmjs.org/vite/-/vite-8.2.2.tgz",@@ -1089,6 +2214,12 @@
10892214 "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz",10902215 "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==",10912216 "license": "MIT"2217+ },2218+ "node_modules/xmlchars": {2219+ "version": "2.2.0",2220+ "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz",2221+ "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==",2222+ "license": "MIT"10922223 }10932224 }10942225 }@@ -8,7 +8,7 @@
88 },99 "private": true,1010 "scripts": {11- "build:diagramzip": "vite build --config diagramzip/vite.config.js",11+ "build:diagramzip": "vite build --config diagramzip/vite.config.js && vite build --config diagramzip/vite.renderer.config.js",1212 "dev:diagramzip": "vite --config diagramzip/vite.config.js",1313 "test": "node --test-force-exit ci/tests/smoke.js",1414 "test:diagramzip": "node --test diagramzip/test/*.test.js",@@ -26,7 +26,9 @@
2626 "@lezer/highlight": "^1.2.3",2727 "blocked-at": "^1.2.0",2828 "codemirror": "^6.0.2",29- "pako": "^3.0.1"29+ "mermaid": "11.17.0",30+ "pako": "^3.0.1",31+ "saxes": "6.0.0"3032 },3133 "devDependencies": {3234 "vite": "^8.2.2"@@ -0,0 +1,1793 @@
1+var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports);(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var t=[],n=[];(()=>{let e=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o`.split(`,`).map(e=>e?parseInt(e,36):1);for(let r=0,i=0;r<e.length;r++)(r%2?n:t).push(i+=e[r])})();function r(e){if(e<768)return!1;for(let r=0,i=t.length;;){let a=r+i>>1;if(e<t[a])i=a;else if(e>=n[a])r=a+1;else return!0;if(r==i)return!1}}function i(e){return e>=127462&&e<=127487}var a=8205;function o(e,t,n=!0,r=!0){return(n?s:c)(e,t,r)}function s(e,t,n){if(t==e.length)return t;t&&u(e.charCodeAt(t))&&d(e.charCodeAt(t-1))&&t--;let o=l(e,t);for(t+=f(o);t<e.length;){let s=l(e,t);if(o==a||s==a||n&&r(s))t+=f(s),o=s;else if(i(s)){let n=0,r=t-2;for(;r>=0&&i(l(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function c(e,t,n){for(;t>1;){let r=s(e,t-2,n);if(r<t)return r;t--}return 0}function l(e,t){let n=e.charCodeAt(t);if(!d(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return u(r)?(n-55296<<10)+(r-56320)+65536:n}function u(e){return e>=56320&&e<57344}function d(e){return e>=55296&&e<56320}function f(e){return e<65536?1:2}var p=class e{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=re(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),h.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=re(this,e,t);let n=[];return this.decompose(e,t,n,0),h.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new y(this),i=new y(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new y(this,e)}iterRange(e,t=this.length){return new ee(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new te(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new m(t):h.from(m.split(t,[]))}},m=class e extends p{constructor(e,t=g(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new ne(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(v(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=_(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=re(this,t,n);let i=_(this.text,_(r.text,v(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):h.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=`2+`){[e,t]=re(this,e,t);let r=``;for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],s=i+o.length;i>e&&a&&(r+=n),e<s&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},h=class e extends p{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e<=s&&t>=a){let i=r&(a<=e|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=re(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(t>=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines<l>>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=`3+`){[e,t]=re(this,e,t);let r=``;for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],s=a+o.length;a>e&&i&&(r+=n),e<s&&t>a&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new m(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof m&&c&&(n=u[u.length-1])instanceof m&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new m(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}};p.empty=new m([``],0);function g(e){let t=-1;for(let n of e)t+=n.length+1;return t}function _(e,t,n=0,r=1e9){for(let i=0,a=0,o=!0;a<e.length&&i<=r;a++){let s=e[a],c=i+s.length;c>=n&&(c>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),o?(t[t.length-1]+=s,o=!1):t.push(s)),i=c+1}return t}function v(e,t,n){return _(e,[``],t,n)}var y=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=``,this.nodes=[e],this.offsets=[t>0?1:(e instanceof m?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof m?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`4+`,this;e--}else if(r instanceof m){let i=r.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=e==0?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[a+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof m?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},ee=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new y(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=``,this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=``}},te=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=``,this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=``,this.afterBreak=!1):t?(this.done=!0,this.value=``):n?this.afterBreak?this.value=``:(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<`u`&&(p.prototype[Symbol.iterator]=function(){return this.iter()},y.prototype[Symbol.iterator]=ee.prototype[Symbol.iterator]=te.prototype[Symbol.iterator]=function(){return this});var ne=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function re(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function b(e,t,n=!0,r=!0){return o(e,t,n,r)}function ie(e){return e>=56320&&e<57344}function ae(e){return e>=55296&&e<56320}function x(e,t){let n=e.charCodeAt(t);if(!ae(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return ie(r)?(n-55296<<10)+(r-56320)+65536:n}function oe(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function S(e){return e<65536?1:2}var se=/\r\n?|\n/,ce=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(ce||={}),le=class e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],a=this.sections[t++];a<0?(e(n,r,i),r+=i):r+=a,n+=i}}iterChangedRanges(e,t=!1){de(this,e,t)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],r=this.sections[e++];r<0?t.push(n,r):t.push(r,n)}return new e(t)}composeDesc(e){return this.empty?e:e.empty?this:pe(this,e)}mapDesc(e,t=!1){return e.empty?this:fe(this,e,t)}mapPos(e,t=-1,n=ce.Simple){let r=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],s=this.sections[a++],c=r+o;if(s<0){if(c>e)return i+(e-r);i+=o}else{if(n!=ce.Simple&&c>=e&&(n==ce.TrackDel&&r<e&&c>e||n==ce.TrackBefore&&r<e||n==ce.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],a=this.sections[n++],o=r+i;if(a>=0&&r<=t&&o>=e)return r<e&&o>t?`cover`:!0;r=o}return!1}toString(){let e=``;for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?` `:``)+n+(r>=0?`:`+r:``)}return e}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!=`number`))throw RangeError(`Invalid JSON representation of ChangeDesc`);return new e(t)}static create(t){return new e(t)}},C=class e extends le{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError(`Applying change set to a document with the wrong length`);return de(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return fe(this,e,t,!0)}invert(t){let n=this.sections.slice(),r=[];for(let e=0,i=0;e<n.length;e+=2){let a=n[e],o=n[e+1];if(o>=0){n[e]=o,n[e+1]=a;let s=e>>1;for(;r.length<s;)r.push(p.empty);r.push(a?t.slice(i,i+a):p.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:pe(this,e,!0)}map(e,t=!1){return e.empty?this:fe(this,e,t,!0)}iterChanges(e,t=!1){de(this,e,t)}get desc(){return le.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new me(this);done:for(let e=0,o=0;;){let s=e==t.length?1e9:t[e++];for(;o<s||o==s&&a.len==0;){if(a.done)break done;let e=Math.min(a.len,s-o);w(i,e,-1);let t=a.ins==-1?-1:a.off==0?a.ins:0;w(n,e,t),t>0&&ue(r,n,a.text),a.forward(e),o+=e}let c=t[e++];for(;o<c;){if(a.done)break done;let e=Math.min(a.len,c-o);w(n,e,-1),w(i,e,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(e),o+=e}}return{changes:new e(n,r),filtered:le.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(t,n,r){let i=[],a=[],o=0,s=null;function c(t=!1){if(!t&&!i.length)return;o<n&&w(i,n-o,-1);let r=new e(i,a);s=s?s.compose(r.map(s)):r,i=[],a=[],o=0}function l(t){if(Array.isArray(t))for(let e of t)l(e);else if(t instanceof e){if(t.length!=n)throw RangeError(`Mismatched change set length (got ${t.length}, expected ${n})`);c(),s=s?s.compose(t.map(s)):t}else{let{from:e,to:s=e,insert:l}=t;if(e>s||e<0||s>n)throw RangeError(`Invalid change range ${e} to ${s} (in doc of length ${n})`);let u=l?typeof l==`string`?p.of(l.split(r||se)):l:p.empty,d=u.length;if(e==s&&d==0)return;e<o&&c(),e>o&&w(i,e-o,-1),w(i,s-e,d),ue(a,i,u),o=s}}return l(t),c(!s),s}static empty(t){return new e(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw RangeError(`Invalid JSON representation of ChangeSet`);let n=[],r=[];for(let e=0;e<t.length;e++){let i=t[e];if(typeof i==`number`)n.push(i,-1);else if(!Array.isArray(i)||typeof i[0]!=`number`||i.some((e,t)=>t&&typeof e!=`string`))throw RangeError(`Invalid JSON representation of ChangeSet`);else if(i.length==1)n.push(i[0],0);else{for(;r.length<e;)r.push(p.empty);r[e]=p.of(i.slice(1)),n.push(i[0],r[e].length)}}return new e(n,r)}static createSet(t,n){return new e(t,n)}};function w(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function ue(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(p.empty);e.push(n)}}function de(e,t,n){let r=e.inserted;for(let i=0,a=0,o=0;o<e.sections.length;){let s=e.sections[o++],c=e.sections[o++];if(c<0)i+=s,a+=s;else{let l=i,u=a,d=p.empty;for(;l+=s,u+=c,c&&r&&(d=d.append(r[o-2>>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)s=e.sections[o++],c=e.sections[o++];t(i,l,a,u,d),i=l,a=u}}}function fe(e,t,n,r=!1){let i=[],a=r?[]:null,o=new me(e),s=new me(t);for(let e=-1;;)if(o.done&&s.len||s.done&&o.len)throw Error(`Mismatched change set lengths`);else if(o.ins==-1&&s.ins==-1){let e=Math.min(o.len,s.len);w(i,e,-1),o.forward(e),s.forward(e)}else if(s.ins>=0&&(o.ins<0||e==o.i||o.off==0&&(s.len<o.len||s.len==o.len&&!n))){let t=s.len;for(w(i,s.ins,-1);t;){let n=Math.min(o.len,t);o.ins>=0&&e<o.i&&o.len<=n&&(w(i,0,o.ins),a&&ue(a,i,o.text),e=o.i),o.forward(n),t-=n}s.next()}else if(o.ins>=0){let t=0,n=o.len;for(;n;)if(s.ins==-1){let e=Math.min(n,s.len);t+=e,n-=e,s.forward(e)}else if(s.ins==0&&s.len<n)n-=s.len,s.next();else break;w(i,t,e<o.i?o.ins:0),a&&e<o.i&&ue(a,i,o.text),e=o.i,o.forward(o.len-n)}else if(o.done&&s.done)return a?C.createSet(i,a):le.create(i);else throw Error(`Mismatched change set lengths`)}function pe(e,t,n=!1){let r=[],i=n?[]:null,a=new me(e),o=new me(t);for(let e=!1;;)if(a.done&&o.done)return i?C.createSet(r,i):le.create(r);else if(a.ins==0)w(r,a.len,0,e),a.next();else if(o.len==0&&!o.done)w(r,0,o.ins,e),i&&ue(i,r,o.text),o.next();else if(a.done||o.done)throw Error(`Mismatched change set lengths`);else{let t=Math.min(a.len2,o.len),n=r.length;if(a.ins==-1){let n=o.ins==-1?-1:o.off?0:o.ins;w(r,t,n,e),i&&n&&ue(i,r,o.text)}else o.ins==-1?(w(r,a.off?0:a.len,t,e),i&&ue(i,r,a.textBit(t))):(w(r,a.off?0:a.len,o.off?0:o.ins,e),i&&!o.off&&ue(i,r,o.text));e=(a.ins>t||o.ins>=0&&o.len>t)&&(e||r.length>n),a.forward2(t),o.forward(t)}}var me=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?p.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?p.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},he=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.flags=n,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new e(r,i,this.flags,this.goalColumn)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return T.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return T.range(this.anchor,r,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!=`number`||typeof e.head!=`number`)throw RangeError(`Invalid JSON representation for SelectionRange`);return T.range(e.anchor,e.head)}static create(t,n,r,i){return new e(t,n,r,i)}},T=class e{constructor(e,t){this.ranges=e,this.mainIndex=t}map(t,n=-1){return t.empty?this:e.create(this.ranges.map(e=>e.map(t,n)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new e([this.main],0)}addRange(t,n=!0){return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!=`number`||t.main>=t.ranges.length)throw RangeError(`Invalid JSON representation for EditorSelection`);return new e(t.ranges.map(e=>he.fromJSON(e)),t.main)}static single(t,n=t){return new e([e.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw RangeError(`A selection needs at least one range`);for(let r=0,i=0;i<t.length;i++){let a=t[i];if(a.empty?a.from<=r:a.from<r)return e.normalized(t.slice(),n);r=a.to}return new e(t,n)}static cursor(e,t=0,n,r){return he.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n)),r)}static range(e,t,n,r,i){let a=r==null?7:Math.min(6,r);return!i&&e!=t&&(i=t<e?1:-1),i&&(a|=i<0?8:16),t<e?he.create(t,e,a|32,n):he.create(e,t,a,n)}static undirectionalRange(e,t){return he.create(e,t,64,void 0)}static normalized(t,n=0){let r=t[n];t.sort((e,t)=>e.from-t.from),n=t.indexOf(r);for(let r=1;r<t.length;r++){let i=t[r],a=t[r-1];if(i.empty?i.from<=a.to:i.from<a.to){let o=a.from,s=Math.max(i.to,a.to);r<=n&&n--,t.splice(--r,2,i.anchor>i.head?e.range(s,o):e.range(o,s))}}return new e(t,n)}};function ge(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError(`Selection points outside of document`)}var _e=0,E=class e{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=_e++,this.default=e([]),this.extensions=typeof i==`function`?i(this):i}get reader(){return this}static define(t={}){return new e(t.combine||(e=>e),t.compareInput||((e,t)=>e===t),t.compare||(t.combine?(e,t)=>e===t:ve),!!t.static,t.enables)}of(e){return new ye([],this,0,e)}compute(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new ye(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new ye(e,this,2,t)}from(e,t){return t||=e=>e,this.compute([e],n=>t(n.field(e)))}};function ve(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}var ye=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=_e++}dynamicSlot(e){let t=this.value,n=this.facet.compareInput,r=this.id,i=e[r]>>1,a=this.type==2,o=!1,s=!1,c=[];for(let t of this.dependencies)t==`doc`?o=!0:t==`selection`?s=!0:(e[t.id]??1)&1||c.push(e[t.id]);return{create(e){return e.values[i]=t(e),1},update(e,r){if(o&&r.docChanged||s&&(r.docChanged||r.selection)||xe(e,c)){let r=t(e);if(a?!be(r,e.values[i],n):!n(r,e.values[i]))return e.values[i]=r,1}return 0},reconfigure:(e,o)=>{let s,c=o.config.address[r];if(c!=null){let r=Pe(o,c);if(this.dependencies.every(t=>t instanceof E?o.facet(t)===e.facet(t):t instanceof we?o.field(t,!1)==e.field(t,!1):!0)||(a?be(s=t(e),r,n):n(s=t(e),r)))return e.values[i]=r,0}else s=t(e);return e.values[i]=s,1}}}get extension(){return this}};function be(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function xe(e,t){let n=!1;for(let r of t)Ne(e,r)&1&&(n=!0);return n}function Se(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),a=r.filter(e=>!(e&1)),o=e[t.id]>>1;function s(e){let n=[];for(let t=0;t<r.length;t++){let a=Pe(e,r[t]);if(i[t]==2)for(let e of a)n.push(e);else n.push(a)}return t.combine(n)}return{create(e){for(let t of r)Ne(e,t);return e.values[o]=s(e),1},update(e,n){if(!xe(e,a))return 0;let r=s(e);return t.compare(r,e.values[o])?0:(e.values[o]=r,1)},reconfigure(e,i){let a=xe(e,r),c=i.config.facets[t.id],l=i.facet(t);if(c&&!a&&ve(n,c))return e.values[o]=l,0;let u=s(e);return t.compare(u,l)?(e.values[o]=l,0):(e.values[o]=u,1)}}}var Ce=E.define({static:!0}),we=class e{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(t){let n=new e(_e++,t.create,t.update,t.compare||((e,t)=>e===t),t);return t.provide&&(n.provides=t.provide(n)),n}create(e){return(e.facet(Ce).find(e=>e.field==this)?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet(Ce),i=n.facet(Ce),a;return(a=r.find(e=>e.field==this))&&a!=i.find(e=>e.field==this)?(e.values[t]=a.create(e),1):n.config.address[this.id]==null?(e.values[t]=this.create(e),1):(e.values[t]=n.field(this),0)}}}init(e){return[this,Ce.of({field:this,create:e})]}get extension(){return this}},Te={lowest:4,low:3,default:2,high:1,highest:0};function Ee(e){return t=>new Oe(t,e)}var De={highest:Ee(Te.highest),high:Ee(Te.high),default:Ee(Te.default),low:Ee(Te.low),lowest:Ee(Te.lowest)},Oe=class{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}},ke=class e{of(e){return new Ae(this,e)}reconfigure(t){return e.reconfigure.of({compartment:this,extension:t})}get(e){return e.config.compartments.get(this)}},Ae=class{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}},je=class e{constructor(e,t,n,r,i,a){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(t,n,r){let i=[],a=Object.create(null),o=new Map;for(let e of Me(t,n,o))e instanceof we?i.push(e):(a[e.facet.id]||(a[e.facet.id]=[])).push(e);let s=Object.create(null),c=[],l=[];for(let e of i)s[e.id]=l.length<<1,l.push(t=>e.slot(t));let u=r?.config.facets;for(let e in a){let t=a[e],n=t[0].facet,i=u&&u[e]||[];if(t.every(e=>e.type==0)){if(s[n.id]=c.length<<1|1,ve(i,t))c.push(r.facet(n));else{let e=n.combine(t.map(e=>e.value));c.push(r&&n.compare(e,r.facet(n))?r.facet(n):e)}}else{for(let e of t)e.type==0?(s[e.id]=c.length<<1|1,c.push(e.value)):(s[e.id]=l.length<<1,l.push(t=>e.dynamicSlot(t)));s[n.id]=l.length<<1,l.push(e=>Se(e,n,t))}}let d=l.map(e=>e(s));return new e(t,o,d,s,c,a)}};function Me(e,t,n){let r=[[],[],[],[],[]],i=new Map;function a(e,o){let s=i.get(e);if(s!=null){if(s<=o)return;let t=r[s].indexOf(e);t>-1&&r[s].splice(t,1),e instanceof Ae&&n.delete(e.compartment)}if(i.set(e,o),Array.isArray(e))for(let t of e)a(t,o);else if(e instanceof Ae){if(n.has(e.compartment))throw RangeError(`Duplicate use of compartment in extensions`);let r=t.get(e.compartment)||e.inner;n.set(e.compartment,r),a(r,o)}else if(e instanceof Oe)a(e.inner,e.prec);else if(e instanceof we)r[o].push(e),e.provides&&a(e.provides,o);else if(e instanceof ye)r[o].push(e),e.facet.extensions&&a(e.facet.extensions,Te.default);else{let t=e.extension;if(!t)throw Error(`Unrecognized extension value in extension set (${e}).`);if(t==e)throw Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(t,o)}}return a(e,Te.default),r.reduce((e,t)=>e.concat(t))}function Ne(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw Error(`Cyclic dependency between fields and/or facets`);if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function Pe(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}var Fe=E.define(),Ie=E.define({combine:e=>e.some(e=>e),static:!0}),Le=E.define({combine:e=>e.length?e[0]:void 0,static:!0}),Re=E.define(),ze=E.define(),Be=E.define(),Ve=E.define({combine:e=>e.length?e[0]:!1}),He=class{constructor(e,t){this.type=e,this.value=t}static define(){return new Ue}},Ue=class{of(e){return new He(this,e)}},We=class{constructor(e){this.map=e}of(e){return new D(this,e)}},D=class e{constructor(e,t){this.type=e,this.value=t}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new e(this.type,n)}is(e){return this.type==e}static define(e={}){return new We(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}};D.reconfigure=D.define(),D.appendConfig=D.define();var O=class e{constructor(t,n,r,i,a,o){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,r&&ge(r,n.newLength),a.some(t=>t.type==e.time)||(this.annotations=a.concat(e.time.of(Date.now())))}static create(t,n,r,i,a,o){return new e(t,n,r,i,a,o)}get newDoc(){return this._doc||=this.changes.apply(this.startState.doc)}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(e.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]==`.`))}};O.time=He.define(),O.userEvent=He.define(),O.addToHistory=He.define(),O.remote=He.define();function Ge(e,t){let n=[];for(let r=0,i=0;;){let a,o;if(r<e.length&&(i==t.length||t[i]>=e[r]))a=e[r++],o=e[r++];else if(i<t.length)a=t[i++],o=t[i++];else return n;!n.length||n[n.length-1]<a?n.push(a,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function Ke(e,t,n){let r,i,a;return n?(r=t.changes,i=C.empty(t.changes.length),a=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),i=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(r)),{changes:a,selection:t.selection?t.selection.map(i):e.selection?.map(r),effects:D.mapEffects(e.effects,r).concat(D.mapEffects(t.effects,i)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function qe(e,t,n){let r=t.selection,i=Xe(t.annotations);return t.userEvent&&(i=i.concat(O.userEvent.of(t.userEvent))),{changes:t.changes instanceof C?t.changes:C.of(t.changes||[],n,e.facet(Le)),selection:r&&(r instanceof T?r:T.single(r.anchor,r.head)),effects:Xe(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function Je(e,t,n){let r=qe(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let i=1;i<t.length;i++){t[i].filter===!1&&(n=!1);let a=!!t[i].sequential;r=Ke(r,qe(e,t[i],a?r.changes.newLength:e.doc.length),a)}let i=O.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return A(n?k(i):i)}function k(e){let t=e.startState,n=!0;for(let r of t.facet(Re)){let t=r(e);if(t===!1){n=!1;break}Array.isArray(t)&&(n=n===!0?t:Ge(n,t))}if(n!==!0){let r,i;if(n===!1)i=e.changes.invertedDesc,r=C.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,i=t.filtered.mapDesc(t.changes).invertedDesc}e=O.create(t,r,e.selection&&e.selection.map(i),D.mapEffects(e.effects,i),e.annotations,e.scrollIntoView)}let r=t.facet(ze);for(let n=r.length-1;n>=0;n--){let i=r[n](e);e=i instanceof O?i:Array.isArray(i)&&i.length==1&&i[0]instanceof O?i[0]:Je(t,Xe(i),!1)}return e}function A(e){let t=e.startState,n=t.facet(Be),r=e;for(let i=n.length-1;i>=0;i--){let a=n[i](e);a&&Object.keys(a).length&&(r=Ke(r,qe(t,a,e.changes.newLength),!0))}return r==e?e:O.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}var Ye=[];function Xe(e){return e==null?Ye:Array.isArray(e)?e:[e]}var j=(function(e){return e[e.Word=0]=`Word`,e[e.Space=1]=`Space`,e[e.Other=2]=`Other`,e})(j||={}),Ze=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Qe;try{Qe=RegExp(`[\\p{Alphabetic}\\p{Number}_]`,`u`)}catch{}function $e(e){if(Qe)return Qe.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>``&&(n.toUpperCase()!=n.toLowerCase()||Ze.test(n)))return!0}return!1}function et(e){return t=>{if(!/\S/.test(t))return j.Space;if($e(t))return j.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return j.Word;return j.Other}}var M=class e{constructor(e,t,n,r,i,a){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)Ne(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw RangeError(`Field is not present in this state`);return}return Ne(this,n),Pe(this,n)}update(...e){return Je(this,e,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let e of t.effects)e.is(ke.reconfigure)?(n&&=(i=new Map,n.compartments.forEach((e,t)=>i.set(t,e)),null),i.set(e.value.compartment,e.value.extension)):e.is(D.reconfigure)?(n=null,r=e.value):e.is(D.appendConfig)&&(n=null,r=Xe(r).concat(e.value));let a;n?a=t.startState.values.slice():(n=je.resolve(r,i,this),a=new e(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let o=t.startState.facet(Ie)?t.newSelection:t.newSelection.asSingle();new e(n,t.newDoc,o,a,(e,n)=>n.update(e,t),t)}replaceSelection(e){return typeof e==`string`&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:T.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],a=Xe(n.effects);for(let n=1;n<t.ranges.length;n++){let o=e(t.ranges[n]),s=this.changes(o.changes),c=s.map(r);for(let e=0;e<n;e++)i[e]=i[e].map(c);let l=r.mapDesc(s,!0);i.push(o.range.map(l)),r=r.compose(c),a=D.mapEffects(a,c).concat(D.mapEffects(Xe(o.effects),l))}return{changes:r,selection:T.create(i,t.mainIndex),effects:a}}changes(t=[]){return t instanceof C?t:C.of(t,this.doc.length,this.facet(e.lineSeparator))}toText(t){return p.of(t.split(this.facet(e.lineSeparator)||se))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(Ne(this,t),Pe(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof we&&this.config.address[r.id]!=null&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(t,n={},r){if(!t||typeof t.doc!=`string`)throw RangeError(`Invalid JSON representation for EditorState`);let i=[];if(r){for(let e in r)if(Object.prototype.hasOwnProperty.call(t,e)){let n=r[e],a=t[e];i.push(n.init(e=>n.spec.fromJSON(a,e)))}}return e.create({doc:t.doc,selection:T.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=je.resolve(t.extensions||[],new Map),r=t.doc instanceof p?t.doc:p.of((t.doc||``).split(n.staticFacet(e.lineSeparator)||se)),i=t.selection?t.selection instanceof T?t.selection:T.single(t.selection.anchor,t.selection.head):T.single(0);return ge(i,r.length),n.staticFacet(Ie)||(i=i.asSingle()),new e(n,r,i,n.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(e.tabSize)}get lineBreak(){return this.facet(e.lineSeparator)||`5+`}get readOnly(){return this.facet(Ve)}phrase(t,...n){for(let n of this.facet(e.phrases))if(Object.prototype.hasOwnProperty.call(n,t)){t=n[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(e,t)=>{if(t==`$`)return`$`;let r=+(t||1);return!r||r>n.length?e:n[r-1]})),t}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(Fe))for(let a of i(this,t,n))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){let t=this.languageDataAt(`wordChars`,e);return et(t.length?t[0]:``)}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-n,o=e-n;for(;a>0;){let e=b(t,a,!1);if(i(t.slice(e,a))!=j.Word)break;a=e}for(;o<r;){let e=b(t,o);if(i(t.slice(o,e))!=j.Word)break;o=e}return a==o?null:T.range(a+n,o+n)}};M.allowMultipleSelections=Ie,M.tabSize=E.define({combine:e=>e.length?e[0]:4}),M.lineSeparator=Le,M.readOnly=Ve,M.phrases=E.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),M.languageData=Fe,M.changeFilter=Re,M.transactionFilter=ze,M.transactionExtender=Be,ke.reconfigure=D.define();function tt(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let i=t[e],a=r[e];if(a===void 0)r[e]=i;else if(a!==i&&i!==void 0){if(Object.hasOwnProperty.call(n,e))r[e]=n[e](a,i);else throw Error(`Config merge conflict for field `+e)}}for(let e in t)r[e]===void 0&&(r[e]=t[e]);return r}var nt=class{eq(e){return this==e}range(e,t=e){return it.create(e,t,this)}};nt.prototype.startSide=nt.prototype.endSide=0,nt.prototype.point=!1,nt.prototype.mapMode=ce.TrackDel;function rt(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}var it=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,r){return new e(t,n,r)}};function at(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var ot=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let a=r,o=i.length;;){if(a==o)return a;let r=a+o>>1,s=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==a)return s>=0?a:o;s>=0?o=r:a=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),a=this.findIndex(n,1e9,!1,i);i<a;i++)if(r(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(t,n){let r=[],i=[],a=[],o=-1,s=-1;for(let e=0;e<this.value.length;e++){let c=this.value[e],l=this.from[e]+t,u=this.to[e]+t,d,f;if(l==u){let e=n.mapPos(l,c.startSide,c.mapMode);if(e==null||(d=f=e,c.startSide!=c.endSide&&(f=n.mapPos(l,c.endSide),f<d)))continue}else if(d=n.mapPos(l,c.startSide),f=n.mapPos(u,c.endSide),d>f||d==f&&c.startSide>0&&c.endSide<=0)continue;(f-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(s=Math.max(s,f-d)),r.push(c),i.push(d-o),a.push(f-o))}return{mapped:r.length?new e(i,a,r,s):null,pos:o}}},N=class e{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(t,n,r,i){return new e(t,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:a=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(at)),this.isEmpty)return n.length?e.of(n):this;let s=new ut(this,null,-1).goto(0),c=0,l=[],u=new ct;for(;s.value||c<n.length;)if(c<n.length&&(s.from-n[c].from||s.startSide-n[c].value.startSide)>=0){let e=n[c++];u.addInner(e.from,e.to,e.value)||l.push(e)}else s.rangeIndex==1&&s.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(s.chunkIndex)<n[c].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||a<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||a<s.from||o(s.from,s.to,s.value))&&(u.addInner(s.from,s.to,s.value)||l.push(it.create(s.from,s.to,s.value))),s.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?e.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:a}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let e=0;e<this.chunk.length;e++){let a=this.chunkPos[e],o=this.chunk[e],s=t.touchesRange(a,a+o.length);if(s===!1)i=Math.max(i,o.maxPoint),n.push(o),r.push(t.mapPos(a));else if(s===!0){let{mapped:e,pos:s}=o.map(a,t);e&&(i=Math.max(i,e.maxPoint),n.push(e),r.push(s))}}let a=this.nextLayer.map(t);return n.length==0?a:new e(r,n,a||e.empty,i)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],a=this.chunk[r];if(t>=i&&e<=i+a.length&&a.between(i,e-i,t-i,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return dt.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return dt.from(e).goto(t)}static compare(e,t,n,r,i=-1){let a=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=lt(a,o,n),c=new pt(a,s,i),l=new pt(o,s,i);n.iterGaps((e,t,n)=>mt(c,e,l,t,n,r)),n.empty&&n.length==0&&mt(c,0,l,0,0,r)}static eq(e,t,n=0,r){r??=1e9-1;let i=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),a=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let o=lt(i,a),s=new pt(i,o,0).goto(n),c=new pt(a,o,0).goto(n);for(;;){if(s.to!=c.to||!ht(s.active,c.active)||s.point&&(!c.point||!rt(s.point,c.point)))return!1;if(s.to>r)return!0;s.next(),c.next()}}static spans(e,t,n,r,i=-1){let a=new pt(e,null,i).goto(t),o=t,s=a.openStart;for(;;){let e=Math.min(a.to,n);if(a.point){let n=a.activeForPoint(a.to),i=a.pointFrom<t?n.length+1:a.point.startSide<0?n.length:Math.min(n.length,s);r.point(o,e,a.point,n,i,a.pointRank),s=Math.min(a.openEnd(e),n.length)}else e>o&&(r.span(o,e,a.active,s),s=a.openEnd(e));if(a.to>n)return s+(a.point&&a.to>n?1:0);o=a.to,a.next()}}static of(e,t=!1){let n=new ct;for(let r of e instanceof it?[e]:t?st(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(t){if(!t.length)return e.empty;let n=t[t.length-1];for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=e.empty;i=i.nextLayer)n=new e(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}};N.empty=new N([],[],null,-1);function st(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(at(t,r)>0)return e.slice().sort(at);t=r}return e}N.empty.nextLayer=N.empty;var ct=class e{finishChunk(e){this.chunks.push(new ot(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,r){this.addInner(t,n,r)||(this.nextLayer||=new e).add(t,n,r)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(N.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=N.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function lt(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let i=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let a=r.get(e.chunk[t]);a!=null&&(n?n.mapPos(a):a)==e.chunkPos[t]&&!n?.touchesRange(a,a+e.chunk[t].length)&&i.add(e.chunk[t])}return i}var ut=class{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}},dt=class e{constructor(e){this.heap=e}static from(t,n=null,r=-1){let i=[];for(let e=0;e<t.length;e++)for(let a=t[e];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new ut(a,n,r,e));return i.length==1?i[0]:new e(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)ft(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)ft(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),ft(this.heap,0)}}};function ft(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}var pt=class{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=dt.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){gt(this.active,e),gt(this.activeTo,e),gt(this.activeRank,e),this.minActive=vt(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||r-this.activeTo[t])>0;)t++;_t(this.active,t,n),_t(this.activeTo,t,r),_t(this.activeRank,t,i),e&&_t(e,t,this.cursor.from),this.minActive=vt(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&>(n,r)}else if(!this.cursor.value){this.to=this.endSide=1e9;break}else if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let e=this.cursor.value;if(!e.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}};function mt(e,t,n,r,i,a){e.goto(t),n.goto(r);let o=r+i,s=r,c=r-t,l=!!a.boundChange;for(let t=!1;;){let r=e.to+c-n.to,i=r||e.endSide-n.endSide,u=i<0?e.to+c:n.to,d=Math.min(u,o);if(e.point||n.point?(e.point&&n.point&&rt(e.point,n.point)&&ht(e.activeForPoint(e.to),n.activeForPoint(n.to))||a.comparePoint(s,d,e.point,n.point),t=!1):(t&&a.boundChange(s),d>s&&!ht(e.active,n.active)&&a.compareRange(s,d,e.active,n.active),l&&d<o&&(r||e.openEnd(u)!=n.openEnd(u))&&(t=!0)),u>o)break;s=u,i<=0&&e.next(),i>=0&&n.next()}}function ht(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!rt(e[n],t[n]))return!1;return!0}function gt(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function _t(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function vt(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)(t[i]-r||e[i].endSide-e[n].endSide)<0&&(n=i,r=t[i]);return n}function yt(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)e.charCodeAt(i)==9?(r+=t-r%t,i++):(r++,i=b(e,i));return r}function bt(e,t,n,r){for(let r=0,i=0;;){if(i>=t)return r;if(r==e.length)break;i+=e.charCodeAt(r)==9?n-i%n:1,r=b(e,r)}return r===!0?-1:e.length}for(var xt=`ͼ`,St=typeof Symbol>`u`?`__ͼ`:Symbol.for(xt),Ct=typeof Symbol>`u`?`__styleSet`+Math.floor(Math.random()*1e8):Symbol(`styleSet`),wt=typeof globalThis<`u`?globalThis:typeof window<`u`?window:{},Tt=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function i(e,t,a,o){let s=[],c=/^@(\w+)\b/.exec(e[0]),l=c&&c[1]==`keyframes`;if(c&&t==null)return a.push(e[0]+`;`);for(let n in t){let o=t[n];if(/&/.test(n))i(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>e.concat(t)),o,a);else if(o&&typeof o==`object`){if(!c)throw RangeError(`The value of a property (`+n+`) should be a primitive value.`);i(r(n),o,s,l)}else o!=null&&s.push(n.replace(/_.*/,``).replace(/[A-Z]/g,e=>`-`+e.toLowerCase())+`: `+o+`;`)}(s.length||l)&&a.push((n&&!c&&!o?e.map(n):e).join(`, `)+` {`+s.join(` `)+`}`)}for(let t in e)i(r(t),e[t],this.rules)}getRules(){return this.rules.join(`6+`)}static newName(){let e=wt[St]||1;return wt[St]=e+1,xt+e.toString(36)}static mount(e,t,n){let r=e[Ct],i=n&&n.nonce;r?i&&r.setNonce(i):r=new Dt(e,i),r.mount(Array.isArray(t)?t:[t],e)}},Et=new Map,Dt=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=Et.get(n);if(t)return e[Ct]=t;this.sheet=new r.CSSStyleSheet,Et.set(n,this)}else this.styleTag=n.createElement(`style`),t&&this.styleTag.setAttribute(`nonce`,t);this.modules=[],e[Ct]=this}mount(e,t){let n=this.sheet,r=0,i=0;for(let t=0;t<e.length;t++){let a=e[t],o=this.modules.indexOf(a);if(o<i&&o>-1&&(this.modules.splice(o,1),i--,o=-1),o==-1){if(this.modules.splice(i++,0,a),n)for(let e=0;e<a.rules.length;e++)n.insertRule(a.rules[e],r++)}else{for(;i<o;)r+=this.modules[i++].rules.length;r+=a.rules.length,i++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e=``;for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+`7+`;this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute(`nonce`)!=e&&this.styleTag.setAttribute(`nonce`,e)}},Ot={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},kt={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},At=typeof navigator<`u`&&/Mac/.test(navigator.platform),jt=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Mt=0;Mt<10;Mt++)Ot[48+Mt]=Ot[96+Mt]=String(Mt);for(var Mt=1;Mt<=24;Mt++)Ot[Mt+111]=`F`+Mt;for(var Mt=65;Mt<=90;Mt++)Ot[Mt]=String.fromCharCode(Mt+32),kt[Mt]=String.fromCharCode(Mt);for(var Nt in Ot)kt.hasOwnProperty(Nt)||(kt[Nt]=Ot[Nt]);function Pt(e){var t=!(At&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||jt&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?kt:Ot)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}function P(){var e=arguments[0];typeof e==`string`&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n==`object`&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i==`string`?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t<arguments.length;t++)Ft(e,arguments[t]);return e}function Ft(e,t){if(typeof t==`string`)e.appendChild(document.createTextNode(t));else if(t!=null){if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)Ft(e,t[n]);else throw RangeError(`Unsupported child node: `+t)}}var It=typeof navigator<`u`?navigator:{userAgent:``,vendor:``,platform:``},Lt=typeof document<`u`?document:{documentElement:{style:{}}},Rt=/Edge\/(\d+)/.exec(It.userAgent),zt=/MSIE \d/.test(It.userAgent),Bt=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(It.userAgent),Vt=!!(zt||Bt||Rt),Ht=!Vt&&/gecko\/(\d+)/i.test(It.userAgent),Ut=!Vt&&/Chrome\/(\d+)/.exec(It.userAgent),Wt=`webkitFontSmoothing`in Lt.documentElement.style,Gt=!Vt&&/Apple Computer/.test(It.vendor),Kt=Gt&&(/Mobile\/\w+/.test(It.userAgent)||It.maxTouchPoints>2),F={mac:Kt||/Mac/.test(It.platform),windows:/Win/.test(It.platform),linux:/Linux|X11/.test(It.platform),ie:Vt,ie_version:zt?Lt.documentMode||6:Bt?+Bt[1]:Rt?+Rt[1]:0,gecko:Ht,gecko_version:Ht?+(/Firefox\/(\d+)/.exec(It.userAgent)||[0,0])[1]:0,chrome:!!Ut,chrome_version:Ut?+Ut[1]:0,ios:Kt,android:/Android\b/.test(It.userAgent),webkit:Wt,webkit_version:Wt?+(/\bAppleWebKit\/(\d+)/.exec(It.userAgent)||[0,0])[1]:0,safari:Gt,safari_version:Gt?+(/\bVersion\/(\d+(\.\d+)?)/.exec(It.userAgent)||[0,0])[1]:0,tabSize:Lt.documentElement.style.tabSize==null?`-moz-tab-size`:`tab-size`};function qt(e,t){for(let n in e)n==`class`&&t.class?t.class+=` `+e.class:n==`style`&&t.style?t.style+=`;`+e.style:t[n]=e[n];return t}var Jt=Object.create(null);function Yt(e,t,n){if(e==t)return!0;e||=Jt,t||=Jt;let r=Object.keys(e),i=Object.keys(t);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let a of r)if(a!=n&&(i.indexOf(a)==-1||e[a]!==t[a]))return!1;return!0}function Xt(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;t[r]??e.removeAttribute(r)}for(let n in t){let r=t[n];n==`style`?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}function Zt(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,i==`style`?e.style.cssText=``:e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,i==`style`?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}function Qt(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}var $t=class{eq(e){return!1}updateDOM(e,t,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},I=(function(e){return e[e.Text=0]=`Text`,e[e.WidgetBefore=1]=`WidgetBefore`,e[e.WidgetAfter=2]=`WidgetAfter`,e[e.WidgetRange=3]=`WidgetRange`,e})(I||={}),L=class extends nt{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new en(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new nn(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:i,end:a}=rn(e,t);n=(i?t?-3e8:-1:5e8)-1,r=(a?t?2e8:1:-6e8)+1}return new nn(e,n,r,t,e.widget||null,!0)}static line(e){return new tn(e)}static set(e,t=!1){return N.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};L.none=N.empty;var en=class e extends L{constructor(e){let{start:t,end:n}=rn(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||`span`,this.attrs=e.class&&e.attributes?qt(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Jt}eq(t){return this==t||t instanceof e&&this.tagName==t.tagName&&Yt(this.attrs,t.attrs)}range(e,t=e){if(e>=t)throw RangeError(`Mark decorations may not be empty`);return super.range(e,t)}};en.prototype.point=!1;var tn=class e extends L{constructor(e){super(-2e8,-2e8,null,e)}eq(t){return t instanceof e&&this.spec.class==t.spec.class&&Yt(this.spec.attributes,t.spec.attributes)}range(e,t=e){if(t!=e)throw RangeError(`Line decoration ranges must be zero-length`);return super.range(e,t)}};tn.prototype.mapMode=ce.TrackBefore,tn.prototype.point=!0;var nn=class e extends L{constructor(e,t,n,r,i,a){super(t,n,i,e),this.block=r,this.isReplace=a,this.mapMode=r?t<=0?ce.TrackBefore:ce.TrackAfter:ce.TrackDel}get type(){return this.startSide==this.endSide?this.startSide<=0?I.WidgetBefore:I.WidgetAfter:I.WidgetRange}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof e&&an(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw RangeError(`Invalid range for replacement decoration`);if(!this.isReplace&&t!=e)throw RangeError(`Widget decorations can only have zero-length ranges`);return super.range(e,t)}};nn.prototype.point=!0;function rn(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n??=e.inclusive,r??=e.inclusive,{start:n??t,end:r??t}}function an(e,t){return e==t||!!(e&&t&&e.compare(t))}function on(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}var sn=class e extends nt{constructor(e,t,n){super(),this.tagName=e,this.attributes=t,this.rank=n}eq(t){return t==this||t instanceof e&&this.tagName==t.tagName&&Yt(this.attributes,t.attributes)}static create(t){return new e(t.tagName,t.attributes||Jt,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(e,t=!1){return N.of(e,t)}};sn.prototype.startSide=sn.prototype.endSide=-1;function cn(e){let t;return t=e.nodeType==11?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function ln(e,t){return t?e==t||e.contains(t.nodeType==1?t:t.parentNode):!1}function un(e,t){if(!t.anchorNode)return!1;try{return ln(e,t.anchorNode)}catch{return!1}}function dn(e){return e.nodeType==3?On(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function fn(e,t,n,r){return n?hn(e,t,n,r,-1)||hn(e,t,n,r,1):!1}function pn(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function mn(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function hn(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:gn(e))){if(e.nodeName==`DIV`)return!1;let n=e.parentNode;if(!n||n.nodeType!=1)return!1;t=pn(e)+(i<0?0:1),e=n}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable==`false`)return!1;t=i<0?gn(e):0}else return!1}}function gn(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function _n(e,t){let{left:n,right:r}=e;if(n==r)return e;let i=t?n:r;return{left:i,right:i,top:e.top,bottom:e.bottom}}function vn(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function yn(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function bn(e,t,n,r,i,a,o,s){let c=e.ownerDocument,l=c.defaultView||window;for(let u=e,d=!1;u&&!d;)if(u.nodeType==1){let e,f=u==c.body,p=1,m=1;if(f)e=vn(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:p,scaleY:m}=yn(u,t)),e={left:t.left,right:t.left+u.clientWidth*p,top:t.top,bottom:t.top+u.clientHeight*m}}let h=0,g=0;if(i==`nearest`)t.top<e.top+o?(g=t.top-(e.top+o),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+o)):t.bottom>e.bottom-o&&(g=t.bottom-e.bottom+o,n<0&&t.top-g<e.top&&(g=t.top-(e.top+o)));else{let r=t.bottom-t.top,a=e.bottom-e.top;g=(i==`center`&&r<=a?t.top+r/2-a/2:i==`start`||i==`center`&&n<0?t.top-o:t.bottom-a+o)-e.top}if(r==`nearest`?t.left<e.left+a?(h=t.left-(e.left+a),n>0&&t.right>e.right+h&&(h=t.right-e.right+a)):t.right>e.right-a&&(h=t.right-e.right+a,n<0&&t.left<e.left+h&&(h=t.left-(e.left+a))):h=(r==`center`?t.left+(t.right-t.left)/2-(e.right-e.left)/2:r==`start`==s?t.left-a:t.right-(e.right-e.left)+a)-e.left,h||g){if(f)l.scrollBy(h,g);else{let e=0,n=0;if(g){let e=u.scrollTop;u.scrollTop+=g/m,n=(u.scrollTop-e)*m}if(h){let t=u.scrollLeft;u.scrollLeft+=h/p,e=(u.scrollLeft-t)*p}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&Math.abs(e-h)<1&&(r=`nearest`),n&&Math.abs(n-g)<1&&(i=`nearest`)}}if(f)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function xn(e,t=!0){let n=e.ownerDocument,r=null,i=null;for(let a=e.parentNode;a&&!(a==n.body||(!t||r)&&i);)if(a.nodeType==1)!i&&a.scrollHeight>a.clientHeight&&(i=a),t&&!r&&a.scrollWidth>a.clientWidth&&(r=a),a=a.assignedSlot||a.parentNode;else if(a.nodeType==11)a=a.host;else break;return{x:r,y:i}}var Sn=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?gn(t):0),n,Math.min(e.focusOffset,n?gn(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}};function Cn(e){let t=[];for(let n=e;n;n=n.nodeType==11?n.host:n.parentNode)n.nodeType==1&&t.push({node:n,left:n.scrollLeft,top:n.scrollTop});return t}function wn(e,t=!0){for(let{node:n,left:r,top:i}of e)t&&n.scrollTop!=i&&(n.scrollTop=i),n.scrollLeft!=r&&(n.scrollLeft=r)}var Tn=null;F.safari&&F.safari_version>=26&&(Tn=!1);function En(e){if(e.setActive)return e.setActive();if(Tn)return e.focus(Tn);let t=Cn(e);e.focus(Tn==null?{get preventScroll(){return Tn={preventScroll:!0},!0}}:void 0),Tn||(Tn=!1,wn(t))}var Dn;function On(e,t,n=t){let r=Dn||=document.createRange();return r.setEnd(e,n),r.setStart(e,t),r}function kn(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let a=new KeyboardEvent(`keydown`,i);a.synthetic=!0,e.dispatchEvent(a);let o=new KeyboardEvent(`keyup`,i);return o.synthetic=!0,e.dispatchEvent(o),a.defaultPrevented||o.defaultPrevented}function An(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function jn(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,gn(n));;)if(r){if(n.nodeType!=1)return!1;let e=n.childNodes[r-1];e.contentEditable==`false`?r--:(n=e,r=gn(n))}else if(n==e)return!0;else r=pn(n),n=n.parentNode}function Mn(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function Nn(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r>0)return{node:n,offset:r};else if(n.nodeType==1&&r>0){if(n.contentEditable==`false`)return null;n=n.childNodes[r-1],r=gn(n)}else if(n.parentNode&&!mn(n))r=pn(n),n=n.parentNode;else return null}function Pn(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};else if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable==`false`)return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!mn(n))r=pn(n)+1,n=n.parentNode;else return null}var Fn=class e{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(t,n){return new e(t.parentNode,pn(t),n)}static after(t,n){return new e(t.parentNode,pn(t)+1,n)}},R=(function(e){return e[e.LTR=0]=`LTR`,e[e.RTL=1]=`RTL`,e})(R||={}),In=R.LTR,Ln=R.RTL;function Rn(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}var zn=Rn(`88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008`),Bn=Rn(`4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333`),Vn=Object.create(null),Hn=[];for(let e of[`()`,`[]`,`{}`]){let t=e.charCodeAt(0),n=e.charCodeAt(1);Vn[t]=n,Vn[n]=-t}function Un(e){return e<=247?zn[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?Bn[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}var Wn=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/,Gn=class{get dir(){return this.level%2?Ln:In}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let i=-1;for(let a=0;a<e.length;a++){let o=e[a];if(o.from<=t&&o.to>=t){if(o.level==n)return a;(i<0||(r==0?e[i].level>o.level:r<0?o.from<t:o.to>t))&&(i=a)}}if(i<0)throw RangeError(`Index out of range`);return i}};function Kn(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!Kn(r.inner,i.inner))return!1}return!0}var z=[];function qn(e,t,n,r,i){for(let a=0;a<=r.length;a++){let o=a?r[a-1].to:t,s=a<r.length?r[a].from:n,c=a?256:i;for(let t=o,n=c,r=c;t<s;t++){let i=Un(e.charCodeAt(t));i==512?i=n:i==8&&r==4&&(i=16),z[t]=i==4?2:i,i&7&&(r=i),n=i}for(let e=o,t=c,r=c;e<s;e++){let i=z[e];if(i==128)e<s-1&&t==z[e+1]&&t&24?i=z[e]=t:z[e]=256;else if(i==64){let i=e+1;for(;i<s&&z[i]==64;)i++;let a=e&&t==8||i<n&&z[i]==8?r==1?1:8:256;for(let t=e;t<i;t++)z[t]=a;e=i-1}else i==8&&r==1&&(z[e]=1);t=i,i&7&&(r=i)}}}function Jn(e,t,n,r,i){let a=i==1?2:1;for(let o=0,s=0,c=0;o<=r.length;o++){let l=o?r[o-1].to:t,u=o<r.length?r[o].from:n;for(let t=l,n,r,o;t<u;t++)if(r=Vn[n=e.charCodeAt(t)]){if(r<0){for(let e=s-3;e>=0;e-=3)if(Hn[e+1]==-r){let n=Hn[e+2],r=n&2?i:n&4?n&1?a:i:0;r&&(z[t]=z[Hn[e]]=r),s=e;break}}else if(Hn.length==189)break;else Hn[s++]=t,Hn[s++]=n,Hn[s++]=c}else if((o=z[t])==2||o==1){let e=o==i;c=+!e;for(let t=s-3;t>=0;t-=3){let n=Hn[t+2];if(n&2)break;if(e)Hn[t+2]|=2;else{if(n&4)break;Hn[t+2]|=4}}}}}function Yn(e,t,n,r){for(let i=0,a=r;i<=n.length;i++){let o=i?n[i-1].to:e,s=i<n.length?n[i].from:t;for(let c=o;c<s;){let o=z[c];if(o==256){let o=c+1;for(;;)if(o==s){if(i==n.length)break;o=n[i++].to,s=i<n.length?n[i].from:t}else if(z[o]==256)o++;else break;let l=a==1,u=l==((o<t?z[o]:r)==1)?l?1:2:r;for(let t=o,r=i,a=r?n[r-1].to:e;t>c;)t==a&&(t=n[--r].from,a=r?n[r-1].to:e),z[--t]=u;c=o}else a=o,c++}}}function Xn(e,t,n,r,i,a,o){let s=r%2?2:1;if(r%2==i%2)for(let c=t,l=0;c<n;){let t=!0,u=!1;if(l==a.length||c<a[l].from){let e=z[c];e!=s&&(t=!1,u=e==16)}let d=!t&&s==1?[]:null,f=t?r:r+1,p=c;run:for(;;)if(l<a.length&&p==a[l].from){if(u)break run;let m=a[l];if(!t)for(let e=m.to,t=l+1;;){if(e==n)break run;if(t<a.length&&a[t].from==e)e=a[t++].to;else if(z[e]==s)break run;else break}l++,d?d.push(m):(m.from>c&&o.push(new Gn(c,m.from,f)),Zn(e,m.direction==In==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.to),p=m.to}else if(p==n||(t?z[p]!=s:z[p]==s))break;else p++;d?Xn(e,c,p,r+1,i,d,o):c<p&&o.push(new Gn(c,p,f)),c=p}else for(let c=n,l=a.length;c>t;){let n=!0,u=!1;if(!l||c>a[l-1].to){let e=z[c-1];e!=s&&(n=!1,u=e==16)}let d=!n&&s==1?[]:null,f=n?r:r+1,p=c;run:for(;;)if(l&&p==a[l-1].to){if(u)break run;let m=a[--l];if(!n)for(let e=m.from,n=l;;){if(e==t)break run;if(n&&a[n-1].to==e)e=a[--n].from;else if(z[e-1]==s)break run;else break}d?d.push(m):(m.to<c&&o.push(new Gn(m.to,c,f)),Zn(e,m.direction==In==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.from),p=m.from}else if(p==t||(n?z[p-1]!=s:z[p-1]==s))break;else p--;d?Xn(e,p,c,r+1,i,d,o):p<c&&o.push(new Gn(p,c,f)),c=p}}function Zn(e,t,n,r,i,a,o){let s=t%2?2:1;qn(e,i,a,r,s),Jn(e,i,a,r,s),Yn(i,a,r,s),Xn(e,i,a,t,n,r,o)}function Qn(e,t,n){if(!e)return[new Gn(0,0,+(t==Ln))];if(t==In&&!n.length&&!Wn.test(e))return $n(e.length);if(n.length)for(;e.length>z.length;)z[z.length]=256;let r=[],i=t==In?0:1;return Zn(e,i,i,n,0,e.length,r),r}function $n(e){return[new Gn(0,e,0)]}var er=``;function tr(e,t,n,r,i){let a=r.head-e.from,o=Gn.find(t,a,r.bidiLevel??-1,r.assoc),s=t[o],c=s.side(i,n);if(a==c){let e=o+=i?1:-1;if(e<0||e>=t.length)return null;s=t[o=e],a=s.side(!i,n),c=s.side(i,n)}let l=b(e.text,a,s.forward(i,n));(l<s.from||l>s.to)&&(l=c),er=e.text.slice(Math.min(a,l),Math.max(a,l));let u=o==(i?t.length-1:0)?null:t[o+(i?1:-1)];return u&&l==c&&u.level+ +!i<s.level?T.cursor(u.side(!i,n)+e.from,u.forward(i,n)?1:-1,u.level):T.cursor(l+e.from,s.forward(i,n)?-1:1,s.level)}function nr(e,t,n){for(let r=t;r<n;r++){let t=Un(e.charCodeAt(r));if(t==1)return In;if(t==2||t==4)return Ln}return In}var rr=E.define(),ir=E.define(),ar=E.define(),or=E.define(),sr=E.define(),cr=E.define(),lr=E.define(),ur=E.define(),dr=E.define(),fr=E.define({combine:e=>e.some(e=>e)}),pr=E.define({combine:e=>e.some(e=>e)}),mr=E.define(),hr=class e{constructor(e,t,n,r,i,a=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=i,this.isSnapshot=a}map(t){return t.empty?this:new e(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new e(T.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},gr=D.define({map:(e,t)=>e.map(t)}),_r=D.define();function vr(e,t,n){let r=e.facet(or);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+`:`,t):console.error(t))}var yr=E.define({combine:e=>!e.length||e[0]}),br=0,xr=E.define({combine(e){return e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})}}),B=class e{constructor(e,t,n,r,i){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(xr.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(xr.of({plugin:this,arg:e}))}static define(t,n){let{eventHandlers:r,eventObservers:i,provide:a,decorations:o}=n||{};return new e(br++,t,r,i,e=>{let t=[];return o&&t.push(Tr.of(t=>{let n=t.plugin(e);return n?o(n):L.none})),a&&t.push(a(e)),t})}static fromClass(t,n){return e.define((e,n)=>new t(e,n),n)}},Sr=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(!this.value){if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){vr(e.state,t,`CodeMirror plugin crashed`),this.deactivate()}}else if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(vr(e.state,t,`CodeMirror plugin crashed`),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}return this}destroy(e){if(this.value?.destroy)try{this.value.destroy()}catch(t){vr(e.state,t,`CodeMirror plugin crashed`)}}deactivate(){this.spec=this.value=null}},Cr=E.define(),wr=E.define(),Tr=E.define(),Er=E.define(),Dr=E.define(),Or=E.define(),kr=E.define();function Ar(e,t){let n=e.state.facet(kr);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),i=[];return N.spans(r,t.from,t.to,{point(){},span(e,n,r,a){let o=e-t.from,s=n-t.from,c=i;for(let e=r.length-1;e>=0;e--,a--){let n=r[e].spec.bidiIsolate,i;if(n??=nr(t.text,o,s),a>0&&c.length&&(i=c[c.length-1]).to==o&&i.direction==n)i.to=s,c=i.inner;else{let e={from:o,to:s,direction:n,inner:[]};c.push(e),c=e.inner}}}}),i}var jr=E.define();function Mr(e){let t=0,n=0,r=0,i=0;for(let a of e.state.facet(jr)){let o=a(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:t,right:n,top:r,bottom:i}}var Nr=E.define(),Pr=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(t){return new e(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(t,n){if(n.length==0)return t;let r=[];for(let i=0,a=0,o=0;;){let s=i<t.length?t[i].fromB:1e9,c=a<n.length?n[a]:1e9,l=Math.min(s,c);if(l==1e9)break;let u=l+o,d=l,f=u;for(;;)if(a<n.length&&n[a]<=d){let e=n[a+1];a+=2,d=Math.max(d,e);for(let e=i;e<t.length&&t[e].fromB<=d;e++)o=t[e].toA-t[e].toB;f=Math.max(f,e+o)}else if(i<t.length&&t[i].fromB<=d){let e=t[i++];d=Math.max(d,e.toB),f=Math.max(f,e.toA),o=e.toA-e.toB}else break;r.push(new e(u,f,l,d))}return r}},Fr=class e{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=C.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let r=[];this.changes.iterChangedRanges((e,t,n,i)=>r.push(new Pr(e,t,n,i))),this.changedRanges=r}static create(t,n,r){return new e(t,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},Ir=[],V=class{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return Ir}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let e=this.domAttrs;e&&Xt(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:``)+(this.breakAfter?`#`:``)}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw RangeError(`Invalid child in posBefore`)}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t,n){return null}domPosFor(e,t){let n=pn(this.dom),r=this.length?e>0:t>0;return new Fn(this.parent.dom,n+ +!!r,e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof zr)return e;return null}static get(e){return e.cmTile}},Lr=class extends V{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,n=null,r,i=e?.node==t?e:null,a=0;for(let o of this.children){if(o.sync(e),a+=o.length+o.breakAfter,r=n?n.nextSibling:t.firstChild,i&&r!=o.dom&&(i.written=!0),o.dom.parentNode==t)for(;r&&r!=o.dom;)r=Rr(r);else t.insertBefore(o.dom,r);n=o.dom}for(r=n?n.nextSibling:t.firstChild,i&&r&&(i.written=!0);r;)r=Rr(r);this.length=a}};function Rr(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var zr=class extends Lr{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=V.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,i=0;;)if(r==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&i++,r=t.pop()}else{let a=n.children[r++];if(a instanceof Br)t.push(r),n=a,r=0;else{let t=i+a.length,n=e(a,i);if(n!==void 0)return n;i=t+a.breakAfter}}}resolveBlock(e,t){let n,r=-1,i,a=-1;if(this.blockTiles((o,s)=>{let c=s+o.length;if(e>=s&&e<=c){if(o.isWidget()&&t>=-1&&t<=1){if(o.flags&32)return!0;o.flags&16&&(n=void 0)}(s<e||e==c&&(t<-1?o.length:o.covers(1)))&&(!n||!o.isWidget()&&n.isWidget())&&(n=o,r=e-s),(c>e||e==s&&(t>1?o.length:o.covers(-1)))&&(!i||!o.isWidget()&&i.isWidget())&&(i=o,a=e-s)}}),!n&&!i)throw Error(`No tile at position `+e);return n&&t<0||!i?{tile:n,offset:r}:{tile:i,offset:a}}},Br=class e extends Lr{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},Vr=class e extends Lr{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(t,n,r){let i=new e(n||document.createElement(`div`),t);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,i=-1,a=null,o=-1;function s(e,c){for(let l=0,u=0;l<e.children.length&&u<=c;l++){let d=e.children[l],f=u+d.length;f>=c&&(d.isComposite()?s(d,c-u):(!a||a.isHidden&&(t>0&&!(a.flags&32)||n&&Ur(a,d)))&&(f>c||d.flags&32&&t<=1)?(a=d,o=c-u):(u<c||d.flags&16&&!d.isHidden&&t>=-1)&&(r=d,i=c-u)),u=f}}s(this,e);let c=(t<0?r:a)||r||a;return c?{tile:c,offset:c==r?i:o}:null}coordsIn(e,t,n){let r=this.resolveInline(e,t,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),t,n):Hr(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:r}=n;if(this.dom.contains(e.dom))return e.isText()?new Fn(e.dom,Math.min(e.dom.nodeValue.length,r)):e.domPosFor(r,e.flags&16?1:e.flags&32?-1:t);let i=n.tile.parent,a=!1;for(let e of i.children){if(a)return new Fn(e.dom,0);e==n.tile&&(a=!0)}}return new Fn(this.dom,0)}};function Hr(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=dn(t);return n[n.length-1]||null}function Ur(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}var Wr=class e extends Lr{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},Gr=class e extends V{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t,n){let r=this.dom.nodeValue.length;e>r&&(e=r);let i=e,a=e,o=0;e==0&&t<0||e==r&&t>=0?F.chrome||F.gecko||(e?(i--,o=1):a<r&&(a++,o=-1)):t<0?i--:a<r&&a++;let s=On(this.dom,i,a).getClientRects();if(!s.length)return null;let c=s[(o?o<0:t>=0)?0:s.length-1];return F.safari&&!o&&c.width==0&&(c=Array.prototype.find.call(s,e=>e.width)||c),n==null?c:_n(c,(o?o>0:t<0)==n)}static of(t,n){let r=new e(n||document.createTextNode(t),t);return n||(r.flags|=2),r}},Kr=class e extends V{constructor(e,t,n,r){super(e,t,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return _n(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let r=this.flags&16?!0:this.flags&32?!1:e>0;for(let i=r?t.length-1:0;n=t[i],!(e>0?i==0:i==t.length-1||n.top<n.bottom);i+=r?-1:1);return _n(n,!r)}}get overrideDOMText(){if(!this.length)return p.empty;let{root:e}=this;if(!e)return p.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(t,n,r,i,a){return a||(a=t.toDOM(n),t.editable||(a.contentEditable=`false`)),new e(a,r,t,i)}},qr=class extends V{constructor(e){let t=document.createElement(`img`);t.className=`cm-widgetBuffer`,t.setAttribute(`aria-hidden`,`true`),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return p.empty}coordsIn(e,t,n){let r=this.dom.getBoundingClientRect();return n==null?r:_n(r,t>0==n)}},Jr=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:i,beforeBreak:a,parents:o}=this;for(;e||t>0;)if(!r.isComposite()){let t=r.length;if(i<t&&e){let a=Math.min(e,t-i);n&&n.skip(r,i,i+a),e-=a,i+=a}if(i==t)a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++;else if(!e)break}else if(a){if(!e)break;n&&n.break(),e--,a=!1}else if(i==r.children.length){if(!e&&!o.length)break;n&&n.leave(r),a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++}else{let s=r.children[i],c=s.breakAfter;(t>0?s.length<=e:s.length<e)&&(!n||n.skip(s,0,s.length)!==!1||!s.isComposite)?(a=!!c,i++,e-=s.length):(o.push({tile:r,index:i}),r=s,i=0,n&&s.isComposite()&&n.enter(s))}return this.tile=r,this.index=i,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}},Yr=class{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}},Xr=class{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){this.flushBuffer();let i=this.ensureMarks(t,n),a=i.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+e.length<512){this.cache.reused.set(a,2);let t=i.children[i.children.length-1]=new Gr(a.dom,a.text+e);t.parent=i}else i.append(r||Gr.of(e,this.cache.find(Gr)?.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?oi(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],i=r.lastChild;if(i instanceof Wr&&i.mark.eq(n.mark))i.dom!=n.dom&&i.setDOM(oi(n.dom)),r=i;else{if(this.cache.reused.get(n)){let e=V.get(n.dom);e&&e.setDOM(oi(n.dom))}let e=Wr.of(n.mark,n.dom);r.append(e),r=e}this.cache.reused.set(n,2)}let i=V.get(e.text);i&&this.cache.reused.set(i,2);let a=new Gr(e.text,e.text.nodeValue);a.flags|=8,this.pos=e.range.toB,r.append(a)}addInlineWidget(e,t,n){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let i=this.ensureMarks(t,n);!r&&!(e.flags&16)&&i.append(this.getBuffer(1)),i.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){e||=ri;let n=Vr.start(e,t||this.cache.find(Vr)?.dom,!!t);this.getBlockPos().append(this.lastBlock=this.curLine=n)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){let n=this.curLine;for(let r=e.length-1;r>=0;r--){let i=e[r],a;if(t>0&&(a=n.lastChild)&&a instanceof Wr&&a.mark.eq(i))n=a,t--;else{let e=Wr.of(i,this.cache.find(Wr,e=>e.mark.eq(i))?.dom);n.append(e),n=e,t=0}}return n}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!ti(this.curLine,!1)||e.dom.nodeName!=`BR`&&e.isWidget()&&!(F.ios&&ti(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(ci,0,32)||new Kr(ci.toDOM(),0,ci,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=e.rank*102+e.value.rank,n=new Yr(e.from,e.to,e.value,t),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){this.updateBlockWrappers();let e=this.root;for(let t of this.wrappers){let n=e.lastChild;if(t.from<this.pos&&n instanceof Br&&n.wrapper.eq(t.wrapper))e=n;else{let n=Br.of(t.wrapper,this.cache.find(Br,e=>e.wrapper.eq(t.wrapper))?.dom);e.append(n),e=n}}return e}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(qr,void 0,1);return n&&(n.flags=t),n||new qr(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},Zr=class{constructor(e){this.skipCount=0,this.text=``,this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text=``,this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw Error(`Ran out of text content when drawing inline views`);this.text=t;let i=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,i)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}},Qr=[Kr,Vr,Gr,Wr,qr,Br,zr];for(let e=0;e<Qr.length;e++)Qr[e].bucket=e;var $r=class{constructor(e){this.view=e,this.buckets=Qr.map(()=>[]),this.index=Qr.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,i=this.buckets[r],a=this.index[r];for(let e=0;e<i.length;e++){let o=(e+a)%i.length,s=i[o];if((!t||t(s))&&!this.reused.has(s))return i.splice(o,1),o<a&&this.index[r]--,this.reused.set(s,n),s}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let i=0,a=0;;i++){if(i==r.length){if(a)return null;a=1,i=0}let o=r[i];if(!this.reused.has(o)&&(a==0?o.widget.compare(e):o.widget.constructor==e.constructor&&e.updateDOM(o.dom,this.view,o.widget)))return r.splice(i,1),i<this.index[0]&&this.index[0]--,o.widget==e&&o.length==t&&(o.flags&497)==n?(this.reused.set(o,1),o):(this.reused.set(o,2),new Kr(o.dom,t,e,o.flags&-498|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}},ei=class{constructor(e,t,n,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new $r(e),this.text=new Zr(e.state.doc),this.builder=new Xr(this.cache,new zr(e,e.contentDOM),N.iter(n)),this.cache.reused.set(t,2),this.old=new Jr(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,i=0,a=0;;){let o=a<e.length?e[a++]:null,s=o?o.fromA:this.old.root.length;if(s>r){let e=s-r;this.preserve(e,!a,!o),r=s,i+=e}if(!o)break;t&&o.fromA<=t.range.fromA&&o.toA>=t.range.toA?(this.forward(o.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(i,t.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,o.toA),this.emit(t.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(i,o.toB)),i=o.toB,r=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=ai(this.old),i=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget()){if(this.openWidget)this.builder.continueWidget(n-t);else{let a=n>0||t<e.length?Kr.of(e.widget,this.view,n-t,e.flags&496,this.cache.maybeReuse(e)):this.cache.reuse(e);a.flags&256?(a.flags&=-2,this.builder.addBlockWidget(a)):(this.builder.ensureLine(null),this.builder.addInlineWidget(a,r,i),i=r.length)}}else if(e.isText())this.builder.ensureLine(null),!t&&n==e.length&&!this.cache.reused.has(e)?this.builder.addText(e.text,r,i,this.cache.reuse(e)):(this.cache.add(e),this.builder.addText(e.text.slice(t,n),r,i)),i=r.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof qr)this.cache.add(e);else if(e instanceof Wr)this.builder.ensureLine(null),this.builder.addMark(e,r,i),this.cache.reused.set(e,1),i=r.length;else return!1;this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof Wr&&r.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?r.length&&=i=0:e instanceof Wr&&(r.shift(),i=Math.min(i,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,i=-1,a=N.spans(this.decorations,e,t,{point:(e,t,a,o,s,c)=>{if(a instanceof nn){if(this.disallowBlockEffectsFor[c]){if(a.block)throw RangeError(`Block decorations may not be specified via plugins`);if(t>this.view.state.doc.lineAt(e).to)throw RangeError(`Decorations that replace line breaks may not be specified via plugins`)}if(i=o.length,s>o.length)r.continueWidget(t-e);else{let i=a.widget||(a.block?si.block:si.inline),c=ni(a),l=this.cache.findWidget(i,t-e,c)||Kr.of(i,this.view,t-e,c);a.block?(a.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(l)):(r.ensureLine(n),r.addInlineWidget(l,o,s))}n=null}else n=ii(n,a);t>e&&this.text.skip(t-e)},span:(e,t,a,o)=>{for(let i=e;i<t;){let s=this.text.next(Math.min(512,t-i));s==null?(r.addLineStartIfNotCovered(n),r.addBreak(),i++):(r.ensureLine(n),r.addText(s,a,i==e?o:a.length),i+=s.length),n=null}i=a.length}});i>-1&&(this.openWidget=a>i),this.openWidget||r.addLineStartIfNotCovered(n),this.openMarks=a}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let e=V.get(r);if(r==this.view.contentDOM)break;e instanceof Wr?t.push(e):e?.isLine()?n=e:e instanceof Br||(r.nodeName==`DIV`&&!n&&r!=this.view.contentDOM?n=new Vr(r,ri):n||t.push(Wr.of(new en({tagName:r.nodeName.toLowerCase(),attributes:Qt(r)}),r)))}return{line:n,marks:t}}};function ti(e,t){let n=e=>{for(let r of e.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function ni(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}var ri={class:`cm-line`};function ii(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r?e:(e||={class:`cm-line`},n&&qt(n,e),r&&(e.class+=` `+r),e)}function ai(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof Wr&&t.push(r.mark)}return t}function oi(e){let t=V.get(e);return t&&t.setDOM(e.cloneNode()),e}var si=class extends $t{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}};si.inline=new si(`span`),si.block=new si(`div`);var ci=new class extends $t{toDOM(){return document.createElement(`br`)}get isHidden(){return!0}get editable(){return!0}},li=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=L.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new zr(e,e.contentDOM),this.updateInner([new Pr(0,0,0,e.state.doc.length)],null)}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(this.domChanged?.newSel?n=this.domChanged.newSel.head:!bi(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let r=n>-1?pi(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){let{from:n,to:r}=this.hasComposition;t=new Pr(n,r,e.changes.mapPos(n,-1),e.changes.mapPos(r,1)).addToSet(t.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(F.ie||F.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,a=this.blockWrappers;this.updateDeco();let o=gi(i,this.decorations,e.changes);o.length&&(t=Pr.extendWithRanges(t,o));let s=vi(a,this.blockWrappers,e.changes);return s.length&&(t=Pr.extendWithRanges(t,s)),r&&!t.some(e=>e.fromA<=r.range.fromA&&e.toA>=r.range.toA)&&(t=r.range.addToSet(t.slice())),this.tile.flags&2&&t.length==0?!1:(this.updateInner(t,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,r=new ei(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&V.get(t.text)&&r.cache.reused.set(V.get(t.text),2),this.tile=r.run(e,t),ui(n,r.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+`px`,this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+`px`:``;let r=F.chrome||F.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||n.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=``});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof xi&&r.push(e.dom);n.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(_r)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:n}=this.tile,r=this.view.root.activeElement,i=r==n,a=!i&&!(this.view.state.facet(yr)||n.tabIndex>-1)&&un(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(i||t||a))return;let o=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,c,l;if(s.empty?l=c=this.inlineDOMNearPos(s.anchor,s.assoc||1):(l=this.inlineDOMNearPos(s.head,s.head==s.from?1:-1),c=this.inlineDOMNearPos(s.anchor,s.anchor==s.from?1:-1)),F.gecko&&s.empty&&!this.hasComposition&&di(c)){let e=document.createTextNode(``);this.view.observer.ignore(()=>c.node.insertBefore(e,c.node.childNodes[c.offset]||null)),c=l=new Fn(e,0),o=!0}let u=this.view.observer.selectionRange;(o||!u.focusNode||(!fn(c.node,c.offset,u.anchorNode,u.anchorOffset)||!fn(l.node,l.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,s))&&(this.view.observer.ignore(()=>{F.android&&F.chrome&&n.contains(u.focusNode)&&yi(u.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let e=cn(this.view.root);if(e){if(s.empty){if(F.gecko){let e=mi(c.node,c.offset);if(e&&e!=3){let t=(e==1?Nn:Pn)(c.node,c.offset);t&&(c=new Fn(t.node,t.offset))}}e.collapse(c.node,c.offset),s.bidiLevel!=null&&e.caretBidiLevel!==void 0&&(e.caretBidiLevel=s.bidiLevel)}else if(e.extend){e.collapse(c.node,c.offset);try{e.extend(l.node,l.offset)}catch{}}else{let t=document.createRange();s.anchor>s.head&&([c,l]=[l,c]),t.setEnd(l.node,l.offset),t.setStart(c.node,c.offset),e.removeAllRanges(),e.addRange(t)}}a&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,l)),this.impreciseAnchor=c.precise?null:new Fn(u.anchorNode,u.anchorOffset),this.impreciseHead=l.precise?null:new Fn(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&fn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=cn(e.root),{anchorNode:r,anchorOffset:i}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let a=this.lineAt(t.head,t.assoc);if(!a)return;let o=a.posAtStart;if(t.head==o||t.head==o+a.length)return;let s=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!s||!c||s.bottom>c.top)return;let l=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(l.node,l.offset),n.modify(`move`,t.assoc<0?`forward`:`backward`,`lineboundary`),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(r,i)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=n.posAtStart;if(n.isComposite()){let i;if(e==n.dom)i=n.dom.childNodes[t];else{let r=gn(e)==0?0:t==0?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;r==0&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}i=r<0?e:e.nextSibling}if(i==n.dom.firstChild)return r;for(;i&&!V.get(i);)i=i.nextSibling;if(!i)return r+n.length;for(let e=0,t=r;;e++){let r=n.children[e];if(r.dom==i)return t;t+=r.length+r.breakAfter}}else if(n.isText())return e==n.dom?r+t:r+(t?n.length:0);else return r}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(r,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r=-1,i=!1,a,o=-1,s=!1;return this.tile.blockTiles((t,c)=>{if(t.isWidget()){if(t.flags&32&&c>=e)return!0;t.flags&16&&(i=!0)}else{let l=c+t.length;if(c<=e&&(n=t,r=e-c,i=l<e),l>=e&&!a&&(a=t,o=e-c,s=c>e),c>e&&a)return!0}}),!n&&!a?this.domAtPos(e,t):(i&&a?n=null:s&&n&&(a=null),n&&t<0||!a?n.domIn(r,t):a.domIn(o,t))}coordsAt(e,t,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,t);return r.isWidget()?r.widget instanceof xi?null:r.coordsInWidget(i,t,!0):r.coordsIn(i,t,n)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(e,t){if(e.isComposite())for(let n of e.children){if(n.length>=t){let e=r(n,t);if(e)return e}if(t-=n.length,t<0)break}else if(e.isText()&&t<e.length){let n=b(e.text,t);if(n==t)return null;let r=On(e.dom,t,n).getClientRects();for(let e=0;e<r.length;e++){let t=r[e];if(e==r.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}return r(t,n)}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,i=this.view.contentDOM.clientWidth,a=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,s=this.view.textDirection==R.LTR,c=0,l=(e,u,d)=>{for(let f=0;f<e.children.length&&!(u>r);f++){let r=e.children[f],p=u+r.length,m=r.dom.getBoundingClientRect(),{height:h}=m;if(d&&!f&&(c+=m.top-d.top),r instanceof Br)p>n&&l(r,u,m);else if(u>=n&&(c>0&&t.push(-c),t.push(h+c),c=0,a)){let e=r.dom.lastChild,t=e?dn(e):[];if(t.length){let e=t[t.length-1],n=s?e.right-m.left:m.right-e.left;n>o&&(o=n,this.minWidth=i,this.minWidthFrom=u,this.minWidthTo=p)}}d&&f==e.children.length-1&&(c+=d.bottom-m.bottom),u=p+r.breakAfter}};return l(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction==`rtl`?R.RTL:R.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t=0,n;for(let r of e.children){if(!r.isText()||/[^ -~]/.test(r.text))return;let e=dn(r.dom);if(e.length!=1)return;t+=e[0].width,n=e[0].height}if(t)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:t/e.length,textHeight:n}}});if(e)return e;let t=document.createElement(`div`),n,r,i;return t.className=`cm-line`,t.style.width=`99999px`,t.style.position=`absolute`,t.textContent=`abc def ghi jkl mno pqr stu`,this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let e=dn(t.firstChild)[0];n=t.getBoundingClientRect().height,r=e&&e.width?e.width/27:7,i=e&&e.height?e.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let i=r==t.viewports.length?null:t.viewports[r],a=i?i.from-1:this.view.state.doc.length;if(a>n){let r=(t.lineBlockAt(a).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(L.replace({widget:new xi(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,a))}if(!i)break;n=i.to+1}return L.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Tr).map(t=>(this.dynamicDecorationMap[e++]=typeof t==`function`)?t(this.view):t),n=!1,r=this.view.state.facet(Dr).map((e,t)=>{let r=typeof e==`function`;return r&&(n=!0),r?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(N.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(Er).map(e=>typeof e==`function`?e(this.view):e)}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=t.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let t of this.view.state.facet(mr))try{if(t(this.view,e.range,e))return!0}catch(e){vr(this.view.state,e,`scroll handler`)}let{range:t}=e,n=this.coordsAt(t.head,t.assoc||(t.head>t.anchor?-1:1)),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let i=Mr(this.view),a={left:n.left-i.left,top:n.top-i.top,right:n.right+i.right,bottom:n.bottom+i.bottom},{offsetWidth:o,offsetHeight:s}=this.view.scrollDOM;if(bn(this.view.scrollDOM,a,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,o),-o),Math.max(Math.min(e.yMargin,s),-s),this.view.textDirection==R.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(n.top>window.visualViewport.offsetTop+window.visualViewport.height||n.bottom<window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(t.head,1);if(e){let t=Cn(e.dom);e.dom.scrollIntoView({block:`nearest`}),wn(t,!1)}}}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){ui(this.tile)}};function ui(e,t){let n=t?.get(e);if(n!=1){n??e.destroy();for(let n of e.children)ui(n,t)}}function di(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable==`false`)&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable==`false`)}function fi(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=Nn(n.focusNode,n.focusOffset),i=Pn(n.focusNode,n.focusOffset),a=r||i;if(i&&r&&i.node!=r.node){let t=V.get(i.node);if(!t||t.isText()&&t.text!=i.node.nodeValue)a=i;else if(e.docView.lastCompositionAfterCursor){let e=V.get(r.node);!e||e.isText()&&e.text!=r.node.nodeValue||(a=i)}}if(e.docView.lastCompositionAfterCursor=a!=r,!a)return null;let o=t-a.offset;return{from:o,to:o+a.node.nodeValue.length,node:a.node}}function pi(e,t,n){let r=fi(e,n);if(!r)return null;let{node:i,from:a,to:o}=r,s=i.nodeValue;if(/[\n\r]/.test(s)||e.state.doc.sliceString(r.from,r.to)!=s)return null;let c=t.invertedDesc;return{range:new Pr(c.mapPos(a),c.mapPos(o),a,o),text:i}}function mi(e,t){return e.nodeType==1?(t&&e.childNodes[t-1].contentEditable==`false`?1:0)|(t<e.childNodes.length&&e.childNodes[t].contentEditable==`false`?2:0):0}var hi=class{constructor(){this.changes=[]}compareRange(e,t){on(e,t,this.changes)}comparePoint(e,t){on(e,t,this.changes)}boundChange(e){on(e,e,this.changes)}};function gi(e,t,n){let r=new hi;return N.compare(e,t,n,r),r.changes}var _i=class{constructor(){this.changes=[]}compareRange(e,t){on(e,t,this.changes)}comparePoint(){}boundChange(e){on(e,e,this.changes)}};function vi(e,t,n){let r=new _i;return N.compare(e,t,n,r),r.changes}function yi(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable==`false`)return!0;return!1}function bi(e,t){let n=!1;return t&&e.iterChangedRanges((e,r)=>{e<t.to&&r>t.from&&(n=!0)}),n}var xi=class extends $t{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement(`div`);return e.className=`cm-gap`,this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+`px`,!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}};function Si(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),a=t-i.from;if(i.length==0)return T.cursor(t);a==0?n=1:a==i.length&&(n=-1);let o=a,s=a;n<0?o=b(i.text,a,!1):s=b(i.text,a);let c=r(i.text.slice(o,s));for(;o>0;){let e=b(i.text,o,!1);if(r(i.text.slice(e,o))!=c)break;o=e}for(;s<i.length;){let e=b(i.text,s);if(r(i.text.slice(s,e))!=c)break;s=e}return T.undirectionalRange(o+i.from,s+i.from)}function Ci(e,t,n,r,i){let a=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>e.defaultLineHeight*1.5){let t=e.viewState.heightOracle.textHeight,r=Math.floor((i-n.top-(e.defaultLineHeight-t)*.5)/t);a+=r*e.viewState.heightOracle.lineLength}let o=e.state.sliceDoc(n.from,n.to);return n.from+bt(o,a,e.state.tabSize)}function wi(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let e;for(let i of r.type){if(i.from>t)break;if(!(i.to<t)){if(i.from<t&&i.to>t)return i;(!e||i.type==I.Text&&(e.type!=i.type||(n<0?i.from<t:i.to>t)))&&(e=i)}}return e||r}return r}function Ti(e,t,n,r){let i=wi(e,t.head,t.assoc||-1),a=!r||i.type!=I.Text||!(e.lineWrapping||i.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head);if(a){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(i.from),o=e.posAtCoords({x:n==(r==R.LTR)?t.right-1:t.left+1,y:(a.top+a.bottom)/2});if(o!=null)return T.cursor(o,n?-1:1)}return T.cursor(n?i.to:i.from,n?-1:1)}function Ei(e,t,n,r){let i=e.state.doc.lineAt(t.head),a=e.bidiSpans(i),o=e.textDirectionAt(i.from);for(let s=t,c=null;;){let t=tr(i,a,o,s,n),l=er;if(!t){if(i.number==(n?e.state.doc.lines:1))return s;l=`8+`,i=e.state.doc.line(i.number+(n?1:-1)),a=e.bidiSpans(i),t=e.visualLineSide(i,!n)}if(!c){if(!r)return t;c=r(l)}else if(!c(l))return s;s=t}}function Di(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return e=>{let t=r(e);return i==j.Space&&(i=t),i==t}}function Oi(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return T.cursor(i,t.assoc);let o=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(i,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),u=e.documentTop;if(l)o??=l.left-c.left,s=a<0?l.top:l.bottom;else{let t=e.viewState.lineBlockAt(i);o??=Math.min(c.right-c.left,e.defaultCharacterWidth*(i-t.from)),s=(a<0?t.top:t.bottom)+u}let d=c.left+o,f=e.viewState.heightOracle.textHeight>>1,p=r??f;for(let t=0;;t+=f){let r=s+(p+t)*a,i=Ni(e,{x:d,y:r},!1,a);if(n?r>c.bottom:r<c.top)return T.cursor(i.pos,i.assoc);let l=e.coordsAtPos(i.pos,i.assoc),u=l?(l.top+l.bottom)/2:0;if(!l||(n?u>s:u<s))return T.cursor(i.pos,i.assoc,void 0,o)}}function ki(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,a)=>{if(t>e&&t<i){let a=r||n||(t-e<i-t?-1:1);t=a<0?e:i,r=a}});if(!r)return t}}function Ai(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],a=null;if(i.empty){let t=ki(e,i.from,0);t!=i.from&&(a=T.cursor(t,-1))}else{let t=ki(e,i.from,-1),n=ki(e,i.to,1);(t!=i.from||n!=i.to)&&(a=i.undirectional?T.undirectionalRange(i.from,i.to):T.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}a&&(n||=t.ranges.slice(),n[r]=a)}return n?T.create(n,t.mainIndex):t}function ji(e,t,n){let r=ki(e.state.facet(Or).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:T.cursor(r,r<n.from?1:-1)}var Mi=class{constructor(e,t){this.pos=e,this.assoc=t}};function Ni(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),a=i.top+e.viewState.paddingTop,{x:o,y:s}=t,c=s-a,l;for(;;){if(c<0)return new Mi(0,1);if(c>e.viewState.docHeight)return new Mi(e.state.doc.length,-1);if(l=e.elementAtHeight(c),r==null)break;if(l.type==I.Text){if(r<0?l.to<e.viewport.from:l.from>e.viewport.to)break;let t=e.docView.coordsAt(r<0?l.from:l.to,r>0?-1:1);if(t&&(r<0?t.top<=c+a:t.bottom>=c+a))break}let t=e.viewState.heightOracle.textHeight/2;c=r>0?l.bottom+t:l.top-t}if(e.viewport.from>=l.to||e.viewport.to<=l.from){if(n)return null;if(l.type==I.Text){let t=Ci(e,i,l,o,s);return new Mi(t,t==l.from?1:-1)}}if(l.type!=I.Text)return c<(l.top+l.bottom)/2?new Mi(l.from,1):new Mi(l.to,-1);let u=e.docView.lineAt(l.from,2);return(!u||u.length!=l.length)&&(u=e.docView.lineAt(l.from,-2)),new Pi(e,o,s,e.textDirectionAt(l.from)).scanTile(u,l.from)}var Pi=class{constructor(e,t,n,r){this.view=e,this.x=t,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[Gn.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[Gn.find(r,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<t)}scan(e,t,n=!1){let r=0,i=e.length-1,a=new Set,o=this.bidiIn(e[0],e[i]),s,c,l=-1,u=1e9,d;search:for(;r<i;){let n=i-r,f=r+i>>1;adjust:if(a.has(f)){for(let e=1;e<n;e++){let t=f+e;if(t>=i&&(t-=n),!a.has(t)){f=t;break adjust}}break search}a.add(f);let p=t(f),m=0;if(p)for(let e=0;e<p.length;e++){let t=p[e];if(!(t.width==0&&p.length>1)){if(t.bottom<this.y)(!s||s.bottom<t.bottom)&&(s=t),m=1;else if(t.top>this.y)(!c||c.top>t.top)&&(c=t),m=-1;else{let e=t.left>this.x?this.x-t.left:t.right<this.x?this.x-t.right:0,n=Math.abs(e);n<u&&(l=f,u=n,d=t),e&&(m=e<0==(this.baseDir==R.LTR)?-1:1)}}}m==-1&&(!o||this.baseDirAt(e[f],1))?i=f:m==1&&(!o||this.baseDirAt(e[f+1],-1))&&(r=f+1)}if(!d){if(!c&&!s)return{i:e[0],after:!1};let n=s&&(!c||this.y-s.bottom<c.top-this.y)?s:c;return this.y=(n.top+n.bottom)/2,this.scan(e,t,!0)}if(u&&!n){let{top:n,bottom:r}=d;if(s&&s.bottom>(n+n+r)/3)return this.y=s.bottom-1,this.scan(e,t,!0);if(c&&c.top<(n+r+r)/3)return this.y=c.top+1,this.scan(e,t,!0)}let f=(o?this.dirAt(e[l],1):this.baseDir)==R.LTR;return{i:l,after:this.x>(d.left+d.right)/2==f}}scanText(e,t){let n=[];for(let r=0;r<e.length;r=b(e.text,r))n.push(t+r);n.push(t+e.length);let r=this.scan(n,r=>{let i=n[r]-t,a=n[r+1]-t;return On(e.dom,i,a).getClientRects()});return r.after?new Mi(n[r.i+1],-1):new Mi(n[r.i],1)}scanTile(e,t){if(!e.length)return new Mi(t,1);if(e.children.length==1){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let r=0,i=t;r<e.children.length;r++)n.push(i+=e.children[r].length);let r=this.scan(n,t=>{let n=e.children[t];return n.flags&48?null:(n.dom.nodeType==1?n.dom:On(n.dom,0,n.length)).getClientRects()}),i=e.children[r.i],a=n[r.i];return i.isText()?this.scanText(i,a):i.isComposite()?this.scanTile(i,a):r.after?new Mi(n[r.i+1],-1):new Mi(a,1)}},Fi=``,Ii=class{constructor(e,t){this.points=e,this.view=t,this.text=``,this.lineSeparator=t.state.facet(M.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Fi}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let i=V.get(r),a=r.nextSibling;if(a==t){i?.breakAfter&&!a&&n!=this.view.contentDOM&&this.lineBreak();break}let o=V.get(a);(i&&o?i.breakAfter:(i?i.breakAfter:mn(r))||mn(a)&&(r.nodeName!=`BR`||i?.isWidget())&&this.text.length>e)&&!Ri(a,t)&&this.lineBreak(),r=a}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,a=1,o;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),a=this.lineSeparator.length):(o=r.exec(t))&&(i=o.index,a=o[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),a>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=a-1);n=i+a}}readNode(e){let t=V.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName==`BR`?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(Li(e,n.node,n.offset)?t:0))}};function Li(e,t,n){for(;;){if(!t||n<gn(t))return!1;if(t==e)return!0;n=pn(t)+1,t=t.parentNode}}function Ri(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let t=V.get(e);if(!t?.isWidget())return!1;t&&(n||=[]).push(t)}if(n){for(let e of n)if(e.overrideDOMText?.length)return!1}return!0}var zi=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},Bi=class{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text=``,this.domChanged=t>-1;let{impreciseHead:i,impreciseAnchor:a}=e.docView,o=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=Vi(e.docView.tile,t,n,0))){let t=i||a?[]:Ki(e),n=new Ii(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=qi(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=i&&i.node==t.focusNode&&i.offset==t.focusOffset||!ln(e.contentDOM,t.focusNode)?o.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=a&&a.node==t.anchorNode&&a.offset==t.anchorOffset||!ln(e.contentDOM,t.anchorNode)?o.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),s=e.viewport;if((F.ios||F.chrome)&&n!=r&&Math.min(n,r)<=o.main.from&&Math.max(n,r)>=o.main.to&&(s.from>0||s.to<e.state.doc.length)){let t=Math.min(n,r),i=Math.max(n,r),a=s.from-t,o=s.to-i;(a==0||a==1||t==0)&&(o==0||o==-1||i==e.state.doc.length)&&(n=0,r=e.state.doc.length)}if(e.inputState.composing>-1&&o.ranges.length>1)this.newSel=o.replaceRange(T.range(r,n));else if(e.lineWrapping&&r==n&&!(o.main.empty&&o.main.head==n)&&e.inputState.lastTouchTime>Date.now()-100){let t=e.coordsAtPos(n,-1),r=0;t&&(r=e.inputState.lastTouchY<=t.bottom?-1:1),this.newSel=T.create([T.cursor(n,r)])}else this.newSel=T.single(r,n)}}};function Vi(e,t,n,r){if(e.isComposite()){let i=-1,a=-1,o=-1,s=-1;for(let c=0,l=r,u=r;c<e.children.length;c++){let r=e.children[c],d=l+r.length;if(l<t&&d>n)return Vi(r,t,n,l);if(d>=t&&i==-1&&(i=c,a=l),l>n&&r.dom.parentNode==e.dom){o=c,s=u;break}u=d,l=d+r.breakAfter}return{from:a,to:s<0?r+e.length:s,startDOM:(i?e.children[i-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o<e.children.length&&o>=0?e.children[o].dom:null}}return e.isText()?{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function Hi(e,t){let n,{newSel:r}=t,{state:i}=e,a=i.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:e,to:r}=t.bounds,s=a.from,c=null;(o===8||F.android&&t.text.length<r-e)&&(s=a.to,c=`end`);let l=i.doc.sliceString(e,r,Fi),u,d;!a.empty&&a.from>=e&&a.to<=r&&(t.typeOver||l!=t.text)&&l.slice(0,a.from-e)==t.text.slice(0,a.from-e)&&l.slice(a.to-e)==t.text.slice(u=t.text.length-(l.length-(a.to-e)))?n={from:a.from,to:a.to,insert:p.of(t.text.slice(a.from-e,u).split(Fi))}:(d=Gi(l,t.text,s-e,c))&&(F.chrome&&o==13&&d.toB==d.from+2&&t.text.slice(d.from,d.toB)==``&&d.toB--,n={from:e+d.from,to:e+d.toA,insert:p.of(t.text.slice(d.from,d.toB).split(Fi))})}else r&&(!e.hasFocus&&i.facet(yr)||Ji(r,a))&&(r=null);if(!n&&!r)return!1;if((F.mac||F.android)&&n&&n.from==n.to&&n.from==a.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute(`autocorrect`)==`off`?(r&&n.insert.length==2&&(r=T.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:p.of([n.insert.toString().replace(`.`,` `)])}):i.doc.lineAt(a.from).to<a.to&&e.docView.lineHasWidget(a.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:a.from,to:a.to,insert:i.toText(e.inputState.insertingText)}:F.chrome&&n&&n.from==n.to&&n.from==a.head&&n.insert.toString()==`9+ `&&e.lineWrapping&&(r&&=T.single(r.main.anchor-1,r.main.head-1),n={from:a.from,to:a.to,insert:p.of([` `])}),n)return Ui(e,n,r,o);if(r&&!Ji(r,a)){let t=!1,n=`select`;return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin==`select`&&(t=!0),n=e.inputState.lastSelectionOrigin,n==`select.pointer`&&(r=Ai(i.facet(Or).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}return!1}function Ui(e,t,n,r=-1){if(F.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(F.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==` `)&&t.insert.length==1&&t.insert.lines==2&&kn(e.contentDOM,`Enter`,13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&kn(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&kn(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||=Wi(e,t,n);return e.state.facet(cr).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function Wi(e,t,n){let r,i=e.state,a=i.selection.main,o=-1;if(t.from==t.to&&t.from<a.from||t.from>a.to){let n=t.from<a.from?-1:1,r=n<0?a.from:a.to,s=ki(i.facet(Or).map(t=>t(e)),r,n);t.from==s&&(o=s)}if(o>-1)r={changes:t,selection:T.cursor(t.from+t.insert.length,-1)};else if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=a.from<t.from?i.sliceDoc(a.from,t.from):``,o=a.to>t.to?i.sliceDoc(t.to,a.to):``;r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+o))}else{let o=i.changes(t),s=n&&n.main.to<=o.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=a.to+10&&t.to>=a.to-10){let c=e.state.sliceDoc(t.from,t.to),l,u=n&&fi(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(a.head);let d=a.to-t.to;r=i.changeByRange(n=>{if(n.from==a.from&&n.to==a.to)return{changes:o,range:s||n.map(o)};let r=n.to-d,u=r-c.length;if(e.state.sliceDoc(u,r)!=c||r>=l.from&&u<=l.to)return{range:n};let f=i.changes({from:u,to:r,insert:t.insert}),p=n.to-a.to;return{changes:f,range:s?T.range(Math.max(0,s.anchor+p),Math.max(0,s.head+p)):n.map(f)}})}else r={changes:o,selection:s&&i.selection.replaceRange(s)}}let s=`input.type`;return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=`.compose`,e.inputState.compositionFirstChange&&(s+=`.start`,e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function Gi(e,t,n,r){let i=Math.min(e.length,t.length),a=0;for(;a<i&&e.charCodeAt(a)==t.charCodeAt(a);)a++;if(a==i&&e.length==t.length)return null;let o=e.length,s=t.length;for(;o>0&&s>0&&e.charCodeAt(o-1)==t.charCodeAt(s-1);)o--,s--;if(r==`end`){let e=Math.max(0,a-Math.min(o,s));n-=o+e-a}if(o<a&&e.length<t.length){let e=n<=a&&n>=o?a-n:0;a-=e,s=a+(s-o),o=a}else if(s<a){let e=n<=a&&n>=s?a-n:0;a-=e,o=a+(o-s),s=a}return{from:a,toA:o,toB:s}}function Ki(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=e.observer.selectionRange;return n&&(t.push(new zi(n,r)),(i!=n||a!=r)&&t.push(new zi(i,a))),t}function qi(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?T.single(n+t,r+t):null}function Ji(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}var Yi=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText=``,this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,F.safari&&e.contentDOM.addEventListener(`input`,()=>null),F.gecko&&Ma(e.contentDOM.ownerDocument)}handleEvent(e){!la(this.view,e)||this.ignoreDuringComposition(e)||e.type==`keydown`&&this.keydown(e)||(this.view.updateState==0?this.runHandlers(e.type,e):Promise.resolve().then(()=>this.runHandlers(e.type,e)))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=Qi(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if(e!=`scroll`){let i=!t[e].handlers.length,a=n[e];a&&i!=!a.handlers.length&&(r.removeEventListener(e,this.handleEvent),a=null),a||r.addEventListener(e,this.handleEvent,{passive:i})}for(let e in n)e!=`scroll`&&!t[e]&&r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&ta.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),F.android&&F.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(F.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&($i.some(t=>t.keyCode==e.keyCode)&&!e.ctrlKey||ea.indexOf(e.key)>-1&&e.ctrlKey)){let t={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return t.shiftKey&&F.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&Xi(this.view.win)&&(t.shiftKey=!1),this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:t},setTimeout(()=>this.flushIOSKey(),250),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key==`Enter`&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,kn(this.view.contentDOM,t.key,t.keyCode,t.mods))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:F.safari&&!F.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function Xi(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function Zi(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){vr(n.state,e)}}}function Qi(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(Zi(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(Zi(t.value,r))}}for(let e in ua)n(e).handlers.push(ua[e]);for(let e in da)n(e).observers.push(da[e]);return t}var $i=[{key:`Backspace`,keyCode:8,inputType:`deleteContentBackward`},{key:`Enter`,keyCode:13,inputType:`insertParagraph`},{key:`Enter`,keyCode:13,inputType:`insertLineBreak`},{key:`Delete`,keyCode:46,inputType:`deleteContentForward`}],ea=`dthko`,ta=[16,17,18,20,91,92,224,225],na=6;function ra(e){return Math.max(0,e)*.7+8}function ia(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}var aa=class{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=xn(e.contentDOM),this.atoms=e.state.facet(Or).map(t=>t(e));let i=e.contentDOM.ownerDocument;i.addEventListener(`mousemove`,this.move=this.move.bind(this)),i.addEventListener(`mouseup`,this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(M.allowMultipleSelections)&&oa(e,t),this.dragging=ca(e,t)&&xa(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&ia(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,i=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:o}=this.scrollParents.y.getBoundingClientRect());let s=Mr(this.view);e.clientX-s.left<=r+na?t=-ra(r-e.clientX):e.clientX+s.right>=a-na&&(t=ra(e.clientX-a)),e.clientY-s.top<=i+na?n=-ra(i-e.clientY):e.clientY+s.bottom>=o-na&&(n=ra(e.clientY-o)),this.setScrollSpeed(t,n)}up(e){this.dragging??this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener(`mousemove`,this.move),e.removeEventListener(`mouseup`,this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=Ai(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:`select.pointer`}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent(`input.type`))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function oa(e,t){let n=e.state.facet(rr);return n.length?n[0](t):F.mac?t.metaKey:t.ctrlKey}function sa(e,t){let n=e.state.facet(ir);return n.length?n[0](t):F.mac?!t.altKey:!t.ctrlKey}function ca(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=cn(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}function la(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=V.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}var ua=Object.create(null),da=Object.create(null),fa=F.ie&&F.ie_version<15||F.ios&&F.webkit_version<604;function pa(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement(`textarea`));n.style.cssText=`position: fixed; left: -10000px; top: 10px`,n.focus(),setTimeout(()=>{e.focus(),n.remove(),ha(e,n.value)},50)}function ma(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function ha(e,t){t=ma(e.state,ur,t);let{state:n}=e,r,i=1,a=n.toText(t),o=a.lines==n.selection.ranges.length;if(Da!=null&&n.selection.ranges.every(e=>e.empty)&&Da==a.toString()){let e=-1;r=n.changeByRange(r=>{let s=n.doc.lineAt(r.from);if(s.from==e)return{range:r};e=s.from;let c=n.toText((o?a.line(i++).text:t)+n.lineBreak);return{changes:{from:s.from,insert:c},range:T.cursor(r.from+c.length)}})}else r=o?n.changeByRange(e=>{let t=a.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:T.cursor(e.from+t.length)}}):n.replaceSelection(a);e.dispatch(r,{userEvent:`input.paste`,scrollIntoView:!0})}da.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,F.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())},da.wheel=da.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},ua.keydown=(e,t)=>(e.inputState.setSelectionOrigin(`select`),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),da.touchstart=(e,t)=>{let n=e.inputState,r=t.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin(`select.pointer`)},da.touchmove=e=>{e.inputState.setSelectionOrigin(`select.pointer`)},da.touchend=(e,t)=>{e.inputState.touchActive=!1},ua.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(ar))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=Sa(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new aa(e,t,n,r)),r&&e.observer.ignore(()=>{En(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}else e.inputState.setSelectionOrigin(`select.pointer`);return!1};function ga(e,t,n,r){if(r==1)return T.cursor(t,n);if(r==2)return Si(e.state,t,n);{let r=e.docView.lineAt(t,n),i=e.state.doc.lineAt(r?r.posAtEnd:t),a=r?r.posAtStart:i.from,o=r?r.posAtEnd:i.to;return o<e.state.doc.length&&o==i.to&&o++,T.undirectionalRange(a,o)}}var _a=F.ie&&F.ie_version<=11,va=null,ya=0,ba=0;function xa(e){if(!_a)return e.detail;let t=va,n=ba;return va=e,ba=Date.now(),ya=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(ya+1)%3:1}function Sa(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=xa(t),i=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),i=i.map(e.changes))},get(t,a,o){let s=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),c,l=ga(e,s.pos,s.assoc,r);if(n.pos!=s.pos&&!a){let t=ga(e,n.pos,n.assoc,r),i=Math.min(t.from,l.from),a=Math.max(t.to,l.to);l=i<l.from?T.range(i,a,l.assoc):T.range(a,i,l.assoc)}return a?i.replaceRange(i.main.extend(l.from,l.to,l.assoc)):o&&r==1&&i.ranges.length>1&&(c=Ca(i,s.pos))?c:o?i.addRange(l):T.create([l])}}}function Ca(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return T.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-+(e.mainIndex>n))}return null}ua.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=T.undirectionalRange(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData(`Text`,ma(e.state,dr,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed=`copyMove`),!1},ua.dragend=e=>(e.inputState.draggedContent=null,!1);function wa(e,t,n,r){if(n=ma(e.state,ur,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,o=r&&a&&sa(e,t)?{from:a.from,to:a.to}:null,s={from:i,insert:n},c=e.state.changes(o?[o,s]:s);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(i,-1),head:c.mapPos(i,1)},userEvent:o?`move.drop`:`input.drop`}),e.inputState.draggedContent=null}ua.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,a=()=>{++i==n.length&&wa(e,t,r.filter(e=>e!=null).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=a,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),a()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData(`Text`);if(n)return wa(e,t,n,!0),!0}return!1},ua.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=fa?null:t.clipboardData;return n?(ha(e,n.getData(`text/plain`)||n.getData(`text/uri-list`)),!0):(pa(e),!1)};function Ta(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement(`textarea`));r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function Ea(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let i=-1;for(let{from:r}of e.selection.ranges){let a=e.doc.lineAt(r);a.number>i&&(t.push(a.text),n.push({from:a.from,to:Math.min(e.doc.length,a.to+1)})),i=a.number}r=!0}return{text:ma(e,dr,t.join(e.lineBreak)),ranges:n,linewise:r}}var Da=null;ua.copy=ua.cut=(e,t)=>{if(!un(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=Ea(e.state);if(!n&&!i)return!1;Da=i?n:null,t.type==`cut`&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:`delete.cut`});let a=fa?null:t.clipboardData;return a?(a.clearData(),a.setData(`text/plain`,n),!0):(Ta(e,n),!1)};var Oa=He.define();function ka(e,t){let n=[];for(let r of e.facet(lr)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:Oa.of(!0)}):null}function Aa(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=ka(e.state,t);n?e.dispatch(n):e.update([])}},10)}da.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),Aa(e)},da.blur=e=>{e.observer.clearSelectionRange(),Aa(e)},da.compositionstart=da.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange??(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},da.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,F.chrome&&F.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},da.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},ua.beforeinput=(e,t)=>{if((t.inputType==`insertText`||t.inputType==`insertCompositionText`)&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType==`insertReplacementText`&&e.observer.editContext){let n=t.dataTransfer?.getData(`text/plain`),r=t.getTargetRanges();if(n&&r.length){let t=r[0];return Ui(e,{from:e.posAtDOM(t.startContainer,t.startOffset),to:e.posAtDOM(t.endContainer,t.endOffset),insert:e.state.toText(n)},null),!0}}let n;if(F.chrome&&F.android&&(n=$i.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(n.key,n.keyCode),n.key==`Backspace`||n.key==`Delete`)){let t=window.visualViewport?.height||0;setTimeout(()=>{(window.visualViewport?.height||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return F.ios&&t.inputType==`deleteContentForward`&&e.observer.flushSoon(),F.safari&&t.inputType==`insertText`&&e.inputState.composing>=0&&setTimeout(()=>da.compositionend(e,t),20),!1};var ja=new Set;function Ma(e){ja.has(e)||(ja.add(e),e.addEventListener(`copy`,()=>{}),e.addEventListener(`cut`,()=>{}))}var Na=[`pre-wrap`,`normal`,`pre-line`,`break-spaces`],Pa=!1;function Fa(){Pa=!1}var Ia=class{constructor(e){this.lineWrapping=e,this.doc=p.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Na.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,n,r,i,a){let o=Na.indexOf(e)>-1,s=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=i,s){this.heightSamples={};for(let e=0;e<a.length;e++){let t=a[e];t<0?e++:this.heightSamples[Math.floor(t*10)]=!0}}return s}},La=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},Ra=class e{constructor(e,t,n,r,i){this.from=e,this.length=t,this.top=n,this.height=r,this._content=i}get type(){return typeof this._content==`number`?I.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof nn?this._content.widget:null}get widgetLineBreaks(){return typeof this._content==`number`?this._content:0}join(t){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new e(this.from,this.length+t.length,this.top,this.height+t.height,n)}},H=(function(e){return e[e.ByPos=0]=`ByPos`,e[e.ByHeight=1]=`ByHeight`,e[e.ByPosNoHeight=2]=`ByPosNoHeight`,e})(H||={}),za=.001,Ba=class e{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>za&&(Pa=!0),this.height=e)}replace(t,n,r){return e.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this,a=n.doc;for(let o=r.length-1;o>=0;o--){let{fromA:s,toA:c,fromB:l,toB:u}=r[o],d=i.lineAt(s,H.ByPosNoHeight,n.setDoc(t),0,0),f=d.to>=c?d:i.lineAt(c,H.ByPosNoHeight,n,0,0);for(u+=f.to-c,c=f.to;o>0&&d.from<=r[o-1].toA;)s=r[o-1].fromA,l=r[o-1].fromB,o--,s<d.from&&(d=i.lineAt(s,H.ByPosNoHeight,n,0,0));l+=d.from-s,s=d.from;let p=Ya.build(n.setDoc(a),e,l,u);i=Va(i,i.replace(s,c,p))}return i.updateHeight(n,0)}static empty(){return new Wa(0,0,0)}static of(t){if(t.length==1)return t[0];let n=0,r=t.length,i=0,a=0;for(;;)if(n==r){if(i>a*2){let e=t[n-1];e.break?t.splice(--n,1,e.left,null,e.right):t.splice(--n,1,e.left,e.right),r+=1+e.break,i-=e.size}else if(a>i*2){let e=t[r];e.break?t.splice(r,1,e.left,null,e.right):t.splice(r,1,e.left,e.right),r+=2+e.break,a-=e.size}else break}else if(i<a){let e=t[n++];e&&(i+=e.size)}else{let e=t[--r];e&&(a+=e.size)}let o=0;return t[n-1]==null?(o=1,n--):t[n]??(o=1,r++),new Ka(e.of(t.slice(0,n)),o,e.of(t.slice(r)))}};function Va(e,t){return e==t?e:(e.constructor!=t.constructor&&(Pa=!0),t)}Ba.prototype.size=1;var Ha=L.replace({}),Ua=class extends Ba{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new Ra(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new Ra(r,0,n,this.spaceAbove,Ha):this.mainBlock(n,r)}lineAt(e,t,n,r,i){let a=this.mainBlock(r,i);return this.spaceAbove?this.blockAt(0,n,r,i).join(a):a}forEachLine(e,t,n,r,i,a){e<=i+this.length&&t>=i&&a(this.lineAt(0,H.ByPos,n,r,i))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},Wa=class e extends Ua{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new Ra(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof e||i instanceof Ga&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof Ga?i=new e(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Ba.of(r)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:``}${this.widgetHeight?`:`+this.widgetHeight:``})`}},Ga=class e extends Ba{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-n+1,a,o=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);a=t/i,this.length>i+1&&(o=(this.height-t)/(this.length-i-1))}else a=this.height/i;return{firstLine:n,lastLine:r,perLine:a,perChar:o}}blockAt(e,t,n,r){let{firstLine:i,lastLine:a,perLine:o,perChar:s}=this.heightMetrics(t,r);if(t.lineWrapping){let i=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),a=t.doc.lineAt(i),c=o+a.length*s,l=Math.max(n,e-c/2);return new Ra(a.from,a.length,l,c,0)}{let r=Math.max(0,Math.min(a-i,Math.floor((e-n)/o))),{from:s,length:c}=t.doc.line(i+r);return new Ra(s,c,n+o*r,o,0)}}lineAt(e,t,n,r,i){if(t==H.ByHeight)return this.blockAt(e,n,r,i);if(t==H.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new Ra(t,r-t,0,0,0)}let{firstLine:a,perLine:o,perChar:s}=this.heightMetrics(n,i),c=n.doc.lineAt(e),l=o+c.length*s,u=c.number-a,d=r+o*u+s*(c.from-i-u);return new Ra(c.from,c.length,Math.max(r,Math.min(d,r+this.height-l)),l,0)}forEachLine(e,t,n,r,i,a){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:o,perLine:s,perChar:c}=this.heightMetrics(n,i);for(let l=e,u=r;l<=t;){let t=n.doc.lineAt(l);if(l==e){let n=t.number-o;u+=s*n+c*(e-i-n)}let r=s+c*t.length;a(new Ra(t.from,t.length,u,r,0)),u+=r,l=t.to+1}}replace(t,n,r){let i=this.length-n;if(i>0){let t=r[r.length-1];t instanceof e?r[r.length-1]=new e(t.length+i):r.push(null,new e(i-1))}if(t>0){let n=r[0];n instanceof e?r[0]=new e(t+n.length):r.unshift(new e(t-1),null)}return Ba.of(r)}decomposeLeft(t,n){n.push(new e(t-1),null)}decomposeRight(t,n){n.push(null,new e(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let a=n+this.length;if(i&&i.from<=n+this.length&&i.more){let r=[],o=Math.max(n,i.from),s=-1;for(i.from>n&&r.push(new e(i.from-n-1).updateHeight(t,n));o<=a&&i.more;){let e=t.doc.lineAt(o).length;r.length&&r.push(null);let n=i.heights[i.index++],a=0;n<0&&(a=-n,n=i.heights[i.index++]),s==-1?s=n:Math.abs(n-s)>=za&&(s=-2);let c=new Wa(e,n,a);c.outdated=!1,r.push(c),o+=e+1}o<=a&&r.push(null,new e(a-o).updateHeight(t,o));let c=Ba.of(r);return(s<0||Math.abs(c.height-this.height)>=za||Math.abs(s-this.heightMetrics(t,n).perLine)>=za)&&(Pa=!0),Va(this,c)}return(r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}},Ka=class extends Ba{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let i=n+this.left.height;return e<i?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,i,r+this.left.length+this.break)}lineAt(e,t,n,r,i){let a=r+this.left.height,o=i+this.left.length+this.break,s=t==H.ByHeight?e<a:e<o,c=s?this.left.lineAt(e,t,n,r,i):this.right.lineAt(e,t,n,a,o);if(this.break||(s?c.to<o:c.from>o))return c;let l=t==H.ByPosNoHeight?H.ByPosNoHeight:H.ByPos;return s?c.join(this.right.lineAt(o,l,n,a,o)):this.left.lineAt(o,l,n,r,i).join(c)}forEachLine(e,t,n,r,i,a){let o=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e<s&&this.left.forEachLine(e,t,n,r,i,a),t>=s&&this.right.forEachLine(e,t,n,o,s,a);else{let c=this.lineAt(s,H.ByPos,n,r,i);e<c.from&&this.left.forEachLine(e,c.from-1,n,r,i,a),c.to>=e&&c.from<=t&&a(c),t>c.to&&this.right.forEachLine(c.to+1,t,n,o,s,a)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let a=i.length;for(let e of n)i.push(e);if(e>0&&qa(i,a-1),t<this.length){let e=i.length;this.decomposeRight(t,i),qa(i,e)}return Ba.of(i)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?Ba.of(this.break?[e,null,t]:[e,t]):(this.left=Va(this.left,e),this.right=Va(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:i,right:a}=this,o=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=o+a.length&&r.more?s=a=a.updateHeight(e,o,n,r):a.updateHeight(e,o,n),s?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?` `:`-`)+this.right}};function qa(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof Ga&&(r=e[t+1])instanceof Ga&&e.splice(t-1,3,new Ga(n.length+1+r.length))}var Ja=5,Ya=class e{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof Wa?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new Wa(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,i=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let a=t-e;n.block?this.addBlock(new Ua(a,r,n)):(a||i||r>=Ja)&&this.addLineDeco(r,i,a)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Wa(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new Ga(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Wa)return e;let t=new Wa(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos+=e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos+=n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Wa)&&!this.isCovered?this.nodes.push(new Wa(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let e of this.nodes)e instanceof Wa&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(t,n,r,i){let a=new e(r,t);return N.spans(n,r,i,a,0),a.finish(r)}};function Xa(e,t,n){let r=new Za;return N.compare(e,t,n,r,0),r.changes}var Za=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&on(e,t,this.changes,5)}};function Qa(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,a=Math.max(0,n.left),o=Math.min(i.innerWidth,n.right),s=Math.max(0,n.top),c=Math.min(i.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(t.nodeType==1){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&r.overflow!=`visible`){let r=n.getBoundingClientRect();a=Math.max(a,r.left),o=Math.min(o,r.right),s=Math.max(s,r.top),c=Math.min(t==e.parentNode?i.innerHeight:c,r.bottom)}t=r.position==`absolute`||r.position==`fixed`?n.offsetParent:n.parentNode}else if(t.nodeType==11)t=t.host;else break;return{left:a-n.left,right:Math.max(a,o)-n.left,top:s-(n.top+t),bottom:Math.max(s,c)-(n.top+t)}}function $a(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}function eo(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}var to=class{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,t){return L.replace({widget:new no(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},no=class extends $t{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement(`div`);return this.vertical?e.style.height=this.size+`px`:(e.style.width=this.size+`px`,e.style.height=`2px`,e.style.display=`inline-block`),e}get estimatedHeight(){return this.vertical?this.size:-1}},ro=class{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=lo,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=R.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(wr).some(e=>typeof e!=`function`&&e.class==`cm-lineWrapping`);this.heightOracle=new Ia(n),this.stateDeco=uo(t),this.heightMap=Ba.empty().applyChanges(this.stateDeco,p.empty,this.heightOracle.setDoc(t.doc),[new Pr(0,0,0,t.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=L.set(this.lineGaps.map(e=>e.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new io(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?lo:new fo(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(po(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=uo(this.state);let r=e.changedRanges,i=Pr.extendWithRanges(r,Xa(n,this.stateDeco,e?e.changes:C.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Fa(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=a||Pa)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let s=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<s.from||t.range.head>s.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t));let c=s.from!=this.viewport.from||s.to!=this.viewport.to;this.viewport=s,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(pr)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,i=n.whiteSpace;this.defaultTextDirection=n.direction==`rtl`?R.RTL:R.LTR;let a=this.heightOracle.mustRefreshForWrapping(i)||this.mustMeasureContent===`refresh`,o=t.getBoundingClientRect(),s=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,l=0;if(o.width&&o.height){let{scaleX:e,scaleY:n}=yn(t,o);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,c|=16,a=s=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=u||this.paddingBottom!=d)&&(this.paddingTop=u,this.paddingBottom=d,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(s=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let f=xn(this.view.contentDOM,!1).y;f!=this.scrollParent&&(this.scrollParent=f,this.scrollAnchorHeight=-1,this.scrollOffset=0);let m=this.getScrollOffset();this.scrollOffset!=m&&(this.scrollAnchorHeight=-1,this.scrollOffset=m),this.scrolledToBottom=Mn(this.scrollParent||e.win);let h=(this.printing?eo:Qa)(t,this.paddingTop),g=h.top-this.pixelViewport.top,_=h.bottom-this.pixelViewport.bottom;this.pixelViewport=h;let v=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(v!=this.inView&&(this.inView=v,v&&(s=!0)),!this.inView&&!this.scrollTarget&&!$a(e.dom))return 0;let y=o.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),s){let t=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(t)&&(a=!0),a||r.lineWrapping&&Math.abs(y-this.contentDOMWidth)>r.charWidth){let{lineHeight:n,charWidth:o,textHeight:s}=e.docView.measureTextSize();a=n>0&&r.refresh(i,n,o,s,Math.max(5,y/o),t),a&&(e.docView.minWidth=0,c|=16)}g>0&&_>0?l=Math.max(g,_):g<0&&_<0&&(l=Math.min(g,_)),Fa();for(let n of this.viewports){let i=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(a?Ba.empty().applyChanges(this.stateDeco,p.empty,this.heightOracle,[new Pr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new La(n.from,i))}Pa&&(c|=2)}let ee=!this.viewportIsAppropriate(this.viewport,l)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return ee&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(l,this.scrollTarget),c|=this.updateForViewport()),(c&2||ee)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,s=new io(r.lineAt(a-n*1e3,H.ByHeight,i,0,0).from,r.lineAt(o+(1-n)*1e3,H.ByHeight,i,0,0).to);if(t){let{head:e}=t.range;if(e<s.from||e>s.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),a=r.lineAt(e,H.ByPos,i,0,0),o;o=t.y==`center`?(a.top+a.bottom)/2-n/2:t.y==`start`||t.y==`nearest`&&e<s.from?a.top:a.bottom-n,s=new io(r.lineAt(o-500,H.ByHeight,i,0,0).from,r.lineAt(o+n+500,H.ByHeight,i,0,0).to)}}return s}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new io(this.heightMap.lineAt(n,H.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,H.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,H.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,H.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:o}=this;return(e==0||r<=a-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||i>=o+Math.max(10,Math.min(n,250)))&&r>a-2e3&&i<o+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new to(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,i=r>>1,a=r<<1;if(this.defaultTextDirection!=R.LTR&&!n)return[];let o=[],s=(r,a,c,l)=>{if(a-r<i)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>r&&e<a){s(r,e-10,c,l),s(e+10,a,c,l);return}let f=co(e,e=>e.from>=c.from&&e.to<=c.to&&Math.abs(e.from-r)<i&&Math.abs(e.to-a)<i&&!d.some(t=>e.from<t&&e.to>t));if(!f){if(a<c.to&&t&&n&&t.visibleRanges.some(e=>e.from<=a&&e.to>=a)){let e=t.moveToLineBoundary(T.cursor(a),!1,!0).head;e>r&&(a=e)}let e=this.gapSize(c,r,a,l);f=new to(r,a,e,n||e<2e6?e:2e6)}o.push(f)},c=t=>{if(t.length<a||t.type!=I.Text)return;let i=ao(t.from,t.to,this.stateDeco);if(i.total<a)return;let o=this.scrollTarget?this.scrollTarget.range.head:null,c,l;if(n){let e=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,n,a;if(o!=null){let r=so(i,o),s=((this.visibleBottom-this.visibleTop)/2+e)/t.height;n=r-s,a=r+s}else n=(this.visibleTop-t.top-e)/t.height,a=(this.visibleBottom-t.top+e)/t.height;c=oo(i,n),l=oo(i,a)}else{let n=i.total*this.heightOracle.charWidth,a=r*this.heightOracle.charWidth,s=0;if(n>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+s<this.pixelViewport.left&&(s=n.size-n.displaySize);let u=this.pixelViewport.left+s,d=this.pixelViewport.right+s,f,p;if(o!=null){let e=so(i,o),t=((d-u)/2+a)/n;f=e-t,p=e+t}else f=(u-a)/n,p=(d+a)/n;c=oo(i,f),l=oo(i,p)}c>t.from&&s(t.from,c,t,i),l<t.to&&s(l,t.to,t,i)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(c):c(e);return o}gapSize(e,t,n,r){let i=so(r,n)-so(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){to.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=L.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];N.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(r&8);t++){let i=this.visibleRanges[t],a=n[t];(i.from!=a.from||i.to!=a.to)&&(r|=4,e&&e.mapPos(i.from,-1)==a.from&&e.mapPos(i.to,1)==a.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||po(this.heightMap.lineAt(e,H.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||po(this.heightMap.lineAt(this.scaler.fromDOM(e),H.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return po(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},io=class{constructor(e,t){this.from=e,this.to=t}};function ao(e,t,n){let r=[],i=e,a=0;return N.spans(n,e,t,{span(){},point(e,t){e>i&&(r.push({from:i,to:e}),a+=e-i),i=t}},20),i<t&&(r.push({from:i,to:t}),a+=t-i),{total:a,ranges:r}}function oo({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],a=i-n;if(r<=a)return n+r;r-=a}}function so(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function co(e,t){for(let n of e)if(t(n))return n}var lo={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function uo(e){let t=e.facet(Tr).filter(e=>typeof e!=`function`),n=e.facet(Dr).filter(e=>typeof e!=`function`);return n.length&&t.push(N.join(n)),t}var fo=class e{constructor(e,t,n){let r=0,i=0,a=0;this.viewports=n.map(({from:n,to:i})=>{let a=t.lineAt(n,H.ByPos,e,0,0).top,o=t.lineAt(i,H.ByPos,e,0,0).bottom;return r+=o-a,{from:n,to:i,top:a,bottom:o,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let e of this.viewports)e.domTop=a+(e.top-i)*this.scale,a=e.domBottom=e.domTop+(e.bottom-e.top),i=e.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return r+(e-n)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);n=i.bottom,r=i.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return n+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);n=i.bottom,r=i.domBottom}}eq(t){return t instanceof e&&this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((e,n)=>e.from==t.viewports[n].from&&e.to==t.viewports[n].to)}};function po(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new Ra(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>po(e,t)):e._content)}var mo=E.define({combine:e=>e.join(` `)}),ho=E.define({combine:e=>e.indexOf(!0)>-1}),go=Tt.newName(),_o=Tt.newName(),vo=Tt.newName(),yo={"&light":`.`+_o,"&dark":`.`+vo};function bo(e,t,n){return new Tt(t,{finish(t){return/&/.test(t)?t.replace(/&\w*/,t=>{if(t==`&`)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+` `+t}})}var xo=bo(`.`+go,{"&":{position:`relative !important`,boxSizing:`border-box`,"&.cm-focused":{outline:`1px dotted #212121`},display:`flex !important`,flexDirection:`column`},".cm-scroller":{display:`flex !important`,alignItems:`flex-start !important`,fontFamily:`monospace`,lineHeight:1.4,height:`100%`,overflowX:`auto`,position:`relative`,zIndex:0,overflowAnchor:`none`},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:`block`,whiteSpace:`pre`,wordWrap:`normal`,boxSizing:`border-box`,minHeight:`100%`,padding:`4px 0`,outline:`none`,"&[contenteditable=true]":{WebkitUserModify:`read-write-plaintext-only`}},".cm-lineWrapping":{whiteSpace_fallback:`pre-wrap`,whiteSpace:`break-spaces`,wordBreak:`break-word`,overflowWrap:`anywhere`,flexShrink:1},"&light .cm-content":{caretColor:`black`},"&dark .cm-content":{caretColor:`white`},".cm-line":{display:`block`,padding:`0 2px 0 6px`},".cm-layer":{userSelect:`none`,position:`absolute`,left:0,top:0,contain:`size style`,"& > *":{position:`absolute`}},"&light .cm-selectionBackground":{background:`#d9d9d9`},"&dark .cm-selectionBackground":{background:`#222`},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#d7d4f0`},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#233`},".cm-cursorLayer":{pointerEvents:`none`},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:`steps(1) cm-blink 1.2s infinite`},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:`1.2px solid black`,marginLeft:`-0.6px`,pointerEvents:`none`},".cm-cursor":{display:`none`},"&dark .cm-cursor":{borderLeftColor:`#ddd`},".cm-selectionHandle":{backgroundColor:`currentColor`,width:`1.5px`},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:`""`,backgroundColor:`inherit`,borderRadius:`50%`,width:`8px`,height:`8px`,position:`absolute`,left:`-3.25px`},".cm-selectionHandle-start::before":{top:`-8px`},".cm-selectionHandle-end::before":{bottom:`-8px`},".cm-dropCursor":{position:`absolute`},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:`block`},".cm-iso":{unicodeBidi:`isolate`},".cm-announced":{position:`fixed`,top:`-10000px`},"@media print":{".cm-announced":{display:`none`}},"&light .cm-activeLine":{backgroundColor:`#cceeff44`},"&dark .cm-activeLine":{backgroundColor:`#99eeff33`},"&light .cm-specialChar":{color:`red`},"&dark .cm-specialChar":{color:`#f78`},".cm-gutters":{flexShrink:0,display:`flex`,height:`100%`,boxSizing:`border-box`,zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:`#f5f5f5`,color:`#6c6c6c`,border:`0px solid #ddd`,"&.cm-gutters-before":{borderRightWidth:`1px`},"&.cm-gutters-after":{borderLeftWidth:`1px`}},"&dark .cm-gutters":{backgroundColor:`#333338`,color:`#ccc`},".cm-gutter":{display:`flex !important`,flexDirection:`column`,flexShrink:0,boxSizing:`border-box`,minHeight:`100%`,overflow:`hidden`},".cm-gutterElement":{boxSizing:`border-box`},".cm-lineNumbers .cm-gutterElement":{padding:`0 3px 0 5px`,minWidth:`20px`,textAlign:`right`,whiteSpace:`nowrap`},"&light .cm-activeLineGutter":{backgroundColor:`#e2f2ff`},"&dark .cm-activeLineGutter":{backgroundColor:`#222227`},".cm-panels":{boxSizing:`border-box`,position:`sticky`,left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:`#f5f5f5`,color:`black`},".cm-panels-top":{top:`0`},".cm-panels-bottom":{bottom:`0`},"&light .cm-panels-top":{borderBottom:`1px solid #ddd`},"&light .cm-panels-bottom":{borderTop:`1px solid #ddd`},"&dark .cm-panels":{backgroundColor:`#333338`,color:`white`},".cm-dialog":{padding:`2px 19px 4px 6px`,position:`relative`,"& label":{fontSize:`80%`}},".cm-dialog-close":{position:`absolute`,top:`3px`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,fontSize:`14px`,padding:`0`},".cm-tab":{display:`inline-block`,overflow:`hidden`,verticalAlign:`bottom`},".cm-widgetBuffer":{verticalAlign:`text-top`,height:`1em`,width:0,display:`inline`},".cm-placeholder":{color:`#888`,display:`inline-block`,verticalAlign:`top`,userSelect:`none`},".cm-highlightSpace":{backgroundImage:`radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)`,backgroundPosition:`center`},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:`auto 100%`,backgroundPosition:`right 90%`,backgroundRepeat:`no-repeat`},".cm-trailingSpace":{backgroundColor:`#ff332255`},".cm-button":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,padding:`.2em 1em`,borderRadius:`1px`},"&light .cm-button":{backgroundImage:`linear-gradient(#eff1f5, #d9d9df)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#b4b4b4, #d0d3d6)`}},"&dark .cm-button":{backgroundImage:`linear-gradient(#393939, #111)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#111, #333)`}},".cm-textfield":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,border:`1px solid silver`,padding:`.2em .5em`},"&light .cm-textfield":{backgroundColor:`white`},"&dark .cm-textfield":{border:`1px solid #555`,backgroundColor:`inherit`}},yo),So={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Co=F.ie&&F.ie_version<=11,wo=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Sn,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(F.ie&&F.ie_version<=11||F.ios&&e.composing)&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&F.android&&e.constructor.EDIT_CONTEXT!==!1&&!(F.chrome&&F.chrome_version<126)&&(this.editContext=new Oo(e),e.state.facet(yr)&&(e.contentDOM.editContext=this.editContext.editContext)),Co&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia(`print`)),typeof ResizeObserver==`function`&&(this.resizeScroll=new ResizeObserver(()=>{this.view.docView?.lastUpdate<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver==`function`&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent(`Event`)))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent(`Event`))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers(`scroll`,e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type==`change`||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(yr)?n.root.activeElement!=this.dom:!un(this.dom,r))return;let i=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(F.ie&&F.ie_version<=11||F.android&&F.chrome)&&!n.state.selection.main.empty&&r.focusNode&&fn(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=cn(e.root);if(!t)return!1;let n=F.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Do(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=un(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&jn(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(n.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||=this.scrollTargets.slice(0,e),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener(`scroll`,this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||=(this.observer.observe(this.dom,So),Co&&this.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Co&&this.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&kn(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}(!this.delayedAndroidKey||e==`Enter`)&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!this.delayedAndroidKey?.force})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!0),t==-1?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&un(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new Bi(this.view,e,t,n);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=Hi(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!Ji(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type==`attributes`),e.type==`childList`){let n=To(t,e.previousSibling||e.target.previousSibling,-1),r=To(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}return e.type==`characterData`?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener(`change`,this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener(`beforeprint`,this.onPrint),e.addEventListener(`scroll`,this.onScroll),e.document.addEventListener(`selectionchange`,this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener(`scroll`,this.onScroll),e.removeEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener(`change`,this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener(`beforeprint`,this.onPrint),e.document.removeEventListener(`selectionchange`,this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(yr)!=e.state.facet(yr)&&(e.view.contentDOM.editContext=e.state.facet(yr)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)==null||e.disconnect(),(t=this.gapIntersection)==null||t.disconnect(),(n=this.resizeScroll)==null||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function To(e,t,n){for(;t;){let r=V.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i==e.dom?n>0?t.nextSibling:t.previousSibling:i}return null}function Eo(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return fn(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function Do(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Eo(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener(`beforeinput`,r,!0),e.dom.ownerDocument.execCommand(`indent`),e.contentDOM.removeEventListener(`beforeinput`,r,!0),n?Eo(e,n):null}var Oo=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:i,head:a}=r,o=this.toEditorPos(n.updateRangeStart),s=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:o,drifted:!1});let c=s-o>n.text.length;o==this.from&&i<this.from?o=i:s==this.to&&i>this.to&&(s=i);let l=Gi(e.state.sliceDoc(o,s),n.text,(c?r.from:r.to)-o,c?`end`:null);if(!l){let t=T.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));Ji(t,r)||e.dispatch({selection:t,userEvent:`select`});return}let u={from:l.from+o,to:l.toA+o,insert:p.of(n.text.slice(l.from,l.toB).split(`10+`))};if((F.mac||F.android)&&u.from==a-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(u={from:o,to:s,insert:p.of([n.text.replace(`.`,` `)])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);Ui(e,u,T.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);t<a;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),a=this.toEditorPos(e.rangeEnd);if(i<a){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+` `:t==`Dashed`?`dashed `:t==`Squiggle`?`wavy `:``}${/thin/i.test(r)?1:2}px`;n.push(L.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:_r.of(L.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{let t=cn(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,a,o,s,c)=>{if(n)return;let l=c.length-(a-i);if(r&&a>=r.to){if(r.from==i&&r.to==a&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=l,this.to+=l;return}r=null,this.revertPending(e.state)}if(i+=t,a+=t,a<=this.from)this.from+=l,this.to+=l;else if(i<this.to){if(i<this.from||a>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),c.toString()),this.to+=l}t+=l}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent(`input.type`)&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>3e4)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},U=class e{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement(`div`),this.scrollDOM=document.createElement(`div`),this.scrollDOM.tabIndex=-1,this.scrollDOM.className=`cm-scroller`,this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement(`div`),this.announceDOM.className=`cm-announced`,this.announceDOM.setAttribute(`aria-live`,`polite`),this.dom=document.createElement(`div`),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(e=>e.forEach(e=>t(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||An(e.parent)||document,this.viewState=new ro(this,e.state||M.create(e)),e.scrollTo&&e.scrollTo.is(gr)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(xr).map(e=>new Sr(e));for(let e of this.plugins)e.update(this);this.observer=new wo(this),this.inputState=new Yi(this),this.inputState.ensureHandlers(this.plugins),this.docView=new li(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),document.fonts?.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=`refresh`,this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof O?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(t){if(this.updateState!=0)throw Error(`Calls to EditorView.update are not allowed while an update is in progress`);let n=!1,r=!1,i,a=this.state;for(let e of t){if(e.startState!=a)throw RangeError(`Trying to update state with a transaction that doesn't start from the previous state.`);a=e.state}if(this.destroyed){this.viewState.state=a;return}let o=this.hasFocus,s=0,c=null;t.some(e=>e.annotation(Oa))?(this.inputState.notifiedFocused=o,s=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=ka(a,o),c||(s=1));let l=this.observer.delayedAndroidKey,u=null;if(l?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(u=null)):this.observer.clear(),a.facet(M.phrases)!=this.state.facet(M.phrases))return this.setState(a);i=Fr.create(this,a,t),i.flags|=s;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let n of t){if(d&&=d.map(n.changes),n.scrollIntoView){let{main:t}=n.state.selection,{x:r,y:i}=this.state.facet(e.cursorScrollMargin);d=new hr(t.empty?t:T.cursor(t.head,t.head>t.anchor?-1:1),`nearest`,`nearest`,i,r)}for(let e of n.effects)e.is(gr)&&(d=e.value.clip(this.state))}this.viewState.update(i,d),this.bidiCache=jo.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(Nr)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(e=>e.isUserEvent(`select.pointer`)))}finally{this.updateState=0}if(i.startState.facet(mo)!=i.state.facet(mo)&&(this.viewState.mustMeasureContent=!0),(n||r||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let e of this.state.facet(sr))try{e(i)}catch(e){vr(this.state,e,`update listener`)}(c||u)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),u&&!Hi(this,u)&&l.force&&kn(this.contentDOM,l.key,l.keyCode)})}setState(e){if(this.updateState!=0)throw Error(`Calls to EditorView.setState are not allowed while an update is in progress`);if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new ro(this,e),this.plugins=e.facet(xr).map(e=>new Sr(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new li(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(xr),n=e.state.facet(xr);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new Sr(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){vr(this.state,e,`doc view update listener`)}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:i,scrollAnchorHeight:a}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(a<0){if(Mn(n||this.win))i=-1,a=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(r);i=e.from,a=e.top}}this.updateState=1;let o=this.viewState.measure();if(!o&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(e>5){console.warn(this.measureRequests.length?`Measure loop restarted more than 5 times`:`Viewport failed to stabilize`);break}let s=[];o&4||([this.measureRequests,s]=[s,this.measureRequests]);let c=s.map(e=>{try{return e.read(this)}catch(e){return vr(this.state,e),Ao}}),l=Fr.create(this,this.state,[]),u=!1;l.flags|=o,t?t.flags|=o:t=l,this.updateState=2,l.empty||(this.updatePlugins(l),this.inputState.update(l),this.updateAttrs(),u=this.docView.update(l),u&&this.docViewUpdate());for(let e=0;e<s.length;e++)if(c[e]!=Ao)try{let t=s[e];t.write&&t.write(c[e],this)}catch(e){vr(this.state,e)}if(u&&this.docView.updateSelection(!0),!l.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight){if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}{let e=((i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-a)/this.scaleY;if((e>1||e<-1)&&!(F.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r+=e,n?i<0?n.scrollTop=n.scrollHeight:n.scrollTop+=e:this.win.scrollBy(0,e),a=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(sr))e(t)}get themeClasses(){return go+` `+(this.state.facet(ho)?vo:_o)+` `+this.state.facet(mo)}updateAttrs(){let e=Mo(this,Cr,{class:`cm-editor`+(this.hasFocus?` cm-focused `:` `)+this.themeClasses}),t={spellcheck:`false`,autocorrect:`off`,autocapitalize:`off`,writingsuggestions:`false`,translate:`no`,contenteditable:this.state.facet(yr)?`true`:`false`,class:`cm-content`,style:`${F.tabSize}: ${this.state.tabSize}`,role:`textbox`,"aria-multiline":`true`};this.state.readOnly&&(t[`aria-readonly`]=`true`),Mo(this,wr,t);let n=this.observer.ignore(()=>{let n=Zt(this.contentDOM,this.contentAttrs,t),r=Zt(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(t){let n=!0;for(let r of t)for(let t of r.effects)if(t.is(e.announce)){n&&(this.announceDOM.textContent=``),n=!1;let e=this.announceDOM.appendChild(document.createElement(`div`));e.textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(Nr);let t=this.state.facet(e.cspNonce);Tt.mount(this.root,this.styleModules.concat(xo).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw Error(`Reading the editor layout isn't allowed during an update`);this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return ji(this,e,Ei(this,e,t,n))}moveByGroup(e,t){return ji(this,e,Ei(this,e,t,t=>Di(this,e.head,t)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),i=n[t?n.length-1:0];return T.cursor(i.side(t,r)+e.from,i.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return Ti(this,e,t,n)}moveVertically(e,t,n){return ji(this,e,Oi(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=Ni(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),Ni(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.state.doc.lineAt(e),r=this.bidiSpans(n),i=r[Gn.find(r,e-n.from,-1,t)];return this.docView.coordsAt(e,t,i.dir==R.RTL)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(fr)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>ko)return $n(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||Kn(r.isolates,n=Ar(this,e))))return r.order;n||=Ar(this,e);let r=Qn(e.text,t,n);return this.bidiCache.push(new jo(e.from,e.to,t,n,!0,r)),r}get hasFocus(){return(this.dom.ownerDocument.hasFocus()||F.safari&&this.inputState?.lastContextMenu>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{En(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return gr.of(new hr(typeof e==`number`?T.cursor(e):e,t.y??`nearest`,t.x??`nearest`,t.yMargin??5,t.xMargin??5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return gr.of(new hr(T.cursor(n.from),`start`,`start`,n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e==`boolean`?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return B.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return B.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=Tt.newName(),r=[mo.of(n),Nr.of(bo(`.${n}`,e))];return t&&t.dark&&r.push(ho.of(!0)),r}static baseTheme(e){return De.lowest(Nr.of(bo(`.`+go,e,yo)))}static findFromDOM(e){let t=e.querySelector(`.cm-content`);return(t&&V.get(t)||V.get(e))?.root?.view||null}};U.styleModule=Nr,U.inputHandler=cr,U.clipboardInputFilter=ur,U.clipboardOutputFilter=dr,U.scrollHandler=mr,U.focusChangeEffect=lr,U.perLineTextDirection=fr,U.exceptionSink=or,U.updateListener=sr,U.editable=yr,U.mouseSelectionStyle=ar,U.dragMovesSelection=ir,U.clickAddsSelectionRange=rr,U.decorations=Tr,U.blockWrappers=Er,U.outerDecorations=Dr,U.atomicRanges=Or,U.bidiIsolatedRanges=kr,U.cursorScrollMargin=E.define({combine:e=>{let t=5,n=5;for(let r of e)typeof r==`number`?t=n=r:{x:t,y:n}=r;return{x:t,y:n}}}),U.scrollMargins=jr,U.darkTheme=ho,U.cspNonce=E.define({combine:e=>e.length?e[0]:``}),U.contentAttributes=wr,U.editorAttributes=Cr,U.lineWrapping=U.contentAttributes.of({class:`cm-lineWrapping`}),U.announce=D.define();var ko=4096,Ao={},jo=class e{constructor(e,t,n,r,i,a){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=i,this.order=a}static update(t,n){if(n.empty&&!t.some(e=>e.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:R.LTR;for(let a=Math.max(0,t.length-10);a<t.length;a++){let o=t[a];o.dir==i&&!n.touchesRange(o.from,o.to)&&r.push(new e(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}};function Mo(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let t=r[i],a=typeof t==`function`?t(e):t;a&&qt(a,n)}return n}var No=F.mac?`mac`:F.windows?`win`:F.linux?`linux`:`key`;function Po(e,t){let n=e.split(/-(?!$)/),r=n[n.length-1];r==`Space`&&(r=` `);let i,a,o,s;for(let e=0;e<n.length-1;++e){let r=n[e];if(/^(cmd|meta|m)$/i.test(r))s=!0;else if(/^a(lt)?$/i.test(r))i=!0;else if(/^(c|ctrl|control)$/i.test(r))a=!0;else if(/^s(hift)?$/i.test(r))o=!0;else if(/^mod$/i.test(r))t==`mac`?s=!0:a=!0;else throw Error(`Unrecognized modifier name: `+r)}return i&&(r=`Alt-`+r),a&&(r=`Ctrl-`+r),s&&(r=`Meta-`+r),o&&(r=`Shift-`+r),r}function Fo(e,t,n){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n!==!1&&t.shiftKey&&(e=`Shift-`+e),e}var Io=De.default(U.domEventHandlers({keydown(e,t){return Go(zo(t.state),e,t,`editor`)}})),Lo=E.define({enables:Io}),Ro=new WeakMap;function zo(e){let t=e.facet(Lo),n=Ro.get(t);return n||Ro.set(t,n=Uo(t.reduce((e,t)=>e.concat(t),[]))),n}function Bo(e,t,n){return Go(zo(e.state),t,e,n)}var Vo=null,Ho=4e3;function Uo(e,t=No){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(n==null)r[e]=t;else if(n!=t)throw Error(`Key binding `+e+` is used both as a regular binding and as a multi-stroke prefix`)},a=(e,r,a,o,s)=>{let c=n[e]||(n[e]=Object.create(null)),l=r.split(/ (?!$)/).map(e=>Po(e,t));for(let t=1;t<l.length;t++){let n=l.slice(0,t).join(` `);i(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=Vo={view:t,prefix:n,scope:e};return setTimeout(()=>{Vo==r&&(Vo=null)},Ho),!0}]})}let u=l.join(` `);i(u,!1);let d=c[u]||(c[u]={preventDefault:!1,stopPropagation:!1,run:(c._any?.run)?.slice()||[]});a&&d.run.push(a),o&&(d.preventDefault=!0),s&&(d.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(` `):[`editor`];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||={preventDefault:!1,stopPropagation:!1,run:[]};let{any:i}=r;for(let t in e)e[t].run.push(e=>i(e,Wo))}let i=r[t]||r.key;if(i)for(let t of e)a(t,i,r.run,r.preventDefault,r.stopPropagation),r.shift&&a(t,`Shift-`+i,r.shift,r.preventDefault,r.stopPropagation)}return n}var Wo=null;function Go(e,t,n,r){Wo=t;let i=Pt(t),a=S(x(i,0))==i.length&&i!=` `,o=``,s=!1,c=!1,l=!1;Vo&&Vo.view==n&&Vo.scope==r&&(o=Vo.prefix+` `,ta.indexOf(t.keyCode)<0&&(c=!0,Vo=null));let u=new Set,d=e=>{if(e){for(let t of e.run)if(!u.has(t)&&(u.add(t),t(n)))return e.stopPropagation&&(l=!0),!0;e.preventDefault&&(e.stopPropagation&&(l=!0),c=!0)}return!1},f=e[r],p,m;return f&&(d(f[o+Fo(i,t,!a)])?s=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(F.windows&&t.ctrlKey&&t.altKey)&&!(F.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=Ot[t.keyCode])&&p!=i?(d(f[o+Fo(p,t,!0)])||t.shiftKey&&(m=kt[t.keyCode])!=i&&m!=p&&d(f[o+Fo(m,t,!1)]))&&(s=!0):a&&t.shiftKey&&d(f[o+Fo(i,t,!0)])&&(s=!0),!s&&d(f._any)&&(s=!0)),c&&(s=!0),s&&l&&t.stopPropagation(),Wo=null,s}var Ko=class e{constructor(e,t,n,r,i){this.className=e,this.left=t,this.top=n,this.width=r,this.height=i}draw(){let e=document.createElement(`div`);return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+`px`,e.style.top=this.top+`px`,this.width!=null&&(e.style.width=this.width+`px`),e.style.height=this.height+`px`}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(t,n,r){if(r.empty){let i=t.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let a=qo(t);return[new e(n,i.left-a.left,i.top-a.top,null,i.bottom-i.top)]}return Yo(t,n,r)}};function qo(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==R.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function Jo(e,t,n,r){let i=e.coordsAtPos(t,n*2);if(!i)return r;let a=e.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,s=e.posAtCoords({x:a.left+1,y:o}),c=e.posAtCoords({x:a.right-1,y:o});return s==null||c==null?r:{from:Math.max(r.from,Math.min(s,c)),to:Math.min(r.to,Math.max(s,c))}}function Yo(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),a=e.textDirection==R.LTR,o=e.contentDOM,s=o.getBoundingClientRect(),c=qo(e),l=o.querySelector(`.cm-line`),u=l&&window.getComputedStyle(l),d=s.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),f=s.right-(u?parseInt(u.paddingRight):0),p=wi(e,r,1),m=wi(e,i,-1),h=p.type==I.Text?p:null,g=m.type==I.Text?m:null;if(h&&(e.lineWrapping||p.widgetLineBreaks)&&(h=Jo(e,r,1,h)),g&&(e.lineWrapping||m.widgetLineBreaks)&&(g=Jo(e,i,-1,g)),h&&g&&h.from==g.from&&h.to==g.to)return v(y(n.from,n.to,h));{let t=h?y(n.from,null,h):ee(p,!1),r=g?y(null,n.to,g):ee(m,!0),i=[];return(h||p).to<(g||m).from-(h&&g?1:0)||p.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<r.top?i.push(_(d,t.bottom,f,r.top)):t.bottom<r.top&&e.elementAtHeight((t.bottom+r.top)/2).type==I.Text&&(t.bottom=r.top=(t.bottom+r.top)/2),v(t).concat(i).concat(v(r))}function _(e,n,r,i){return new Ko(t,e-c.left,n-c.top,Math.max(0,r-e),i-n)}function v({top:e,bottom:t,horizontal:n}){let r=[];for(let i=0;i<n.length;i+=2)r.push(_(n[i],e,n[i+1],t));return r}function y(t,n,r){let i=1e9,o=-1e9,s=[];function c(t,n,c,l,u){let p=e.coordsAtPos(t,t==r.to?-2:2),m=e.coordsAtPos(c,c==r.from?2:-2);!p||!m||(i=Math.min(p.top,m.top,i),o=Math.max(p.bottom,m.bottom,o),u==R.LTR?s.push(a&&n?d:p.left,a&&l?f:m.right):s.push(!a&&l?d:m.left,!a&&n?f:p.right))}let l=t??r.from,u=n??r.to;for(let r of e.visibleRanges)if(r.to>l&&r.from<u)for(let i=Math.max(r.from,l),a=Math.min(r.to,u);;){let r=e.state.doc.lineAt(i);for(let o of e.bidiSpans(r)){let e=o.from+r.from,s=o.to+r.from;if(e>=a)break;s>i&&c(Math.max(e,i),t==null&&e<=l,Math.min(s,a),n==null&&s>=u,o.dir)}if(i=r.to+1,i>=a)break}return s.length==0&&c(l,t==null,u,n==null,e.textDirection),{top:i,bottom:o,horizontal:s}}function ee(e,t){let n=s.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}function Xo(e,t){return e.constructor==t.constructor&&e.eq(t)}var Zo=class{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement(`div`)),this.dom.classList.add(`cm-layer`),t.above&&this.dom.classList.add(`cm-layer-above`),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute(`aria-hidden`,`true`),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Qo)!=e.state.facet(Qo)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(Qo);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((e,t)=>!Xo(e,this.drawn[t]))){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e,F.webkit&&(this.dom.style.display=this.dom.firstChild?``:`none`)}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}},Qo=E.define();function $o(e){return[B.define(t=>new Zo(t,e)),Qo.of(e)]}var es=E.define({combine(e){return tt(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function ts(e={}){return[es.of(e),rs,as,ss,pr.of(!0)]}function ns(e){return e.startState.facet(es)!=e.state.facet(es)}var rs=$o({above:!0,markers(e){let{state:t}=e,n=t.facet(es),r=[];for(let i of t.selection.ranges){let a=i==t.selection.main;if(i.empty||n.drawRangeCursor&&!(a&&F.ios&&n.iosSelectionHandles)){let t=a?`cm-cursor cm-cursor-primary`:`cm-cursor cm-cursor-secondary`,n=i.empty?i:T.cursor(i.head,i.assoc);for(let i of Ko.forRange(e,t,n))r.push(i)}}return r},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName=t.style.animationName==`cm-blink`?`cm-blink2`:`cm-blink`);let n=ns(e);return n&&is(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){is(t.state,e)},class:`cm-cursorLayer`});function is(e,t){t.style.animationDuration=e.facet(es).cursorBlinkRate+`ms`}var as=$o({above:!1,markers(e){let t=[],{main:n,ranges:r}=e.state.selection;for(let n of r)if(!n.empty)for(let r of Ko.forRange(e,`cm-selectionBackground`,n))t.push(r);if(F.ios&&!n.empty&&e.state.facet(es).iosSelectionHandles){for(let r of Ko.forRange(e,`cm-selectionHandle cm-selectionHandle-start`,T.cursor(n.from,1)))t.push(r);for(let r of Ko.forRange(e,`cm-selectionHandle cm-selectionHandle-end`,T.cursor(n.to,1)))t.push(r)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||ns(e)},class:`cm-selectionLayer`}),os=F.gecko&&F.gecko_version==153?`#ffffff01`:`transparent`,ss=De.highest(U.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:`${os} !important`},caretColor:`transparent !important`},".cm-content":{caretColor:`transparent !important`,"& :focus":{caretColor:`initial !important`,"&::selection, & ::selection":{backgroundColor:`Highlight !important`}}}})),cs=D.define({map(e,t){return e==null?null:t.mapPos(e)}}),ls=we.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(cs)?t.value:e,e)}}),us=B.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(ls);n==null?this.cursor!=null&&((t=this.cursor)==null||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement(`div`)),this.cursor.className=`cm-dropCursor`),(e.startState.field(ls)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(ls),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+`px`,this.cursor.style.top=e.top/n+`px`,this.cursor.style.height=e.height/n+`px`):this.cursor.style.left=`-100000px`}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(ls)!=e&&this.view.dispatch({effects:cs.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){(e.target==this.view.contentDOM||!this.view.contentDOM.contains(e.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function ds(){return[ls,us]}function fs(e,t,n,r,i){t.lastIndex=0;for(let a=e.iterRange(n,r),o=n,s;!a.next().done;o+=a.value.length)if(!a.lineBreak)for(;s=t.exec(a.value);)i(o+s.index,s)}function ps(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:i,to:a}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),a=Math.min(e.state.doc.lineAt(a).to,a+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=a:r.push({from:i,to:a});return r}var ms=class{constructor(e){let{regexp:t,decoration:n,decorate:r,boundary:i,maxLength:a=1e3}=e;if(!t.global)throw RangeError(`The regular expression given to MatchDecorator should have its 'g' flag set`);if(this.regexp=t,r)this.addMatch=(e,t,n,i)=>r(i,n,n+e[0].length,e,t);else if(typeof n==`function`)this.addMatch=(e,t,r,i)=>{let a=n(e,t,r);a&&i(r,r+e[0].length,a)};else if(n)this.addMatch=(e,t,r,i)=>i(r,r+e[0].length,n);else throw RangeError(`Either 'decorate' or 'decoration' should be provided to MatchDecorator`);this.boundary=i,this.maxLength=a}createDeco(e){let t=new ct,n=t.add.bind(t);for(let{from:t,to:r}of ps(e,this.maxLength))fs(e.state.doc,this.regexp,t,r,(t,r)=>this.addMatch(r,e,t,n));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((t,i,a,o)=>{o>=e.view.viewport.from&&a<=e.view.viewport.to&&(n=Math.min(a,n),r=Math.max(o,r))}),e.viewportMoved||r-n>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let i of e.visibleRanges){let a=Math.max(i.from,n),o=Math.min(i.to,r);if(o>=a){let n=e.state.doc.lineAt(a),r=n.to<o?e.state.doc.lineAt(o):n,s=Math.max(i.from,n.from),c=Math.min(i.to,r.to);if(this.boundary){for(;a>n.from;a--)if(this.boundary.test(n.text[a-1-n.from])){s=a;break}for(;o<r.to;o++)if(this.boundary.test(r.text[o-r.from])){c=o;break}}let l=[],u,d=(e,t,n)=>l.push(n.range(e,t));if(n==r)for(this.regexp.lastIndex=s-n.from;(u=this.regexp.exec(n.text))&&u.index<c-n.from;)this.addMatch(u,e,u.index+n.from,d);else fs(e.state.doc,this.regexp,s,c,(t,n)=>this.addMatch(n,e,t,d));t=t.update({filterFrom:s,filterTo:c,filter:(e,t)=>e<s||t>c,add:l})}}return t}},hs=/x/.unicode==null?`g`:`gu`,gs=RegExp(`[\0-\b11+--\u2028\u2029-]`,hs),_s={0:`null`,7:`bell`,8:`backspace`,10:`newline`,11:`vertical tab`,13:`carriage return`,27:`escape`,8203:`zero width space`,8204:`zero width non-joiner`,8205:`zero width joiner`,8206:`left-to-right mark`,8207:`right-to-left mark`,8232:`line separator`,8237:`left-to-right override`,8238:`right-to-left override`,8294:`left-to-right isolate`,8295:`right-to-left isolate`,8297:`pop directional isolate`,8233:`paragraph separator`,65279:`zero width no-break space`,65532:`object replacement`},vs=null;function ys(){if(vs==null&&typeof document<`u`&&document.body){let e=document.body.style;vs=(e.tabSize??e.MozTabSize)!=null}return vs||!1}var bs=E.define({combine(e){let t=tt(e,{render:null,specialChars:gs,addSpecialChars:null});return(t.replaceTabs=!ys())&&(t.specialChars=RegExp(` |`+t.specialChars.source,hs)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+`|`+t.addSpecialChars.source,hs)),t}});function xs(e={}){return[bs.of(e),Cs()]}var Ss=null;function Cs(){return Ss||=B.fromClass(class{constructor(e){this.view=e,this.decorations=L.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(bs)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new ms({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,a=x(t[0],0);if(a==9){let e=i.lineAt(r),t=n.state.tabSize,a=yt(e.text,t,r-e.from);return L.replace({widget:new Ds((t-a%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=L.replace({widget:new Es(e,a)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(bs);e.startState.facet(bs)==t?this.decorations=this.decorator.updateDeco(e,this.decorations):(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view))}},{decorations:e=>e.decorations})}var ws=`•`;function Ts(e){return e>=32?ws:e==10?``:String.fromCharCode(9216+e)}var Es=class extends $t{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=Ts(this.code),n=e.state.phrase(`Control character`)+` `+(_s[this.code]||`0x`+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let i=document.createElement(`span`);return i.textContent=t,i.title=n,i.setAttribute(`aria-label`,n),i.className=`cm-specialChar`,i}ignoreEvent(){return!1}},Ds=class extends $t{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement(`span`);return e.textContent=` `,e.className=`cm-tab`,e.style.width=this.width+`px`,e}ignoreEvent(){return!1}};function Os(){return As}var ks=L.line({class:`cm-activeLine`}),As=B.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(ks.range(i.from)),t=i.from)}return L.set(n)}},{decorations:e=>e.decorations}),js=2e3;function Ms(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),a=[];if(t.off>js||n.off>js||t.col<0||n.col<0){let o=Math.min(t.off,n.off),s=Math.max(t.off,n.off);for(let t=r;t<=i;t++){let n=e.doc.line(t);n.length<=s&&a.push(T.range(n.from+o,n.to+s))}}else{let o=Math.min(t.col,n.col),s=Math.max(t.col,n.col);for(let t=r;t<=i;t++){let n=e.doc.line(t),r=bt(n.text,o,e.tabSize,!0);if(r<0)a.push(T.cursor(n.to));else{let t=bt(n.text,s,e.tabSize);a.push(T.range(n.from+r,n.from+t))}}}return a}function Ns(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function Ps(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),i=n-r.from,a=i>js?-1:i==r.length?Ns(e,t.clientX):yt(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:a,off:i}}function Fs(e,t){let n=Ps(e,t),r=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),i=e.state.doc.lineAt(t);n={line:i.number,col:n.col,off:Math.min(n.off,i.length)},r=r.map(e.changes)}},get(t,i,a){let o=Ps(e,t);if(!o)return r;let s=Ms(e.state,n,o);return s.length?a?T.create(s.concat(r.ranges)):T.create(s):r}}:null}function Is(e){let t=e?.eventFilter||(e=>e.altKey&&e.button==0);return U.mouseSelectionStyle.of((e,n)=>t(n)?Fs(e,n):null)}var Ls={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},Rs={style:`cursor: crosshair`};function zs(e={}){let[t,n]=Ls[e.key||`Alt`],r=B.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){(e.keyCode==t||!n(e))&&this.set(!1)},mousemove(e){this.set(n(e))}}});return[r,U.contentAttributes.of(e=>e.plugin(r)?.isDown?Rs:null)]}var Bs=`-10000px`,Vs=class{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let a=[],o=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],s=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(s=e)}if(s<0)a[n]=this.createTooltipView(r,n?a[n-1]:null),o&&(o[n]=!!r.above);else{let r=a[n]=this.tooltipViews[s];o&&(o[n]=t[s]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)a.indexOf(e)<0&&(this.removeTooltipView(e),(n=e.destroy)==null||n.call(e));return t&&(o.forEach((e,n)=>t[n]=e),t.length=o.length),this.input=r,this.tooltips=i,this.tooltipViews=a,!0}};function Hs(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}var Us=E.define({combine:e=>({position:F.ios?`absolute`:e.find(e=>e.position)?.position||`fixed`,parent:e.find(e=>e.parent)?.parent||null,tooltipSpace:e.find(e=>e.tooltipSpace)?.tooltipSpace||Hs})}),Ws=new WeakMap,Gs=B.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(Us);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver==`function`?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Vs(e,Ys,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver==`function`?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener(`resize`,this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement(`div`),this.container.style.position=`relative`,this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(Us);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add(`cm-tooltip`),e.arrow&&!n.dom.querySelector(`.cm-tooltip > .cm-tooltip-arrow`)){let e=document.createElement(`div`);e.className=`cm-tooltip-arrow`,n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=Bs,n.dom.style.left=`0px`,this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener(`resize`,this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(e=t.destroy)==null||e.call(t);this.parent&&this.container.remove(),(t=this.resizeObserver)==null||t.disconnect(),(n=this.intersectionObserver)==null||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position==`fixed`&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(F.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||this.position==`absolute`){if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState)}let r=this.view.scrollDOM.getBoundingClientRect(),i=Mr(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(Us).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){if(e.makeAbsolute){this.madeAbsolute=!0,this.position=`absolute`;for(let e of this.manager.tooltipViews)e.dom.style.position=`absolute`}let{visible:t,space:n,scaleX:r,scaleY:i}=e,a=[];for(let o=0;o<this.manager.tooltips.length;o++){let s=this.manager.tooltips[o],c=this.manager.tooltipViews[o],{dom:l}=c,u=e.pos[o],d=e.size[o];if(!u||s.clip!==!1&&(u.bottom<=Math.max(t.top,n.top)||u.top>=Math.min(t.bottom,n.bottom)||u.right<Math.max(t.left,n.left)-.1||u.left>Math.min(t.right,n.right)+.1)){l.style.top=Bs;continue}let f=s.arrow?c.dom.querySelector(`.cm-tooltip-arrow`):null,p=f?7:0,m=d.right-d.left,h=Ws.get(c)??d.bottom-d.top,g=c.offset||Js,_=this.view.textDirection==R.LTR,v=d.width>n.right-n.left?_?n.left:n.right-d.width:_?Math.max(n.left,Math.min(u.left-(f?14:0)+g.x,n.right-m)):Math.min(Math.max(n.left,u.left-m+(f?14:0)-g.x),n.right-m),y=this.above[o];!s.strictSide&&(y?u.top-h-p-g.y<n.top:u.bottom+h+p+g.y>n.bottom)&&y==n.bottom-u.bottom>u.top-n.top&&(y=this.above[o]=!y);let ee=(y?u.top-n.top:n.bottom-u.bottom)-p;if(ee<h&&c.resize!==!1){if(ee<this.view.defaultLineHeight){l.style.top=Bs;continue}Ws.set(c,h),l.style.height=(h=ee)/i+`px`}else l.style.height&&(l.style.height=``);let te=y?u.top-h-p-g.y:u.bottom+p+g.y,ne=v+m;if(c.overlap!==!0)for(let e of a)e.left<ne&&e.right>v&&e.top<te+h&&e.bottom>te&&(te=y?e.top-h-2-p:e.bottom+p+2);if(this.position==`absolute`?(l.style.top=(te-e.parent.top)/i+`px`,Ks(l,(v-e.parent.left)/r)):(l.style.top=te/i+`px`,Ks(l,v/r)),f){let e=u.left+(_?g.x:-g.x)-(v+14-7);f.style.left=e/r+`px`}c.overlap!==!0&&a.push({left:v,top:te,right:ne,bottom:te+h}),l.classList.toggle(`cm-tooltip-above`,y),l.classList.toggle(`cm-tooltip-below`,!y),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=Bs}},{eventObservers:{scroll(){this.maybeMeasure()}}});function Ks(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+`px`)}var qs=U.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:`border-box`},"&light .cm-tooltip":{border:`1px solid #bbb`,backgroundColor:`#f5f5f5`},"&light .cm-tooltip-section:not(:first-child)":{borderTop:`1px solid #bbb`},"&dark .cm-tooltip":{backgroundColor:`#333338`,color:`white`},".cm-tooltip-arrow":{height:`7px`,width:`14px`,position:`absolute`,zIndex:-1,overflow:`hidden`,"&:before, &:after":{content:`''`,position:`absolute`,width:0,height:0,borderLeft:`7px solid transparent`,borderRight:`7px solid transparent`},".cm-tooltip-above &":{bottom:`-7px`,"&:before":{borderTop:`7px solid #bbb`},"&:after":{borderTop:`7px solid #f5f5f5`,bottom:`1px`}},".cm-tooltip-below &":{top:`-7px`,"&:before":{borderBottom:`7px solid #bbb`},"&:after":{borderBottom:`7px solid #f5f5f5`,top:`1px`}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:`#333338`,borderBottomColor:`#333338`},"&:after":{borderTopColor:`transparent`,borderBottomColor:`transparent`}}}),Js={x:0,y:0},Ys=E.define({enables:[Gs,qs]}),Xs=E.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])}),Zs=class e{static create(t){return new e(t)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement(`div`),this.dom.classList.add(`cm-tooltip-hover`),this.manager=new Vs(e,Xs,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add(`cm-tooltip-section`),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)==null||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp(`offset`)}get getCoords(){return this.passProp(`getCoords`)}get overlap(){return this.passProp(`overlap`)}get resize(){return this.passProp(`resize`)}},Qs=Ys.compute([Xs],e=>{let t=e.facet(Xs);return t.length===0?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>e.end??e.pos)),create:Zs.create,above:t[0].above,arrow:t.some(e=>e.arrow)}}),$s=E.define(),ec=class{constructor(e,t,n,r,i,a){this.view=e,this.source=t,this.field=n,this.locked=r,this.setHover=i,this.hoverTime=a,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener(`mouseleave`,this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener(`mousemove`,this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.tile.nearest(t.target);if(!n)return;let r,i=1;if(n.isWidget())r=n.posAtStart;else{if(r=e.posAtCoords(t),r==null)return;let n=e.coordsAtPos(r);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(r)).find(e=>e.from<=r&&e.to>=r),o=a&&a.dir==R.RTL?-1:1;i=t.x<n.left?-o:o}this.activateHover(e,r,i)}activateHover(e,t,n,r){let i=this.source(e,t,n),a=t=>{if(t&&!(Array.isArray(t)&&!t.length)){let n=Array.isArray(t)?t:[t];r&&this.locked.set(n,r),e.dispatch({effects:this.setHover.of(n)})}};if(i&&`then`in i){let n=this.pending={pos:t};i.then(e=>{this.pending==n&&(this.pending=null,a(e))},t=>vr(e.state,t,`hover tooltip`))}else a(i)}get tooltip(){let e=this.view.plugin(Gs),t=e?e.manager.tooltips.findIndex(e=>e.create==Zs.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:t,tooltip:n}=this;if(t.length&&!this.locked.has(t)&&n&&!nc(n.dom,e)||this.pending){let{pos:n}=t[0]||this.pending,r=t[0]?.end??n;(n==r?this.view.posAtCoords(this.lastMove)!=n:!rc(this.view,n,r,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length&&!this.locked.has(t)){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener(`mouseleave`,t);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener(`mouseleave`,t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener(`mouseleave`,this.mouseleave),this.view.dom.removeEventListener(`mousemove`,this.mousemove)}},tc=4;function nc(e,t){let{left:n,right:r,top:i,bottom:a}=e.getBoundingClientRect(),o;if(o=e.querySelector(`.cm-tooltip-arrow`)){let e=o.getBoundingClientRect();i=Math.min(e.top,i),a=Math.max(e.bottom,a)}return t.clientX>=n-tc&&t.clientX<=r+tc&&t.clientY>=i-tc&&t.clientY<=a+tc}function rc(e,t,n,r,i,a){let o=e.scrollDOM.getBoundingClientRect(),s=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>r||o.right<r||o.top>i||Math.min(o.bottom,s)<i)return!1;let c=e.posAtCoords({x:r,y:i},!1);return c>=t&&c<=n}function ic(e,t={}){let n=D.define(),r=new WeakMap,i=we.define({create(){return[]},update(e,a){let o=r.get(e);if(e.length&&(t.hideOnChange&&(a.docChanged||a.selection)||o&&o(a)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(a,e)))),a.docChanged&&e.length){let t=[];for(let n of e){let e=a.changes.mapPos(n.pos,-1,ce.TrackDel);if(e!=null){let r=Object.assign(Object.create(null),n);r.pos=e,r.end!=null&&(r.end=a.changes.mapPos(r.end)),t.push(r)}}e=t}for(let t of a.effects)t.is(n)&&(e=t.value,o=void 0),(t.is(sc)&&!t.value||t.value==i)&&(e=[]);return e.length&&o&&r.set(e,o),e},provide:e=>Xs.from(e)}),a=B.define(a=>new ec(a,e,i,r,n,t.hoverTime||300));return{active:i,extension:[i,a,$s.of(a),Qs]}}function ac(e,t,n,r={}){let i=e.state.facet($s).map(t=>e.plugin(t)).filter(e=>!!e);if(r.tooltip&&r.tooltip.active){let e=i.find(e=>e.field==r.tooltip.active);e&&(i=[e])}for(let a of i)a.activateHover(e,t,n,r.until??(()=>!1))}function oc(e,t){let n=e.plugin(Gs);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}var sc=D.define(),cc=E.define({combine(e){let t,n;for(let r of e)t||=r.topContainer,n||=r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function lc(e,t){let n=e.plugin(uc),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}var uc=B.fromClass(class{constructor(e){this.input=e.state.facet(pc),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(cc);this.top=new dc(e,!0,t.topContainer),this.bottom=new dc(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}update(e){let t=e.state.facet(cc);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new dc(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new dc(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(pc);if(n!=this.input){let t=n.filter(e=>e),r=[],i=[],a=[],o=[];for(let n of t){let t=this.specs.indexOf(n),s;t<0?(s=n(e.view),o.push(s)):(s=this.panels[t],s.update&&s.update(e)),r.push(s),(s.top?i:a).push(s)}this.specs=t,this.panels=r,this.top.sync(i),this.bottom.sync(a);for(let e of o)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>U.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})}),dc=class{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes=``,this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&=(this.dom.remove(),void 0);return}if(!this.dom){this.dom=document.createElement(`div`),this.dom.className=this.top?`cm-panels cm-panels-top`:`cm-panels cm-panels-bottom`;let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=fc(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=fc(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(` `))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(` `))e&&this.container.classList.add(e)}}};function fc(e){let t=e.nextSibling;return e.remove(),t}var pc=E.define({enables:uc});function mc(e,t){let n,r=new Promise(e=>n=e),i=e=>vc(e,t,n);e.state.field(hc,!1)?e.dispatch({effects:gc.of(i)}):e.dispatch({effects:D.appendConfig.of(hc.init(()=>[i]))});let a=_c.of(i);return{close:a,result:r.then(t=>((e.win.queueMicrotask||(t=>e.win.setTimeout(t,10)))(()=>{e.state.field(hc).indexOf(i)>-1&&e.dispatch({effects:a})}),t))}}var hc=we.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(gc)?e=[n.value].concat(e):n.is(_c)&&(e=e.filter(e=>e!=n.value));return e},provide:e=>pc.computeN([e],t=>t.field(e))}),gc=D.define(),_c=D.define();function vc(e,t,n){let r=t.content?t.content(e,()=>o(null)):null;if(!r){if(r=P(`form`),t.input){let e=P(`input`,t.input);/^(text|password|number|email|tel|url)$/.test(e.type)&&e.classList.add(`cm-textfield`),e.name||=`input`,r.appendChild(P(`label`,(t.label||``)+`: `,e))}else r.appendChild(document.createTextNode(t.label||``));r.appendChild(document.createTextNode(` `)),r.appendChild(P(`button`,{class:`cm-button`,type:`submit`},t.submitLabel||`OK`))}let i=r.nodeName==`FORM`?[r]:r.querySelectorAll(`form`);for(let e=0;e<i.length;e++){let t=i[e];t.addEventListener(`keydown`,e=>{e.keyCode==27?(e.preventDefault(),o(null)):e.keyCode==13&&(e.preventDefault(),o(t))}),t.addEventListener(`submit`,e=>{e.preventDefault(),o(t)})}let a=P(`div`,r,P(`button`,{onclick:()=>o(null),"aria-label":e.state.phrase(`close`),class:`cm-dialog-close`,type:`button`},[`×`]));t.class&&(a.className=t.class),a.classList.add(`cm-dialog`);function o(t){a.contains(a.ownerDocument.activeElement)&&e.focus(),n(t)}return{dom:a,top:t.top,mount:()=>{if(t.focus){let e;e=typeof t.focus==`string`?r.querySelector(t.focus):r.querySelector(`input`)||r.querySelector(`button`),e&&`select`in e?e.select():e&&`focus`in e&&e.focus()}}}}var yc=class extends nt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};yc.prototype.elementClass=``,yc.prototype.toDOM=void 0,yc.prototype.mapMode=ce.TrackBefore,yc.prototype.startSide=yc.prototype.endSide=-1,yc.prototype.point=!0;var bc=E.define(),xc=E.define(),Sc={class:``,renderEmptyElements:!1,elementStyle:``,markers:()=>N.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:`before`},Cc=E.define();function wc(e){return[Ec(),Cc.of({...Sc,...e})]}var Tc=E.define({combine:e=>e.some(e=>e)});function Ec(e){let t=[Dc];return e&&e.fixed===!1&&t.push(Tc.of(!0)),t}var Dc=B.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement(`div`),this.dom.className=`cm-gutters cm-gutters-before`,this.dom.setAttribute(`aria-hidden`,`true`),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.gutters=e.state.facet(Cc).map(t=>new jc(e,t)),this.fixed=!e.state.facet(Tc);for(let e of this.gutters)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position=`sticky`),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement(`div`),this.domAfter.className=`cm-gutters cm-gutters-after`,this.domAfter.setAttribute(`aria-hidden`,`true`),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.domAfter.style.position=this.fixed?`sticky`:``,this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(e.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+`px`;this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(Tc)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?`sticky`:``,this.domAfter&&(this.domAfter.style.position=this.fixed?`sticky`:``)),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=N.iter(this.view.state.facet(bc),this.view.viewport.from),r=[],i=this.gutters.map(e=>new Ac(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let a of e.type)if(a.type==I.Text&&t){kc(n,r,a.from);for(let e of i)e.line(this.view,a,r);t=!1}else if(a.widget)for(let e of i)e.widget(this.view,a)}else if(e.type==I.Text){kc(n,r,e.from);for(let t of i)t.line(this.view,e,r)}else if(e.widget)for(let t of i)t.widget(this.view,e);for(let e of i)e.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(Cc),n=e.state.facet(Cc),r=e.docChanged||e.heightChanged||e.viewportChanged||!N.eq(e.startState.facet(bc),e.state.facet(bc),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let i=[];for(let r of n){let n=t.indexOf(r);n<0?i.push(new jc(this.view,r)):(this.gutters[n].update(e),i.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),i.indexOf(e)<0&&e.destroy();for(let e of i)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>U.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,i=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==R.LTR?{left:r,right:i}:{right:r,left:i}})});function Oc(e){return Array.isArray(e)?e:[e]}function kc(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}var Ac=class{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=N.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,i=(t.top-this.height)/e.scaleY,a=t.height/e.scaleY;if(this.i==r.elements.length){let t=new Mc(e,a,i,n);r.elements.push(t),r.dom.appendChild(t.dom)}else r.elements[this.i].update(e,a,i,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];kc(this.cursor,r,t.from),n.length&&(r=r.concat(n));let i=this.gutter.config.lineMarker(e,t,r);i&&r.unshift(i);let a=this.gutter;r.length==0&&!a.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let n of e.state.facet(xc)){let i=n(e,t.widget,t);i&&(r||=[]).push(i)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},jc=class{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement(`div`),this.dom.className=`cm-gutter`+(this.config.class?` `+this.config.class:``);for(let n in t.domEventHandlers)this.dom.addEventListener(n,r=>{let i=r.target,a;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();a=(e.top+e.bottom)/2}else a=r.clientY;let o=e.lineBlockAtHeight(a-e.documentTop);t.domEventHandlers[n](e,o,r)&&r.preventDefault()});this.markers=Oc(t.markers(e)),t.initialSpacer&&(this.spacer=new Mc(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+=`visibility: hidden; pointer-events: none`)}update(e){let t=this.markers;if(this.markers=Oc(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!N.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},Mc=class{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement(`div`),this.dom.className=`cm-gutterElement`,this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+`px`),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+`px`:``),Nc(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n=`cm-gutterElement`,r=this.dom.firstChild;for(let i=0,a=0;;){let o=a,s=i<t.length?t[i++]:null,c=!1;if(s){let e=s.elementClass;e&&(n+=` `+e);for(let e=a;e<this.markers.length;e++)if(this.markers[e].compare(s)){o=e,c=!0;break}}else o=this.markers.length;for(;a<o;){let e=this.markers[a++];if(e.toDOM){e.destroy(r);let t=r.nextSibling;r.remove(),r=t}}if(!s)break;s.toDOM&&(c?r=r.nextSibling:this.dom.insertBefore(s.toDOM(e),r)),c&&a++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}};function Nc(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}var Pc=E.define(),Fc=E.define(),Ic=E.define({combine(e){return tt(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],i=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||i(e,t,n):i}return n}})}}),Lc=class extends yc{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function Rc(e,t){return e.state.facet(Ic).formatNumber(t,e.state)}var zc=Cc.compute([Ic],e=>({class:`cm-lineNumbers`,renderEmptyElements:!1,markers(e){return e.state.facet(Pc)},lineMarker(e,t,n){return n.some(e=>e.toDOM)?null:new Lc(Rc(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let r of e.state.facet(Fc)){let i=r(e,t,n);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(Ic)!=e.state.facet(Ic),initialSpacer(e){return new Lc(Rc(e,Vc(e.state.doc.lines)))},updateSpacer(e,t){let n=Rc(t.view,Vc(t.view.state.doc.lines));return n==e.number?e:new Lc(n)},domEventHandlers:e.facet(Ic).domEventHandlers,side:`before`}));function Bc(e={}){return[Ic.of(e),Ec(),zc]}function Vc(e){let t=9;for(;t<e;)t=t*10+9;return t}var Hc=new class extends yc{constructor(){super(...arguments),this.elementClass=`cm-activeLineGutter`}},Uc=bc.compute([`selection`],e=>{let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.head).from;i>n&&(n=i,t.push(Hc.range(i)))}return N.of(t)});function Wc(){return Uc}var Gc=1024,Kc=0,qc=class{constructor(e,t){this.from=e,this.to=t}},W=class{constructor(e={}){this.id=Kc++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=Xc.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};W.closedBy=new W({deserialize:e=>e.split(` `)}),W.openedBy=new W({deserialize:e=>e.split(` `)}),W.group=new W({deserialize:e=>e.split(` `)}),W.isolate=new W({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),W.contextHash=new W({perNode:!0}),W.lookAhead=new W({perNode:!0}),W.mounted=new W({perNode:!0});var Jc=class{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[W.mounted.id]}},Yc=Object.create(null),Xc=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):Yc,r=!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e==`string`){if(this.name==e)return!0;let t=this.prop(W.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(W.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}};Xc.none=new Xc(``,Object.create(null),0,8);var Zc=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);if(t){r||=Object.assign({},e.props);let n=t[1],i=t[0];i.combine&&i.id in r&&(n=i.combine(r[i.id],n)),r[i.id]=n}}n.push(r?new Xc(e.name,r,e.id,e.flags):e)}return new e(n)}},Qc=new WeakMap,$c=new WeakMap,G;(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`})(G||={});var K=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=Jc.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.toString();n&&(t&&(t+=`,`),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?`(`+t+`)`:``):t}cursor(e=0){return new pl(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new pl(Qc.get(this)||this.topNode);return r.moveTo(e,t),Qc.set(this,r._tree),r}get topNode(){return new al(this,0,0,null)}resolve(e,t=0){let n=rl(Qc.get(this)||this.topNode,e,t,!1);return Qc.set(this,n),n}resolveInner(e,t=0){let n=rl($c.get(this)||this.topNode,e,t,!0);return $c.set(this,n),n}resolveStack(e,t=0){return fl(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&G.IncludeAnonymous)>0;for(let e=this.cursor(a|G.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(t={}){return this.children.length<=8?this:vl(Xc.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(Xc.none,t,n,r)))}static build(e){return hl(e)}};K.empty=new K(Xc.none,[],[],0);var el=class e{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new e(this.buffer,this.index)}},tl=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Xc.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(`,`)}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!(nl(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}};function nl(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function rl(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof al&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:G.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof al&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}var il=class{cursor(e=0){return new pl(this,e)}getChild(e,t=null,n=null){let r=ol(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return ol(this,e,t,n)}resolve(e,t=0){return rl(this,e,t,!1)}resolveInner(e,t=0){return rl(this,e,t,!0)}matchContext(e){return sl(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},al=class e extends il{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:c}=o._tree,l=n>0?s.length:-1;t!=l;t+=n){let l=s[t],u=c[t]+o.from,d;if(!(!(a&G.EnterBracketed&&l instanceof K&&(d=Jc.get(l))&&!d.overlay&&d.bracketed&&r>=u&&r<=u+l.length)&&!nl(i,r,u,u+l.length))){if(l instanceof tl){if(a&G.ExcludeBuffers)continue;let e=l.findChild(0,l.buffer.length,n,r-u,i);if(e>-1)return new ll(new cl(o,l,t,u),null,e)}else if(a&G.IncludeAnonymous||!l.type.isAnonymous||ml(l)){let s;if(!(a&G.IgnoreMounts)&&(s=Jc.get(l))&&!s.overlay)return new e(s.tree,u,t,o);let c=new e(l,u,t,o);return a&G.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?l.children.length-1:0,n,r,i,a)}}}if(a&G.IncludeAnonymous||!o.type.isAnonymous||(t=o.index>=0?o.index+n:n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(t,n,r=0){let i;if(!(r&G.IgnoreOverlays)&&(i=Jc.get(this._tree))&&i.overlay){let a=t-this.from,o=r&G.EnterBracketed&&i.bracketed;for(let{from:t,to:r}of i.overlay)if((n>0||o?t<=a:t<a)&&(n<0||o?r>=a:r>a))return new e(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function ol(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function sl(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}var cl=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},ll=class e extends il{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(t,n,r=0){if(r&G.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new K(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function ul(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof al&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new dl(i,n)}var dl=class{constructor(e,t){this.heads=e,this.node=t}get next(){return ul(this.heads)}};function fl(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof al?r:r.context.parent;e;e=e.parent)if(e.index<0){let a=e.parent;(i||=[r]).push(a.resolve(t,n)),e=a}else{let a=Jc.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new al(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push(rl(o,t,n,!1))}}return i?ul(i):r}var pl=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~G.EnterBracketed,e instanceof al)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof al?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&G.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&G.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&G.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&G.IncludeAnonymous||e instanceof tl||!e.type.isAnonymous||ml(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)scan:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break scan}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new ll(this.buffer,t,this.stack[e]);return this.bufferNode=new ll(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return sl(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return sl(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}};function ml(e){return e.children.some(e=>e instanceof tl||!e.type.isAnonymous||ml(e))}function hl(e){let{buffer:t,nodeSet:n,maxBufferLength:r=Gc,reused:i=[],minRepeatType:a=n.types.length}=e,o=Array.isArray(t)?new el(t,t.length):t,s=n.types,c=0,l=0;function u(e,t,_,v,y,ee){let{id:te,start:ne,end:re,size:b}=o,ie=l,ae=c;if(b<0){if(o.next(),b==-1){let t=i[te];_.push(t),v.push(ne-e);return}if(b==-3){c=te;return}if(b==-4){l=te;return}throw RangeError(`Unrecognized record size: ${b}`)}let x=s[te],oe,S,se=ne-e;if(re-ne<=r&&(S=h(o.pos-t,y))){let t=new Uint16Array(S.size-S.skip),r=o.pos-S.size,i=t.length;for(;o.pos>r;)i=g(S.start,t,i);oe=new tl(t,re-S.start,n),se=S.start-e}else{let e=o.pos-b;o.next();let t=[],n=[],i=te>=a?te:-1,s=0,c=re;for(;o.pos>e;)i>=0&&o.id==i&&o.size>=0?(o.end<=c-r&&(p(t,n,ne,s,o.end,c,i,ie,ae),s=t.length,c=o.end),o.next()):ee>2500?d(ne,e,t,n):u(ne,e,t,n,i,ee+1);if(i>=0&&s>0&&s<t.length&&p(t,n,ne,s,ne,c,i,ie,ae),t.reverse(),n.reverse(),i>-1&&s>0){let e=f(x,ae);oe=vl(x,t,n,0,t.length,0,re-ne,e,e)}else oe=m(x,t,n,re-ne,ie-re,ae)}_.push(oe),v.push(se)}function d(e,t,i,a){let s=[],c=0,l=-1;for(;o.pos>t;){let{id:e,start:t,end:n,size:i}=o;if(i>4)o.next();else if(l>-1&&t<l)break;else l<0&&(l=n-r),s.push(e,t,n),c++,o.next()}if(c){let t=new Uint16Array(c*4),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;i.push(new tl(t,s[2]-r,n)),a.push(r-e)}}function f(e,t){return(n,r,i)=>{let a=0,o=n.length-1,s,c;if(o>=0&&(s=n[o])instanceof K){if(!o&&s.type==e&&s.length==i)return s;(c=s.prop(W.lookAhead))&&(a=r[o]+s.length+c)}return m(e,n,r,i,a,t)}}function p(e,t,r,i,a,o,s,c,l){let u=[],d=[];for(;e.length>i;)u.push(e.pop()),d.push(t.pop()+r-a);e.push(m(n.types[s],u,d,o-a,c-o,l)),t.push(a-r)}function m(e,t,n,r,i,a,o){if(a){let e=[W.contextHash,a];o=o?[e].concat(o):[e]}if(i>25){let e=[W.lookAhead,i];o=o?[e].concat(o):[e]}return new K(e,t,n,r,o)}function h(e,t){let n=o.fork(),i=0,s=0,c=0,l=n.end-r,u={size:0,start:0,skip:0};scan:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=s,u.skip=c,c+=4,i+=4,n.next();continue}let o=n.pos-e;if(e<0||o<r||n.start<l)break;let d=n.id>=a?4:0,f=n.start;for(n.next();n.pos>o;){if(n.size<0){if(n.size==-3||n.size==-4)d+=4;else break scan}else n.id>=a&&(d+=4);n.next()}s=f,i+=e,c+=d}return(t<0||i==e)&&(u.size=i,u.start=s,u.skip=c),u.size>4?u:void 0}function g(e,t,n){let{id:r,start:i,end:s,size:u}=o;if(o.next(),u>=0&&r<a){let a=n;if(u>4){let r=o.pos-(u-4);for(;o.pos>r;)n=g(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=i-e,t[--n]=r}else u==-3?c=r:u==-4&&(l=r);return n}let _=[],v=[];for(;o.pos>0;)u(e.start||0,e.bufferStart||0,_,v,-1,0);let y=e.length??(_.length?v[0]+_[0].length:0);return new K(s[e.topID],_.reverse(),v.reverse(),y)}var gl=new WeakMap;function _l(e,t){if(!e.isAnonymous||t instanceof tl||t.type!=e)return 1;let n=gl.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof K)){n=1;break}n+=_l(e,r)}gl.set(t,n)}return n}function vl(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=_l(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=_l(e,t[s]);for(s++;s<i;s++){let n=_l(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push(vl(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var yl=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},bl=class{startParse(e,t,n){return typeof e==`string`&&(e=new xl(e)),n=n?n.length?n.map(e=>new qc(e.from,e.to)):[new qc(0,0)]:[new qc(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},xl=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};new W({perNode:!0});var Sl=0,Cl=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=Sl++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new Tl(e);return e=>e.modified.indexOf(t)>-1?e:Tl.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}},wl=0,Tl=class e{constructor(e){this.name=e,this.instances=[],this.id=wl++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&El(n,e.modified));if(r)return r;let i=[],a=new Cl(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=Dl(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}};function El(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function Dl(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function Ol(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new Al(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return kl.add(t)}var kl=new W({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new Al(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}}),Al=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};Al.empty=new Al([],2,null);function jl(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}function Ml(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+` `+e:e)}return n}function Nl(e,t,n,r=0,i=e.length){let a=new Pl(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,``,a.highlighters),a.flush(i)}var Pl=class{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=``}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,i){let{type:a,from:o,to:s}=e;if(o>=n||s<=t)return;a.isTop&&(i=this.highlighters.filter(e=>!e.scope||e.scope(a)));let c=r,l=Fl(e)||Al.empty,u=Ml(i,l.tags);if(u&&(c&&(c+=` `),c+=u,l.mode==1&&(r+=(r?` `:``)+u)),this.startSpan(Math.max(t,o),c),l.opaque)return;let d=e.tree&&e.tree.prop(W.mounted);if(d&&d.overlay){let a=e.node.enter(d.overlay[0].from+o,1),l=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),u=e.firstChild();for(let f=0,p=o;;f++){let m=f<d.overlay.length?d.overlay[f]:null,h=m?m.from+o:s,g=Math.max(t,p),_=Math.min(n,h);if(g<_&&u)for(;e.from<_&&(this.highlightRange(e,g,_,r,i),this.startSpan(Math.min(_,e.to),c),!(e.to>=h||!e.nextSibling())););if(!m||h>n)break;p=m.to+o,p>t&&(this.highlightRange(a.cursor(),Math.max(t,m.from+o),Math.min(n,p),``,l),this.startSpan(Math.min(n,p),c))}u&&e.parent()}else if(e.firstChild()){d&&(r=``);do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}};function Fl(e){let t=e.type.prop(kl);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}var q=Cl.define,Il=q(),Ll=q(),Rl=q(Ll),zl=q(Ll),Bl=q(),Vl=q(Bl),Hl=q(Bl),Ul=q(),Wl=q(Ul),Gl=q(),Kl=q(),ql=q(),Jl=q(ql),Yl=q(),J={comment:Il,lineComment:q(Il),blockComment:q(Il),docComment:q(Il),name:Ll,variableName:q(Ll),typeName:Rl,tagName:q(Rl),propertyName:zl,attributeName:q(zl),className:q(Ll),labelName:q(Ll),namespace:q(Ll),macroName:q(Ll),literal:Bl,string:Vl,docString:q(Vl),character:q(Vl),attributeValue:q(Vl),number:Hl,integer:q(Hl),float:q(Hl),bool:q(Bl),regexp:q(Bl),escape:q(Bl),color:q(Bl),url:q(Bl),keyword:Gl,self:q(Gl),null:q(Gl),atom:q(Gl),unit:q(Gl),modifier:q(Gl),operatorKeyword:q(Gl),controlKeyword:q(Gl),definitionKeyword:q(Gl),moduleKeyword:q(Gl),operator:Kl,derefOperator:q(Kl),arithmeticOperator:q(Kl),logicOperator:q(Kl),bitwiseOperator:q(Kl),compareOperator:q(Kl),updateOperator:q(Kl),definitionOperator:q(Kl),typeOperator:q(Kl),controlOperator:q(Kl),punctuation:ql,separator:q(ql),bracket:Jl,angleBracket:q(Jl),squareBracket:q(Jl),paren:q(Jl),brace:q(Jl),content:Ul,heading:Wl,heading1:q(Wl),heading2:q(Wl),heading3:q(Wl),heading4:q(Wl),heading5:q(Wl),heading6:q(Wl),contentSeparator:q(Ul),list:q(Ul),quote:q(Ul),emphasis:q(Ul),strong:q(Ul),link:q(Ul),monospace:q(Ul),strikethrough:q(Ul),inserted:q(),deleted:q(),changed:q(),invalid:q(),meta:Yl,documentMeta:q(Yl),annotation:q(Yl),processingInstruction:q(Yl),definition:Cl.defineModifier(`definition`),constant:Cl.defineModifier(`constant`),function:Cl.defineModifier(`function`),standard:Cl.defineModifier(`standard`),local:Cl.defineModifier(`local`),special:Cl.defineModifier(`special`)};for(let e in J){let t=J[e];t instanceof Cl&&(t.name=e)}jl([{tag:J.link,class:`tok-link`},{tag:J.heading,class:`tok-heading`},{tag:J.emphasis,class:`tok-emphasis`},{tag:J.strong,class:`tok-strong`},{tag:J.keyword,class:`tok-keyword`},{tag:J.atom,class:`tok-atom`},{tag:J.bool,class:`tok-bool`},{tag:J.url,class:`tok-url`},{tag:J.labelName,class:`tok-labelName`},{tag:J.inserted,class:`tok-inserted`},{tag:J.deleted,class:`tok-deleted`},{tag:J.literal,class:`tok-literal`},{tag:J.string,class:`tok-string`},{tag:J.number,class:`tok-number`},{tag:[J.regexp,J.escape,J.special(J.string)],class:`tok-string2`},{tag:J.variableName,class:`tok-variableName`},{tag:J.local(J.variableName),class:`tok-variableName tok-local`},{tag:J.definition(J.variableName),class:`tok-variableName tok-definition`},{tag:J.special(J.variableName),class:`tok-variableName2`},{tag:J.definition(J.propertyName),class:`tok-propertyName tok-definition`},{tag:J.typeName,class:`tok-typeName`},{tag:J.namespace,class:`tok-namespace`},{tag:J.className,class:`tok-className`},{tag:J.macroName,class:`tok-macroName`},{tag:J.propertyName,class:`tok-propertyName`},{tag:J.operator,class:`tok-operator`},{tag:J.comment,class:`tok-comment`},{tag:J.meta,class:`tok-meta`},{tag:J.invalid,class:`tok-invalid`},{tag:J.punctuation,class:`tok-punctuation`}]);var Xl=new W;function Zl(e){return E.define({combine:e?t=>t.concat(e):void 0})}var Ql=new W,$l=class{constructor(e,t,n=[],r=``){this.data=e,this.name=r,M.prototype.hasOwnProperty(`tree`)||Object.defineProperty(M.prototype,"tree",{get(){return Y(this)}}),this.parser=t,this.extension=[uu.of(this),M.languageData.of((e,t,n)=>{let r=eu(e,t,n),i=r.type.prop(Xl);if(!i)return[];let a=e.facet(i),o=r.type.prop(Ql);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,e)){let n=e.facet(t.facet);return t.type==`replace`?n:n.concat(a)}}return a})].concat(n)}isActiveAt(e,t,n=-1){return eu(e,t,n).type.prop(Xl)==this.data}findRegions(e){let t=e.facet(uu);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(Xl)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(W.mounted);if(i){if(i.tree.prop(Xl)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof K&&r(i,e.positions[n]+t)}};return r(Y(e),0),n}get allowsNesting(){return!0}};$l.setState=D.define();function eu(e,t,n){let r=e.facet(uu),i=Y(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,G.ExcludeBuffers|G.EnterBracketed))e.type.isTop&&(i=e);return i}var tu=class e extends $l{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(t){let n=Zl(t.languageData);return new e(n,t.parser.configure({props:[Xl.add(e=>e.isTop?n:void 0)]}),t.name)}configure(t,n){return new e(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function Y(e){let t=e.field($l.state,!1);return t?t.tree:K.empty}var nu=class{constructor(e){this.doc=e,this.cursorPos=0,this.string=``,this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},ru=null,iu=class e{constructor(e,t,n=[],r,i,a,o,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new e(t,n,[],K.empty,0,r,[],null)}startParse(){return this.parser.startParse(new nu(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=K.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{if(typeof e==`number`){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||=this.startParse(),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n){if(this.fragments=this.withoutTempSkipped(yl.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=this.parse.stoppedAt??this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0}if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(yl.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=ru;ru=this;try{return e()}finally{ru=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=au(e,t.from,t.to);return e}changes(t,n){let{fragments:r,tree:i,treeLen:a,viewport:o,skipped:s}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,n,r,i)=>e.push({fromA:t,toA:n,fromB:r,toB:i})),r=yl.applyChanges(r,e),i=K.empty,a=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){s=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&s.push({from:n,to:r})}}}return new e(this.parser,n,r,i,a,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=au(this.fragments,n,r),this.skipped.splice(t--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&=(this.takeTree(),null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends bl{createParse(t,n,r){let i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance(){let t=ru;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new K(Xc.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return ru}};function au(e,t,n){return yl.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var ou=class e{constructor(e){this.context=e,this.tree=e.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new e(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=iu.create(t.facet(uu).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}};$l.state=we.define({create:ou.init,update(e,t){for(let e of t.effects)if(e.is($l.setState))return e.value;return t.startState.facet(uu)==t.state.facet(uu)?e.apply(t):ou.init(t.state)}});var su=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<`u`&&(su=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});var cu=typeof navigator<`u`&&navigator.scheduling?.isInputPending?()=>navigator.scheduling.isInputPending():null,lu=B.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field($l.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field($l.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=su(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field($l.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!cu?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>cu&&cu()||Date.now()>a,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:$l.setState.of(new ou(i.context))})),this.chunkBudget>0&&!(s&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&=(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>vr(this.view.state,e)).then(()=>this.workScheduled--),null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),uu=E.define({combine(e){return e.length?e[0]:null},enables:e=>[$l.state,lu,U.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),du=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},fu=E.define(),pu=E.define({combine:e=>{if(!e.length)return` `;let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error(`Invalid indent unit: `+JSON.stringify(e[0]));return t}});function mu(e){let t=e.facet(pu);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function hu(e,t){let n=``,r=e.tabSize,i=e.facet(pu)[0];if(i==` `){for(;t>=r;)n+=` `,t-=r;i=` `}for(let e=0;e<t;e++)n+=i;return n}function gu(e,t){e instanceof M&&(e=new _u(e));for(let n of e.state.facet(fu)){let r=n(e,t);if(r!==void 0)return r}let n=Y(e.state);return n.length>=t?yu(e,n,t):null}var _u=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=mu(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return r!=null&&r>=n.from&&r<=n.to?i&&r==e?{text:``,from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return``;let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),a=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return a>-1&&(i+=a-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return yt(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},vu=new W;function yu(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t&&!(t.from<r.node.from||t.to>r.node.to||t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return bu(r,e,n)}function bu(e,t,n){for(let r=e;r;r=r.next){let e=Su(r.node);if(e)return e(wu.create(t,n,r))}return 0}function xu(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function Su(e){let t=e.type.prop(vu);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(W.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>Ou(e,!0,1,void 0,n&&!xu(e)?t.from:void 0)}return e.parent==null?Cu:null}function Cu(){return 0}var wu=class e extends _u{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(t,n,r){return new e(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(Tu(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return bu(this.context.next,this.base,this.pos)}};function Tu(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function Eu(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,a=e.state.doc.lineAt(n.from),o=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.from>=o)return null;let e=/^ */.exec(a.text.slice(n.to-a.from))[0].length;return{from:n.from,to:n.to+e}}e=i.to}}function Du({closing:e,align:t=!0,units:n=1}){return r=>Ou(r,t,n,e)}function Ou(e,t,n,r,i){let a=e.textAfter,o=a.match(/^\s*/)[0].length,s=r&&a.slice(o,o+r.length)==r||i==e.pos+o,c=t?Eu(e):null;return c?s?e.column(c.from):e.column(c.to):e.baseIndent+(s?0:e.unit*n)}function ku({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}var Au=200;function ju(){return M.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent(`input.type`)&&!e.isUserEvent(`input.complete`))return e;let t=e.startState.languageDataAt(`indentOnInput`,e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+Au)return e;let a=n.sliceString(i.from,r);if(!t.some(e=>e.test(a)))return e;let{state:o}=e,s=-1,c=[];for(let{head:e}of o.selection.ranges){let t=o.doc.lineAt(e);if(t.from==s)continue;s=t.from;let n=gu(o,t.from);if(n==null)continue;let r=/^\s*/.exec(t.text)[0],i=hu(o,n);r!=i&&c.push({from:t.from,to:t.from+r.length,insert:i})}return c.length?[e,{changes:c,sequential:!0}]:e})}var Mu=E.define(),Nu=new W;function Pu(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}function Fu(e,t,n){let r=Y(e);if(r.length<n)return null;let i=r.resolveStack(n,1),a=null;for(let o=i;o;o=o.next){let i=o.node;if(i.to<=n||i.from>n)continue;if(a&&i.from<t)break;let s=i.type.prop(Nu);if(s&&(i.to<r.length-50||r.length==e.doc.length||!Iu(i))){let r=s(i,e);r&&r.from<=n&&r.from>=t&&r.to>n&&(a=r)}}return a}function Iu(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function Lu(e,t,n){for(let r of e.facet(Mu)){let i=r(e,t,n);if(i)return i}return Fu(e,t,n)}function Ru(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}var zu=D.define({map:Ru}),Bu=D.define({map:Ru});function Vu(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(e=>e.from<=n&&e.to>=n)||t.push(e.lineBlockAt(n));return t}var Hu=we.define({create(){return L.none},update(e,t){t.isUserEvent(`delete`)&&t.changes.iterChangedRanges((t,n)=>e=Uu(e,t,n)),e=e.map(t.changes);let n=[];for(let r of t.effects)r.is(zu)&&!Gu(e,r.value.from,r.value.to)?n.push(r.value):r.is(Bu)&&(e=e.update({filter:(e,t)=>r.value.from!=e||r.value.to!=t,filterFrom:r.value.from,filterTo:r.value.to}));if(n.length){let{preparePlaceholder:r}=t.state.facet(Qu),i=n.map(e=>(r?L.replace({widget:new nd(r(t.state,e))}):td).range(e.from,e.to));e=e.update({add:i})}return t.selection&&(e=Uu(e,t.selection.main.head)),e},provide:e=>U.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(e,t)=>{n.push(e,t)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw RangeError(`Invalid JSON for fold state`);let t=[];for(let n=0;n<e.length;){let r=e[n++],i=e[n++];if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid JSON for fold state`);t.push(td.range(r,i))}return L.set(t,!0)}});function Uu(e,t,n=t){let r=!1;return e.between(t,n,(e,i)=>{e<n&&i>t&&(r=!0)}),r?e.update({filterFrom:t,filterTo:n,filter:(e,r)=>e>=n||r<=t}):e}function Wu(e,t,n){var r;let i=null;return(r=e.field(Hu,!1))==null||r.between(t,n,(e,t)=>{(!i||i.from>e)&&(i={from:e,to:t})}),i}function Gu(e,t,n){let r=!1;return e.between(t,t,(e,i)=>{e==t&&i==n&&(r=!0)}),r}function Ku(e,t){return e.field(Hu,!1)?t:t.concat(D.appendConfig.of($u()))}var qu=e=>{for(let t of Vu(e)){let n=Lu(e.state,t.from,t.to);if(n)return e.dispatch({effects:Ku(e.state,[zu.of(n),Yu(e,n)])}),!0}return!1},Ju=e=>{if(!e.state.field(Hu,!1))return!1;let t=[];for(let n of Vu(e)){let r=Wu(e.state,n.from,n.to);r&&t.push(Bu.of(r),Yu(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function Yu(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return U.announce.of(`${e.state.phrase(n?`Folded lines`:`Unfolded lines`)} ${r} ${e.state.phrase(`to`)} ${i}.`)}var Xu=[{key:`Ctrl-Shift-[`,mac:`Cmd-Alt-[`,run:qu},{key:`Ctrl-Shift-]`,mac:`Cmd-Alt-]`,run:Ju},{key:`Ctrl-Alt-[`,run:e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),a=Lu(t,i.from,i.to);a&&n.push(zu.of(a)),r=(a?e.lineBlockAt(a.to):i).to+1}return n.length&&e.dispatch({effects:Ku(e.state,n)}),!!n.length}},{key:`Ctrl-Alt-]`,run:e=>{let t=e.state.field(Hu,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(Bu.of({from:e,to:t}))}),e.dispatch({effects:n}),!0}}],Zu={placeholderDOM:null,preparePlaceholder:null,placeholderText:`…`},Qu=E.define({combine(e){return tt(e,Zu)}});function $u(e){let t=[Hu,od];return e&&t.push(Qu.of(e)),t}function ed(e,t){let{state:n}=e,r=n.facet(Qu),i=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=Wu(e.state,n.from,n.to);r&&e.dispatch({effects:Bu.of(r)}),t.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let a=document.createElement(`span`);return a.textContent=r.placeholderText,a.setAttribute(`aria-label`,n.phrase(`folded code`)),a.title=n.phrase(`unfold`),a.className=`cm-foldPlaceholder`,a.onclick=i,a}var td=L.replace({widget:new class extends $t{toDOM(e){return ed(e,null)}}}),nd=class extends $t{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return ed(e,this.value)}},rd={openText:`⌄`,closedText:`›`,markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1},id=class extends yc{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement(`span`);return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?`Fold line`:`Unfold line`),t}};function ad(e={}){let t={...rd,...e},n=new id(t,!0),r=new id(t,!1),i=B.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(uu)!=e.state.facet(uu)||e.startState.field(Hu,!1)!=e.state.field(Hu,!1)||Y(e.startState)!=Y(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new ct;for(let i of e.viewportLineBlocks){let a=Wu(e.state,i.from,i.to)?r:Lu(e.state,i.from,i.to)?n:null;a&&t.add(i.from,i.from,a)}return t.finish()}}),{domEventHandlers:a}=t;return[i,wc({class:`cm-foldGutter`,markers(e){return e.plugin(i)?.markers||N.empty},initialSpacer(){return new id(t,!1)},domEventHandlers:{...a,click:(e,t,n)=>{if(a.click&&a.click(e,t,n))return!0;let r=Wu(e.state,t.from,t.to);if(r)return e.dispatch({effects:Bu.of(r)}),!0;let i=Lu(e.state,t.from,t.to);return i?(e.dispatch({effects:zu.of(i)}),!0):!1}}}),$u()]}var od=U.baseTheme({".cm-foldPlaceholder":{backgroundColor:`#eee`,border:`1px solid #ddd`,color:`#888`,borderRadius:`.2em`,margin:`0 1px`,padding:`0 1px`,cursor:`pointer`},".cm-foldGutter span":{padding:`0 1px`,cursor:`pointer`}}),sd=class e{constructor(e,t){this.specs=e;let n;function r(e){let t=Tt.newName();return(n||=Object.create(null))[`.`+t]=e,t}let i=typeof t.all==`string`?t.all:t.all?r(t.all):void 0,a=t.scope;this.scope=a instanceof $l?e=>e.prop(Xl)==a.data:a?e=>e==a:void 0,this.style=jl(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new Tt(n):null,this.themeType=t.themeType}static define(t,n){return new e(t,n||{})}},cd=E.define(),ld=E.define({combine(e){return e.length?[e[0]]:null}});function ud(e){let t=e.facet(cd);return t.length?t:e.facet(ld)}function dd(e,t){let n=[pd],r;return e instanceof sd&&(e.module&&n.push(U.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(ld.of(e)):r?n.push(cd.computeN([U.darkTheme],t=>t.facet(U.darkTheme)==(r==`dark`)?[e]:[])):n.push(cd.of(e)),n}var fd=class{constructor(e){this.markCache=Object.create(null),this.tree=Y(e.state),this.decorations=this.buildDeco(e,ud(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Y(e.state),n=ud(e.state),r=n!=ud(e.startState),{viewport:i}=e.view,a=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&a>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return L.none;let n=new ct;for(let{from:r,to:i}of e.visibleRanges)Nl(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=L.mark({class:r})))},r,i);return n.finish()}},pd=De.high(B.fromClass(fd,{decorations:e=>e.decorations})),md=sd.define([{tag:J.meta,color:`#404740`},{tag:J.link,textDecoration:`underline`},{tag:J.heading,textDecoration:`underline`,fontWeight:`bold`},{tag:J.emphasis,fontStyle:`italic`},{tag:J.strong,fontWeight:`bold`},{tag:J.strikethrough,textDecoration:`line-through`},{tag:J.keyword,color:`#708`},{tag:[J.atom,J.bool,J.url,J.contentSeparator,J.labelName],color:`#219`},{tag:[J.literal,J.inserted],color:`#164`},{tag:[J.string,J.deleted],color:`#a11`},{tag:[J.regexp,J.escape,J.special(J.string)],color:`#e40`},{tag:J.definition(J.variableName),color:`#00f`},{tag:J.local(J.variableName),color:`#30a`},{tag:[J.typeName,J.namespace],color:`#085`},{tag:J.className,color:`#167`},{tag:[J.special(J.variableName),J.macroName],color:`#256`},{tag:J.definition(J.propertyName),color:`#00c`},{tag:J.comment,color:`#940`},{tag:J.invalid,color:`#f00`}]),hd=U.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:`#328c8252`},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bb555544`}}),gd=1e4,_d=`()[]{}`,vd=E.define({combine(e){return tt(e,{afterCursor:!0,brackets:_d,maxScanDistance:gd,renderMatch:xd})}}),yd=L.mark({class:`cm-matchingBracket`}),bd=L.mark({class:`cm-nonmatchingBracket`});function xd(e){let t=[],n=e.matched?yd:bd;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function Sd(e){let t=[],n=e.facet(vd);for(let r of e.selection.ranges){if(!r.empty)continue;let i=Od(e,r.head,-1,n)||r.head>0&&Od(e,r.head-1,1,n)||n.afterCursor&&(Od(e,r.head,1,n)||r.head<e.doc.length&&Od(e,r.head+1,-1,n));i&&(t=t.concat(n.renderMatch(i,e)))}return L.set(t,!0)}var Cd=[B.fromClass(class{constructor(e){this.paused=!1,this.decorations=Sd(e.state)}update(e){(e.docChanged||e.selectionSet||this.paused)&&(e.view.composing?(this.decorations=this.decorations.map(e.changes),this.paused=!0):(this.decorations=Sd(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),hd];function wd(e={}){return[vd.of(e),Cd]}var Td=new W;function Ed(e,t,n){let r=e.prop(t<0?W.openedBy:W.closedBy);if(r)return r;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==+(t<0))return[n[r+t]]}return null}function Dd(e){let t=e.type.prop(Td);return t?t(e.node):e}function Od(e,t,n,r={}){let i=r.maxScanDistance||gd,a=r.brackets||_d,o=Y(e),s=o.resolveInner(t,n);for(let r=s;r;r=r.parent){let i=Ed(r.type,n,a);if(i&&r.from<r.to){let o=Dd(r);if(o&&(n>0?t>=o.from&&t<o.to:t>o.from&&t<=o.to))return kd(e,t,n,r,o,i,a)}}return Ad(e,t,n,o,s.type,i,a)}function kd(e,t,n,r,i,a,o){let s=r.parent,c={from:i.from,to:i.to},l=0,u=s?.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(l==0&&a.indexOf(u.type.name)>-1&&u.from<u.to){let e=Dd(u);return{start:c,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}if(Ed(u.type,n,o))l++;else if(Ed(u.type,-n,o)){if(l==0){let e=Dd(u);return{start:c,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}l--}}while(n<0?u.prevSibling():u.nextSibling());return{start:c,matched:!1}}function Ad(e,t,n,r,i,a,o){if(n<0?!t:t==e.doc.length)return null;let s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),c=o.indexOf(s);if(c<0||c%2==0!=n>0)return null;let l={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let e=0;!u.next().done&&e<=a;){let a=u.value;n<0&&(e+=a.length);let s=t+e*n;for(let e=n>0?0:a.length-1,t=n>0?a.length:-1;e!=t;e+=n){let t=o.indexOf(a[e]);if(!(t<0||r.resolveInner(s+e,1).type!=i)){if(t%2==0==n>0)d++;else if(d==1)return{start:l,end:{from:s+e,to:s+e+1},matched:t>>1==c>>1};else d--}}n>0&&(e+=a.length)}return u.done?{start:l,matched:!1}:null}function jd(e,t,n,r=0,i=0){t??(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));let a=i;for(let i=r;i<t;i++)e.charCodeAt(i)==9?a+=n-a%n:a++;return a}var Md=class{constructor(e,t,n,r){this.string=e,this.tabSize=t,this.indentUnit=n,this.overrideIndent=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let t=this.string.charAt(this.pos),n;if(n=typeof e==`string`?t==e:t&&(e instanceof RegExp?e.test(t):e(t)),n)return++this.pos,t}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=jd(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){return this.overrideIndent??jd(this.string,null,this.tabSize)}match(e,t,n){if(typeof e==`string`){let r=e=>n?e.toLowerCase():e;return r(this.string.substr(this.pos,e.length))==r(e)?(t!==!1&&(this.pos+=e.length),!0):null}{let n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}};function Nd(e){return{name:e.name||``,token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||Pd,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||Hd,mergeTokens:e.mergeTokens!==!1}}function Pd(e){if(typeof e!=`object`)return e;let t={};for(let n in e){let r=e[n];t[n]=r instanceof Array?r.slice():r}return t}var Fd=new WeakMap,Id=class e extends $l{constructor(e){let t=Zl(e.languageData),n=Nd(e),r,i=new class extends bl{createParse(e,t,n){return new Bd(r,e,t,n)}};super(t,i,[],e.name),this.topNode=Qd(t,this),r=this,this.streamParser=n,this.stateAfter=new W({perNode:!0}),this.tokenTable=e.tokenTable?new Jd(n.tokenTable):Yd}static define(t){return new e(t)}getIndent(e){let t,{overrideIndentation:n}=e.options;n&&(t=Fd.get(e.state),t!=null&&t<e.pos-1e4&&(t=void 0));let r=Ld(this,e.node.tree,e.node.from,e.node.from,t??e.pos),i,a;if(r?(a=r.state,i=r.pos+1):(a=this.streamParser.startState(e.unit),i=e.node.from),e.pos-i>1e4)return null;for(;i<e.pos;){let t=e.state.doc.lineAt(i),r=Math.min(e.pos,t.to);if(t.length){let i=n?n(t.from):-1,o=new Md(t.text,e.state.tabSize,e.unit,i<0?void 0:i);for(;o.pos<r-t.from;)Vd(this.streamParser.token,o,a)}else this.streamParser.blankLine(a,e.unit);if(r==e.pos)break;i=t.to+1}let o=e.lineAt(e.pos);return n&&t==null&&Fd.set(e.state,o.from),this.streamParser.indent(a,/^\s*(.*)/.exec(o.text)[1],e)}get allowsNesting(){return!1}};function Ld(e,t,n,r,i){let a=n>=r&&n+t.length<=i&&t.prop(e.stateAfter);if(a)return{state:e.streamParser.copyState(a),pos:n+t.length};for(let a=t.children.length-1;a>=0;a--){let o=t.children[a],s=n+t.positions[a],c=o instanceof K&&s<i&&Ld(e,o,s,r,i);if(c)return c}return null}function Rd(e,t,n,r,i){if(i&&n<=0&&r>=t.length)return t;!i&&n==0&&t.type==e.topNode&&(i=!0);for(let a=t.children.length-1;a>=0;a--){let o=t.positions[a],s=t.children[a],c;if(o<r&&s instanceof K){if(!(c=Rd(e,s,n-o,r-o,i)))break;return i?new K(t.type,t.children.slice(0,a).concat(c),t.positions.slice(0,a+1),o+c.length):c}}return null}function zd(e,t,n,r,i){for(let i of t){let t=i.from+(i.openStart?25:0),a=i.to-(i.openEnd?25:0),o=t<=n&&a>n&&Ld(e,i.tree,0-i.offset,n,a),s;if(o&&o.pos<=r&&(s=Rd(e,i.tree,n+i.offset,o.pos+i.offset,!1)))return{state:o.state,tree:s}}return{state:e.streamParser.startState(i?mu(i):4),tree:K.empty}}var Bd=class{constructor(e,t,n,r){this.lang=e,this.input=t,this.fragments=n,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let i=iu.get(),a=r[0].from,{state:o,tree:s}=zd(e,n,a,this.to,i?.state);this.state=o,this.parsedPos=this.chunkStart=a+s.length;for(let e=0;e<s.children.length;e++)this.chunks.push(s.children[e]),this.chunkPos.push(s.positions[e]);i&&this.parsedPos<i.viewport.from-1e5&&r.some(e=>e.from<=i.viewport.from&&e.to>=i.viewport.from)&&(this.state=this.lang.streamParser.startState(mu(i.state)),i.skipUntilInView(this.parsedPos,i.viewport.from),this.parsedPos=i.viewport.from),this.moveRangeIndex()}advance(){let e=iu.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),n=Math.min(t,this.chunkStart+512);for(e&&(n=Math.min(n,e.viewport.to));this.parsedPos<n;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==`12+`&&(t=``);else{let e=t.indexOf(`13+`);e>-1&&(t=t.slice(0,e))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),n=e+t.length;for(let e=this.rangeIndex;;){let r=this.ranges[e].to;if(r>=n||(t=t.slice(0,r-(n-t.length)),e++,e==this.ranges.length))break;let i=this.ranges[e].from,a=this.lineAfter(i);t+=a,n=i+a.length}return{line:t,end:n}}skipGapsTo(e,t,n){for(;;){let r=this.ranges[this.rangeIndex].to,i=e+t;if(n>0?r>i:r>=i)break;let a=this.ranges[++this.rangeIndex].from;t+=a-r}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,n,r){let i=4;if(this.ranges.length>1){r=this.skipGapsTo(t,r,1),t+=r;let e=this.chunk.length;r=this.skipGapsTo(n,r,-1),n+=r,i+=this.chunk.length-e}let a=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&i==4&&a>=0&&this.chunk[a]==e&&this.chunk[a+2]==t?this.chunk[a+2]=n:this.chunk.push(e,t,n,i),r}parseLine(e){let{line:t,end:n}=this.nextLine(),r=0,{streamParser:i}=this.lang,a=new Md(t,e?e.state.tabSize:4,e?mu(e.state):2);if(a.eol())i.blankLine(this.state,a.indentUnit);else for(;!a.eol();){let e=Vd(i.token,a,this.state);if(e&&(r=this.emitToken(this.lang.tokenTable.resolve(e),this.parsedPos+a.start,this.parsedPos+a.pos,r)),a.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=K.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Wd,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new K(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new K(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}};function Vd(e,t,n){t.start=t.pos;for(let r=0;r<10;r++){let r=e(t,n);if(t.pos>t.start)return r}throw Error(`Stream parser failed to advance stream.`)}var Hd=Object.create(null),Ud=[Xc.none],Wd=new Zc(Ud),Gd=[],Kd=Object.create(null),qd=Object.create(null);for(let[e,t]of[[`variable`,`variableName`],[`variable-2`,`variableName.special`],[`string-2`,`string.special`],[`def`,`variableName.definition`],[`tag`,`tagName`],[`attribute`,`attributeName`],[`type`,`typeName`],[`builtin`,`variableName.standard`],[`qualifier`,`modifier`],[`error`,`invalid`],[`header`,`heading`],[`property`,`propertyName`]])qd[e]=Zd(Hd,t);var Jd=class{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),qd)}resolve(e){return e?this.table[e]||(this.table[e]=Zd(this.extra,e)):0}},Yd=new Jd(Hd);function Xd(e,t){Gd.indexOf(e)>-1||(Gd.push(e),console.warn(t))}function Zd(e,t){let n=[];for(let r of t.split(` `)){let t=[];for(let n of r.split(`.`)){let r=e[n]||J[n];r?typeof r==`function`?t.length?t=t.map(r):Xd(n,`Modifier ${n} used at start of tag`):t.length?Xd(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:Xd(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,`_`),i=r+` `+n.map(e=>e.id),a=Kd[i];if(a)return a.id;let o=Kd[i]=Xc.define({id:Ud.length,name:r,props:[Ol({[r]:n})]});return Ud.push(o),o.id}function Qd(e,t){let n=Xc.define({id:Ud.length,name:`Document`,props:[Xl.add(()=>e),vu.add(()=>e=>t.getIndent(e))],top:!0});return Ud.push(n),n}R.RTL,R.LTR;var $d=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=af(e.state,n.from);return r.line?tf(e):r.block?rf(e):!1};function ef(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var tf=ef(uf,0),nf=ef(lf,0),rf=ef((e,t)=>lf(e,t,cf(t)),0);function af(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var of=50;function sf(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-of,r),o=e.sliceDoc(i,i+of),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=100?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+of),d=e.sliceDoc(i-of,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function cf(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function lf(e,t,n=t.selection.ranges){let r=n.map(e=>af(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>sf(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function uf(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=af(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var df=He.define(),ff=He.define(),pf=E.define(),mf=E.define({combine(e){return tt(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),hf=we.define({create(){return Pf.empty},update(e,t){let n=t.state.facet(mf),r=t.annotation(df);if(r){let i=Sf.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?Cf(o,o.length,n.minDepth,i):kf(o,t.startState.selection),new Pf(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(ff);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(O.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=Sf.fromTransaction(t),o=t.annotation(O.time),s=t.annotation(O.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new Pf(e.done.map(Sf.fromJSON),e.undone.map(Sf.fromJSON))}});function gf(e={}){return[hf,mf.of(e),U.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?vf:e.inputType==`historyRedo`?yf:null;return n?(e.preventDefault(),n(t)):!1}})]}function _f(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(hf,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var vf=_f(0,!1),yf=_f(1,!1),bf=_f(0,!0),xf=_f(1,!0),Sf=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&C.fromJSON(t.changes),[],t.mapped&&le.fromJSON(t.mapped),t.startSelection&&T.fromJSON(t.startSelection),t.selectionsAfter.map(T.fromJSON))}static fromTransaction(t,n){let r=Df;for(let e of t.startState.facet(pf)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,Df)}static selection(t){return new e(void 0,Df,void 0,void 0,t)}};function Cf(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function wf(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function Tf(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function Ef(e,t){return e.length?t.length?e.concat(t):e:t}var Df=[],Of=200;function kf(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Of));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),Cf(e,e.length-1,1e9,n.setSelAfter(r)))}return[Sf.selection([t])]}function Af(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function jf(e,t){if(!e.length)return e;let n=e.length,r=Df;for(;n;){let i=Mf(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[Sf.selection(r)]:Df}function Mf(e,t,n){let r=Ef(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):Df,n);if(!e.changes)return Sf.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new Sf(i,D.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var Nf=/^(input\.type|delete)($|\.)/,Pf=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||Nf.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,wf(s.changes,t.changes))||r==`input.type.compose`)?Cf(o,o.length-1,i.minDepth,new Sf(t.changes.compose(s.changes),Ef(D.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,Df)):Cf(o,o.length,i.minDepth,t),new e(o,Df,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:Df;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Tf(a[a.length-1],t)?this:new e(kf(this.done,t),this.undone,n,r)}addMapping(t){return new e(jf(this.done,t),jf(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:df.of({side:e,rest:Af(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?Df:r.slice(0,r.length-1);return i.mapped&&(n=jf(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:df.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}return null}};Pf.empty=new Pf(Df,Df);var Ff=[{key:`Mod-z`,run:vf,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:yf,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:yf,preventDefault:!0},{key:`Mod-u`,run:bf,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:xf,preventDefault:!0}];function If(e,t){return T.create(e.ranges.map(t),e.mainIndex)}function Lf(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function Rf({state:e,dispatch:t},n){let r=If(e.selection,n);return!r.eq(e.selection,!0)&&(t(Lf(e,r)),!0)}function zf(e,t){return T.cursor(t?e.to:e.from)}function Bf(e,t){return Rf(e,n=>n.empty?e.moveByChar(n,t):zf(n,t))}function Vf(e){return e.textDirectionAt(e.state.selection.main.head)==R.LTR}var Hf=e=>Bf(e,!Vf(e)),Uf=e=>Bf(e,Vf(e));function Wf(e,t){return Rf(e,n=>n.empty?e.moveByGroup(n,t):zf(n,t))}var Gf=e=>Wf(e,!Vf(e)),Kf=e=>Wf(e,Vf(e));typeof Intl<`u`&&Intl.Segmenter;function qf(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function Jf(e,t,n){let r=Y(e).resolveInner(t.head),i=n?W.closedBy:W.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;qf(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?Od(e,r.from,1):Od(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,T.cursor(s,n?-1:1)}var Yf=e=>Rf(e,t=>Jf(e.state,t,!Vf(e))),Xf=e=>Rf(e,t=>Jf(e.state,t,Vf(e)));function Zf(e,t){return Rf(e,n=>{if(!n.empty)return zf(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var Qf=e=>Zf(e,!1),$f=e=>Zf(e,!0);function ep(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(U.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function tp(e,t){let n=ep(e),{state:r}=e,i=If(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):zf(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=U.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(Lf(r,i),{effects:a}),!0}var np=e=>tp(e,!1),rp=e=>tp(e,!0);function ip(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=T.cursor(r.from+n))}return i}var ap=e=>Rf(e,t=>ip(e,t,!0)),op=e=>Rf(e,t=>ip(e,t,!1)),sp=e=>Rf(e,t=>ip(e,t,!Vf(e))),cp=e=>Rf(e,t=>ip(e,t,Vf(e))),lp=e=>Rf(e,t=>T.cursor(e.lineBlockAt(t.head).from,1)),up=e=>Rf(e,t=>T.cursor(e.lineBlockAt(t.head).to,-1));function dp(e,t,n){let r=!1,i=If(e.selection,t=>{let i=Od(e,t.head,-1)||Od(e,t.head,1)||t.head>0&&Od(e,t.head-1,1)||t.head<e.doc.length&&Od(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?T.range(t.anchor,a):T.cursor(a)});return r?(t(Lf(e,i)),!0):!1}var fp=({state:e,dispatch:t})=>dp(e,t,!1);function pp(e,t,n){let r=If(e.state.selection,e=>{e.undirectional&&e.head>=e.anchor!=t&&(e=T.range(e.head,e.anchor));let r=n(e);return T.range(e.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return!r.eq(e.state.selection)&&(e.dispatch(Lf(e.state,r)),!0)}function mp(e,t){return pp(e,t,n=>e.moveByChar(n,t))}var hp=e=>mp(e,!Vf(e)),gp=e=>mp(e,Vf(e));function _p(e,t){return pp(e,t,n=>e.moveByGroup(n,t))}var vp=e=>_p(e,!Vf(e)),yp=e=>_p(e,Vf(e)),bp=e=>{let t=!Vf(e);return pp(e,t,n=>Jf(e.state,n,t))},xp=e=>{let t=Vf(e);return pp(e,t,n=>Jf(e.state,n,t))};function Sp(e,t){return pp(e,t,n=>e.moveVertically(n,t))}var Cp=e=>Sp(e,!1),wp=e=>Sp(e,!0);function Tp(e,t){return pp(e,t,n=>e.moveVertically(n,t,ep(e).height))}var Ep=e=>Tp(e,!1),Dp=e=>Tp(e,!0),Op=e=>pp(e,!0,t=>ip(e,t,!0)),kp=e=>pp(e,!1,t=>ip(e,t,!1)),Ap=e=>{let t=!Vf(e);return pp(e,t,n=>ip(e,n,t))},jp=e=>{let t=Vf(e);return pp(e,t,n=>ip(e,n,t))},Mp=e=>pp(e,!1,t=>T.cursor(e.lineBlockAt(t.head).from)),Np=e=>pp(e,!0,t=>T.cursor(e.lineBlockAt(t.head).to)),Pp=({state:e,dispatch:t})=>(t(Lf(e,{anchor:0})),!0),Fp=({state:e,dispatch:t})=>(t(Lf(e,{anchor:e.doc.length})),!0),Ip=({state:e,dispatch:t})=>(t(Lf(e,{anchor:e.selection.main.anchor,head:0})),!0),Lp=({state:e,dispatch:t})=>(t(Lf(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Rp=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),zp=({state:e,dispatch:t})=>{let n=im(e).map(({from:t,to:n})=>T.undirectionalRange(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:T.create(n),userEvent:`select`})),!0},Bp=({state:e,dispatch:t})=>{let n=If(e.selection,t=>{let n=Y(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return T.undirectionalRange(n.from,n.to)}return t});return!n.eq(e.selection)&&(t(Lf(e,n)),!0)};function Vp(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}if(r.head==n.head)break;n=r}}return i.length!=r.ranges.length&&(e.dispatch(Lf(n,T.create(i,i.length-1))),!0)}var Hp=e=>Vp(e,!1),Up=e=>Vp(e,!0),Wp=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=T.create([n.main]):n.main.empty||(r=T.create([T.cursor(n.main.head)])),r?(t(Lf(e,r)),!0):!1};function Gp(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=Kp(e,o,!1)):o>i&&(n=`delete.forward`,o=Kp(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=Kp(e,i,!1),a=Kp(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:T.cursor(i,i<r.head?-1:1)}});return!i.changes.empty&&(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?U.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function Kp(e,t,n){if(e instanceof U)for(let r of e.state.facet(U.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var qp=(e,t,n)=>Gp(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=yt(s,a.tabSize)%mu(a)||mu(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=b(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=b(o.text,c-o.from,!1,!1)+o.from);return c}),Jp=e=>qp(e,!1,!0),Yp=e=>qp(e,!0,!1),Xp=(e,t)=>Gp(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=b(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),Zp=e=>Xp(e,!1),Qp=e=>Xp(e,!0),$p=e=>Gp(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),em=e=>Gp(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),tm=e=>Gp(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),nm=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:p.of([``,``])},range:T.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},rm=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:b(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:b(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:T.cursor(a)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function im(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function am(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of im(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(T.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(T.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:T.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var om=({state:e,dispatch:t})=>am(e,t,!1),sm=({state:e,dispatch:t})=>am(e,t,!0);function cm(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of im(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var lm=({state:e,dispatch:t})=>cm(e,t,!1),um=({state:e,dispatch:t})=>cm(e,t,!0),dm=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(im(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=If(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function fm(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Y(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(W.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var pm=hm(!1),mm=hm(!0);function hm(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&fm(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new _u(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=gu(s,r);for(c??=yt(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,hu(t,c)];return o&&l.push(hu(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:p.of(l)},range:T.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function gm(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:T.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var _m=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new _u(e,{overrideIndentation:e=>n[e]??-1}),i=gm(e,(t,i,a)=>{let o=gu(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=hu(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},vm=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(gm(e,(t,n)=>{n.push({from:t.from,insert:e.facet(pu)})}),{userEvent:`input.indent`})),!0),ym=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(gm(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=yt(r,e.tabSize),a=0,o=hu(e,Math.max(0,i-mu(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),bm=e=>(e.setTabFocusMode(),!0),xm=[{key:`Ctrl-b`,run:Hf,shift:hp,preventDefault:!0},{key:`Ctrl-f`,run:Uf,shift:gp},{key:`Ctrl-p`,run:Qf,shift:Cp},{key:`Ctrl-n`,run:$f,shift:wp},{key:`Ctrl-a`,run:lp,shift:Mp},{key:`Ctrl-e`,run:up,shift:Np},{key:`Ctrl-d`,run:Yp},{key:`Ctrl-h`,run:Jp},{key:`Ctrl-k`,run:$p},{key:`Ctrl-Alt-h`,run:Zp},{key:`Ctrl-o`,run:nm},{key:`Ctrl-t`,run:rm},{key:`Ctrl-v`,run:rp}],Sm=[{key:`ArrowLeft`,run:Hf,shift:hp,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:Gf,shift:vp,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:sp,shift:Ap,preventDefault:!0},{key:`ArrowRight`,run:Uf,shift:gp,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:Kf,shift:yp,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:cp,shift:jp,preventDefault:!0},{key:`ArrowUp`,run:Qf,shift:Cp,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:Pp,shift:Ip},{mac:`Ctrl-ArrowUp`,run:np,shift:Ep},{key:`ArrowDown`,run:$f,shift:wp,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:Fp,shift:Lp},{mac:`Ctrl-ArrowDown`,run:rp,shift:Dp},{key:`PageUp`,run:np,shift:Ep},{key:`PageDown`,run:rp,shift:Dp},{key:`Home`,run:op,shift:kp,preventDefault:!0},{key:`Mod-Home`,run:Pp,shift:Ip},{key:`End`,run:ap,shift:Op,preventDefault:!0},{key:`Mod-End`,run:Fp,shift:Lp},{key:`Enter`,run:pm,shift:pm},{key:`Mod-a`,run:Rp},{key:`Backspace`,run:Jp,shift:Jp,preventDefault:!0},{key:`Delete`,run:Yp,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:Zp,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:Qp,preventDefault:!0},{mac:`Mod-Backspace`,run:em,preventDefault:!0},{mac:`Mod-Delete`,run:tm,preventDefault:!0}].concat(xm.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),Cm=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:Yf,shift:bp},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:Xf,shift:xp},{key:`Alt-ArrowUp`,run:om},{key:`Shift-Alt-ArrowUp`,run:lm},{key:`Alt-ArrowDown`,run:sm},{key:`Shift-Alt-ArrowDown`,run:um},{key:`Mod-Alt-ArrowUp`,run:Hp},{key:`Mod-Alt-ArrowDown`,run:Up},{key:`Escape`,run:Wp},{key:`Mod-Enter`,run:mm},{key:`Alt-l`,mac:`Ctrl-l`,run:zp},{key:`Mod-i`,run:Bp,preventDefault:!0},{key:`Mod-[`,run:ym},{key:`Mod-]`,run:vm},{key:`Mod-Alt-\\`,run:_m},{key:`Shift-Mod-k`,run:dm},{key:`Shift-Mod-\\`,run:fp},{key:`Mod-/`,run:$d},{key:`Alt-A`,mac:`Ctrl-A`,run:nf},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:bm}].concat(Sm),wm=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,Tm=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(wm(e)):wm,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return x(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=oe(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=S(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n,a=!0;;e++){let n=r.charCodeAt(e),o=this.match(n,i,a,this.bufferPos+this.bufferStart,e==r.length-1);if(o)return this.value=o,this;if(e==r.length-1)break;a&&e<t.length&&t.charCodeAt(e)==n?i++:a=!1}}}match(e,t,n,r,i){let a=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],o=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?a={from:n.from,to:r,precise:i&&n.precise}:(n.index++,o=!0)),o?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?a={from:t,to:r,precise:n&&i}:this.matches.push({from:t,index:1,precise:n})),a&&this.test&&!this.test(a.from,a.to,this.buffer,this.bufferStart)&&(a=null),a}};typeof Symbol<`u`&&(Tm.prototype[Symbol.iterator]=function(){return this});var Em={from:-1,to:-1,match:/.*/.exec(``),precise:!0},Dm=`gm`+(/x/.unicode==null?``:`u`),Om=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=Em,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new jm(e,t,n,r,i);this.re=new RegExp(t,Dm+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter();let a=e.lineAt(r);this.curLineStart=a.from,this.matchPos=Nm(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=Nm(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},km=new WeakMap,Am=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=km.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return km.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),km.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},jm=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=Em,this.matchPos=Nm(e,r),this.re=new RegExp(t,Dm+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=Am.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,precise:!0,match:t},this.matchPos=Nm(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Am.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(Om.prototype[Symbol.iterator]=jm.prototype[Symbol.iterator]=function(){return this});function Mm(e){try{return new RegExp(e,Dm),!0}catch{return!1}}function Nm(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var Pm=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=mc(e,{label:t.phrase(`Go to line`),input:{type:`text`,name:`line`,value:n},focus:!0,submitLabel:t.phrase(`go`)});return i.then(n=>{let i=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!i){e.dispatch({effects:r});return}let a=t.doc.lineAt(t.selection.main.head),[,o,s,c,l]=i,u=c?+c.slice(1):0,d=s?+s:a.number;if(s&&l){let e=d/100;o&&(e=e*(o==`-`?-1:1)+a.number/t.doc.lines),d=Math.round(t.doc.lines*e)}else s&&o&&(d=d*(o==`-`?-1:1)+a.number);let f=t.doc.line(Math.max(1,Math.min(t.doc.lines,d))),p=T.cursor(f.from+Math.max(0,Math.min(u,f.length)));e.dispatch({effects:[r,U.scrollIntoView(p.from,{y:`center`})],selection:p})}),!0},Fm={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Im=E.define({combine(e){return tt(e,Fm,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function Lm(e){let t=[Um,Hm];return e&&t.push(Im.of(e)),t}var Rm=L.mark({class:`cm-selectionMatch`}),zm=L.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function Bm(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=j.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=j.Word)}function Vm(e,t,n,r){return e(t.sliceDoc(n,n+1))==j.Word&&e(t.sliceDoc(r-1,r))==j.Word}var Hm=B.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Im),{state:n}=e,r=n.selection;if(r.ranges.length>1)return L.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return L.none;let e=n.wordAt(i.head);if(!e)return L.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return L.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(Bm(o,n,i.from,i.to)&&Vm(o,n,i.from,i.to)))return L.none}else if(a=n.sliceDoc(i.from,i.to),!a)return L.none}let s=[];for(let r of e.visibleRanges){let e=new Tm(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||Bm(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(zm.range(r,a)):(r>=i.to||a<=i.from)&&s.push(Rm.range(r,a)),s.length>t.maxMatches))return L.none}}return L.set(s)}},{decorations:e=>e.decorations}),Um=U.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),Wm=({state:e,dispatch:t})=>{let{selection:n}=e,r=T.create(n.ranges.map(t=>e.wordAt(t.head)||T.cursor(t.head)),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)};function Gm(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new Tm(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new Tm(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var Km=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return Wm({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=Gm(e,r);return i?(t(e.update({selection:e.selection.addRange(T.range(i.from,i.to),!1),effects:U.scrollIntoView(i.to)})),!0):!1},qm=E.define({combine(e){return tt(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Dh(e),scrollToMatch:e=>U.scrollIntoView(e)})}}),Jm=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||Mm(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`14+`:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new ah(this):new $m(this)}getCursor(e,t=0,n){let r=e.doc?e:M.create({doc:e});return n??=r.doc.length,this.regexp?th(this,r,t,n):Zm(this,r,t,n)}},Ym=class{constructor(e){this.spec=e}};function Xm(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function Zm(e,t,n,r){let i;return e.wholeWord&&(i=Qm(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=Xm(e.test,t,i)),new Tm(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function Qm(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(nh(i,n-a))!=j.Word||t(rh(i,n-a))!=j.Word)&&(t(rh(i,r-a))!=j.Word||t(nh(i,r-a))!=j.Word))}var $m=class extends Ym{constructor(e){super(e)}nextMatch(e,t,n){let r=Zm(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=Zm(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=Zm(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=Zm(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=Zm(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function eh(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function th(e,t,n,r){let i;return e.wholeWord&&(i=ih(t.charCategorizer(t.selection.main.head))),e.test&&(i=eh(e.test,t,i)),new Om(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function nh(e,t){return e.slice(b(e,t,!1),t)}function rh(e,t){return e.slice(t,b(e,t))}function ih(e){return(t,n,r)=>!r[0].length||(e(nh(r.input,r.index))!=j.Word||e(rh(r.input,r.index))!=j.Word)&&(e(rh(r.input,r.index+r[0].length))!=j.Word||e(nh(r.input,r.index+r[0].length))!=j.Word)}var ah=class extends Ym{nextMatch(e,t,n){let r=th(this.spec,e,n,e.doc.length).next();return r.done&&(r=th(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=th(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=th(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=th(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},oh=D.define(),sh=D.define(),ch=we.define({create(e){return new lh(xh(e).create(),null)},update(e,t){for(let n of t.effects)n.is(oh)?e=new lh(n.value.create(),e.panel):n.is(sh)&&(e=new lh(e.query,n.value?bh:null));return e},provide:e=>pc.from(e,e=>e.panel)}),lh=class{constructor(e,t){this.query=e,this.panel=t}},uh=L.mark({class:`cm-searchMatch`}),dh=L.mark({class:`cm-searchMatch cm-searchMatch-selected`}),fh=B.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(ch))}update(e){let t=e.state.field(ch);(t!=e.startState.field(ch)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return L.none;let{view:n}=this,r=new ct;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?dh:uh)})}return r.finish()}},{decorations:e=>e.decorations});function ph(e){return t=>{let n=t.state.field(ch,!1);return n&&n.query.spec.valid?e(t,n):wh(t)}}var mh=ph((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=T.single(r.from,r.to),a=e.state.facet(qm);return e.dispatch({selection:i,effects:[jh(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),Ch(e),!0}),hh=ph((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=T.single(i.from,i.to),o=e.state.facet(qm);return e.dispatch({selection:a,effects:[jh(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),Ch(e),!0}),gh=ph((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:T.create(n.map(e=>T.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),_h=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new Tm(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(T.range(t.value.from,t.value.to))}return t(e.update({selection:T.create(a,o),userEvent:`select.search.matches`})),!0},vh=ph((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];o.precise?o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=t.nextMatch(n,o.from,o.to),u.push(U.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`))):o=t.nextMatch(n,o.from,o.to);let d=e.state.changes(s);return o&&(c=T.single(o.from,o.to).map(d),u.push(jh(e,o)),u.push(n.facet(qm).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effects:u,userEvent:`input.replace`}),!0}),yh=ph((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:e,to:i,precise:a}=r;a&&n.push({from:e,to:i,insert:t.getReplacement(r)})}if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:U.announce.of(r),userEvent:`input.replace.all`}),!0});function bh(e){return e.state.facet(qm).createPanel(e)}function xh(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(qm);return new Jm({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function Sh(e){let t=lc(e,bh);return t&&t.dom.querySelector(`[main-field]`)}function Ch(e){let t=Sh(e);t&&t==e.root.activeElement&&t.select()}var wh=e=>{let t=e.state.field(ch,!1);if(t&&t.panel){let n=Sh(e);if(n&&n!=e.root.activeElement){let r=xh(e.state,t.query.spec);r.valid&&e.dispatch({effects:oh.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[sh.of(!0),t?oh.of(xh(e.state,t.query.spec)):D.appendConfig.of(Nh)]});return!0},Th=e=>{let t=e.state.field(ch,!1);if(!t||!t.panel)return!1;let n=lc(e,bh);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:sh.of(!1)}),!0},Eh=[{key:`Mod-f`,run:wh,scope:`editor search-panel`},{key:`F3`,run:mh,shift:hh,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:mh,shift:hh,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:Th,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:_h},{key:`Mod-Alt-g`,run:Pm},{key:`Mod-d`,run:Km,preventDefault:!0}],Dh=class{constructor(e){this.view=e;let t=this.query=e.state.field(ch).query.spec;this.commit=this.commit.bind(this),this.searchField=P(`input`,{value:t.search,placeholder:Oh(e,`Find`),"aria-label":Oh(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=P(`input`,{value:t.replace,placeholder:Oh(e,`Replace`),"aria-label":Oh(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=P(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=P(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=P(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return P(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=P(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>mh(e),[Oh(e,`next`)]),n(`prev`,()=>hh(e),[Oh(e,`previous`)]),n(`select`,()=>gh(e),[Oh(e,`all`)]),P(`label`,null,[this.caseField,Oh(e,`match case`)]),P(`label`,null,[this.reField,Oh(e,`regexp`)]),P(`label`,null,[this.wordField,Oh(e,`by word`)]),...e.state.readOnly?[]:[P(`br`),this.replaceField,n(`replace`,()=>vh(e),[Oh(e,`replace`)]),n(`replaceAll`,()=>yh(e),[Oh(e,`replace all`)])],P(`button`,{name:`close`,onclick:()=>Th(e),"aria-label":Oh(e,`close`),type:`button`},[`×`])])}commit(){let e=new Jm({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:oh.of(e)}))}keydown(e){Bo(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?hh:mh)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),vh(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(oh)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(qm).top}};function Oh(e,t){return e.state.phrase(t)}var kh=30,Ah=/[\s\.,:;?!]/;function jh(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-kh),o=Math.min(i,n+kh),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<kh;e++)if(!Ah.test(s[e+1])&&Ah.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-kh;e--)if(!Ah.test(s[e-1])&&Ah.test(s[e])){s=s.slice(0,e);break}}return U.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var Mh=U.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),Nh=[ch,De.low(fh),Mh],Ph=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=Y(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(Vh(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function Fh(e){let t=Object.keys(e).join(``),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,``)),`[${n?`\\w`:``}${t.replace(/[^\w\s]/g,`\\$&`)}]`}function Ih(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=Fh(t)+Fh(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function Lh(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:Ih(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function Rh(e,t){return n=>{for(let t=Y(n.state).resolveInner(n.pos,-1);t;t=t.parent){if(e.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return t(n)}}var zh=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function Bh(e){return e.selection.main.from}function Vh(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var Hh=He.define();function Uh(e,t,n,r){let{main:i}=e.selection,a=n-i.from,o=r-i.from;return{...e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+o)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+o,insert:c},range:T.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:`input.complete`}}var Wh=new WeakMap;function Gh(e){if(!Array.isArray(e))return e;let t=Wh.get(e);return t||Wh.set(e,t=Lh(e)),t}var Kh=D.define(),qh=D.define(),Jh=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=x(e,t),r=S(n);this.chars.push(n);let i=e.slice(t,t+r),a=i.toUpperCase();this.folded.push(x(a==i?i.toLowerCase():a,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:a}=this;if(t.length==1){let r=x(e,0),i=S(r),a=i==e.length?0:-100;if(r!=t[0]){if(r==n[0])a+=-200;else return null}return this.ret(a,[0,i])}let o=e.indexOf(this.pattern);if(o==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let s=t.length,c=0;if(o<0){for(let i=0,a=Math.min(e.length,200);i<a&&c<s;){let a=x(e,i);(a==t[c]||a==n[c])&&(r[c++]=i),i+=S(a)}if(c<s)return null}let l=0,u=0,d=!1,f=0,p=-1,m=-1,h=/[a-z]/.test(e),g=!0;for(let r=0,c=Math.min(e.length,200),_=0;r<c&&u<s;){let c=x(e,r);o<0&&(l<s&&c==t[l]&&(i[l++]=r),f<s&&(c==t[f]||c==n[f]?(f==0&&(p=r),m=r+1,f++):f=0));let v,y=c<255?c>=48&&c<=57||c>=97&&c<=122?2:+(c>=65&&c<=90):(v=oe(c))==v.toLowerCase()?v==v.toUpperCase()?0:2:1;(!r||y==1&&h||_==0&&y!=0)&&(t[u]==c||n[u]==c&&(d=!0)?a[u++]=r:a.length&&(g=!1)),_=y,r+=S(c)}return u==s&&a[0]==0&&g?this.result(-100+(d?-200:0),a,e):f==s&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):f==s?this.ret(-900-e.length,[p,m]):u==s?this.result(-100+(d?-200:0)+-700+(g?0:-1100),a,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?S(x(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}},Yh=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},X=E.define({combine(e){return tt(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>``,optionClass:()=>``,aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Zh,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>Xh(e(n),t(n)),optionClass:(e,t)=>n=>Xh(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function Xh(e,t){return e?t?e+` `+t:e:t}function Zh(e,t,n,r,i,a){let o=e.textDirection==R.RTL,s=o,c=!1,l=`top`,u,d,f=t.left-i.left,p=i.right-t.right,m=r.right-r.left,h=r.bottom-r.top;if(s&&f<Math.min(m,p)?s=!1:!s&&p<Math.min(m,f)&&(s=!0),m<=(s?f:p))u=Math.max(i.top,Math.min(n.top,i.bottom-h))-t.top,d=Math.min(400,s?f:p);else{c=!0,d=Math.min(400,(o?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=h||e>t.top?u=n.bottom-t.top:(l=`bottom`,u=t.bottom-n.top)}let g=(t.bottom-t.top)/a.offsetHeight,_=(t.right-t.left)/a.offsetWidth;return{style:`${l}: ${u/g}px; max-width: ${d/_}px`,class:`cm-completionInfo-`+(c?o?`left-narrow`:`right-narrow`:s?`left`:`right`)}}var Qh=D.define();function $h(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement(`div`);return t.classList.add(`cm-completionIcon`),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>`cm-completionIcon-`+e)),t.setAttribute(`aria-hidden`,`true`),t},position:20}),t.push({render(e,t,n,r){let i=document.createElement(`span`);i.className=`cm-completionLabel`;let a=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(a.slice(o,t)));let s=i.appendChild(document.createElement(`span`));s.appendChild(document.createTextNode(a.slice(t,n))),s.className=`cm-completionMatchedText`,o=n}return o<a.length&&i.appendChild(document.createTextNode(a.slice(o))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement(`span`);return t.className=`cm-completionDetail`,t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}function eg(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.ceil((e-t)/n);return{from:e-r*n,to:e-(r-1)*n}}var tg=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass=``;let r=e.state.field(t),{options:i,selected:a}=r.open,o=e.state.facet(X);this.optionContent=$h(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=eg(i.length,a,o.maxRenderedOptions),this.dom=document.createElement(`div`),this.dom.className=`cm-tooltip-autocomplete`,this.updateTooltipClass(e.state),this.dom.addEventListener(`mousedown`,n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if(t.nodeName==`LI`&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains(`cm-completionListIncompleteTop`)&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains(`cm-completionListIncompleteBottom`)&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;t!=null&&(e.dispatch({effects:Qh.of(t)}),n.preventDefault())}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(X).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:qh.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(`scroll`,()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:r,selected:i,disabled:a}=t.open;(!n.open||n.open.options!=r)&&(this.range=eg(r.length,i,e.state.facet(X).maxRenderedOptions),this.showOptions(r,t.id)),this.updateSel(),a!=n.open?.disabled&&this.dom.classList.toggle(`cm-tooltip-autocomplete-disabled`,!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(` `))e&&this.dom.classList.remove(e);for(let e of t.split(` `))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=eg(t.options.length,t.selected,this.view.state.facet(X).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let a=typeof i==`string`?document.createTextNode(i):i(r);if(!a)return;`then`in a?a.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>vr(this.view.state,e,`completion info`)):(this.addInfoPane(a,r),n.setAttribute(`aria-describedby`,this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement(`div`);if(n.className=`cm-tooltip cm-completionInfo`,n.id=`cm-completionInfo-`+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!=`LI`||!n.id?r--:r==e?n.hasAttribute(`aria-selected`)||(n.setAttribute(`aria-selected`,`true`),t=n):n.hasAttribute(`aria-selected`)&&(n.removeAttribute(`aria-selected`),n.removeAttribute(`aria-describedby`));return t&&rg(this.list,t),t}measureInfo(){let e=this.dom.querySelector(`[aria-selected]`);if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(X).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className=`cm-tooltip cm-completionInfo `+(e.class||``)):this.info.style.cssText=`top: -1e6px`)}createListBox(e,t,n){let r=document.createElement(`ul`);r.id=t,r.setAttribute(`role`,`listbox`),r.setAttribute(`aria-expanded`,`true`),r.setAttribute(`aria-label`,this.view.state.phrase(`Completions`)),r.addEventListener(`mousedown`,e=>{e.target==r&&e.preventDefault()});let i=null;for(let a=n.from;a<n.to;a++){let{completion:o,match:s}=e[a],{section:c}=o;if(c){let e=typeof c==`string`?c:c.name;if(e!=i&&(a>n.from||n.from==0)){if(i=e,typeof c!=`string`&&c.header)r.appendChild(c.header(c));else{let t=r.appendChild(document.createElement(`completion-section`));t.textContent=e}}}let l=r.appendChild(document.createElement(`li`));l.id=t+`-`+a,l.setAttribute(`role`,`option`);let u=this.optionClass(o);u&&(l.className=u);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,s);t&&l.appendChild(t)}}return n.from&&r.classList.add(`cm-completionListIncompleteTop`),n.to<e.length&&r.classList.add(`cm-completionListIncompleteBottom`),r}destroyInfo(){this.info&&=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null)}destroy(){this.destroyInfo()}};function ng(e,t){return n=>new tg(n,e,t)}function rg(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function ig(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+ +!!e.type}function ag(e,t){let n=[],r=null,i=null,a=e=>{n.push(e);let{section:t}=e.completion;if(t){r||=[];let e=typeof t==`string`?t:t.name;r.some(t=>t.name==e)||r.push(typeof t==`string`?{name:e}:t)}},o=t.facet(X);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(r.result.filter===!1)for(let t of r.result.options)a(new zh(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),s,c=o.filterStrict?new Yh(n):new Jh(n);for(let t of r.result.options)if(s=c.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched,o=s.score+(t.boost||0);if(a(new zh(t,r.source,n,o)),typeof t.section==`object`&&t.section.rank===`dynamic`){let{name:e}=t.section;i||=Object.create(null),i[e]=Math.max(o,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,a=(e,t)=>(e.rank===`dynamic`&&t.rank===`dynamic`?i[t.name]-i[e.name]:0)||(typeof e.rank==`number`?e.rank:1e9)-(typeof t.rank==`number`?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(a))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e[typeof n==`string`?n:n.name])}}let s=[],c=null,l=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||l(e.completion,t.completion))){let t=e.completion;!c||c.label!=t.label||c.detail!=t.detail||c.type!=null&&t.type!=null&&c.type!=t.type||c.apply!=t.apply||c.boost!=t.boost?s.push(e):ig(e.completion)>ig(c)&&(s[s.length-1]=e),c=e.completion}return s}var og=class e{constructor(e,t,n,r,i,a){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new e(this.options,dg(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,o){if(i&&!o&&t.some(e=>e.isPending))return i.setDisabled();let s=ag(t,n);if(!s.length)return i&&t.some(e=>e.isPending)?i.setDisabled():null;let c=n.facet(X).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){c=t;break}}return new e(s,dg(r,c),{pos:t.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:bg,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new e(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new e(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},sg=class e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new e(fg,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(X),i=(r.override||n.languageDataAt(`autocomplete`,Bh(n)).map(Gh)).map(e=>(this.active.find(t=>t.source==e)||new mg(e,+!!this.active.some(e=>e.state!=0))).update(t,r));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let a=this.open,o=t.effects.some(e=>e.is(_g));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!cg(i,this.active)||o?a=og.build(i,n,this.id,a,r,o):a&&a.disabled&&!i.some(e=>e.isPending)&&(a=null),!a&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new mg(e.source,0):e));for(let e of t.effects)e.is(Qh)&&(a&&=a.setSelected(e.value,this.id));return i==this.active&&a==this.open?this:new e(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?lg:ug}};function cg(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}var lg={"aria-autocomplete":`list`},ug={};function dg(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}var fg=[];function pg(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(Hh);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent(`input.type`);return n&&t.activateOnTyping?5:n?1:e.isUserEvent(`delete.backward`)?2:e.selection?8:e.docChanged?16:0}var mg=class e{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=pg(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new e(i.source,0)),r&4&&i.state==0&&(i=new e(this.source,1)),i=i.updateFor(t,r);for(let n of t.effects)if(n.is(Kh))i=new e(i.source,1,n.value);else if(n.is(qh))i=new e(i.source,0);else if(n.is(_g))for(let e of n.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Bh(e.state))}},hg=class e extends mg{constructor(e,t,n,r,i,a){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=a}hasResult(){return!0}updateFor(t,n){if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let i=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),o=Bh(t.state);if(o>a||!r||n&2&&(Bh(t.startState)==this.from||o<this.limit))return new mg(this.source,n&4?1:0);let s=t.changes.mapPos(this.limit);return gg(r.validFor,t.state,i,a)?new e(this.source,this.explicit,s,r,i,a):r.update&&(r=r.update(r,i,a,new Ph(t.state,o,!1)))?new e(this.source,this.explicit,s,r,r.from,r.to??Bh(t.state)):new mg(this.source,1,this.explicit)}map(t){if(t.empty)return this;let n=this.result.map?this.result.map(this.result,t):this.result;return n?new e(this.source,this.explicit,t.mapPos(this.limit),n,t.mapPos(this.from),t.mapPos(this.to,1)):new mg(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function gg(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):Vh(e,!0).test(i)}var _g=D.define({map(e,t){return e.map(e=>e.map(t))}}),vg=we.define({create(){return sg.start()},update(e,t){return e.update(t)},provide:e=>[Ys.from(e,e=>e.tooltip),U.contentAttributes.from(e,e=>e.attrs)]});function yg(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(vg).active.find(e=>e.source==t.source);return r instanceof hg&&(typeof n==`string`?e.dispatch({...Uh(e.state,n,r.from,r.to),annotations:Hh.of(t.completion)}):n(e,t.completion,r.from,r.to),!0)}var bg=ng(vg,yg);function xg(e,t=`option`){return n=>{let r=n.state.field(vg,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(X).interactionDelay)return!1;let i=1,a;t==`page`&&(a=oc(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(a.dom.offsetHeight/a.dom.querySelector(`li`).offsetHeight)-1));let{length:o}=r.open.options,s=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:o-1;return s<0?s=t==`page`?0:o-1:s>=o&&(s=t==`page`?o-1:0),n.dispatch({effects:Qh.of(s)}),!0}}var Sg=e=>{let t=e.state.field(vg,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(X).interactionDelay?!1:yg(e,t.open.options[t.open.selected])},Cg=e=>e.state.field(vg,!1)?(e.dispatch({effects:Kh.of(!0)}),!0):!1,wg=e=>{let t=e.state.field(vg,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(e.dispatch({effects:qh.of(null)}),!0)},Tg=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},Eg=50,Dg=1e3,Og=B.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(vg).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(vg),n=e.state.facet(X);if(!e.selectionSet&&!e.docChanged&&e.startState.field(vg)==t)return;let r=e.transactions.some(e=>{let t=pg(e,n);return t&8||(e.selection||e.docChanged)&&!(t&3)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>Eg&&Date.now()-n.time>Dg){for(let e of n.context.abortListeners)try{e()}catch(e){vr(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(Kh)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let t of e.transactions)t.isUserEvent(`input.type`)?this.composing=2:this.composing==2&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(vg);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(X).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new Ph(t,Bh(t),e.explicit,this.view),r=new Tg(e,n);this.running.push(r),Promise.resolve(e.source(n)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:qh.of(null)}),vr(this.view.state,e)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(X).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(X),n=this.view.state.field(vg);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let n=Bh(i.updates.length?i.updates[0].startState:this.view.state),r=Math.min(n,i.done.from+ +!i.active.explicit),a=new hg(i.active.source,i.active.explicit,r,i.done,i.done.from,i.done.to??n);for(let e of i.updates)a=a.update(e,t);if(a.hasResult()){e.push(a);continue}}let a=n.active.find(e=>e.source==i.active.source);if(a&&a.isPending){if(i.done==null){let n=new mg(i.active.source,0);for(let e of i.updates)n=n.update(e,t);n.isPending||e.push(n)}else this.startQuery(a)}}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:_g.of(e)})}},{eventHandlers:{blur(e){let t=this.view.state.field(vg,!1);if(t&&t.tooltip&&this.view.state.facet(X).closeOnBlur){let n=t.open&&oc(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:qh.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Kh.of(!1)}),20),this.composing=0}}}),kg=typeof navigator==`object`&&/Win/.test(navigator.platform),Ag=De.highest(U.domEventHandlers({keydown(e,t){let n=t.state.field(vg,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(kg&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&yg(t,r),!1}})),jg=U.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`,cursor:`pointer`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),Mg={brackets:[`(`,`[`,`{`,`'`,`"`],before:`)]}:;>`,stringPrefixes:[]},Ng=D.define({map(e,t){return t.mapPos(e,-1,ce.TrackAfter)??void 0}}),Pg=new class extends nt{};Pg.startSide=1,Pg.endSide=-1;var Fg=we.define({create(){return N.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(Ng)&&(e=e.update({add:[Pg.range(n.value,n.value+1)]}));return e}});function Ig(){return[Vg,Fg]}var Lg=`()[]{}<>«»»«[]{}`;function Rg(e){for(let t=0;t<16;t+=2)if(Lg.charCodeAt(t)==e)return Lg.charAt(t+1);return oe(e<128?e:e+1)}function zg(e,t){return e.languageDataAt(`closeBrackets`,t)[0]||Mg}var Bg=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),Vg=U.inputHandler.of((e,t,n,r)=>{if((Bg?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&S(x(r,0))==1||t!=i.from||n!=i.to)return!1;let a=Ug(e.state,r);return a?(e.dispatch(a),!0):!1}),Hg=[{key:`Backspace`,run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=zg(e,e.selection.main.head).brackets||Mg.brackets,r=null,i=e.changeByRange(t=>{if(t.empty){let r=Kg(e.doc,t.head);for(let i of n)if(i==r&&Gg(e.doc,t.head)==Rg(x(i,0)))return{changes:{from:t.head-i.length,to:t.head+i.length},range:T.cursor(t.head-i.length)}}return{range:r=t}});return r||t(e.update(i,{scrollIntoView:!0,userEvent:`delete.backward`})),!r}}];function Ug(e,t){let n=zg(e,e.selection.main.head),r=n.brackets||Mg.brackets;for(let i of r){let a=Rg(x(i,0));if(t==i)return a==i?Yg(e,i,r.indexOf(i+i+i)>-1,n):qg(e,i,a,n.before||Mg.before);if(t==a&&Wg(e,e.selection.main.from))return Jg(e,i,a)}return null}function Wg(e,t){let n=!1;return e.field(Fg).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function Gg(e,t){let n=e.sliceString(t,t+2);return n.slice(0,S(x(n,0)))}function Kg(e,t){let n=e.sliceString(t-2,t);return S(x(n,0))==n.length?n:n.slice(1)}function qg(e,t,n,r){let i=null,a=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],effects:Ng.of(a.to+t.length),range:T.range(a.anchor+t.length,a.head+t.length)};let o=Gg(e.doc,a.head);return!o||/\s/.test(o)||r.indexOf(o)>-1?{changes:{insert:t+n,from:a.head},effects:Ng.of(a.head+t.length),range:T.cursor(a.head+t.length)}:{range:i=a}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:`input.type`})}function Jg(e,t,n){let r=null,i=e.changeByRange(t=>t.empty&&Gg(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:T.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(i,{scrollIntoView:!0,userEvent:`input.type`})}function Yg(e,t,n,r){let i=r.stringPrefixes||Mg.stringPrefixes,a=null,o=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:Ng.of(r.to+t.length),range:T.range(r.anchor+t.length,r.head+t.length)};let o=r.head,s=Gg(e.doc,o),c;if(s==t){if(Xg(e,o))return{changes:{insert:t+t,from:o},effects:Ng.of(o+t.length),range:T.cursor(o+t.length)};if(Wg(e,o)){let r=n&&e.sliceDoc(o,o+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:o,to:o+r.length,insert:r},range:T.cursor(o+r.length)}}}else if(n&&e.sliceDoc(o-2*t.length,o)==t+t&&(c=Qg(e,o-2*t.length,i))>-1&&Xg(e,c))return{changes:{insert:t+t+t+t,from:o},effects:Ng.of(o+t.length),range:T.cursor(o+t.length)};else if(e.charCategorizer(o)(s)!=j.Word&&Qg(e,o,i)>-1&&!Zg(e,o,t,i))return{changes:{insert:t+t,from:o},effects:Ng.of(o+t.length),range:T.cursor(o+t.length)};return{range:a=r}});return a?null:e.update(o,{scrollIntoView:!0,userEvent:`input.type`})}function Xg(e,t){let n=Y(e).resolveInner(t+1);return n.parent&&n.from==t}function Zg(e,t,n,r){let i=Y(e).resolveInner(t,-1),a=r.reduce((e,t)=>Math.max(e,t.length),0);for(let o=0;o<5;o++){let o=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+a)),s=o.indexOf(n);if(!s||s>-1&&r.indexOf(o.slice(0,s))>-1){let t=i.firstChild;for(;t&&t.from==i.from&&t.to-t.from>n.length+s;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let c=i.to==t&&i.parent;if(!c)break;i=c}return!1}function Qg(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=j.Word)return t;for(let i of n){let n=t-i.length;if(e.sliceDoc(n,t)==i&&r(e.sliceDoc(n-1,n))!=j.Word)return n}return-1}function $g(e={}){return[Ag,vg,X.of(e),Og,t_,jg]}var e_=[{key:`Ctrl-Space`,run:Cg},{mac:"Alt-`",run:Cg},{mac:`Alt-i`,run:Cg},{key:`Escape`,run:wg},{key:`ArrowDown`,run:xg(!0)},{key:`ArrowUp`,run:xg(!1)},{key:`PageDown`,run:xg(!0,`page`)},{key:`PageUp`,run:xg(!1,`page`)},{key:`Enter`,run:Sg}],t_=De.highest(Lo.computeN([X],e=>e.facet(X).defaultKeymap?[e_]:[])),n_=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},r_=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(__).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new ct,s=[],c=0,l=r.doc.iter(),u=0,d=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>d)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,d);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==d))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=O_(s);if(i)o.add(n,n,L.widget({widget:new x_(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,L.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==d)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let f=o.finish();return new e(f,n,i_(f))}};function i_(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0)){if(!r)r=new n_(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new n_(r.from,n,r.diagnostic)}}),r}function a_(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(__).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(s_))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function o_(e,t){return e.field(u_,!1)?t:t.concat(D.appendConfig.of(A_))}var s_=D.define(),c_=D.define(),l_=D.define(),u_=we.define({create(){return new r_(L.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=i_(n,e.selected.diagnostic,i)||i_(n,null,i)}!n.size&&i&&t.state.facet(__).autoPanel&&(i=null),e=new r_(n,i,r)}for(let n of t.effects)if(n.is(s_)){let r=t.state.facet(__).autoPanel?n.value.length?C_.open:null:e.panel;e=r_.init(n.value,r,t.state)}else n.is(c_)?e=new r_(e.diagnostics,n.value?C_.open:null,e.selected):n.is(l_)&&(e=new r_(e.diagnostics,e.panel,n.value));return e},provide:e=>[pc.from(e,e=>e.panel),U.decorations.from(e,e=>e.diagnostics)]}),d_=L.mark({class:`cm-lintRange cm-lintRange-active`});function f_(e,t,n){let{diagnostics:r}=e.state.field(u_),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(__).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:!0,create(){return{dom:p_(e,i)}}}:null}function p_(e,t){return P(`ul`,{class:`cm-tooltip-lint`},t.map(t=>b_(e,t,!1)))}var m_=e=>{let t=e.state.field(u_,!1);(!t||!t.panel)&&e.dispatch({effects:o_(e.state,[c_.of(!0)])});let n=lc(e,C_.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},h_=e=>{let t=e.state.field(u_,!1);return!t||!t.panel?!1:(e.dispatch({effects:c_.of(!1)}),!0)},g_=[{key:`Mod-Shift-m`,run:m_,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(u_,!1);if(!t)return!1;let n=e.state.selection.main,r=i_(t.diagnostics,null,n.to+1);return!r&&(r=i_(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),ac(e,r.from,1,{tooltip:k_,until:e=>e.docChanged||e.newSelection.main.head<r.from||e.newSelection.main.head>r.to}),!0)}}],__=E.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...tt(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:v_,tooltipFilter:v_,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function v_(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function y_(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function b_(e,t,n){let r=n?y_(t.actions):[];return P(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},P(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=i_(e.state.field(u_).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),P(`u`,s.slice(c,c+1)),s.slice(c+1)];return P(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&P(`div`,{class:`cm-diagnosticSource`},t.source))}var x_=class extends $t{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return P(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},S_=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=b_(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},C_=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)h_(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=y_(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=i_(this.view.state.field(u_).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=P(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=P(`div`,{class:`cm-panel-lint`},this.list,P(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>h_(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(u_).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(u_),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new S_(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new S_(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=i_(this.view.state.field(u_).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:l_.of(t)})}static open(t){return new e(t)}};function w_(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function T_(e){return w_(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var E_=U.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:T_(`#f11`)},".cm-lintRange-warning":{backgroundImage:T_(`orange`)},".cm-lintRange-info":{backgroundImage:T_(`#999`)},".cm-lintRange-hint":{backgroundImage:T_(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function D_(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function O_(e){let t=`hint`,n=1;for(let r of e){let e=D_(r.severity);e>n&&(n=e,t=r.severity)}return t}var k_=ic(f_,{hideOn:a_}),A_=[u_,U.decorations.compute([u_],e=>{let{selected:t,panel:n}=e.field(u_);return!t||!n||t.from==t.to?L.none:L.set([d_.range(t.from,t.to)])}),k_,E_],j_=[Bc(),Wc(),xs(),gf(),ad(),ts(),ds(),M.allowMultipleSelections.of(!0),ju(),dd(md,{fallback:!0}),wd(),Ig(),$g(),Is(),zs(),Os(),Lm(),Lo.of([...Hg,...Cm,...Eh,...Ff,...Xu,...e_,...g_])],M_=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new N_(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){n<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from;n<r.minRepeatTerm&&s==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&this.buffer[e-4]==0&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new P_(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216)){if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new N_(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},N_=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},P_=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},F_=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new e(this.stack,this.pos,this.index)}};function I_(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var L_=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},R_=new L_,z_=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=R_,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.next=this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?-1:this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=``,this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=R_,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},B_=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;U_(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};B_.prototype.contextual=B_.prototype.fallback=B_.prototype.extend=!1;var V_=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?I_(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(U_(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};V_.prototype.contextual=B_.prototype.fallback=B_.prototype.extend=!1;var H_=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function U_(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;scan:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||G_(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535){o=e[n+u*3-1];continue scan}for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue scan}}break}}function W_(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function G_(e,t,n,r){let i=W_(n,r,t);return i<0||W_(n,r,e)<i}var K_=typeof process<`u`&&/\bparse\b/.test({}.LOG),q_=null;function J_(e,t,n){let r=e.cursor(G.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}var Y_=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?J_(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?J_(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],a=this.start[t]+n.positions[r];if(a>e)return this.nextStart=a,null;if(i instanceof K){if(a==e){if(a<this.safeFrom)return null;let e=a+i.length;if(e<=this.safeTo){let t=i.prop(W.lookAhead);if(!t||e+t<this.fragment.to)return i}}this.index[t]++,a+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+i.length}}},X_=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new L_)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let c=i[r],l=this.tokens[r];if(!(n&&!c.fallback)&&((c.contextual||l.start!=e.pos||l.mask!=a||l.context!=o)&&(this.updateCachedToken(l,c,e),l.mask=a,l.context=o),l.lookAhead>l.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new L_,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new L_,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535){if(o[s+1]==1)s=rv(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(rv(o,s+2),t,n,r));break}}o[s]==t&&(r=this.putAction(rv(o,s+1),t,n,r))}return r}},Z_=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new z_(t,r),this.tokens=new X_(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[M_.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new Y_(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&iv(r);if(e)return K_&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw K_&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return K_&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){outer:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500){if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue outer}}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=K_?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let o=this.fragments.nodeAt(r);o;){let r=this.parser.nodeSet.types[o.type.id]==o.type?i.getGoto(e.state,o.type.id):-1;if(r>-1&&o.length&&(!t||(o.prop(W.contextHash)||0)==n))return e.useNode(o,r),K_&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(o.type.id)})`),!0;if(!(o instanceof K)||o.children.length==0||o.positions[0]>0)break;let s=o.children[0];if(s instanceof K&&o.positions[0]==0)o=s;else break}}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),K_&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;o<s.length;){let c=s[o++],l=s[o++],u=s[o++],d=o==s.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(c,l,p?p.start:f.pos,u),K_&&console.log(a+this.stackID(f)+` (via ${c&65536?`reduce of ${i.getName(c&65535)}`:`shift`} for ${i.getName(l)} @ ${r}${f==e?``:`, split`})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return Q_(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=K_?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),K_&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(K_&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)K_&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))K_&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),K_&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),Q_(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),K.build({buffer:F_.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(q_||=new WeakMap).get(e);return t||q_.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function Q_(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}var $_=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},ev=e=>e,tv=class{constructor(e){this.start=e.start,this.shift=e.shift||ev,this.reduce=e.reduce||ev,this.reuse=e.reuse||ev,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},nv=class e extends bl{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(` `);this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push(``);let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];typeof e==`string`&&(e=W[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let a=t[n+-r];for(let o=-r;o>0;o--)i(t[n++],e,a);n++}}}this.nodeSet=new Zc(t.map((t,i)=>Xc.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:i==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Gc;let a=I_(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(av),this.states=I_(e.states,Uint32Array),this.data=I_(e.stateData),this.goto=I_(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>typeof e==`number`?new B_(a,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new Z_(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535){if(n[i+1]==1)a=n[i=rv(n,i+2)];else if(n[i+1]==2)return rv(n,i+2);else break}if(a==t||a==0)return rv(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=rv(this.data,n+2);else break}r=t(rv(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=rv(this.data,n+2);else break}if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(t){let n=Object.assign(Object.create(e.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let e=this.topRules[t.top];if(!e)throw RangeError(`Invalid top rule name ${t.top}`);n.top=e}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(e=>{let n=t.tokenizers.find(t=>t.from==e);return n?n.to:e})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((e,r)=>{let i=t.specializers.find(t=>t.from==e.external);if(!i)return e;let a=Object.assign(Object.assign({},e),{external:i.to});return n.specializers[r]=av(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new $_(e,n,r)}static deserialize(t){return new e(t)}};function rv(e,t){return e[t]|e[t+1]<<16}function iv(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function av(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}var ov=Ol({String:J.string,Number:J.number,"True False":J.bool,PropertyName:J.propertyName,Null:J.null,", :":J.separator,"[ ]":J.squareBracket,"{ }":J.brace}),sv=nv.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:`#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O`,goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:`⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array`,maxTerm:25,nodeProps:[[`isolate`,-2,6,11,``],[`openedBy`,7,`{`,14,`[`],[`closedBy`,8,`}`,15,`]`]],propSources:[ov],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),cv=tu.define({name:`json`,parser:sv.configure({props:[vu.add({Object:ku({except:/^\s*\}/}),Array:ku({except:/^\s*\]/})}),Nu.add({"Object Array":Pu})]}),languageData:{closeBrackets:{brackets:[`[`,`{`,`"`]},indentOnInput:/^\s*[\}\]]$/}});function lv(){return new du(cv)}var uv=36,dv=1,fv=2,pv=3,mv=4,hv=5,gv=6,_v=7,vv=8,yv=9,bv=10,xv=11,Sv=12,Cv=13,wv=14,Tv=15,Ev=16,Dv=17,Ov=18,kv=19,Av=20,jv=21,Mv=22,Nv=23,Pv=24;function Fv(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function Iv(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function Lv(e,t,n){for(let r=!1;;){if(e.next<0)return;if(e.next==t&&!r){e.advance();return}r=n&&!r&&e.next==92,e.advance()}}function Rv(e,t){scan:for(;;){if(e.next<0)return;if(e.next==36){e.advance();for(let n=0;n<t.length;n++){if(e.next!=t.charCodeAt(n))continue scan;e.advance()}if(e.next==36){e.advance();return}}else e.advance()}}function zv(e,t){let n=`[{<(`.indexOf(String.fromCharCode(t)),r=n<0?t:`]}>)`.charCodeAt(n);for(;;){if(e.next<0)return;if(e.next==r&&e.peek(1)==39){e.advance(2);return}e.advance()}}function Bv(e,t){for(;!(e.next!=95&&!Fv(e.next));)t!=null&&(t+=String.fromCharCode(e.next)),e.advance();return t}function Vv(e){if(e.next==39||e.next==34||e.next==96){let t=e.next;e.advance(),Lv(e,t,!1)}else Bv(e)}function Hv(e,t){for(;e.next==48||e.next==49;)e.advance();t&&e.next==t&&e.advance()}function Uv(e,t){for(;;){if(e.next==46){if(t)break;t=!0}else if(e.next<48||e.next>57)break;e.advance()}if(e.next==69||e.next==101)for(e.advance(),(e.next==43||e.next==45)&&e.advance();e.next>=48&&e.next<=57;)e.advance()}function Wv(e){for(;!(e.next<0||e.next==10);)e.advance()}function Gv(e,t){for(let n=0;n<t.length;n++)if(t.charCodeAt(n)==e)return!0;return!1}var Kv=` \r15+`;function qv(e,t,n){let r=Object.create(null);r.true=r.false=hv,r.null=r.unknown=gv;for(let t of e.split(` `))t&&(r[t]=Av);for(let e of t.split(` `))e&&(r[e]=jv);for(let e of(n||``).split(` `))e&&(r[e]=Pv);return r}var Jv=`array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying `,Yv=`absolute action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded case cast catalog check close collate collation column commit condition connect connection constraint constraints constructor continue corresponding count create cross cube current current_date current_default_transform_group current_transform_group_for_type current_path current_role current_time current_timestamp current_user cursor cycle data day deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exists exit external fetch first for foreign found from free full function general get global go goto grant group grouping handle having hold hour identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local localtime localtimestamp locator loop map match method minute modifies module month names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search second section select session session_user set sets signal similar size some space specific specifictype sql sqlexception sqlstate sqlwarning start state static system_user table temporary then timezone_hour timezone_minute to trailing transaction translation treat trigger under undo union unique unnest until update usage user using value values view when whenever where while with without work write year zone `,Xv={backslashEscapes:!1,hashComments:!1,spaceAfterDashes:!1,slashComments:!1,doubleQuotedStrings:!1,doubleDollarQuotedStrings:!1,unquotedBitLiterals:!1,treatBitsAsBytes:!1,charSetCasts:!1,plsqlQuotingMechanism:!1,operatorChars:`*+-%<>!=&|~^/`,specialVar:`?`,identifierQuotes:`"`,caseInsensitiveIdentifiers:!1,words:qv(Yv,Jv)};function Zv(e,t,n,r){let i={};for(let t in Xv)i[t]=(e.hasOwnProperty(t)?e:Xv)[t];return t&&(i.words=qv(t,n||``,r)),i}function Qv(e){return new H_(t=>{let{next:n}=t;if(t.advance(),Gv(n,Kv)){for(;Gv(t.next,Kv);)t.advance();t.acceptToken(uv)}else if(n==36&&e.doubleDollarQuotedStrings){let e=Bv(t,``);t.next==36&&(t.advance(),Rv(t,e),t.acceptToken(pv))}else if(n==39||n==34&&e.doubleQuotedStrings)Lv(t,n,e.backslashEscapes),t.acceptToken(pv);else if(n==35&&e.hashComments||n==47&&t.next==47&&e.slashComments)Wv(t),t.acceptToken(dv);else if(n==45&&t.next==45&&(!e.spaceAfterDashes||t.peek(1)==32))Wv(t),t.acceptToken(dv);else if(n==47&&t.next==42){t.advance();for(let e=1;;){let n=t.next;if(t.next<0)break;if(t.advance(),n==42&&t.next==47){if(e--,t.advance(),!e)break}else n==47&&t.next==42&&(e++,t.advance())}t.acceptToken(fv)}else if((n==101||n==69)&&t.next==39)t.advance(),Lv(t,39,!0),t.acceptToken(pv);else if((n==110||n==78)&&t.next==39&&e.charSetCasts)t.advance(),Lv(t,39,e.backslashEscapes),t.acceptToken(pv);else if(n==95&&e.charSetCasts)for(let n=0;;n++){if(t.next==39&&n>1){t.advance(),Lv(t,39,e.backslashEscapes),t.acceptToken(pv);break}if(!Fv(t.next))break;t.advance()}else if(e.plsqlQuotingMechanism&&(n==113||n==81)&&t.next==39&&t.peek(1)>0&&!Gv(t.peek(1),Kv)){let e=t.peek(1);t.advance(2),zv(t,e),t.acceptToken(pv)}else if(Gv(n,e.identifierQuotes))Lv(t,n==91?93:n,!1),t.acceptToken(kv);else if(n==40)t.acceptToken(_v);else if(n==41)t.acceptToken(vv);else if(n==123)t.acceptToken(yv);else if(n==125)t.acceptToken(bv);else if(n==91)t.acceptToken(xv);else if(n==93)t.acceptToken(Sv);else if(n==59)t.acceptToken(Cv);else if(e.unquotedBitLiterals&&n==48&&t.next==98)t.advance(),Hv(t),t.acceptToken(Mv);else if((n==98||n==66)&&(t.next==39||t.next==34)){let n=t.next;t.advance(),e.treatBitsAsBytes?(Lv(t,n,e.backslashEscapes),t.acceptToken(Nv)):(Hv(t,n),t.acceptToken(Mv))}else if(n==48&&(t.next==120||t.next==88)||(n==120||n==88)&&t.next==39){let e=t.next==39;for(t.advance();Iv(t.next);)t.advance();e&&t.next==39&&t.advance(),t.acceptToken(mv)}else if(n==46&&t.next>=48&&t.next<=57)Uv(t,!0),t.acceptToken(mv);else if(n==46)t.acceptToken(wv);else if(n>=48&&n<=57)Uv(t,!1),t.acceptToken(mv);else if(Gv(n,e.operatorChars)){for(;Gv(t.next,e.operatorChars);)t.advance();t.acceptToken(Tv)}else if(Gv(n,e.specialVar))t.next==n&&t.advance(),Vv(t),t.acceptToken(Dv);else if(n==58||n==44)t.acceptToken(Ev);else if(Fv(n)){let r=Bv(t,String.fromCharCode(n));t.acceptToken(t.next==46||t.peek(-r.length-1)==46?Ov:e.words[r.toLowerCase()]??Ov)}})}var $v=Qv(Xv),ey=nv.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:`⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement`,maxTerm:38,nodeProps:[[`isolate`,-4,1,2,3,19,``]],skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:`RORO`,tokenizers:[0,$v],topRules:{Script:[0,25]},tokenPrec:0});function ty(e){let t=e.cursor().moveTo(e.from,-1);for(;/Comment/.test(t.name);)t.moveTo(t.from,-1);return t.node}function ny(e,t){let n=e.sliceString(t.from,t.to),r=/^([`'"\[])(.*)([`'"\]])$/.exec(n);return r?r[2]:n}function ry(e){return e&&(e.name==`Identifier`||e.name==`QuotedIdentifier`)}function iy(e,t){if(t.name==`CompositeIdentifier`){let n=[];for(let r=t.firstChild;r;r=r.nextSibling)ry(r)&&n.push(ny(e,r));return n}return[ny(e,t)]}function ay(e,t){for(let n=[];;){if(!t||t.name!=`.`)return n;let r=ty(t);if(!ry(r))return n;n.unshift(ny(e,r)),t=ty(r)}}function oy(e,t){let n=Y(e).resolveInner(t,-1),r=cy(e.doc,n);return n.name==`Identifier`||n.name==`QuotedIdentifier`||n.name==`Keyword`?{from:n.from,quoted:n.name==`QuotedIdentifier`?e.doc.sliceString(n.from,n.from+1):null,parents:ay(e.doc,ty(n)),aliases:r}:n.name==`.`?{from:t,quoted:null,parents:ay(e.doc,n),aliases:r}:{from:t,quoted:null,parents:[],empty:!0,aliases:r}}var sy=new Set(`where group having order union intersect except all distinct limit offset fetch for`.split(` `));function cy(e,t){let n;for(let e=t;!n;e=e.parent){if(!e)return null;e.name==`Statement`&&(n=e)}let r=null;for(let t=n.firstChild,i=!1,a=null;t;t=t.nextSibling){let n=t.name==`Keyword`?e.sliceString(t.from,t.to).toLowerCase():null,o=null;if(!i)i=n==`from`;else if(n==`as`&&a&&ry(t.nextSibling))o=ny(e,t.nextSibling);else if(n&&sy.has(n))break;else a&&ry(t)&&(o=ny(e,t));o&&(r||=Object.create(null),r[o]=iy(e,a)),a=/Identifier$/.test(t.name)?t:null}return r}function ly(e,t,n){return n.map(n=>({...n,label:n.label[0]==e?n.label:e+n.label+t,apply:void 0}))}var uy=/^\w*$/,dy=/^[`'"\[]?\w*[`'"\]]?$/;function fy(e){return e.self&&typeof e.self.label==`string`}var py=class e{constructor(e,t){this.idQuote=e,this.idCaseInsensitive=t,this.list=[],this.children=void 0}child(t){let n=this.children||=Object.create(null);return n[t]||(t&&!this.list.some(e=>e.label==t)&&this.list.push(my(t,`type`,this.idQuote,this.idCaseInsensitive)),n[t]=new e(this.idQuote,this.idCaseInsensitive))}maybeChild(e){return this.children?this.children[e]:null}addCompletion(e){let t=this.list.findIndex(t=>t.label==e.label);t>-1?this.list[t]=e:this.list.push(e)}addCompletions(e){for(let t of e)this.addCompletion(typeof t==`string`?my(t,`property`,this.idQuote,this.idCaseInsensitive):t)}addNamespace(e){Array.isArray(e)?this.addCompletions(e):fy(e)?this.addNamespace(e.children):this.addNamespaceObject(e)}addNamespaceObject(e){for(let t of Object.keys(e)){let n=e[t],r=null,i=t.replace(/\\?\./g,e=>e==`.`?`\0`:e).split(`\0`),a=this;fy(n)&&(r=n.self,n=n.children);for(let e=0;e<i.length;e++)r&&e==i.length-1&&a.addCompletion(r),a=a.child(i[e].replace(/\\\./g,`.`));a.addNamespace(n)}}};function my(e,t,n,r){return RegExp(`^[a-z_][a-z_\\d]*$`,r?`i`:``).test(e)?{label:e,type:t}:{label:e,type:t,apply:n+e+hy(n)}}function hy(e){return e===`[`?`]`:e}function gy(e,t,n,r,i,a){let o=new py(a?.spec.identifierQuotes?.[0]||`"`,!!a?.spec.caseInsensitiveIdentifiers),s=i?o.child(i):null;return o.addNamespace(e),t&&(s||o).addCompletions(t),n&&o.addCompletions(n),s&&o.addCompletions(s.list),r&&o.addCompletions((s||o).child(r).list),e=>{let{parents:t,from:n,quoted:i,empty:a,aliases:c}=oy(e.state,e.pos);if(a&&!e.explicit)return null;c&&t.length==1&&(t=c[t[0]]||t);let l=o;for(let e of t){for(;!l.children||!l.children[e];)if(l==o&&s)l=s;else if(l==s&&r)l=l.child(r);else return null;let t=l.maybeChild(e);if(!t)return null;l=t}let u=l.list;if(l==o&&c&&(u=u.concat(Object.keys(c).map(e=>({label:e,type:`constant`})))),i){let t=i[0],r=hy(t);return{from:n,to:e.state.sliceDoc(e.pos,e.pos+1)==r?e.pos+1:void 0,options:ly(t,r,u),validFor:dy}}return{from:n,options:u,validFor:uy}}}function _y(e){return e==jv?`type`:e==Av?`keyword`:`variable`}function vy(e,t,n){return Rh([`QuotedIdentifier`,`String`,`LineComment`,`BlockComment`,`.`],Lh(Object.keys(e).map(r=>n(t?r.toUpperCase():r,_y(e[r])))))}var yy=ey.configure({props:[vu.add({Statement:ku()}),Nu.add({Statement(e,t){return{from:Math.min(e.from+100,t.doc.lineAt(e.from).to),to:e.to}},BlockComment(e){return{from:e.from+2,to:e.to-2}}}),Ol({Keyword:J.keyword,Type:J.typeName,Builtin:J.standard(J.name),Bits:J.number,Bytes:J.string,Bool:J.bool,Null:J.null,Number:J.number,String:J.string,Identifier:J.name,QuotedIdentifier:J.special(J.string),SpecialVar:J.special(J.name),LineComment:J.lineComment,BlockComment:J.blockComment,Operator:J.operator,"Semi Punctuation":J.punctuation,"( )":J.paren,"{ }":J.brace,"[ ]":J.squareBracket})]}),by=class e{constructor(e,t,n){this.dialect=e,this.language=t,this.spec=n}get extension(){return this.language.extension}configureLanguage(t,n){return new e(this.dialect,this.language.configure(t,n),this.spec)}static define(t){let n=Zv(t,t.keywords,t.types,t.builtin),r=tu.define({name:`sql`,parser:yy.configure({tokenizers:[{from:$v,to:Qv(n)}]}),languageData:{commentTokens:{line:`--`,block:{open:`/*`,close:`*/`}},closeBrackets:{brackets:[`(`,`[`,`{`,`'`,`"`,"`"]}}});return new e(n,r,t)}};function xy(e,t){return{label:e,type:t,boost:-1}}function Sy(e,t=!1,n){return vy(e.dialect.words,t,n||xy)}function Cy(e){return e.schema?gy(e.schema,e.tables,e.schemas,e.defaultTable,e.defaultSchema,e.dialect||Ey):()=>null}function wy(e){return e.schema?(e.dialect||Ey).language.data.of({autocomplete:Cy(e)}):[]}function Ty(e={}){let t=e.dialect||Ey;return new du(t.language,[wy(e),t.language.data.of({autocomplete:Sy(t,e.upperCaseKeywords,e.keywordCompletion)})])}var Ey=by.define({});Yv+``,Jv+``;var Dy=`accessible algorithm analyze asensitive authors auto_increment autocommit avg avg_row_length binlog btree cache catalog_name chain change changed checkpoint checksum class_origin client_statistics coalesce code collations columns comment committed completion concurrent consistent contains contributors convert database databases day_hour day_microsecond day_minute day_second delay_key_write delayed delimiter des_key_file dev_pop dev_samp deviance directory disable discard distinctrow div dual dumpfile enable enclosed ends engine engines enum errors escaped even event events every explain extended fast field fields flush force found_rows fulltext grants handler hash high_priority hosts hour_microsecond hour_minute hour_second ignore ignore_server_ids import index index_statistics infile innodb insensitive insert_method install invoker iterate keys kill linear lines list load lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modify mutex mysql_errno no_write_to_binlog offline offset one online optimize optionally outfile pack_keys parser partition partitions password phase plugin plugins prev processlist profile profiles purge query quick range read_write rebuild recover regexp relaylog remove rename reorganize repair repeatable replace require resume rlike row_format rtree schedule schema_name schemas second_microsecond security sensitive separator serializable server share show slave slow snapshot soname spatial sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result ssl starting starts std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace terminated triggers truncate uncommitted uninstall unlock upgrade use use_frm user_resources user_statistics utc_date utc_time utc_timestamp variables views warnings xa xor year_month zerofill`;Jv+``,Yv+``+Dy,Yv+``+Dy,Yv+``,Jv+``,Yv+``,Jv+``,Jv+``,Yv+``,Jv+``;var Oy=1,ky=2,Ay=3,jy=4,My=5,Ny=36,Py=37,Fy=38,Iy=11,Ly=13;function Ry(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function zy(e){return e==9||e==10||e==13||e==32}var By=null,Vy=null,Hy=0;function Uy(e,t){let n=e.pos+t;if(Vy==e&&Hy==n)return By;for(;zy(e.peek(t));)t++;let r=``;for(;;){let n=e.peek(t);if(!Ry(n))break;r+=String.fromCharCode(n),t++}return Vy=e,Hy=n,By=r||null}function Wy(e,t){this.name=e,this.parent=t}var Gy=new tv({start:null,shift(e,t,n,r){return t==Oy?new Wy(Uy(r,1)||``,e):e},reduce(e,t){return t==Iy&&e?e.parent:e},reuse(e,t,n,r){let i=t.type.id;return i==Oy||i==Ly?new Wy(Uy(r,1)||``,e):e},strict:!1}),Ky=new H_((e,t)=>{if(e.next==60){if(e.advance(),e.next==47){e.advance();let n=Uy(e,0);if(!n)return e.acceptToken(My);if(t.context&&n==t.context.name)return e.acceptToken(ky);for(let r=t.context;r;r=r.parent)if(r.name==n)return e.acceptToken(Ay,-2);e.acceptToken(jy)}else if(e.next!=33&&e.next!=63)return e.acceptToken(Oy)}},{contextual:!0});function qy(e,t){return new H_(n=>{let r=0,i=t.charCodeAt(0);scan:for(;!(n.next<0);n.advance(),r++)if(n.next==i){for(let e=1;e<t.length;e++)if(n.peek(e)!=t.charCodeAt(e))continue scan;break}r&&n.acceptToken(e)})}var Jy=qy(Ny,`-->`),Yy=qy(Py,`?>`),Xy=qy(Fy,`]]>`),Zy=Ol({Text:J.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":J.angleBracket,TagName:J.tagName,"MismatchedCloseTag/TagName":[J.tagName,J.invalid],AttributeName:J.attributeName,AttributeValue:J.attributeValue,Is:J.definitionOperator,"EntityReference CharacterReference":J.character,Comment:J.blockComment,ProcessingInst:J.processingInstruction,DoctypeDecl:J.documentMeta,Cdata:J.special(J.string)}),Qy=nv.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C}'#C}O$dOrO,59^OOOP,59^,59^OOOS'#DO'#DOO$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6z-E6zOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6{-E6{OOOP1G.x1G.xOOOS-E6|-E6|OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+$c7+$cO'YOpO,59VO'bOpO,59VO'mO!bO,59eOOOO-E6w-E6wO'{OpO1G.uO'{OpO1G.uOOOP1G.u1G.uO(TOpO7+$fOOOP7+$f7+$fO(]O!bO<<GuOOOP<<Gu<<GuOOOP<<G}<<G}O'bOpO1G.qO'bOpO1G.qO(hO#tO'#CnO(vO&jO'#CnOOOO1G.q1G.qO)UOpO7+$aOOOP7+$a7+$aOOOP<<HQ<<HQOOOPAN=aAN=aOOOPAN=iAN=iO'bOpO7+$]OOOO7+$]7+$]OOOO'#Cz'#CzO)^O#tO,59YOOOO,59Y,59YOOOO'#C{'#C{O)lO&jO,59YOOOP<<G{<<G{OOOO<<Gw<<GwOOOO-E6x-E6xOOOO1G.t1G.tOOOO-E6y-E6y",stateData:")z~OPQOSVOTWOVWOWWOXWOiXOyPO!QTO!SUO~OvZOx]O~O^`Oz^O~OPQOQcOSVOTWOVWOWWOXWOyPO!QTO!SUO~ORdO~P!SOteO!PgO~OuhO!RjO~O^lOz^O~OvZOxoO~O^qOz^O~O[vO`sOdwOz^O~ORyO~P!SO^{Oz^O~OteO!P}O~OuhO!R!PO~O^!QOz^O~O[!SOz^O~O[!VO`sOd!WOz^O~Oa!YOz^O~Oz^O[mX`mXdmX~O[!VO`sOd!WO~O^!]Oz^O~O[!_Oz^O~O[!aOz^O~O[!cO`sOd!dOz^O~O[!cO`sOd!dO~Oa!eOz^O~Oz^O{!gO}!hO~Oz^O[ma`madma~O[!kOz^O~O[!lOz^O~O[!mO`sOd!nO~OW!qOX!qO{!sO|!qO~OW!tOX!tO}!sO!O!tO~O[!vOz^O~OW!qOX!qO{!yO|!qO~OW!tOX!tO}!yO!O!tO~O",goto:"%cxPPPPPPPPPPyyP!PP!VPP!`!jP!pyyyP!v!|#S$[$k$q$w$}%TPPPP%ZXWORYbXRORYb_t`qru!T!U!bQ!i!YS!p!e!fR!w!oQdRRybXSORYbQYORmYQ[PRn[Q_QQkVjp_krz!R!T!X!Z!^!`!f!j!oQr`QzcQ!RlQ!TqQ!XsQ!ZtQ!^{Q!`!QQ!f!YQ!j!]R!o!eQu`S!UqrU![u!U!bR!b!TQ!r!gR!x!rQ!u!hR!z!uQbRRxbQfTR|fQiUR!OiSXOYTaRb",nodeNames:`⚠ StartTag StartCloseTag MissingCloseTag StartCloseTag StartCloseTag Document Text EntityReference CharacterReference Cdata Element EndTag OpenTag TagName Attribute AttributeName Is AttributeValue CloseTag SelfCloseEndTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag DoctypeDecl`,maxTerm:50,context:Gy,nodeProps:[[`closedBy`,1,`SelfCloseEndTag EndTag`,13,`CloseTag MissingCloseTag`],[`openedBy`,12,`StartTag StartCloseTag`,19,`OpenTag`,20,`StartTag`],[`isolate`,-6,13,18,19,21,22,24,``]],propSources:[Zy],skippedNodes:[0],repeatNodeCount:9,tokenData:"!)v~R!YOX$qXY)iYZ)iZ]$q]^)i^p$qpq)iqr$qrs*vsv$qvw+fwx/ix}$q}!O0[!O!P$q!P!Q2z!Q![$q![!]4n!]!^$q!^!_8U!_!`!#t!`!a!$l!a!b!%d!b!c$q!c!}4n!}#P$q#P#Q!'W#Q#R$q#R#S4n#S#T$q#T#o4n#o%W$q%W%o4n%o%p$q%p&a4n&a&b$q&b1p4n1p4U$q4U4d4n4d4e$q4e$IS4n$IS$I`$q$I`$Ib4n$Ib$Kh$q$Kh%#t4n%#t&/x$q&/x&Et4n&Et&FV$q&FV;'S4n;'S;:j8O;:j;=`)c<%l?&r$q?&r?Ah4n?Ah?BY$q?BY?Mn4n?MnO$qi$zXVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qa%nVVP!O`Ov%gwx&Tx!^%g!^!_&o!_;'S%g;'S;=`'W<%lO%gP&YTVPOv&Tw!^&T!_;'S&T;'S;=`&i<%lO&TP&lP;=`<%l&T`&tS!O`Ov&ox;'S&o;'S;=`'Q<%lO&o`'TP;=`<%l&oa'ZP;=`<%l%gX'eWVP|WOr'^rs&Tsv'^w!^'^!^!_'}!_;'S'^;'S;=`(i<%lO'^W(ST|WOr'}sv'}w;'S'};'S;=`(c<%lO'}W(fP;=`<%l'}X(lP;=`<%l'^h(vV|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oh)`P;=`<%l(oi)fP;=`<%l$qo)t`VP|W!O`zUOX$qXY)iYZ)iZ]$q]^)i^p$qpq)iqr$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk+PV{YVP!O`Ov%gwx&Tx!^%g!^!_&o!_;'S%g;'S;=`'W<%lO%g~+iast,n![!]-r!c!}-r#R#S-r#T#o-r%W%o-r%p&a-r&b1p-r4U4d-r4e$IS-r$I`$Ib-r$Kh%#t-r&/x&Et-r&FV;'S-r;'S;:j/c?&r?Ah-r?BY?Mn-r~,qQ!Q![,w#l#m-V~,zQ!Q![,w!]!^-Q~-VOX~~-YR!Q![-c!c!i-c#T#Z-c~-fS!Q![-c!]!^-Q!c!i-c#T#Z-c~-ug}!O-r!O!P-r!Q![-r![!]-r!]!^/^!c!}-r#R#S-r#T#o-r$}%O-r%W%o-r%p&a-r&b1p-r1p4U-r4U4d-r4e$IS-r$I`$Ib-r$Je$Jg-r$Kh%#t-r&/x&Et-r&FV;'S-r;'S;:j/c?&r?Ah-r?BY?Mn-r~/cOW~~/fP;=`<%l-rk/rW}bVP|WOr'^rs&Tsv'^w!^'^!^!_'}!_;'S'^;'S;=`(i<%lO'^k0eZVP|W!O`Or$qrs%gsv$qwx'^x}$q}!O1W!O!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk1aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a2S!a;'S$q;'S;=`)c<%lO$qk2_X!PQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qm3TZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a3v!a;'S$q;'S;=`)c<%lO$qm4RXdSVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qo4{!P`S^QVP|W!O`Or$qrs%gsv$qwx'^x}$q}!O4n!O!P4n!P!Q$q!Q![4n![!]4n!]!^$q!^!_(o!_!c$q!c!}4n!}#R$q#R#S4n#S#T$q#T#o4n#o$}$q$}%O4n%O%W$q%W%o4n%o%p$q%p&a4n&a&b$q&b1p4n1p4U4n4U4d4n4d4e$q4e$IS4n$IS$I`$q$I`$Ib4n$Ib$Je$q$Je$Jg4n$Jg$Kh$q$Kh%#t4n%#t&/x$q&/x&Et4n&Et&FV$q&FV;'S4n;'S;:j8O;:j;=`)c<%l?&r$q?&r?Ah4n?Ah?BY$q?BY?Mn4n?MnO$qo8RP;=`<%l4ni8]Y|W!O`Oq(oqr8{rs&osv(owx'}x!a(o!a!b!#U!b;'S(o;'S;=`)]<%lO(oi9S_|W!O`Or(ors&osv(owx'}x}(o}!O:R!O!f(o!f!g;e!g!}(o!}#ODh#O#W(o#W#XLp#X;'S(o;'S;=`)]<%lO(oi:YX|W!O`Or(ors&osv(owx'}x}(o}!O:u!O;'S(o;'S;=`)]<%lO(oi;OV!QP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oi;lX|W!O`Or(ors&osv(owx'}x!q(o!q!r<X!r;'S(o;'S;=`)]<%lO(oi<`X|W!O`Or(ors&osv(owx'}x!e(o!e!f<{!f;'S(o;'S;=`)]<%lO(oi=SX|W!O`Or(ors&osv(owx'}x!v(o!v!w=o!w;'S(o;'S;=`)]<%lO(oi=vX|W!O`Or(ors&osv(owx'}x!{(o!{!|>c!|;'S(o;'S;=`)]<%lO(oi>jX|W!O`Or(ors&osv(owx'}x!r(o!r!s?V!s;'S(o;'S;=`)]<%lO(oi?^X|W!O`Or(ors&osv(owx'}x!g(o!g!h?y!h;'S(o;'S;=`)]<%lO(oi@QY|W!O`Or?yrs@psv?yvwA[wxBdx!`?y!`!aCr!a;'S?y;'S;=`Db<%lO?ya@uV!O`Ov@pvxA[x!`@p!`!aAy!a;'S@p;'S;=`B^<%lO@pPA_TO!`A[!`!aAn!a;'SA[;'S;=`As<%lOA[PAsOiPPAvP;=`<%lA[aBQSiP!O`Ov&ox;'S&o;'S;=`'Q<%lO&oaBaP;=`<%l@pXBiX|WOrBdrsA[svBdvwA[w!`Bd!`!aCU!a;'SBd;'S;=`Cl<%lOBdXC]TiP|WOr'}sv'}w;'S'};'S;=`(c<%lO'}XCoP;=`<%lBdiC{ViP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oiDeP;=`<%l?yiDoZ|W!O`Or(ors&osv(owx'}x!e(o!e!fEb!f#V(o#V#WIr#W;'S(o;'S;=`)]<%lO(oiEiX|W!O`Or(ors&osv(owx'}x!f(o!f!gFU!g;'S(o;'S;=`)]<%lO(oiF]X|W!O`Or(ors&osv(owx'}x!c(o!c!dFx!d;'S(o;'S;=`)]<%lO(oiGPX|W!O`Or(ors&osv(owx'}x!v(o!v!wGl!w;'S(o;'S;=`)]<%lO(oiGsX|W!O`Or(ors&osv(owx'}x!c(o!c!dH`!d;'S(o;'S;=`)]<%lO(oiHgX|W!O`Or(ors&osv(owx'}x!}(o!}#OIS#O;'S(o;'S;=`)]<%lO(oiI]V|W!O`yPOr(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oiIyX|W!O`Or(ors&osv(owx'}x#W(o#W#XJf#X;'S(o;'S;=`)]<%lO(oiJmX|W!O`Or(ors&osv(owx'}x#T(o#T#UKY#U;'S(o;'S;=`)]<%lO(oiKaX|W!O`Or(ors&osv(owx'}x#h(o#h#iK|#i;'S(o;'S;=`)]<%lO(oiLTX|W!O`Or(ors&osv(owx'}x#T(o#T#UH`#U;'S(o;'S;=`)]<%lO(oiLwX|W!O`Or(ors&osv(owx'}x#c(o#c#dMd#d;'S(o;'S;=`)]<%lO(oiMkX|W!O`Or(ors&osv(owx'}x#V(o#V#WNW#W;'S(o;'S;=`)]<%lO(oiN_X|W!O`Or(ors&osv(owx'}x#h(o#h#iNz#i;'S(o;'S;=`)]<%lO(oi! RX|W!O`Or(ors&osv(owx'}x#m(o#m#n! n#n;'S(o;'S;=`)]<%lO(oi! uX|W!O`Or(ors&osv(owx'}x#d(o#d#e!!b#e;'S(o;'S;=`)]<%lO(oi!!iX|W!O`Or(ors&osv(owx'}x#X(o#X#Y?y#Y;'S(o;'S;=`)]<%lO(oi!#_V!SP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(ok!$PXaQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qo!$wX[UVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!%mZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!&`!a;'S$q;'S;=`)c<%lO$qk!&kX!RQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!'aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_#P$q#P#Q!(S#Q;'S$q;'S;=`)c<%lO$qk!(]ZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!)O!a;'S$q;'S;=`)c<%lO$qk!)ZXxQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$q",tokenizers:[Ky,Jy,Yy,Xy,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function $y(e,t){let n=t&&t.getChild(`TagName`);return n?e.sliceString(n.from,n.to):``}function eb(e,t){let n=t&&t.firstChild;return!n||n.name!=`OpenTag`?``:$y(e,n)}function tb(e,t,n){let r=t&&t.getChildren(`Attribute`).find(e=>e.from<=n&&e.to>=n),i=r&&r.getChild(`AttributeName`);return i?e.sliceString(i.from,i.to):``}function nb(e){for(let t=e&&e.parent;t;t=t.parent)if(t.name==`Element`)return t;return null}function rb(e,t){let n=Y(e).resolveInner(t,-1),r=null;for(let e=n;!r&&e.parent;e=e.parent)(e.name==`OpenTag`||e.name==`CloseTag`||e.name==`SelfClosingTag`||e.name==`MismatchedCloseTag`)&&(r=e);if(r&&(r.to>t||r.lastChild.type.isError)){let e=r.parent;if(n.name==`TagName`)return r.name==`CloseTag`||r.name==`MismatchedCloseTag`?{type:`closeTag`,from:n.from,context:e}:{type:`openTag`,from:n.from,context:nb(e)};if(n.name==`AttributeName`)return{type:`attrName`,from:n.from,context:r};if(n.name==`AttributeValue`)return{type:`attrValue`,from:n.from,context:r};let i=n==r||n.name==`Attribute`?n.childBefore(t):n;return i?.name==`StartTag`?{type:`openTag`,from:t,context:nb(e)}:i?.name==`StartCloseTag`&&i.to<=t?{type:`closeTag`,from:t,context:e}:i?.name==`Is`?{type:`attrValue`,from:t,context:r}:i?{type:`attrName`,from:t,context:r}:null}if(n.name==`StartCloseTag`)return{type:`closeTag`,from:t,context:n.parent};for(;n.parent&&n.to==t&&!n.lastChild?.type.isError;)n=n.parent;return n.name==`Element`||n.name==`Text`||n.name==`Document`?{type:`tag`,from:t,context:n.name==`Element`?n:nb(n)}:null}var ib=class{constructor(e,t,n){this.attrs=t,this.attrValues=n,this.children=[],this.name=e.name,this.completion=Object.assign(Object.assign({type:`type`},e.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:`<`+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:`</`+this.name+`>`,boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+`>`}),this.text=e.textContent?e.textContent.map(e=>({label:e,type:`text`})):[]}},ab=/^[:\-\.\w\u00b7-\uffff]*$/;function ob(e){return Object.assign(Object.assign({type:`property`},e.completion||{}),{label:e.name})}function sb(e){return typeof e==`string`?{label:`"${e}"`,type:`constant`}:/^"/.test(e.label)?e:Object.assign(Object.assign({},e),{label:`"${e.label}"`})}function cb(e,t){let n=[],r=[],i=Object.create(null);for(let e of t){let t=ob(e);n.push(t),e.global&&r.push(t),e.values&&(i[e.name]=e.values.map(sb))}let a=[],o=[],s=Object.create(null);for(let t of e){let e=r,c=i;t.attributes&&(e=e.concat(t.attributes.map(e=>typeof e==`string`?n.find(t=>t.label==e)||{label:e,type:`property`}:(e.values&&(c==i&&(c=Object.create(c)),c[e.name]=e.values.map(sb)),ob(e)))));let l=new ib(t,e,c);s[l.name]=l,a.push(l),t.top&&o.push(l)}o.length||(o=a);for(let t=0;t<a.length;t++){let n=e[t],r=a[t];if(n.children)for(let e of n.children)s[e]&&r.children.push(s[e]);else r.children=a}return e=>{let{doc:t}=e.state,n=rb(e.state,e.pos);if(!n||n.type==`tag`&&!e.explicit)return null;let{type:c,from:l,context:u}=n;if(c==`openTag`){let e=o,n=eb(t,u);return n&&(e=s[n]?.children||a),{from:l,options:e.map(e=>e.completion),validFor:ab}}if(c==`closeTag`){let n=eb(t,u);return n?{from:l,to:e.pos+ +(t.sliceString(e.pos,e.pos+1)==`>`),options:[s[n]?.closeNameCompletion||{label:n+`>`,type:`type`}],validFor:ab}:null}if(c==`attrName`)return{from:l,options:s[$y(t,u)]?.attrs||r,validFor:ab};if(c==`attrValue`){let n=tb(t,u,l);if(!n)return null;let r=(s[$y(t,u)]?.attrValues||i)[n];return!r||!r.length?null:{from:l,to:e.pos+ +(t.sliceString(e.pos,e.pos+1)==`"`),options:r,validFor:/^"[^"]*"?$/}}if(c==`tag`){let n=eb(t,u),r=s[n],i=[],c=u&&u.lastChild;n&&(!c||c.name!=`CloseTag`||$y(t,c)!=n)&&i.push(r?r.closeCompletion:{label:`</`+n+`>`,type:`type`,boost:2});let d=i.concat((r?.children||(u?a:o)).map(e=>e.openCompletion));if(u&&r?.text.length){let t=u.firstChild;t.to>e.pos-20&&!/\S/.test(e.state.sliceDoc(t.to,e.pos))&&(d=d.concat(r.text))}return{from:l,options:d,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}return null}}var lb=tu.define({name:`xml`,parser:Qy.configure({props:[vu.add({Element(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),Nu.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!=`OpenTag`?null:{from:t.to,to:n.name==`CloseTag`?n.from:e.to}}}),Td.add({"OpenTag CloseTag":e=>e.getChild(`TagName`)})]}),languageData:{commentTokens:{block:{open:`<!--`,close:`-->`}},indentOnInput:/^\s*<\/$/}});function ub(e={}){let t=[lb.data.of({autocomplete:cb(e.elements||[],e.attributes||[])})];return e.autoCloseTags!==!1&&t.push(fb),new du(lb,t)}function db(e,t,n=e.length){if(!t)return``;let r=t.firstChild,i=r&&r.getChild(`TagName`);return i?e.sliceString(i.from,Math.min(i.to,n)):``}var fb=U.inputHandler.of((e,t,n,r,i)=>{if(e.composing||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!lb.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let{head:t}=e,n=o.doc.sliceString(t-1,t)==r,i=Y(o).resolveInner(t,-1),a;if(n&&r==`>`&&i.name==`EndTag`){let n=i.parent;if(n.parent?.lastChild?.name!=`CloseTag`&&(a=db(o.doc,n.parent,t)))return{range:e,changes:{from:t,to:t+ +(o.doc.sliceString(t,t+1)===`>`),insert:`</${a}>`}}}else if(n&&r==`/`&&i.name==`StartCloseTag`){let e=i.parent;if(i.from==t-2&&e.lastChild?.name!=`CloseTag`&&(a=db(o.doc,e,t))){let e=t+ +(o.doc.sliceString(t,t+1)===`>`),n=`${a}>`;return{range:T.cursor(t+n.length,-1),changes:{from:t,to:e,insert:n}}}}return{range:e}});return!s.changes.empty&&(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),pb=63,mb=64,hb=1,gb=2,_b=3,vb=4,yb=5,bb=6,xb=7,Sb=65,Cb=66,wb=8,Tb=9,Eb=10,Db=11,Ob=12,kb=13,Ab=19,jb=20,Mb=29,Nb=33,Pb=34,Fb=47,Ib=0,Lb=1,Rb=2,zb=3,Bb=4,Vb=class{constructor(e,t,n){this.parent=e,this.depth=t,this.type=n,this.hash=(e?e.hash+e.hash<<8:0)+t+(t<<4)+n}};Vb.top=new Vb(null,-1,Ib);function Hb(e,t){for(let n=0,r=t-e.pos-1;;r--,n++){let t=e.peek(r);if(Wb(t)||t==-1)return n}}function Ub(e){return e==32||e==9}function Wb(e){return e==10||e==13}function Gb(e){return Ub(e)||Wb(e)}function Kb(e){return e<0||Gb(e)}var qb=new tv({start:Vb.top,reduce(e,t){return e.type==zb&&(t==jb||t==Pb)?e.parent:e},shift(e,t,n,r){if(t==_b)return new Vb(e,Hb(r,r.pos),Lb);if(t==Sb||t==yb)return new Vb(e,Hb(r,r.pos),Rb);if(t==pb)return e.parent;if(t==Ab||t==Nb)return new Vb(e,0,zb);if(t==kb&&e.type==Bb)return e.parent;if(t==Fb){let t=/[1-9]/.exec(r.read(r.pos,n.pos));if(t)return new Vb(e,e.depth+ +t[0],Bb)}return e},hash(e){return e.hash}});function Jb(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&Kb(e.peek(n+3))}var Yb=new H_((e,t)=>{if(e.next==-1&&t.canShift(mb))return e.acceptToken(mb);let n=e.peek(-1);if((Wb(n)||n<0)&&t.context.type!=zb){if(Jb(e,45)){if(t.canShift(pb))e.acceptToken(pb);else return e.acceptToken(hb,3)}if(Jb(e,46)){if(t.canShift(pb))e.acceptToken(pb);else return e.acceptToken(gb,3)}let n=0;for(;e.next==32;)n++,e.advance();(n<t.context.depth||n==t.context.depth&&t.context.type==Lb&&(e.next!=45||!Kb(e.peek(1))))&&e.next!=-1&&!Wb(e.next)&&e.next!=35&&e.acceptToken(pb,-n)}},{contextual:!0}),Xb=new H_((e,t)=>{if(t.context.type==zb){e.next==63&&(e.advance(),Kb(e.next)&&e.acceptToken(xb));return}if(e.next==45)e.advance(),Kb(e.next)&&e.acceptToken(t.context.type==Lb&&t.context.depth==Hb(e,e.pos-1)?vb:_b);else if(e.next==63)e.advance(),Kb(e.next)&&e.acceptToken(t.context.type==Rb&&t.context.depth==Hb(e,e.pos-1)?bb:yb);else{let n=e.pos;for(;;)if(Ub(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)ex(e);else if(e.next==38)tx(e);else if(e.next==42){tx(e);break}else if(e.next==39||e.next==34){if(nx(e,!0))break;return}else if(e.next==91||e.next==123){if(!rx(e))return;break}else{sx(e,!0,!1,0);break}for(;Ub(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(Mb))return;Kb(e.peek(1))&&e.acceptTokenTo(t.context.type==Rb&&t.context.depth==Hb(e,n)?Cb:Sb,n)}}},{contextual:!0});function Zb(e){return e>32&&e<127&&e!=34&&e!=37&&e!=44&&e!=60&&e!=62&&e!=92&&e!=94&&e!=96&&e!=123&&e!=124&&e!=125}function Qb(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function $b(e,t){return e.next==37?(e.advance(),Qb(e.next)&&e.advance(),Qb(e.next)&&e.advance(),!0):Zb(e.next)||t&&e.next==44?(e.advance(),!0):!1}function ex(e){if(e.advance(),e.next==60){for(e.advance();;)if(!$b(e,!0)){e.next==62&&e.advance();break}}else for(;$b(e,!1););}function tx(e){for(e.advance();!Kb(e.next)&&ax(e.next)!=`f`;)e.advance()}function nx(e,t){let n=e.next,r=!1,i=e.pos;for(e.advance();;){let a=e.next;if(a<0)break;if(e.advance(),a==n){if(a==39){if(e.next==39)e.advance();else break}else break}else if(a==92&&n==34)e.next>=0&&e.advance();else if(Wb(a)){if(t)return!1;r=!0}else if(t&&e.pos>=i+1024)return!1}return!r}function rx(e){for(let t=[],n=e.pos+1024;;)if(e.next==91||e.next==123)t.push(e.next),e.advance();else if(e.next==39||e.next==34){if(!nx(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else if(e.next<0||e.pos>n||Wb(e.next))return!1;else e.advance()}var ix=`iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif`;function ax(e){return e<33?`u`:e>125?`s`:ix[e-33]}function ox(e,t){let n=ax(e);return n!=`u`&&!(t&&n==`f`)}function sx(e,t,n,r){if(ax(e.next)==`s`||(e.next==63||e.next==58||e.next==45)&&ox(e.peek(1),n))e.advance();else return!1;let i=e.pos;for(;;){let a=e.next,o=0,s=r+1;for(;Gb(a);){if(Wb(a)){if(t)return!1;s=0}else s++;a=e.peek(++o)}if(!(a>=0&&(a==58?ox(e.peek(o+1),n):a==35?e.peek(o-1)!=32:ox(a,n)))||!n&&s<=r||s==0&&!n&&(Jb(e,45,o)||Jb(e,46,o)))break;if(t&&ax(a)==`f`)return!1;for(let t=o;t>=0;t--)e.advance();if(t&&e.pos>i+1024)return!1}return!0}var cx=new H_((e,t)=>{if(e.next==33)ex(e),e.acceptToken(Ob);else if(e.next==38||e.next==42){let t=e.next==38?Eb:Db;tx(e),e.acceptToken(t)}else e.next==39||e.next==34?(nx(e,!1),e.acceptToken(Tb)):sx(e,!1,t.context.type==zb,t.context.depth)&&e.acceptToken(wb)}),lx=new H_((e,t)=>{let n=t.context.type==Bb?t.context.depth:-1,r=e.pos;scan:for(;;){let i=0,a=e.next;for(;a==32;)a=e.peek(++i);if(!i&&(Jb(e,45,i)||Jb(e,46,i))||!Wb(a)&&(n<0&&(n=Math.max(t.context.depth+1,i)),i<n))break;for(;;){if(e.next<0)break scan;let t=Wb(e.next);if(e.advance(),t)continue scan;r=e.pos}}e.acceptTokenTo(kb,r)}),ux=Ol({DirectiveName:J.keyword,DirectiveContent:J.attributeValue,"DirectiveEnd DocEnd":J.meta,QuotedLiteral:J.string,BlockLiteralHeader:J.special(J.string),BlockLiteralContent:J.content,Literal:J.content,"Key/Literal Key/QuotedLiteral":J.definition(J.propertyName),"Anchor Alias":J.labelName,Tag:J.typeName,Comment:J.lineComment,": , -":J.separator,"?":J.punctuation,"[ ]":J.squareBracket,"{ }":J.brace}),dx=nv.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:`⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document`,maxTerm:74,context:qb,nodeProps:[[`isolate`,-3,8,9,14,``],[`openedBy`,18,`[`,32,`{`],[`closedBy`,19,`]`,33,`}`]],propSources:[ux],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[Yb,Xb,cx,lx,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),fx=tu.define({name:`yaml`,parser:dx.configure({props:[vu.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name==`BlockLiteralContent`&&t.from<t.to)return e.baseIndentFor(t);if(t.name==`BlockLiteral`)return e.baseIndentFor(t)+e.unit;if(t.name==`BlockSequence`||t.name==`BlockMapping`)return e.column(t.firstChild.from,1);if(t.name==`QuotedLiteral`)return null;if(t.name==`Literal`){let n=e.column(t.from,1);if(n==e.lineIndent(t.from,1))return n;if(t.to>e.pos)return null}}return null},FlowMapping:Du({closing:`}`}),FlowSequence:Du({closing:`]`})}),Nu.add({"FlowMapping FlowSequence":Pu,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:`#`},indentOnInput:/^\s*[\]\}]$/}});function px(){return new du(fx)}J.meta;var mx=[[`plantuml`,`PlantUML`],[`mermaid`,`Mermaid`],[`graphviz`,`GraphViz`],[`d2`,`D2`],[`c4plantuml`,`C4 PlantUML`],[`blockdiag`,`BlockDiag`],[`seqdiag`,`SeqDiag`],[`actdiag`,`ActDiag`],[`nwdiag`,`NwDiag`],[`packetdiag`,`PacketDiag`],[`rackdiag`,`RackDiag`],[`bpmn`,`BPMN`],[`bytefield`,`Bytefield`],[`dbml`,`DBML`],[`diagramsnet`,`Diagrams.net`],[`ditaa`,`Ditaa`],[`erd`,`ERD`],[`excalidraw`,`Excalidraw`],[`goat`,`GoAT`],[`nomnoml`,`Nomnoml`],[`pikchr`,`Pikchr`],[`structurizr`,`Structurizr`],[`svgbob`,`Svgbob`],[`symbolator`,`Symbolator`],[`tikz`,`TikZ`],[`umlet`,`UMLet`],[`vega`,`Vega`],[`vegalite`,`Vega-Lite`],[`wavedrom`,`WaveDrom`],[`wireviz`,`WireViz`]].map(([e,t])=>({id:e,label:t})),hx=new Set(`actor.alt.and.as.class.component.database.direction.else.end.endnote.endif.endwhile.flowchart.graph.group.if.interface.loop.namespace.node.note.package.participant.rectangle.return.skinparam.start.state.stop.subgraph.then.title.while`.split(`.`)),gx=Id.define({startState:()=>({blockComment:!1}),token(e,t){return t.blockComment?(e.skipTo(`*/`)?(e.match(`*/`),t.blockComment=!1):e.skipToEnd(),`blockComment`):e.match(`/*`)?(t.blockComment=!0,`blockComment`):e.match(/^\s*(?:%%|\/\/|'|#).*/)?`lineComment`:e.match(/^@(?:start|end)[a-z0-9_]*/i)?`keyword`:e.match(/^"(?:[^"\\]|\\.)*"/)?`string`:e.match(/^(?:--?>|<--?|==>|<==|\.\.>|<\.\.|->|<-|=>|<=|--|\.\.)/)?`operator`:e.match(/^#[0-9a-f]{3,8}\b/i)?`color`:e.match(/^\b\d+(?:\.\d+)?\b/)?`number`:e.match(/^\b[a-z_][\w-]*\b/i)?hx.has(e.current().toLowerCase())?`keyword`:`variableName`:(e.next(),null)}}),_x=new Set([`bytefield`,`excalidraw`,`vega`,`vegalite`,`wavedrom`]),vx=new Set([`bpmn`,`diagramsnet`,`umlet`]);function yx(e){return _x.has(e)?lv():vx.has(e)?ub():e===`wireviz`?px():e===`dbml`?Ty():gx}function bx(e){return mx.some(t=>t.id===e)}var xx=`<?xml version="1.0" encoding="UTF-8"?>16+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:qa="http://some-company/schema/bpmn/qa" id="_RdgBELNaEeSYkoSLDs6j-w" targetNamespace="http://activiti.org/bpmn">17+ <bpmn2:process id="Process_1">18+ <bpmn2:task id="Task_1" name="Examine Situation" qa:suitable="0.7">19+ <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>20+ <bpmn2:extensionElements>21+ <qa:analysisDetails lastChecked="2015-01-20" nextCheck="2015-07-15">22+ <qa:comment author="Klaus">23+ Our operators always have a hard time to figure out, what they need to do here.24+ </qa:comment>25+ <qa:comment author="Walter">26+ I believe this can be split up in a number of activities and partly automated.27+ </qa:comment>28+ </qa:analysisDetails>29+ </bpmn2:extensionElements>30+ </bpmn2:task>31+ <bpmn2:sequenceFlow id="SequenceFlow_1" name="" sourceRef="Task_1" targetRef="ExclusiveGateway_1"/>32+ <bpmn2:exclusiveGateway id="ExclusiveGateway_1" name="Things OK?">33+ <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>34+ <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing>35+ <bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing>36+ </bpmn2:exclusiveGateway>37+ <bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="ExclusiveGateway_1" targetRef="EndEvent_1"/>38+ <bpmn2:sequenceFlow id="SequenceFlow_5" name="" sourceRef="ExclusiveGateway_1" targetRef="EndEvent_2"/>39+ <bpmn2:endEvent id="EndEvent_1" name="Notification Sent">40+ <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>41+ <bpmn2:messageEventDefinition id="MessageEventDefinition_1"/>42+ </bpmn2:endEvent>43+ <bpmn2:endEvent id="EndEvent_2" name="Error Propagated">44+ <bpmn2:incoming>SequenceFlow_5</bpmn2:incoming>45+ <bpmn2:errorEventDefinition id="ErrorEventDefinition_1"/>46+ </bpmn2:endEvent>47+ </bpmn2:process>48+ <bpmndi:BPMNDiagram id="BPMNDiagram_1">49+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">50+ <bpmndi:BPMNShape id="_BPMNShape_Task_2" bpmnElement="Task_1">51+ <dc:Bounds height="80.0" width="100.0" x="96.0" y="196.0"/>52+ </bpmndi:BPMNShape>53+ <bpmndi:BPMNShape id="_BPMNShape_EndEvent_2" bpmnElement="EndEvent_1">54+ <dc:Bounds height="36.0" width="36.0" x="396.0" y="300.0"/>55+ <bpmndi:BPMNLabel>56+ <dc:Bounds height="0.0" width="0.0" x="414.0" y="341.0"/>57+ </bpmndi:BPMNLabel>58+ </bpmndi:BPMNShape>59+ <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_2" bpmnElement="ExclusiveGateway_1" isMarkerVisible="true">60+ <dc:Bounds height="50.0" width="50.0" x="276.0" y="210.0"/>61+ <bpmndi:BPMNLabel>62+ <dc:Bounds height="21.0" width="74.0" x="333.0" y="226.0"/>63+ </bpmndi:BPMNLabel>64+ </bpmndi:BPMNShape>65+ <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_Task_2" targetElement="_BPMNShape_ExclusiveGateway_2">66+ <di:waypoint xsi:type="dc:Point" x="196.0" y="236.0"/>67+ <di:waypoint xsi:type="dc:Point" x="276.0" y="235.0"/>68+ <bpmndi:BPMNLabel>69+ <dc:Bounds height="6.0" width="6.0" x="214.0" y="236.0"/>70+ </bpmndi:BPMNLabel>71+ </bpmndi:BPMNEdge>72+ <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="_BPMNShape_ExclusiveGateway_2" targetElement="_BPMNShape_EndEvent_2">73+ <di:waypoint xsi:type="dc:Point" x="301.0" y="260.0"/>74+ <di:waypoint xsi:type="dc:Point" x="301.0" y="318.0"/>75+ <di:waypoint xsi:type="dc:Point" x="396.0" y="318.0"/>76+ <bpmndi:BPMNLabel>77+ <dc:Bounds height="6.0" width="6.0" x="298.0" y="301.0"/>78+ </bpmndi:BPMNLabel>79+ </bpmndi:BPMNEdge>80+ <bpmndi:BPMNShape id="_BPMNShape_EndEvent_3" bpmnElement="EndEvent_2">81+ <dc:Bounds height="36.0" width="36.0" x="396.0" y="132.0"/>82+ <bpmndi:BPMNLabel>83+ <dc:Bounds height="0.0" width="0.0" x="414.0" y="173.0"/>84+ </bpmndi:BPMNLabel>85+ </bpmndi:BPMNShape>86+ <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_5" sourceElement="_BPMNShape_ExclusiveGateway_2" targetElement="_BPMNShape_EndEvent_3">87+ <di:waypoint xsi:type="dc:Point" x="301.0" y="210.0"/>88+ <di:waypoint xsi:type="dc:Point" x="301.0" y="150.0"/>89+ <di:waypoint xsi:type="dc:Point" x="396.0" y="150.0"/>90+ <bpmndi:BPMNLabel>91+ <dc:Bounds height="6.0" width="6.0" x="333.0" y="150.0"/>92+ </bpmndi:BPMNLabel>93+ </bpmndi:BPMNEdge>94+ </bpmndi:BPMNPlane>95+ </bpmndi:BPMNDiagram>96+</bpmn2:definitions>97+`,Sx=`(draw-column-headers)98+(draw-box "Address" {:span 4})99+(draw-box "Size" {:span 2})100+(draw-box 0 {:span 2})101+(draw-gap "Payload")102+(draw-bottom)103+`,Cx=`dogs -> cats -> mice: chase104+replica 1 <-> replica 2105+a -> b: To err is human, to moo bovine {106+ style.animated: true107+ source-arrowhead: 1108+ target-arrowhead: * {109+ shape: diamond110+ }111+}112+`,wx=`Table users {113+ id integer114+ username varchar115+ role varchar116+ created_at timestamp117+}118+119+Table posts {120+ id integer [primary key]121+ title varchar122+ body text [note: 'Content of the post']123+ user_id integer124+ status post_status125+ created_at timestamp126+}127+128+Enum post_status {129+ draft130+ published131+ private [note: 'visible via URL only']132+}133+134+Ref: posts.user_id > users.id // many-to-one135+`,Tx=`<mxfile host="localhost" modified="2021-05-13T15:13:49.065Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" etag="wSTZ0NLKJqQDPf-wjMNB" version="@DRAWIO-VERSION@" type="device"><diagram id="3228e29e-7158-1315-38df-8450db1d8a1d" name="Page-1">3VpdU+s4DP01PK5HtiTLfmwL3H3ZJ3Zmn0Mb2s4tTSeEBfbXr0LT2wbncvkI7WYDMzSy3CTnyEeSwxlObh+/ldlm8Ucxy1dnDmaPZ3h+5pwlCPqntjxtLUKNYV4uZ43T3nC1/CdvjNBY75ez/K7lWBXFqlpu2sZpsV7n06ply8qyeGi73RSr9lU32TxPDFfTbJVa/1rOqkVjtT7uB37Pl/NFc+ngZDtwnU2/z8vift1cb12s8+3Ibbb7muYZ7xbZrHg4MOHFGU7Koqi2n24fJ/mqhnWH2Hbe5U9Gf9xyma+rt0xwlqmZ9He2um+evLm36mkHhU5S1PVk/LBYVvnVJpvWIw9KvNrKosqqZbFWy28IarhZrlaTYlWUz7PxEoIAq73QecuqDgdfu91VZfE93zk+o4TjRXW70jOrH9OH2d1qXlb544GpebhveXGbV+WTujSj6MAgWYsueI8hNAw1EenYG+/QEgs7jLaJz4c92zrFQAAOzlvhgNFvXRYHvFv9FhSOFAOCOAqNT9bE3/zHXe2J0A8NFz/nxfXIi0VOebkI7PUqp+DFW2fIO6+/7NFjygt7G0J0IZLeJSbE2MgmgKOamaAnMeXFARknMQrqohUl0fbDC36Wlxc0uEsey+QkNDBYDd0YrUdG8YDU5gHZOOuDJ3ZgrfPp+hDoWBAE/SBNPSNt3Wg0fqsQHa4e7h15wmgsB+s9K7awg/ZpB6s1KkkcKIJlQKAEeRetcQREEFXYkEQ6iHA9EcF9pgjqSBGCfjIKJ1kDpBIfiFBCtFFUcNpMeDQYFGjkCACRO4hgQ6A5RKcCk0TqIALEuEBWPFJEiNH1w4tPeBklxCgMVY1kDex6/mexqTl4zgbFurpq/GB3vq3CLLVhrocOE/rz0RP84gy3IbdBARUBDwGDIHfITofq9BXrkmA6HhqmwvACUw1Qzaiq7xIFNBKjHBXTkGA6GRqmAYLRYkUlNWrVwbEt2FpenjJmY4Lv+dDw9ULtUqQdvwLGa65UB4xoO2T4C+FlSOC9GBq8TIkkxHaN4Y4qCZx2naPBaQIzGZF6wQNq+xjbpYPKrDlunKYd43hwmIrnpB44pbZy2u6Nhoeqd+EVdXXxpAinbd54MjiB1S75FYQRgxGwQThErjeLjgpw2r6N/2/4hlPWt5z2YePhFWBRO12P2gVLBPL2RbWApF2yDb7eM6r37Y6Kb0dPdj68CE67MutMjBEic0Br/XGrhbQpGw0uaElrLF37pFAK2wD+Remgw0E1g2zUoCXXscH/hQB3dGWDC1ptD14pcYlOKbs+7cvS7a8370t27ErefPDF1bzMZst8z0njccggfy1tCrFhODhebFcwGl06on21hQAdyyLWwrQ/OvY0lfrgg3gR0gN3+eKznKZ9Ybr99hlO8w++9Do2eW0dg1/wRR2rTEtOiFrb67L1tfpRPwSlTWbaDb3v/dcNX8t0aIywN6CwkmZuAXkrJWLIqVoGbbL0x0o/lKQtaprI3/miLMuuPyB8J6WEgA1GrVRBIvlgO7rYIy6TtKlNc/9ndEzQT7MPvDH77yQhYjIuIEBg9BARO8rfX6chdXFgRbkTFUfaFV3voE9P9/9w8zx28A9NePEv</diagram></mxfile>`,Ex=`[Person]136+*name137+height138+weight139++birth_location_id140+141+[Location]142+*id143+city144+state145+country146+147+Person *--1 Location148+`,Dx=`{149+ "type": "excalidraw",150+ "version": 2,151+ "source": "https://excalidraw.com",152+ "elements": [153+ {154+ "id": "vWrqOAfkind2qcm7LDAGZ",155+ "type": "ellipse",156+ "x": 414,157+ "y": 237,158+ "width": 214,159+ "height": 214,160+ "angle": 0,161+ "strokeColor": "#000000",162+ "backgroundColor": "#15aabf",163+ "fillStyle": "hachure",164+ "strokeWidth": 1,165+ "strokeStyle": "solid",166+ "roughness": 1,167+ "opacity": 100,168+ "groupIds": [],169+ "strokeSharpness": "sharp",170+ "seed": 1041657908,171+ "version": 120,172+ "versionNonce": 1188004276,173+ "isDeleted": false,174+ "boundElementIds": null175+ },176+ {177+ "id": "rC-02l026X3SWaucOxDw9",178+ "type": "ellipse",179+ "x": 563,180+ "y": 236,181+ "width": 214,182+ "height": 214,183+ "angle": 0,184+ "strokeColor": "#000000",185+ "backgroundColor": "#40c057",186+ "fillStyle": "hachure",187+ "strokeWidth": 1,188+ "strokeStyle": "solid",189+ "roughness": 1,190+ "opacity": 100,191+ "groupIds": [],192+ "strokeSharpness": "sharp",193+ "seed": 476355980,194+ "version": 169,195+ "versionNonce": 830055604,196+ "isDeleted": false,197+ "boundElementIds": null198+ },199+ {200+ "id": "DrhW4ZSEpniMojuzsiqvi",201+ "type": "ellipse",202+ "x": 476,203+ "y": 358,204+ "width": 214,205+ "height": 214,206+ "angle": 0,207+ "strokeColor": "#000000",208+ "backgroundColor": "#7950f2",209+ "fillStyle": "hachure",210+ "strokeWidth": 1,211+ "strokeStyle": "solid",212+ "roughness": 1,213+ "opacity": 100,214+ "groupIds": [],215+ "strokeSharpness": "sharp",216+ "seed": 1966042508,217+ "version": 119,218+ "versionNonce": 1553878324,219+ "isDeleted": false,220+ "boundElementIds": null221+ },222+ {223+ "id": "NMI4ix1W7sQ6z9EDdYwc7",224+ "type": "arrow",225+ "x": 384.12748830144295,226+ "y": 207.60779895196669,227+ "width": 119.87251169855705,228+ "height": 100.39220104803331,229+ "angle": 0,230+ "strokeColor": "#000000",231+ "backgroundColor": "#7950f2",232+ "fillStyle": "hachure",233+ "strokeWidth": 1,234+ "strokeStyle": "solid",235+ "roughness": 1,236+ "opacity": 100,237+ "groupIds": [],238+ "strokeSharpness": "round",239+ "seed": 1656470796,240+ "version": 69,241+ "versionNonce": 1460943500,242+ "isDeleted": false,243+ "boundElementIds": null,244+ "points": [245+ [246+ 0,247+ 0248+ ],249+ [250+ 119.87251169855705,251+ 100.39220104803331252+ ]253+ ],254+ "lastCommittedPoint": null,255+ "startBinding": {256+ "elementId": "3J8-URSbMsKSvZ2TvCc3K",257+ "focus": 0.2594107757283838,258+ "gap": 7.607798951966686259+ },260+ "endBinding": null261+ },262+ {263+ "id": "QixLrxvPLw7TbG6VJJ9dj",264+ "type": "arrow",265+ "x": 652.9917772874236,266+ "y": 609.5185939229559,267+ "width": 61.74239993095398,268+ "height": 105.02421977738851,269+ "angle": 0,270+ "strokeColor": "#000000",271+ "backgroundColor": "#40c057",272+ "fillStyle": "hachure",273+ "strokeWidth": 1,274+ "strokeStyle": "solid",275+ "roughness": 1,276+ "opacity": 100,277+ "groupIds": [],278+ "strokeSharpness": "round",279+ "seed": 738941452,280+ "version": 107,281+ "versionNonce": 1655140148,282+ "isDeleted": false,283+ "boundElementIds": null,284+ "points": [285+ [286+ 0,287+ 0288+ ],289+ [290+ -61.74239993095398,291+ -105.02421977738851292+ ]293+ ],294+ "lastCommittedPoint": null,295+ "startBinding": {296+ "elementId": "dhyExWoj7pia0unVwtXeL",297+ "focus": 0.1480924722475781,298+ "gap": 8.481406077044085299+ },300+ "endBinding": null301+ },302+ {303+ "id": "LBRnTRdXKmkt5IwhKJLDC",304+ "type": "arrow",305+ "x": 806.9784146802895,306+ "y": 212.38825479040858,307+ "width": 104.97841468028946,308+ "height": 96.61174520959142,309+ "angle": 0,310+ "strokeColor": "#000000",311+ "backgroundColor": "#40c057",312+ "fillStyle": "hachure",313+ "strokeWidth": 1,314+ "strokeStyle": "solid",315+ "roughness": 1,316+ "opacity": 100,317+ "groupIds": [],318+ "strokeSharpness": "round",319+ "seed": 751503500,320+ "version": 69,321+ "versionNonce": 1180701708,322+ "isDeleted": false,323+ "boundElementIds": null,324+ "points": [325+ [326+ 0,327+ 0328+ ],329+ [330+ -104.97841468028946,331+ 96.61174520959142332+ ]333+ ],334+ "lastCommittedPoint": null,335+ "startBinding": {336+ "elementId": "7fiPETvGUweaqK1VIn2zu",337+ "focus": -0.07338204068894764,338+ "gap": 9.388254790408553339+ },340+ "endBinding": null341+ },342+ {343+ "id": "VFSwfD_HsZyf5SBKdiFDz",344+ "type": "arrow",345+ "x": 599.140263160093,346+ "y": 191.4445904184276,347+ "width": 3.62529516014456,348+ "height": 206.31238589940077,349+ "angle": 0.13471642395161876,350+ "strokeColor": "#000000",351+ "backgroundColor": "#40c057",352+ "fillStyle": "hachure",353+ "strokeWidth": 1,354+ "strokeStyle": "solid",355+ "roughness": 1,356+ "opacity": 100,357+ "groupIds": [],358+ "strokeSharpness": "round",359+ "seed": 1721266612,360+ "version": 192,361+ "versionNonce": 1388066444,362+ "isDeleted": false,363+ "boundElementIds": null,364+ "points": [365+ [366+ 0,367+ 0368+ ],369+ [370+ 3.62529516014456,371+ 206.31238589940077372+ ]373+ ],374+ "lastCommittedPoint": null,375+ "startBinding": null,376+ "endBinding": null377+ },378+ {379+ "id": "3J8-URSbMsKSvZ2TvCc3K",380+ "type": "text",381+ "x": 314,382+ "y": 175,383+ "width": 135,384+ "height": 25,385+ "angle": 0,386+ "strokeColor": "#000000",387+ "backgroundColor": "#40c057",388+ "fillStyle": "hachure",389+ "strokeWidth": 1,390+ "strokeStyle": "solid",391+ "roughness": 1,392+ "opacity": 100,393+ "groupIds": [],394+ "strokeSharpness": "sharp",395+ "seed": 1793099060,396+ "version": 43,397+ "versionNonce": 2135655476,398+ "isDeleted": false,399+ "boundElementIds": [400+ "NMI4ix1W7sQ6z9EDdYwc7"401+ ],402+ "text": "want to draw",403+ "fontSize": 20,404+ "fontFamily": 1,405+ "textAlign": "left",406+ "verticalAlign": "top",407+ "baseline": 18408+ },409+ {410+ "id": "7fiPETvGUweaqK1VIn2zu",411+ "type": "text",412+ "x": 782,413+ "y": 178,414+ "width": 89,415+ "height": 25,416+ "angle": 0,417+ "strokeColor": "#000000",418+ "backgroundColor": "#40c057",419+ "fillStyle": "hachure",420+ "strokeWidth": 1,421+ "strokeStyle": "solid",422+ "roughness": 1,423+ "opacity": 100,424+ "groupIds": [],425+ "strokeSharpness": "sharp",426+ "seed": 1750780940,427+ "version": 38,428+ "versionNonce": 1584702860,429+ "isDeleted": false,430+ "boundElementIds": [431+ "LBRnTRdXKmkt5IwhKJLDC"432+ ],433+ "text": "can draw",434+ "fontSize": 20,435+ "fontFamily": 1,436+ "textAlign": "left",437+ "verticalAlign": "top",438+ "baseline": 18439+ },440+ {441+ "id": "dhyExWoj7pia0unVwtXeL",442+ "type": "text",443+ "x": 612,444+ "y": 618,445+ "width": 91,446+ "height": 25,447+ "angle": 0,448+ "strokeColor": "#000000",449+ "backgroundColor": "#40c057",450+ "fillStyle": "hachure",451+ "strokeWidth": 1,452+ "strokeStyle": "solid",453+ "roughness": 1,454+ "opacity": 100,455+ "groupIds": [],456+ "strokeSharpness": "sharp",457+ "seed": 1228201396,458+ "version": 105,459+ "versionNonce": 288443916,460+ "isDeleted": false,461+ "boundElementIds": [462+ "QixLrxvPLw7TbG6VJJ9dj"463+ ],464+ "text": "have time",465+ "fontSize": 20,466+ "fontFamily": 1,467+ "textAlign": "left",468+ "verticalAlign": "top",469+ "baseline": 18470+ },471+ {472+ "id": "PKjjaNpqiOpZQ7kml-d18",473+ "type": "text",474+ "x": 567,475+ "y": 148,476+ "width": 88,477+ "height": 25,478+ "angle": 0,479+ "strokeColor": "#000000",480+ "backgroundColor": "#40c057",481+ "fillStyle": "hachure",482+ "strokeWidth": 1,483+ "strokeStyle": "solid",484+ "roughness": 1,485+ "opacity": 100,486+ "groupIds": [],487+ "strokeSharpness": "sharp",488+ "seed": 152899636,489+ "version": 105,490+ "versionNonce": 1333089972,491+ "isDeleted": false,492+ "boundElementIds": [],493+ "text": "NOT ME!",494+ "fontSize": 20,495+ "fontFamily": 1,496+ "textAlign": "left",497+ "verticalAlign": "top",498+ "baseline": 18499+ }500+ ],501+ "appState": {502+ "viewBackgroundColor": "#ffffff",503+ "gridSize": null504+ }505+}506+`,Ox=`+-------------------+ ^ .---.507+| ‗A Box‗ |__.--.__ __.--> | .-. | |508+| | '--' v | * |<--- | |509++-------------------+ '-' | |510+ \`Round\` *---(-. |511+ .-----------------. .-------. .----------. .-------. | | |512+ | Mixed Rounded | | | / Diagonals \\ | | | | | |513+ | & Square Corners | '--. .--' / \\ |---+---| '-)-' .--------.514+ '--+------------+-' .--. | '-------+--------' | | | | / Search /515+ | | | | '---. | '-------' | '-+------'516+ |<---------->| | | | v Interior | ^517+ ' <---' '----' .-----------. ---. .--- v |518+ .------------------. Diag line | .-------. +---. \\ / . |519+ | if (a > b) +---. .--->| | | | |\`Curved line\` \\ / / \\ |520+ | obj->fcn() | \\ / | '-------' |<--' + / \\ |521+ '------------------' '--' '--+--------' .--. .--. | .-. +Done?+-'522+ .---+-----. | ^ |\\ | | /| .--+ | | \\ /523+ | | | Join \\|/ | | \`Curved\` | \\| |/ | | \\ | \\ /524+ | | +----> o --o-- '-' Vertical '--' '--' '-- '--' + .---.525+ <--+---+-----' | /|\\ | | 3 |526+ v not:line 'quotes' .-' '---'527+ .-. .---+--------. / A || B ·bold· | ^528+ | | | Not a dot | <---+---<-- A dash--is not a line v |529+ '-' '---------+--' / Nor/is this. ---530+`,kx=`[Pirate|eyeCount: Int|raid();pillage()|531+ [beard]--[parrot]532+ [beard]-:>[foul mouth]533+]534+535+[<abstract>Marauder]<:--[Pirate]536+[Pirate]- 0..7[mischief]537+[jollyness]->[Pirate]538+[jollyness]->[rum]539+[jollyness]->[singing]540+[Pirate]-> *[rum|tastiness: Int|swig()]541+[Pirate]->[singing]542+[singing]<->[rum]543+`,Ax=`nwdiag {544+ network dmz {545+ address = "210.x.x.x/24"546+547+ web01 [address = "210.x.x.1"];548+ web02 [address = "210.x.x.2"];549+ }550+ network internal {551+ address = "172.x.x.x/24";552+553+ web01 [address = "172.x.x.1"];554+ web02 [address = "172.x.x.2"];555+ db01;556+ db02;557+ }558+}559+`,jx=`packetdiag {560+ colwidth = 32;561+ node_height = 72;562+563+ 0-15: Source Port;564+ 16-31: Destination Port;565+ 32-63: Sequence Number;566+ 64-95: Acknowledgment Number;567+ 96-99: Data Offset;568+ 100-105: Reserved;569+ 106: URG [rotate = 270];570+ 107: ACK [rotate = 270];571+ 108: PSH [rotate = 270];572+ 109: RST [rotate = 270];573+ 110: SYN [rotate = 270];574+ 111: FIN [rotate = 270];575+ 112-127: Window;576+ 128-143: Checksum;577+ 144-159: Urgent Pointer;578+ 160-191: (Options and Padding);579+ 192-223: data [colheight = 3];580+}581+`,Mx=`D: diamond "Cardinal" "Points"582+ dot ".n" above at D.n583+ dot " .e" ljust at D.e584+ dot ".s" below at D.s585+ dot ".w " rjust at D.w586+`,Nx=`rackdiag {587+ 16U;588+ 1: UPS [2U];589+ 3: DB Server;590+ 4: Web Server;591+ 5: Web Server;592+ 6: Web Server;593+ 7: Load Balancer;594+ 8: L3 Switch;595+}596+`,Px=` .-,( ),-.597+ ___ _ .-( )-.598+ [___]|=| -->( ) __________599+ /::/ |_| '-( ).-' --->[_...__... ]600+ '-.( ).-'601+ \\ ____ __602+ '--->| | |==|603+ |____| | |604+ /::::/ |__|605+`,Fx=`module demo_device #(606+ //# {{}}607+ parameter SIZE = 8,608+ parameter RESET_ACTIVE_LEVEL = 1609+) (610+ //# {{clocks|Clocking}}611+ input wire clock,612+ //# {{control|Control signals}}613+ input wire reset,614+ input wire enable,615+ //# {{data|Data ports}}616+ input wire [SIZE-1:0] data_in,617+ output wire [SIZE-1:0] data_out618+);619+ // ...620+endmodule`,Ix=`% From: https://tikz.net/periodic-table/621+622+% Adapted from https://texample.net/tikz/examples/periodic-table-of-chemical-elements.623+% All Credit to Ivan Griffin.624+625+\\documentclass[tikz,border=5mm]{standalone}626+\\usetikzlibrary{shapes,calc}627+628+\\begin{document}629+630+\\newcommand{\\ElemLabel}[4]{631+ \\begin{minipage}{2.2cm}632+ \\centering633+ {\\textbf{#1} \\hfill #2}%634+ \\linebreak \\linebreak635+ {\\textbf{#3}}%636+ \\linebreak \\linebreak637+ {{#4}}638+ \\end{minipage}639+}640+641+\\newcommand{\\NaturalElem}[4]{\\ElemLabel{#1}{#2}{\\huge {#3}}{#4}}642+643+\\newcommand{\\SyntheticElem}[4]{\\ElemLabel{#1}{#2}{\\color{gray}{\\huge #3}}{#4}}644+645+\\begin{tikzpicture}[font=\\sffamily]646+647+ % Fill Color Styles648+ \\tikzstyle{ElementFill} = [fill=yellow!15]649+ \\tikzstyle{AlkaliMetalFill} = [fill=blue!55]650+ \\tikzstyle{AlkalineEarthMetalFill} = [fill=blue!40]651+ \\tikzstyle{MetalFill} = [fill=blue!25]652+ \\tikzstyle{MetalloidFill} = [fill=orange!40]653+ \\tikzstyle{NonmetalFill} = [fill=teal!40]654+ \\tikzstyle{HalogenFill} = [fill=yellow!40]655+ \\tikzstyle{NobleGasFill} = [fill=green!55]656+ \\tikzstyle{LanthanideActinideFill} = [fill=red!40]657+658+ % Element Styles659+ \\tikzstyle{Element} = [ElementFill,660+ minimum width=2.5cm, minimum height=2.5cm, node distance=2.75cm]661+ \\tikzstyle{AlkaliMetal} = [Element, AlkaliMetalFill]662+ \\tikzstyle{AlkalineEarthMetal} = [Element, AlkalineEarthMetalFill]663+ \\tikzstyle{Metal} = [Element, MetalFill]664+ \\tikzstyle{Metalloid} = [Element, MetalloidFill]665+ \\tikzstyle{Nonmetal} = [Element, NonmetalFill]666+ \\tikzstyle{Halogen} = [Element, HalogenFill]667+ \\tikzstyle{NobleGas} = [Element, NobleGasFill]668+ \\tikzstyle{LanthanideActinide} = [Element, LanthanideActinideFill]669+ \\tikzstyle{PeriodLabel} = [font={\\sffamily\\LARGE}, node distance=2.0cm]670+ \\tikzstyle{GroupLabel} = [font={\\sffamily\\LARGE}, minimum width=2.75cm, node distance=2.0cm]671+672+ % Group 1 - IA673+ \\node[Element] (H) {\\NaturalElem{1} {1.0079}{H}{Hydrogen}};674+ \\node[below of=H, AlkaliMetal] (Li) {\\NaturalElem{3}{6.941}{Li}{Lithium}};675+ \\node[below of=Li, AlkaliMetal] (Na) {\\NaturalElem{11}{22.990}{Na}{Sodium}};676+ \\node[below of=Na, AlkaliMetal] (K) {\\NaturalElem{19}{39.098}{K}{Potassium}};677+ \\node[below of=K, AlkaliMetal] (Rb) {\\NaturalElem{37}{85.468}{Rb}{Rubidium}};678+ \\node[below of=Rb, AlkaliMetal] (Cs) {\\NaturalElem{55}{132.91}{Cs}{Caesium}};679+ \\node[below of=Cs, AlkaliMetal] (Fr) {\\NaturalElem{87}{223}{Fr}{Francium}};680+681+ % Group 2 - IIA682+ \\node[right of=Li, AlkalineEarthMetal] (Be) {\\NaturalElem{4}{9.0122}{Be}{Beryllium}};683+ \\node[below of=Be, AlkalineEarthMetal] (Mg) {\\NaturalElem{12}{24.305}{Mg}{Magnesium}};684+ \\node[below of=Mg, AlkalineEarthMetal] (Ca) {\\NaturalElem{20}{40.078}{Ca}{Calcium}};685+ \\node[below of=Ca, AlkalineEarthMetal] (Sr) {\\NaturalElem{38}{87.62}{Sr}{Strontium}};686+ \\node[below of=Sr, AlkalineEarthMetal] (Ba) {\\NaturalElem{56}{137.33}{Ba}{Barium}};687+ \\node[below of=Ba, AlkalineEarthMetal] (Ra) {\\NaturalElem{88}{226}{Ra}{Radium}};688+689+ % Group 3 - IIIB690+ \\node[right of=Ca, Metal] (Sc) {\\NaturalElem{21}{44.956}{Sc}{Scandium}};691+ \\node[below of=Sc, Metal] (Y) {\\NaturalElem{39}{88.906}{Y}{Yttrium}};692+ \\node[below of=Y, LanthanideActinide] (LaLu) {\\NaturalElem{57-71}{}{La-Lu}{Lanthanide}};693+ \\node[below of=LaLu, LanthanideActinide] (AcLr) {\\NaturalElem{89-103}{}{Ac-Lr}{Actinide}};694+695+ % Group 4 - IVB696+ \\node[right of=Sc, Metal] (Ti) {\\NaturalElem{22}{47.867}{Ti}{Titanium}};697+ \\node[below of=Ti, Metal] (Zr) {\\NaturalElem{40}{91.224}{Zr}{Zirconium}};698+ \\node[below of=Zr, Metal] (Hf) {\\NaturalElem{72}{178.49}{Hf}{Hafnium}};699+ \\node[below of=Hf, Metal] (Rf) {\\SyntheticElem{104}{261}{Rf}{Rutherfordium}};700+701+ % Group 5 - VB702+ \\node[right of=Ti, Metal] (V) {\\NaturalElem{23}{50.942}{V}{Vanadium}};703+ \\node[below of=V, Metal] (Nb) {\\NaturalElem{41}{92.906}{Nb}{Niobium}};704+ \\node[below of=Nb, Metal] (Ta) {\\NaturalElem{73}{180.95}{Ta}{Tantalum}};705+ \\node[below of=Ta, Metal] (Db) {\\SyntheticElem{105}{262}{Db}{Dubnium}};706+707+ % Group 6 - VIB708+ \\node[right of=V, Metal] (Cr) {\\NaturalElem{24}{51.996}{Cr}{Chromium}};709+ \\node[below of=Cr, Metal] (Mo) {\\NaturalElem{42}{95.94}{Mo}{Molybdenum}};710+ \\node[below of=Mo, Metal] (W) {\\NaturalElem{74}{183.84}{W}{Tungsten}};711+ \\node[below of=W, Metal] (Sg) {\\SyntheticElem{106}{266}{Sg}{Seaborgium}};712+713+ % Group 7 - VIIB714+ \\node[right of=Cr, Metal] (Mn) {\\NaturalElem{25}{54.938}{Mn}{Manganese}};715+ \\node[below of=Mn, Metal] (Tc) {\\NaturalElem{43}{96}{Tc}{Technetium}};716+ \\node[below of=Tc, Metal] (Re) {\\NaturalElem{75}{186.21}{Re}{Rhenium}};717+ \\node[below of=Re, Metal] (Bh) {\\SyntheticElem{107}{264}{Bh}{Bohrium}};718+719+ % Group 8 - VIIIB720+ \\node[right of=Mn, Metal] (Fe) {\\NaturalElem{26}{55.845}{Fe}{Iron}};721+ \\node[below of=Fe, Metal] (Ru) {\\NaturalElem{44}{101.07}{Ru}{Ruthenium}};722+ \\node[below of=Ru, Metal] (Os) {\\NaturalElem{76}{190.23}{Os}{Osmium}};723+ \\node[below of=Os, Metal] (Hs) {\\SyntheticElem{108}{277}{Hs}{Hassium}};724+725+ % Group 9 - VIIIB726+ \\node[right of=Fe, Metal] (Co) {\\NaturalElem{27}{58.933}{Co}{Cobalt}};727+ \\node[below of=Co, Metal] (Rh) {\\NaturalElem{45}{102.91}{Rh}{Rhodium}};728+ \\node[below of=Rh, Metal] (Ir) {\\NaturalElem{77}{192.22}{Ir}{Iridium}};729+ \\node[below of=Ir, Metal] (Mt) {\\SyntheticElem{109}{268}{Mt}{Meitnerium}};730+731+ % Group 10 - VIIIB732+ \\node[right of=Co, Metal] (Ni) {\\NaturalElem{28}{58.693}{Ni}{Nickel}};733+ \\node[below of=Ni, Metal] (Pd) {\\NaturalElem{46}{106.42}{Pd}{Palladium}};734+ \\node[below of=Pd, Metal] (Pt) {\\NaturalElem{78}{195.08}{Pt}{Platinum}};735+ \\node[below of=Pt, Metal] (Ds) {\\SyntheticElem{110}{281}{Ds}{Darmstadtium}};736+737+ % Group 11 - IB738+ \\node[right of=Ni, Metal] (Cu) {\\NaturalElem{29}{63.546}{Cu}{Copper}};739+ \\node[below of=Cu, Metal] (Ag) {\\NaturalElem{47}{107.87}{Ag}{Silver}};740+ \\node[below of=Ag, Metal] (Au) {\\NaturalElem{79}{196.97}{Au}{Gold}};741+ \\node[below of=Au, Metal] (Rg) {\\SyntheticElem{111}{280}{Rg}{Roentgenium}};742+743+ % Group 12 - IIB744+ \\node[right of=Cu, Metal] (Zn) {\\NaturalElem{30}{65.39}{Zn}{Zinc}};745+ \\node[below of=Zn, Metal] (Cd) {\\NaturalElem{48}{112.41}{Cd}{Cadmium}};746+ \\node[below of=Cd, Metal] (Hg) {\\NaturalElem{80}{200.59}{Hg}{Mercury}};747+ \\node[below of=Hg, Metal] (Uub) {\\SyntheticElem{112}{285}{Uub}{Ununbium}};748+749+ % Group 13 - IIIA750+ \\node[right of=Zn, Metal] (Ga) {\\NaturalElem{31}{69.723}{Ga}{Gallium}};751+ \\node[above of=Ga, Metal] (Al) {\\NaturalElem{13}{26.982}{Al}{Aluminium}};752+ \\node[above of=Al, Metalloid] (B) {\\NaturalElem{5}{10.811}{B}{Boron}};753+ \\node[below of=Ga, Metal] (In) {\\NaturalElem{49}{114.82}{In}{Indium}};754+ \\node[below of=In, Metal] (Tl) {\\NaturalElem{81}{204.38}{Tl}{Thallium}};755+ \\node[below of=Tl, Metal] (Uut) {\\SyntheticElem{113}{284}{Uut}{Ununtrium}};756+757+ % Group 14 - IVA758+ \\node[right of=B, Nonmetal] (C) {\\NaturalElem{6}{12.011}{C}{Carbon}};759+ \\node[below of=C, Metalloid] (Si) {\\NaturalElem{14}{28.086}{Si}{Silicon}};760+ \\node[below of=Si, Metalloid] (Ge) {\\NaturalElem{32}{72.64}{Ge}{Germanium}};761+ \\node[below of=Ge, Metal] (Sn) {\\NaturalElem{50}{118.71}{Sn}{Tin}};762+ \\node[below of=Sn, Metal] (Pb) {\\NaturalElem{82}{207.2}{Pb}{Lead}};763+ \\node[below of=Pb, Metal] (Uuq) {\\SyntheticElem{114}{289}{Uuq}{Ununquadium}};764+765+ % Group 15 - VA766+ \\node[right of=C, Nonmetal] (N) {\\NaturalElem{7}{14.007}{N}{Nitrogen}};767+ \\node[below of=N, Nonmetal] (P) {\\NaturalElem{15}{30.974}{P}{Phosphorus}};768+ \\node[below of=P, Metalloid] (As) {\\NaturalElem{33}{74.922}{As}{Arsenic}};769+ \\node[below of=As, Metalloid] (Sb) {\\NaturalElem{51}{121.76}{Sb}{Antimony}};770+ \\node[below of=Sb, Metal] (Bi) {\\NaturalElem{83}{208.98}{Bi}{Bismuth}};771+ \\node[below of=Bi, Metal] (Uup) {\\SyntheticElem{115}{288}{Uup}{Ununpentium}};772+773+ % Group 16 - VIA774+ \\node[right of=N, Nonmetal] (O) {\\NaturalElem{8}{15.999}{O}{Oxygen}};775+ \\node[below of=O, Nonmetal] (S) {\\NaturalElem{16}{32.065}{S}{Sulphur}};776+ \\node[below of=S, Nonmetal] (Se) {\\NaturalElem{34}{78.96}{Se}{Selenium}};777+ \\node[below of=Se, Metalloid] (Te) {\\NaturalElem{52}{127.6}{Te}{Tellurium}};778+ \\node[below of=Te, Metalloid] (Po) {\\NaturalElem{84}{209}{Po}{Polonium}};779+ \\node[below of=Po, Metal] (Uuh) {\\SyntheticElem{116}{293}{Uuh}{Ununhexium}};780+781+ % Group 17 - VIIA782+ \\node[right of=O, Halogen] (F) {\\NaturalElem{9}{18.998}{F}{Fluorine}};783+ \\node[below of=F, Halogen] (Cl) {\\NaturalElem{17}{35.453}{Cl}{Chlorine}};784+ \\node[below of=Cl, Halogen] (Br) {\\NaturalElem{35}{79.904}{Br}{Bromine}};785+ \\node[below of=Br, Halogen] (I) {\\NaturalElem{53}{126.9}{I}{Iodine}};786+ \\node[below of=I, Halogen] (At) {\\NaturalElem{85}{210}{At}{Astatine}};787+ \\node[below of=At, Element] (Uus) {\\SyntheticElem{117}{292}{Uus}{Ununseptium}};788+789+ % Group 18 - VIIIA790+ \\node[right of=F, NobleGas] (Ne) {\\NaturalElem{10}{20.180}{Ne}{Neon}};791+ \\node[above of=Ne, NobleGas] (He) {\\NaturalElem{2}{4.0025}{He}{Helium}};792+ \\node[below of=Ne, NobleGas] (Ar) {\\NaturalElem{18}{39.948}{Ar}{Argon}};793+ \\node[below of=Ar, NobleGas] (Kr) {\\NaturalElem{36}{83.8}{Kr}{Krypton}};794+ \\node[below of=Kr, NobleGas] (Xe) {\\NaturalElem{54}{131.29}{Xe}{Xenon}};795+ \\node[below of=Xe, NobleGas] (Rn) {\\NaturalElem{86}{222}{Rn}{Radon}};796+ \\node[below of=Rn, Nonmetal] (Uuo) {\\SyntheticElem{118}{294}{Uuo}{Ununoctium}};797+798+ % Period799+ \\node[left of=H, PeriodLabel] (Period1) {1};800+ \\node[left of=Li, PeriodLabel] (Period2) {2};801+ \\node[left of=Na, PeriodLabel] (Period3) {3};802+ \\node[left of=K, PeriodLabel] (Period4) {4};803+ \\node[left of=Rb, PeriodLabel] (Period5) {5};804+ \\node[left of=Cs, PeriodLabel] (Period6) {6};805+ \\node[left of=Fr, PeriodLabel] (Period7) {7};806+807+ % Group808+ \\node[above of=H, GroupLabel] (Group1) {1 \\hfill IA};809+ \\node[above of=Be, GroupLabel] (Group2) {2 \\hfill IIA};810+ \\node[above of=Sc, GroupLabel] (Group3) {3 \\hfill IIIA};811+ \\node[above of=Ti, GroupLabel] (Group4) {4 \\hfill IVB};812+ \\node[above of=V, GroupLabel] (Group5) {5 \\hfill VB};813+ \\node[above of=Cr, GroupLabel] (Group6) {6 \\hfill VIB};814+ \\node[above of=Mn, GroupLabel] (Group7) {7 \\hfill VIIB};815+ \\node[above of=Fe, GroupLabel] (Group8) {8 \\hfill VIIIB};816+ \\node[above of=Co, GroupLabel] (Group9) {9 \\hfill VIIIB};817+ \\node[above of=Ni, GroupLabel] (Group10) {10 \\hfill VIIIB};818+ \\node[above of=Cu, GroupLabel] (Group11) {11 \\hfill IB};819+ \\node[above of=Zn, GroupLabel] (Group12) {12 \\hfill IIB};820+ \\node[above of=B, GroupLabel] (Group13) {13 \\hfill IIIA};821+ \\node[above of=C, GroupLabel] (Group14) {14 \\hfill IVA};822+ \\node[above of=N, GroupLabel] (Group15) {15 \\hfill VA};823+ \\node[above of=O, GroupLabel] (Group16) {16 \\hfill VIA};824+ \\node[above of=F, GroupLabel] (Group17) {17 \\hfill VIIA};825+ \\node[above of=He, GroupLabel] (Group18) {18 \\hfill VIIIA};826+827+ % Lanthanide828+ \\node[below of=Rf, LanthanideActinide, yshift=-1cm] (La) {\\NaturalElem{57}{138.91}{La}{Lanthanum}};829+ \\node[right of=La, LanthanideActinide] (Ce) {\\NaturalElem{58}{140.12}{Ce}{Cerium}};830+ \\node[right of=Ce, LanthanideActinide] (Pr) {\\NaturalElem{59}{140.91}{Pr}{Praseodymium}};831+ \\node[right of=Pr, LanthanideActinide] (Nd) {\\NaturalElem{60}{144.24}{Nd}{Neodymium}};832+ \\node[right of=Nd, LanthanideActinide] (Pm) {\\NaturalElem{61}{145}{Pm}{Promethium}};833+ \\node[right of=Pm, LanthanideActinide] (Sm) {\\NaturalElem{62}{150.36}{Sm}{Samarium}};834+ \\node[right of=Sm, LanthanideActinide] (Eu) {\\NaturalElem{63}{151.96}{Eu}{Europium}};835+ \\node[right of=Eu, LanthanideActinide] (Gd) {\\NaturalElem{64}{157.25}{Gd}{Gadolinium}};836+ \\node[right of=Gd, LanthanideActinide] (Tb) {\\NaturalElem{65}{158.93}{Tb}{Terbium}};837+ \\node[right of=Tb, LanthanideActinide] (Dy) {\\NaturalElem{66}{162.50}{Dy}{Dysprosium}};838+ \\node[right of=Dy, LanthanideActinide] (Ho) {\\NaturalElem{67}{164.93}{Ho}{Holmium}};839+ \\node[right of=Ho, LanthanideActinide] (Er) {\\NaturalElem{68}{167.26}{Er}{Erbium}};840+ \\node[right of=Er, LanthanideActinide] (Tm) {\\NaturalElem{69}{168.93}{Tm}{Thulium}};841+ \\node[right of=Tm, LanthanideActinide] (Yb) {\\NaturalElem{70}{173.04}{Yb}{Ytterbium}};842+ \\node[right of=Yb, LanthanideActinide] (Lu) {\\NaturalElem{71}{174.97}{Lu}{Lutetium}};843+844+ % Actinide845+ \\node[below of=La, LanthanideActinide, yshift=-1cm] (Ac) {\\NaturalElem{89}{227}{Ac}{Actinium}};846+ \\node[right of=Ac, LanthanideActinide] (Th) {\\NaturalElem{90}{232.04}{Th}{Thorium}};847+ \\node[right of=Th, LanthanideActinide] (Pa) {\\NaturalElem{91}{231.04}{Pa}{Protactinium}};848+ \\node[right of=Pa, LanthanideActinide] (U) {\\NaturalElem{92}{238.03}{U}{Uranium}};849+ \\node[right of=U, LanthanideActinide] (Np) {\\SyntheticElem{93}{237}{Np}{Neptunium}};850+ \\node[right of=Np, LanthanideActinide] (Pu) {\\SyntheticElem{94}{244}{Pu}{Plutonium}};851+ \\node[right of=Pu, LanthanideActinide] (Am) {\\SyntheticElem{95}{243}{Am}{Americium}};852+ \\node[right of=Am, LanthanideActinide] (Cm) {\\SyntheticElem{96}{247}{Cm}{Curium}};853+ \\node[right of=Cm, LanthanideActinide] (Bk) {\\SyntheticElem{97}{247}{Bk}{Berkelium}};854+ \\node[right of=Bk, LanthanideActinide] (Cf) {\\SyntheticElem{98}{251}{Cf}{Californium}};855+ \\node[right of=Cf, LanthanideActinide] (Es) {\\SyntheticElem{99}{252}{Es}{Einsteinium}};856+ \\node[right of=Es, LanthanideActinide] (Fm) {\\SyntheticElem{100}{257}{Fm}{Fermium}};857+ \\node[right of=Fm, LanthanideActinide] (Md) {\\SyntheticElem{101}{258}{Md}{Mendelevium}};858+ \\node[right of=Md, LanthanideActinide] (No) {\\SyntheticElem{102}{259}{No}{Nobelium}};859+ \\node[right of=No, LanthanideActinide] (Lr) {\\SyntheticElem{103}{262}{Lr}{Lawrencium}};860+861+ % Draw dotted lines connecting Lanthanide breakout to main table862+ \\draw[thick,dotted] (LaLu.north west) -- (La.north west)863+ (LaLu.south west) -- (La.south west);864+ % Draw dotted lines connecting Actinide breakout to main table865+ \\draw[thick,dotted] (AcLr.north west) -- (Ac.north west)866+ (AcLr.south west) -- (Ac.south west);867+868+ % Legend869+ \\fill[AlkaliMetalFill] ($(La.north -| Fr.west) + (0,1em)$)870+ rectangle +(1em, 1em) node[right, yshift=-1.2ex] (AlkaliMetal) {Alkali Metal};871+ \\fill[AlkalineEarthMetalFill] ($(AlkaliMetal.west) - (1em,2em)$)872+ rectangle +(1em, 1em) node[right, yshift=-1.2ex] (AlkalineEarthMetal) {Alkaline Earth Metal};873+ \\fill[MetalFill] ($(AlkalineEarthMetal.west) - (1em,2em)$)874+ rectangle +(1em, 1em) node[right, yshift=-1.2ex] (Metal) {Metal};875+ \\fill[MetalloidFill] ($(Metal.west) - (1em,2em)$)876+ rectangle +(1em, 1em) node[right, yshift=-1.2ex] (Metalloid) {Metalloid};877+ \\fill[NonmetalFill] ($(Metalloid.west) - (1em,2em)$)878+ rectangle +(1em, 1em) node[right, yshift=-1.2ex] (Non-metal) {Non-metal};879+ \\fill[HalogenFill] ($(Non-metal.west) - (1em,2em)$)880+ rectangle +(1em, 1em) node[right, yshift=-1.2ex] (Halogen) {Halogen};881+ \\fill[NobleGasFill] ($(Halogen.west) - (1em,2em)$)882+ rectangle +(1em, 1em) node[right, yshift=-1.2ex] (NobleGas) {Noble Gas};883+ \\fill[LanthanideActinideFill] ($(NobleGas.west) - (1em,2em)$)884+ rectangle +(1em, 1em) node[right, yshift=-1.2ex] (Lanthanide/Actinide) {Lanthanide/Actinide};885+886+ \\node at (Ac -| Fr) [draw, Element, fill=white] (legend) {\\NaturalElem{Z}{mass}{\\LARGE Symbol}{Name}};887+ \\node[align=left] at (Ac -| Ra) {black: natural\\\\\\color{gray}gray: man-made};888+889+ % Diagram Title890+ \\node at (H.west -| Fe.north) [scale=2, font={\\sffamily\\Huge\\bfseries}]891+ {Periodic Table of Elements};892+893+\\end{tikzpicture}894+895+\\end{document}896+`,Lx=`<?xml version="1.0" encoding="UTF-8"?>897+<umlet_diagram>898+ <element>899+ <type>com.umlet.element.base.Relation</type>900+ <coordinates>901+ <x>739</x>902+ <y>16</y>903+ <w>232</w>904+ <h>264</h>905+ </coordinates>906+ <panel_attributes>lt=<-907+ when(spidersensor="rotate")908+ /block spider909+ </panel_attributes>910+ <additional_attributes>161;244;161;34;71;34;71;74</additional_attributes>911+ </element>912+ <element>913+ <type>com.umlet.element.custom.FinalState</type>914+ <coordinates>915+ <x>890</x>916+ <y>260</y>917+ <w>20</w>918+ <h>20</h>919+ </coordinates>920+ <panel_attributes></panel_attributes>921+ <additional_attributes>transparentSelection=false</additional_attributes>922+ </element>923+ <element>924+ <type>com.umlet.element.base.Relation</type>925+ <coordinates>926+ <x>750</x>927+ <y>170</y>928+ <w>160</w>929+ <h>137</h>930+ </coordinates>931+ <panel_attributes>lt=<-932+ after (10s)933+ / block spider934+ </panel_attributes>935+ <additional_attributes>140;100;66;100;66;20</additional_attributes>936+ </element>937+ <element>938+ <type>com.umlet.element.custom.State</type>939+ <coordinates>940+ <x>340</x>941+ <y>420</y>942+ <w>100</w>943+ <h>40</h>944+ </coordinates>945+ <panel_attributes>wait</panel_attributes>946+ <additional_attributes>transparentSelection=false</additional_attributes>947+ </element>948+ <element>949+ <type>com.umlet.element.custom.HistoryState</type>950+ <coordinates>951+ <x>230</x>952+ <y>440</y>953+ <w>20</w>954+ <h>20</h>955+ </coordinates>956+ <panel_attributes></panel_attributes>957+ <additional_attributes>transparentSelection=false</additional_attributes>958+ </element>959+ <element>960+ <type>com.umlet.element.base.Relation</type>961+ <coordinates>962+ <x>230</x>963+ <y>416</y>964+ <w>130</w>965+ <h>54</h>966+ </coordinates>967+ <panel_attributes>lt=<-968+ restart969+ </panel_attributes>970+ <additional_attributes>20;34;110;34</additional_attributes>971+ </element>972+ <element>973+ <type>com.umlet.element.base.Relation</type>974+ <coordinates>975+ <x>270</x>976+ <y>396</y>977+ <w>90</w>978+ <h>54</h>979+ </coordinates>980+ <panel_attributes>lt=<-981+ pause982+ </panel_attributes>983+ <additional_attributes>70;34;20;34</additional_attributes>984+ </element>985+ <element>986+ <type>com.umlet.element.custom.FinalState</type>987+ <coordinates>988+ <x>90</x>989+ <y>400</y>990+ <w>20</w>991+ <h>20</h>992+ </coordinates>993+ <panel_attributes></panel_attributes>994+ <additional_attributes>transparentSelection=false</additional_attributes>995+ </element>996+ <element>997+ <type>com.umlet.element.base.Relation</type>998+ <coordinates>999+ <x>46</x>1000+ <y>256</y>1001+ <w>114</w>1002+ <h>164</h>1003+ </coordinates>1004+ <panel_attributes>lt=<-1005+ after (10s)1006+ /timeout1007+ </panel_attributes>1008+ <additional_attributes>54;144;54;34;94;34</additional_attributes>1009+ </element>1010+ <element>1011+ <type>com.umlet.element.base.Relation</type>1012+ <coordinates>1013+ <x>230</x>1014+ <y>110</y>1015+ <w>190</w>1016+ <h>170</h>1017+ </coordinates>1018+ <panel_attributes>lt=<-1019+ timeout1020+ </panel_attributes>1021+ <additional_attributes>20;150;110;150;110;20;170;20</additional_attributes>1022+ </element>1023+ <element>1024+ <type>com.umlet.element.custom.State</type>1025+ <coordinates>1026+ <x>700</x>1027+ <y>90</y>1028+ <w>180</w>1029+ <h>100</h>1030+ </coordinates>1031+ <panel_attributes>accept1032+ boarding pass1033+ --1034+ entry/ release card1035+ do/release spider1036+ </panel_attributes>1037+ <additional_attributes>transparentSelection=true</additional_attributes>1038+ </element>1039+ <element>1040+ <type>com.umlet.element.base.Relation</type>1041+ <coordinates>1042+ <x>540</x>1043+ <y>140</y>1044+ <w>205</w>1045+ <h>100</h>1046+ </coordinates>1047+ <panel_attributes>lt=<-1048+ [passenger booked]1049+ </panel_attributes>1050+ <additional_attributes>160;20;120;80;20;80</additional_attributes>1051+ </element>1052+ <element>1053+ <type>com.umlet.element.base.Relation</type>1054+ <coordinates>1055+ <x>450</x>1056+ <y>210</y>1057+ <w>239</w>1058+ <h>190</h>1059+ </coordinates>1060+ <panel_attributes>lt=<-1061+ [passenger not booked]1062+ </panel_attributes>1063+ <additional_attributes>219;170;99;170;99;20</additional_attributes>1064+ </element>1065+ <element>1066+ <type>com.umlet.element.custom.State</type>1067+ <coordinates>1068+ <x>670</x>1069+ <y>350</y>1070+ <w>120</w>1071+ <h>50</h>1072+ </coordinates>1073+ <panel_attributes>reject1074+ boarding pass1075+ </panel_attributes>1076+ <additional_attributes>transparentSelection=false</additional_attributes>1077+ </element>1078+ <element>1079+ <type>com.umlet.element.base.Relation</type>1080+ <coordinates>1081+ <x>480</x>1082+ <y>130</y>1083+ <w>142</w>1084+ <h>100</h>1085+ </coordinates>1086+ <panel_attributes>lt=<-1087+ result of search1088+ </panel_attributes>1089+ <additional_attributes>71;80;71;20</additional_attributes>1090+ </element>1091+ <element>1092+ <type>com.umlet.element.base.Relation</type>1093+ <coordinates>1094+ <x>270</x>1095+ <y>70</y>1096+ <w>150</w>1097+ <h>40</h>1098+ </coordinates>1099+ <panel_attributes>lt=<-</panel_attributes>1100+ <additional_attributes>130;20;20;20</additional_attributes>1101+ </element>1102+ <element>1103+ <type>com.umlet.element.custom.ThreeWayRelation</type>1104+ <coordinates>1105+ <x>540</x>1106+ <y>210</y>1107+ <w>20</w>1108+ <h>20</h>1109+ </coordinates>1110+ <panel_attributes></panel_attributes>1111+ <additional_attributes>transparentSelection=false</additional_attributes>1112+ </element>1113+ <element>1114+ <type>com.umlet.element.custom.State</type>1115+ <coordinates>1116+ <x>140</x>1117+ <y>60</y>1118+ <w>150</w>1119+ <h>420</h>1120+ </coordinates>1121+ <panel_attributes>read boarding pass1122+ --1123+ </panel_attributes>1124+ <additional_attributes>transparentSelection=true</additional_attributes>1125+ </element>1126+ <element>1127+ <type>com.umlet.element.custom.State</type>1128+ <coordinates>1129+ <x>400</x>1130+ <y>60</y>1131+ <w>180</w>1132+ <h>90</h>1133+ </coordinates>1134+ <panel_attributes>check passenger1135+ --1136+ entry/start search1137+ do/blink lamp1138+ </panel_attributes>1139+ <additional_attributes>transparentSelection=true</additional_attributes>1140+ </element>1141+ <element>1142+ <type>com.umlet.element.custom.FinalState</type>1143+ <coordinates>1144+ <x>170</x>1145+ <y>410</y>1146+ <w>20</w>1147+ <h>20</h>1148+ </coordinates>1149+ <panel_attributes></panel_attributes>1150+ <additional_attributes>transparentSelection=false</additional_attributes>1151+ </element>1152+ <element>1153+ <type>com.umlet.element.custom.State</type>1154+ <coordinates>1155+ <x>150</x>1156+ <y>240</y>1157+ <w>100</w>1158+ <h>40</h>1159+ </coordinates>1160+ <panel_attributes>read1161+ passenger ID1162+ </panel_attributes>1163+ <additional_attributes>transparentSelection=false</additional_attributes>1164+ </element>1165+ <element>1166+ <type>com.umlet.element.custom.State</type>1167+ <coordinates>1168+ <x>150</x>1169+ <y>330</y>1170+ <w>100</w>1171+ <h>40</h>1172+ </coordinates>1173+ <panel_attributes>identify1174+ passenger1175+ </panel_attributes>1176+ <additional_attributes>transparentSelection=false</additional_attributes>1177+ </element>1178+ <element>1179+ <type>com.umlet.element.base.Relation</type>1180+ <coordinates>1181+ <x>160</x>1182+ <y>260</y>1183+ <w>40</w>1184+ <h>90</h>1185+ </coordinates>1186+ <panel_attributes>lt=<-</panel_attributes>1187+ <additional_attributes>20;70;20;20</additional_attributes>1188+ </element>1189+ <element>1190+ <type>com.umlet.element.base.Relation</type>1191+ <coordinates>1192+ <x>160</x>1193+ <y>100</y>1194+ <w>40</w>1195+ <h>70</h>1196+ </coordinates>1197+ <panel_attributes>lt=<-</panel_attributes>1198+ <additional_attributes>20;50;20;20</additional_attributes>1199+ </element>1200+ <element>1201+ <type>com.umlet.element.base.Relation</type>1202+ <coordinates>1203+ <x>160</x>1204+ <y>350</y>1205+ <w>40</w>1206+ <h>80</h>1207+ </coordinates>1208+ <panel_attributes>lt=<-</panel_attributes>1209+ <additional_attributes>20;60;20;20</additional_attributes>1210+ </element>1211+ <element>1212+ <type>com.umlet.element.base.Relation</type>1213+ <coordinates>1214+ <x>140</x>1215+ <y>170</y>1216+ <w>78</w>1217+ <h>90</h>1218+ </coordinates>1219+ <panel_attributes>lt=<-1220+ [valid]1221+ </panel_attributes>1222+ <additional_attributes>39;70;39;20</additional_attributes>1223+ </element>1224+ <element>1225+ <type>com.umlet.element.custom.State</type>1226+ <coordinates>1227+ <x>150</x>1228+ <y>150</y>1229+ <w>100</w>1230+ <h>40</h>1231+ </coordinates>1232+ <panel_attributes>check1233+ validity1234+ </panel_attributes>1235+ <additional_attributes>transparentSelection=false</additional_attributes>1236+ </element>1237+ <element>1238+ <type>com.umlet.element.custom.InitialState</type>1239+ <coordinates>1240+ <x>170</x>1241+ <y>100</y>1242+ <w>20</w>1243+ <h>20</h>1244+ </coordinates>1245+ <panel_attributes></panel_attributes>1246+ <additional_attributes>transparentSelection=false</additional_attributes>1247+ </element>1248+</umlet_diagram>1249+`,Rx=`{1250+ "$schema": "https://vega.github.io/schema/vega/v5.json",1251+ "width": 400,1252+ "height": 200,1253+ "padding": 5,1254+1255+ "data": [1256+ {1257+ "name": "table",1258+ "values": [1259+ {"category": "A", "amount": 28},1260+ {"category": "B", "amount": 55},1261+ {"category": "C", "amount": 43},1262+ {"category": "D", "amount": 91},1263+ {"category": "E", "amount": 81},1264+ {"category": "F", "amount": 53},1265+ {"category": "G", "amount": 19},1266+ {"category": "H", "amount": 87}1267+ ]1268+ }1269+ ],1270+1271+ "signals": [1272+ {1273+ "name": "tooltip",1274+ "value": {},1275+ "on": [1276+ {"events": "rect:mouseover", "update": "datum"},1277+ {"events": "rect:mouseout", "update": "{}"}1278+ ]1279+ }1280+ ],1281+1282+ "scales": [1283+ {1284+ "name": "xscale",1285+ "type": "band",1286+ "domain": {"data": "table", "field": "category"},1287+ "range": "width",1288+ "padding": 0.05,1289+ "round": true1290+ },1291+ {1292+ "name": "yscale",1293+ "domain": {"data": "table", "field": "amount"},1294+ "nice": true,1295+ "range": "height"1296+ }1297+ ],1298+1299+ "axes": [1300+ { "orient": "bottom", "scale": "xscale" },1301+ { "orient": "left", "scale": "yscale" }1302+ ],1303+1304+ "marks": [1305+ {1306+ "type": "rect",1307+ "from": {"data":"table"},1308+ "encode": {1309+ "enter": {1310+ "x": {"scale": "xscale", "field": "category"},1311+ "width": {"scale": "xscale", "band": 1},1312+ "y": {"scale": "yscale", "field": "amount"},1313+ "y2": {"scale": "yscale", "value": 0}1314+ },1315+ "update": {1316+ "fill": {"value": "steelblue"}1317+ },1318+ "hover": {1319+ "fill": {"value": "red"}1320+ }1321+ }1322+ },1323+ {1324+ "type": "text",1325+ "encode": {1326+ "enter": {1327+ "align": {"value": "center"},1328+ "baseline": {"value": "bottom"},1329+ "fill": {"value": "#333"}1330+ },1331+ "update": {1332+ "x": {"scale": "xscale", "signal": "tooltip.category", "band": 0.5},1333+ "y": {"scale": "yscale", "signal": "tooltip.amount", "offset": -2},1334+ "text": {"signal": "tooltip.amount"},1335+ "fillOpacity": [1336+ {"test": "datum === tooltip", "value": 0},1337+ {"value": 1}1338+ ]1339+ }1340+ }1341+ }1342+ ]1343+}1344+`,zx=`{1345+ "$schema": "https://vega.github.io/schema/vega-lite/v4.json",1346+ "description": "Horizontally concatenated charts that show different types of discretizing scales.",1347+ "data": {1348+ "values": [1349+ {"a": "A", "b": 28},1350+ {"a": "B", "b": 55},1351+ {"a": "C", "b": 43},1352+ {"a": "D", "b": 91},1353+ {"a": "E", "b": 81},1354+ {"a": "F", "b": 53},1355+ {"a": "G", "b": 19},1356+ {"a": "H", "b": 87},1357+ {"a": "I", "b": 52}1358+ ]1359+ },1360+ "hconcat": [1361+ {1362+ "mark": "circle",1363+ "encoding": {1364+ "y": {1365+ "field": "b",1366+ "type": "nominal",1367+ "sort": null,1368+ "axis": {1369+ "ticks": false,1370+ "domain": false,1371+ "title": null1372+ }1373+ },1374+ "size": {1375+ "field": "b",1376+ "type": "quantitative",1377+ "scale": {1378+ "type": "quantize"1379+ }1380+ },1381+ "color": {1382+ "field": "b",1383+ "type": "quantitative",1384+ "scale": {1385+ "type": "quantize",1386+ "zero": true1387+ },1388+ "legend": {1389+ "title": "Quantize"1390+ }1391+ }1392+ }1393+ },1394+ {1395+ "mark": "circle",1396+ "encoding": {1397+ "y": {1398+ "field": "b",1399+ "type": "nominal",1400+ "sort": null,1401+ "axis": {1402+ "ticks": false,1403+ "domain": false,1404+ "title": null1405+ }1406+ },1407+ "size": {1408+ "field": "b",1409+ "type": "quantitative",1410+ "scale": {1411+ "type": "quantile",1412+ "range": [80, 160, 240, 320, 400]1413+ }1414+ },1415+ "color": {1416+ "field": "b",1417+ "type": "quantitative",1418+ "scale": {1419+ "type": "quantile",1420+ "scheme": "magma"1421+ },1422+ "legend": {1423+ "format": "d",1424+ "title": "Quantile"1425+ }1426+ }1427+ }1428+ },1429+ {1430+ "mark": "circle",1431+ "encoding": {1432+ "y": {1433+ "field": "b",1434+ "type": "nominal",1435+ "sort": null,1436+ "axis": {1437+ "ticks": false,1438+ "domain": false,1439+ "title": null1440+ }1441+ },1442+ "size": {1443+ "field": "b",1444+ "type": "quantitative",1445+ "scale": {1446+ "type": "threshold",1447+ "domain": [30, 70],1448+ "range": [80, 200, 320]1449+ }1450+ },1451+ "color": {1452+ "field": "b",1453+ "type": "quantitative",1454+ "scale": {1455+ "type": "threshold",1456+ "domain": [30, 70],1457+ "scheme": "viridis"1458+ },1459+ "legend": {1460+ "title": "Threshold"1461+ }1462+ }1463+ }1464+ }1465+ ],1466+ "resolve": {1467+ "scale": {1468+ "color": "independent",1469+ "size": "independent"1470+ }1471+ }1472+}1473+`,Bx=`{ signal: [1474+ { name: "clk", wave: "p.....|..." },1475+ { name: "Data", wave: "x.345x|=.x", data: ["head", "body", "tail", "data"] },1476+ { name: "Request", wave: "0.1..0|1.0" },1477+ {},1478+ { name: "Acknowledge", wave: "1.....|01." }1479+]}1480+`,Vx=`connectors:1481+ X1:1482+ type: D-Sub1483+ subtype: female1484+ pinlabels: [DCD, RX, TX, DTR, GND, DSR, RTS, CTS, RI]1485+ X2:1486+ type: Molex KK 2541487+ subtype: female1488+ pinlabels: [GND, RX, TX]1489+1490+cables:1491+ W1:1492+ gauge: 0.25 mm21493+ length: 0.21494+ color_code: DIN1495+ wirecount: 31496+ shield: true1497+1498+connections:1499+ -1500+ - X1: [5,2,3]1501+ - W1: [1,2,3]1502+ - X2: [1,3,2]1503+ -1504+ - X1: 51505+ - W1: s1506+`;function Hx(e){return e^e>>1}function Ux(e,t){let n=Hx(e);return{meta:{title:n&1?t.title:``,description:n&2?t.description:``},presentation:{background:n&4?`#f4f4f4`:``,padding:n&8?24:0,frame:!!(n&16)}}}var Wx=4,Gx=0,Kx=1,qx=2;function Jx(e){let t=e.length;for(;--t>=0;)e[t]=0}var Yx=29,Xx=256,Zx=286,Qx=30,$x=19,eS=573,tS=15,nS=16,rS=256,iS=16,aS=17,oS=18,sS=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),cS=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]);new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]);var lS=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),uS=512,dS=Array(576);Jx(dS);var fS=Array(Qx*2);Jx(fS);var pS=Array(uS);Jx(pS);var mS=Array(256);Jx(mS);var hS=Array(Yx);Jx(hS);var gS=Array(Qx);Jx(gS);var _S=e=>e<256?pS[e]:pS[256+(e>>>7)],vS=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},yS=(e,t,n)=>{e.bi_valid>nS-n?(e.bi_buf|=t<<e.bi_valid&65535,vS(e,e.bi_buf),e.bi_buf=t>>nS-e.bi_valid,e.bi_valid+=n-nS):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},bS=(e,t,n)=>{yS(e,n[t*2],n[t*2+1])},xS=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},SS=(e,t)=>{let n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,l,u,d,f,p,m,h=0;for(f=0;f<=tS;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<eS;l++)u=e.heap[l],f=n[n[u*2+1]*2+1]+1,f>c&&(f=c,h++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,p=0,u>=s&&(p=o[u-s]),m=n[u*2],e.opt_len+=m*(f+p),a&&(e.static_len+=m*(i[u*2+1]+p)));if(h!==0){do{for(f=c-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,h-=2}while(h>0);for(f=c;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--l],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}},CS=(e,t,n)=>{let r=Array(16),i=0,a,o;for(a=1;a<=tS;a++)i=i+n[a-1]<<1,r[a]=i;for(o=0;o<=t;o++){let t=e[o*2+1];t!==0&&(e[o*2]=xS(r[t]++,t))}},wS=e=>{let t;for(t=0;t<Zx;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Qx;t++)e.dyn_dtree[t*2]=0;for(t=0;t<$x;t++)e.bl_tree[t*2]=0;e.dyn_ltree[rS*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},TS=e=>{e.bi_valid>8?vS(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},ES=(e,t,n,r)=>{let i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]},DS=(e,t,n)=>{let r=e.heap[n],i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&ES(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!ES(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},OS=(e,t,n)=>{let r,i,a=0,o,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+a++]&255,r+=(e.pending_buf[e.sym_buf+a++]&255)<<8,i=e.pending_buf[e.sym_buf+a++],r===0?bS(e,i,t):(o=mS[i],bS(e,o+Xx+1,t),s=sS[o],s!==0&&(i-=hS[o],yS(e,i,s)),r--,o=_S(r),bS(e,o,n),s=cS[o],s!==0&&(r-=gS[o],yS(e,r,s)));while(a<e.sym_next);bS(e,rS,t)},kS=(e,t)=>{let n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,c=-1,l;for(e.heap_len=0,e.heap_max=eS,o=0;o<a;o++)n[o*2]===0?n[o*2+1]=0:(e.heap[++e.heap_len]=c=o,e.depth[o]=0);for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)DS(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],DS(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,DS(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],SS(e,t),CS(n,c,e.bl_count)},AS=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a===0?s<=10?e.bl_tree[34]++:e.bl_tree[36]++:(a!==i&&e.bl_tree[a*2]++,e.bl_tree[32]++),s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))},jS=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do bS(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(bS(e,aS,e.bl_tree),yS(e,s-3,3)):(bS(e,oS,e.bl_tree),yS(e,s-11,7)):(a!==i&&(bS(e,a,e.bl_tree),s--),bS(e,iS,e.bl_tree),yS(e,s-3,2));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}},MS=e=>{let t;for(AS(e,e.dyn_ltree,e.l_desc.max_code),AS(e,e.dyn_dtree,e.d_desc.max_code),kS(e,e.bl_desc),t=18;t>=3&&e.bl_tree[lS[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},NS=(e,t,n,r)=>{let i;for(yS(e,t-257,5),yS(e,n-1,5),yS(e,r-4,4),i=0;i<r;i++)yS(e,e.bl_tree[lS[i]*2+1],3);jS(e,e.dyn_ltree,t-1),jS(e,e.dyn_dtree,n-1)},PS=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return Gx;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return Kx;for(n=32;n<Xx;n++)if(e.dyn_ltree[n*2]!==0)return Kx;return Gx},FS=(e,t,n,r)=>{yS(e,0+ +!!r,3),TS(e),vS(e,n),vS(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},IS=(e,t,n,r)=>{let i,a,o=0;e.level>0?(e.strm.data_type===qx&&(e.strm.data_type=PS(e)),kS(e,e.l_desc),kS(e,e.d_desc),o=MS(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?FS(e,t,n,r):e.strategy===Wx||a===i?(yS(e,2+ +!!r,3),OS(e,dS,fS)):(yS(e,4+ +!!r,3),NS(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),OS(e,e.dyn_ltree,e.dyn_dtree)),wS(e),r&&TS(e)},LS=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(mS[n]+Xx+1)*2]++,e.dyn_dtree[_S(t)*2]++),e.sym_next===e.sym_end),RS=(e,t,n,r)=>{let i=e&65535|0,a=e>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0},zS=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t})()),BS=(e,t,n,r)=>{let i=zS,a=r+n;e^=-1;for(let n=r;n<a;n++)e=e>>>8^i[(e^t[n])&255];return e^-1},Z=3,VS=258,HS=262,US=1,WS=2,GS=3,KS=4,qS=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)},JS=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,YS=(e,t)=>{let n;if(e.legacy_hash)n=e.ins_h=JS(e,e.ins_h,e.window[t+Z-1]);else{let r=e.window,i=r[t]|r[t+1]<<8|r[t+2]<<16|r[t+3]<<24;n=e.ins_h=Math.imul(i,66521)+66521>>>16&e.hash_mask}let r=e.prev[t&e.w_mask]=e.head[n];return e.head[n]=t,r},XS=e=>{let t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},ZS=(e,t)=>{IS(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,XS(e.strm)},QS=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=RS(e.adler,t,i,n):e.state.wrap===2&&(e.adler=BS(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},$S=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-HS?e.strstart-(e.w_size-HS):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+VS,p=l[r+o-1],m=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,l[i+o]===m&&l[i+o-1]===p&&l[i]===l[r]&&l[++i]===l[r+1]){r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<f);if(a=VS-(f-r),r=f-VS,a>o){if(e.match_start=t,o=a,a>=s)break;p=l[r+o-1],m=l[r+o]}}while((t=d[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead},eC=e=>{let t=e.w_size,n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-HS)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),qS(e),r+=t),e.strm.avail_in===0)break;if(n=QS(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,!e.legacy_hash){if(e.lookahead+e.insert>Z)for(i=e.strstart-e.insert;e.insert&&(YS(e,i),i++,e.insert--,!(e.lookahead+e.insert<=Z)););}else if(e.lookahead+e.insert>=Z)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=JS(e,e.ins_h,e.window[i+1]);e.insert&&(YS(e,i),i++,e.insert--,!(e.lookahead+e.insert<Z)););}while(e.lookahead<HS&&e.strm.avail_in!==0)},tC=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,a,o=0,s=e.strm.avail_in;do{if(r=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a||(a=e.strm.avail_out-a,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>a&&(r=a),r<n&&(r===0&&t!==4||t===0||r!==i+e.strm.avail_in)))break;o=+(t===4&&r===i+e.strm.avail_in),FS(e,0,0,o),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,XS(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(QS(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(o===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?KS:t!==0&&t!==4&&e.strm.avail_in===0&&e.strstart===e.block_start?WS:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(QS(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,n=a>e.w_size?e.w_size:a,i=e.strstart-e.block_start,(i>=n||(i||t===4)&&t!==0&&e.strm.avail_in===0&&i<=a)&&(r=i>a?a:i,o=+(t===4&&e.strm.avail_in===0&&r===i),FS(e,e.block_start,r,o),e.block_start+=r,XS(e.strm)),o?GS:US)},nC=(e,t)=>{let n,r;for(;;){if(e.lookahead<HS){if(eC(e),e.lookahead<HS&&t===0)return US;if(e.lookahead===0)break}if(n=0,e.lookahead>=Z&&(n=YS(e,e.strstart)),n!==0&&e.strstart-n<=e.w_size-HS&&(e.match_length=$S(e,n)),e.match_length>=Z){if(r=LS(e,e.strstart-e.match_start,e.match_length-Z),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Z){e.match_length--;do e.strstart++,n=YS(e,e.strstart);while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.legacy_hash&&(e.ins_h=e.window[e.strstart],e.ins_h=JS(e,e.ins_h,e.window[e.strstart+1]))}else r=LS(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(ZS(e,!1),e.strm.avail_out===0))return US}return e.insert=e.strstart<Z-1?e.strstart:Z-1,t===4?(ZS(e,!0),e.strm.avail_out===0?GS:KS):e.sym_next&&(ZS(e,!1),e.strm.avail_out===0)?US:WS},rC=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<HS){if(eC(e),e.lookahead<HS&&t===0)return US;if(e.lookahead===0)break}if(n=0,e.lookahead>=Z&&(n=YS(e,e.strstart)),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=Z-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-HS&&(e.match_length=$S(e,n),e.match_length<=5&&(e.strategy===1||e.match_length===Z&&e.strstart-e.match_start>4096)&&(e.match_length=Z-1)),e.prev_length>=Z&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-Z,r=LS(e,e.strstart-1-e.prev_match,e.prev_length-Z),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(n=YS(e,e.strstart));while(--e.prev_length!==0);if(e.match_available=0,e.match_length=Z-1,e.strstart++,r&&(ZS(e,!1),e.strm.avail_out===0))return US}else if(e.match_available){if(r=LS(e,0,e.window[e.strstart-1]),r&&ZS(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return US}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(r=LS(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<Z-1?e.strstart:Z-1,t===4?(ZS(e,!0),e.strm.avail_out===0?GS:KS):e.sym_next&&(ZS(e,!1),e.strm.avail_out===0)?US:WS},iC=class{constructor(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}};new iC(0,0,0,0,tC),new iC(4,4,8,4,nC),new iC(4,5,16,8,nC),new iC(4,6,32,32,nC),new iC(4,4,16,16,rC),new iC(8,16,32,32,rC),new iC(8,16,128,128,rC),new iC(8,32,128,256,rC),new iC(32,128,258,1024,rC),new iC(32,258,258,4096,rC),new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,199,75]),new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var aC=`plantuml`,oC=`@startuml1507+skinparam monochrome true1508+skinparam shadowing false1509+1510+actor Alice1511+participant "Alice Agent" as AliceAgent1512+participant "Tandem App" as Tandem1513+participant "Bob Agent" as BobAgent1514+actor Bob1515+1516+Alice -> AliceAgent: Describe a shared to-do app1517+AliceAgent -> Tandem: Draft the task flow1518+Bob -> BobAgent: Build and test the API1519+BobAgent -> Tandem: Ship task sync1520+Alice -> Tandem: Add "Buy paint"1521+Tandem -> Bob: Share the new task1522+Bob -> Tandem: Mark it done1523+Tandem --> Alice: Everyone is in sync1524+@enduml`;new TextEncoder,new TextDecoder;function sC(e={}){if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`Invalid diagram metadata.`);let t=e.title??``,n=e.description??``;if(typeof t!=`string`||typeof n!=`string`)throw Error(`Invalid diagram metadata.`);return{title:t,description:n}}function cC(e={}){if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`Invalid diagram presentation.`);let t=e.background??``,n=e.padding??0,r=e.frame??!1;if(typeof t!=`string`||t&&!/^#[0-9a-f]{6}$/i.test(t)||!Number.isInteger(n)||n<0||n>256||typeof r!=`boolean`)throw Error(`Invalid diagram presentation.`);return{background:t,padding:n,frame:r}}var lC={plantuml:oC,mermaid:`flowchart LR1525+ Alice([Alice]) -->|describes the shared list| AliceAgent["Alice Agent"]1526+ AliceAgent -->|drafts the experience| Tandem["Tandem App"]1527+ Bob([Bob]) -->|reviews the plan| BobAgent["Bob Agent"]1528+ BobAgent -->|builds and tests the API| Tandem1529+ Tandem -->|keeps tasks in sync| Alice1530+ Tandem -->|keeps tasks in sync| Bob`,graphviz:`digraph Tandem {1531+ rankdir=LR1532+ node [shape=box, style="rounded,filled", fillcolor="#eef2ff"]1533+ Alice [shape=oval, fillcolor="#fef3c7"]1534+ Bob [shape=oval, fillcolor="#dcfce7"]1535+ AliceAgent [label="Alice Agent"]1536+ BobAgent [label="Bob Agent"]1537+ Tandem [label="Tandem App", fillcolor="#ddd6fe"]1538+ Alice -> AliceAgent [label="shares an idea"]1539+ AliceAgent -> Tandem [label="proposes the flow"]1540+ Bob -> BobAgent [label="asks for an API"]1541+ BobAgent -> Tandem [label="ships + tests"]1542+ Tandem -> { Alice Bob } [label="syncs tasks"]1543+}`,c4plantuml:`@startuml1544+!include <C4/C4_Context>1545+1546+Person(alice, "Alice", "Plans the product and creates shared tasks")1547+Person(bob, "Bob", "Builds the app and completes shared tasks")1548+System(aliceAgent, "Alice Agent", "Turns Alice's ideas into product flows")1549+System(bobAgent, "Bob Agent", "Implements and tests Bob's changes")1550+System(tandem, "Tandem App", "A tiny shared to-do list")1551+1552+Rel(alice, aliceAgent, "Explains what friends need")1553+Rel(aliceAgent, tandem, "Proposes task flows")1554+Rel(bob, bobAgent, "Requests implementation help")1555+Rel(bobAgent, tandem, "Builds and verifies")1556+Rel(alice, tandem, "Creates tasks")1557+Rel(bob, tandem, "Completes tasks")1558+@enduml`,blockdiag:`blockdiag {1559+ orientation = portrait1560+ Alice -> "Alice Agent" -> "Tandem App";1561+ Bob -> "Bob Agent" -> "Tandem App";1562+ "Tandem App" -> "Shared task list";1563+1564+ Alice [color = "#fde68a"];1565+ Bob [color = "#bbf7d0"];1566+ "Alice Agent" [color = "#bfdbfe"];1567+ "Bob Agent" [color = "#bfdbfe"];1568+ "Tandem App" [color = "#ddd6fe"];1569+ "Shared task list" [color = "#fecdd3"];1570+}`,seqdiag:`seqdiag {1571+ Alice; "Alice Agent"; "Tandem App"; "Bob Agent"; Bob;1572+ Alice -> "Alice Agent" [label = "Sketch our shared errands"];1573+ "Alice Agent" -> "Tandem App" [label = "Create task: Buy paint"];1574+ "Tandem App" -> "Bob Agent" [label = "Task assigned to Bob"];1575+ "Bob Agent" -> Bob [label = "Offer a reminder"];1576+ Bob -> "Tandem App" [label = "Mark task complete"];1577+ "Tandem App" -> Alice [label = "List synced"];1578+}`,actdiag:`actdiag {1579+ describe -> shape -> implement -> verify -> share1580+1581+ lane Alice {1582+ label = "Alice"1583+ describe [label = "Describe shared tasks"];1584+ share [label = "Try Tandem with Bob"];1585+ }1586+ lane "Alice Agent" {1587+ shape [label = "Shape the task flow"];1588+ }1589+ lane "Bob Agent" {1590+ implement [label = "Build Tandem"];1591+ verify [label = "Test task sync"];1592+ }1593+}`,structurizr:`workspace "Tandem" "Alice and Bob build a shared to-do app with their agents" {1594+ model {1595+ alice = person "Alice" "Plans Tandem and creates tasks"1596+ bob = person "Bob" "Builds Tandem and completes tasks"1597+ aliceAgent = softwareSystem "Alice Agent" "Shapes Alice's ideas into product flows"1598+ bobAgent = softwareSystem "Bob Agent" "Implements and tests Bob's changes"1599+ tandem = softwareSystem "Tandem App" "Keeps Alice and Bob's tasks in sync"1600+1601+ alice -> aliceAgent "Describes the experience"1602+ aliceAgent -> tandem "Proposes task flows"1603+ bob -> bobAgent "Requests implementation help"1604+ bobAgent -> tandem "Builds and tests"1605+ alice -> tandem "Creates tasks"1606+ bob -> tandem "Completes tasks"1607+ }1608+ views {1609+ systemLandscape "TandemLandscape" {1610+ include *1611+ autolayout lr1612+ }1613+ theme default1614+ }1615+}`,ditaa:`+-------------+ +-------------+1616+| | | |1617+| Alice | | Bob |1618+| | | |1619++------+------+ +------+------+1620+ | product idea | implementation1621+ v v1622++------+------+ +------+------+1623+| | | |1624+| Alice Agent | | Bob Agent |1625+| | | |1626++------+------+ +------+------+1627+ | task flow | tested build1628+ | |1629+ +------------------+ +--------------+1630+ | |1631+ v v1632+ +------+---+------+1633+ | |1634+ | Tandem App |1635+ | |1636+ +--------+--------+1637+ |1638+ | persist and sync1639+ v1640+ +--------+--------+1641+ | Shared Tasks |1642+ | {s} |1643+ +-----------------+`,d2:Cx,nwdiag:Ax,packetdiag:jx,rackdiag:Nx,bpmn:xx.replaceAll(`Examine Situation`,`Bob Agent tests Tandem`).replaceAll(`Things OK?`,`Tests pass?`).replaceAll(`Notification Sent`,`Alice and Bob share tasks`).replaceAll(`Error Propagated`,`Alice Agent revises flow`).replaceAll(`Klaus`,`Alice`).replaceAll(`Walter`,`Bob`),bytefield:Sx,dbml:wx,diagramsnet:Tx,erd:Ex,excalidraw:Dx,goat:Ox,nomnoml:kx,pikchr:Mx,svgbob:Px,symbolator:Fx,tikz:Ix,umlet:Lx,vega:Rx,vegalite:zx,wavedrom:Bx,wireviz:Vx},uC={plantuml:[`Tandem task sync`,`Alice and Bob coordinate shared tasks through their agents.`],mermaid:[`Shared task flow`,`A compact view of ideas moving through the Tandem team.`],graphviz:[`Tandem collaboration graph`,`People and agents converge on one synchronized task list.`],d2:[`Connection styles`,`D2 connection, arrowhead, shape, and animation syntax.`],c4plantuml:[`Tandem system context`,`The people and software systems surrounding Tandem.`],blockdiag:[`Tandem block flow`,`A block-oriented view of the shared task workflow.`],seqdiag:[`Tandem task sequence`,`A task moves from Alice to Bob and back through Tandem.`],actdiag:[`Tandem delivery activities`,`Work crosses Alice, Alice Agent, and Bob Agent lanes.`],nwdiag:[`Network layout`,`A sample network topology and its connected address ranges.`],packetdiag:[`TCP packet structure`,`The bit-level layout of a TCP packet header.`],rackdiag:[`Rack layout`,`A sample equipment rack rendered from rackdiag syntax.`],bpmn:[`Agent-assisted review`,`A BPMN review flow that branches on test results.`],bytefield:[`Byte field layout`,`A compact byte-oriented protocol field example.`],dbml:[`Database schema`,`Tables and relationships expressed with DBML.`],diagramsnet:[`Venn diagram`,`An overlapping-set example imported from diagrams.net.`],ditaa:[`Tandem ASCII architecture`,`An ASCII sketch becomes a rendered system diagram.`],erd:[`Data model`,`Entities and relationships in a small relational schema.`],excalidraw:[`Venn sketch`,`A hand-drawn overlapping-set diagram.`],goat:[`Component shapes`,`GoAT exercises boxes, connectors, curves, and symbols.`],nomnoml:[`Pirate class diagram`,`A playful class diagram demonstrating Nomnoml syntax.`],pikchr:[`Cardinal points`,`A diamond marks north, east, south, and west.`],structurizr:[`Tandem landscape`,`A software landscape linking people, agents, and Tandem.`],svgbob:[`Cloud network`,`An ASCII cloud connects clients and services.`],symbolator:[`Hardware component`,`A component symbol generated from interface declarations.`],tikz:[`Periodic table`,`A color-coded periodic table rendered with TikZ.`],umlet:[`UML example`,`A UMLet document rendered directly from its XML form.`],vega:[`Bar chart`,`A declarative bar chart expressed with Vega.`],vegalite:[`Discretizing scale`,`A Vega-Lite example comparing discretized values.`],wavedrom:[`Timing diagram`,`Digital signals and timing relationships rendered by WaveDrom.`],wireviz:[`Wiring harness`,`Connections, cables, and pins described with WireViz.`]};function dC(e){return lC[e]??oC}function fC(e){let t=mx.findIndex(t=>t.id===e),[n,r]=uC[e]??[`Diagram example`,`A diagram.zip catalog example.`];return{type:e,source:dC(e),options:{},...Ux(Math.max(t,0),{title:n,description:r})}}function pC(e,t,n,r,i){return e.set(t,{...r,type:t}),e.get(n)??i(n)}var mC=`/api/v1`,hC=/^[A-Za-z0-9_-]{16}$/,gC=/^[A-Za-z0-9_-]{43}$/;function _C(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/,``)}function vC(){return _C(crypto.getRandomValues(new Uint8Array(32)))}function yC(e){return e.match(/^\/d\/([A-Za-z0-9_-]{16})\/?$/)?.[1]??null}function bC(e,t){if(!hC.test(t))throw Error(`Invalid diagram alias.`);return new URL(`/d/${t}`,e).toString()}function xC(e,t,n){if(!gC.test(n))throw Error(`Invalid write capability.`);let r=new URL(bC(e,t));return r.hash=`w=${n}`,r.toString()}function SC(e,t,n=`svg`){if(!hC.test(t))throw Error(`Invalid diagram alias.`);if(n!==`svg`&&n!==`png`)throw Error(`Invalid render format.`);return new URL(`${mC}/aliases/${t}/renders/${n}`,e).toString()}function CC(e){return e.match(/^#w=([A-Za-z0-9_-]{43})$/)?.[1]??null}var wC=class extends Error{constructor(e,{status:t,code:n}={}){super(e),this.status=t,this.code=n}};function TC(e){if(!e||typeof e!=`object`||typeof e.type!=`string`||typeof e.source!=`string`)throw Error(`Invalid diagram state.`);return{mode:`open`,diagram:{type:e.type,source:e.source,options:e.options??{},presentation:cC(e.presentation)},metadata:sC(e.meta)}}function EC(e){if(!e||typeof e!=`object`||!hC.test(e.aliasId)||!gC.test(e.contentId)||!gC.test(e.renderId)||!Number.isSafeInteger(e.revision)||e.mode!==`open`&&e.mode!==`locked`)throw new wC(`The persistence service returned an invalid response.`,{code:`invalid_response`});let t={aliasId:e.aliasId,contentId:e.contentId,renderId:e.renderId,revision:e.revision,mode:e.mode,createdAt:e.createdAt,updatedAt:e.updatedAt};if(e.mode===`locked`){if(!e.encryptedContent||!e.encryptedMetadata||!e.keyEnvelope)throw new wC(`The persistence service returned an invalid locked diagram.`,{code:`invalid_response`});return{...t,encryptedContent:e.encryptedContent,encryptedMetadata:e.encryptedMetadata,keyEnvelope:e.keyEnvelope}}if(!e.diagram||typeof e.diagram!=`object`)throw new wC(`The persistence service returned an invalid open diagram.`,{code:`invalid_response`});return{...t,state:{type:e.diagram.type,source:e.diagram.source,options:e.diagram.options??{},presentation:cC(e.diagram.presentation),meta:sC(e.metadata)}}}var DC=class{constructor({fetchImpl:e=globalThis.fetch,origin:t=globalThis.location?.origin??`http://localhost`,apiPrefix:n=mC}={}){this.fetch=(...t)=>e(...t),this.origin=t,this.apiPrefix=n.replace(/\/$/,``)}url(e=``){return new URL(`${this.apiPrefix}/aliases${e}`,this.origin)}async request(e,t){let n=await this.fetch(e,t),r=await n.json().catch(()=>null);if(!n.ok)throw new wC(r?.error?.message||`Persistence request failed with HTTP ${n.status}.`,{status:n.status,code:r?.error?.code});return EC(r)}async errorFor(e){let t=await e.json().catch(()=>null);return new wC(t?.error?.message||`Persistence request failed with HTTP ${e.status}.`,{status:e.status,code:t?.error?.code})}async createPayload(e){let t=vC();return{...await this.request(this.url(),{method:`POST`,headers:{Authorization:`Bearer ${t}`,"Content-Type":`application/json`},body:JSON.stringify(e)}),writeCapability:t}}createAlias(e){return this.createPayload(TC(e))}createLockedAlias(e){if(e?.mode!==`locked`)throw Error(`Invalid locked diagram payload.`);return this.createPayload(e)}getAlias(e){if(!hC.test(e))throw Error(`Invalid diagram alias.`);return this.request(this.url(`/${e}`),{headers:{Accept:`application/json`}})}updatePayload(e,t,n,r){if(!hC.test(e))throw Error(`Invalid diagram alias.`);if(!Number.isSafeInteger(n)||n<1)throw Error(`Invalid alias revision.`);if(!gC.test(r))throw Error(`Invalid write capability.`);return this.request(this.url(`/${e}`),{method:`PUT`,headers:{Accept:`application/json`,Authorization:`Bearer ${r}`,"Content-Type":`application/json`,"If-Match":`"${n}"`},body:JSON.stringify(t)})}updateAlias(e,t,n,r){return this.updatePayload(e,TC(t),n,r)}updateLockedAlias(e,t,n,r){if(t?.mode!==`locked`)throw Error(`Invalid locked diagram payload.`);return this.updatePayload(e,t,n,r)}async uploadRender({aliasId:e,renderId:t,revision:n,writeCapability:r,format:i,mode:a,render:o}){if(!hC.test(e))throw Error(`Invalid diagram alias.`);if(!gC.test(t))throw Error(`Invalid render ID.`);if(!Number.isSafeInteger(n)||n<1)throw Error(`Invalid alias revision.`);if(!gC.test(r))throw Error(`Invalid write capability.`);if(i!==`svg`&&i!==`png`)throw Error(`Invalid render format.`);if(a!==`open`&&a!==`locked`)throw Error(`Invalid diagram mode.`);let s=a===`locked`?`application/json`:i===`svg`?`image/svg+xml`:`image/png`,c=a===`locked`?JSON.stringify(o):o,l=await this.fetch(this.url(`/${e}/renders/${i}`),{method:`PUT`,headers:{Authorization:`Bearer ${r}`,"Content-Type":s,"If-Match":`"${n}"`,"X-Render-Id":t},body:c});if(!l.ok)throw await this.errorFor(l)}async getEncryptedRender(e,t){if(!hC.test(e))throw Error(`Invalid diagram alias.`);if(t!==`svg`&&t!==`png`)throw Error(`Invalid render format.`);let n=this.url(`/${e}/renders/${t}`);n.searchParams.set(`encrypted`,`1`);let r=await this.fetch(n,{headers:{Accept:`application/json`}});if(!r.ok)throw await this.errorFor(r);return r.json()}},OC=6e5,kC=new TextEncoder,AC=new TextDecoder,jC=kC.encode(`diagram.zip:content:v1`),MC=kC.encode(`diagram.zip:metadata:v1`),NC=kC.encode(`diagram.zip:bundle-key:v1`);function PC(e){if(e!==`svg`&&e!==`png`)throw Error(`Invalid render format.`);return kC.encode(`diagram.zip:render:${e}:v1`)}function FC(e){let t=``,n=32768;for(let r=0;r<e.length;r+=n)t+=String.fromCharCode(...e.subarray(r,r+n));return btoa(t).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/,``)}function IC(e){if(typeof e!=`string`||!/^[A-Za-z0-9_-]+$/.test(e))throw Error(`Invalid encrypted diagram.`);let t=e.replaceAll(`-`,`+`).replaceAll(`_`,`/`),n=t+`=`.repeat((4-t.length%4)%4),r=atob(n),i=Uint8Array.from(r,e=>e.charCodeAt(0));if(FC(i)!==e)throw Error(`Invalid encrypted diagram.`);return i}function LC(e){return crypto.getRandomValues(new Uint8Array(e))}async function RC(e,t){if(!(e instanceof Uint8Array)||e.byteLength!==32)throw Error(`Invalid diagram key.`);return crypto.subtle.importKey(`raw`,e,{name:`AES-GCM`},!1,t)}async function zC(e,{iterations:t,salt:n}){if(typeof e!=`string`)throw Error(`Password is required.`);let r=await crypto.subtle.importKey(`raw`,kC.encode(e),`PBKDF2`,!1,[`deriveKey`]);return crypto.subtle.deriveKey({name:`PBKDF2`,hash:`SHA-256`,iterations:t,salt:n},r,{name:`AES-GCM`,length:256},!1,[`encrypt`,`decrypt`])}async function BC(e,t,n){let r=LC(12),i=await crypto.subtle.encrypt({name:`AES-GCM`,iv:r,additionalData:n,tagLength:128},t,e);return{v:1,alg:`A256GCM`,iv:FC(r),ciphertext:FC(new Uint8Array(i))}}async function VC(e,t,n){if(!e||e.v!==1||e.alg!==`A256GCM`)throw Error(`Invalid encrypted diagram.`);let r=IC(e.iv);if(r.byteLength!==12)throw Error(`Invalid encrypted diagram.`);let i=IC(e.ciphertext);if(i.byteLength<16)throw Error(`Invalid encrypted diagram.`);return new Uint8Array(await crypto.subtle.decrypt({name:`AES-GCM`,iv:r,additionalData:n,tagLength:128},t,i))}async function HC(e,t,n){return BC(kC.encode(JSON.stringify(e)),t,n)}async function UC(e,t,n){return JSON.parse(AC.decode(await VC(e,t,n)))}function WC(e,t){if(!e||typeof e!=`object`||!bx(e.type)||typeof e.source!=`string`||!e.options||typeof e.options!=`object`||Array.isArray(e.options))throw Error(`Invalid encrypted diagram.`);return{type:e.type,source:e.source,options:e.options,presentation:cC(e.presentation),meta:sC(t)}}async function GC(e,t){if(typeof t!=`string`||t.length<8)throw Error(`Password must be at least 8 characters.`);let n=LC(16),r={name:`PBKDF2`,hash:`SHA-256`,iterations:OC,salt:FC(n)};return{v:1,kdf:r,wrap:await BC(e,await zC(t,{iterations:r.iterations,salt:n}),NC)}}async function KC(e,t){if(!e||e.v!==1||e.kdf?.name!==`PBKDF2`||e.kdf.hash!==`SHA-256`||!Number.isInteger(e.kdf.iterations)||e.kdf.iterations<1e5||e.kdf.iterations>5e6)throw Error(`Invalid encrypted diagram.`);let n=IC(e.kdf.salt);if(n.byteLength!==16)throw Error(`Invalid encrypted diagram.`);let r=await zC(t,{iterations:e.kdf.iterations,salt:n}),i=await VC(e.wrap,r,NC);if(i.byteLength!==32)throw Error(`Invalid encrypted diagram.`);return i}async function qC(e,t,n){let r=WC({type:e.type,source:e.source,options:e.options??{},presentation:e.presentation},e.meta),i=await RC(t,[`encrypt`]);return{mode:`locked`,encryptedContent:await HC({type:r.type,source:r.source,options:r.options,presentation:r.presentation},i,jC),encryptedMetadata:await HC(r.meta,i,MC),keyEnvelope:n}}async function JC(e,t){let n=LC(32);return{bundleKey:n,payload:await qC(e,n,await GC(n,t))}}async function YC(e,t){if(!e||e.mode!==`locked`)throw Error(`Invalid encrypted diagram.`);try{let n=await KC(e.keyEnvelope,t),r=await RC(n,[`decrypt`]),[i,a]=await Promise.all([UC(e.encryptedContent,r,jC),UC(e.encryptedMetadata,r,MC)]);return{bundleKey:n,state:WC(i,a)}}catch{throw Error(`Wrong password or damaged diagram.`)}}async function XC(e,t,n){if(!(e instanceof Blob))throw Error(`Invalid rendered image.`);let r=await RC(t,[`encrypt`]);return BC(new Uint8Array(await e.arrayBuffer()),r,PC(n))}var ZC=`diagram.zip:renderer:v1`,QC=`/diagram.zip/renderer-frame.html`,$C=2e4,ew=Object.freeze([`mermaid`]);function tw(e){return e?.name===`AbortError`?e:new DOMException(`Render superseded.`,`AbortError`)}var nw=class{constructor({documentObject:e=document,windowObject:t=window,frameUrl:n=QC}={}){this.document=e,this.window=t,this.frameUrl=n,this.frame=null,this.ready=null,this.resolveReady=null,this.rejectReady=null,this.sequence=0,this.pending=new Map,this.handleMessage=e=>this.receive(e),this.window.addEventListener(`message`,this.handleMessage)}ensureFrame(){if(this.frame)return this.ready;let e=this.document.createElement(`iframe`);return e.title=`Diagram renderer`,e.setAttribute(`sandbox`,`allow-scripts`),e.setAttribute(`aria-hidden`,`true`),e.tabIndex=-1,Object.assign(e.style,{position:`fixed`,left:`-200vw`,top:`0`,width:`1280px`,height:`800px`,border:`0`,pointerEvents:`none`,visibility:`hidden`}),this.ready=new Promise((e,t)=>{this.resolveReady=e,this.rejectReady=t}),e.addEventListener(`error`,()=>this.rejectReady?.(Error(`The client renderer could not be loaded.`)),{once:!0}),e.src=this.frameUrl,this.frame=e,this.document.body.append(e),this.ready}receive(e){if(!this.frame||e.source!==this.frame.contentWindow||e.data?.channel!==ZC)return;if(e.data.type===`ready`){this.resolveReady?.(),this.resolveReady=null,this.rejectReady=null;return}if(e.data.type!==`result`)return;let t=this.pending.get(e.data.requestId);t&&(this.pending.delete(e.data.requestId),t.finish(),e.data.ok&&typeof e.data.svg==`string`?t.resolve({body:e.data.svg,version:e.data.version,runtime:`client`}):t.reject(Error(e.data.error||`Client rendering failed.`)))}async render(e,t,n){let r;try{await Promise.race([this.ensureFrame(),new Promise((e,t)=>{r=setTimeout(()=>t(Error(`The client renderer timed out while loading.`)),$C)})])}finally{clearTimeout(r)}if(n.aborted)throw tw(n.reason);let i=`${Date.now().toString(36)}-${++this.sequence}`;return new Promise((r,a)=>{let o=setTimeout(()=>{this.pending.delete(i),n.removeEventListener(`abort`,s),a(Error(`The client renderer timed out.`))},$C),s=()=>{this.pending.delete(i),clearTimeout(o),a(tw(n.reason))};n.addEventListener(`abort`,s,{once:!0}),this.pending.set(i,{resolve:r,reject:a,finish:()=>{clearTimeout(o),n.removeEventListener(`abort`,s)}}),this.frame.contentWindow.postMessage({channel:ZC,type:`render`,requestId:i,engine:e,source:t},`*`)})}},rw;function iw(e){return ew.includes(e)?(rw??=new nw,{id:e,runtime:`client`,render:({source:t},n)=>rw.render(e,t,n)}):null}var aw=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CHAR=` 1644+\r --�𐀀-`,e.S=` \r1645+`,e.NAME_START_CHAR=`:A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-`,e.NAME_CHAR=`-`+e.NAME_START_CHAR+`.0-9·̀-ͯ‿-⁀`,e.CHAR_RE=RegExp(`^[`+e.CHAR+`]$`,`u`),e.S_RE=RegExp(`^[`+e.S+`]+$`,`u`),e.NAME_START_CHAR_RE=RegExp(`^[`+e.NAME_START_CHAR+`]$`,`u`),e.NAME_CHAR_RE=RegExp(`^[`+e.NAME_CHAR+`]$`,`u`),e.NAME_RE=RegExp(`^[`+e.NAME_START_CHAR+`][`+e.NAME_CHAR+`]*$`,`u`),e.NMTOKEN_RE=RegExp(`^[`+e.NAME_CHAR+`]+$`,`u`);var t=9,n=10,r=13,i=32;e.S_LIST=[i,n,r,t];function a(e){return e>=i&&e<=55295||e===n||e===r||e===t||e>=57344&&e<=65533||e>=65536&&e<=1114111}e.isChar=a;function o(e){return e===i||e===n||e===r||e===t}e.isS=o;function s(e){return e>=65&&e<=90||e>=97&&e<=122||e===58||e===95||e===8204||e===8205||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}e.isNameStartChar=s;function c(e){return s(e)||e>=48&&e<=57||e===45||e===46||e===183||e>=768&&e<=879||e>=8255&&e<=8256}e.isNameChar=c})),ow=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CHAR=`--�𐀀-`,e.RESTRICTED_CHAR=`-\b\v\f---`,e.S=` \r1646+`,e.NAME_START_CHAR=`:A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-`,e.NAME_CHAR=`-`+e.NAME_START_CHAR+`.0-9·̀-ͯ‿-⁀`,e.CHAR_RE=RegExp(`^[`+e.CHAR+`]$`,`u`),e.RESTRICTED_CHAR_RE=RegExp(`^[`+e.RESTRICTED_CHAR+`]$`,`u`),e.S_RE=RegExp(`^[`+e.S+`]+$`,`u`),e.NAME_START_CHAR_RE=RegExp(`^[`+e.NAME_START_CHAR+`]$`,`u`),e.NAME_CHAR_RE=RegExp(`^[`+e.NAME_CHAR+`]$`,`u`),e.NAME_RE=RegExp(`^[`+e.NAME_START_CHAR+`][`+e.NAME_CHAR+`]*$`,`u`),e.NMTOKEN_RE=RegExp(`^[`+e.NAME_CHAR+`]+$`,`u`);var t=9,n=10,r=13,i=32;e.S_LIST=[i,n,r,t];function a(e){return e>=1&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}e.isChar=a;function o(e){return e>=1&&e<=8||e===11||e===12||e>=14&&e<=31||e>=127&&e<=132||e>=134&&e<=159}e.isRestrictedChar=o;function s(e){return e===9||e===10||e===13||e>31&&e<127||e===133||e>159&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}e.isCharAndNotRestricted=s;function c(e){return e===i||e===n||e===r||e===t}e.isS=c;function l(e){return e>=65&&e<=90||e>=97&&e<=122||e===58||e===95||e===8204||e===8205||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}e.isNameStartChar=l;function u(e){return l(e)||e>=48&&e<=57||e===45||e===46||e===183||e>=768&&e<=879||e>=8255&&e<=8256}e.isNameChar=u})),sw=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NC_NAME_START_CHAR=`A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-`,e.NC_NAME_CHAR=`-`+e.NC_NAME_START_CHAR+`.0-9·̀-ͯ‿-⁀`,e.NC_NAME_START_CHAR_RE=RegExp(`^[`+e.NC_NAME_START_CHAR+`]$`,`u`),e.NC_NAME_CHAR_RE=RegExp(`^[`+e.NC_NAME_CHAR+`]$`,`u`),e.NC_NAME_RE=RegExp(`^[`+e.NC_NAME_START_CHAR+`][`+e.NC_NAME_CHAR+`]*$`,`u`);function t(e){return e>=65&&e<=90||e===95||e>=97&&e<=122||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}e.isNCNameStartChar=t;function n(e){return t(e)||e===45||e===46||e>=48&&e<=57||e===183||e>=768&&e<=879||e>=8255&&e<=8256}e.isNCNameChar=n})),cw=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SaxesParser=e.EVENTS=void 0;var t=aw(),n=ow(),r=sw(),i=t.isS,a=t.isChar,o=t.isNameStartChar,s=t.isNameChar,c=t.S_LIST,l=t.NAME_RE,u=n.isChar,d=r.isNCNameStartChar,f=r.isNCNameChar,p=r.NC_NAME_RE,m=`http://www.w3.org/XML/1998/namespace`,h=`http://www.w3.org/2000/xmlns/`,g={__proto__:null,xml:m,xmlns:h},_={__proto__:null,amp:`&`,gt:`>`,lt:`<`,quot:`"`,apos:`'`},v=-1,y=-2,ee=0,te=1,ne=2,re=3,b=4,ie=5,ae=6,x=7,oe=8,S=9,se=10,ce=11,le=12,C=13,w=14,ue=15,de=16,fe=17,pe=18,me=19,he=20,T=21,ge=22,_e=23,E=24,ve=25,ye=26,be=27,xe=28,Se=29,Ce=30,we=31,Te=32,Ee=33,De=34,Oe=35,ke=36,Ae=37,je=38,Me=39,Ne=40,Pe=41,Fe=42,Ie=43,Le=44,Re=9,ze=10,Be=13,Ve=32,He=33,Ue=34,We=38,D=39,O=45,Ge=47,Ke=59,qe=60,Je=61,k=62,A=63,Ye=91,Xe=93,j=133,Ze=8232,Qe=e=>e===Ue||e===D,$e=[Ue,D],et=[...$e,Ye,k],M=[...$e,qe,Xe],tt=[Je,A,...c],nt=[...c,k,We,qe];function rt(e,t,n){switch(t){case`xml`:n!==m&&e.fail(`xml prefix must be bound to ${m}.`);break;case`xmlns`:n!==h&&e.fail(`xmlns prefix must be bound to ${h}.`)}switch(n){case h:e.fail(t===``?`the default namespace may not be set to ${n}.`:`may not assign a prefix (even "xmlns") to the URI \1647+${h}.`);break;case m:switch(t){case`xml`:break;case``:e.fail(`the default namespace may not be set to ${n}.`);break;default:e.fail(`may not assign the xml namespace to another prefix.`)}}}function it(e,t){for(let n of Object.keys(t))rt(e,n,t[n])}var at=e=>p.test(e),ot=e=>l.test(e),N=0,st=1,ct=2;e.EVENTS=[`xmldecl`,`text`,`processinginstruction`,`doctype`,`comment`,`opentagstart`,`attribute`,`opentag`,`closetag`,`cdata`,`error`,`end`,`ready`];var lt={xmldecl:`xmldeclHandler`,text:`textHandler`,processinginstruction:`piHandler`,doctype:`doctypeHandler`,comment:`commentHandler`,opentagstart:`openTagStartHandler`,attribute:`attributeHandler`,opentag:`openTagHandler`,closetag:`closeTagHandler`,cdata:`cdataHandler`,error:`errorHandler`,end:`endHandler`,ready:`readyHandler`};e.SaxesParser=class{constructor(e){this.opt=e??{},this.fragmentOpt=!!this.opt.fragment;let t=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,t){this.nameStartCheck=d,this.nameCheck=f,this.isName=at,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},g);let e=this.opt.additionalNamespaces;e!=null&&(it(this,e),Object.assign(this.ns,e))}else this.nameStartCheck=o,this.nameCheck=s,this.isName=ot,this.processAttribs=this.processAttribsPlain,this.pushAttrib=this.pushAttribPlain;this.stateTable=[this.sBegin,this.sBeginWhitespace,this.sDoctype,this.sDoctypeQuote,this.sDTD,this.sDTDQuoted,this.sDTDOpenWaka,this.sDTDOpenWakaBang,this.sDTDComment,this.sDTDCommentEnding,this.sDTDCommentEnded,this.sDTDPI,this.sDTDPIEnding,this.sText,this.sEntity,this.sOpenWaka,this.sOpenWakaBang,this.sComment,this.sCommentEnding,this.sCommentEnded,this.sCData,this.sCDataEnding,this.sCDataEnding2,this.sPIFirstChar,this.sPIRest,this.sPIBody,this.sPIEnding,this.sXMLDeclNameStart,this.sXMLDeclName,this.sXMLDeclEq,this.sXMLDeclValueStart,this.sXMLDeclValue,this.sXMLDeclSeparator,this.sXMLDeclEnding,this.sOpenTag,this.sOpenTagSlash,this.sAttrib,this.sAttribName,this.sAttribNameSawWhite,this.sAttribValue,this.sAttribValueQuoted,this.sAttribValueClosed,this.sAttribValueUnquoted,this.sCloseTag,this.sCloseTagSawWhite],this._init()}get closed(){return this._closed}_init(){var e;this.openWakaBang=``,this.text=``,this.name=``,this.piTarget=``,this.entity=``,this.q=null,this.tags=[],this.tag=null,this.topNS=null,this.chunk=``,this.chunkPosition=0,this.i=0,this.prevI=0,this.carriedFromPrevious=void 0,this.forbiddenState=N,this.attribList=[];let{fragmentOpt:t}=this;this.state=t?C:ee,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=t,this.xmlDeclPossible=!t,this.xmlDeclExpects=[`version`],this.entityReturnState=void 0;let{defaultXMLVersion:n}=this.opt;if(n===void 0){if(this.opt.forceXMLVersion===!0)throw Error(`forceXMLVersion set but defaultXMLVersion is not set`);n=`1.0`}this.setXMLVersion(n),this.positionAtNewLine=0,this.doctype=!1,this._closed=!1,this.xmlDecl={version:void 0,encoding:void 0,standalone:void 0},this.line=1,this.column=0,this.ENTITIES=Object.create(_),(e=this.readyHandler)==null||e.call(this)}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(e,t){this[lt[e]]=t}off(e){this[lt[e]]=void 0}makeError(e){let t=this.fileName??``;return this.trackPosition&&(t.length>0&&(t+=`:`),t+=`${this.line}:${this.column}`),t.length>0&&(t+=`: `),Error(t+e)}fail(e){let t=this.makeError(e),n=this.errorHandler;if(n===void 0)throw t;return n(t),this}write(e){if(this.closed)return this.fail(`cannot write after close; assign an onready handler.`);let t=!1;e===null?(t=!0,e=``):typeof e==`object`&&(e=e.toString()),this.carriedFromPrevious!==void 0&&(e=`${this.carriedFromPrevious}${e}`,this.carriedFromPrevious=void 0);let n=e.length,r=e.charCodeAt(n-1);!t&&(r===Be||r>=55296&&r<=56319)&&(this.carriedFromPrevious=e[n-1],n--,e=e.slice(0,n));let{stateTable:i}=this;for(this.chunk=e,this.i=0;this.i<n;)i[this.state].call(this);return this.chunkPosition+=n,t?this.end():this}close(){return this.write(null)}getCode10(){let{chunk:e,i:t}=this;if(this.prevI=t,this.i=t+1,t>=e.length)return v;let n=e.charCodeAt(t);if(this.column++,n<55296){if(n>=Ve||n===Re)return n;switch(n){case ze:return this.line++,this.column=0,this.positionAtNewLine=this.position,ze;case Be:return e.charCodeAt(t+1)===ze&&(this.i=t+2),this.line++,this.column=0,this.positionAtNewLine=this.position,y;default:return this.fail(`disallowed character.`),n}}if(n>56319)return n>=57344&&n<=65533||this.fail(`disallowed character.`),n;let r=65536+(n-55296)*1024+(e.charCodeAt(t+1)-56320);return this.i=t+2,r>1114111&&this.fail(`disallowed character.`),r}getCode11(){let{chunk:e,i:t}=this;if(this.prevI=t,this.i=t+1,t>=e.length)return v;let n=e.charCodeAt(t);if(this.column++,n<55296){if(n>31&&n<127||n>159&&n!==Ze||n===Re)return n;switch(n){case ze:return this.line++,this.column=0,this.positionAtNewLine=this.position,ze;case Be:{let n=e.charCodeAt(t+1);(n===ze||n===j)&&(this.i=t+2)}case j:case Ze:return this.line++,this.column=0,this.positionAtNewLine=this.position,y;default:return this.fail(`disallowed character.`),n}}if(n>56319)return n>=57344&&n<=65533||this.fail(`disallowed character.`),n;let r=65536+(n-55296)*1024+(e.charCodeAt(t+1)-56320);return this.i=t+2,r>1114111&&this.fail(`disallowed character.`),r}getCodeNorm(){let e=this.getCode();return e===y?ze:e}unget(){this.i=this.prevI,this.column--}captureTo(e){let{i:t}=this,{chunk:n}=this;for(;;){let r=this.getCode(),i=r===y,a=i?ze:r;if(a===v||e.includes(a))return this.text+=n.slice(t,this.prevI),a;i&&(this.text+=`${n.slice(t,this.prevI)}\n`,t=this.i)}}captureToChar(e){let{i:t}=this,{chunk:n}=this;for(;;){let r=this.getCode();switch(r){case y:this.text+=`${n.slice(t,this.prevI)}\n`,t=this.i,r=ze;break;case v:return this.text+=n.slice(t),!1}if(r===e)return this.text+=n.slice(t,this.prevI),!0}}captureNameChars(){let{chunk:e,i:t}=this;for(;;){let n=this.getCode();if(n===v)return this.name+=e.slice(t),v;if(!s(n))return this.name+=e.slice(t,this.prevI),n===y?ze:n}}skipSpaces(){for(;;){let e=this.getCodeNorm();if(e===v||!i(e))return e}}setXMLVersion(e){this.currentXMLVersion=e,e===`1.0`?(this.isChar=a,this.getCode=this.getCode10):(this.isChar=u,this.getCode=this.getCode11)}sBegin(){this.chunk.charCodeAt(0)===65279&&(this.i++,this.column++),this.state=te}sBeginWhitespace(){let e=this.i,t=this.skipSpaces();switch(this.prevI!==e&&(this.xmlDeclPossible=!1),t){case qe:if(this.state=ue,this.text.length!==0)throw Error(`no-empty text at start`);break;case v:break;default:this.unget(),this.state=C,this.xmlDeclPossible=!1}}sDoctype(){var e;let t=this.captureTo(et);switch(t){case k:(e=this.doctypeHandler)==null||e.call(this,this.text),this.text=``,this.state=C,this.doctype=!0;break;case v:break;default:this.text+=String.fromCodePoint(t),t===Ye?this.state=b:Qe(t)&&(this.state=re,this.q=t)}}sDoctypeQuote(){let e=this.q;this.captureToChar(e)&&(this.text+=String.fromCodePoint(e),this.q=null,this.state=ne)}sDTD(){let e=this.captureTo(M);e!==v&&(this.text+=String.fromCodePoint(e),e===Xe?this.state=ne:e===qe?this.state=ae:Qe(e)&&(this.state=ie,this.q=e))}sDTDQuoted(){let e=this.q;this.captureToChar(e)&&(this.text+=String.fromCodePoint(e),this.state=b,this.q=null)}sDTDOpenWaka(){let e=this.getCodeNorm();switch(this.text+=String.fromCodePoint(e),e){case He:this.state=x,this.openWakaBang=``;break;case A:this.state=ce;break;default:this.state=b}}sDTDOpenWakaBang(){let e=String.fromCodePoint(this.getCodeNorm()),t=this.openWakaBang+=e;this.text+=e,t!==`-`&&(this.state=t===`--`?oe:b,this.openWakaBang=``)}sDTDComment(){this.captureToChar(O)&&(this.text+=`-`,this.state=S)}sDTDCommentEnding(){let e=this.getCodeNorm();this.text+=String.fromCodePoint(e),this.state=e===O?se:oe}sDTDCommentEnded(){let e=this.getCodeNorm();this.text+=String.fromCodePoint(e),e===k?this.state=b:(this.fail(`malformed comment.`),this.state=oe)}sDTDPI(){this.captureToChar(A)&&(this.text+=`?`,this.state=le)}sDTDPIEnding(){let e=this.getCodeNorm();this.text+=String.fromCodePoint(e),e===k&&(this.state=b)}sText(){this.tags.length===0?this.handleTextOutsideRoot():this.handleTextInRoot()}sEntity(){let{i:e}=this,{chunk:t}=this;loop:for(;;)switch(this.getCode()){case y:this.entity+=`${t.slice(e,this.prevI)}\n`,e=this.i;break;case Ke:{let{entityReturnState:n}=this,r=this.entity+t.slice(e,this.prevI);this.state=n;let i;r===``?(this.fail(`empty entity name.`),i=`&;`):(i=this.parseEntity(r),this.entity=``),(n!==C||this.textHandler!==void 0)&&(this.text+=i);break loop}case v:this.entity+=t.slice(e);break loop}}sOpenWaka(){let e=this.getCode();if(o(e))this.state=De,this.unget(),this.xmlDeclPossible=!1;else switch(e){case Ge:this.state=Ie,this.xmlDeclPossible=!1;break;case He:this.state=de,this.openWakaBang=``,this.xmlDeclPossible=!1;break;case A:this.state=_e;break;default:this.fail(`disallowed character in tag name`),this.state=C,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case`[CDATA[`:!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail(`text data outside of root node.`),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail(`text data outside of root node.`),this.reportedTextAfterRoot=!0),this.state=he,this.openWakaBang=``;break;case`--`:this.state=fe,this.openWakaBang=``;break;case`DOCTYPE`:this.state=ne,(this.doctype||this.sawRoot)&&this.fail(`inappropriately located doctype declaration.`),this.openWakaBang=``;break;default:this.openWakaBang.length>=7&&this.fail(`incorrect syntax.`)}}sComment(){this.captureToChar(O)&&(this.state=pe)}sCommentEnding(){var e;let t=this.getCodeNorm();t===O?(this.state=me,(e=this.commentHandler)==null||e.call(this,this.text),this.text=``):(this.text+=`-${String.fromCodePoint(t)}`,this.state=fe)}sCommentEnded(){let e=this.getCodeNorm();e===k?this.state=C:(this.fail(`malformed comment.`),this.text+=`--${String.fromCodePoint(e)}`,this.state=fe)}sCData(){this.captureToChar(Xe)&&(this.state=T)}sCDataEnding(){let e=this.getCodeNorm();e===Xe?this.state=ge:(this.text+=`]${String.fromCodePoint(e)}`,this.state=he)}sCDataEnding2(){var e;let t=this.getCodeNorm();switch(t){case k:(e=this.cdataHandler)==null||e.call(this,this.text),this.text=``,this.state=C;break;case Xe:this.text+=`]`;break;default:this.text+=`]]${String.fromCodePoint(t)}`,this.state=he}}sPIFirstChar(){let e=this.getCodeNorm();this.nameStartCheck(e)?(this.piTarget+=String.fromCodePoint(e),this.state=E):e===A||i(e)?(this.fail(`processing instruction without a target.`),this.state=e===A?ye:ve):(this.fail(`disallowed character in processing instruction name.`),this.piTarget+=String.fromCodePoint(e),this.state=E)}sPIRest(){let{chunk:e,i:t}=this;for(;;){let n=this.getCodeNorm();if(n===v){this.piTarget+=e.slice(t);return}if(!this.nameCheck(n)){this.piTarget+=e.slice(t,this.prevI);let r=n===A;r||i(n)?this.piTarget===`xml`?(this.xmlDeclPossible||this.fail(`an XML declaration must be at the start of the document.`),this.state=r?Ee:be):this.state=r?ye:ve:(this.fail(`disallowed character in processing instruction name.`),this.piTarget+=String.fromCodePoint(n));break}}}sPIBody(){if(this.text.length===0){let e=this.getCodeNorm();e===A?this.state=ye:i(e)||(this.text=String.fromCodePoint(e))}else this.captureToChar(A)&&(this.state=ye)}sPIEnding(){var e;let t=this.getCodeNorm();if(t===k){let{piTarget:t}=this;t.toLowerCase()===`xml`&&this.fail(`the XML declaration must appear at the start of the document.`),(e=this.piHandler)==null||e.call(this,{target:t,body:this.text}),this.piTarget=this.text=``,this.state=C}else t===A?this.text+=`?`:(this.text+=`?${String.fromCodePoint(t)}`,this.state=ve);this.xmlDeclPossible=!1}sXMLDeclNameStart(){let e=this.skipSpaces();if(e===A){this.state=Ee;return}e!==v&&(this.state=xe,this.name=String.fromCodePoint(e))}sXMLDeclName(){let e=this.captureTo(tt);if(e===A){this.state=Ee,this.name+=this.text,this.text=``,this.fail(`XML declaration is incomplete.`);return}if(i(e)||e===Je){if(this.name+=this.text,this.text=``,!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail(`did not expect any more name/value pairs.`);break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(`, `)}`)}this.state=e===Je?Ce:Se}}sXMLDeclEq(){let e=this.getCodeNorm();if(e===A){this.state=Ee,this.fail(`XML declaration is incomplete.`);return}i(e)||(e!==Je&&this.fail(`value required.`),this.state=Ce)}sXMLDeclValueStart(){let e=this.getCodeNorm();if(e===A){this.state=Ee,this.fail(`XML declaration is incomplete.`);return}i(e)||(Qe(e)?this.q=e:(this.fail(`value must be quoted.`),this.q=Ve),this.state=we)}sXMLDeclValue(){let e=this.captureTo([this.q,A]);if(e===A){this.state=Ee,this.text=``,this.fail(`XML declaration is incomplete.`);return}if(e===v)return;let t=this.text;switch(this.text=``,this.name){case`version`:{this.xmlDeclExpects=[`encoding`,`standalone`];let e=t;this.xmlDecl.version=e,/^1\.[0-9]+$/.test(e)?this.opt.forceXMLVersion||this.setXMLVersion(e):this.fail(`version number must match /^1\\.[0-9]+$/.`);break}case`encoding`:/^[A-Za-z][A-Za-z0-9._-]*$/.test(t)||this.fail(`encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/.`),this.xmlDeclExpects=[`standalone`],this.xmlDecl.encoding=t;break;case`standalone`:t!==`yes`&&t!==`no`&&this.fail(`standalone value must match "yes" or "no".`),this.xmlDeclExpects=[],this.xmlDecl.standalone=t}this.name=``,this.state=Te}sXMLDeclSeparator(){let e=this.getCodeNorm();if(e===A){this.state=Ee;return}i(e)||(this.fail(`whitespace required.`),this.unget()),this.state=be}sXMLDeclEnding(){var e;this.getCodeNorm()===k?(this.piTarget===`xml`?this.name!==`version`&&this.xmlDeclExpects.includes(`version`)&&this.fail(`XML declaration must contain a version.`):this.fail(`processing instructions are not allowed before root.`),(e=this.xmldeclHandler)==null||e.call(this,this.xmlDecl),this.name=``,this.piTarget=this.text=``,this.state=C):this.fail(`The character ? is disallowed anywhere in XML declarations.`),this.xmlDeclPossible=!1}sOpenTag(){var e;let t=this.captureNameChars();if(t===v)return;let n=this.tag={name:this.name,attributes:Object.create(null)};switch(this.name=``,this.xmlnsOpt&&(this.topNS=n.ns=Object.create(null)),(e=this.openTagStartHandler)==null||e.call(this,n),this.sawRoot=!0,!this.fragmentOpt&&this.closedRoot&&this.fail(`documents may contain only one root.`),t){case k:this.openTag();break;case Ge:this.state=Oe;break;default:i(t)||this.fail(`disallowed character in tag name.`),this.state=ke}}sOpenTagSlash(){this.getCode()===k?this.openSelfClosingTag():(this.fail(`forward-slash in opening tag not followed by >.`),this.state=ke)}sAttrib(){let e=this.skipSpaces();e!==v&&(o(e)?(this.unget(),this.state=Ae):e===k?this.openTag():e===Ge?this.state=Oe:this.fail(`disallowed character in attribute name.`))}sAttribName(){let e=this.captureNameChars();e===Je?this.state=Me:i(e)?this.state=je:e===k?(this.fail(`attribute without value.`),this.pushAttrib(this.name,this.name),this.name=this.text=``,this.openTag()):e!==v&&this.fail(`disallowed character in attribute name.`)}sAttribNameSawWhite(){let e=this.skipSpaces();switch(e){case v:return;case Je:this.state=Me;break;default:this.fail(`attribute without value.`),this.text=``,this.name=``,e===k?this.openTag():o(e)?(this.unget(),this.state=Ae):(this.fail(`disallowed character in attribute name.`),this.state=ke)}}sAttribValue(){let e=this.getCodeNorm();Qe(e)?(this.q=e,this.state=Ne):i(e)||(this.fail(`unquoted attribute value.`),this.state=Fe,this.unget())}sAttribValueQuoted(){let{q:e,chunk:t}=this,{i:n}=this;for(;;)switch(this.getCode()){case e:this.pushAttrib(this.name,this.text+t.slice(n,this.prevI)),this.name=this.text=``,this.q=null,this.state=Pe;return;case We:this.text+=t.slice(n,this.prevI),this.state=w,this.entityReturnState=Ne;return;case ze:case y:case Re:this.text+=`${t.slice(n,this.prevI)} `,n=this.i;break;case qe:this.text+=t.slice(n,this.prevI),this.fail(`disallowed character.`);return;case v:this.text+=t.slice(n);return}}sAttribValueClosed(){let e=this.getCodeNorm();i(e)?this.state=ke:e===k?this.openTag():e===Ge?this.state=Oe:o(e)?(this.fail(`no whitespace between attributes.`),this.unget(),this.state=Ae):this.fail(`disallowed character in attribute name.`)}sAttribValueUnquoted(){let e=this.captureTo(nt);switch(e){case We:this.state=w,this.entityReturnState=Fe;break;case qe:this.fail(`disallowed character.`);break;case v:break;default:this.text.includes(`]]>`)&&this.fail(`the string "]]>" is disallowed in char data.`),this.pushAttrib(this.name,this.text),this.name=this.text=``,e===k?this.openTag():this.state=ke}}sCloseTag(){let e=this.captureNameChars();e===k?this.closeTag():i(e)?this.state=Le:e!==v&&this.fail(`disallowed character in closing tag.`)}sCloseTagSawWhite(){switch(this.skipSpaces()){case k:this.closeTag();break;case v:break;default:this.fail(`disallowed character in closing tag.`)}}handleTextInRoot(){let{i:e,forbiddenState:t}=this,{chunk:n,textHandler:r}=this;scanLoop:for(;;)switch(this.getCode()){case qe:if(this.state=ue,r!==void 0){let{text:t}=this,i=n.slice(e,this.prevI);t.length===0?i.length!==0&&r(i):(r(t+i),this.text=``)}t=N;break scanLoop;case We:this.state=w,this.entityReturnState=C,r!==void 0&&(this.text+=n.slice(e,this.prevI)),t=N;break scanLoop;case Xe:switch(t){case N:t=st;break;case st:t=ct;break;case ct:break;default:throw Error(`impossible state`)}break;case k:t===ct&&this.fail(`the string "]]>" is disallowed in char data.`),t=N;break;case y:r!==void 0&&(this.text+=`${n.slice(e,this.prevI)}\n`),e=this.i,t=N;break;case v:r!==void 0&&(this.text+=n.slice(e));break scanLoop;default:t=N}this.forbiddenState=t}handleTextOutsideRoot(){let{i:e}=this,{chunk:t,textHandler:n}=this,r=!1;outRootLoop:for(;;){let a=this.getCode();switch(a){case qe:if(this.state=ue,n!==void 0){let{text:r}=this,i=t.slice(e,this.prevI);r.length===0?i.length!==0&&n(i):(n(r+i),this.text=``)}break outRootLoop;case We:this.state=w,this.entityReturnState=C,n!==void 0&&(this.text+=t.slice(e,this.prevI)),r=!0;break outRootLoop;case y:n!==void 0&&(this.text+=`${t.slice(e,this.prevI)}\n`),e=this.i;break;case v:n!==void 0&&(this.text+=t.slice(e));break outRootLoop;default:i(a)||(r=!0)}}r&&(!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail(`text data outside of root node.`),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail(`text data outside of root node.`),this.reportedTextAfterRoot=!0))}pushAttribNS(e,t){var n;let{prefix:r,local:i}=this.qname(e),a={name:e,prefix:r,local:i,value:t};if(this.attribList.push(a),(n=this.attributeHandler)==null||n.call(this,a),r===`xmlns`){let e=t.trim();this.currentXMLVersion===`1.0`&&e===``&&this.fail(`invalid attempt to undefine prefix in XML 1.0`),this.topNS[i]=e,rt(this,i,e)}else if(e===`xmlns`){let e=t.trim();this.topNS[``]=e,rt(this,``,e)}}pushAttribPlain(e,t){var n;let r={name:e,value:t};this.attribList.push(r),(n=this.attributeHandler)==null||n.call(this,r)}end(){var e,t;this.sawRoot||this.fail(`document must contain a root element.`);let{tags:n}=this;for(;n.length>0;){let e=n.pop();this.fail(`unclosed tag: ${e.name}`)}this.state!==ee&&this.state!==C&&this.fail(`unexpected end.`);let{text:r}=this;return r.length!==0&&((e=this.textHandler)==null||e.call(this,r),this.text=``),this._closed=!0,(t=this.endHandler)==null||t.call(this),this._init(),this}resolve(e){var t;let n=this.topNS[e];if(n!==void 0)return n;let{tags:r}=this;for(let t=r.length-1;t>=0;t--)if(n=r[t].ns[e],n!==void 0)return n;return n=this.ns[e],n===void 0?(t=this.opt).resolvePrefix?.call(t,e):n}qname(e){let t=e.indexOf(`:`);if(t===-1)return{prefix:``,local:e};let n=e.slice(t+1),r=e.slice(0,t);return(r===``||n===``||n.includes(`:`))&&this.fail(`malformed name: ${e}.`),{prefix:r,local:n}}processAttribsNS(){let{attribList:e}=this,t=this.tag;{let{prefix:e,local:n}=this.qname(t.name);t.prefix=e,t.local=n;let r=t.uri=this.resolve(e)??``;e!==``&&(e===`xmlns`&&this.fail(`tags may not have "xmlns" as prefix.`),r===``&&(this.fail(`unbound namespace prefix: ${JSON.stringify(e)}.`),t.uri=e))}if(e.length===0)return;let{attributes:n}=t,r=new Set;for(let t of e){let{name:e,prefix:i,local:a}=t,o,s;i===``?(o=e===`xmlns`?h:``,s=e):(o=this.resolve(i),o===void 0&&(this.fail(`unbound namespace prefix: ${JSON.stringify(i)}.`),o=i),s=`{${o}}${a}`),r.has(s)&&this.fail(`duplicate attribute: ${s}.`),r.add(s),t.uri=o,n[e]=t}this.attribList=[]}processAttribsPlain(){let{attribList:e}=this,t=this.tag.attributes;for(let{name:n,value:r}of e)t[n]!==void 0&&this.fail(`duplicate attribute: ${n}.`),t[n]=r;this.attribList=[]}openTag(){var e;this.processAttribs();let{tags:t}=this,n=this.tag;n.isSelfClosing=!1,(e=this.openTagHandler)==null||e.call(this,n),t.push(n),this.state=C,this.name=``}openSelfClosingTag(){var e,t;this.processAttribs();let{tags:n}=this,r=this.tag;r.isSelfClosing=!0,(e=this.openTagHandler)==null||e.call(this,r),(t=this.closeTagHandler)==null||t.call(this,r),(this.tag=n[n.length-1]??null)===null&&(this.closedRoot=!0),this.state=C,this.name=``}closeTag(){let{tags:e,name:t}=this;if(this.state=C,this.name=``,t===``){this.fail(`weird empty close tag.`),this.text+=`</>`;return}let n=this.closeTagHandler,r=e.length;for(;r-->0;){let r=this.tag=e.pop();if(this.topNS=r.ns,n?.(r),r.name===t)break;this.fail(`unexpected close tag.`)}r===0?this.closedRoot=!0:r<0&&(this.fail(`unmatched closing tag: ${t}.`),this.text+=`</${t}>`)}parseEntity(e){if(e[0]!==`#`){let t=this.ENTITIES[e];return t===void 0?(this.fail(this.isName(e)?`undefined entity.`:`disallowed character in entity name.`),`&${e};`):t}let t=NaN;return e[1]===`x`&&/^#x[0-9a-f]+$/i.test(e)?t=parseInt(e.slice(2),16):/^#[0-9]+$/.test(e)&&(t=parseInt(e.slice(1),10)),this.isChar(t)?String.fromCodePoint(t):(this.fail(`malformed character entity.`),`&${e};`)}}}))(),lw=4194304,uw=new Set([`script`,`iframe`,`object`,`embed`,`audio`,`video`]),dw=new Set([`foreignobject`,`div`,`span`,`p`,`br`,`b`,`strong`,`i`,`em`,`small`,`sub`,`sup`,`code`,`ul`,`ol`,`li`,`a`]),fw=/^data:image\/(?:png|jpeg|gif|webp);base64,[a-z0-9+/=\s]+$/i,pw=/^data:(?:font\/(?:woff2?|opentype|truetype)|application\/(?:x-)?font-woff2?);base64,[a-z0-9+/=\s]+$/i,mw=class extends Error{constructor(e){super(e),this.name=`ClientSvgError`}};function hw(e){let t=e.trim();return t.startsWith(`#`)||fw.test(t)||pw.test(t)}function gw(e){if(/@import|expression\s*\(|javascript\s*:|data\s*:\s*text\/html|behavior\s*:|-moz-binding/i.test(e))return!0;let t=/url\s*\(\s*(['"]?)(.*?)\1\s*\)/gi;for(let n of e.matchAll(t))if(!hw(n[2]??``))return!0;return/url\s*\(/i.test(e.replace(t,``))}function _w(e){let t=e.trim();return t.startsWith(`#`)||fw.test(t)}function vw(e,t){let n=e.toLowerCase();return n.startsWith(`on`)?!1:n===`href`||n===`xlink:href`||n===`src`?_w(t):[`style`,`filter`,`fill`,`stroke`,`clip-path`,`mask`].includes(n)?!gw(t):n!==`xml:base`&&!/javascript\s*:/i.test(t)}function yw(e){return e.replaceAll(`&`,`&`).replaceAll(`<`,`<`).replaceAll(`>`,`>`)}function bw(e){return yw(e).replaceAll(`"`,`"`)}function xw(e){if(e.type===`text`)return yw(e.value);let t=[...e.attributes].map(([e,t])=>` ${e}="${bw(t)}"`).join(``);return`<${e.name}${t}>${e.children.map(xw).join(``)}</${e.name}>`}function Sw(e){return e.name.toLowerCase().split(`:`).at(-1)??e.name.toLowerCase()}function Cw(e){if(e===void 0||!/^-?\d+(?:\.\d+)?(?:px)?$/.test(e.trim()))return null;let t=Number.parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function ww(e){let t=e.attributes.get(`viewBox`)?.trim().split(/[\s,]+/).map(Number);if(t?.length===4&&t.every(Number.isFinite)&&t[2]>0&&t[3]>0)return t;let n=Cw(e.attributes.get(`width`)),r=Cw(e.attributes.get(`height`));return n!==null&&r!==null?[0,0,n,r]:null}function Tw(e,t){let n=e.attributes.get(`style`);if(!n)return null;for(let e of n.split(`;`)){let n=e.indexOf(`:`);if(n>=0&&e.slice(0,n).trim().toLowerCase()===t)return e.slice(n+1).trim()}return null}function Ew(e){let t=(e.attributes.get(`fill`)??Tw(e,`fill`)??``).replaceAll(` `,``).toLowerCase();return t===`white`||t===`#fff`||t===`#ffffff`||t===`rgb(255,255,255)`}function Dw(e){if(e===void 0||!/^-?\d+(?:\.\d+)?$/.test(e.trim()))return null;let t=Number(e);return Number.isFinite(t)?t:null}function Ow(e,t){let n=e.attributes.get(`width`)?.trim(),r=e.attributes.get(`height`)?.trim();if(n===`100%`&&r===`100%`)return!0;let i=Dw(e.attributes.get(`x`)??`0`),a=Dw(e.attributes.get(`y`)??`0`),o=Dw(n),s=Dw(r);if([i,a,o,s].some(e=>e===null))return!1;let[c,l,u,d]=t,f=.01;return i<=c+f&&a<=l+f&&i+o>=c+u-f&&a+s>=l+d-f}function kw(e,t,n){let r=Sw(e),i=new Set((e.attributes.get(`class`)??``).toLowerCase().split(/\s+/));return r===`rect`&&i.has(`backdrop`)||r===`rect`&&t!==null&&Ew(e)&&Ow(e,t)?!0:n===`graphviz`&&r===`polygon`&&Ew(e)&&(e.attributes.get(`stroke`)??``).toLowerCase()===`none`}function Aw(e,t,n){let r=Sw(e)===`svg`?ww(e)??t:t;e.children=e.children.filter(e=>e.type===`text`||!kw(e,r,n)&&(Aw(e,r,n),!0))}function jw(e,t){let n=(e.attributes.get(`style`)??``).split(`;`).map(e=>e.trim()).filter(Boolean).filter(e=>!/^background(?:-color)?\s*:/i.test(e));n.push(`background-color:${t}`),e.attributes.set(`style`,`${n.join(`;`)};`)}function Mw(e,t=[],n=[]){return{type:`element`,name:e,attributes:new Map(t),children:n}}function Nw(e,t,n,r){let i=[],a=null;t.title&&i.push(Mw(`title`,[],[{type:`text`,value:t.title}])),t.description&&i.push(Mw(`desc`,[],[{type:`text`,value:t.description}]));let o=ww(e);if((n.padding||n.background||n.frame)&&o===null)throw new mw(`Renderer output has no usable SVG dimensions for presentation settings.`);if(o!==null){let[t,r,s,c]=o,l=n.padding,u=[t-l,r-l,s+l*2,c+l*2];e.attributes.set(`viewBox`,u.join(` `)),e.attributes.has(`width`)&&e.attributes.set(`width`,String(u[2])),e.attributes.has(`height`)&&e.attributes.set(`height`,String(u[3])),n.background&&i.push(Mw(`rect`,[[`x`,String(u[0])],[`y`,String(u[1])],[`width`,String(u[2])],[`height`,String(u[3])],[`fill`,n.background]])),n.frame&&(a=Mw(`rect`,[[`x`,String(u[0]+.5)],[`y`,String(u[1]+.5)],[`width`,String(Math.max(0,u[2]-1))],[`height`,String(Math.max(0,u[3]-1))],[`fill`,`none`],[`stroke`,`#000000`],[`stroke-width`,`1`],[`vector-effect`,`non-scaling-stroke`]]))}n.background&&(Aw(e,o,r),jw(e,n.background)),e.children.unshift(...i),a&&e.children.push(a)}function Pw(e,t,n,r){if(e.length>lw)throw new mw(`Rendered SVG is too large.`);let i=null,a=[],o=0,s=null,c=new cw.SaxesParser({xmlns:!0});c.on(`doctype`,e=>{e.includes(`[`)&&(s=Error(`Internal DOCTYPE subsets are not allowed`))}),c.on(`opentag`,e=>{let t=e.local.toLowerCase(),n=t===`foreignobject`||a.some(e=>Sw(e)===`foreignobject`);if(o>0||uw.has(t)||n&&!dw.has(t)){o++;return}let r=Mw(e.name);for(let t of Object.values(e.attributes))vw(t.name,t.value)&&r.attributes.set(t.name,t.value);let c=a.at(-1);c?c.children.push(r):i===null?i=r:s=Error(`Multiple root elements`),a.push(r)});let l=e=>{if(o>0||e===``)return;let t=a.at(-1);if(t){if(Sw(t)===`style`&&gw(e))throw new mw(`Renderer output contains unsafe CSS.`);t.children.push({type:`text`,value:e})}else e.trim()!==``&&(s=Error(`Text outside root element`))};c.on(`text`,l),c.on(`cdata`,l),c.on(`closetag`,()=>{o>0?o--:a.pop()}),c.on(`error`,e=>{s=e});try{c.write(e).close()}catch(e){if(e instanceof mw)throw e;s=e}if(s!==null||i===null||Sw(i)!==`svg`)throw new mw(`Renderer returned invalid SVG.`);return Nw(i,t,n,r),xw(i)}function Fw(e,t,n){return Math.min(Math.max(e,t),n)}var Iw=class{constructor({stage:e,image:t,status:n,minimap:r,minimapImage:i,minimapViewport:a}){this.stage=e,this.image=t,this.status=n,this.minimap=r,this.minimapImage=i,this.minimapViewport=a,this.scale=1,this.x=0,this.y=0,this.objectUrl=null,this.abortController=null,this.requestNumber=0,this.pendingRender=null,this.renderLoop=null,this.latestRenderKey=null,this.latestSvgBlob=null,this.imageFallbackUrl=null,this.activeImageUrl=null,this.drag=null,this.image.addEventListener(`load`,()=>{this.image.src===this.activeImageUrl&&(this.imageFallbackUrl=null,this.setStatus(`Rendered`,`ready`),this.fit())}),this.image.addEventListener(`error`,()=>this.retryBlockedImage()),this.stage.addEventListener(`pointerdown`,e=>this.startPan(e)),this.stage.addEventListener(`pointermove`,e=>this.pan(e)),this.stage.addEventListener(`pointerup`,e=>this.endPan(e)),this.stage.addEventListener(`pointercancel`,e=>this.endPan(e)),this.stage.addEventListener(`wheel`,e=>this.wheelZoom(e),{passive:!1}),this.minimap.addEventListener(`pointerdown`,e=>this.moveFromMinimap(e)),new ResizeObserver(()=>this.updateTransform()).observe(this.stage)}render({type:e,source:t,options:n={},meta:r={},presentation:i={}}){if(!t.trim()){this.requestNumber++,this.pendingRender=null,this.abortController?.abort(),this.setStatus(`Write something to render.`,`idle`);return}let a=JSON.stringify({type:e,source:t,options:n,meta:r,presentation:i});return this.latestRenderKey===a&&this.latestSvgBlob?Promise.resolve():(this.pendingRender={type:e,source:t,options:n,meta:r,presentation:i,renderKey:a,requestNumber:++this.requestNumber},this.abortController?.abort(),this.renderLoop||=this.drainRenderQueue(),this.renderLoop)}async drainRenderQueue(){try{for(;this.pendingRender;){let e=this.pendingRender;this.pendingRender=null,await this.performRender(e)}}finally{this.renderLoop=null,this.pendingRender&&(this.renderLoop=this.drainRenderQueue())}}async performRender({type:e,source:t,options:n,meta:r,presentation:i,renderKey:a,requestNumber:o}){let s=new AbortController;this.abortController=s,this.setStatus(`Rendering…`,`loading`),this.stage.style.setProperty(`--render-background`,`var(--preview-bg)`);try{let c=iw(e),l;if(c)try{let a=await c.render({type:e,source:t,options:n},s.signal);l=Pw(a.body,r,i,e),this.status.dataset.cache=`browser`,this.status.dataset.renderer=a.runtime}catch(a){if(a.name===`AbortError`)throw a;l=await this.renderThroughGateway({type:e,source:t,options:n,meta:r,presentation:i},s.signal)}else l=await this.renderThroughGateway({type:e,source:t,options:n,meta:r,presentation:i},s.signal);if(o!==this.requestNumber)return;let{blob:u,background:d}=this.normalizedSvgBlob(l);this.latestRenderKey=a,this.latestSvgBlob=u,this.imageFallbackUrl=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(await u.text())}`,this.stage.style.setProperty(`--render-background`,d);let f=URL.createObjectURL(u),p=this.objectUrl;this.objectUrl=f,this.activeImageUrl=f,this.image.src=f,this.minimapImage.src=f,this.image.hidden=!1,this.setStatus(`Loading image…`,`loading`),p&&URL.revokeObjectURL(p)}catch(e){if(e.name===`AbortError`)return;this.setStatus(e.message||`Could not render this diagram.`,`error`)}finally{this.abortController===s&&(this.abortController=null)}}async renderThroughGateway({type:e,source:t,options:n,meta:r,presentation:i},a){let o=await fetch(`/render/v1/svg`,{method:`POST`,headers:{Accept:`image/svg+xml`,"Content-Type":`application/json`},body:JSON.stringify({engine:e,source:t,format:`svg`,options:n,metadata:r,presentation:i}),signal:a});if(!o.ok)throw Error(await this.errorMessage(o));return this.status.dataset.cache=o.headers.get(`X-Diagram-Cache`)?.toLowerCase()??`miss`,this.status.dataset.renderer=o.headers.get(`X-Diagram-Renderer`)?.toLowerCase()??`gateway`,o.text()}retryBlockedImage(){if(this.image.src===this.activeImageUrl){if(this.imageFallbackUrl&&this.activeImageUrl.startsWith(`blob:`)){let e=this.imageFallbackUrl;this.imageFallbackUrl=null,this.objectUrl&&URL.revokeObjectURL(this.objectUrl),this.objectUrl=null,this.activeImageUrl=e,this.image.src=e,this.minimapImage.src=e;return}this.setStatus(`The rendered image was blocked or invalid.`,`error`)}}svgBlobFor(e){let{type:t,source:n,options:r={},meta:i={},presentation:a={}}=e,o=JSON.stringify({type:t,source:n,options:r,meta:i,presentation:a});return this.latestRenderKey===o?this.latestSvgBlob:null}async errorMessage(e){let t=await e.text();if(e.headers.get(`Content-Type`)?.includes(`application/json`))try{let e=JSON.parse(t);if(typeof e?.error?.message==`string`)return e.error.message}catch{}return new DOMParser().parseFromString(t,`text/html`).body.textContent.trim().replace(/\s+/g,` `)||`Render failed with HTTP ${e.status}.`}normalizedSvgBlob(e){let t=new DOMParser().parseFromString(e,`image/svg+xml`).documentElement,n=t.getAttribute(`viewBox`)?.trim().split(/[\s,]+/).map(Number);t.nodeName===`svg`&&n?.length===4&&n.every(Number.isFinite)&&(t.hasAttribute(`width`)||t.setAttribute(`width`,String(n[2])),t.hasAttribute(`height`)||t.setAttribute(`height`,String(n[3])),e=new XMLSerializer().serializeToString(t));let r=t.style.backgroundColor||t.style.background,i=r&&r!==`transparent`?r:`#ffffff`;return{blob:new Blob([e],{type:`image/svg+xml`}),background:i}}setStatus(e,t){this.status.textContent=e,this.status.dataset.state=t}zoom(e){if(this.image.hidden)return;let t=this.stage.getBoundingClientRect();this.zoomAt(e,t.width/2,t.height/2)}zoomAt(e,t,n){let r=Fw(this.scale*e,.1,8),i=(t-this.x)/this.scale,a=(n-this.y)/this.scale;this.x=t-i*r,this.y=n-a*r,this.scale=r,this.updateTransform()}wheelZoom(e){if(this.image.hidden||e.target.closest(`.preview-toolbar, .minimap`))return;e.preventDefault();let t=this.stage.getBoundingClientRect(),n=e.deltaY*(e.deltaMode===WheelEvent.DOM_DELTA_LINE?16:e.deltaMode===WheelEvent.DOM_DELTA_PAGE?t.height:1);this.zoomAt(Math.exp(-Fw(n,-240,240)*.002),e.clientX-t.left,e.clientY-t.top)}oneToOne(){if(this.image.hidden)return;let e=this.stage.getBoundingClientRect();this.scale=1,this.x=(e.width-this.image.naturalWidth)/2,this.y=(e.height-this.image.naturalHeight)/2,this.updateTransform()}fit(){if(!this.image.naturalWidth||!this.image.naturalHeight)return;let e=this.stage.getBoundingClientRect(),t=Math.min(64,e.width*.12);this.scale=Fw(Math.min((e.width-t*2)/this.image.naturalWidth,(e.height-t*2)/this.image.naturalHeight),.1,2),this.x=(e.width-this.image.naturalWidth*this.scale)/2,this.y=(e.height-this.image.naturalHeight*this.scale)/2,this.updateTransform()}updateTransform(){this.image.style.transform=`translate(${this.x}px, ${this.y}px) scale(${this.scale})`,this.updateMinimap()}startPan(e){this.image.hidden||e.button!==0||e.target.closest(`.preview-toolbar, .minimap`)||(this.drag={pointerId:e.pointerId,x:e.clientX,y:e.clientY,originX:this.x,originY:this.y},this.stage.setPointerCapture(e.pointerId),this.stage.dataset.dragging=`true`)}pan(e){!this.drag||e.pointerId!==this.drag.pointerId||(this.x=this.drag.originX+e.clientX-this.drag.x,this.y=this.drag.originY+e.clientY-this.drag.y,this.updateTransform())}endPan(e){!this.drag||e.pointerId!==this.drag.pointerId||(this.drag=null,delete this.stage.dataset.dragging)}moveFromMinimap(e){if(!this.image.naturalWidth||!this.image.naturalHeight)return;let t=this.minimap.getBoundingClientRect(),n=Math.min(t.width/this.image.naturalWidth,t.height/this.image.naturalHeight),r=(t.width-this.image.naturalWidth*n)/2,i=(t.height-this.image.naturalHeight*n)/2,a=(e.clientX-t.left-r)/n,o=(e.clientY-t.top-i)/n,s=this.stage.getBoundingClientRect();this.x=s.width/2-a*this.scale,this.y=s.height/2-o*this.scale,this.updateTransform()}updateMinimap(){if(!this.image.naturalWidth||!this.image.naturalHeight)return;let e=this.stage.getBoundingClientRect(),t=this.image.naturalWidth*this.scale,n=this.image.naturalHeight*this.scale,r=this.x>=0&&this.y>=0&&this.x+t<=e.width&&this.y+n<=e.height;if(this.minimap.hidden=r,r)return;let i=this.minimap.getBoundingClientRect(),a=Math.min(i.width/this.image.naturalWidth,i.height/this.image.naturalHeight),o=(i.width-this.image.naturalWidth*a)/2,s=(i.height-this.image.naturalHeight*a)/2,c=Fw(-this.x/this.scale,0,this.image.naturalWidth),l=Fw(-this.y/this.scale,0,this.image.naturalHeight),u=Fw((e.width-this.x)/this.scale,0,this.image.naturalWidth),d=Fw((e.height-this.y)/this.scale,0,this.image.naturalHeight);this.minimapViewport.style.left=`${o+c*a}px`,this.minimapViewport.style.top=`${s+l*a}px`,this.minimapViewport.style.width=`${Math.max(4,(u-c)*a)}px`,this.minimapViewport.style.height=`${Math.max(4,(d-l)*a)}px`}},Lw=`diagram.zip:draft:local:v2`,Rw=`diagram.zip:draft:alias:v1:`,zw=`diagram.zip:write:v1:`,Bw=new ke,Vw=new DC,Hw,Uw=!1,Ww,Gw=!1,Kw=``,Q={aliasId:null,contentId:null,renderId:null,revision:null,mode:`open`,savedMode:null,writeCapability:null,savedState:null,savedSnapshot:null,bundleKey:null,keyEnvelope:null,encryptedContent:null,encryptedMetadata:null,keyEnvelopeDirty:!1,dirty:!0},qw=new Map;document.querySelector(`#app`).innerHTML=`1648+ <main class="app-shell">1649+ <header class="app-header">1650+ <a class="brand" href="/" aria-label="New diagram"><img class="brand-mark" src="/diagram.zip/icon.svg" alt=""><span>diagram.zip</span></a>1651+ <div class="header-meta">1652+ <span class="render-status" data-state="idle" role="status">Ready</span>1653+ <label class="type-picker">1654+ <span class="sr-only">Diagram type</span>1655+ <select id="diagram-type"></select>1656+ </label>1657+ <button class="secondary-action" id="details" type="button">Details</button>1658+ <button class="secondary-action" id="save" type="button">Save</button>1659+ <button class="primary-action" id="share" type="button">Share</button>1660+ </div>1661+ </header>1662+1663+ <div class="mobile-tabs" role="tablist" aria-label="Workspace panel">1664+ <button type="button" role="tab" aria-selected="true" data-panel="editor">Edit</button>1665+ <button type="button" role="tab" aria-selected="false" data-panel="preview">Preview</button>1666+ </div>1667+1668+ <div class="workspace" data-mobile-panel="editor">1669+ <section class="editor-panel" aria-label="Diagram source">1670+ <div id="editor"></div>1671+ </section>1672+ <section class="preview-panel" aria-label="Diagram preview">1673+ <div class="preview-stage" id="preview-stage">1674+ <img id="preview-image" alt="Rendered diagram" draggable="false" hidden>1675+ <p class="preview-empty">Your diagram will appear here.</p>1676+ <div class="preview-toolbar" aria-label="Preview controls">1677+ <button type="button" data-preview-action="zoom-out" aria-label="Zoom out">−</button>1678+ <button type="button" data-preview-action="zoom-in" aria-label="Zoom in">+</button>1679+ <button type="button" data-preview-action="fit">Fit</button>1680+ <button type="button" data-preview-action="one-to-one">1:1</button>1681+ </div>1682+ <div class="minimap" id="minimap" aria-label="Preview minimap" hidden>1683+ <img id="minimap-image" alt="" draggable="false">1684+ <span id="minimap-viewport" aria-hidden="true"></span>1685+ </div>1686+ </div>1687+ </section>1688+ </div>1689+ </main>1690+1691+ <dialog id="details-dialog" aria-labelledby="details-title">1692+ <form method="dialog" class="dialog-card">1693+ <div class="dialog-header">1694+ <h1 id="details-title">Diagram details</h1>1695+ <button class="icon-button" value="cancel" aria-label="Close">×</button>1696+ </div>1697+ <div class="details-fields">1698+ <label>1699+ <span>Title</span>1700+ <input id="diagram-title" maxlength="200" placeholder="Untitled diagram">1701+ </label>1702+ <label>1703+ <span>Description</span>1704+ <textarea id="diagram-description" maxlength="2000" rows="4" placeholder="What does this diagram show?"></textarea>1705+ </label>1706+ <fieldset class="presentation-fields">1707+ <legend>Presentation</legend>1708+ <label>1709+ <span>Canvas</span>1710+ <select id="diagram-background">1711+ <option value="">Renderer default</option>1712+ <option value="#ffffff">White</option>1713+ <option value="#f4f4f4">Soft gray</option>1714+ </select>1715+ </label>1716+ <label>1717+ <span>Padding</span>1718+ <div class="number-field"><input id="diagram-padding" type="number" min="0" max="256" step="4"><span>px</span></div>1719+ </label>1720+ <label class="checkbox-field"><input id="diagram-frame" type="checkbox"><span>Frame</span></label>1721+ </fieldset>1722+ <fieldset class="privacy-fields">1723+ <legend>Privacy</legend>1724+ <div>1725+ <strong id="privacy-label">Open</strong>1726+ <p id="privacy-description">Anyone with the read link can open and embed this diagram.</p>1727+ </div>1728+ <div class="privacy-actions">1729+ <button class="secondary-action" id="lock-diagram" type="button">Lock with password</button>1730+ <button class="secondary-action" id="change-password" type="button" hidden>Change password</button>1731+ <button class="secondary-action" id="unlock-diagram" type="button" hidden>Remove password</button>1732+ </div>1733+ </fieldset>1734+ </div>1735+ <div class="dialog-actions">1736+ <button class="primary-action" value="done">Done</button>1737+ </div>1738+ </form>1739+ </dialog>1740+1741+ <dialog id="share-dialog" aria-labelledby="share-title">1742+ <form method="dialog" class="dialog-card">1743+ <div class="dialog-header">1744+ <h1 id="share-title">Share diagram</h1>1745+ <button class="icon-button" value="cancel" aria-label="Close">×</button>1746+ </div>1747+ <p class="share-status" id="share-status"></p>1748+ <div class="share-options">1749+ <label><span>Read link</span><div><input id="viewer-link" readonly><button type="button" data-copy="viewer-link">Copy</button></div></label>1750+ <label><span>Edit link</span><div><input id="editor-link" readonly><button type="button" data-copy="editor-link">Copy</button></div><small id="editor-link-note">Anyone with this link can update the diagram.</small></label>1751+ <label><span>SVG image</span><div><input id="image-link" readonly><button type="button" data-copy="image-link">Copy</button></div><small id="image-link-note"></small></label>1752+ <label><span>Markdown</span><div><input id="markdown-link" readonly><button type="button" data-copy="markdown-link">Copy</button></div></label>1753+ </div>1754+ <div class="dialog-actions share-actions">1755+ <button class="primary-action" id="share-save" type="button">Save</button>1756+ </div>1757+ </form>1758+ </dialog>1759+1760+ <dialog id="conflict-dialog" aria-labelledby="conflict-title">1761+ <form method="dialog" class="dialog-card">1762+ <div class="dialog-header">1763+ <h1 id="conflict-title">Save conflict</h1>1764+ <button class="icon-button" value="cancel" aria-label="Close">×</button>1765+ </div>1766+ <p class="dialog-copy">Reload the saved version, or keep your work by saving it as a new diagram.</p>1767+ <div class="dialog-actions conflict-actions">1768+ <button class="secondary-action" value="reload">Reload saved</button>1769+ <button class="primary-action" value="copy">Save as new</button>1770+ </div>1771+ </form>1772+ </dialog>1773+1774+ <dialog id="password-dialog" aria-labelledby="password-title">1775+ <form class="dialog-card" id="password-form">1776+ <div class="dialog-header">1777+ <h1 id="password-title">Enter password</h1>1778+ <button class="icon-button" id="password-cancel" type="button" aria-label="Close">×</button>1779+ </div>1780+ <p class="dialog-copy" id="password-copy"></p>1781+ <div class="details-fields">1782+ <label><span>Password</span><input id="diagram-password" type="password" autocomplete="current-password" required></label>1783+ <label id="password-confirm-field" hidden><span>Confirm password</span><input id="diagram-password-confirm" type="password" autocomplete="new-password"></label>1784+ </div>1785+ <p class="form-error" id="password-error" role="alert"></p>1786+ <div class="dialog-actions">1787+ <button class="primary-action" id="password-submit" type="submit">Unlock</button>1788+ </div>1789+ </form>1790+ </dialog>1791+1792+ <div class="toast" id="toast" role="status" aria-live="polite"></div>1793+`;var Jw=document.querySelector(`#diagram-type`),Yw=document.querySelector(`#diagram-title`),Xw=document.querySelector(`#diagram-description`),Zw=document.querySelector(`#diagram-background`),Qw=document.querySelector(`#diagram-padding`),$w=document.querySelector(`#diagram-frame`);for(let{id:e,label:t}of mx)Jw.add(new Option(t,e));var eT=await uT(),tT=sC(eT.meta),nT=cC(eT.presentation);Jw.value=eT.type,Yw.value=tT.title,Xw.value=tT.description,Zw.value=nT.background,Qw.value=String(nT.padding),$w.checked=nT.frame,RT(),Ww=eT.type,qw.set(eT.type,eT);var rT=sd.define([{tag:J.keyword,color:`var(--syntax-keyword)`,fontWeight:`650`},{tag:J.string,color:`var(--syntax-string)`},{tag:[J.comment,J.lineComment,J.blockComment],color:`var(--syntax-comment)`,fontStyle:`italic`},{tag:[J.number,J.bool],color:`var(--syntax-number)`},{tag:[J.operator,J.punctuation],color:`var(--syntax-operator)`},{tag:[J.variableName,J.typeName],color:`var(--syntax-variable)`}]),iT=new U({state:M.create({doc:eT.source,extensions:[j_,Bw.of(yx(eT.type)),dd(rT),U.theme({"&":{height:`100%`,backgroundColor:`transparent`},".cm-scroller":{fontFamily:`var(--font-mono)`,lineHeight:`1.65`},".cm-content":{padding:`28px 10px 80px`},".cm-gutters":{backgroundColor:`transparent`,border:`0`,paddingLeft:`12px`},".cm-activeLine, .cm-activeLineGutter":{backgroundColor:`var(--editor-active-line)`},".cm-cursor, .cm-dropCursor":{borderLeftColor:`var(--ink)`},"&.cm-focused":{outline:`none`}}),U.updateListener.of(e=>{e.docChanged&&!Uw&&sT()})]}),parent:document.querySelector(`#editor`)}),aT=new Iw({stage:document.querySelector(`#preview-stage`),image:document.querySelector(`#preview-image`),status:document.querySelector(`.render-status`),minimap:document.querySelector(`#minimap`),minimapImage:document.querySelector(`#minimap-image`),minimapViewport:document.querySelector(`#minimap-viewport`)});Jw.addEventListener(`change`,()=>{let e=Jw.value;dT(pC(qw,Ww,e,oT(),fC))}),document.querySelector(`#details`).addEventListener(`click`,()=>{document.querySelector(`#details-dialog`).showModal(),Yw.focus()});for(let e of[Yw,Xw,Zw,Qw,$w])e.addEventListener(`input`,()=>{RT(),clearTimeout(lT.timeout),lT.timeout=setTimeout(lT,220)});document.querySelector(`#details-dialog`).addEventListener(`close`,lT),document.querySelector(`#lock-diagram`).addEventListener(`click`,bT),document.querySelector(`#change-password`).addEventListener(`click`,xT),document.querySelector(`#unlock-diagram`).addEventListener(`click`,ST),document.querySelector(`#save`).addEventListener(`click`,()=>hT()),document.querySelector(`#share`).addEventListener(`click`,fT),document.querySelector(`#share-save`).addEventListener(`click`,async()=>{await hT(),pT()}),document.querySelector(`.brand`).addEventListener(`click`,e=>{e.preventDefault(),confirm(`Start a new diagram?`)&<()}),document.querySelectorAll(`[data-preview-action]`).forEach(e=>{e.addEventListener(`click`,()=>{let t=e.dataset.previewAction;t===`zoom-out`&&aT.zoom(.8),t===`zoom-in`&&aT.zoom(1.25),t===`fit`&&aT.fit(),t===`one-to-one`&&aT.oneToOne()})}),document.querySelectorAll(`.mobile-tabs button`).forEach(e=>{e.addEventListener(`click`,()=>{document.querySelector(`.workspace`).dataset.mobilePanel=e.dataset.panel,document.querySelectorAll(`.mobile-tabs button`).forEach(t=>{t.setAttribute(`aria-selected`,String(t===e))}),e.dataset.panel===`preview`&&aT.fit()})}),document.querySelectorAll(`[data-copy]`).forEach(e=>{e.addEventListener(`click`,async()=>{let t=document.querySelector(`#${e.dataset.copy}`);t.value&&(await zT(t.value),$(`Copied`))})}),window.addEventListener(`popstate`,()=>location.reload()),window.addEventListener(`keydown`,e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),hT())});function oT(){let e=Math.min(256,Math.max(0,Number.parseInt(Qw.value,10)||0));return{type:Jw.value,source:iT.state.doc.toString(),options:{},meta:sC({title:Yw.value,description:Xw.value}),presentation:cC({background:Zw.value,padding:e,frame:$w.checked})}}function sT(e=1200){clearTimeout(Hw),Hw=setTimeout(cT,e)}function cT(e=!0){let t=oT();AT(t),Q.dirty=Q.keyEnvelopeDirty||Q.savedSnapshot!==DT(t,Q.mode),FT(),IT(),e&&aT.render(t)}function lT(){clearTimeout(lT.timeout),cT()}async function uT(){let e=yC(location.pathname);if(e){let t=CC(location.hash);t&&MT(e,t),location.hash&&history.replaceState(null,``,`${location.pathname}${location.search}`);try{let n=await Vw.getAlias(e),r=t??NT(e);if(n.mode===`locked`){let e=await CT(n);return e?(PT(n,r,e.state,e.bundleKey),e.state):(Kw=`A password is required to open this diagram.`,fC(aC))}PT(n,r,n.state);let i=kT(`${Rw}${e}`);return i?.revision===n.revision?i.state:n.state}catch(e){Kw=e instanceof wC?e.message:`This saved diagram could not be loaded.`}}location.hash&&history.replaceState(null,``,`${location.pathname}${location.search}`);let t=kT(Lw);return t?t.state:fC(aC)}function dT(e,t=!0){if(!bx(e.type))throw Error(`Unsupported diagram type.`);let n=sC(e.meta),r=cC(e.presentation);Uw=!0,Ww=e.type,qw.set(e.type,{...e,meta:n,presentation:r}),Jw.value=e.type,Yw.value=n.title,Xw.value=n.description,Zw.value=r.background,Qw.value=String(r.padding),$w.checked=r.frame,RT(),iT.dispatch({changes:{from:0,to:iT.state.doc.length,insert:e.source},effects:Bw.reconfigure(yx(e.type))}),Uw=!1,t?cT():aT.render(oT())}function fT(){cT(),pT(),document.querySelector(`#share-dialog`).showModal()}function pT(){let e=!!Q.aliasId,t=e&&Q.savedMode===`locked`,n=e?bC(location.origin,Q.aliasId):``,r=e&&Q.writeCapability?xC(location.origin,Q.aliasId,Q.writeCapability):``,i=t?null:Q.savedState,a=i?SC(location.origin,Q.aliasId,`svg`):``,o=document.querySelector(`#image-link`),s=document.querySelector(`#markdown-link`),c=i?.meta.title.trim().replace(/[\[\]\r\n]/g,` `)||`Diagram`;mT(`viewer-link`,n,`Save to create a read link`),mT(`editor-link`,r,e?`No write capability on this device`:`Save to create an edit link`),mT(`image-link`,a,t?`Encrypted diagrams cannot be embedded`:e?`Unavailable for this diagram`:`Save to create an image link`),mT(`markdown-link`,a?``:``,t?`Encrypted diagrams cannot be embedded`:e?`Unavailable for this diagram`:`Save to create Markdown`),document.querySelector(`#editor-link-note`).textContent=r?`Anyone with this link can update the diagram.`:e?`This device has read-only access. Save a copy to create a new edit link.`:`The edit link is a bearer credential and appears after saving.`,document.querySelector(`#image-link-note`).textContent=t?`This diagram is encrypted in your browser. Image embeds are disabled because they cannot ask for its password.`:``,o.dataset.state=t?`unavailable`:`ready`,s.dataset.state=t?`unavailable`:`ready`;let l=document.querySelector(`#share-status`),u=document.querySelector(`#share-save`);u.hidden=e&&!Q.dirty,e?Q.dirty&&Q.writeCapability?(l.textContent=`These links show the last saved version. Save your changes before sharing.`,u.textContent=`Save changes`):Q.dirty?(l.textContent=`You are editing a read-only diagram. Save a copy to share your changes.`,u.textContent=`Save as new`):l.textContent=t?Q.writeCapability?`The read link asks for the password. The edit link also grants permission to save changes.`:`The read link asks for the password. This device has read-only access.`:Q.writeCapability?`Copy a read link, or share the edit capability carefully.`:`This diagram is read-only on this device.`:(l.textContent=`Save this diagram to create stable share links.`,u.textContent=`Save diagram`)}function mT(e,t,n){let r=document.querySelector(`#${e}`),i=document.querySelector(`[data-copy="${e}"]`);r.value=t,r.placeholder=t?``:n,i.disabled=!t}async function hT(){if(Gw)return!1;cT(!1);let e=oT();if(Q.aliasId&&!Q.dirty)return $(`Already saved`),!0;Gw=!0,FT();try{if(Q.aliasId&&Q.writeCapability)return PT(Q.mode===`locked`?await Vw.updateLockedAlias(Q.aliasId,await _T(e),Q.revision,Q.writeCapability):await Vw.updateAlias(Q.aliasId,e,Q.revision,Q.writeCapability),Q.writeCapability,e,Q.mode===`locked`?Q.bundleKey:null),jT(`${Rw}${Q.aliasId}`),await vT(e),$(`Saved`),!0;let t=!!Q.aliasId;return await gT(e),$(t?`Saved as a new diagram`:`Saved`),!0}catch(t){return t instanceof wC&&t.status===412&&Q.aliasId?await TT(e):($(t instanceof Error?t.message:`Could not save this diagram.`),!1)}finally{Gw=!1,FT()}}async function gT(e){let t=Q.aliasId,n=t?`${Rw}${t}`:Lw,r=Q.bundleKey,i=Q.mode===`locked`?await Vw.createLockedAlias(await _T(e)):await Vw.createAlias(e);PT(i,i.writeCapability,e,Q.mode===`locked`?r:null),MT(i.aliasId,i.writeCapability),jT(n),history.pushState(null,``,`/d/${i.aliasId}`),await vT(e)}async function _T(e){if(!(Q.bundleKey instanceof Uint8Array)||!Q.keyEnvelope)throw Error(`This diagram is missing its browser encryption key.`);return Q.savedMode===`locked`&&Q.savedSnapshot===DT(e,`locked`)&&Q.encryptedContent&&Q.encryptedMetadata?{mode:`locked`,encryptedContent:Q.encryptedContent,encryptedMetadata:Q.encryptedMetadata,keyEnvelope:Q.keyEnvelope}:qC(e,Q.bundleKey,Q.keyEnvelope)}async function vT(e){if(!Q.aliasId||!Q.writeCapability)return;await aT.render(e);let t=aT.svgBlobFor(e);if(!t)return;let n=[[`svg`,t]];try{n.push([`png`,await yT(t)])}catch{}let r=n.map(async([e,t])=>{let n=Q.mode===`locked`?await XC(t,Q.bundleKey,e):t;return Vw.uploadRender({aliasId:Q.aliasId,renderId:Q.renderId,revision:Q.revision,writeCapability:Q.writeCapability,format:e,mode:Q.mode,render:n})});(await Promise.allSettled(r)).every(e=>e.status===`rejected`)&&aT.setStatus(`Saved; render cache unavailable`,`ready`)}async function yT(e){let t=URL.createObjectURL(e);try{let e=new Image;e.src=t,await e.decode();let n=Math.min(1,4096/Math.max(e.naturalWidth,e.naturalHeight)),r=Math.max(1,Math.round(e.naturalWidth*n)),i=Math.max(1,Math.round(e.naturalHeight*n)),a=document.createElement(`canvas`);a.width=r,a.height=i;let o=a.getContext(`2d`);if(!o)throw Error(`Canvas is unavailable.`);o.drawImage(e,0,0,r,i);let s=await new Promise(e=>a.toBlob(e,`image/png`));if(!s)throw Error(`Could not create a PNG render.`);return s}finally{URL.revokeObjectURL(t)}}async function bT(){let e=await wT({title:`Lock diagram`,copy:`The source, metadata, and saved render will be encrypted in this browser. The password cannot be recovered.`,submitLabel:`Lock diagram`,confirm:!0});if(e!==null)try{let{bundleKey:t,payload:n}=await JC(oT(),e);Q.mode=`locked`,Q.bundleKey=t,Q.keyEnvelope=n.keyEnvelope,Q.encryptedContent=n.encryptedContent,Q.encryptedMetadata=n.encryptedMetadata,Q.keyEnvelopeDirty=!0,jT(Q.aliasId?`${Rw}${Q.aliasId}`:Lw),cT(!1),$(`Locked in this browser — save to persist`)}catch(e){$(e instanceof Error?e.message:`Could not lock this diagram.`)}}async function xT(){if(Q.mode!==`locked`||!(Q.bundleKey instanceof Uint8Array))return;let e=await wT({title:`Change password`,copy:`Only the encrypted bundle key will be rewrapped. The diagram content does not need to be re-encrypted.`,submitLabel:`Change password`,confirm:!0});if(e!==null)try{Q.keyEnvelope=await GC(Q.bundleKey,e),Q.keyEnvelopeDirty=!0,cT(!1),$(`Password changed — save to persist`)}catch(e){$(e instanceof Error?e.message:`Could not change the password.`)}}function ST(){Q.mode===`locked`&&confirm(`Remove password protection? The next save will store the diagram in plaintext.`)&&(Q.mode=`open`,Q.keyEnvelopeDirty=!1,cT(!1),$(`Password removed — save to persist`))}async function CT(e){for(;;){let t=await wT({title:`Unlock diagram`,copy:`Decryption happens only in this browser. The password is never sent to diagram.zip.`,submitLabel:`Unlock`,confirm:!1});if(t===null)return null;try{return await YC(e,t)}catch(e){$(e instanceof Error?e.message:`Could not unlock this diagram.`)}}}function wT({title:e,copy:t,submitLabel:n,confirm:r}){let i=document.querySelector(`#password-dialog`),a=document.querySelector(`#password-form`),o=document.querySelector(`#diagram-password`),s=document.querySelector(`#diagram-password-confirm`),c=document.querySelector(`#password-confirm-field`),l=document.querySelector(`#password-error`);return document.querySelector(`#password-title`).textContent=e,document.querySelector(`#password-copy`).textContent=t,document.querySelector(`#password-submit`).textContent=n,c.hidden=!r,o.autocomplete=r?`new-password`:`current-password`,o.value=``,s.value=``,l.textContent=``,new Promise(e=>{let t=!1,n=n=>{t||(t=!0,a.removeEventListener(`submit`,c),document.querySelector(`#password-cancel`).removeEventListener(`click`,u),i.removeEventListener(`cancel`,u),i.removeEventListener(`close`,d),e(n))},c=e=>{e.preventDefault();let t=o.value;if(r&&t.length<8){l.textContent=`Use at least 8 characters.`,o.focus();return}if(r&&t!==s.value){l.textContent=`The passwords do not match.`,s.focus();return}i.close(),n(t)},u=e=>{e.preventDefault(),i.close(),n(null)},d=()=>n(null);a.addEventListener(`submit`,c),document.querySelector(`#password-cancel`).addEventListener(`click`,u),i.addEventListener(`cancel`,u),i.addEventListener(`close`,d),i.showModal(),o.focus()})}async function TT(e){let t=await ET();if(t===`reload`){let e=Q.aliasId,t=Q.writeCapability;try{let n=await Vw.getAlias(e),r=n.state,i=null;if(n.mode===`locked`){let e=await CT(n);if(!e)return!1;r=e.state,i=e.bundleKey}return PT(n,t,r,i),jT(`${Rw}${e}`),dT(r,!1),FT(),$(`Reloaded saved diagram`),!0}catch(e){return $(e instanceof Error?e.message:`Could not reload this diagram.`),!1}}return t===`copy`&&(await gT(e),$(`Saved as a new diagram`),!0)}function ET(){let e=document.querySelector(`#conflict-dialog`);return e.returnValue=``,e.showModal(),new Promise(t=>{e.addEventListener(`close`,()=>t(e.returnValue),{once:!0})})}function DT(e,t=`open`){return JSON.stringify({mode:t,type:e.type,source:e.source,options:e.options??{},meta:sC(e.meta),presentation:cC(e.presentation)})}function OT(e){if(!e||typeof e!=`object`||!bx(e.type)||typeof e.source!=`string`)return null;try{return{type:e.type,source:e.source,options:e.options??{},meta:sC(e.meta),presentation:cC(e.presentation)}}catch{return null}}function kT(e){try{let t=JSON.parse(localStorage.getItem(e)),n=OT(t?.state);return n?{state:n,revision:t.revision??null}:null}catch{return null}}function AT(e){if(Q.mode===`locked`)return;let t=Q.aliasId?`${Rw}${Q.aliasId}`:Lw;try{localStorage.setItem(t,JSON.stringify({state:e,revision:Q.revision}))}catch{}}function jT(e){try{localStorage.removeItem(e)}catch{}}function MT(e,t){try{localStorage.setItem(`${zw}${e}`,t)}catch{}}function NT(e){try{return CC(`#w=${localStorage.getItem(`${zw}${e}`)??``}`)}catch{return null}}function PT(e,t,n,r=null){Q={aliasId:e.aliasId,contentId:e.contentId,renderId:e.renderId,revision:e.revision,mode:e.mode,savedMode:e.mode,writeCapability:t,savedState:n,savedSnapshot:DT(n,e.mode),bundleKey:r,keyEnvelope:e.mode===`locked`?e.keyEnvelope:null,encryptedContent:e.mode===`locked`?e.encryptedContent:null,encryptedMetadata:e.mode===`locked`?e.encryptedMetadata:null,keyEnvelopeDirty:!1,dirty:!1},IT(),FT()}function FT(){let e=document.querySelector(`#save`);if(Gw){e.textContent=`Saving…`,e.disabled=!0;return}if(Q.aliasId&&!Q.dirty){e.textContent=`Saved`,e.disabled=!0;return}e.textContent=Q.aliasId&&!Q.writeCapability?`Save copy`:`Save`,e.disabled=!1}function IT(){let e=Q.mode===`locked`;document.querySelector(`#privacy-label`).textContent=e?`Password locked`:`Open`,document.querySelector(`#privacy-description`).textContent=e?`Source, metadata, and saved renders are encrypted in your browser. Password-locked diagrams cannot be embedded.`:`Anyone with the read link can open and embed this diagram.`,document.querySelector(`#lock-diagram`).hidden=e,document.querySelector(`#change-password`).hidden=!e,document.querySelector(`#unlock-diagram`).hidden=!e}function LT(){Q={aliasId:null,contentId:null,renderId:null,revision:null,mode:`open`,savedMode:null,writeCapability:null,savedState:null,savedSnapshot:null,bundleKey:null,keyEnvelope:null,encryptedContent:null,encryptedMetadata:null,keyEnvelopeDirty:!1,dirty:!0},qw.clear(),history.pushState(null,``,`/`),dT(fC(aC))}function RT(){let e=Yw.value.trim(),t=Xw.value.trim();document.title=e?`${e} — diagram.zip`:`diagram.zip`,document.querySelector(`meta[name="description"]`).content=t||`Create diagrams from text and share them as a link.`}async function zT(e){if(navigator.clipboard)return navigator.clipboard.writeText(e);let t=document.createElement(`textarea`);t.value=e,document.body.append(t),t.select(),document.execCommand(`copy`),t.remove()}function $(e){let t=document.querySelector(`#toast`);t.textContent=e,t.dataset.visible=`true`,clearTimeout($.timeout),$.timeout=setTimeout(()=>delete t.dataset.visible,1800)}cT(),Kw&&$(Kw);\ No newline at end of file@@ -1,1789 +0,0 @@
1-(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=[],t=[];(()=>{let n=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o`.split(`,`).map(e=>e?parseInt(e,36):1);for(let r=0,i=0;r<n.length;r++)(r%2?t:e).push(i+=n[r])})();function n(n){if(n<768)return!1;for(let r=0,i=e.length;;){let a=r+i>>1;if(n<e[a])i=a;else if(n>=t[a])r=a+1;else return!0;if(r==i)return!1}}function r(e){return e>=127462&&e<=127487}var i=8205;function a(e,t,n=!0,r=!0){return(n?o:s)(e,t,r)}function o(e,t,a){if(t==e.length)return t;t&&l(e.charCodeAt(t))&&u(e.charCodeAt(t-1))&&t--;let o=c(e,t);for(t+=d(o);t<e.length;){let s=c(e,t);if(o==i||s==i||a&&n(s))t+=d(s),o=s;else if(r(s)){let n=0,i=t-2;for(;i>=0&&r(c(e,i));)n++,i-=2;if(n%2==0)break;t+=2}else break}return t}function s(e,t,n){for(;t>1;){let r=o(e,t-2,n);if(r<t)return r;t--}return 0}function c(e,t){let n=e.charCodeAt(t);if(!u(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return l(r)?(n-55296<<10)+(r-56320)+65536:n}function l(e){return e>=56320&&e<57344}function u(e){return e>=55296&&e<56320}function d(e){return e<65536?1:2}var f=class e{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=b(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),m.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=b(this,e,t);let n=[];return this.decompose(e,t,n,0),m.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new v(this),i=new v(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new v(this,e)}iterRange(e,t=this.length){return new y(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new ee(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new p(t):m.from(p.split(t,[]))}},p=class e extends f{constructor(e,t=h(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new te(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(_(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=g(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=b(this,t,n);let i=g(this.text,g(r.text,_(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):m.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=`2-`){[e,t]=b(this,e,t);let r=``;for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],s=i+o.length;i>e&&a&&(r+=n),e<s&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},m=class e extends f{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e<=s&&t>=a){let i=r&(a<=e|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=b(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(t>=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines<l>>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=`3-`){[e,t]=b(this,e,t);let r=``;for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],s=a+o.length;a>e&&i&&(r+=n),e<s&&t>a&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new p(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof p&&c&&(n=u[u.length-1])instanceof p&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new p(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}};f.empty=new p([``],0);function h(e){let t=-1;for(let n of e)t+=n.length+1;return t}function g(e,t,n=0,r=1e9){for(let i=0,a=0,o=!0;a<e.length&&i<=r;a++){let s=e[a],c=i+s.length;c>=n&&(c>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),o?(t[t.length-1]+=s,o=!1):t.push(s)),i=c+1}return t}function _(e,t,n){return g(e,[``],t,n)}var v=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=``,this.nodes=[e],this.offsets=[t>0?1:(e instanceof p?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof p?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`4-`,this;e--}else if(r instanceof p){let i=r.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=e==0?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[a+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof p?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},y=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new v(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=``,this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=``}},ee=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=``,this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=``,this.afterBreak=!1):t?(this.done=!0,this.value=``):n?this.afterBreak?this.value=``:(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<`u`&&(f.prototype[Symbol.iterator]=function(){return this.iter()},v.prototype[Symbol.iterator]=y.prototype[Symbol.iterator]=ee.prototype[Symbol.iterator]=function(){return this});var te=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function b(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function x(e,t,n=!0,r=!0){return a(e,t,n,r)}function ne(e){return e>=56320&&e<57344}function re(e){return e>=55296&&e<56320}function S(e,t){let n=e.charCodeAt(t);if(!re(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return ne(r)?(n-55296<<10)+(r-56320)+65536:n}function ie(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function ae(e){return e<65536?1:2}var oe=/\r\n?|\n/,C=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(C||={}),se=class e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],a=this.sections[t++];a<0?(e(n,r,i),r+=i):r+=a,n+=i}}iterChangedRanges(e,t=!1){ue(this,e,t)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],r=this.sections[e++];r<0?t.push(n,r):t.push(r,n)}return new e(t)}composeDesc(e){return this.empty?e:e.empty?this:fe(this,e)}mapDesc(e,t=!1){return e.empty?this:de(this,e,t)}mapPos(e,t=-1,n=C.Simple){let r=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],s=this.sections[a++],c=r+o;if(s<0){if(c>e)return i+(e-r);i+=o}else{if(n!=C.Simple&&c>=e&&(n==C.TrackDel&&r<e&&c>e||n==C.TrackBefore&&r<e||n==C.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],a=this.sections[n++],o=r+i;if(a>=0&&r<=t&&o>=e)return r<e&&o>t?`cover`:!0;r=o}return!1}toString(){let e=``;for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?` `:``)+n+(r>=0?`:`+r:``)}return e}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!=`number`))throw RangeError(`Invalid JSON representation of ChangeDesc`);return new e(t)}static create(t){return new e(t)}},ce=class e extends se{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError(`Applying change set to a document with the wrong length`);return ue(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return de(this,e,t,!0)}invert(t){let n=this.sections.slice(),r=[];for(let e=0,i=0;e<n.length;e+=2){let a=n[e],o=n[e+1];if(o>=0){n[e]=o,n[e+1]=a;let s=e>>1;for(;r.length<s;)r.push(f.empty);r.push(a?t.slice(i,i+a):f.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:fe(this,e,!0)}map(e,t=!1){return e.empty?this:de(this,e,t,!0)}iterChanges(e,t=!1){ue(this,e,t)}get desc(){return se.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new pe(this);done:for(let e=0,o=0;;){let s=e==t.length?1e9:t[e++];for(;o<s||o==s&&a.len==0;){if(a.done)break done;let e=Math.min(a.len,s-o);w(i,e,-1);let t=a.ins==-1?-1:a.off==0?a.ins:0;w(n,e,t),t>0&&le(r,n,a.text),a.forward(e),o+=e}let c=t[e++];for(;o<c;){if(a.done)break done;let e=Math.min(a.len,c-o);w(n,e,-1),w(i,e,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(e),o+=e}}return{changes:new e(n,r),filtered:se.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(t,n,r){let i=[],a=[],o=0,s=null;function c(t=!1){if(!t&&!i.length)return;o<n&&w(i,n-o,-1);let r=new e(i,a);s=s?s.compose(r.map(s)):r,i=[],a=[],o=0}function l(t){if(Array.isArray(t))for(let e of t)l(e);else if(t instanceof e){if(t.length!=n)throw RangeError(`Mismatched change set length (got ${t.length}, expected ${n})`);c(),s=s?s.compose(t.map(s)):t}else{let{from:e,to:s=e,insert:l}=t;if(e>s||e<0||s>n)throw RangeError(`Invalid change range ${e} to ${s} (in doc of length ${n})`);let u=l?typeof l==`string`?f.of(l.split(r||oe)):l:f.empty,d=u.length;if(e==s&&d==0)return;e<o&&c(),e>o&&w(i,e-o,-1),w(i,s-e,d),le(a,i,u),o=s}}return l(t),c(!s),s}static empty(t){return new e(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw RangeError(`Invalid JSON representation of ChangeSet`);let n=[],r=[];for(let e=0;e<t.length;e++){let i=t[e];if(typeof i==`number`)n.push(i,-1);else if(!Array.isArray(i)||typeof i[0]!=`number`||i.some((e,t)=>t&&typeof e!=`string`))throw RangeError(`Invalid JSON representation of ChangeSet`);else if(i.length==1)n.push(i[0],0);else{for(;r.length<e;)r.push(f.empty);r[e]=f.of(i.slice(1)),n.push(i[0],r[e].length)}}return new e(n,r)}static createSet(t,n){return new e(t,n)}};function w(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function le(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(f.empty);e.push(n)}}function ue(e,t,n){let r=e.inserted;for(let i=0,a=0,o=0;o<e.sections.length;){let s=e.sections[o++],c=e.sections[o++];if(c<0)i+=s,a+=s;else{let l=i,u=a,d=f.empty;for(;l+=s,u+=c,c&&r&&(d=d.append(r[o-2>>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)s=e.sections[o++],c=e.sections[o++];t(i,l,a,u,d),i=l,a=u}}}function de(e,t,n,r=!1){let i=[],a=r?[]:null,o=new pe(e),s=new pe(t);for(let e=-1;;)if(o.done&&s.len||s.done&&o.len)throw Error(`Mismatched change set lengths`);else if(o.ins==-1&&s.ins==-1){let e=Math.min(o.len,s.len);w(i,e,-1),o.forward(e),s.forward(e)}else if(s.ins>=0&&(o.ins<0||e==o.i||o.off==0&&(s.len<o.len||s.len==o.len&&!n))){let t=s.len;for(w(i,s.ins,-1);t;){let n=Math.min(o.len,t);o.ins>=0&&e<o.i&&o.len<=n&&(w(i,0,o.ins),a&&le(a,i,o.text),e=o.i),o.forward(n),t-=n}s.next()}else if(o.ins>=0){let t=0,n=o.len;for(;n;)if(s.ins==-1){let e=Math.min(n,s.len);t+=e,n-=e,s.forward(e)}else if(s.ins==0&&s.len<n)n-=s.len,s.next();else break;w(i,t,e<o.i?o.ins:0),a&&e<o.i&&le(a,i,o.text),e=o.i,o.forward(o.len-n)}else if(o.done&&s.done)return a?ce.createSet(i,a):se.create(i);else throw Error(`Mismatched change set lengths`)}function fe(e,t,n=!1){let r=[],i=n?[]:null,a=new pe(e),o=new pe(t);for(let e=!1;;)if(a.done&&o.done)return i?ce.createSet(r,i):se.create(r);else if(a.ins==0)w(r,a.len,0,e),a.next();else if(o.len==0&&!o.done)w(r,0,o.ins,e),i&&le(i,r,o.text),o.next();else if(a.done||o.done)throw Error(`Mismatched change set lengths`);else{let t=Math.min(a.len2,o.len),n=r.length;if(a.ins==-1){let n=o.ins==-1?-1:o.off?0:o.ins;w(r,t,n,e),i&&n&&le(i,r,o.text)}else o.ins==-1?(w(r,a.off?0:a.len,t,e),i&&le(i,r,a.textBit(t))):(w(r,a.off?0:a.len,o.off?0:o.ins,e),i&&!o.off&&le(i,r,o.text));e=(a.ins>t||o.ins>=0&&o.len>t)&&(e||r.length>n),a.forward2(t),o.forward(t)}}var pe=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?f.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?f.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},me=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.flags=n,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new e(r,i,this.flags,this.goalColumn)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return T.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return T.range(this.anchor,r,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!=`number`||typeof e.head!=`number`)throw RangeError(`Invalid JSON representation for SelectionRange`);return T.range(e.anchor,e.head)}static create(t,n,r,i){return new e(t,n,r,i)}},T=class e{constructor(e,t){this.ranges=e,this.mainIndex=t}map(t,n=-1){return t.empty?this:e.create(this.ranges.map(e=>e.map(t,n)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new e([this.main],0)}addRange(t,n=!0){return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!=`number`||t.main>=t.ranges.length)throw RangeError(`Invalid JSON representation for EditorSelection`);return new e(t.ranges.map(e=>me.fromJSON(e)),t.main)}static single(t,n=t){return new e([e.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw RangeError(`A selection needs at least one range`);for(let r=0,i=0;i<t.length;i++){let a=t[i];if(a.empty?a.from<=r:a.from<r)return e.normalized(t.slice(),n);r=a.to}return new e(t,n)}static cursor(e,t=0,n,r){return me.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n)),r)}static range(e,t,n,r,i){let a=r==null?7:Math.min(6,r);return!i&&e!=t&&(i=t<e?1:-1),i&&(a|=i<0?8:16),t<e?me.create(t,e,a|32,n):me.create(e,t,a,n)}static undirectionalRange(e,t){return me.create(e,t,64,void 0)}static normalized(t,n=0){let r=t[n];t.sort((e,t)=>e.from-t.from),n=t.indexOf(r);for(let r=1;r<t.length;r++){let i=t[r],a=t[r-1];if(i.empty?i.from<=a.to:i.from<a.to){let o=a.from,s=Math.max(i.to,a.to);r<=n&&n--,t.splice(--r,2,i.anchor>i.head?e.range(s,o):e.range(o,s))}}return new e(t,n)}};function he(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError(`Selection points outside of document`)}var ge=0,E=class e{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=ge++,this.default=e([]),this.extensions=typeof i==`function`?i(this):i}get reader(){return this}static define(t={}){return new e(t.combine||(e=>e),t.compareInput||((e,t)=>e===t),t.compare||(t.combine?(e,t)=>e===t:_e),!!t.static,t.enables)}of(e){return new ve([],this,0,e)}compute(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new ve(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new ve(e,this,2,t)}from(e,t){return t||=e=>e,this.compute([e],n=>t(n.field(e)))}};function _e(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}var ve=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=ge++}dynamicSlot(e){let t=this.value,n=this.facet.compareInput,r=this.id,i=e[r]>>1,a=this.type==2,o=!1,s=!1,c=[];for(let t of this.dependencies)t==`doc`?o=!0:t==`selection`?s=!0:(e[t.id]??1)&1||c.push(e[t.id]);return{create(e){return e.values[i]=t(e),1},update(e,r){if(o&&r.docChanged||s&&(r.docChanged||r.selection)||be(e,c)){let r=t(e);if(a?!ye(r,e.values[i],n):!n(r,e.values[i]))return e.values[i]=r,1}return 0},reconfigure:(e,o)=>{let s,c=o.config.address[r];if(c!=null){let r=Ne(o,c);if(this.dependencies.every(t=>t instanceof E?o.facet(t)===e.facet(t):t instanceof Ce?o.field(t,!1)==e.field(t,!1):!0)||(a?ye(s=t(e),r,n):n(s=t(e),r)))return e.values[i]=r,0}else s=t(e);return e.values[i]=s,1}}}get extension(){return this}};function ye(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function be(e,t){let n=!1;for(let r of t)Me(e,r)&1&&(n=!0);return n}function xe(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),a=r.filter(e=>!(e&1)),o=e[t.id]>>1;function s(e){let n=[];for(let t=0;t<r.length;t++){let a=Ne(e,r[t]);if(i[t]==2)for(let e of a)n.push(e);else n.push(a)}return t.combine(n)}return{create(e){for(let t of r)Me(e,t);return e.values[o]=s(e),1},update(e,n){if(!be(e,a))return 0;let r=s(e);return t.compare(r,e.values[o])?0:(e.values[o]=r,1)},reconfigure(e,i){let a=be(e,r),c=i.config.facets[t.id],l=i.facet(t);if(c&&!a&&_e(n,c))return e.values[o]=l,0;let u=s(e);return t.compare(u,l)?(e.values[o]=l,0):(e.values[o]=u,1)}}}var Se=E.define({static:!0}),Ce=class e{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(t){let n=new e(ge++,t.create,t.update,t.compare||((e,t)=>e===t),t);return t.provide&&(n.provides=t.provide(n)),n}create(e){return(e.facet(Se).find(e=>e.field==this)?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet(Se),i=n.facet(Se),a;return(a=r.find(e=>e.field==this))&&a!=i.find(e=>e.field==this)?(e.values[t]=a.create(e),1):n.config.address[this.id]==null?(e.values[t]=this.create(e),1):(e.values[t]=n.field(this),0)}}}init(e){return[this,Se.of({field:this,create:e})]}get extension(){return this}},we={lowest:4,low:3,default:2,high:1,highest:0};function Te(e){return t=>new De(t,e)}var Ee={highest:Te(we.highest),high:Te(we.high),default:Te(we.default),low:Te(we.low),lowest:Te(we.lowest)},De=class{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}},Oe=class e{of(e){return new ke(this,e)}reconfigure(t){return e.reconfigure.of({compartment:this,extension:t})}get(e){return e.config.compartments.get(this)}},ke=class{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}},Ae=class e{constructor(e,t,n,r,i,a){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(t,n,r){let i=[],a=Object.create(null),o=new Map;for(let e of je(t,n,o))e instanceof Ce?i.push(e):(a[e.facet.id]||(a[e.facet.id]=[])).push(e);let s=Object.create(null),c=[],l=[];for(let e of i)s[e.id]=l.length<<1,l.push(t=>e.slot(t));let u=r?.config.facets;for(let e in a){let t=a[e],n=t[0].facet,i=u&&u[e]||[];if(t.every(e=>e.type==0)){if(s[n.id]=c.length<<1|1,_e(i,t))c.push(r.facet(n));else{let e=n.combine(t.map(e=>e.value));c.push(r&&n.compare(e,r.facet(n))?r.facet(n):e)}}else{for(let e of t)e.type==0?(s[e.id]=c.length<<1|1,c.push(e.value)):(s[e.id]=l.length<<1,l.push(t=>e.dynamicSlot(t)));s[n.id]=l.length<<1,l.push(e=>xe(e,n,t))}}let d=l.map(e=>e(s));return new e(t,o,d,s,c,a)}};function je(e,t,n){let r=[[],[],[],[],[]],i=new Map;function a(e,o){let s=i.get(e);if(s!=null){if(s<=o)return;let t=r[s].indexOf(e);t>-1&&r[s].splice(t,1),e instanceof ke&&n.delete(e.compartment)}if(i.set(e,o),Array.isArray(e))for(let t of e)a(t,o);else if(e instanceof ke){if(n.has(e.compartment))throw RangeError(`Duplicate use of compartment in extensions`);let r=t.get(e.compartment)||e.inner;n.set(e.compartment,r),a(r,o)}else if(e instanceof De)a(e.inner,e.prec);else if(e instanceof Ce)r[o].push(e),e.provides&&a(e.provides,o);else if(e instanceof ve)r[o].push(e),e.facet.extensions&&a(e.facet.extensions,we.default);else{let t=e.extension;if(!t)throw Error(`Unrecognized extension value in extension set (${e}).`);if(t==e)throw Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(t,o)}}return a(e,we.default),r.reduce((e,t)=>e.concat(t))}function Me(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw Error(`Cyclic dependency between fields and/or facets`);if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function Ne(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}var Pe=E.define(),Fe=E.define({combine:e=>e.some(e=>e),static:!0}),Ie=E.define({combine:e=>e.length?e[0]:void 0,static:!0}),Le=E.define(),Re=E.define(),ze=E.define(),Be=E.define({combine:e=>e.length?e[0]:!1}),Ve=class{constructor(e,t){this.type=e,this.value=t}static define(){return new He}},He=class{of(e){return new Ve(this,e)}},Ue=class{constructor(e){this.map=e}of(e){return new D(this,e)}},D=class e{constructor(e,t){this.type=e,this.value=t}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new e(this.type,n)}is(e){return this.type==e}static define(e={}){return new Ue(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}};D.reconfigure=D.define(),D.appendConfig=D.define();var We=class e{constructor(t,n,r,i,a,o){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,r&&he(r,n.newLength),a.some(t=>t.type==e.time)||(this.annotations=a.concat(e.time.of(Date.now())))}static create(t,n,r,i,a,o){return new e(t,n,r,i,a,o)}get newDoc(){return this._doc||=this.changes.apply(this.startState.doc)}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(e.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]==`.`))}};We.time=Ve.define(),We.userEvent=Ve.define(),We.addToHistory=Ve.define(),We.remote=Ve.define();function Ge(e,t){let n=[];for(let r=0,i=0;;){let a,o;if(r<e.length&&(i==t.length||t[i]>=e[r]))a=e[r++],o=e[r++];else if(i<t.length)a=t[i++],o=t[i++];else return n;!n.length||n[n.length-1]<a?n.push(a,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function Ke(e,t,n){let r,i,a;return n?(r=t.changes,i=ce.empty(t.changes.length),a=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),i=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(r)),{changes:a,selection:t.selection?t.selection.map(i):e.selection?.map(r),effects:D.mapEffects(e.effects,r).concat(D.mapEffects(t.effects,i)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function qe(e,t,n){let r=t.selection,i=Qe(t.annotations);return t.userEvent&&(i=i.concat(We.userEvent.of(t.userEvent))),{changes:t.changes instanceof ce?t.changes:ce.of(t.changes||[],n,e.facet(Ie)),selection:r&&(r instanceof T?r:T.single(r.anchor,r.head)),effects:Qe(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function Je(e,t,n){let r=qe(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let i=1;i<t.length;i++){t[i].filter===!1&&(n=!1);let a=!!t[i].sequential;r=Ke(r,qe(e,t[i],a?r.changes.newLength:e.doc.length),a)}let i=We.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return Xe(n?Ye(i):i)}function Ye(e){let t=e.startState,n=!0;for(let r of t.facet(Le)){let t=r(e);if(t===!1){n=!1;break}Array.isArray(t)&&(n=n===!0?t:Ge(n,t))}if(n!==!0){let r,i;if(n===!1)i=e.changes.invertedDesc,r=ce.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,i=t.filtered.mapDesc(t.changes).invertedDesc}e=We.create(t,r,e.selection&&e.selection.map(i),D.mapEffects(e.effects,i),e.annotations,e.scrollIntoView)}let r=t.facet(Re);for(let n=r.length-1;n>=0;n--){let i=r[n](e);e=i instanceof We?i:Array.isArray(i)&&i.length==1&&i[0]instanceof We?i[0]:Je(t,Qe(i),!1)}return e}function Xe(e){let t=e.startState,n=t.facet(ze),r=e;for(let i=n.length-1;i>=0;i--){let a=n[i](e);a&&Object.keys(a).length&&(r=Ke(r,qe(t,a,e.changes.newLength),!0))}return r==e?e:We.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}var Ze=[];function Qe(e){return e==null?Ze:Array.isArray(e)?e:[e]}var O=(function(e){return e[e.Word=0]=`Word`,e[e.Space=1]=`Space`,e[e.Other=2]=`Other`,e})(O||={}),$e=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,et;try{et=RegExp(`[\\p{Alphabetic}\\p{Number}_]`,`u`)}catch{}function tt(e){if(et)return et.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>``&&(n.toUpperCase()!=n.toLowerCase()||$e.test(n)))return!0}return!1}function nt(e){return t=>{if(!/\S/.test(t))return O.Space;if(tt(t))return O.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return O.Word;return O.Other}}var k=class e{constructor(e,t,n,r,i,a){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)Me(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw RangeError(`Field is not present in this state`);return}return Me(this,n),Ne(this,n)}update(...e){return Je(this,e,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let e of t.effects)e.is(Oe.reconfigure)?(n&&=(i=new Map,n.compartments.forEach((e,t)=>i.set(t,e)),null),i.set(e.value.compartment,e.value.extension)):e.is(D.reconfigure)?(n=null,r=e.value):e.is(D.appendConfig)&&(n=null,r=Qe(r).concat(e.value));let a;n?a=t.startState.values.slice():(n=Ae.resolve(r,i,this),a=new e(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let o=t.startState.facet(Fe)?t.newSelection:t.newSelection.asSingle();new e(n,t.newDoc,o,a,(e,n)=>n.update(e,t),t)}replaceSelection(e){return typeof e==`string`&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:T.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],a=Qe(n.effects);for(let n=1;n<t.ranges.length;n++){let o=e(t.ranges[n]),s=this.changes(o.changes),c=s.map(r);for(let e=0;e<n;e++)i[e]=i[e].map(c);let l=r.mapDesc(s,!0);i.push(o.range.map(l)),r=r.compose(c),a=D.mapEffects(a,c).concat(D.mapEffects(Qe(o.effects),l))}return{changes:r,selection:T.create(i,t.mainIndex),effects:a}}changes(t=[]){return t instanceof ce?t:ce.of(t,this.doc.length,this.facet(e.lineSeparator))}toText(t){return f.of(t.split(this.facet(e.lineSeparator)||oe))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(Me(this,t),Ne(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof Ce&&this.config.address[r.id]!=null&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(t,n={},r){if(!t||typeof t.doc!=`string`)throw RangeError(`Invalid JSON representation for EditorState`);let i=[];if(r){for(let e in r)if(Object.prototype.hasOwnProperty.call(t,e)){let n=r[e],a=t[e];i.push(n.init(e=>n.spec.fromJSON(a,e)))}}return e.create({doc:t.doc,selection:T.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=Ae.resolve(t.extensions||[],new Map),r=t.doc instanceof f?t.doc:f.of((t.doc||``).split(n.staticFacet(e.lineSeparator)||oe)),i=t.selection?t.selection instanceof T?t.selection:T.single(t.selection.anchor,t.selection.head):T.single(0);return he(i,r.length),n.staticFacet(Fe)||(i=i.asSingle()),new e(n,r,i,n.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(e.tabSize)}get lineBreak(){return this.facet(e.lineSeparator)||`5-`}get readOnly(){return this.facet(Be)}phrase(t,...n){for(let n of this.facet(e.phrases))if(Object.prototype.hasOwnProperty.call(n,t)){t=n[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(e,t)=>{if(t==`$`)return`$`;let r=+(t||1);return!r||r>n.length?e:n[r-1]})),t}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(Pe))for(let a of i(this,t,n))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){let t=this.languageDataAt(`wordChars`,e);return nt(t.length?t[0]:``)}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-n,o=e-n;for(;a>0;){let e=x(t,a,!1);if(i(t.slice(e,a))!=O.Word)break;a=e}for(;o<r;){let e=x(t,o);if(i(t.slice(o,e))!=O.Word)break;o=e}return a==o?null:T.range(a+n,o+n)}};k.allowMultipleSelections=Fe,k.tabSize=E.define({combine:e=>e.length?e[0]:4}),k.lineSeparator=Ie,k.readOnly=Be,k.phrases=E.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),k.languageData=Pe,k.changeFilter=Le,k.transactionFilter=Re,k.transactionExtender=ze,Oe.reconfigure=D.define();function rt(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let i=t[e],a=r[e];if(a===void 0)r[e]=i;else if(a!==i&&i!==void 0){if(Object.hasOwnProperty.call(n,e))r[e]=n[e](a,i);else throw Error(`Config merge conflict for field `+e)}}for(let e in t)r[e]===void 0&&(r[e]=t[e]);return r}var it=class{eq(e){return this==e}range(e,t=e){return ot.create(e,t,this)}};it.prototype.startSide=it.prototype.endSide=0,it.prototype.point=!1,it.prototype.mapMode=C.TrackDel;function at(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}var ot=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,r){return new e(t,n,r)}};function st(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var ct=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let a=r,o=i.length;;){if(a==o)return a;let r=a+o>>1,s=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==a)return s>=0?a:o;s>=0?o=r:a=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),a=this.findIndex(n,1e9,!1,i);i<a;i++)if(r(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(t,n){let r=[],i=[],a=[],o=-1,s=-1;for(let e=0;e<this.value.length;e++){let c=this.value[e],l=this.from[e]+t,u=this.to[e]+t,d,f;if(l==u){let e=n.mapPos(l,c.startSide,c.mapMode);if(e==null||(d=f=e,c.startSide!=c.endSide&&(f=n.mapPos(l,c.endSide),f<d)))continue}else if(d=n.mapPos(l,c.startSide),f=n.mapPos(u,c.endSide),d>f||d==f&&c.startSide>0&&c.endSide<=0)continue;(f-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(s=Math.max(s,f-d)),r.push(c),i.push(d-o),a.push(f-o))}return{mapped:r.length?new e(i,a,r,s):null,pos:o}}},A=class e{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(t,n,r,i){return new e(t,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:a=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(st)),this.isEmpty)return n.length?e.of(n):this;let s=new ft(this,null,-1).goto(0),c=0,l=[],u=new ut;for(;s.value||c<n.length;)if(c<n.length&&(s.from-n[c].from||s.startSide-n[c].value.startSide)>=0){let e=n[c++];u.addInner(e.from,e.to,e.value)||l.push(e)}else s.rangeIndex==1&&s.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(s.chunkIndex)<n[c].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||a<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||a<s.from||o(s.from,s.to,s.value))&&(u.addInner(s.from,s.to,s.value)||l.push(ot.create(s.from,s.to,s.value))),s.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?e.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:a}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let e=0;e<this.chunk.length;e++){let a=this.chunkPos[e],o=this.chunk[e],s=t.touchesRange(a,a+o.length);if(s===!1)i=Math.max(i,o.maxPoint),n.push(o),r.push(t.mapPos(a));else if(s===!0){let{mapped:e,pos:s}=o.map(a,t);e&&(i=Math.max(i,e.maxPoint),n.push(e),r.push(s))}}let a=this.nextLayer.map(t);return n.length==0?a:new e(r,n,a||e.empty,i)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],a=this.chunk[r];if(t>=i&&e<=i+a.length&&a.between(i,e-i,t-i,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return pt.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return pt.from(e).goto(t)}static compare(e,t,n,r,i=-1){let a=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=dt(a,o,n),c=new ht(a,s,i),l=new ht(o,s,i);n.iterGaps((e,t,n)=>gt(c,e,l,t,n,r)),n.empty&&n.length==0&>(c,0,l,0,0,r)}static eq(e,t,n=0,r){r??=1e9-1;let i=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),a=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let o=dt(i,a),s=new ht(i,o,0).goto(n),c=new ht(a,o,0).goto(n);for(;;){if(s.to!=c.to||!_t(s.active,c.active)||s.point&&(!c.point||!at(s.point,c.point)))return!1;if(s.to>r)return!0;s.next(),c.next()}}static spans(e,t,n,r,i=-1){let a=new ht(e,null,i).goto(t),o=t,s=a.openStart;for(;;){let e=Math.min(a.to,n);if(a.point){let n=a.activeForPoint(a.to),i=a.pointFrom<t?n.length+1:a.point.startSide<0?n.length:Math.min(n.length,s);r.point(o,e,a.point,n,i,a.pointRank),s=Math.min(a.openEnd(e),n.length)}else e>o&&(r.span(o,e,a.active,s),s=a.openEnd(e));if(a.to>n)return s+(a.point&&a.to>n?1:0);o=a.to,a.next()}}static of(e,t=!1){let n=new ut;for(let r of e instanceof ot?[e]:t?lt(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(t){if(!t.length)return e.empty;let n=t[t.length-1];for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=e.empty;i=i.nextLayer)n=new e(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}};A.empty=new A([],[],null,-1);function lt(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(st(t,r)>0)return e.slice().sort(st);t=r}return e}A.empty.nextLayer=A.empty;var ut=class e{finishChunk(e){this.chunks.push(new ct(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,r){this.addInner(t,n,r)||(this.nextLayer||=new e).add(t,n,r)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(A.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=A.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function dt(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let i=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let a=r.get(e.chunk[t]);a!=null&&(n?n.mapPos(a):a)==e.chunkPos[t]&&!n?.touchesRange(a,a+e.chunk[t].length)&&i.add(e.chunk[t])}return i}var ft=class{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}},pt=class e{constructor(e){this.heap=e}static from(t,n=null,r=-1){let i=[];for(let e=0;e<t.length;e++)for(let a=t[e];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new ft(a,n,r,e));return i.length==1?i[0]:new e(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)mt(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)mt(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),mt(this.heap,0)}}};function mt(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}var ht=class{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=pt.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){vt(this.active,e),vt(this.activeTo,e),vt(this.activeRank,e),this.minActive=bt(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||r-this.activeTo[t])>0;)t++;yt(this.active,t,n),yt(this.activeTo,t,r),yt(this.activeRank,t,i),e&&yt(e,t,this.cursor.from),this.minActive=bt(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&vt(n,r)}else if(!this.cursor.value){this.to=this.endSide=1e9;break}else if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let e=this.cursor.value;if(!e.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}};function gt(e,t,n,r,i,a){e.goto(t),n.goto(r);let o=r+i,s=r,c=r-t,l=!!a.boundChange;for(let t=!1;;){let r=e.to+c-n.to,i=r||e.endSide-n.endSide,u=i<0?e.to+c:n.to,d=Math.min(u,o);if(e.point||n.point?(e.point&&n.point&&at(e.point,n.point)&&_t(e.activeForPoint(e.to),n.activeForPoint(n.to))||a.comparePoint(s,d,e.point,n.point),t=!1):(t&&a.boundChange(s),d>s&&!_t(e.active,n.active)&&a.compareRange(s,d,e.active,n.active),l&&d<o&&(r||e.openEnd(u)!=n.openEnd(u))&&(t=!0)),u>o)break;s=u,i<=0&&e.next(),i>=0&&n.next()}}function _t(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!at(e[n],t[n]))return!1;return!0}function vt(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function yt(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function bt(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)(t[i]-r||e[i].endSide-e[n].endSide)<0&&(n=i,r=t[i]);return n}function xt(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)e.charCodeAt(i)==9?(r+=t-r%t,i++):(r++,i=x(e,i));return r}function St(e,t,n,r){for(let r=0,i=0;;){if(i>=t)return r;if(r==e.length)break;i+=e.charCodeAt(r)==9?n-i%n:1,r=x(e,r)}return r===!0?-1:e.length}for(var Ct=`ͼ`,wt=typeof Symbol>`u`?`__ͼ`:Symbol.for(Ct),Tt=typeof Symbol>`u`?`__styleSet`+Math.floor(Math.random()*1e8):Symbol(`styleSet`),Et=typeof globalThis<`u`?globalThis:typeof window<`u`?window:{},Dt=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function i(e,t,a,o){let s=[],c=/^@(\w+)\b/.exec(e[0]),l=c&&c[1]==`keyframes`;if(c&&t==null)return a.push(e[0]+`;`);for(let n in t){let o=t[n];if(/&/.test(n))i(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>e.concat(t)),o,a);else if(o&&typeof o==`object`){if(!c)throw RangeError(`The value of a property (`+n+`) should be a primitive value.`);i(r(n),o,s,l)}else o!=null&&s.push(n.replace(/_.*/,``).replace(/[A-Z]/g,e=>`-`+e.toLowerCase())+`: `+o+`;`)}(s.length||l)&&a.push((n&&!c&&!o?e.map(n):e).join(`, `)+` {`+s.join(` `)+`}`)}for(let t in e)i(r(t),e[t],this.rules)}getRules(){return this.rules.join(`6-`)}static newName(){let e=Et[wt]||1;return Et[wt]=e+1,Ct+e.toString(36)}static mount(e,t,n){let r=e[Tt],i=n&&n.nonce;r?i&&r.setNonce(i):r=new kt(e,i),r.mount(Array.isArray(t)?t:[t],e)}},Ot=new Map,kt=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=Ot.get(n);if(t)return e[Tt]=t;this.sheet=new r.CSSStyleSheet,Ot.set(n,this)}else this.styleTag=n.createElement(`style`),t&&this.styleTag.setAttribute(`nonce`,t);this.modules=[],e[Tt]=this}mount(e,t){let n=this.sheet,r=0,i=0;for(let t=0;t<e.length;t++){let a=e[t],o=this.modules.indexOf(a);if(o<i&&o>-1&&(this.modules.splice(o,1),i--,o=-1),o==-1){if(this.modules.splice(i++,0,a),n)for(let e=0;e<a.rules.length;e++)n.insertRule(a.rules[e],r++)}else{for(;i<o;)r+=this.modules[i++].rules.length;r+=a.rules.length,i++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e=``;for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+`7-`;this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute(`nonce`)!=e&&this.styleTag.setAttribute(`nonce`,e)}},At={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},jt={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},Mt=typeof navigator<`u`&&/Mac/.test(navigator.platform),Nt=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),j=0;j<10;j++)At[48+j]=At[96+j]=String(j);for(var j=1;j<=24;j++)At[j+111]=`F`+j;for(var j=65;j<=90;j++)At[j]=String.fromCharCode(j+32),jt[j]=String.fromCharCode(j);for(var Pt in At)jt.hasOwnProperty(Pt)||(jt[Pt]=At[Pt]);function Ft(e){var t=!(Mt&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Nt&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?jt:At)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}function M(){var e=arguments[0];typeof e==`string`&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n==`object`&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i==`string`?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t<arguments.length;t++)It(e,arguments[t]);return e}function It(e,t){if(typeof t==`string`)e.appendChild(document.createTextNode(t));else if(t!=null){if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)It(e,t[n]);else throw RangeError(`Unsupported child node: `+t)}}var Lt=typeof navigator<`u`?navigator:{userAgent:``,vendor:``,platform:``},Rt=typeof document<`u`?document:{documentElement:{style:{}}},zt=/Edge\/(\d+)/.exec(Lt.userAgent),Bt=/MSIE \d/.test(Lt.userAgent),Vt=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Lt.userAgent),Ht=!!(Bt||Vt||zt),Ut=!Ht&&/gecko\/(\d+)/i.test(Lt.userAgent),Wt=!Ht&&/Chrome\/(\d+)/.exec(Lt.userAgent),Gt=`webkitFontSmoothing`in Rt.documentElement.style,Kt=!Ht&&/Apple Computer/.test(Lt.vendor),qt=Kt&&(/Mobile\/\w+/.test(Lt.userAgent)||Lt.maxTouchPoints>2),N={mac:qt||/Mac/.test(Lt.platform),windows:/Win/.test(Lt.platform),linux:/Linux|X11/.test(Lt.platform),ie:Ht,ie_version:Bt?Rt.documentMode||6:Vt?+Vt[1]:zt?+zt[1]:0,gecko:Ut,gecko_version:Ut?+(/Firefox\/(\d+)/.exec(Lt.userAgent)||[0,0])[1]:0,chrome:!!Wt,chrome_version:Wt?+Wt[1]:0,ios:qt,android:/Android\b/.test(Lt.userAgent),webkit:Gt,webkit_version:Gt?+(/\bAppleWebKit\/(\d+)/.exec(Lt.userAgent)||[0,0])[1]:0,safari:Kt,safari_version:Kt?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Lt.userAgent)||[0,0])[1]:0,tabSize:Rt.documentElement.style.tabSize==null?`-moz-tab-size`:`tab-size`};function Jt(e,t){for(let n in e)n==`class`&&t.class?t.class+=` `+e.class:n==`style`&&t.style?t.style+=`;`+e.style:t[n]=e[n];return t}var Yt=Object.create(null);function Xt(e,t,n){if(e==t)return!0;e||=Yt,t||=Yt;let r=Object.keys(e),i=Object.keys(t);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let a of r)if(a!=n&&(i.indexOf(a)==-1||e[a]!==t[a]))return!1;return!0}function Zt(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;t[r]??e.removeAttribute(r)}for(let n in t){let r=t[n];n==`style`?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}function Qt(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,i==`style`?e.style.cssText=``:e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,i==`style`?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}function $t(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}var en=class{eq(e){return!1}updateDOM(e,t,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},P=(function(e){return e[e.Text=0]=`Text`,e[e.WidgetBefore=1]=`WidgetBefore`,e[e.WidgetAfter=2]=`WidgetAfter`,e[e.WidgetRange=3]=`WidgetRange`,e})(P||={}),F=class extends it{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new tn(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new rn(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:i,end:a}=an(e,t);n=(i?t?-3e8:-1:5e8)-1,r=(a?t?2e8:1:-6e8)+1}return new rn(e,n,r,t,e.widget||null,!0)}static line(e){return new nn(e)}static set(e,t=!1){return A.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};F.none=A.empty;var tn=class e extends F{constructor(e){let{start:t,end:n}=an(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||`span`,this.attrs=e.class&&e.attributes?Jt(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Yt}eq(t){return this==t||t instanceof e&&this.tagName==t.tagName&&Xt(this.attrs,t.attrs)}range(e,t=e){if(e>=t)throw RangeError(`Mark decorations may not be empty`);return super.range(e,t)}};tn.prototype.point=!1;var nn=class e extends F{constructor(e){super(-2e8,-2e8,null,e)}eq(t){return t instanceof e&&this.spec.class==t.spec.class&&Xt(this.spec.attributes,t.spec.attributes)}range(e,t=e){if(t!=e)throw RangeError(`Line decoration ranges must be zero-length`);return super.range(e,t)}};nn.prototype.mapMode=C.TrackBefore,nn.prototype.point=!0;var rn=class e extends F{constructor(e,t,n,r,i,a){super(t,n,i,e),this.block=r,this.isReplace=a,this.mapMode=r?t<=0?C.TrackBefore:C.TrackAfter:C.TrackDel}get type(){return this.startSide==this.endSide?this.startSide<=0?P.WidgetBefore:P.WidgetAfter:P.WidgetRange}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof e&&on(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw RangeError(`Invalid range for replacement decoration`);if(!this.isReplace&&t!=e)throw RangeError(`Widget decorations can only have zero-length ranges`);return super.range(e,t)}};rn.prototype.point=!0;function an(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n??=e.inclusive,r??=e.inclusive,{start:n??t,end:r??t}}function on(e,t){return e==t||!!(e&&t&&e.compare(t))}function sn(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}var cn=class e extends it{constructor(e,t,n){super(),this.tagName=e,this.attributes=t,this.rank=n}eq(t){return t==this||t instanceof e&&this.tagName==t.tagName&&Xt(this.attributes,t.attributes)}static create(t){return new e(t.tagName,t.attributes||Yt,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(e,t=!1){return A.of(e,t)}};cn.prototype.startSide=cn.prototype.endSide=-1;function ln(e){let t;return t=e.nodeType==11?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function un(e,t){return t?e==t||e.contains(t.nodeType==1?t:t.parentNode):!1}function dn(e,t){if(!t.anchorNode)return!1;try{return un(e,t.anchorNode)}catch{return!1}}function fn(e){return e.nodeType==3?kn(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function pn(e,t,n,r){return n?gn(e,t,n,r,-1)||gn(e,t,n,r,1):!1}function mn(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function hn(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function gn(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:_n(e))){if(e.nodeName==`DIV`)return!1;let n=e.parentNode;if(!n||n.nodeType!=1)return!1;t=mn(e)+(i<0?0:1),e=n}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable==`false`)return!1;t=i<0?_n(e):0}else return!1}}function _n(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function vn(e,t){let{left:n,right:r}=e;if(n==r)return e;let i=t?n:r;return{left:i,right:i,top:e.top,bottom:e.bottom}}function yn(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function bn(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function xn(e,t,n,r,i,a,o,s){let c=e.ownerDocument,l=c.defaultView||window;for(let u=e,d=!1;u&&!d;)if(u.nodeType==1){let e,f=u==c.body,p=1,m=1;if(f)e=yn(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:p,scaleY:m}=bn(u,t)),e={left:t.left,right:t.left+u.clientWidth*p,top:t.top,bottom:t.top+u.clientHeight*m}}let h=0,g=0;if(i==`nearest`)t.top<e.top+o?(g=t.top-(e.top+o),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+o)):t.bottom>e.bottom-o&&(g=t.bottom-e.bottom+o,n<0&&t.top-g<e.top&&(g=t.top-(e.top+o)));else{let r=t.bottom-t.top,a=e.bottom-e.top;g=(i==`center`&&r<=a?t.top+r/2-a/2:i==`start`||i==`center`&&n<0?t.top-o:t.bottom-a+o)-e.top}if(r==`nearest`?t.left<e.left+a?(h=t.left-(e.left+a),n>0&&t.right>e.right+h&&(h=t.right-e.right+a)):t.right>e.right-a&&(h=t.right-e.right+a,n<0&&t.left<e.left+h&&(h=t.left-(e.left+a))):h=(r==`center`?t.left+(t.right-t.left)/2-(e.right-e.left)/2:r==`start`==s?t.left-a:t.right-(e.right-e.left)+a)-e.left,h||g){if(f)l.scrollBy(h,g);else{let e=0,n=0;if(g){let e=u.scrollTop;u.scrollTop+=g/m,n=(u.scrollTop-e)*m}if(h){let t=u.scrollLeft;u.scrollLeft+=h/p,e=(u.scrollLeft-t)*p}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&Math.abs(e-h)<1&&(r=`nearest`),n&&Math.abs(n-g)<1&&(i=`nearest`)}}if(f)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function Sn(e,t=!0){let n=e.ownerDocument,r=null,i=null;for(let a=e.parentNode;a&&!(a==n.body||(!t||r)&&i);)if(a.nodeType==1)!i&&a.scrollHeight>a.clientHeight&&(i=a),t&&!r&&a.scrollWidth>a.clientWidth&&(r=a),a=a.assignedSlot||a.parentNode;else if(a.nodeType==11)a=a.host;else break;return{x:r,y:i}}var Cn=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?_n(t):0),n,Math.min(e.focusOffset,n?_n(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}};function wn(e){let t=[];for(let n=e;n;n=n.nodeType==11?n.host:n.parentNode)n.nodeType==1&&t.push({node:n,left:n.scrollLeft,top:n.scrollTop});return t}function Tn(e,t=!0){for(let{node:n,left:r,top:i}of e)t&&n.scrollTop!=i&&(n.scrollTop=i),n.scrollLeft!=r&&(n.scrollLeft=r)}var En=null;N.safari&&N.safari_version>=26&&(En=!1);function Dn(e){if(e.setActive)return e.setActive();if(En)return e.focus(En);let t=wn(e);e.focus(En==null?{get preventScroll(){return En={preventScroll:!0},!0}}:void 0),En||(En=!1,Tn(t))}var On;function kn(e,t,n=t){let r=On||=document.createRange();return r.setEnd(e,n),r.setStart(e,t),r}function An(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let a=new KeyboardEvent(`keydown`,i);a.synthetic=!0,e.dispatchEvent(a);let o=new KeyboardEvent(`keyup`,i);return o.synthetic=!0,e.dispatchEvent(o),a.defaultPrevented||o.defaultPrevented}function jn(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function Mn(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,_n(n));;)if(r){if(n.nodeType!=1)return!1;let e=n.childNodes[r-1];e.contentEditable==`false`?r--:(n=e,r=_n(n))}else if(n==e)return!0;else r=mn(n),n=n.parentNode}function Nn(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function Pn(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r>0)return{node:n,offset:r};else if(n.nodeType==1&&r>0){if(n.contentEditable==`false`)return null;n=n.childNodes[r-1],r=_n(n)}else if(n.parentNode&&!hn(n))r=mn(n),n=n.parentNode;else return null}function Fn(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};else if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable==`false`)return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!hn(n))r=mn(n)+1,n=n.parentNode;else return null}var In=class e{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(t,n){return new e(t.parentNode,mn(t),n)}static after(t,n){return new e(t.parentNode,mn(t)+1,n)}},I=(function(e){return e[e.LTR=0]=`LTR`,e[e.RTL=1]=`RTL`,e})(I||={}),Ln=I.LTR,Rn=I.RTL;function zn(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}var Bn=zn(`88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008`),Vn=zn(`4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333`),Hn=Object.create(null),Un=[];for(let e of[`()`,`[]`,`{}`]){let t=e.charCodeAt(0),n=e.charCodeAt(1);Hn[t]=n,Hn[n]=-t}function Wn(e){return e<=247?Bn[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?Vn[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}var Gn=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/,Kn=class{get dir(){return this.level%2?Rn:Ln}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let i=-1;for(let a=0;a<e.length;a++){let o=e[a];if(o.from<=t&&o.to>=t){if(o.level==n)return a;(i<0||(r==0?e[i].level>o.level:r<0?o.from<t:o.to>t))&&(i=a)}}if(i<0)throw RangeError(`Index out of range`);return i}};function qn(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!qn(r.inner,i.inner))return!1}return!0}var L=[];function Jn(e,t,n,r,i){for(let a=0;a<=r.length;a++){let o=a?r[a-1].to:t,s=a<r.length?r[a].from:n,c=a?256:i;for(let t=o,n=c,r=c;t<s;t++){let i=Wn(e.charCodeAt(t));i==512?i=n:i==8&&r==4&&(i=16),L[t]=i==4?2:i,i&7&&(r=i),n=i}for(let e=o,t=c,r=c;e<s;e++){let i=L[e];if(i==128)e<s-1&&t==L[e+1]&&t&24?i=L[e]=t:L[e]=256;else if(i==64){let i=e+1;for(;i<s&&L[i]==64;)i++;let a=e&&t==8||i<n&&L[i]==8?r==1?1:8:256;for(let t=e;t<i;t++)L[t]=a;e=i-1}else i==8&&r==1&&(L[e]=1);t=i,i&7&&(r=i)}}}function Yn(e,t,n,r,i){let a=i==1?2:1;for(let o=0,s=0,c=0;o<=r.length;o++){let l=o?r[o-1].to:t,u=o<r.length?r[o].from:n;for(let t=l,n,r,o;t<u;t++)if(r=Hn[n=e.charCodeAt(t)]){if(r<0){for(let e=s-3;e>=0;e-=3)if(Un[e+1]==-r){let n=Un[e+2],r=n&2?i:n&4?n&1?a:i:0;r&&(L[t]=L[Un[e]]=r),s=e;break}}else if(Un.length==189)break;else Un[s++]=t,Un[s++]=n,Un[s++]=c}else if((o=L[t])==2||o==1){let e=o==i;c=+!e;for(let t=s-3;t>=0;t-=3){let n=Un[t+2];if(n&2)break;if(e)Un[t+2]|=2;else{if(n&4)break;Un[t+2]|=4}}}}}function Xn(e,t,n,r){for(let i=0,a=r;i<=n.length;i++){let o=i?n[i-1].to:e,s=i<n.length?n[i].from:t;for(let c=o;c<s;){let o=L[c];if(o==256){let o=c+1;for(;;)if(o==s){if(i==n.length)break;o=n[i++].to,s=i<n.length?n[i].from:t}else if(L[o]==256)o++;else break;let l=a==1,u=l==((o<t?L[o]:r)==1)?l?1:2:r;for(let t=o,r=i,a=r?n[r-1].to:e;t>c;)t==a&&(t=n[--r].from,a=r?n[r-1].to:e),L[--t]=u;c=o}else a=o,c++}}}function Zn(e,t,n,r,i,a,o){let s=r%2?2:1;if(r%2==i%2)for(let c=t,l=0;c<n;){let t=!0,u=!1;if(l==a.length||c<a[l].from){let e=L[c];e!=s&&(t=!1,u=e==16)}let d=!t&&s==1?[]:null,f=t?r:r+1,p=c;run:for(;;)if(l<a.length&&p==a[l].from){if(u)break run;let m=a[l];if(!t)for(let e=m.to,t=l+1;;){if(e==n)break run;if(t<a.length&&a[t].from==e)e=a[t++].to;else if(L[e]==s)break run;else break}l++,d?d.push(m):(m.from>c&&o.push(new Kn(c,m.from,f)),Qn(e,m.direction==Ln==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.to),p=m.to}else if(p==n||(t?L[p]!=s:L[p]==s))break;else p++;d?Zn(e,c,p,r+1,i,d,o):c<p&&o.push(new Kn(c,p,f)),c=p}else for(let c=n,l=a.length;c>t;){let n=!0,u=!1;if(!l||c>a[l-1].to){let e=L[c-1];e!=s&&(n=!1,u=e==16)}let d=!n&&s==1?[]:null,f=n?r:r+1,p=c;run:for(;;)if(l&&p==a[l-1].to){if(u)break run;let m=a[--l];if(!n)for(let e=m.from,n=l;;){if(e==t)break run;if(n&&a[n-1].to==e)e=a[--n].from;else if(L[e-1]==s)break run;else break}d?d.push(m):(m.to<c&&o.push(new Kn(m.to,c,f)),Qn(e,m.direction==Ln==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.from),p=m.from}else if(p==t||(n?L[p-1]!=s:L[p-1]==s))break;else p--;d?Zn(e,p,c,r+1,i,d,o):p<c&&o.push(new Kn(p,c,f)),c=p}}function Qn(e,t,n,r,i,a,o){let s=t%2?2:1;Jn(e,i,a,r,s),Yn(e,i,a,r,s),Xn(i,a,r,s),Zn(e,i,a,t,n,r,o)}function $n(e,t,n){if(!e)return[new Kn(0,0,+(t==Rn))];if(t==Ln&&!n.length&&!Gn.test(e))return er(e.length);if(n.length)for(;e.length>L.length;)L[L.length]=256;let r=[],i=t==Ln?0:1;return Qn(e,i,i,n,0,e.length,r),r}function er(e){return[new Kn(0,e,0)]}var tr=``;function nr(e,t,n,r,i){let a=r.head-e.from,o=Kn.find(t,a,r.bidiLevel??-1,r.assoc),s=t[o],c=s.side(i,n);if(a==c){let e=o+=i?1:-1;if(e<0||e>=t.length)return null;s=t[o=e],a=s.side(!i,n),c=s.side(i,n)}let l=x(e.text,a,s.forward(i,n));(l<s.from||l>s.to)&&(l=c),tr=e.text.slice(Math.min(a,l),Math.max(a,l));let u=o==(i?t.length-1:0)?null:t[o+(i?1:-1)];return u&&l==c&&u.level+ +!i<s.level?T.cursor(u.side(!i,n)+e.from,u.forward(i,n)?1:-1,u.level):T.cursor(l+e.from,s.forward(i,n)?-1:1,s.level)}function rr(e,t,n){for(let r=t;r<n;r++){let t=Wn(e.charCodeAt(r));if(t==1)return Ln;if(t==2||t==4)return Rn}return Ln}var ir=E.define(),ar=E.define(),or=E.define(),sr=E.define(),cr=E.define(),lr=E.define(),ur=E.define(),dr=E.define(),fr=E.define(),pr=E.define({combine:e=>e.some(e=>e)}),mr=E.define({combine:e=>e.some(e=>e)}),hr=E.define(),gr=class e{constructor(e,t,n,r,i,a=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=i,this.isSnapshot=a}map(t){return t.empty?this:new e(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new e(T.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},_r=D.define({map:(e,t)=>e.map(t)}),vr=D.define();function yr(e,t,n){let r=e.facet(sr);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+`:`,t):console.error(t))}var br=E.define({combine:e=>!e.length||e[0]}),xr=0,Sr=E.define({combine(e){return e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})}}),R=class e{constructor(e,t,n,r,i){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(Sr.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Sr.of({plugin:this,arg:e}))}static define(t,n){let{eventHandlers:r,eventObservers:i,provide:a,decorations:o}=n||{};return new e(xr++,t,r,i,e=>{let t=[];return o&&t.push(Er.of(t=>{let n=t.plugin(e);return n?o(n):F.none})),a&&t.push(a(e)),t})}static fromClass(t,n){return e.define((e,n)=>new t(e,n),n)}},Cr=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(!this.value){if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){yr(e.state,t,`CodeMirror plugin crashed`),this.deactivate()}}else if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(yr(e.state,t,`CodeMirror plugin crashed`),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}return this}destroy(e){if(this.value?.destroy)try{this.value.destroy()}catch(t){yr(e.state,t,`CodeMirror plugin crashed`)}}deactivate(){this.spec=this.value=null}},wr=E.define(),Tr=E.define(),Er=E.define(),Dr=E.define(),Or=E.define(),kr=E.define(),Ar=E.define();function jr(e,t){let n=e.state.facet(Ar);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),i=[];return A.spans(r,t.from,t.to,{point(){},span(e,n,r,a){let o=e-t.from,s=n-t.from,c=i;for(let e=r.length-1;e>=0;e--,a--){let n=r[e].spec.bidiIsolate,i;if(n??=rr(t.text,o,s),a>0&&c.length&&(i=c[c.length-1]).to==o&&i.direction==n)i.to=s,c=i.inner;else{let e={from:o,to:s,direction:n,inner:[]};c.push(e),c=e.inner}}}}),i}var Mr=E.define();function Nr(e){let t=0,n=0,r=0,i=0;for(let a of e.state.facet(Mr)){let o=a(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:t,right:n,top:r,bottom:i}}var Pr=E.define(),Fr=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(t){return new e(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(t,n){if(n.length==0)return t;let r=[];for(let i=0,a=0,o=0;;){let s=i<t.length?t[i].fromB:1e9,c=a<n.length?n[a]:1e9,l=Math.min(s,c);if(l==1e9)break;let u=l+o,d=l,f=u;for(;;)if(a<n.length&&n[a]<=d){let e=n[a+1];a+=2,d=Math.max(d,e);for(let e=i;e<t.length&&t[e].fromB<=d;e++)o=t[e].toA-t[e].toB;f=Math.max(f,e+o)}else if(i<t.length&&t[i].fromB<=d){let e=t[i++];d=Math.max(d,e.toB),f=Math.max(f,e.toA),o=e.toA-e.toB}else break;r.push(new e(u,f,l,d))}return r}},Ir=class e{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=ce.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let r=[];this.changes.iterChangedRanges((e,t,n,i)=>r.push(new Fr(e,t,n,i))),this.changedRanges=r}static create(t,n,r){return new e(t,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},Lr=[],z=class{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return Lr}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let e=this.domAttrs;e&&Zt(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:``)+(this.breakAfter?`#`:``)}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw RangeError(`Invalid child in posBefore`)}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t,n){return null}domPosFor(e,t){let n=mn(this.dom),r=this.length?e>0:t>0;return new In(this.parent.dom,n+ +!!r,e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Br)return e;return null}static get(e){return e.cmTile}},Rr=class extends z{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,n=null,r,i=e?.node==t?e:null,a=0;for(let o of this.children){if(o.sync(e),a+=o.length+o.breakAfter,r=n?n.nextSibling:t.firstChild,i&&r!=o.dom&&(i.written=!0),o.dom.parentNode==t)for(;r&&r!=o.dom;)r=zr(r);else t.insertBefore(o.dom,r);n=o.dom}for(r=n?n.nextSibling:t.firstChild,i&&r&&(i.written=!0);r;)r=zr(r);this.length=a}};function zr(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var Br=class extends Rr{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=z.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,i=0;;)if(r==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&i++,r=t.pop()}else{let a=n.children[r++];if(a instanceof Vr)t.push(r),n=a,r=0;else{let t=i+a.length,n=e(a,i);if(n!==void 0)return n;i=t+a.breakAfter}}}resolveBlock(e,t){let n,r=-1,i,a=-1;if(this.blockTiles((o,s)=>{let c=s+o.length;if(e>=s&&e<=c){if(o.isWidget()&&t>=-1&&t<=1){if(o.flags&32)return!0;o.flags&16&&(n=void 0)}(s<e||e==c&&(t<-1?o.length:o.covers(1)))&&(!n||!o.isWidget()&&n.isWidget())&&(n=o,r=e-s),(c>e||e==s&&(t>1?o.length:o.covers(-1)))&&(!i||!o.isWidget()&&i.isWidget())&&(i=o,a=e-s)}}),!n&&!i)throw Error(`No tile at position `+e);return n&&t<0||!i?{tile:n,offset:r}:{tile:i,offset:a}}},Vr=class e extends Rr{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},Hr=class e extends Rr{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(t,n,r){let i=new e(n||document.createElement(`div`),t);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,i=-1,a=null,o=-1;function s(e,c){for(let l=0,u=0;l<e.children.length&&u<=c;l++){let d=e.children[l],f=u+d.length;f>=c&&(d.isComposite()?s(d,c-u):(!a||a.isHidden&&(t>0&&!(a.flags&32)||n&&Wr(a,d)))&&(f>c||d.flags&32&&t<=1)?(a=d,o=c-u):(u<c||d.flags&16&&!d.isHidden&&t>=-1)&&(r=d,i=c-u)),u=f}}s(this,e);let c=(t<0?r:a)||r||a;return c?{tile:c,offset:c==r?i:o}:null}coordsIn(e,t,n){let r=this.resolveInline(e,t,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),t,n):Ur(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:r}=n;if(this.dom.contains(e.dom))return e.isText()?new In(e.dom,Math.min(e.dom.nodeValue.length,r)):e.domPosFor(r,e.flags&16?1:e.flags&32?-1:t);let i=n.tile.parent,a=!1;for(let e of i.children){if(a)return new In(e.dom,0);e==n.tile&&(a=!0)}}return new In(this.dom,0)}};function Ur(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=fn(t);return n[n.length-1]||null}function Wr(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}var Gr=class e extends Rr{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},Kr=class e extends z{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t,n){let r=this.dom.nodeValue.length;e>r&&(e=r);let i=e,a=e,o=0;e==0&&t<0||e==r&&t>=0?N.chrome||N.gecko||(e?(i--,o=1):a<r&&(a++,o=-1)):t<0?i--:a<r&&a++;let s=kn(this.dom,i,a).getClientRects();if(!s.length)return null;let c=s[(o?o<0:t>=0)?0:s.length-1];return N.safari&&!o&&c.width==0&&(c=Array.prototype.find.call(s,e=>e.width)||c),n==null?c:vn(c,(o?o>0:t<0)==n)}static of(t,n){let r=new e(n||document.createTextNode(t),t);return n||(r.flags|=2),r}},qr=class e extends z{constructor(e,t,n,r){super(e,t,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return vn(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let r=this.flags&16?!0:this.flags&32?!1:e>0;for(let i=r?t.length-1:0;n=t[i],!(e>0?i==0:i==t.length-1||n.top<n.bottom);i+=r?-1:1);return vn(n,!r)}}get overrideDOMText(){if(!this.length)return f.empty;let{root:e}=this;if(!e)return f.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(t,n,r,i,a){return a||(a=t.toDOM(n),t.editable||(a.contentEditable=`false`)),new e(a,r,t,i)}},Jr=class extends z{constructor(e){let t=document.createElement(`img`);t.className=`cm-widgetBuffer`,t.setAttribute(`aria-hidden`,`true`),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return f.empty}coordsIn(e,t,n){let r=this.dom.getBoundingClientRect();return n==null?r:vn(r,t>0==n)}},Yr=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:i,beforeBreak:a,parents:o}=this;for(;e||t>0;)if(!r.isComposite()){let t=r.length;if(i<t&&e){let a=Math.min(e,t-i);n&&n.skip(r,i,i+a),e-=a,i+=a}if(i==t)a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++;else if(!e)break}else if(a){if(!e)break;n&&n.break(),e--,a=!1}else if(i==r.children.length){if(!e&&!o.length)break;n&&n.leave(r),a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++}else{let s=r.children[i],c=s.breakAfter;(t>0?s.length<=e:s.length<e)&&(!n||n.skip(s,0,s.length)!==!1||!s.isComposite)?(a=!!c,i++,e-=s.length):(o.push({tile:r,index:i}),r=s,i=0,n&&s.isComposite()&&n.enter(s))}return this.tile=r,this.index=i,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}},Xr=class{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}},Zr=class{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){this.flushBuffer();let i=this.ensureMarks(t,n),a=i.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+e.length<512){this.cache.reused.set(a,2);let t=i.children[i.children.length-1]=new Kr(a.dom,a.text+e);t.parent=i}else i.append(r||Kr.of(e,this.cache.find(Kr)?.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?si(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],i=r.lastChild;if(i instanceof Gr&&i.mark.eq(n.mark))i.dom!=n.dom&&i.setDOM(si(n.dom)),r=i;else{if(this.cache.reused.get(n)){let e=z.get(n.dom);e&&e.setDOM(si(n.dom))}let e=Gr.of(n.mark,n.dom);r.append(e),r=e}this.cache.reused.set(n,2)}let i=z.get(e.text);i&&this.cache.reused.set(i,2);let a=new Kr(e.text,e.text.nodeValue);a.flags|=8,this.pos=e.range.toB,r.append(a)}addInlineWidget(e,t,n){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let i=this.ensureMarks(t,n);!r&&!(e.flags&16)&&i.append(this.getBuffer(1)),i.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){e||=ii;let n=Hr.start(e,t||this.cache.find(Hr)?.dom,!!t);this.getBlockPos().append(this.lastBlock=this.curLine=n)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){let n=this.curLine;for(let r=e.length-1;r>=0;r--){let i=e[r],a;if(t>0&&(a=n.lastChild)&&a instanceof Gr&&a.mark.eq(i))n=a,t--;else{let e=Gr.of(i,this.cache.find(Gr,e=>e.mark.eq(i))?.dom);n.append(e),n=e,t=0}}return n}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!ni(this.curLine,!1)||e.dom.nodeName!=`BR`&&e.isWidget()&&!(N.ios&&ni(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(li,0,32)||new qr(li.toDOM(),0,li,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=e.rank*102+e.value.rank,n=new Xr(e.from,e.to,e.value,t),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){this.updateBlockWrappers();let e=this.root;for(let t of this.wrappers){let n=e.lastChild;if(t.from<this.pos&&n instanceof Vr&&n.wrapper.eq(t.wrapper))e=n;else{let n=Vr.of(t.wrapper,this.cache.find(Vr,e=>e.wrapper.eq(t.wrapper))?.dom);e.append(n),e=n}}return e}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(Jr,void 0,1);return n&&(n.flags=t),n||new Jr(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},Qr=class{constructor(e){this.skipCount=0,this.text=``,this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text=``,this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw Error(`Ran out of text content when drawing inline views`);this.text=t;let i=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,i)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}},$r=[qr,Hr,Kr,Gr,Jr,Vr,Br];for(let e=0;e<$r.length;e++)$r[e].bucket=e;var ei=class{constructor(e){this.view=e,this.buckets=$r.map(()=>[]),this.index=$r.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,i=this.buckets[r],a=this.index[r];for(let e=0;e<i.length;e++){let o=(e+a)%i.length,s=i[o];if((!t||t(s))&&!this.reused.has(s))return i.splice(o,1),o<a&&this.index[r]--,this.reused.set(s,n),s}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let i=0,a=0;;i++){if(i==r.length){if(a)return null;a=1,i=0}let o=r[i];if(!this.reused.has(o)&&(a==0?o.widget.compare(e):o.widget.constructor==e.constructor&&e.updateDOM(o.dom,this.view,o.widget)))return r.splice(i,1),i<this.index[0]&&this.index[0]--,o.widget==e&&o.length==t&&(o.flags&497)==n?(this.reused.set(o,1),o):(this.reused.set(o,2),new qr(o.dom,t,e,o.flags&-498|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}},ti=class{constructor(e,t,n,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new ei(e),this.text=new Qr(e.state.doc),this.builder=new Zr(this.cache,new Br(e,e.contentDOM),A.iter(n)),this.cache.reused.set(t,2),this.old=new Yr(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,i=0,a=0;;){let o=a<e.length?e[a++]:null,s=o?o.fromA:this.old.root.length;if(s>r){let e=s-r;this.preserve(e,!a,!o),r=s,i+=e}if(!o)break;t&&o.fromA<=t.range.fromA&&o.toA>=t.range.toA?(this.forward(o.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(i,t.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,o.toA),this.emit(t.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(i,o.toB)),i=o.toB,r=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=oi(this.old),i=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget()){if(this.openWidget)this.builder.continueWidget(n-t);else{let a=n>0||t<e.length?qr.of(e.widget,this.view,n-t,e.flags&496,this.cache.maybeReuse(e)):this.cache.reuse(e);a.flags&256?(a.flags&=-2,this.builder.addBlockWidget(a)):(this.builder.ensureLine(null),this.builder.addInlineWidget(a,r,i),i=r.length)}}else if(e.isText())this.builder.ensureLine(null),!t&&n==e.length&&!this.cache.reused.has(e)?this.builder.addText(e.text,r,i,this.cache.reuse(e)):(this.cache.add(e),this.builder.addText(e.text.slice(t,n),r,i)),i=r.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof Jr)this.cache.add(e);else if(e instanceof Gr)this.builder.ensureLine(null),this.builder.addMark(e,r,i),this.cache.reused.set(e,1),i=r.length;else return!1;this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof Gr&&r.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?r.length&&=i=0:e instanceof Gr&&(r.shift(),i=Math.min(i,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,i=-1,a=A.spans(this.decorations,e,t,{point:(e,t,a,o,s,c)=>{if(a instanceof rn){if(this.disallowBlockEffectsFor[c]){if(a.block)throw RangeError(`Block decorations may not be specified via plugins`);if(t>this.view.state.doc.lineAt(e).to)throw RangeError(`Decorations that replace line breaks may not be specified via plugins`)}if(i=o.length,s>o.length)r.continueWidget(t-e);else{let i=a.widget||(a.block?ci.block:ci.inline),c=ri(a),l=this.cache.findWidget(i,t-e,c)||qr.of(i,this.view,t-e,c);a.block?(a.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(l)):(r.ensureLine(n),r.addInlineWidget(l,o,s))}n=null}else n=ai(n,a);t>e&&this.text.skip(t-e)},span:(e,t,a,o)=>{for(let i=e;i<t;){let s=this.text.next(Math.min(512,t-i));s==null?(r.addLineStartIfNotCovered(n),r.addBreak(),i++):(r.ensureLine(n),r.addText(s,a,i==e?o:a.length),i+=s.length),n=null}i=a.length}});i>-1&&(this.openWidget=a>i),this.openWidget||r.addLineStartIfNotCovered(n),this.openMarks=a}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let e=z.get(r);if(r==this.view.contentDOM)break;e instanceof Gr?t.push(e):e?.isLine()?n=e:e instanceof Vr||(r.nodeName==`DIV`&&!n&&r!=this.view.contentDOM?n=new Hr(r,ii):n||t.push(Gr.of(new tn({tagName:r.nodeName.toLowerCase(),attributes:$t(r)}),r)))}return{line:n,marks:t}}};function ni(e,t){let n=e=>{for(let r of e.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function ri(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}var ii={class:`cm-line`};function ai(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r?e:(e||={class:`cm-line`},n&&Jt(n,e),r&&(e.class+=` `+r),e)}function oi(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof Gr&&t.push(r.mark)}return t}function si(e){let t=z.get(e);return t&&t.setDOM(e.cloneNode()),e}var ci=class extends en{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}};ci.inline=new ci(`span`),ci.block=new ci(`div`);var li=new class extends en{toDOM(){return document.createElement(`br`)}get isHidden(){return!0}get editable(){return!0}},ui=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=F.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Br(e,e.contentDOM),this.updateInner([new Fr(0,0,0,e.state.doc.length)],null)}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(this.domChanged?.newSel?n=this.domChanged.newSel.head:!xi(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let r=n>-1?mi(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){let{from:n,to:r}=this.hasComposition;t=new Fr(n,r,e.changes.mapPos(n,-1),e.changes.mapPos(r,1)).addToSet(t.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(N.ie||N.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,a=this.blockWrappers;this.updateDeco();let o=_i(i,this.decorations,e.changes);o.length&&(t=Fr.extendWithRanges(t,o));let s=yi(a,this.blockWrappers,e.changes);return s.length&&(t=Fr.extendWithRanges(t,s)),r&&!t.some(e=>e.fromA<=r.range.fromA&&e.toA>=r.range.toA)&&(t=r.range.addToSet(t.slice())),this.tile.flags&2&&t.length==0?!1:(this.updateInner(t,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,r=new ti(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&z.get(t.text)&&r.cache.reused.set(z.get(t.text),2),this.tile=r.run(e,t),di(n,r.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+`px`,this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+`px`:``;let r=N.chrome||N.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||n.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=``});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof Si&&r.push(e.dom);n.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(vr)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:n}=this.tile,r=this.view.root.activeElement,i=r==n,a=!i&&!(this.view.state.facet(br)||n.tabIndex>-1)&&dn(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(i||t||a))return;let o=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,c,l;if(s.empty?l=c=this.inlineDOMNearPos(s.anchor,s.assoc||1):(l=this.inlineDOMNearPos(s.head,s.head==s.from?1:-1),c=this.inlineDOMNearPos(s.anchor,s.anchor==s.from?1:-1)),N.gecko&&s.empty&&!this.hasComposition&&fi(c)){let e=document.createTextNode(``);this.view.observer.ignore(()=>c.node.insertBefore(e,c.node.childNodes[c.offset]||null)),c=l=new In(e,0),o=!0}let u=this.view.observer.selectionRange;(o||!u.focusNode||(!pn(c.node,c.offset,u.anchorNode,u.anchorOffset)||!pn(l.node,l.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,s))&&(this.view.observer.ignore(()=>{N.android&&N.chrome&&n.contains(u.focusNode)&&bi(u.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let e=ln(this.view.root);if(e){if(s.empty){if(N.gecko){let e=hi(c.node,c.offset);if(e&&e!=3){let t=(e==1?Pn:Fn)(c.node,c.offset);t&&(c=new In(t.node,t.offset))}}e.collapse(c.node,c.offset),s.bidiLevel!=null&&e.caretBidiLevel!==void 0&&(e.caretBidiLevel=s.bidiLevel)}else if(e.extend){e.collapse(c.node,c.offset);try{e.extend(l.node,l.offset)}catch{}}else{let t=document.createRange();s.anchor>s.head&&([c,l]=[l,c]),t.setEnd(l.node,l.offset),t.setStart(c.node,c.offset),e.removeAllRanges(),e.addRange(t)}}a&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,l)),this.impreciseAnchor=c.precise?null:new In(u.anchorNode,u.anchorOffset),this.impreciseHead=l.precise?null:new In(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&pn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=ln(e.root),{anchorNode:r,anchorOffset:i}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let a=this.lineAt(t.head,t.assoc);if(!a)return;let o=a.posAtStart;if(t.head==o||t.head==o+a.length)return;let s=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!s||!c||s.bottom>c.top)return;let l=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(l.node,l.offset),n.modify(`move`,t.assoc<0?`forward`:`backward`,`lineboundary`),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(r,i)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=n.posAtStart;if(n.isComposite()){let i;if(e==n.dom)i=n.dom.childNodes[t];else{let r=_n(e)==0?0:t==0?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;r==0&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}i=r<0?e:e.nextSibling}if(i==n.dom.firstChild)return r;for(;i&&!z.get(i);)i=i.nextSibling;if(!i)return r+n.length;for(let e=0,t=r;;e++){let r=n.children[e];if(r.dom==i)return t;t+=r.length+r.breakAfter}}else if(n.isText())return e==n.dom?r+t:r+(t?n.length:0);else return r}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(r,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r=-1,i=!1,a,o=-1,s=!1;return this.tile.blockTiles((t,c)=>{if(t.isWidget()){if(t.flags&32&&c>=e)return!0;t.flags&16&&(i=!0)}else{let l=c+t.length;if(c<=e&&(n=t,r=e-c,i=l<e),l>=e&&!a&&(a=t,o=e-c,s=c>e),c>e&&a)return!0}}),!n&&!a?this.domAtPos(e,t):(i&&a?n=null:s&&n&&(a=null),n&&t<0||!a?n.domIn(r,t):a.domIn(o,t))}coordsAt(e,t,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,t);return r.isWidget()?r.widget instanceof Si?null:r.coordsInWidget(i,t,!0):r.coordsIn(i,t,n)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(e,t){if(e.isComposite())for(let n of e.children){if(n.length>=t){let e=r(n,t);if(e)return e}if(t-=n.length,t<0)break}else if(e.isText()&&t<e.length){let n=x(e.text,t);if(n==t)return null;let r=kn(e.dom,t,n).getClientRects();for(let e=0;e<r.length;e++){let t=r[e];if(e==r.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}return r(t,n)}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,i=this.view.contentDOM.clientWidth,a=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,s=this.view.textDirection==I.LTR,c=0,l=(e,u,d)=>{for(let f=0;f<e.children.length&&!(u>r);f++){let r=e.children[f],p=u+r.length,m=r.dom.getBoundingClientRect(),{height:h}=m;if(d&&!f&&(c+=m.top-d.top),r instanceof Vr)p>n&&l(r,u,m);else if(u>=n&&(c>0&&t.push(-c),t.push(h+c),c=0,a)){let e=r.dom.lastChild,t=e?fn(e):[];if(t.length){let e=t[t.length-1],n=s?e.right-m.left:m.right-e.left;n>o&&(o=n,this.minWidth=i,this.minWidthFrom=u,this.minWidthTo=p)}}d&&f==e.children.length-1&&(c+=d.bottom-m.bottom),u=p+r.breakAfter}};return l(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction==`rtl`?I.RTL:I.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t=0,n;for(let r of e.children){if(!r.isText()||/[^ -~]/.test(r.text))return;let e=fn(r.dom);if(e.length!=1)return;t+=e[0].width,n=e[0].height}if(t)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:t/e.length,textHeight:n}}});if(e)return e;let t=document.createElement(`div`),n,r,i;return t.className=`cm-line`,t.style.width=`99999px`,t.style.position=`absolute`,t.textContent=`abc def ghi jkl mno pqr stu`,this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let e=fn(t.firstChild)[0];n=t.getBoundingClientRect().height,r=e&&e.width?e.width/27:7,i=e&&e.height?e.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let i=r==t.viewports.length?null:t.viewports[r],a=i?i.from-1:this.view.state.doc.length;if(a>n){let r=(t.lineBlockAt(a).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(F.replace({widget:new Si(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,a))}if(!i)break;n=i.to+1}return F.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Er).map(t=>(this.dynamicDecorationMap[e++]=typeof t==`function`)?t(this.view):t),n=!1,r=this.view.state.facet(Or).map((e,t)=>{let r=typeof e==`function`;return r&&(n=!0),r?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(A.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(Dr).map(e=>typeof e==`function`?e(this.view):e)}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=t.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let t of this.view.state.facet(hr))try{if(t(this.view,e.range,e))return!0}catch(e){yr(this.view.state,e,`scroll handler`)}let{range:t}=e,n=this.coordsAt(t.head,t.assoc||(t.head>t.anchor?-1:1)),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let i=Nr(this.view),a={left:n.left-i.left,top:n.top-i.top,right:n.right+i.right,bottom:n.bottom+i.bottom},{offsetWidth:o,offsetHeight:s}=this.view.scrollDOM;if(xn(this.view.scrollDOM,a,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,o),-o),Math.max(Math.min(e.yMargin,s),-s),this.view.textDirection==I.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(n.top>window.visualViewport.offsetTop+window.visualViewport.height||n.bottom<window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(t.head,1);if(e){let t=wn(e.dom);e.dom.scrollIntoView({block:`nearest`}),Tn(t,!1)}}}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){di(this.tile)}};function di(e,t){let n=t?.get(e);if(n!=1){n??e.destroy();for(let n of e.children)di(n,t)}}function fi(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable==`false`)&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable==`false`)}function pi(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=Pn(n.focusNode,n.focusOffset),i=Fn(n.focusNode,n.focusOffset),a=r||i;if(i&&r&&i.node!=r.node){let t=z.get(i.node);if(!t||t.isText()&&t.text!=i.node.nodeValue)a=i;else if(e.docView.lastCompositionAfterCursor){let e=z.get(r.node);!e||e.isText()&&e.text!=r.node.nodeValue||(a=i)}}if(e.docView.lastCompositionAfterCursor=a!=r,!a)return null;let o=t-a.offset;return{from:o,to:o+a.node.nodeValue.length,node:a.node}}function mi(e,t,n){let r=pi(e,n);if(!r)return null;let{node:i,from:a,to:o}=r,s=i.nodeValue;if(/[\n\r]/.test(s)||e.state.doc.sliceString(r.from,r.to)!=s)return null;let c=t.invertedDesc;return{range:new Fr(c.mapPos(a),c.mapPos(o),a,o),text:i}}function hi(e,t){return e.nodeType==1?(t&&e.childNodes[t-1].contentEditable==`false`?1:0)|(t<e.childNodes.length&&e.childNodes[t].contentEditable==`false`?2:0):0}var gi=class{constructor(){this.changes=[]}compareRange(e,t){sn(e,t,this.changes)}comparePoint(e,t){sn(e,t,this.changes)}boundChange(e){sn(e,e,this.changes)}};function _i(e,t,n){let r=new gi;return A.compare(e,t,n,r),r.changes}var vi=class{constructor(){this.changes=[]}compareRange(e,t){sn(e,t,this.changes)}comparePoint(){}boundChange(e){sn(e,e,this.changes)}};function yi(e,t,n){let r=new vi;return A.compare(e,t,n,r),r.changes}function bi(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable==`false`)return!0;return!1}function xi(e,t){let n=!1;return t&&e.iterChangedRanges((e,r)=>{e<t.to&&r>t.from&&(n=!0)}),n}var Si=class extends en{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement(`div`);return e.className=`cm-gap`,this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+`px`,!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}};function Ci(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),a=t-i.from;if(i.length==0)return T.cursor(t);a==0?n=1:a==i.length&&(n=-1);let o=a,s=a;n<0?o=x(i.text,a,!1):s=x(i.text,a);let c=r(i.text.slice(o,s));for(;o>0;){let e=x(i.text,o,!1);if(r(i.text.slice(e,o))!=c)break;o=e}for(;s<i.length;){let e=x(i.text,s);if(r(i.text.slice(s,e))!=c)break;s=e}return T.undirectionalRange(o+i.from,s+i.from)}function wi(e,t,n,r,i){let a=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>e.defaultLineHeight*1.5){let t=e.viewState.heightOracle.textHeight,r=Math.floor((i-n.top-(e.defaultLineHeight-t)*.5)/t);a+=r*e.viewState.heightOracle.lineLength}let o=e.state.sliceDoc(n.from,n.to);return n.from+St(o,a,e.state.tabSize)}function Ti(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let e;for(let i of r.type){if(i.from>t)break;if(!(i.to<t)){if(i.from<t&&i.to>t)return i;(!e||i.type==P.Text&&(e.type!=i.type||(n<0?i.from<t:i.to>t)))&&(e=i)}}return e||r}return r}function Ei(e,t,n,r){let i=Ti(e,t.head,t.assoc||-1),a=!r||i.type!=P.Text||!(e.lineWrapping||i.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head);if(a){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(i.from),o=e.posAtCoords({x:n==(r==I.LTR)?t.right-1:t.left+1,y:(a.top+a.bottom)/2});if(o!=null)return T.cursor(o,n?-1:1)}return T.cursor(n?i.to:i.from,n?-1:1)}function Di(e,t,n,r){let i=e.state.doc.lineAt(t.head),a=e.bidiSpans(i),o=e.textDirectionAt(i.from);for(let s=t,c=null;;){let t=nr(i,a,o,s,n),l=tr;if(!t){if(i.number==(n?e.state.doc.lines:1))return s;l=`8-`,i=e.state.doc.line(i.number+(n?1:-1)),a=e.bidiSpans(i),t=e.visualLineSide(i,!n)}if(!c){if(!r)return t;c=r(l)}else if(!c(l))return s;s=t}}function Oi(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return e=>{let t=r(e);return i==O.Space&&(i=t),i==t}}function ki(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return T.cursor(i,t.assoc);let o=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(i,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),u=e.documentTop;if(l)o??=l.left-c.left,s=a<0?l.top:l.bottom;else{let t=e.viewState.lineBlockAt(i);o??=Math.min(c.right-c.left,e.defaultCharacterWidth*(i-t.from)),s=(a<0?t.top:t.bottom)+u}let d=c.left+o,f=e.viewState.heightOracle.textHeight>>1,p=r??f;for(let t=0;;t+=f){let r=s+(p+t)*a,i=Pi(e,{x:d,y:r},!1,a);if(n?r>c.bottom:r<c.top)return T.cursor(i.pos,i.assoc);let l=e.coordsAtPos(i.pos,i.assoc),u=l?(l.top+l.bottom)/2:0;if(!l||(n?u>s:u<s))return T.cursor(i.pos,i.assoc,void 0,o)}}function Ai(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,a)=>{if(t>e&&t<i){let a=r||n||(t-e<i-t?-1:1);t=a<0?e:i,r=a}});if(!r)return t}}function ji(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],a=null;if(i.empty){let t=Ai(e,i.from,0);t!=i.from&&(a=T.cursor(t,-1))}else{let t=Ai(e,i.from,-1),n=Ai(e,i.to,1);(t!=i.from||n!=i.to)&&(a=i.undirectional?T.undirectionalRange(i.from,i.to):T.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}a&&(n||=t.ranges.slice(),n[r]=a)}return n?T.create(n,t.mainIndex):t}function Mi(e,t,n){let r=Ai(e.state.facet(kr).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:T.cursor(r,r<n.from?1:-1)}var Ni=class{constructor(e,t){this.pos=e,this.assoc=t}};function Pi(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),a=i.top+e.viewState.paddingTop,{x:o,y:s}=t,c=s-a,l;for(;;){if(c<0)return new Ni(0,1);if(c>e.viewState.docHeight)return new Ni(e.state.doc.length,-1);if(l=e.elementAtHeight(c),r==null)break;if(l.type==P.Text){if(r<0?l.to<e.viewport.from:l.from>e.viewport.to)break;let t=e.docView.coordsAt(r<0?l.from:l.to,r>0?-1:1);if(t&&(r<0?t.top<=c+a:t.bottom>=c+a))break}let t=e.viewState.heightOracle.textHeight/2;c=r>0?l.bottom+t:l.top-t}if(e.viewport.from>=l.to||e.viewport.to<=l.from){if(n)return null;if(l.type==P.Text){let t=wi(e,i,l,o,s);return new Ni(t,t==l.from?1:-1)}}if(l.type!=P.Text)return c<(l.top+l.bottom)/2?new Ni(l.from,1):new Ni(l.to,-1);let u=e.docView.lineAt(l.from,2);return(!u||u.length!=l.length)&&(u=e.docView.lineAt(l.from,-2)),new Fi(e,o,s,e.textDirectionAt(l.from)).scanTile(u,l.from)}var Fi=class{constructor(e,t,n,r){this.view=e,this.x=t,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[Kn.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[Kn.find(r,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<t)}scan(e,t,n=!1){let r=0,i=e.length-1,a=new Set,o=this.bidiIn(e[0],e[i]),s,c,l=-1,u=1e9,d;search:for(;r<i;){let n=i-r,f=r+i>>1;adjust:if(a.has(f)){for(let e=1;e<n;e++){let t=f+e;if(t>=i&&(t-=n),!a.has(t)){f=t;break adjust}}break search}a.add(f);let p=t(f),m=0;if(p)for(let e=0;e<p.length;e++){let t=p[e];if(!(t.width==0&&p.length>1)){if(t.bottom<this.y)(!s||s.bottom<t.bottom)&&(s=t),m=1;else if(t.top>this.y)(!c||c.top>t.top)&&(c=t),m=-1;else{let e=t.left>this.x?this.x-t.left:t.right<this.x?this.x-t.right:0,n=Math.abs(e);n<u&&(l=f,u=n,d=t),e&&(m=e<0==(this.baseDir==I.LTR)?-1:1)}}}m==-1&&(!o||this.baseDirAt(e[f],1))?i=f:m==1&&(!o||this.baseDirAt(e[f+1],-1))&&(r=f+1)}if(!d){if(!c&&!s)return{i:e[0],after:!1};let n=s&&(!c||this.y-s.bottom<c.top-this.y)?s:c;return this.y=(n.top+n.bottom)/2,this.scan(e,t,!0)}if(u&&!n){let{top:n,bottom:r}=d;if(s&&s.bottom>(n+n+r)/3)return this.y=s.bottom-1,this.scan(e,t,!0);if(c&&c.top<(n+r+r)/3)return this.y=c.top+1,this.scan(e,t,!0)}let f=(o?this.dirAt(e[l],1):this.baseDir)==I.LTR;return{i:l,after:this.x>(d.left+d.right)/2==f}}scanText(e,t){let n=[];for(let r=0;r<e.length;r=x(e.text,r))n.push(t+r);n.push(t+e.length);let r=this.scan(n,r=>{let i=n[r]-t,a=n[r+1]-t;return kn(e.dom,i,a).getClientRects()});return r.after?new Ni(n[r.i+1],-1):new Ni(n[r.i],1)}scanTile(e,t){if(!e.length)return new Ni(t,1);if(e.children.length==1){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let r=0,i=t;r<e.children.length;r++)n.push(i+=e.children[r].length);let r=this.scan(n,t=>{let n=e.children[t];return n.flags&48?null:(n.dom.nodeType==1?n.dom:kn(n.dom,0,n.length)).getClientRects()}),i=e.children[r.i],a=n[r.i];return i.isText()?this.scanText(i,a):i.isComposite()?this.scanTile(i,a):r.after?new Ni(n[r.i+1],-1):new Ni(a,1)}},Ii=``,Li=class{constructor(e,t){this.points=e,this.view=t,this.text=``,this.lineSeparator=t.state.facet(k.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Ii}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let i=z.get(r),a=r.nextSibling;if(a==t){i?.breakAfter&&!a&&n!=this.view.contentDOM&&this.lineBreak();break}let o=z.get(a);(i&&o?i.breakAfter:(i?i.breakAfter:hn(r))||hn(a)&&(r.nodeName!=`BR`||i?.isWidget())&&this.text.length>e)&&!zi(a,t)&&this.lineBreak(),r=a}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,a=1,o;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),a=this.lineSeparator.length):(o=r.exec(t))&&(i=o.index,a=o[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),a>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=a-1);n=i+a}}readNode(e){let t=z.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName==`BR`?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(Ri(e,n.node,n.offset)?t:0))}};function Ri(e,t,n){for(;;){if(!t||n<_n(t))return!1;if(t==e)return!0;n=mn(t)+1,t=t.parentNode}}function zi(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let t=z.get(e);if(!t?.isWidget())return!1;t&&(n||=[]).push(t)}if(n){for(let e of n)if(e.overrideDOMText?.length)return!1}return!0}var Bi=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},Vi=class{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text=``,this.domChanged=t>-1;let{impreciseHead:i,impreciseAnchor:a}=e.docView,o=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=Hi(e.docView.tile,t,n,0))){let t=i||a?[]:qi(e),n=new Li(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=Ji(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=i&&i.node==t.focusNode&&i.offset==t.focusOffset||!un(e.contentDOM,t.focusNode)?o.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=a&&a.node==t.anchorNode&&a.offset==t.anchorOffset||!un(e.contentDOM,t.anchorNode)?o.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),s=e.viewport;if((N.ios||N.chrome)&&n!=r&&Math.min(n,r)<=o.main.from&&Math.max(n,r)>=o.main.to&&(s.from>0||s.to<e.state.doc.length)){let t=Math.min(n,r),i=Math.max(n,r),a=s.from-t,o=s.to-i;(a==0||a==1||t==0)&&(o==0||o==-1||i==e.state.doc.length)&&(n=0,r=e.state.doc.length)}if(e.inputState.composing>-1&&o.ranges.length>1)this.newSel=o.replaceRange(T.range(r,n));else if(e.lineWrapping&&r==n&&!(o.main.empty&&o.main.head==n)&&e.inputState.lastTouchTime>Date.now()-100){let t=e.coordsAtPos(n,-1),r=0;t&&(r=e.inputState.lastTouchY<=t.bottom?-1:1),this.newSel=T.create([T.cursor(n,r)])}else this.newSel=T.single(r,n)}}};function Hi(e,t,n,r){if(e.isComposite()){let i=-1,a=-1,o=-1,s=-1;for(let c=0,l=r,u=r;c<e.children.length;c++){let r=e.children[c],d=l+r.length;if(l<t&&d>n)return Hi(r,t,n,l);if(d>=t&&i==-1&&(i=c,a=l),l>n&&r.dom.parentNode==e.dom){o=c,s=u;break}u=d,l=d+r.breakAfter}return{from:a,to:s<0?r+e.length:s,startDOM:(i?e.children[i-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o<e.children.length&&o>=0?e.children[o].dom:null}}return e.isText()?{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function Ui(e,t){let n,{newSel:r}=t,{state:i}=e,a=i.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:e,to:r}=t.bounds,s=a.from,c=null;(o===8||N.android&&t.text.length<r-e)&&(s=a.to,c=`end`);let l=i.doc.sliceString(e,r,Ii),u,d;!a.empty&&a.from>=e&&a.to<=r&&(t.typeOver||l!=t.text)&&l.slice(0,a.from-e)==t.text.slice(0,a.from-e)&&l.slice(a.to-e)==t.text.slice(u=t.text.length-(l.length-(a.to-e)))?n={from:a.from,to:a.to,insert:f.of(t.text.slice(a.from-e,u).split(Ii))}:(d=Ki(l,t.text,s-e,c))&&(N.chrome&&o==13&&d.toB==d.from+2&&t.text.slice(d.from,d.toB)==``&&d.toB--,n={from:e+d.from,to:e+d.toA,insert:f.of(t.text.slice(d.from,d.toB).split(Ii))})}else r&&(!e.hasFocus&&i.facet(br)||Yi(r,a))&&(r=null);if(!n&&!r)return!1;if((N.mac||N.android)&&n&&n.from==n.to&&n.from==a.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute(`autocorrect`)==`off`?(r&&n.insert.length==2&&(r=T.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:f.of([n.insert.toString().replace(`.`,` `)])}):i.doc.lineAt(a.from).to<a.to&&e.docView.lineHasWidget(a.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:a.from,to:a.to,insert:i.toText(e.inputState.insertingText)}:N.chrome&&n&&n.from==n.to&&n.from==a.head&&n.insert.toString()==`9- `&&e.lineWrapping&&(r&&=T.single(r.main.anchor-1,r.main.head-1),n={from:a.from,to:a.to,insert:f.of([` `])}),n)return Wi(e,n,r,o);if(r&&!Yi(r,a)){let t=!1,n=`select`;return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin==`select`&&(t=!0),n=e.inputState.lastSelectionOrigin,n==`select.pointer`&&(r=ji(i.facet(kr).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}return!1}function Wi(e,t,n,r=-1){if(N.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(N.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==` `)&&t.insert.length==1&&t.insert.lines==2&&An(e.contentDOM,`Enter`,13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&An(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&An(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||=Gi(e,t,n);return e.state.facet(lr).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function Gi(e,t,n){let r,i=e.state,a=i.selection.main,o=-1;if(t.from==t.to&&t.from<a.from||t.from>a.to){let n=t.from<a.from?-1:1,r=n<0?a.from:a.to,s=Ai(i.facet(kr).map(t=>t(e)),r,n);t.from==s&&(o=s)}if(o>-1)r={changes:t,selection:T.cursor(t.from+t.insert.length,-1)};else if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=a.from<t.from?i.sliceDoc(a.from,t.from):``,o=a.to>t.to?i.sliceDoc(t.to,a.to):``;r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+o))}else{let o=i.changes(t),s=n&&n.main.to<=o.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=a.to+10&&t.to>=a.to-10){let c=e.state.sliceDoc(t.from,t.to),l,u=n&&pi(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(a.head);let d=a.to-t.to;r=i.changeByRange(n=>{if(n.from==a.from&&n.to==a.to)return{changes:o,range:s||n.map(o)};let r=n.to-d,u=r-c.length;if(e.state.sliceDoc(u,r)!=c||r>=l.from&&u<=l.to)return{range:n};let f=i.changes({from:u,to:r,insert:t.insert}),p=n.to-a.to;return{changes:f,range:s?T.range(Math.max(0,s.anchor+p),Math.max(0,s.head+p)):n.map(f)}})}else r={changes:o,selection:s&&i.selection.replaceRange(s)}}let s=`input.type`;return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=`.compose`,e.inputState.compositionFirstChange&&(s+=`.start`,e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function Ki(e,t,n,r){let i=Math.min(e.length,t.length),a=0;for(;a<i&&e.charCodeAt(a)==t.charCodeAt(a);)a++;if(a==i&&e.length==t.length)return null;let o=e.length,s=t.length;for(;o>0&&s>0&&e.charCodeAt(o-1)==t.charCodeAt(s-1);)o--,s--;if(r==`end`){let e=Math.max(0,a-Math.min(o,s));n-=o+e-a}if(o<a&&e.length<t.length){let e=n<=a&&n>=o?a-n:0;a-=e,s=a+(s-o),o=a}else if(s<a){let e=n<=a&&n>=s?a-n:0;a-=e,o=a+(o-s),s=a}return{from:a,toA:o,toB:s}}function qi(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=e.observer.selectionRange;return n&&(t.push(new Bi(n,r)),(i!=n||a!=r)&&t.push(new Bi(i,a))),t}function Ji(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?T.single(n+t,r+t):null}function Yi(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}var Xi=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText=``,this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,N.safari&&e.contentDOM.addEventListener(`input`,()=>null),N.gecko&&Ma(e.contentDOM.ownerDocument)}handleEvent(e){!ua(this.view,e)||this.ignoreDuringComposition(e)||e.type==`keydown`&&this.keydown(e)||(this.view.updateState==0?this.runHandlers(e.type,e):Promise.resolve().then(()=>this.runHandlers(e.type,e)))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=$i(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if(e!=`scroll`){let i=!t[e].handlers.length,a=n[e];a&&i!=!a.handlers.length&&(r.removeEventListener(e,this.handleEvent),a=null),a||r.addEventListener(e,this.handleEvent,{passive:i})}for(let e in n)e!=`scroll`&&!t[e]&&r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&na.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),N.android&&N.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(N.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(ea.some(t=>t.keyCode==e.keyCode)&&!e.ctrlKey||ta.indexOf(e.key)>-1&&e.ctrlKey)){let t={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return t.shiftKey&&N.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&Zi(this.view.win)&&(t.shiftKey=!1),this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:t},setTimeout(()=>this.flushIOSKey(),250),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key==`Enter`&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,An(this.view.contentDOM,t.key,t.keyCode,t.mods))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:N.safari&&!N.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function Zi(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function Qi(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){yr(n.state,e)}}}function $i(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(Qi(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(Qi(t.value,r))}}for(let e in da)n(e).handlers.push(da[e]);for(let e in B)n(e).observers.push(B[e]);return t}var ea=[{key:`Backspace`,keyCode:8,inputType:`deleteContentBackward`},{key:`Enter`,keyCode:13,inputType:`insertParagraph`},{key:`Enter`,keyCode:13,inputType:`insertLineBreak`},{key:`Delete`,keyCode:46,inputType:`deleteContentForward`}],ta=`dthko`,na=[16,17,18,20,91,92,224,225],ra=6;function ia(e){return Math.max(0,e)*.7+8}function aa(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}var oa=class{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=Sn(e.contentDOM),this.atoms=e.state.facet(kr).map(t=>t(e));let i=e.contentDOM.ownerDocument;i.addEventListener(`mousemove`,this.move=this.move.bind(this)),i.addEventListener(`mouseup`,this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(k.allowMultipleSelections)&&sa(e,t),this.dragging=la(e,t)&&xa(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&aa(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,i=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:o}=this.scrollParents.y.getBoundingClientRect());let s=Nr(this.view);e.clientX-s.left<=r+ra?t=-ia(r-e.clientX):e.clientX+s.right>=a-ra&&(t=ia(e.clientX-a)),e.clientY-s.top<=i+ra?n=-ia(i-e.clientY):e.clientY+s.bottom>=o-ra&&(n=ia(e.clientY-o)),this.setScrollSpeed(t,n)}up(e){this.dragging??this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener(`mousemove`,this.move),e.removeEventListener(`mouseup`,this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=ji(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:`select.pointer`}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent(`input.type`))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function sa(e,t){let n=e.state.facet(ir);return n.length?n[0](t):N.mac?t.metaKey:t.ctrlKey}function ca(e,t){let n=e.state.facet(ar);return n.length?n[0](t):N.mac?!t.altKey:!t.ctrlKey}function la(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=ln(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}function ua(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=z.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}var da=Object.create(null),B=Object.create(null),fa=N.ie&&N.ie_version<15||N.ios&&N.webkit_version<604;function pa(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement(`textarea`));n.style.cssText=`position: fixed; left: -10000px; top: 10px`,n.focus(),setTimeout(()=>{e.focus(),n.remove(),ha(e,n.value)},50)}function ma(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function ha(e,t){t=ma(e.state,dr,t);let{state:n}=e,r,i=1,a=n.toText(t),o=a.lines==n.selection.ranges.length;if(Da!=null&&n.selection.ranges.every(e=>e.empty)&&Da==a.toString()){let e=-1;r=n.changeByRange(r=>{let s=n.doc.lineAt(r.from);if(s.from==e)return{range:r};e=s.from;let c=n.toText((o?a.line(i++).text:t)+n.lineBreak);return{changes:{from:s.from,insert:c},range:T.cursor(r.from+c.length)}})}else r=o?n.changeByRange(e=>{let t=a.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:T.cursor(e.from+t.length)}}):n.replaceSelection(a);e.dispatch(r,{userEvent:`input.paste`,scrollIntoView:!0})}B.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,N.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())},B.wheel=B.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},da.keydown=(e,t)=>(e.inputState.setSelectionOrigin(`select`),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),B.touchstart=(e,t)=>{let n=e.inputState,r=t.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin(`select.pointer`)},B.touchmove=e=>{e.inputState.setSelectionOrigin(`select.pointer`)},B.touchend=(e,t)=>{e.inputState.touchActive=!1},da.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(or))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=Sa(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new oa(e,t,n,r)),r&&e.observer.ignore(()=>{Dn(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}else e.inputState.setSelectionOrigin(`select.pointer`);return!1};function ga(e,t,n,r){if(r==1)return T.cursor(t,n);if(r==2)return Ci(e.state,t,n);{let r=e.docView.lineAt(t,n),i=e.state.doc.lineAt(r?r.posAtEnd:t),a=r?r.posAtStart:i.from,o=r?r.posAtEnd:i.to;return o<e.state.doc.length&&o==i.to&&o++,T.undirectionalRange(a,o)}}var _a=N.ie&&N.ie_version<=11,va=null,ya=0,ba=0;function xa(e){if(!_a)return e.detail;let t=va,n=ba;return va=e,ba=Date.now(),ya=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(ya+1)%3:1}function Sa(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=xa(t),i=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),i=i.map(e.changes))},get(t,a,o){let s=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),c,l=ga(e,s.pos,s.assoc,r);if(n.pos!=s.pos&&!a){let t=ga(e,n.pos,n.assoc,r),i=Math.min(t.from,l.from),a=Math.max(t.to,l.to);l=i<l.from?T.range(i,a,l.assoc):T.range(a,i,l.assoc)}return a?i.replaceRange(i.main.extend(l.from,l.to,l.assoc)):o&&r==1&&i.ranges.length>1&&(c=Ca(i,s.pos))?c:o?i.addRange(l):T.create([l])}}}function Ca(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return T.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-+(e.mainIndex>n))}return null}da.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=T.undirectionalRange(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData(`Text`,ma(e.state,fr,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed=`copyMove`),!1},da.dragend=e=>(e.inputState.draggedContent=null,!1);function wa(e,t,n,r){if(n=ma(e.state,dr,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,o=r&&a&&ca(e,t)?{from:a.from,to:a.to}:null,s={from:i,insert:n},c=e.state.changes(o?[o,s]:s);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(i,-1),head:c.mapPos(i,1)},userEvent:o?`move.drop`:`input.drop`}),e.inputState.draggedContent=null}da.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,a=()=>{++i==n.length&&wa(e,t,r.filter(e=>e!=null).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=a,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),a()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData(`Text`);if(n)return wa(e,t,n,!0),!0}return!1},da.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=fa?null:t.clipboardData;return n?(ha(e,n.getData(`text/plain`)||n.getData(`text/uri-list`)),!0):(pa(e),!1)};function Ta(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement(`textarea`));r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function Ea(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let i=-1;for(let{from:r}of e.selection.ranges){let a=e.doc.lineAt(r);a.number>i&&(t.push(a.text),n.push({from:a.from,to:Math.min(e.doc.length,a.to+1)})),i=a.number}r=!0}return{text:ma(e,fr,t.join(e.lineBreak)),ranges:n,linewise:r}}var Da=null;da.copy=da.cut=(e,t)=>{if(!dn(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=Ea(e.state);if(!n&&!i)return!1;Da=i?n:null,t.type==`cut`&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:`delete.cut`});let a=fa?null:t.clipboardData;return a?(a.clearData(),a.setData(`text/plain`,n),!0):(Ta(e,n),!1)};var Oa=Ve.define();function ka(e,t){let n=[];for(let r of e.facet(ur)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:Oa.of(!0)}):null}function Aa(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=ka(e.state,t);n?e.dispatch(n):e.update([])}},10)}B.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),Aa(e)},B.blur=e=>{e.observer.clearSelectionRange(),Aa(e)},B.compositionstart=B.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange??(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},B.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,N.chrome&&N.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},B.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},da.beforeinput=(e,t)=>{if((t.inputType==`insertText`||t.inputType==`insertCompositionText`)&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType==`insertReplacementText`&&e.observer.editContext){let n=t.dataTransfer?.getData(`text/plain`),r=t.getTargetRanges();if(n&&r.length){let t=r[0];return Wi(e,{from:e.posAtDOM(t.startContainer,t.startOffset),to:e.posAtDOM(t.endContainer,t.endOffset),insert:e.state.toText(n)},null),!0}}let n;if(N.chrome&&N.android&&(n=ea.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(n.key,n.keyCode),n.key==`Backspace`||n.key==`Delete`)){let t=window.visualViewport?.height||0;setTimeout(()=>{(window.visualViewport?.height||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return N.ios&&t.inputType==`deleteContentForward`&&e.observer.flushSoon(),N.safari&&t.inputType==`insertText`&&e.inputState.composing>=0&&setTimeout(()=>B.compositionend(e,t),20),!1};var ja=new Set;function Ma(e){ja.has(e)||(ja.add(e),e.addEventListener(`copy`,()=>{}),e.addEventListener(`cut`,()=>{}))}var Na=[`pre-wrap`,`normal`,`pre-line`,`break-spaces`],Pa=!1;function Fa(){Pa=!1}var Ia=class{constructor(e){this.lineWrapping=e,this.doc=f.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Na.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,n,r,i,a){let o=Na.indexOf(e)>-1,s=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=i,s){this.heightSamples={};for(let e=0;e<a.length;e++){let t=a[e];t<0?e++:this.heightSamples[Math.floor(t*10)]=!0}}return s}},La=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},Ra=class e{constructor(e,t,n,r,i){this.from=e,this.length=t,this.top=n,this.height=r,this._content=i}get type(){return typeof this._content==`number`?P.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof rn?this._content.widget:null}get widgetLineBreaks(){return typeof this._content==`number`?this._content:0}join(t){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new e(this.from,this.length+t.length,this.top,this.height+t.height,n)}},V=(function(e){return e[e.ByPos=0]=`ByPos`,e[e.ByHeight=1]=`ByHeight`,e[e.ByPosNoHeight=2]=`ByPosNoHeight`,e})(V||={}),za=.001,Ba=class e{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>za&&(Pa=!0),this.height=e)}replace(t,n,r){return e.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this,a=n.doc;for(let o=r.length-1;o>=0;o--){let{fromA:s,toA:c,fromB:l,toB:u}=r[o],d=i.lineAt(s,V.ByPosNoHeight,n.setDoc(t),0,0),f=d.to>=c?d:i.lineAt(c,V.ByPosNoHeight,n,0,0);for(u+=f.to-c,c=f.to;o>0&&d.from<=r[o-1].toA;)s=r[o-1].fromA,l=r[o-1].fromB,o--,s<d.from&&(d=i.lineAt(s,V.ByPosNoHeight,n,0,0));l+=d.from-s,s=d.from;let p=Ya.build(n.setDoc(a),e,l,u);i=Va(i,i.replace(s,c,p))}return i.updateHeight(n,0)}static empty(){return new Wa(0,0,0)}static of(t){if(t.length==1)return t[0];let n=0,r=t.length,i=0,a=0;for(;;)if(n==r){if(i>a*2){let e=t[n-1];e.break?t.splice(--n,1,e.left,null,e.right):t.splice(--n,1,e.left,e.right),r+=1+e.break,i-=e.size}else if(a>i*2){let e=t[r];e.break?t.splice(r,1,e.left,null,e.right):t.splice(r,1,e.left,e.right),r+=2+e.break,a-=e.size}else break}else if(i<a){let e=t[n++];e&&(i+=e.size)}else{let e=t[--r];e&&(a+=e.size)}let o=0;return t[n-1]==null?(o=1,n--):t[n]??(o=1,r++),new Ka(e.of(t.slice(0,n)),o,e.of(t.slice(r)))}};function Va(e,t){return e==t?e:(e.constructor!=t.constructor&&(Pa=!0),t)}Ba.prototype.size=1;var Ha=F.replace({}),Ua=class extends Ba{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new Ra(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new Ra(r,0,n,this.spaceAbove,Ha):this.mainBlock(n,r)}lineAt(e,t,n,r,i){let a=this.mainBlock(r,i);return this.spaceAbove?this.blockAt(0,n,r,i).join(a):a}forEachLine(e,t,n,r,i,a){e<=i+this.length&&t>=i&&a(this.lineAt(0,V.ByPos,n,r,i))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},Wa=class e extends Ua{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new Ra(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof e||i instanceof Ga&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof Ga?i=new e(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Ba.of(r)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:``}${this.widgetHeight?`:`+this.widgetHeight:``})`}},Ga=class e extends Ba{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-n+1,a,o=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);a=t/i,this.length>i+1&&(o=(this.height-t)/(this.length-i-1))}else a=this.height/i;return{firstLine:n,lastLine:r,perLine:a,perChar:o}}blockAt(e,t,n,r){let{firstLine:i,lastLine:a,perLine:o,perChar:s}=this.heightMetrics(t,r);if(t.lineWrapping){let i=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),a=t.doc.lineAt(i),c=o+a.length*s,l=Math.max(n,e-c/2);return new Ra(a.from,a.length,l,c,0)}{let r=Math.max(0,Math.min(a-i,Math.floor((e-n)/o))),{from:s,length:c}=t.doc.line(i+r);return new Ra(s,c,n+o*r,o,0)}}lineAt(e,t,n,r,i){if(t==V.ByHeight)return this.blockAt(e,n,r,i);if(t==V.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new Ra(t,r-t,0,0,0)}let{firstLine:a,perLine:o,perChar:s}=this.heightMetrics(n,i),c=n.doc.lineAt(e),l=o+c.length*s,u=c.number-a,d=r+o*u+s*(c.from-i-u);return new Ra(c.from,c.length,Math.max(r,Math.min(d,r+this.height-l)),l,0)}forEachLine(e,t,n,r,i,a){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:o,perLine:s,perChar:c}=this.heightMetrics(n,i);for(let l=e,u=r;l<=t;){let t=n.doc.lineAt(l);if(l==e){let n=t.number-o;u+=s*n+c*(e-i-n)}let r=s+c*t.length;a(new Ra(t.from,t.length,u,r,0)),u+=r,l=t.to+1}}replace(t,n,r){let i=this.length-n;if(i>0){let t=r[r.length-1];t instanceof e?r[r.length-1]=new e(t.length+i):r.push(null,new e(i-1))}if(t>0){let n=r[0];n instanceof e?r[0]=new e(t+n.length):r.unshift(new e(t-1),null)}return Ba.of(r)}decomposeLeft(t,n){n.push(new e(t-1),null)}decomposeRight(t,n){n.push(null,new e(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let a=n+this.length;if(i&&i.from<=n+this.length&&i.more){let r=[],o=Math.max(n,i.from),s=-1;for(i.from>n&&r.push(new e(i.from-n-1).updateHeight(t,n));o<=a&&i.more;){let e=t.doc.lineAt(o).length;r.length&&r.push(null);let n=i.heights[i.index++],a=0;n<0&&(a=-n,n=i.heights[i.index++]),s==-1?s=n:Math.abs(n-s)>=za&&(s=-2);let c=new Wa(e,n,a);c.outdated=!1,r.push(c),o+=e+1}o<=a&&r.push(null,new e(a-o).updateHeight(t,o));let c=Ba.of(r);return(s<0||Math.abs(c.height-this.height)>=za||Math.abs(s-this.heightMetrics(t,n).perLine)>=za)&&(Pa=!0),Va(this,c)}return(r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}},Ka=class extends Ba{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let i=n+this.left.height;return e<i?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,i,r+this.left.length+this.break)}lineAt(e,t,n,r,i){let a=r+this.left.height,o=i+this.left.length+this.break,s=t==V.ByHeight?e<a:e<o,c=s?this.left.lineAt(e,t,n,r,i):this.right.lineAt(e,t,n,a,o);if(this.break||(s?c.to<o:c.from>o))return c;let l=t==V.ByPosNoHeight?V.ByPosNoHeight:V.ByPos;return s?c.join(this.right.lineAt(o,l,n,a,o)):this.left.lineAt(o,l,n,r,i).join(c)}forEachLine(e,t,n,r,i,a){let o=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e<s&&this.left.forEachLine(e,t,n,r,i,a),t>=s&&this.right.forEachLine(e,t,n,o,s,a);else{let c=this.lineAt(s,V.ByPos,n,r,i);e<c.from&&this.left.forEachLine(e,c.from-1,n,r,i,a),c.to>=e&&c.from<=t&&a(c),t>c.to&&this.right.forEachLine(c.to+1,t,n,o,s,a)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let a=i.length;for(let e of n)i.push(e);if(e>0&&qa(i,a-1),t<this.length){let e=i.length;this.decomposeRight(t,i),qa(i,e)}return Ba.of(i)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?Ba.of(this.break?[e,null,t]:[e,t]):(this.left=Va(this.left,e),this.right=Va(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:i,right:a}=this,o=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=o+a.length&&r.more?s=a=a.updateHeight(e,o,n,r):a.updateHeight(e,o,n),s?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?` `:`-`)+this.right}};function qa(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof Ga&&(r=e[t+1])instanceof Ga&&e.splice(t-1,3,new Ga(n.length+1+r.length))}var Ja=5,Ya=class e{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof Wa?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new Wa(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,i=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let a=t-e;n.block?this.addBlock(new Ua(a,r,n)):(a||i||r>=Ja)&&this.addLineDeco(r,i,a)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Wa(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new Ga(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Wa)return e;let t=new Wa(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos+=e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos+=n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Wa)&&!this.isCovered?this.nodes.push(new Wa(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let e of this.nodes)e instanceof Wa&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(t,n,r,i){let a=new e(r,t);return A.spans(n,r,i,a,0),a.finish(r)}};function Xa(e,t,n){let r=new Za;return A.compare(e,t,n,r,0),r.changes}var Za=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&sn(e,t,this.changes,5)}};function Qa(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,a=Math.max(0,n.left),o=Math.min(i.innerWidth,n.right),s=Math.max(0,n.top),c=Math.min(i.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(t.nodeType==1){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&r.overflow!=`visible`){let r=n.getBoundingClientRect();a=Math.max(a,r.left),o=Math.min(o,r.right),s=Math.max(s,r.top),c=Math.min(t==e.parentNode?i.innerHeight:c,r.bottom)}t=r.position==`absolute`||r.position==`fixed`?n.offsetParent:n.parentNode}else if(t.nodeType==11)t=t.host;else break;return{left:a-n.left,right:Math.max(a,o)-n.left,top:s-(n.top+t),bottom:Math.max(s,c)-(n.top+t)}}function $a(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}function eo(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}var to=class{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,t){return F.replace({widget:new no(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},no=class extends en{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement(`div`);return this.vertical?e.style.height=this.size+`px`:(e.style.width=this.size+`px`,e.style.height=`2px`,e.style.display=`inline-block`),e}get estimatedHeight(){return this.vertical?this.size:-1}},ro=class{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=lo,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=I.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(Tr).some(e=>typeof e!=`function`&&e.class==`cm-lineWrapping`);this.heightOracle=new Ia(n),this.stateDeco=uo(t),this.heightMap=Ba.empty().applyChanges(this.stateDeco,f.empty,this.heightOracle.setDoc(t.doc),[new Fr(0,0,0,t.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=F.set(this.lineGaps.map(e=>e.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new io(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?lo:new fo(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(po(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=uo(this.state);let r=e.changedRanges,i=Fr.extendWithRanges(r,Xa(n,this.stateDeco,e?e.changes:ce.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Fa(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=a||Pa)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let s=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<s.from||t.range.head>s.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t));let c=s.from!=this.viewport.from||s.to!=this.viewport.to;this.viewport=s,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(mr)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,i=n.whiteSpace;this.defaultTextDirection=n.direction==`rtl`?I.RTL:I.LTR;let a=this.heightOracle.mustRefreshForWrapping(i)||this.mustMeasureContent===`refresh`,o=t.getBoundingClientRect(),s=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,l=0;if(o.width&&o.height){let{scaleX:e,scaleY:n}=bn(t,o);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,c|=16,a=s=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=u||this.paddingBottom!=d)&&(this.paddingTop=u,this.paddingBottom=d,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(s=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let p=Sn(this.view.contentDOM,!1).y;p!=this.scrollParent&&(this.scrollParent=p,this.scrollAnchorHeight=-1,this.scrollOffset=0);let m=this.getScrollOffset();this.scrollOffset!=m&&(this.scrollAnchorHeight=-1,this.scrollOffset=m),this.scrolledToBottom=Nn(this.scrollParent||e.win);let h=(this.printing?eo:Qa)(t,this.paddingTop),g=h.top-this.pixelViewport.top,_=h.bottom-this.pixelViewport.bottom;this.pixelViewport=h;let v=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(v!=this.inView&&(this.inView=v,v&&(s=!0)),!this.inView&&!this.scrollTarget&&!$a(e.dom))return 0;let y=o.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),s){let t=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(t)&&(a=!0),a||r.lineWrapping&&Math.abs(y-this.contentDOMWidth)>r.charWidth){let{lineHeight:n,charWidth:o,textHeight:s}=e.docView.measureTextSize();a=n>0&&r.refresh(i,n,o,s,Math.max(5,y/o),t),a&&(e.docView.minWidth=0,c|=16)}g>0&&_>0?l=Math.max(g,_):g<0&&_<0&&(l=Math.min(g,_)),Fa();for(let n of this.viewports){let i=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(a?Ba.empty().applyChanges(this.stateDeco,f.empty,this.heightOracle,[new Fr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new La(n.from,i))}Pa&&(c|=2)}let ee=!this.viewportIsAppropriate(this.viewport,l)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return ee&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(l,this.scrollTarget),c|=this.updateForViewport()),(c&2||ee)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,s=new io(r.lineAt(a-n*1e3,V.ByHeight,i,0,0).from,r.lineAt(o+(1-n)*1e3,V.ByHeight,i,0,0).to);if(t){let{head:e}=t.range;if(e<s.from||e>s.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),a=r.lineAt(e,V.ByPos,i,0,0),o;o=t.y==`center`?(a.top+a.bottom)/2-n/2:t.y==`start`||t.y==`nearest`&&e<s.from?a.top:a.bottom-n,s=new io(r.lineAt(o-500,V.ByHeight,i,0,0).from,r.lineAt(o+n+500,V.ByHeight,i,0,0).to)}}return s}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new io(this.heightMap.lineAt(n,V.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,V.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,V.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,V.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:o}=this;return(e==0||r<=a-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||i>=o+Math.max(10,Math.min(n,250)))&&r>a-2e3&&i<o+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new to(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,i=r>>1,a=r<<1;if(this.defaultTextDirection!=I.LTR&&!n)return[];let o=[],s=(r,a,c,l)=>{if(a-r<i)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>r&&e<a){s(r,e-10,c,l),s(e+10,a,c,l);return}let f=co(e,e=>e.from>=c.from&&e.to<=c.to&&Math.abs(e.from-r)<i&&Math.abs(e.to-a)<i&&!d.some(t=>e.from<t&&e.to>t));if(!f){if(a<c.to&&t&&n&&t.visibleRanges.some(e=>e.from<=a&&e.to>=a)){let e=t.moveToLineBoundary(T.cursor(a),!1,!0).head;e>r&&(a=e)}let e=this.gapSize(c,r,a,l);f=new to(r,a,e,n||e<2e6?e:2e6)}o.push(f)},c=t=>{if(t.length<a||t.type!=P.Text)return;let i=ao(t.from,t.to,this.stateDeco);if(i.total<a)return;let o=this.scrollTarget?this.scrollTarget.range.head:null,c,l;if(n){let e=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,n,a;if(o!=null){let r=so(i,o),s=((this.visibleBottom-this.visibleTop)/2+e)/t.height;n=r-s,a=r+s}else n=(this.visibleTop-t.top-e)/t.height,a=(this.visibleBottom-t.top+e)/t.height;c=oo(i,n),l=oo(i,a)}else{let n=i.total*this.heightOracle.charWidth,a=r*this.heightOracle.charWidth,s=0;if(n>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+s<this.pixelViewport.left&&(s=n.size-n.displaySize);let u=this.pixelViewport.left+s,d=this.pixelViewport.right+s,f,p;if(o!=null){let e=so(i,o),t=((d-u)/2+a)/n;f=e-t,p=e+t}else f=(u-a)/n,p=(d+a)/n;c=oo(i,f),l=oo(i,p)}c>t.from&&s(t.from,c,t,i),l<t.to&&s(l,t.to,t,i)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(c):c(e);return o}gapSize(e,t,n,r){let i=so(r,n)-so(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){to.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=F.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];A.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(r&8);t++){let i=this.visibleRanges[t],a=n[t];(i.from!=a.from||i.to!=a.to)&&(r|=4,e&&e.mapPos(i.from,-1)==a.from&&e.mapPos(i.to,1)==a.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||po(this.heightMap.lineAt(e,V.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||po(this.heightMap.lineAt(this.scaler.fromDOM(e),V.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return po(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},io=class{constructor(e,t){this.from=e,this.to=t}};function ao(e,t,n){let r=[],i=e,a=0;return A.spans(n,e,t,{span(){},point(e,t){e>i&&(r.push({from:i,to:e}),a+=e-i),i=t}},20),i<t&&(r.push({from:i,to:t}),a+=t-i),{total:a,ranges:r}}function oo({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],a=i-n;if(r<=a)return n+r;r-=a}}function so(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function co(e,t){for(let n of e)if(t(n))return n}var lo={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function uo(e){let t=e.facet(Er).filter(e=>typeof e!=`function`),n=e.facet(Or).filter(e=>typeof e!=`function`);return n.length&&t.push(A.join(n)),t}var fo=class e{constructor(e,t,n){let r=0,i=0,a=0;this.viewports=n.map(({from:n,to:i})=>{let a=t.lineAt(n,V.ByPos,e,0,0).top,o=t.lineAt(i,V.ByPos,e,0,0).bottom;return r+=o-a,{from:n,to:i,top:a,bottom:o,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let e of this.viewports)e.domTop=a+(e.top-i)*this.scale,a=e.domBottom=e.domTop+(e.bottom-e.top),i=e.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return r+(e-n)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);n=i.bottom,r=i.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return n+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);n=i.bottom,r=i.domBottom}}eq(t){return t instanceof e&&this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((e,n)=>e.from==t.viewports[n].from&&e.to==t.viewports[n].to)}};function po(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new Ra(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>po(e,t)):e._content)}var mo=E.define({combine:e=>e.join(` `)}),ho=E.define({combine:e=>e.indexOf(!0)>-1}),go=Dt.newName(),_o=Dt.newName(),vo=Dt.newName(),yo={"&light":`.`+_o,"&dark":`.`+vo};function bo(e,t,n){return new Dt(t,{finish(t){return/&/.test(t)?t.replace(/&\w*/,t=>{if(t==`&`)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+` `+t}})}var xo=bo(`.`+go,{"&":{position:`relative !important`,boxSizing:`border-box`,"&.cm-focused":{outline:`1px dotted #212121`},display:`flex !important`,flexDirection:`column`},".cm-scroller":{display:`flex !important`,alignItems:`flex-start !important`,fontFamily:`monospace`,lineHeight:1.4,height:`100%`,overflowX:`auto`,position:`relative`,zIndex:0,overflowAnchor:`none`},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:`block`,whiteSpace:`pre`,wordWrap:`normal`,boxSizing:`border-box`,minHeight:`100%`,padding:`4px 0`,outline:`none`,"&[contenteditable=true]":{WebkitUserModify:`read-write-plaintext-only`}},".cm-lineWrapping":{whiteSpace_fallback:`pre-wrap`,whiteSpace:`break-spaces`,wordBreak:`break-word`,overflowWrap:`anywhere`,flexShrink:1},"&light .cm-content":{caretColor:`black`},"&dark .cm-content":{caretColor:`white`},".cm-line":{display:`block`,padding:`0 2px 0 6px`},".cm-layer":{userSelect:`none`,position:`absolute`,left:0,top:0,contain:`size style`,"& > *":{position:`absolute`}},"&light .cm-selectionBackground":{background:`#d9d9d9`},"&dark .cm-selectionBackground":{background:`#222`},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#d7d4f0`},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#233`},".cm-cursorLayer":{pointerEvents:`none`},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:`steps(1) cm-blink 1.2s infinite`},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:`1.2px solid black`,marginLeft:`-0.6px`,pointerEvents:`none`},".cm-cursor":{display:`none`},"&dark .cm-cursor":{borderLeftColor:`#ddd`},".cm-selectionHandle":{backgroundColor:`currentColor`,width:`1.5px`},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:`""`,backgroundColor:`inherit`,borderRadius:`50%`,width:`8px`,height:`8px`,position:`absolute`,left:`-3.25px`},".cm-selectionHandle-start::before":{top:`-8px`},".cm-selectionHandle-end::before":{bottom:`-8px`},".cm-dropCursor":{position:`absolute`},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:`block`},".cm-iso":{unicodeBidi:`isolate`},".cm-announced":{position:`fixed`,top:`-10000px`},"@media print":{".cm-announced":{display:`none`}},"&light .cm-activeLine":{backgroundColor:`#cceeff44`},"&dark .cm-activeLine":{backgroundColor:`#99eeff33`},"&light .cm-specialChar":{color:`red`},"&dark .cm-specialChar":{color:`#f78`},".cm-gutters":{flexShrink:0,display:`flex`,height:`100%`,boxSizing:`border-box`,zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:`#f5f5f5`,color:`#6c6c6c`,border:`0px solid #ddd`,"&.cm-gutters-before":{borderRightWidth:`1px`},"&.cm-gutters-after":{borderLeftWidth:`1px`}},"&dark .cm-gutters":{backgroundColor:`#333338`,color:`#ccc`},".cm-gutter":{display:`flex !important`,flexDirection:`column`,flexShrink:0,boxSizing:`border-box`,minHeight:`100%`,overflow:`hidden`},".cm-gutterElement":{boxSizing:`border-box`},".cm-lineNumbers .cm-gutterElement":{padding:`0 3px 0 5px`,minWidth:`20px`,textAlign:`right`,whiteSpace:`nowrap`},"&light .cm-activeLineGutter":{backgroundColor:`#e2f2ff`},"&dark .cm-activeLineGutter":{backgroundColor:`#222227`},".cm-panels":{boxSizing:`border-box`,position:`sticky`,left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:`#f5f5f5`,color:`black`},".cm-panels-top":{top:`0`},".cm-panels-bottom":{bottom:`0`},"&light .cm-panels-top":{borderBottom:`1px solid #ddd`},"&light .cm-panels-bottom":{borderTop:`1px solid #ddd`},"&dark .cm-panels":{backgroundColor:`#333338`,color:`white`},".cm-dialog":{padding:`2px 19px 4px 6px`,position:`relative`,"& label":{fontSize:`80%`}},".cm-dialog-close":{position:`absolute`,top:`3px`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,fontSize:`14px`,padding:`0`},".cm-tab":{display:`inline-block`,overflow:`hidden`,verticalAlign:`bottom`},".cm-widgetBuffer":{verticalAlign:`text-top`,height:`1em`,width:0,display:`inline`},".cm-placeholder":{color:`#888`,display:`inline-block`,verticalAlign:`top`,userSelect:`none`},".cm-highlightSpace":{backgroundImage:`radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)`,backgroundPosition:`center`},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:`auto 100%`,backgroundPosition:`right 90%`,backgroundRepeat:`no-repeat`},".cm-trailingSpace":{backgroundColor:`#ff332255`},".cm-button":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,padding:`.2em 1em`,borderRadius:`1px`},"&light .cm-button":{backgroundImage:`linear-gradient(#eff1f5, #d9d9df)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#b4b4b4, #d0d3d6)`}},"&dark .cm-button":{backgroundImage:`linear-gradient(#393939, #111)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#111, #333)`}},".cm-textfield":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,border:`1px solid silver`,padding:`.2em .5em`},"&light .cm-textfield":{backgroundColor:`white`},"&dark .cm-textfield":{border:`1px solid #555`,backgroundColor:`inherit`}},yo),So={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Co=N.ie&&N.ie_version<=11,wo=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Cn,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(N.ie&&N.ie_version<=11||N.ios&&e.composing)&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&N.android&&e.constructor.EDIT_CONTEXT!==!1&&!(N.chrome&&N.chrome_version<126)&&(this.editContext=new Oo(e),e.state.facet(br)&&(e.contentDOM.editContext=this.editContext.editContext)),Co&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia(`print`)),typeof ResizeObserver==`function`&&(this.resizeScroll=new ResizeObserver(()=>{this.view.docView?.lastUpdate<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver==`function`&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent(`Event`)))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent(`Event`))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers(`scroll`,e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type==`change`||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(br)?n.root.activeElement!=this.dom:!dn(this.dom,r))return;let i=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(N.ie&&N.ie_version<=11||N.android&&N.chrome)&&!n.state.selection.main.empty&&r.focusNode&&pn(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=ln(e.root);if(!t)return!1;let n=N.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Do(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=dn(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&Mn(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(n.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||=this.scrollTargets.slice(0,e),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener(`scroll`,this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||=(this.observer.observe(this.dom,So),Co&&this.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Co&&this.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&An(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}(!this.delayedAndroidKey||e==`Enter`)&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!this.delayedAndroidKey?.force})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!0),t==-1?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&dn(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new Vi(this.view,e,t,n);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=Ui(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!Yi(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type==`attributes`),e.type==`childList`){let n=To(t,e.previousSibling||e.target.previousSibling,-1),r=To(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}return e.type==`characterData`?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener(`change`,this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener(`beforeprint`,this.onPrint),e.addEventListener(`scroll`,this.onScroll),e.document.addEventListener(`selectionchange`,this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener(`scroll`,this.onScroll),e.removeEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener(`change`,this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener(`beforeprint`,this.onPrint),e.document.removeEventListener(`selectionchange`,this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(br)!=e.state.facet(br)&&(e.view.contentDOM.editContext=e.state.facet(br)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)==null||e.disconnect(),(t=this.gapIntersection)==null||t.disconnect(),(n=this.resizeScroll)==null||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function To(e,t,n){for(;t;){let r=z.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i==e.dom?n>0?t.nextSibling:t.previousSibling:i}return null}function Eo(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return pn(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function Do(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Eo(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener(`beforeinput`,r,!0),e.dom.ownerDocument.execCommand(`indent`),e.contentDOM.removeEventListener(`beforeinput`,r,!0),n?Eo(e,n):null}var Oo=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:i,head:a}=r,o=this.toEditorPos(n.updateRangeStart),s=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:o,drifted:!1});let c=s-o>n.text.length;o==this.from&&i<this.from?o=i:s==this.to&&i>this.to&&(s=i);let l=Ki(e.state.sliceDoc(o,s),n.text,(c?r.from:r.to)-o,c?`end`:null);if(!l){let t=T.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));Yi(t,r)||e.dispatch({selection:t,userEvent:`select`});return}let u={from:l.from+o,to:l.toA+o,insert:f.of(n.text.slice(l.from,l.toB).split(`10-`))};if((N.mac||N.android)&&u.from==a-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(u={from:o,to:s,insert:f.of([n.text.replace(`.`,` `)])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);Wi(e,u,T.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);t<a;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),a=this.toEditorPos(e.rangeEnd);if(i<a){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+` `:t==`Dashed`?`dashed `:t==`Squiggle`?`wavy `:``}${/thin/i.test(r)?1:2}px`;n.push(F.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:vr.of(F.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{let t=ln(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,a,o,s,c)=>{if(n)return;let l=c.length-(a-i);if(r&&a>=r.to){if(r.from==i&&r.to==a&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=l,this.to+=l;return}r=null,this.revertPending(e.state)}if(i+=t,a+=t,a<=this.from)this.from+=l,this.to+=l;else if(i<this.to){if(i<this.from||a>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),c.toString()),this.to+=l}t+=l}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent(`input.type`)&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>3e4)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},H=class e{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement(`div`),this.scrollDOM=document.createElement(`div`),this.scrollDOM.tabIndex=-1,this.scrollDOM.className=`cm-scroller`,this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement(`div`),this.announceDOM.className=`cm-announced`,this.announceDOM.setAttribute(`aria-live`,`polite`),this.dom=document.createElement(`div`),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(e=>e.forEach(e=>t(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||jn(e.parent)||document,this.viewState=new ro(this,e.state||k.create(e)),e.scrollTo&&e.scrollTo.is(_r)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Sr).map(e=>new Cr(e));for(let e of this.plugins)e.update(this);this.observer=new wo(this),this.inputState=new Xi(this),this.inputState.ensureHandlers(this.plugins),this.docView=new ui(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),document.fonts?.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=`refresh`,this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof We?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(t){if(this.updateState!=0)throw Error(`Calls to EditorView.update are not allowed while an update is in progress`);let n=!1,r=!1,i,a=this.state;for(let e of t){if(e.startState!=a)throw RangeError(`Trying to update state with a transaction that doesn't start from the previous state.`);a=e.state}if(this.destroyed){this.viewState.state=a;return}let o=this.hasFocus,s=0,c=null;t.some(e=>e.annotation(Oa))?(this.inputState.notifiedFocused=o,s=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=ka(a,o),c||(s=1));let l=this.observer.delayedAndroidKey,u=null;if(l?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(u=null)):this.observer.clear(),a.facet(k.phrases)!=this.state.facet(k.phrases))return this.setState(a);i=Ir.create(this,a,t),i.flags|=s;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let n of t){if(d&&=d.map(n.changes),n.scrollIntoView){let{main:t}=n.state.selection,{x:r,y:i}=this.state.facet(e.cursorScrollMargin);d=new gr(t.empty?t:T.cursor(t.head,t.head>t.anchor?-1:1),`nearest`,`nearest`,i,r)}for(let e of n.effects)e.is(_r)&&(d=e.value.clip(this.state))}this.viewState.update(i,d),this.bidiCache=jo.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(Pr)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(e=>e.isUserEvent(`select.pointer`)))}finally{this.updateState=0}if(i.startState.facet(mo)!=i.state.facet(mo)&&(this.viewState.mustMeasureContent=!0),(n||r||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let e of this.state.facet(cr))try{e(i)}catch(e){yr(this.state,e,`update listener`)}(c||u)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),u&&!Ui(this,u)&&l.force&&An(this.contentDOM,l.key,l.keyCode)})}setState(e){if(this.updateState!=0)throw Error(`Calls to EditorView.setState are not allowed while an update is in progress`);if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new ro(this,e),this.plugins=e.facet(Sr).map(e=>new Cr(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new ui(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Sr),n=e.state.facet(Sr);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new Cr(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){yr(this.state,e,`doc view update listener`)}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:i,scrollAnchorHeight:a}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(a<0){if(Nn(n||this.win))i=-1,a=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(r);i=e.from,a=e.top}}this.updateState=1;let o=this.viewState.measure();if(!o&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(e>5){console.warn(this.measureRequests.length?`Measure loop restarted more than 5 times`:`Viewport failed to stabilize`);break}let s=[];o&4||([this.measureRequests,s]=[s,this.measureRequests]);let c=s.map(e=>{try{return e.read(this)}catch(e){return yr(this.state,e),Ao}}),l=Ir.create(this,this.state,[]),u=!1;l.flags|=o,t?t.flags|=o:t=l,this.updateState=2,l.empty||(this.updatePlugins(l),this.inputState.update(l),this.updateAttrs(),u=this.docView.update(l),u&&this.docViewUpdate());for(let e=0;e<s.length;e++)if(c[e]!=Ao)try{let t=s[e];t.write&&t.write(c[e],this)}catch(e){yr(this.state,e)}if(u&&this.docView.updateSelection(!0),!l.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight){if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}{let e=((i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-a)/this.scaleY;if((e>1||e<-1)&&!(N.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r+=e,n?i<0?n.scrollTop=n.scrollHeight:n.scrollTop+=e:this.win.scrollBy(0,e),a=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(cr))e(t)}get themeClasses(){return go+` `+(this.state.facet(ho)?vo:_o)+` `+this.state.facet(mo)}updateAttrs(){let e=Mo(this,wr,{class:`cm-editor`+(this.hasFocus?` cm-focused `:` `)+this.themeClasses}),t={spellcheck:`false`,autocorrect:`off`,autocapitalize:`off`,writingsuggestions:`false`,translate:`no`,contenteditable:this.state.facet(br)?`true`:`false`,class:`cm-content`,style:`${N.tabSize}: ${this.state.tabSize}`,role:`textbox`,"aria-multiline":`true`};this.state.readOnly&&(t[`aria-readonly`]=`true`),Mo(this,Tr,t);let n=this.observer.ignore(()=>{let n=Qt(this.contentDOM,this.contentAttrs,t),r=Qt(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(t){let n=!0;for(let r of t)for(let t of r.effects)if(t.is(e.announce)){n&&(this.announceDOM.textContent=``),n=!1;let e=this.announceDOM.appendChild(document.createElement(`div`));e.textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(Pr);let t=this.state.facet(e.cspNonce);Dt.mount(this.root,this.styleModules.concat(xo).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw Error(`Reading the editor layout isn't allowed during an update`);this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return Mi(this,e,Di(this,e,t,n))}moveByGroup(e,t){return Mi(this,e,Di(this,e,t,t=>Oi(this,e.head,t)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),i=n[t?n.length-1:0];return T.cursor(i.side(t,r)+e.from,i.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return Ei(this,e,t,n)}moveVertically(e,t,n){return Mi(this,e,ki(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=Pi(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),Pi(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.state.doc.lineAt(e),r=this.bidiSpans(n),i=r[Kn.find(r,e-n.from,-1,t)];return this.docView.coordsAt(e,t,i.dir==I.RTL)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(pr)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>ko)return er(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||qn(r.isolates,n=jr(this,e))))return r.order;n||=jr(this,e);let r=$n(e.text,t,n);return this.bidiCache.push(new jo(e.from,e.to,t,n,!0,r)),r}get hasFocus(){return(this.dom.ownerDocument.hasFocus()||N.safari&&this.inputState?.lastContextMenu>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Dn(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return _r.of(new gr(typeof e==`number`?T.cursor(e):e,t.y??`nearest`,t.x??`nearest`,t.yMargin??5,t.xMargin??5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return _r.of(new gr(T.cursor(n.from),`start`,`start`,n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e==`boolean`?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return R.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return R.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=Dt.newName(),r=[mo.of(n),Pr.of(bo(`.${n}`,e))];return t&&t.dark&&r.push(ho.of(!0)),r}static baseTheme(e){return Ee.lowest(Pr.of(bo(`.`+go,e,yo)))}static findFromDOM(e){let t=e.querySelector(`.cm-content`);return(t&&z.get(t)||z.get(e))?.root?.view||null}};H.styleModule=Pr,H.inputHandler=lr,H.clipboardInputFilter=dr,H.clipboardOutputFilter=fr,H.scrollHandler=hr,H.focusChangeEffect=ur,H.perLineTextDirection=pr,H.exceptionSink=sr,H.updateListener=cr,H.editable=br,H.mouseSelectionStyle=or,H.dragMovesSelection=ar,H.clickAddsSelectionRange=ir,H.decorations=Er,H.blockWrappers=Dr,H.outerDecorations=Or,H.atomicRanges=kr,H.bidiIsolatedRanges=Ar,H.cursorScrollMargin=E.define({combine:e=>{let t=5,n=5;for(let r of e)typeof r==`number`?t=n=r:{x:t,y:n}=r;return{x:t,y:n}}}),H.scrollMargins=Mr,H.darkTheme=ho,H.cspNonce=E.define({combine:e=>e.length?e[0]:``}),H.contentAttributes=Tr,H.editorAttributes=wr,H.lineWrapping=H.contentAttributes.of({class:`cm-lineWrapping`}),H.announce=D.define();var ko=4096,Ao={},jo=class e{constructor(e,t,n,r,i,a){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=i,this.order=a}static update(t,n){if(n.empty&&!t.some(e=>e.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:I.LTR;for(let a=Math.max(0,t.length-10);a<t.length;a++){let o=t[a];o.dir==i&&!n.touchesRange(o.from,o.to)&&r.push(new e(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}};function Mo(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let t=r[i],a=typeof t==`function`?t(e):t;a&&Jt(a,n)}return n}var No=N.mac?`mac`:N.windows?`win`:N.linux?`linux`:`key`;function Po(e,t){let n=e.split(/-(?!$)/),r=n[n.length-1];r==`Space`&&(r=` `);let i,a,o,s;for(let e=0;e<n.length-1;++e){let r=n[e];if(/^(cmd|meta|m)$/i.test(r))s=!0;else if(/^a(lt)?$/i.test(r))i=!0;else if(/^(c|ctrl|control)$/i.test(r))a=!0;else if(/^s(hift)?$/i.test(r))o=!0;else if(/^mod$/i.test(r))t==`mac`?s=!0:a=!0;else throw Error(`Unrecognized modifier name: `+r)}return i&&(r=`Alt-`+r),a&&(r=`Ctrl-`+r),s&&(r=`Meta-`+r),o&&(r=`Shift-`+r),r}function Fo(e,t,n){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n!==!1&&t.shiftKey&&(e=`Shift-`+e),e}var Io=Ee.default(H.domEventHandlers({keydown(e,t){return Go(zo(t.state),e,t,`editor`)}})),Lo=E.define({enables:Io}),Ro=new WeakMap;function zo(e){let t=e.facet(Lo),n=Ro.get(t);return n||Ro.set(t,n=Uo(t.reduce((e,t)=>e.concat(t),[]))),n}function Bo(e,t,n){return Go(zo(e.state),t,e,n)}var Vo=null,Ho=4e3;function Uo(e,t=No){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(n==null)r[e]=t;else if(n!=t)throw Error(`Key binding `+e+` is used both as a regular binding and as a multi-stroke prefix`)},a=(e,r,a,o,s)=>{let c=n[e]||(n[e]=Object.create(null)),l=r.split(/ (?!$)/).map(e=>Po(e,t));for(let t=1;t<l.length;t++){let n=l.slice(0,t).join(` `);i(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=Vo={view:t,prefix:n,scope:e};return setTimeout(()=>{Vo==r&&(Vo=null)},Ho),!0}]})}let u=l.join(` `);i(u,!1);let d=c[u]||(c[u]={preventDefault:!1,stopPropagation:!1,run:(c._any?.run)?.slice()||[]});a&&d.run.push(a),o&&(d.preventDefault=!0),s&&(d.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(` `):[`editor`];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||={preventDefault:!1,stopPropagation:!1,run:[]};let{any:i}=r;for(let t in e)e[t].run.push(e=>i(e,Wo))}let i=r[t]||r.key;if(i)for(let t of e)a(t,i,r.run,r.preventDefault,r.stopPropagation),r.shift&&a(t,`Shift-`+i,r.shift,r.preventDefault,r.stopPropagation)}return n}var Wo=null;function Go(e,t,n,r){Wo=t;let i=Ft(t),a=ae(S(i,0))==i.length&&i!=` `,o=``,s=!1,c=!1,l=!1;Vo&&Vo.view==n&&Vo.scope==r&&(o=Vo.prefix+` `,na.indexOf(t.keyCode)<0&&(c=!0,Vo=null));let u=new Set,d=e=>{if(e){for(let t of e.run)if(!u.has(t)&&(u.add(t),t(n)))return e.stopPropagation&&(l=!0),!0;e.preventDefault&&(e.stopPropagation&&(l=!0),c=!0)}return!1},f=e[r],p,m;return f&&(d(f[o+Fo(i,t,!a)])?s=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(N.windows&&t.ctrlKey&&t.altKey)&&!(N.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=At[t.keyCode])&&p!=i?(d(f[o+Fo(p,t,!0)])||t.shiftKey&&(m=jt[t.keyCode])!=i&&m!=p&&d(f[o+Fo(m,t,!1)]))&&(s=!0):a&&t.shiftKey&&d(f[o+Fo(i,t,!0)])&&(s=!0),!s&&d(f._any)&&(s=!0)),c&&(s=!0),s&&l&&t.stopPropagation(),Wo=null,s}var Ko=class e{constructor(e,t,n,r,i){this.className=e,this.left=t,this.top=n,this.width=r,this.height=i}draw(){let e=document.createElement(`div`);return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+`px`,e.style.top=this.top+`px`,this.width!=null&&(e.style.width=this.width+`px`),e.style.height=this.height+`px`}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(t,n,r){if(r.empty){let i=t.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let a=qo(t);return[new e(n,i.left-a.left,i.top-a.top,null,i.bottom-i.top)]}return Yo(t,n,r)}};function qo(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==I.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function Jo(e,t,n,r){let i=e.coordsAtPos(t,n*2);if(!i)return r;let a=e.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,s=e.posAtCoords({x:a.left+1,y:o}),c=e.posAtCoords({x:a.right-1,y:o});return s==null||c==null?r:{from:Math.max(r.from,Math.min(s,c)),to:Math.min(r.to,Math.max(s,c))}}function Yo(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),a=e.textDirection==I.LTR,o=e.contentDOM,s=o.getBoundingClientRect(),c=qo(e),l=o.querySelector(`.cm-line`),u=l&&window.getComputedStyle(l),d=s.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),f=s.right-(u?parseInt(u.paddingRight):0),p=Ti(e,r,1),m=Ti(e,i,-1),h=p.type==P.Text?p:null,g=m.type==P.Text?m:null;if(h&&(e.lineWrapping||p.widgetLineBreaks)&&(h=Jo(e,r,1,h)),g&&(e.lineWrapping||m.widgetLineBreaks)&&(g=Jo(e,i,-1,g)),h&&g&&h.from==g.from&&h.to==g.to)return v(y(n.from,n.to,h));{let t=h?y(n.from,null,h):ee(p,!1),r=g?y(null,n.to,g):ee(m,!0),i=[];return(h||p).to<(g||m).from-(h&&g?1:0)||p.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<r.top?i.push(_(d,t.bottom,f,r.top)):t.bottom<r.top&&e.elementAtHeight((t.bottom+r.top)/2).type==P.Text&&(t.bottom=r.top=(t.bottom+r.top)/2),v(t).concat(i).concat(v(r))}function _(e,n,r,i){return new Ko(t,e-c.left,n-c.top,Math.max(0,r-e),i-n)}function v({top:e,bottom:t,horizontal:n}){let r=[];for(let i=0;i<n.length;i+=2)r.push(_(n[i],e,n[i+1],t));return r}function y(t,n,r){let i=1e9,o=-1e9,s=[];function c(t,n,c,l,u){let p=e.coordsAtPos(t,t==r.to?-2:2),m=e.coordsAtPos(c,c==r.from?2:-2);!p||!m||(i=Math.min(p.top,m.top,i),o=Math.max(p.bottom,m.bottom,o),u==I.LTR?s.push(a&&n?d:p.left,a&&l?f:m.right):s.push(!a&&l?d:m.left,!a&&n?f:p.right))}let l=t??r.from,u=n??r.to;for(let r of e.visibleRanges)if(r.to>l&&r.from<u)for(let i=Math.max(r.from,l),a=Math.min(r.to,u);;){let r=e.state.doc.lineAt(i);for(let o of e.bidiSpans(r)){let e=o.from+r.from,s=o.to+r.from;if(e>=a)break;s>i&&c(Math.max(e,i),t==null&&e<=l,Math.min(s,a),n==null&&s>=u,o.dir)}if(i=r.to+1,i>=a)break}return s.length==0&&c(l,t==null,u,n==null,e.textDirection),{top:i,bottom:o,horizontal:s}}function ee(e,t){let n=s.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}function Xo(e,t){return e.constructor==t.constructor&&e.eq(t)}var Zo=class{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement(`div`)),this.dom.classList.add(`cm-layer`),t.above&&this.dom.classList.add(`cm-layer-above`),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute(`aria-hidden`,`true`),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Qo)!=e.state.facet(Qo)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(Qo);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((e,t)=>!Xo(e,this.drawn[t]))){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e,N.webkit&&(this.dom.style.display=this.dom.firstChild?``:`none`)}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}},Qo=E.define();function $o(e){return[R.define(t=>new Zo(t,e)),Qo.of(e)]}var es=E.define({combine(e){return rt(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function ts(e={}){return[es.of(e),rs,as,ss,mr.of(!0)]}function ns(e){return e.startState.facet(es)!=e.state.facet(es)}var rs=$o({above:!0,markers(e){let{state:t}=e,n=t.facet(es),r=[];for(let i of t.selection.ranges){let a=i==t.selection.main;if(i.empty||n.drawRangeCursor&&!(a&&N.ios&&n.iosSelectionHandles)){let t=a?`cm-cursor cm-cursor-primary`:`cm-cursor cm-cursor-secondary`,n=i.empty?i:T.cursor(i.head,i.assoc);for(let i of Ko.forRange(e,t,n))r.push(i)}}return r},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName=t.style.animationName==`cm-blink`?`cm-blink2`:`cm-blink`);let n=ns(e);return n&&is(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){is(t.state,e)},class:`cm-cursorLayer`});function is(e,t){t.style.animationDuration=e.facet(es).cursorBlinkRate+`ms`}var as=$o({above:!1,markers(e){let t=[],{main:n,ranges:r}=e.state.selection;for(let n of r)if(!n.empty)for(let r of Ko.forRange(e,`cm-selectionBackground`,n))t.push(r);if(N.ios&&!n.empty&&e.state.facet(es).iosSelectionHandles){for(let r of Ko.forRange(e,`cm-selectionHandle cm-selectionHandle-start`,T.cursor(n.from,1)))t.push(r);for(let r of Ko.forRange(e,`cm-selectionHandle cm-selectionHandle-end`,T.cursor(n.to,1)))t.push(r)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||ns(e)},class:`cm-selectionLayer`}),os=N.gecko&&N.gecko_version==153?`#ffffff01`:`transparent`,ss=Ee.highest(H.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:`${os} !important`},caretColor:`transparent !important`},".cm-content":{caretColor:`transparent !important`,"& :focus":{caretColor:`initial !important`,"&::selection, & ::selection":{backgroundColor:`Highlight !important`}}}})),cs=D.define({map(e,t){return e==null?null:t.mapPos(e)}}),ls=Ce.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(cs)?t.value:e,e)}}),us=R.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(ls);n==null?this.cursor!=null&&((t=this.cursor)==null||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement(`div`)),this.cursor.className=`cm-dropCursor`),(e.startState.field(ls)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(ls),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+`px`,this.cursor.style.top=e.top/n+`px`,this.cursor.style.height=e.height/n+`px`):this.cursor.style.left=`-100000px`}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(ls)!=e&&this.view.dispatch({effects:cs.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){(e.target==this.view.contentDOM||!this.view.contentDOM.contains(e.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function ds(){return[ls,us]}function fs(e,t,n,r,i){t.lastIndex=0;for(let a=e.iterRange(n,r),o=n,s;!a.next().done;o+=a.value.length)if(!a.lineBreak)for(;s=t.exec(a.value);)i(o+s.index,s)}function ps(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:i,to:a}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),a=Math.min(e.state.doc.lineAt(a).to,a+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=a:r.push({from:i,to:a});return r}var ms=class{constructor(e){let{regexp:t,decoration:n,decorate:r,boundary:i,maxLength:a=1e3}=e;if(!t.global)throw RangeError(`The regular expression given to MatchDecorator should have its 'g' flag set`);if(this.regexp=t,r)this.addMatch=(e,t,n,i)=>r(i,n,n+e[0].length,e,t);else if(typeof n==`function`)this.addMatch=(e,t,r,i)=>{let a=n(e,t,r);a&&i(r,r+e[0].length,a)};else if(n)this.addMatch=(e,t,r,i)=>i(r,r+e[0].length,n);else throw RangeError(`Either 'decorate' or 'decoration' should be provided to MatchDecorator`);this.boundary=i,this.maxLength=a}createDeco(e){let t=new ut,n=t.add.bind(t);for(let{from:t,to:r}of ps(e,this.maxLength))fs(e.state.doc,this.regexp,t,r,(t,r)=>this.addMatch(r,e,t,n));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((t,i,a,o)=>{o>=e.view.viewport.from&&a<=e.view.viewport.to&&(n=Math.min(a,n),r=Math.max(o,r))}),e.viewportMoved||r-n>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let i of e.visibleRanges){let a=Math.max(i.from,n),o=Math.min(i.to,r);if(o>=a){let n=e.state.doc.lineAt(a),r=n.to<o?e.state.doc.lineAt(o):n,s=Math.max(i.from,n.from),c=Math.min(i.to,r.to);if(this.boundary){for(;a>n.from;a--)if(this.boundary.test(n.text[a-1-n.from])){s=a;break}for(;o<r.to;o++)if(this.boundary.test(r.text[o-r.from])){c=o;break}}let l=[],u,d=(e,t,n)=>l.push(n.range(e,t));if(n==r)for(this.regexp.lastIndex=s-n.from;(u=this.regexp.exec(n.text))&&u.index<c-n.from;)this.addMatch(u,e,u.index+n.from,d);else fs(e.state.doc,this.regexp,s,c,(t,n)=>this.addMatch(n,e,t,d));t=t.update({filterFrom:s,filterTo:c,filter:(e,t)=>e<s||t>c,add:l})}}return t}},hs=/x/.unicode==null?`g`:`gu`,gs=RegExp(`[\0-\b11---\u2028\u2029-]`,hs),_s={0:`null`,7:`bell`,8:`backspace`,10:`newline`,11:`vertical tab`,13:`carriage return`,27:`escape`,8203:`zero width space`,8204:`zero width non-joiner`,8205:`zero width joiner`,8206:`left-to-right mark`,8207:`right-to-left mark`,8232:`line separator`,8237:`left-to-right override`,8238:`right-to-left override`,8294:`left-to-right isolate`,8295:`right-to-left isolate`,8297:`pop directional isolate`,8233:`paragraph separator`,65279:`zero width no-break space`,65532:`object replacement`},vs=null;function ys(){if(vs==null&&typeof document<`u`&&document.body){let e=document.body.style;vs=(e.tabSize??e.MozTabSize)!=null}return vs||!1}var bs=E.define({combine(e){let t=rt(e,{render:null,specialChars:gs,addSpecialChars:null});return(t.replaceTabs=!ys())&&(t.specialChars=RegExp(` |`+t.specialChars.source,hs)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+`|`+t.addSpecialChars.source,hs)),t}});function xs(e={}){return[bs.of(e),Cs()]}var Ss=null;function Cs(){return Ss||=R.fromClass(class{constructor(e){this.view=e,this.decorations=F.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(bs)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new ms({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,a=S(t[0],0);if(a==9){let e=i.lineAt(r),t=n.state.tabSize,a=xt(e.text,t,r-e.from);return F.replace({widget:new Ds((t-a%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=F.replace({widget:new Es(e,a)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(bs);e.startState.facet(bs)==t?this.decorations=this.decorator.updateDeco(e,this.decorations):(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view))}},{decorations:e=>e.decorations})}var ws=`•`;function Ts(e){return e>=32?ws:e==10?``:String.fromCharCode(9216+e)}var Es=class extends en{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=Ts(this.code),n=e.state.phrase(`Control character`)+` `+(_s[this.code]||`0x`+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let i=document.createElement(`span`);return i.textContent=t,i.title=n,i.setAttribute(`aria-label`,n),i.className=`cm-specialChar`,i}ignoreEvent(){return!1}},Ds=class extends en{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement(`span`);return e.textContent=` `,e.className=`cm-tab`,e.style.width=this.width+`px`,e}ignoreEvent(){return!1}};function Os(){return As}var ks=F.line({class:`cm-activeLine`}),As=R.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(ks.range(i.from)),t=i.from)}return F.set(n)}},{decorations:e=>e.decorations}),js=2e3;function Ms(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),a=[];if(t.off>js||n.off>js||t.col<0||n.col<0){let o=Math.min(t.off,n.off),s=Math.max(t.off,n.off);for(let t=r;t<=i;t++){let n=e.doc.line(t);n.length<=s&&a.push(T.range(n.from+o,n.to+s))}}else{let o=Math.min(t.col,n.col),s=Math.max(t.col,n.col);for(let t=r;t<=i;t++){let n=e.doc.line(t),r=St(n.text,o,e.tabSize,!0);if(r<0)a.push(T.cursor(n.to));else{let t=St(n.text,s,e.tabSize);a.push(T.range(n.from+r,n.from+t))}}}return a}function Ns(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function Ps(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),i=n-r.from,a=i>js?-1:i==r.length?Ns(e,t.clientX):xt(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:a,off:i}}function Fs(e,t){let n=Ps(e,t),r=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),i=e.state.doc.lineAt(t);n={line:i.number,col:n.col,off:Math.min(n.off,i.length)},r=r.map(e.changes)}},get(t,i,a){let o=Ps(e,t);if(!o)return r;let s=Ms(e.state,n,o);return s.length?a?T.create(s.concat(r.ranges)):T.create(s):r}}:null}function Is(e){let t=e?.eventFilter||(e=>e.altKey&&e.button==0);return H.mouseSelectionStyle.of((e,n)=>t(n)?Fs(e,n):null)}var Ls={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},Rs={style:`cursor: crosshair`};function zs(e={}){let[t,n]=Ls[e.key||`Alt`],r=R.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){(e.keyCode==t||!n(e))&&this.set(!1)},mousemove(e){this.set(n(e))}}});return[r,H.contentAttributes.of(e=>e.plugin(r)?.isDown?Rs:null)]}var Bs=`-10000px`,Vs=class{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let a=[],o=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],s=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(s=e)}if(s<0)a[n]=this.createTooltipView(r,n?a[n-1]:null),o&&(o[n]=!!r.above);else{let r=a[n]=this.tooltipViews[s];o&&(o[n]=t[s]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)a.indexOf(e)<0&&(this.removeTooltipView(e),(n=e.destroy)==null||n.call(e));return t&&(o.forEach((e,n)=>t[n]=e),t.length=o.length),this.input=r,this.tooltips=i,this.tooltipViews=a,!0}};function Hs(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}var Us=E.define({combine:e=>({position:N.ios?`absolute`:e.find(e=>e.position)?.position||`fixed`,parent:e.find(e=>e.parent)?.parent||null,tooltipSpace:e.find(e=>e.tooltipSpace)?.tooltipSpace||Hs})}),Ws=new WeakMap,Gs=R.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(Us);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver==`function`?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Vs(e,Ys,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver==`function`?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener(`resize`,this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement(`div`),this.container.style.position=`relative`,this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(Us);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add(`cm-tooltip`),e.arrow&&!n.dom.querySelector(`.cm-tooltip > .cm-tooltip-arrow`)){let e=document.createElement(`div`);e.className=`cm-tooltip-arrow`,n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=Bs,n.dom.style.left=`0px`,this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener(`resize`,this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(e=t.destroy)==null||e.call(t);this.parent&&this.container.remove(),(t=this.resizeObserver)==null||t.disconnect(),(n=this.intersectionObserver)==null||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position==`fixed`&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(N.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||this.position==`absolute`){if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState)}let r=this.view.scrollDOM.getBoundingClientRect(),i=Nr(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(Us).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){if(e.makeAbsolute){this.madeAbsolute=!0,this.position=`absolute`;for(let e of this.manager.tooltipViews)e.dom.style.position=`absolute`}let{visible:t,space:n,scaleX:r,scaleY:i}=e,a=[];for(let o=0;o<this.manager.tooltips.length;o++){let s=this.manager.tooltips[o],c=this.manager.tooltipViews[o],{dom:l}=c,u=e.pos[o],d=e.size[o];if(!u||s.clip!==!1&&(u.bottom<=Math.max(t.top,n.top)||u.top>=Math.min(t.bottom,n.bottom)||u.right<Math.max(t.left,n.left)-.1||u.left>Math.min(t.right,n.right)+.1)){l.style.top=Bs;continue}let f=s.arrow?c.dom.querySelector(`.cm-tooltip-arrow`):null,p=f?7:0,m=d.right-d.left,h=Ws.get(c)??d.bottom-d.top,g=c.offset||Js,_=this.view.textDirection==I.LTR,v=d.width>n.right-n.left?_?n.left:n.right-d.width:_?Math.max(n.left,Math.min(u.left-(f?14:0)+g.x,n.right-m)):Math.min(Math.max(n.left,u.left-m+(f?14:0)-g.x),n.right-m),y=this.above[o];!s.strictSide&&(y?u.top-h-p-g.y<n.top:u.bottom+h+p+g.y>n.bottom)&&y==n.bottom-u.bottom>u.top-n.top&&(y=this.above[o]=!y);let ee=(y?u.top-n.top:n.bottom-u.bottom)-p;if(ee<h&&c.resize!==!1){if(ee<this.view.defaultLineHeight){l.style.top=Bs;continue}Ws.set(c,h),l.style.height=(h=ee)/i+`px`}else l.style.height&&(l.style.height=``);let te=y?u.top-h-p-g.y:u.bottom+p+g.y,b=v+m;if(c.overlap!==!0)for(let e of a)e.left<b&&e.right>v&&e.top<te+h&&e.bottom>te&&(te=y?e.top-h-2-p:e.bottom+p+2);if(this.position==`absolute`?(l.style.top=(te-e.parent.top)/i+`px`,Ks(l,(v-e.parent.left)/r)):(l.style.top=te/i+`px`,Ks(l,v/r)),f){let e=u.left+(_?g.x:-g.x)-(v+14-7);f.style.left=e/r+`px`}c.overlap!==!0&&a.push({left:v,top:te,right:b,bottom:te+h}),l.classList.toggle(`cm-tooltip-above`,y),l.classList.toggle(`cm-tooltip-below`,!y),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=Bs}},{eventObservers:{scroll(){this.maybeMeasure()}}});function Ks(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+`px`)}var qs=H.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:`border-box`},"&light .cm-tooltip":{border:`1px solid #bbb`,backgroundColor:`#f5f5f5`},"&light .cm-tooltip-section:not(:first-child)":{borderTop:`1px solid #bbb`},"&dark .cm-tooltip":{backgroundColor:`#333338`,color:`white`},".cm-tooltip-arrow":{height:`7px`,width:`14px`,position:`absolute`,zIndex:-1,overflow:`hidden`,"&:before, &:after":{content:`''`,position:`absolute`,width:0,height:0,borderLeft:`7px solid transparent`,borderRight:`7px solid transparent`},".cm-tooltip-above &":{bottom:`-7px`,"&:before":{borderTop:`7px solid #bbb`},"&:after":{borderTop:`7px solid #f5f5f5`,bottom:`1px`}},".cm-tooltip-below &":{top:`-7px`,"&:before":{borderBottom:`7px solid #bbb`},"&:after":{borderBottom:`7px solid #f5f5f5`,top:`1px`}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:`#333338`,borderBottomColor:`#333338`},"&:after":{borderTopColor:`transparent`,borderBottomColor:`transparent`}}}),Js={x:0,y:0},Ys=E.define({enables:[Gs,qs]}),Xs=E.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])}),Zs=class e{static create(t){return new e(t)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement(`div`),this.dom.classList.add(`cm-tooltip-hover`),this.manager=new Vs(e,Xs,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add(`cm-tooltip-section`),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)==null||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp(`offset`)}get getCoords(){return this.passProp(`getCoords`)}get overlap(){return this.passProp(`overlap`)}get resize(){return this.passProp(`resize`)}},Qs=Ys.compute([Xs],e=>{let t=e.facet(Xs);return t.length===0?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>e.end??e.pos)),create:Zs.create,above:t[0].above,arrow:t.some(e=>e.arrow)}}),$s=E.define(),ec=class{constructor(e,t,n,r,i,a){this.view=e,this.source=t,this.field=n,this.locked=r,this.setHover=i,this.hoverTime=a,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener(`mouseleave`,this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener(`mousemove`,this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.tile.nearest(t.target);if(!n)return;let r,i=1;if(n.isWidget())r=n.posAtStart;else{if(r=e.posAtCoords(t),r==null)return;let n=e.coordsAtPos(r);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(r)).find(e=>e.from<=r&&e.to>=r),o=a&&a.dir==I.RTL?-1:1;i=t.x<n.left?-o:o}this.activateHover(e,r,i)}activateHover(e,t,n,r){let i=this.source(e,t,n),a=t=>{if(t&&!(Array.isArray(t)&&!t.length)){let n=Array.isArray(t)?t:[t];r&&this.locked.set(n,r),e.dispatch({effects:this.setHover.of(n)})}};if(i&&`then`in i){let n=this.pending={pos:t};i.then(e=>{this.pending==n&&(this.pending=null,a(e))},t=>yr(e.state,t,`hover tooltip`))}else a(i)}get tooltip(){let e=this.view.plugin(Gs),t=e?e.manager.tooltips.findIndex(e=>e.create==Zs.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:t,tooltip:n}=this;if(t.length&&!this.locked.has(t)&&n&&!nc(n.dom,e)||this.pending){let{pos:n}=t[0]||this.pending,r=t[0]?.end??n;(n==r?this.view.posAtCoords(this.lastMove)!=n:!rc(this.view,n,r,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length&&!this.locked.has(t)){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener(`mouseleave`,t);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener(`mouseleave`,t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener(`mouseleave`,this.mouseleave),this.view.dom.removeEventListener(`mousemove`,this.mousemove)}},tc=4;function nc(e,t){let{left:n,right:r,top:i,bottom:a}=e.getBoundingClientRect(),o;if(o=e.querySelector(`.cm-tooltip-arrow`)){let e=o.getBoundingClientRect();i=Math.min(e.top,i),a=Math.max(e.bottom,a)}return t.clientX>=n-tc&&t.clientX<=r+tc&&t.clientY>=i-tc&&t.clientY<=a+tc}function rc(e,t,n,r,i,a){let o=e.scrollDOM.getBoundingClientRect(),s=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>r||o.right<r||o.top>i||Math.min(o.bottom,s)<i)return!1;let c=e.posAtCoords({x:r,y:i},!1);return c>=t&&c<=n}function ic(e,t={}){let n=D.define(),r=new WeakMap,i=Ce.define({create(){return[]},update(e,a){let o=r.get(e);if(e.length&&(t.hideOnChange&&(a.docChanged||a.selection)||o&&o(a)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(a,e)))),a.docChanged&&e.length){let t=[];for(let n of e){let e=a.changes.mapPos(n.pos,-1,C.TrackDel);if(e!=null){let r=Object.assign(Object.create(null),n);r.pos=e,r.end!=null&&(r.end=a.changes.mapPos(r.end)),t.push(r)}}e=t}for(let t of a.effects)t.is(n)&&(e=t.value,o=void 0),(t.is(sc)&&!t.value||t.value==i)&&(e=[]);return e.length&&o&&r.set(e,o),e},provide:e=>Xs.from(e)}),a=R.define(a=>new ec(a,e,i,r,n,t.hoverTime||300));return{active:i,extension:[i,a,$s.of(a),Qs]}}function ac(e,t,n,r={}){let i=e.state.facet($s).map(t=>e.plugin(t)).filter(e=>!!e);if(r.tooltip&&r.tooltip.active){let e=i.find(e=>e.field==r.tooltip.active);e&&(i=[e])}for(let a of i)a.activateHover(e,t,n,r.until??(()=>!1))}function oc(e,t){let n=e.plugin(Gs);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}var sc=D.define(),cc=E.define({combine(e){let t,n;for(let r of e)t||=r.topContainer,n||=r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function lc(e,t){let n=e.plugin(uc),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}var uc=R.fromClass(class{constructor(e){this.input=e.state.facet(pc),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(cc);this.top=new dc(e,!0,t.topContainer),this.bottom=new dc(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}update(e){let t=e.state.facet(cc);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new dc(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new dc(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(pc);if(n!=this.input){let t=n.filter(e=>e),r=[],i=[],a=[],o=[];for(let n of t){let t=this.specs.indexOf(n),s;t<0?(s=n(e.view),o.push(s)):(s=this.panels[t],s.update&&s.update(e)),r.push(s),(s.top?i:a).push(s)}this.specs=t,this.panels=r,this.top.sync(i),this.bottom.sync(a);for(let e of o)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>H.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})}),dc=class{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes=``,this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&=(this.dom.remove(),void 0);return}if(!this.dom){this.dom=document.createElement(`div`),this.dom.className=this.top?`cm-panels cm-panels-top`:`cm-panels cm-panels-bottom`;let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=fc(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=fc(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(` `))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(` `))e&&this.container.classList.add(e)}}};function fc(e){let t=e.nextSibling;return e.remove(),t}var pc=E.define({enables:uc});function mc(e,t){let n,r=new Promise(e=>n=e),i=e=>vc(e,t,n);e.state.field(hc,!1)?e.dispatch({effects:gc.of(i)}):e.dispatch({effects:D.appendConfig.of(hc.init(()=>[i]))});let a=_c.of(i);return{close:a,result:r.then(t=>((e.win.queueMicrotask||(t=>e.win.setTimeout(t,10)))(()=>{e.state.field(hc).indexOf(i)>-1&&e.dispatch({effects:a})}),t))}}var hc=Ce.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(gc)?e=[n.value].concat(e):n.is(_c)&&(e=e.filter(e=>e!=n.value));return e},provide:e=>pc.computeN([e],t=>t.field(e))}),gc=D.define(),_c=D.define();function vc(e,t,n){let r=t.content?t.content(e,()=>o(null)):null;if(!r){if(r=M(`form`),t.input){let e=M(`input`,t.input);/^(text|password|number|email|tel|url)$/.test(e.type)&&e.classList.add(`cm-textfield`),e.name||=`input`,r.appendChild(M(`label`,(t.label||``)+`: `,e))}else r.appendChild(document.createTextNode(t.label||``));r.appendChild(document.createTextNode(` `)),r.appendChild(M(`button`,{class:`cm-button`,type:`submit`},t.submitLabel||`OK`))}let i=r.nodeName==`FORM`?[r]:r.querySelectorAll(`form`);for(let e=0;e<i.length;e++){let t=i[e];t.addEventListener(`keydown`,e=>{e.keyCode==27?(e.preventDefault(),o(null)):e.keyCode==13&&(e.preventDefault(),o(t))}),t.addEventListener(`submit`,e=>{e.preventDefault(),o(t)})}let a=M(`div`,r,M(`button`,{onclick:()=>o(null),"aria-label":e.state.phrase(`close`),class:`cm-dialog-close`,type:`button`},[`×`]));t.class&&(a.className=t.class),a.classList.add(`cm-dialog`);function o(t){a.contains(a.ownerDocument.activeElement)&&e.focus(),n(t)}return{dom:a,top:t.top,mount:()=>{if(t.focus){let e;e=typeof t.focus==`string`?r.querySelector(t.focus):r.querySelector(`input`)||r.querySelector(`button`),e&&`select`in e?e.select():e&&`focus`in e&&e.focus()}}}}var yc=class extends it{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};yc.prototype.elementClass=``,yc.prototype.toDOM=void 0,yc.prototype.mapMode=C.TrackBefore,yc.prototype.startSide=yc.prototype.endSide=-1,yc.prototype.point=!0;var bc=E.define(),xc=E.define(),Sc={class:``,renderEmptyElements:!1,elementStyle:``,markers:()=>A.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:`before`},Cc=E.define();function wc(e){return[Ec(),Cc.of({...Sc,...e})]}var Tc=E.define({combine:e=>e.some(e=>e)});function Ec(e){let t=[Dc];return e&&e.fixed===!1&&t.push(Tc.of(!0)),t}var Dc=R.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement(`div`),this.dom.className=`cm-gutters cm-gutters-before`,this.dom.setAttribute(`aria-hidden`,`true`),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.gutters=e.state.facet(Cc).map(t=>new jc(e,t)),this.fixed=!e.state.facet(Tc);for(let e of this.gutters)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position=`sticky`),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement(`div`),this.domAfter.className=`cm-gutters cm-gutters-after`,this.domAfter.setAttribute(`aria-hidden`,`true`),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.domAfter.style.position=this.fixed?`sticky`:``,this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(e.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+`px`;this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(Tc)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?`sticky`:``,this.domAfter&&(this.domAfter.style.position=this.fixed?`sticky`:``)),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=A.iter(this.view.state.facet(bc),this.view.viewport.from),r=[],i=this.gutters.map(e=>new Ac(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let a of e.type)if(a.type==P.Text&&t){kc(n,r,a.from);for(let e of i)e.line(this.view,a,r);t=!1}else if(a.widget)for(let e of i)e.widget(this.view,a)}else if(e.type==P.Text){kc(n,r,e.from);for(let t of i)t.line(this.view,e,r)}else if(e.widget)for(let t of i)t.widget(this.view,e);for(let e of i)e.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(Cc),n=e.state.facet(Cc),r=e.docChanged||e.heightChanged||e.viewportChanged||!A.eq(e.startState.facet(bc),e.state.facet(bc),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let i=[];for(let r of n){let n=t.indexOf(r);n<0?i.push(new jc(this.view,r)):(this.gutters[n].update(e),i.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),i.indexOf(e)<0&&e.destroy();for(let e of i)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>H.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,i=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==I.LTR?{left:r,right:i}:{right:r,left:i}})});function Oc(e){return Array.isArray(e)?e:[e]}function kc(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}var Ac=class{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=A.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,i=(t.top-this.height)/e.scaleY,a=t.height/e.scaleY;if(this.i==r.elements.length){let t=new Mc(e,a,i,n);r.elements.push(t),r.dom.appendChild(t.dom)}else r.elements[this.i].update(e,a,i,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];kc(this.cursor,r,t.from),n.length&&(r=r.concat(n));let i=this.gutter.config.lineMarker(e,t,r);i&&r.unshift(i);let a=this.gutter;r.length==0&&!a.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let n of e.state.facet(xc)){let i=n(e,t.widget,t);i&&(r||=[]).push(i)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},jc=class{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement(`div`),this.dom.className=`cm-gutter`+(this.config.class?` `+this.config.class:``);for(let n in t.domEventHandlers)this.dom.addEventListener(n,r=>{let i=r.target,a;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();a=(e.top+e.bottom)/2}else a=r.clientY;let o=e.lineBlockAtHeight(a-e.documentTop);t.domEventHandlers[n](e,o,r)&&r.preventDefault()});this.markers=Oc(t.markers(e)),t.initialSpacer&&(this.spacer=new Mc(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+=`visibility: hidden; pointer-events: none`)}update(e){let t=this.markers;if(this.markers=Oc(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!A.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},Mc=class{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement(`div`),this.dom.className=`cm-gutterElement`,this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+`px`),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+`px`:``),Nc(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n=`cm-gutterElement`,r=this.dom.firstChild;for(let i=0,a=0;;){let o=a,s=i<t.length?t[i++]:null,c=!1;if(s){let e=s.elementClass;e&&(n+=` `+e);for(let e=a;e<this.markers.length;e++)if(this.markers[e].compare(s)){o=e,c=!0;break}}else o=this.markers.length;for(;a<o;){let e=this.markers[a++];if(e.toDOM){e.destroy(r);let t=r.nextSibling;r.remove(),r=t}}if(!s)break;s.toDOM&&(c?r=r.nextSibling:this.dom.insertBefore(s.toDOM(e),r)),c&&a++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}};function Nc(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}var Pc=E.define(),Fc=E.define(),Ic=E.define({combine(e){return rt(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],i=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||i(e,t,n):i}return n}})}}),Lc=class extends yc{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function Rc(e,t){return e.state.facet(Ic).formatNumber(t,e.state)}var zc=Cc.compute([Ic],e=>({class:`cm-lineNumbers`,renderEmptyElements:!1,markers(e){return e.state.facet(Pc)},lineMarker(e,t,n){return n.some(e=>e.toDOM)?null:new Lc(Rc(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let r of e.state.facet(Fc)){let i=r(e,t,n);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(Ic)!=e.state.facet(Ic),initialSpacer(e){return new Lc(Rc(e,Vc(e.state.doc.lines)))},updateSpacer(e,t){let n=Rc(t.view,Vc(t.view.state.doc.lines));return n==e.number?e:new Lc(n)},domEventHandlers:e.facet(Ic).domEventHandlers,side:`before`}));function Bc(e={}){return[Ic.of(e),Ec(),zc]}function Vc(e){let t=9;for(;t<e;)t=t*10+9;return t}var Hc=new class extends yc{constructor(){super(...arguments),this.elementClass=`cm-activeLineGutter`}},Uc=bc.compute([`selection`],e=>{let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.head).from;i>n&&(n=i,t.push(Hc.range(i)))}return A.of(t)});function Wc(){return Uc}var Gc=1024,Kc=0,qc=class{constructor(e,t){this.from=e,this.to=t}},U=class{constructor(e={}){this.id=Kc++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=Xc.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};U.closedBy=new U({deserialize:e=>e.split(` `)}),U.openedBy=new U({deserialize:e=>e.split(` `)}),U.group=new U({deserialize:e=>e.split(` `)}),U.isolate=new U({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),U.contextHash=new U({perNode:!0}),U.lookAhead=new U({perNode:!0}),U.mounted=new U({perNode:!0});var Jc=class{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[U.mounted.id]}},Yc=Object.create(null),Xc=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):Yc,r=!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e==`string`){if(this.name==e)return!0;let t=this.prop(U.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(U.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}};Xc.none=new Xc(``,Object.create(null),0,8);var Zc=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);if(t){r||=Object.assign({},e.props);let n=t[1],i=t[0];i.combine&&i.id in r&&(n=i.combine(r[i.id],n)),r[i.id]=n}}n.push(r?new Xc(e.name,r,e.id,e.flags):e)}return new e(n)}},Qc=new WeakMap,$c=new WeakMap,W;(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`})(W||={});var G=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=Jc.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.toString();n&&(t&&(t+=`,`),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?`(`+t+`)`:``):t}cursor(e=0){return new pl(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new pl(Qc.get(this)||this.topNode);return r.moveTo(e,t),Qc.set(this,r._tree),r}get topNode(){return new al(this,0,0,null)}resolve(e,t=0){let n=rl(Qc.get(this)||this.topNode,e,t,!1);return Qc.set(this,n),n}resolveInner(e,t=0){let n=rl($c.get(this)||this.topNode,e,t,!0);return $c.set(this,n),n}resolveStack(e,t=0){return fl(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&W.IncludeAnonymous)>0;for(let e=this.cursor(a|W.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(t={}){return this.children.length<=8?this:vl(Xc.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(Xc.none,t,n,r)))}static build(e){return hl(e)}};G.empty=new G(Xc.none,[],[],0);var el=class e{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new e(this.buffer,this.index)}},tl=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Xc.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(`,`)}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!(nl(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}};function nl(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function rl(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof al&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:W.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof al&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}var il=class{cursor(e=0){return new pl(this,e)}getChild(e,t=null,n=null){let r=ol(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return ol(this,e,t,n)}resolve(e,t=0){return rl(this,e,t,!1)}resolveInner(e,t=0){return rl(this,e,t,!0)}matchContext(e){return sl(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},al=class e extends il{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:c}=o._tree,l=n>0?s.length:-1;t!=l;t+=n){let l=s[t],u=c[t]+o.from,d;if(!(!(a&W.EnterBracketed&&l instanceof G&&(d=Jc.get(l))&&!d.overlay&&d.bracketed&&r>=u&&r<=u+l.length)&&!nl(i,r,u,u+l.length))){if(l instanceof tl){if(a&W.ExcludeBuffers)continue;let e=l.findChild(0,l.buffer.length,n,r-u,i);if(e>-1)return new ll(new cl(o,l,t,u),null,e)}else if(a&W.IncludeAnonymous||!l.type.isAnonymous||ml(l)){let s;if(!(a&W.IgnoreMounts)&&(s=Jc.get(l))&&!s.overlay)return new e(s.tree,u,t,o);let c=new e(l,u,t,o);return a&W.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?l.children.length-1:0,n,r,i,a)}}}if(a&W.IncludeAnonymous||!o.type.isAnonymous||(t=o.index>=0?o.index+n:n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(t,n,r=0){let i;if(!(r&W.IgnoreOverlays)&&(i=Jc.get(this._tree))&&i.overlay){let a=t-this.from,o=r&W.EnterBracketed&&i.bracketed;for(let{from:t,to:r}of i.overlay)if((n>0||o?t<=a:t<a)&&(n<0||o?r>=a:r>a))return new e(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function ol(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function sl(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}var cl=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},ll=class e extends il{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(t,n,r=0){if(r&W.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new G(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function ul(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof al&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new dl(i,n)}var dl=class{constructor(e,t){this.heads=e,this.node=t}get next(){return ul(this.heads)}};function fl(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof al?r:r.context.parent;e;e=e.parent)if(e.index<0){let a=e.parent;(i||=[r]).push(a.resolve(t,n)),e=a}else{let a=Jc.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new al(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push(rl(o,t,n,!1))}}return i?ul(i):r}var pl=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~W.EnterBracketed,e instanceof al)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof al?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&W.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&W.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&W.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&W.IncludeAnonymous||e instanceof tl||!e.type.isAnonymous||ml(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)scan:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break scan}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new ll(this.buffer,t,this.stack[e]);return this.bufferNode=new ll(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return sl(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return sl(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}};function ml(e){return e.children.some(e=>e instanceof tl||!e.type.isAnonymous||ml(e))}function hl(e){let{buffer:t,nodeSet:n,maxBufferLength:r=Gc,reused:i=[],minRepeatType:a=n.types.length}=e,o=Array.isArray(t)?new el(t,t.length):t,s=n.types,c=0,l=0;function u(e,t,_,v,y,ee){let{id:te,start:b,end:x,size:ne}=o,re=l,S=c;if(ne<0){if(o.next(),ne==-1){let t=i[te];_.push(t),v.push(b-e);return}if(ne==-3){c=te;return}if(ne==-4){l=te;return}throw RangeError(`Unrecognized record size: ${ne}`)}let ie=s[te],ae,oe,C=b-e;if(x-b<=r&&(oe=h(o.pos-t,y))){let t=new Uint16Array(oe.size-oe.skip),r=o.pos-oe.size,i=t.length;for(;o.pos>r;)i=g(oe.start,t,i);ae=new tl(t,x-oe.start,n),C=oe.start-e}else{let e=o.pos-ne;o.next();let t=[],n=[],i=te>=a?te:-1,s=0,c=x;for(;o.pos>e;)i>=0&&o.id==i&&o.size>=0?(o.end<=c-r&&(p(t,n,b,s,o.end,c,i,re,S),s=t.length,c=o.end),o.next()):ee>2500?d(b,e,t,n):u(b,e,t,n,i,ee+1);if(i>=0&&s>0&&s<t.length&&p(t,n,b,s,b,c,i,re,S),t.reverse(),n.reverse(),i>-1&&s>0){let e=f(ie,S);ae=vl(ie,t,n,0,t.length,0,x-b,e,e)}else ae=m(ie,t,n,x-b,re-x,S)}_.push(ae),v.push(C)}function d(e,t,i,a){let s=[],c=0,l=-1;for(;o.pos>t;){let{id:e,start:t,end:n,size:i}=o;if(i>4)o.next();else if(l>-1&&t<l)break;else l<0&&(l=n-r),s.push(e,t,n),c++,o.next()}if(c){let t=new Uint16Array(c*4),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;i.push(new tl(t,s[2]-r,n)),a.push(r-e)}}function f(e,t){return(n,r,i)=>{let a=0,o=n.length-1,s,c;if(o>=0&&(s=n[o])instanceof G){if(!o&&s.type==e&&s.length==i)return s;(c=s.prop(U.lookAhead))&&(a=r[o]+s.length+c)}return m(e,n,r,i,a,t)}}function p(e,t,r,i,a,o,s,c,l){let u=[],d=[];for(;e.length>i;)u.push(e.pop()),d.push(t.pop()+r-a);e.push(m(n.types[s],u,d,o-a,c-o,l)),t.push(a-r)}function m(e,t,n,r,i,a,o){if(a){let e=[U.contextHash,a];o=o?[e].concat(o):[e]}if(i>25){let e=[U.lookAhead,i];o=o?[e].concat(o):[e]}return new G(e,t,n,r,o)}function h(e,t){let n=o.fork(),i=0,s=0,c=0,l=n.end-r,u={size:0,start:0,skip:0};scan:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=s,u.skip=c,c+=4,i+=4,n.next();continue}let o=n.pos-e;if(e<0||o<r||n.start<l)break;let d=n.id>=a?4:0,f=n.start;for(n.next();n.pos>o;){if(n.size<0){if(n.size==-3||n.size==-4)d+=4;else break scan}else n.id>=a&&(d+=4);n.next()}s=f,i+=e,c+=d}return(t<0||i==e)&&(u.size=i,u.start=s,u.skip=c),u.size>4?u:void 0}function g(e,t,n){let{id:r,start:i,end:s,size:u}=o;if(o.next(),u>=0&&r<a){let a=n;if(u>4){let r=o.pos-(u-4);for(;o.pos>r;)n=g(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=i-e,t[--n]=r}else u==-3?c=r:u==-4&&(l=r);return n}let _=[],v=[];for(;o.pos>0;)u(e.start||0,e.bufferStart||0,_,v,-1,0);let y=e.length??(_.length?v[0]+_[0].length:0);return new G(s[e.topID],_.reverse(),v.reverse(),y)}var gl=new WeakMap;function _l(e,t){if(!e.isAnonymous||t instanceof tl||t.type!=e)return 1;let n=gl.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof G)){n=1;break}n+=_l(e,r)}gl.set(t,n)}return n}function vl(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=_l(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=_l(e,t[s]);for(s++;s<i;s++){let n=_l(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push(vl(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var yl=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},bl=class{startParse(e,t,n){return typeof e==`string`&&(e=new xl(e)),n=n?n.length?n.map(e=>new qc(e.from,e.to)):[new qc(0,0)]:[new qc(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},xl=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};new U({perNode:!0});var Sl=0,Cl=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=Sl++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new Tl(e);return e=>e.modified.indexOf(t)>-1?e:Tl.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}},wl=0,Tl=class e{constructor(e){this.name=e,this.instances=[],this.id=wl++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&El(n,e.modified));if(r)return r;let i=[],a=new Cl(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=Dl(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}};function El(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function Dl(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function Ol(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new Al(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return kl.add(t)}var kl=new U({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new Al(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}}),Al=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};Al.empty=new Al([],2,null);function jl(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}function Ml(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+` `+e:e)}return n}function Nl(e,t,n,r=0,i=e.length){let a=new Pl(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,``,a.highlighters),a.flush(i)}var Pl=class{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=``}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,i){let{type:a,from:o,to:s}=e;if(o>=n||s<=t)return;a.isTop&&(i=this.highlighters.filter(e=>!e.scope||e.scope(a)));let c=r,l=Fl(e)||Al.empty,u=Ml(i,l.tags);if(u&&(c&&(c+=` `),c+=u,l.mode==1&&(r+=(r?` `:``)+u)),this.startSpan(Math.max(t,o),c),l.opaque)return;let d=e.tree&&e.tree.prop(U.mounted);if(d&&d.overlay){let a=e.node.enter(d.overlay[0].from+o,1),l=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),u=e.firstChild();for(let f=0,p=o;;f++){let m=f<d.overlay.length?d.overlay[f]:null,h=m?m.from+o:s,g=Math.max(t,p),_=Math.min(n,h);if(g<_&&u)for(;e.from<_&&(this.highlightRange(e,g,_,r,i),this.startSpan(Math.min(_,e.to),c),!(e.to>=h||!e.nextSibling())););if(!m||h>n)break;p=m.to+o,p>t&&(this.highlightRange(a.cursor(),Math.max(t,m.from+o),Math.min(n,p),``,l),this.startSpan(Math.min(n,p),c))}u&&e.parent()}else if(e.firstChild()){d&&(r=``);do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}};function Fl(e){let t=e.type.prop(kl);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}var K=Cl.define,Il=K(),Ll=K(),Rl=K(Ll),zl=K(Ll),Bl=K(),Vl=K(Bl),Hl=K(Bl),Ul=K(),Wl=K(Ul),Gl=K(),Kl=K(),ql=K(),Jl=K(ql),Yl=K(),q={comment:Il,lineComment:K(Il),blockComment:K(Il),docComment:K(Il),name:Ll,variableName:K(Ll),typeName:Rl,tagName:K(Rl),propertyName:zl,attributeName:K(zl),className:K(Ll),labelName:K(Ll),namespace:K(Ll),macroName:K(Ll),literal:Bl,string:Vl,docString:K(Vl),character:K(Vl),attributeValue:K(Vl),number:Hl,integer:K(Hl),float:K(Hl),bool:K(Bl),regexp:K(Bl),escape:K(Bl),color:K(Bl),url:K(Bl),keyword:Gl,self:K(Gl),null:K(Gl),atom:K(Gl),unit:K(Gl),modifier:K(Gl),operatorKeyword:K(Gl),controlKeyword:K(Gl),definitionKeyword:K(Gl),moduleKeyword:K(Gl),operator:Kl,derefOperator:K(Kl),arithmeticOperator:K(Kl),logicOperator:K(Kl),bitwiseOperator:K(Kl),compareOperator:K(Kl),updateOperator:K(Kl),definitionOperator:K(Kl),typeOperator:K(Kl),controlOperator:K(Kl),punctuation:ql,separator:K(ql),bracket:Jl,angleBracket:K(Jl),squareBracket:K(Jl),paren:K(Jl),brace:K(Jl),content:Ul,heading:Wl,heading1:K(Wl),heading2:K(Wl),heading3:K(Wl),heading4:K(Wl),heading5:K(Wl),heading6:K(Wl),contentSeparator:K(Ul),list:K(Ul),quote:K(Ul),emphasis:K(Ul),strong:K(Ul),link:K(Ul),monospace:K(Ul),strikethrough:K(Ul),inserted:K(),deleted:K(),changed:K(),invalid:K(),meta:Yl,documentMeta:K(Yl),annotation:K(Yl),processingInstruction:K(Yl),definition:Cl.defineModifier(`definition`),constant:Cl.defineModifier(`constant`),function:Cl.defineModifier(`function`),standard:Cl.defineModifier(`standard`),local:Cl.defineModifier(`local`),special:Cl.defineModifier(`special`)};for(let e in q){let t=q[e];t instanceof Cl&&(t.name=e)}jl([{tag:q.link,class:`tok-link`},{tag:q.heading,class:`tok-heading`},{tag:q.emphasis,class:`tok-emphasis`},{tag:q.strong,class:`tok-strong`},{tag:q.keyword,class:`tok-keyword`},{tag:q.atom,class:`tok-atom`},{tag:q.bool,class:`tok-bool`},{tag:q.url,class:`tok-url`},{tag:q.labelName,class:`tok-labelName`},{tag:q.inserted,class:`tok-inserted`},{tag:q.deleted,class:`tok-deleted`},{tag:q.literal,class:`tok-literal`},{tag:q.string,class:`tok-string`},{tag:q.number,class:`tok-number`},{tag:[q.regexp,q.escape,q.special(q.string)],class:`tok-string2`},{tag:q.variableName,class:`tok-variableName`},{tag:q.local(q.variableName),class:`tok-variableName tok-local`},{tag:q.definition(q.variableName),class:`tok-variableName tok-definition`},{tag:q.special(q.variableName),class:`tok-variableName2`},{tag:q.definition(q.propertyName),class:`tok-propertyName tok-definition`},{tag:q.typeName,class:`tok-typeName`},{tag:q.namespace,class:`tok-namespace`},{tag:q.className,class:`tok-className`},{tag:q.macroName,class:`tok-macroName`},{tag:q.propertyName,class:`tok-propertyName`},{tag:q.operator,class:`tok-operator`},{tag:q.comment,class:`tok-comment`},{tag:q.meta,class:`tok-meta`},{tag:q.invalid,class:`tok-invalid`},{tag:q.punctuation,class:`tok-punctuation`}]);var Xl=new U;function Zl(e){return E.define({combine:e?t=>t.concat(e):void 0})}var Ql=new U,$l=class{constructor(e,t,n=[],r=``){this.data=e,this.name=r,k.prototype.hasOwnProperty(`tree`)||Object.defineProperty(k.prototype,"tree",{get(){return J(this)}}),this.parser=t,this.extension=[uu.of(this),k.languageData.of((e,t,n)=>{let r=eu(e,t,n),i=r.type.prop(Xl);if(!i)return[];let a=e.facet(i),o=r.type.prop(Ql);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,e)){let n=e.facet(t.facet);return t.type==`replace`?n:n.concat(a)}}return a})].concat(n)}isActiveAt(e,t,n=-1){return eu(e,t,n).type.prop(Xl)==this.data}findRegions(e){let t=e.facet(uu);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(Xl)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(U.mounted);if(i){if(i.tree.prop(Xl)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof G&&r(i,e.positions[n]+t)}};return r(J(e),0),n}get allowsNesting(){return!0}};$l.setState=D.define();function eu(e,t,n){let r=e.facet(uu),i=J(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,W.ExcludeBuffers|W.EnterBracketed))e.type.isTop&&(i=e);return i}var tu=class e extends $l{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(t){let n=Zl(t.languageData);return new e(n,t.parser.configure({props:[Xl.add(e=>e.isTop?n:void 0)]}),t.name)}configure(t,n){return new e(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function J(e){let t=e.field($l.state,!1);return t?t.tree:G.empty}var nu=class{constructor(e){this.doc=e,this.cursorPos=0,this.string=``,this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},ru=null,iu=class e{constructor(e,t,n=[],r,i,a,o,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new e(t,n,[],G.empty,0,r,[],null)}startParse(){return this.parser.startParse(new nu(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=G.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{if(typeof e==`number`){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||=this.startParse(),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n){if(this.fragments=this.withoutTempSkipped(yl.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=this.parse.stoppedAt??this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0}if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(yl.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=ru;ru=this;try{return e()}finally{ru=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=au(e,t.from,t.to);return e}changes(t,n){let{fragments:r,tree:i,treeLen:a,viewport:o,skipped:s}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,n,r,i)=>e.push({fromA:t,toA:n,fromB:r,toB:i})),r=yl.applyChanges(r,e),i=G.empty,a=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){s=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&s.push({from:n,to:r})}}}return new e(this.parser,n,r,i,a,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=au(this.fragments,n,r),this.skipped.splice(t--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&=(this.takeTree(),null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends bl{createParse(t,n,r){let i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance(){let t=ru;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new G(Xc.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return ru}};function au(e,t,n){return yl.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var ou=class e{constructor(e){this.context=e,this.tree=e.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new e(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=iu.create(t.facet(uu).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}};$l.state=Ce.define({create:ou.init,update(e,t){for(let e of t.effects)if(e.is($l.setState))return e.value;return t.startState.facet(uu)==t.state.facet(uu)?e.apply(t):ou.init(t.state)}});var su=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<`u`&&(su=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});var cu=typeof navigator<`u`&&navigator.scheduling?.isInputPending?()=>navigator.scheduling.isInputPending():null,lu=R.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field($l.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field($l.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=su(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field($l.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!cu?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>cu&&cu()||Date.now()>a,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:$l.setState.of(new ou(i.context))})),this.chunkBudget>0&&!(s&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&=(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>yr(this.view.state,e)).then(()=>this.workScheduled--),null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),uu=E.define({combine(e){return e.length?e[0]:null},enables:e=>[$l.state,lu,H.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),du=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},fu=E.define(),pu=E.define({combine:e=>{if(!e.length)return` `;let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error(`Invalid indent unit: `+JSON.stringify(e[0]));return t}});function mu(e){let t=e.facet(pu);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function hu(e,t){let n=``,r=e.tabSize,i=e.facet(pu)[0];if(i==` `){for(;t>=r;)n+=` `,t-=r;i=` `}for(let e=0;e<t;e++)n+=i;return n}function gu(e,t){e instanceof k&&(e=new _u(e));for(let n of e.state.facet(fu)){let r=n(e,t);if(r!==void 0)return r}let n=J(e.state);return n.length>=t?yu(e,n,t):null}var _u=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=mu(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return r!=null&&r>=n.from&&r<=n.to?i&&r==e?{text:``,from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return``;let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),a=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return a>-1&&(i+=a-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return xt(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},vu=new U;function yu(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t&&!(t.from<r.node.from||t.to>r.node.to||t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return bu(r,e,n)}function bu(e,t,n){for(let r=e;r;r=r.next){let e=Su(r.node);if(e)return e(wu.create(t,n,r))}return 0}function xu(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function Su(e){let t=e.type.prop(vu);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(U.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>Ou(e,!0,1,void 0,n&&!xu(e)?t.from:void 0)}return e.parent==null?Cu:null}function Cu(){return 0}var wu=class e extends _u{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(t,n,r){return new e(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(Tu(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return bu(this.context.next,this.base,this.pos)}};function Tu(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function Eu(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,a=e.state.doc.lineAt(n.from),o=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.from>=o)return null;let e=/^ */.exec(a.text.slice(n.to-a.from))[0].length;return{from:n.from,to:n.to+e}}e=i.to}}function Du({closing:e,align:t=!0,units:n=1}){return r=>Ou(r,t,n,e)}function Ou(e,t,n,r,i){let a=e.textAfter,o=a.match(/^\s*/)[0].length,s=r&&a.slice(o,o+r.length)==r||i==e.pos+o,c=t?Eu(e):null;return c?s?e.column(c.from):e.column(c.to):e.baseIndent+(s?0:e.unit*n)}function ku({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}var Au=200;function ju(){return k.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent(`input.type`)&&!e.isUserEvent(`input.complete`))return e;let t=e.startState.languageDataAt(`indentOnInput`,e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+Au)return e;let a=n.sliceString(i.from,r);if(!t.some(e=>e.test(a)))return e;let{state:o}=e,s=-1,c=[];for(let{head:e}of o.selection.ranges){let t=o.doc.lineAt(e);if(t.from==s)continue;s=t.from;let n=gu(o,t.from);if(n==null)continue;let r=/^\s*/.exec(t.text)[0],i=hu(o,n);r!=i&&c.push({from:t.from,to:t.from+r.length,insert:i})}return c.length?[e,{changes:c,sequential:!0}]:e})}var Mu=E.define(),Nu=new U;function Pu(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}function Fu(e,t,n){let r=J(e);if(r.length<n)return null;let i=r.resolveStack(n,1),a=null;for(let o=i;o;o=o.next){let i=o.node;if(i.to<=n||i.from>n)continue;if(a&&i.from<t)break;let s=i.type.prop(Nu);if(s&&(i.to<r.length-50||r.length==e.doc.length||!Iu(i))){let r=s(i,e);r&&r.from<=n&&r.from>=t&&r.to>n&&(a=r)}}return a}function Iu(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function Lu(e,t,n){for(let r of e.facet(Mu)){let i=r(e,t,n);if(i)return i}return Fu(e,t,n)}function Ru(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}var zu=D.define({map:Ru}),Bu=D.define({map:Ru});function Vu(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(e=>e.from<=n&&e.to>=n)||t.push(e.lineBlockAt(n));return t}var Hu=Ce.define({create(){return F.none},update(e,t){t.isUserEvent(`delete`)&&t.changes.iterChangedRanges((t,n)=>e=Uu(e,t,n)),e=e.map(t.changes);let n=[];for(let r of t.effects)r.is(zu)&&!Gu(e,r.value.from,r.value.to)?n.push(r.value):r.is(Bu)&&(e=e.update({filter:(e,t)=>r.value.from!=e||r.value.to!=t,filterFrom:r.value.from,filterTo:r.value.to}));if(n.length){let{preparePlaceholder:r}=t.state.facet(Qu),i=n.map(e=>(r?F.replace({widget:new nd(r(t.state,e))}):td).range(e.from,e.to));e=e.update({add:i})}return t.selection&&(e=Uu(e,t.selection.main.head)),e},provide:e=>H.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(e,t)=>{n.push(e,t)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw RangeError(`Invalid JSON for fold state`);let t=[];for(let n=0;n<e.length;){let r=e[n++],i=e[n++];if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid JSON for fold state`);t.push(td.range(r,i))}return F.set(t,!0)}});function Uu(e,t,n=t){let r=!1;return e.between(t,n,(e,i)=>{e<n&&i>t&&(r=!0)}),r?e.update({filterFrom:t,filterTo:n,filter:(e,r)=>e>=n||r<=t}):e}function Wu(e,t,n){var r;let i=null;return(r=e.field(Hu,!1))==null||r.between(t,n,(e,t)=>{(!i||i.from>e)&&(i={from:e,to:t})}),i}function Gu(e,t,n){let r=!1;return e.between(t,t,(e,i)=>{e==t&&i==n&&(r=!0)}),r}function Ku(e,t){return e.field(Hu,!1)?t:t.concat(D.appendConfig.of($u()))}var qu=e=>{for(let t of Vu(e)){let n=Lu(e.state,t.from,t.to);if(n)return e.dispatch({effects:Ku(e.state,[zu.of(n),Yu(e,n)])}),!0}return!1},Ju=e=>{if(!e.state.field(Hu,!1))return!1;let t=[];for(let n of Vu(e)){let r=Wu(e.state,n.from,n.to);r&&t.push(Bu.of(r),Yu(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function Yu(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return H.announce.of(`${e.state.phrase(n?`Folded lines`:`Unfolded lines`)} ${r} ${e.state.phrase(`to`)} ${i}.`)}var Xu=[{key:`Ctrl-Shift-[`,mac:`Cmd-Alt-[`,run:qu},{key:`Ctrl-Shift-]`,mac:`Cmd-Alt-]`,run:Ju},{key:`Ctrl-Alt-[`,run:e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),a=Lu(t,i.from,i.to);a&&n.push(zu.of(a)),r=(a?e.lineBlockAt(a.to):i).to+1}return n.length&&e.dispatch({effects:Ku(e.state,n)}),!!n.length}},{key:`Ctrl-Alt-]`,run:e=>{let t=e.state.field(Hu,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(Bu.of({from:e,to:t}))}),e.dispatch({effects:n}),!0}}],Zu={placeholderDOM:null,preparePlaceholder:null,placeholderText:`…`},Qu=E.define({combine(e){return rt(e,Zu)}});function $u(e){let t=[Hu,od];return e&&t.push(Qu.of(e)),t}function ed(e,t){let{state:n}=e,r=n.facet(Qu),i=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=Wu(e.state,n.from,n.to);r&&e.dispatch({effects:Bu.of(r)}),t.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let a=document.createElement(`span`);return a.textContent=r.placeholderText,a.setAttribute(`aria-label`,n.phrase(`folded code`)),a.title=n.phrase(`unfold`),a.className=`cm-foldPlaceholder`,a.onclick=i,a}var td=F.replace({widget:new class extends en{toDOM(e){return ed(e,null)}}}),nd=class extends en{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return ed(e,this.value)}},rd={openText:`⌄`,closedText:`›`,markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1},id=class extends yc{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement(`span`);return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?`Fold line`:`Unfold line`),t}};function ad(e={}){let t={...rd,...e},n=new id(t,!0),r=new id(t,!1),i=R.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(uu)!=e.state.facet(uu)||e.startState.field(Hu,!1)!=e.state.field(Hu,!1)||J(e.startState)!=J(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new ut;for(let i of e.viewportLineBlocks){let a=Wu(e.state,i.from,i.to)?r:Lu(e.state,i.from,i.to)?n:null;a&&t.add(i.from,i.from,a)}return t.finish()}}),{domEventHandlers:a}=t;return[i,wc({class:`cm-foldGutter`,markers(e){return e.plugin(i)?.markers||A.empty},initialSpacer(){return new id(t,!1)},domEventHandlers:{...a,click:(e,t,n)=>{if(a.click&&a.click(e,t,n))return!0;let r=Wu(e.state,t.from,t.to);if(r)return e.dispatch({effects:Bu.of(r)}),!0;let i=Lu(e.state,t.from,t.to);return i?(e.dispatch({effects:zu.of(i)}),!0):!1}}}),$u()]}var od=H.baseTheme({".cm-foldPlaceholder":{backgroundColor:`#eee`,border:`1px solid #ddd`,color:`#888`,borderRadius:`.2em`,margin:`0 1px`,padding:`0 1px`,cursor:`pointer`},".cm-foldGutter span":{padding:`0 1px`,cursor:`pointer`}}),sd=class e{constructor(e,t){this.specs=e;let n;function r(e){let t=Dt.newName();return(n||=Object.create(null))[`.`+t]=e,t}let i=typeof t.all==`string`?t.all:t.all?r(t.all):void 0,a=t.scope;this.scope=a instanceof $l?e=>e.prop(Xl)==a.data:a?e=>e==a:void 0,this.style=jl(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new Dt(n):null,this.themeType=t.themeType}static define(t,n){return new e(t,n||{})}},cd=E.define(),ld=E.define({combine(e){return e.length?[e[0]]:null}});function ud(e){let t=e.facet(cd);return t.length?t:e.facet(ld)}function dd(e,t){let n=[pd],r;return e instanceof sd&&(e.module&&n.push(H.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(ld.of(e)):r?n.push(cd.computeN([H.darkTheme],t=>t.facet(H.darkTheme)==(r==`dark`)?[e]:[])):n.push(cd.of(e)),n}var fd=class{constructor(e){this.markCache=Object.create(null),this.tree=J(e.state),this.decorations=this.buildDeco(e,ud(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=J(e.state),n=ud(e.state),r=n!=ud(e.startState),{viewport:i}=e.view,a=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&a>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return F.none;let n=new ut;for(let{from:r,to:i}of e.visibleRanges)Nl(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=F.mark({class:r})))},r,i);return n.finish()}},pd=Ee.high(R.fromClass(fd,{decorations:e=>e.decorations})),md=sd.define([{tag:q.meta,color:`#404740`},{tag:q.link,textDecoration:`underline`},{tag:q.heading,textDecoration:`underline`,fontWeight:`bold`},{tag:q.emphasis,fontStyle:`italic`},{tag:q.strong,fontWeight:`bold`},{tag:q.strikethrough,textDecoration:`line-through`},{tag:q.keyword,color:`#708`},{tag:[q.atom,q.bool,q.url,q.contentSeparator,q.labelName],color:`#219`},{tag:[q.literal,q.inserted],color:`#164`},{tag:[q.string,q.deleted],color:`#a11`},{tag:[q.regexp,q.escape,q.special(q.string)],color:`#e40`},{tag:q.definition(q.variableName),color:`#00f`},{tag:q.local(q.variableName),color:`#30a`},{tag:[q.typeName,q.namespace],color:`#085`},{tag:q.className,color:`#167`},{tag:[q.special(q.variableName),q.macroName],color:`#256`},{tag:q.definition(q.propertyName),color:`#00c`},{tag:q.comment,color:`#940`},{tag:q.invalid,color:`#f00`}]),hd=H.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:`#328c8252`},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bb555544`}}),gd=1e4,_d=`()[]{}`,vd=E.define({combine(e){return rt(e,{afterCursor:!0,brackets:_d,maxScanDistance:gd,renderMatch:xd})}}),yd=F.mark({class:`cm-matchingBracket`}),bd=F.mark({class:`cm-nonmatchingBracket`});function xd(e){let t=[],n=e.matched?yd:bd;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function Sd(e){let t=[],n=e.facet(vd);for(let r of e.selection.ranges){if(!r.empty)continue;let i=Od(e,r.head,-1,n)||r.head>0&&Od(e,r.head-1,1,n)||n.afterCursor&&(Od(e,r.head,1,n)||r.head<e.doc.length&&Od(e,r.head+1,-1,n));i&&(t=t.concat(n.renderMatch(i,e)))}return F.set(t,!0)}var Cd=[R.fromClass(class{constructor(e){this.paused=!1,this.decorations=Sd(e.state)}update(e){(e.docChanged||e.selectionSet||this.paused)&&(e.view.composing?(this.decorations=this.decorations.map(e.changes),this.paused=!0):(this.decorations=Sd(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),hd];function wd(e={}){return[vd.of(e),Cd]}var Td=new U;function Ed(e,t,n){let r=e.prop(t<0?U.openedBy:U.closedBy);if(r)return r;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==+(t<0))return[n[r+t]]}return null}function Dd(e){let t=e.type.prop(Td);return t?t(e.node):e}function Od(e,t,n,r={}){let i=r.maxScanDistance||gd,a=r.brackets||_d,o=J(e),s=o.resolveInner(t,n);for(let r=s;r;r=r.parent){let i=Ed(r.type,n,a);if(i&&r.from<r.to){let o=Dd(r);if(o&&(n>0?t>=o.from&&t<o.to:t>o.from&&t<=o.to))return kd(e,t,n,r,o,i,a)}}return Ad(e,t,n,o,s.type,i,a)}function kd(e,t,n,r,i,a,o){let s=r.parent,c={from:i.from,to:i.to},l=0,u=s?.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(l==0&&a.indexOf(u.type.name)>-1&&u.from<u.to){let e=Dd(u);return{start:c,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}if(Ed(u.type,n,o))l++;else if(Ed(u.type,-n,o)){if(l==0){let e=Dd(u);return{start:c,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}l--}}while(n<0?u.prevSibling():u.nextSibling());return{start:c,matched:!1}}function Ad(e,t,n,r,i,a,o){if(n<0?!t:t==e.doc.length)return null;let s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),c=o.indexOf(s);if(c<0||c%2==0!=n>0)return null;let l={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let e=0;!u.next().done&&e<=a;){let a=u.value;n<0&&(e+=a.length);let s=t+e*n;for(let e=n>0?0:a.length-1,t=n>0?a.length:-1;e!=t;e+=n){let t=o.indexOf(a[e]);if(!(t<0||r.resolveInner(s+e,1).type!=i)){if(t%2==0==n>0)d++;else if(d==1)return{start:l,end:{from:s+e,to:s+e+1},matched:t>>1==c>>1};else d--}}n>0&&(e+=a.length)}return u.done?{start:l,matched:!1}:null}function jd(e,t,n,r=0,i=0){t??(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));let a=i;for(let i=r;i<t;i++)e.charCodeAt(i)==9?a+=n-a%n:a++;return a}var Md=class{constructor(e,t,n,r){this.string=e,this.tabSize=t,this.indentUnit=n,this.overrideIndent=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let t=this.string.charAt(this.pos),n;if(n=typeof e==`string`?t==e:t&&(e instanceof RegExp?e.test(t):e(t)),n)return++this.pos,t}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=jd(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){return this.overrideIndent??jd(this.string,null,this.tabSize)}match(e,t,n){if(typeof e==`string`){let r=e=>n?e.toLowerCase():e;return r(this.string.substr(this.pos,e.length))==r(e)?(t!==!1&&(this.pos+=e.length),!0):null}{let n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}};function Nd(e){return{name:e.name||``,token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||Pd,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||Hd,mergeTokens:e.mergeTokens!==!1}}function Pd(e){if(typeof e!=`object`)return e;let t={};for(let n in e){let r=e[n];t[n]=r instanceof Array?r.slice():r}return t}var Fd=new WeakMap,Id=class e extends $l{constructor(e){let t=Zl(e.languageData),n=Nd(e),r,i=new class extends bl{createParse(e,t,n){return new Bd(r,e,t,n)}};super(t,i,[],e.name),this.topNode=Qd(t,this),r=this,this.streamParser=n,this.stateAfter=new U({perNode:!0}),this.tokenTable=e.tokenTable?new Jd(n.tokenTable):Yd}static define(t){return new e(t)}getIndent(e){let t,{overrideIndentation:n}=e.options;n&&(t=Fd.get(e.state),t!=null&&t<e.pos-1e4&&(t=void 0));let r=Ld(this,e.node.tree,e.node.from,e.node.from,t??e.pos),i,a;if(r?(a=r.state,i=r.pos+1):(a=this.streamParser.startState(e.unit),i=e.node.from),e.pos-i>1e4)return null;for(;i<e.pos;){let t=e.state.doc.lineAt(i),r=Math.min(e.pos,t.to);if(t.length){let i=n?n(t.from):-1,o=new Md(t.text,e.state.tabSize,e.unit,i<0?void 0:i);for(;o.pos<r-t.from;)Vd(this.streamParser.token,o,a)}else this.streamParser.blankLine(a,e.unit);if(r==e.pos)break;i=t.to+1}let o=e.lineAt(e.pos);return n&&t==null&&Fd.set(e.state,o.from),this.streamParser.indent(a,/^\s*(.*)/.exec(o.text)[1],e)}get allowsNesting(){return!1}};function Ld(e,t,n,r,i){let a=n>=r&&n+t.length<=i&&t.prop(e.stateAfter);if(a)return{state:e.streamParser.copyState(a),pos:n+t.length};for(let a=t.children.length-1;a>=0;a--){let o=t.children[a],s=n+t.positions[a],c=o instanceof G&&s<i&&Ld(e,o,s,r,i);if(c)return c}return null}function Rd(e,t,n,r,i){if(i&&n<=0&&r>=t.length)return t;!i&&n==0&&t.type==e.topNode&&(i=!0);for(let a=t.children.length-1;a>=0;a--){let o=t.positions[a],s=t.children[a],c;if(o<r&&s instanceof G){if(!(c=Rd(e,s,n-o,r-o,i)))break;return i?new G(t.type,t.children.slice(0,a).concat(c),t.positions.slice(0,a+1),o+c.length):c}}return null}function zd(e,t,n,r,i){for(let i of t){let t=i.from+(i.openStart?25:0),a=i.to-(i.openEnd?25:0),o=t<=n&&a>n&&Ld(e,i.tree,0-i.offset,n,a),s;if(o&&o.pos<=r&&(s=Rd(e,i.tree,n+i.offset,o.pos+i.offset,!1)))return{state:o.state,tree:s}}return{state:e.streamParser.startState(i?mu(i):4),tree:G.empty}}var Bd=class{constructor(e,t,n,r){this.lang=e,this.input=t,this.fragments=n,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let i=iu.get(),a=r[0].from,{state:o,tree:s}=zd(e,n,a,this.to,i?.state);this.state=o,this.parsedPos=this.chunkStart=a+s.length;for(let e=0;e<s.children.length;e++)this.chunks.push(s.children[e]),this.chunkPos.push(s.positions[e]);i&&this.parsedPos<i.viewport.from-1e5&&r.some(e=>e.from<=i.viewport.from&&e.to>=i.viewport.from)&&(this.state=this.lang.streamParser.startState(mu(i.state)),i.skipUntilInView(this.parsedPos,i.viewport.from),this.parsedPos=i.viewport.from),this.moveRangeIndex()}advance(){let e=iu.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),n=Math.min(t,this.chunkStart+512);for(e&&(n=Math.min(n,e.viewport.to));this.parsedPos<n;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==`12-`&&(t=``);else{let e=t.indexOf(`13-`);e>-1&&(t=t.slice(0,e))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),n=e+t.length;for(let e=this.rangeIndex;;){let r=this.ranges[e].to;if(r>=n||(t=t.slice(0,r-(n-t.length)),e++,e==this.ranges.length))break;let i=this.ranges[e].from,a=this.lineAfter(i);t+=a,n=i+a.length}return{line:t,end:n}}skipGapsTo(e,t,n){for(;;){let r=this.ranges[this.rangeIndex].to,i=e+t;if(n>0?r>i:r>=i)break;let a=this.ranges[++this.rangeIndex].from;t+=a-r}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,n,r){let i=4;if(this.ranges.length>1){r=this.skipGapsTo(t,r,1),t+=r;let e=this.chunk.length;r=this.skipGapsTo(n,r,-1),n+=r,i+=this.chunk.length-e}let a=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&i==4&&a>=0&&this.chunk[a]==e&&this.chunk[a+2]==t?this.chunk[a+2]=n:this.chunk.push(e,t,n,i),r}parseLine(e){let{line:t,end:n}=this.nextLine(),r=0,{streamParser:i}=this.lang,a=new Md(t,e?e.state.tabSize:4,e?mu(e.state):2);if(a.eol())i.blankLine(this.state,a.indentUnit);else for(;!a.eol();){let e=Vd(i.token,a,this.state);if(e&&(r=this.emitToken(this.lang.tokenTable.resolve(e),this.parsedPos+a.start,this.parsedPos+a.pos,r)),a.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=G.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Wd,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new G(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new G(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}};function Vd(e,t,n){t.start=t.pos;for(let r=0;r<10;r++){let r=e(t,n);if(t.pos>t.start)return r}throw Error(`Stream parser failed to advance stream.`)}var Hd=Object.create(null),Ud=[Xc.none],Wd=new Zc(Ud),Gd=[],Kd=Object.create(null),qd=Object.create(null);for(let[e,t]of[[`variable`,`variableName`],[`variable-2`,`variableName.special`],[`string-2`,`string.special`],[`def`,`variableName.definition`],[`tag`,`tagName`],[`attribute`,`attributeName`],[`type`,`typeName`],[`builtin`,`variableName.standard`],[`qualifier`,`modifier`],[`error`,`invalid`],[`header`,`heading`],[`property`,`propertyName`]])qd[e]=Zd(Hd,t);var Jd=class{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),qd)}resolve(e){return e?this.table[e]||(this.table[e]=Zd(this.extra,e)):0}},Yd=new Jd(Hd);function Xd(e,t){Gd.indexOf(e)>-1||(Gd.push(e),console.warn(t))}function Zd(e,t){let n=[];for(let r of t.split(` `)){let t=[];for(let n of r.split(`.`)){let r=e[n]||q[n];r?typeof r==`function`?t.length?t=t.map(r):Xd(n,`Modifier ${n} used at start of tag`):t.length?Xd(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:Xd(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,`_`),i=r+` `+n.map(e=>e.id),a=Kd[i];if(a)return a.id;let o=Kd[i]=Xc.define({id:Ud.length,name:r,props:[Ol({[r]:n})]});return Ud.push(o),o.id}function Qd(e,t){let n=Xc.define({id:Ud.length,name:`Document`,props:[Xl.add(()=>e),vu.add(()=>e=>t.getIndent(e))],top:!0});return Ud.push(n),n}I.RTL,I.LTR;var $d=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=af(e.state,n.from);return r.line?tf(e):r.block?rf(e):!1};function ef(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var tf=ef(uf,0),nf=ef(lf,0),rf=ef((e,t)=>lf(e,t,cf(t)),0);function af(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var of=50;function sf(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-of,r),o=e.sliceDoc(i,i+of),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=100?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+of),d=e.sliceDoc(i-of,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function cf(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function lf(e,t,n=t.selection.ranges){let r=n.map(e=>af(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>sf(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function uf(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=af(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var df=Ve.define(),ff=Ve.define(),pf=E.define(),mf=E.define({combine(e){return rt(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),hf=Ce.define({create(){return Pf.empty},update(e,t){let n=t.state.facet(mf),r=t.annotation(df);if(r){let i=Sf.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?Cf(o,o.length,n.minDepth,i):kf(o,t.startState.selection),new Pf(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(ff);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(We.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=Sf.fromTransaction(t),o=t.annotation(We.time),s=t.annotation(We.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new Pf(e.done.map(Sf.fromJSON),e.undone.map(Sf.fromJSON))}});function gf(e={}){return[hf,mf.of(e),H.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?vf:e.inputType==`historyRedo`?yf:null;return n?(e.preventDefault(),n(t)):!1}})]}function _f(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(hf,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var vf=_f(0,!1),yf=_f(1,!1),bf=_f(0,!0),xf=_f(1,!0),Sf=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&ce.fromJSON(t.changes),[],t.mapped&&se.fromJSON(t.mapped),t.startSelection&&T.fromJSON(t.startSelection),t.selectionsAfter.map(T.fromJSON))}static fromTransaction(t,n){let r=Df;for(let e of t.startState.facet(pf)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,Df)}static selection(t){return new e(void 0,Df,void 0,void 0,t)}};function Cf(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function wf(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function Tf(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function Ef(e,t){return e.length?t.length?e.concat(t):e:t}var Df=[],Of=200;function kf(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Of));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),Cf(e,e.length-1,1e9,n.setSelAfter(r)))}return[Sf.selection([t])]}function Af(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function jf(e,t){if(!e.length)return e;let n=e.length,r=Df;for(;n;){let i=Mf(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[Sf.selection(r)]:Df}function Mf(e,t,n){let r=Ef(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):Df,n);if(!e.changes)return Sf.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new Sf(i,D.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var Nf=/^(input\.type|delete)($|\.)/,Pf=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||Nf.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,wf(s.changes,t.changes))||r==`input.type.compose`)?Cf(o,o.length-1,i.minDepth,new Sf(t.changes.compose(s.changes),Ef(D.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,Df)):Cf(o,o.length,i.minDepth,t),new e(o,Df,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:Df;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Tf(a[a.length-1],t)?this:new e(kf(this.done,t),this.undone,n,r)}addMapping(t){return new e(jf(this.done,t),jf(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:df.of({side:e,rest:Af(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?Df:r.slice(0,r.length-1);return i.mapped&&(n=jf(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:df.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}return null}};Pf.empty=new Pf(Df,Df);var Ff=[{key:`Mod-z`,run:vf,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:yf,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:yf,preventDefault:!0},{key:`Mod-u`,run:bf,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:xf,preventDefault:!0}];function If(e,t){return T.create(e.ranges.map(t),e.mainIndex)}function Lf(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function Rf({state:e,dispatch:t},n){let r=If(e.selection,n);return!r.eq(e.selection,!0)&&(t(Lf(e,r)),!0)}function zf(e,t){return T.cursor(t?e.to:e.from)}function Bf(e,t){return Rf(e,n=>n.empty?e.moveByChar(n,t):zf(n,t))}function Y(e){return e.textDirectionAt(e.state.selection.main.head)==I.LTR}var Vf=e=>Bf(e,!Y(e)),Hf=e=>Bf(e,Y(e));function Uf(e,t){return Rf(e,n=>n.empty?e.moveByGroup(n,t):zf(n,t))}var Wf=e=>Uf(e,!Y(e)),Gf=e=>Uf(e,Y(e));typeof Intl<`u`&&Intl.Segmenter;function Kf(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function qf(e,t,n){let r=J(e).resolveInner(t.head),i=n?U.closedBy:U.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;Kf(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?Od(e,r.from,1):Od(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,T.cursor(s,n?-1:1)}var Jf=e=>Rf(e,t=>qf(e.state,t,!Y(e))),Yf=e=>Rf(e,t=>qf(e.state,t,Y(e)));function Xf(e,t){return Rf(e,n=>{if(!n.empty)return zf(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var Zf=e=>Xf(e,!1),Qf=e=>Xf(e,!0);function $f(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(H.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function ep(e,t){let n=$f(e),{state:r}=e,i=If(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):zf(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=H.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(Lf(r,i),{effects:a}),!0}var tp=e=>ep(e,!1),np=e=>ep(e,!0);function rp(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=T.cursor(r.from+n))}return i}var ip=e=>Rf(e,t=>rp(e,t,!0)),ap=e=>Rf(e,t=>rp(e,t,!1)),op=e=>Rf(e,t=>rp(e,t,!Y(e))),sp=e=>Rf(e,t=>rp(e,t,Y(e))),cp=e=>Rf(e,t=>T.cursor(e.lineBlockAt(t.head).from,1)),lp=e=>Rf(e,t=>T.cursor(e.lineBlockAt(t.head).to,-1));function up(e,t,n){let r=!1,i=If(e.selection,t=>{let i=Od(e,t.head,-1)||Od(e,t.head,1)||t.head>0&&Od(e,t.head-1,1)||t.head<e.doc.length&&Od(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?T.range(t.anchor,a):T.cursor(a)});return r?(t(Lf(e,i)),!0):!1}var dp=({state:e,dispatch:t})=>up(e,t,!1);function fp(e,t,n){let r=If(e.state.selection,e=>{e.undirectional&&e.head>=e.anchor!=t&&(e=T.range(e.head,e.anchor));let r=n(e);return T.range(e.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return!r.eq(e.state.selection)&&(e.dispatch(Lf(e.state,r)),!0)}function pp(e,t){return fp(e,t,n=>e.moveByChar(n,t))}var mp=e=>pp(e,!Y(e)),hp=e=>pp(e,Y(e));function gp(e,t){return fp(e,t,n=>e.moveByGroup(n,t))}var _p=e=>gp(e,!Y(e)),vp=e=>gp(e,Y(e)),yp=e=>{let t=!Y(e);return fp(e,t,n=>qf(e.state,n,t))},bp=e=>{let t=Y(e);return fp(e,t,n=>qf(e.state,n,t))};function xp(e,t){return fp(e,t,n=>e.moveVertically(n,t))}var Sp=e=>xp(e,!1),Cp=e=>xp(e,!0);function wp(e,t){return fp(e,t,n=>e.moveVertically(n,t,$f(e).height))}var Tp=e=>wp(e,!1),Ep=e=>wp(e,!0),Dp=e=>fp(e,!0,t=>rp(e,t,!0)),Op=e=>fp(e,!1,t=>rp(e,t,!1)),kp=e=>{let t=!Y(e);return fp(e,t,n=>rp(e,n,t))},Ap=e=>{let t=Y(e);return fp(e,t,n=>rp(e,n,t))},jp=e=>fp(e,!1,t=>T.cursor(e.lineBlockAt(t.head).from)),Mp=e=>fp(e,!0,t=>T.cursor(e.lineBlockAt(t.head).to)),Np=({state:e,dispatch:t})=>(t(Lf(e,{anchor:0})),!0),Pp=({state:e,dispatch:t})=>(t(Lf(e,{anchor:e.doc.length})),!0),Fp=({state:e,dispatch:t})=>(t(Lf(e,{anchor:e.selection.main.anchor,head:0})),!0),Ip=({state:e,dispatch:t})=>(t(Lf(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Lp=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),Rp=({state:e,dispatch:t})=>{let n=rm(e).map(({from:t,to:n})=>T.undirectionalRange(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:T.create(n),userEvent:`select`})),!0},zp=({state:e,dispatch:t})=>{let n=If(e.selection,t=>{let n=J(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return T.undirectionalRange(n.from,n.to)}return t});return!n.eq(e.selection)&&(t(Lf(e,n)),!0)};function Bp(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}if(r.head==n.head)break;n=r}}return i.length!=r.ranges.length&&(e.dispatch(Lf(n,T.create(i,i.length-1))),!0)}var Vp=e=>Bp(e,!1),Hp=e=>Bp(e,!0),Up=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=T.create([n.main]):n.main.empty||(r=T.create([T.cursor(n.main.head)])),r?(t(Lf(e,r)),!0):!1};function Wp(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=Gp(e,o,!1)):o>i&&(n=`delete.forward`,o=Gp(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=Gp(e,i,!1),a=Gp(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:T.cursor(i,i<r.head?-1:1)}});return!i.changes.empty&&(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?H.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function Gp(e,t,n){if(e instanceof H)for(let r of e.state.facet(H.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var Kp=(e,t,n)=>Wp(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=xt(s,a.tabSize)%mu(a)||mu(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=x(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=x(o.text,c-o.from,!1,!1)+o.from);return c}),qp=e=>Kp(e,!1,!0),Jp=e=>Kp(e,!0,!1),Yp=(e,t)=>Wp(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=x(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),Xp=e=>Yp(e,!1),Zp=e=>Yp(e,!0),Qp=e=>Wp(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),$p=e=>Wp(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),em=e=>Wp(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),tm=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:f.of([``,``])},range:T.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},nm=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:x(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:x(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:T.cursor(a)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function rm(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function im(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of rm(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(T.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(T.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:T.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var am=({state:e,dispatch:t})=>im(e,t,!1),om=({state:e,dispatch:t})=>im(e,t,!0);function sm(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of rm(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var cm=({state:e,dispatch:t})=>sm(e,t,!1),lm=({state:e,dispatch:t})=>sm(e,t,!0),um=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(rm(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=If(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function dm(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=J(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(U.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var fm=mm(!1),pm=mm(!0);function mm(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&dm(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new _u(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=gu(s,r);for(c??=xt(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,hu(t,c)];return o&&l.push(hu(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:f.of(l)},range:T.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function hm(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:T.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var gm=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new _u(e,{overrideIndentation:e=>n[e]??-1}),i=hm(e,(t,i,a)=>{let o=gu(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=hu(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},_m=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(hm(e,(t,n)=>{n.push({from:t.from,insert:e.facet(pu)})}),{userEvent:`input.indent`})),!0),vm=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(hm(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=xt(r,e.tabSize),a=0,o=hu(e,Math.max(0,i-mu(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),ym=e=>(e.setTabFocusMode(),!0),bm=[{key:`Ctrl-b`,run:Vf,shift:mp,preventDefault:!0},{key:`Ctrl-f`,run:Hf,shift:hp},{key:`Ctrl-p`,run:Zf,shift:Sp},{key:`Ctrl-n`,run:Qf,shift:Cp},{key:`Ctrl-a`,run:cp,shift:jp},{key:`Ctrl-e`,run:lp,shift:Mp},{key:`Ctrl-d`,run:Jp},{key:`Ctrl-h`,run:qp},{key:`Ctrl-k`,run:Qp},{key:`Ctrl-Alt-h`,run:Xp},{key:`Ctrl-o`,run:tm},{key:`Ctrl-t`,run:nm},{key:`Ctrl-v`,run:np}],xm=[{key:`ArrowLeft`,run:Vf,shift:mp,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:Wf,shift:_p,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:op,shift:kp,preventDefault:!0},{key:`ArrowRight`,run:Hf,shift:hp,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:Gf,shift:vp,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:sp,shift:Ap,preventDefault:!0},{key:`ArrowUp`,run:Zf,shift:Sp,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:Np,shift:Fp},{mac:`Ctrl-ArrowUp`,run:tp,shift:Tp},{key:`ArrowDown`,run:Qf,shift:Cp,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:Pp,shift:Ip},{mac:`Ctrl-ArrowDown`,run:np,shift:Ep},{key:`PageUp`,run:tp,shift:Tp},{key:`PageDown`,run:np,shift:Ep},{key:`Home`,run:ap,shift:Op,preventDefault:!0},{key:`Mod-Home`,run:Np,shift:Fp},{key:`End`,run:ip,shift:Dp,preventDefault:!0},{key:`Mod-End`,run:Pp,shift:Ip},{key:`Enter`,run:fm,shift:fm},{key:`Mod-a`,run:Lp},{key:`Backspace`,run:qp,shift:qp,preventDefault:!0},{key:`Delete`,run:Jp,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:Xp,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:Zp,preventDefault:!0},{mac:`Mod-Backspace`,run:$p,preventDefault:!0},{mac:`Mod-Delete`,run:em,preventDefault:!0}].concat(bm.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),Sm=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:Jf,shift:yp},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:Yf,shift:bp},{key:`Alt-ArrowUp`,run:am},{key:`Shift-Alt-ArrowUp`,run:cm},{key:`Alt-ArrowDown`,run:om},{key:`Shift-Alt-ArrowDown`,run:lm},{key:`Mod-Alt-ArrowUp`,run:Vp},{key:`Mod-Alt-ArrowDown`,run:Hp},{key:`Escape`,run:Up},{key:`Mod-Enter`,run:pm},{key:`Alt-l`,mac:`Ctrl-l`,run:Rp},{key:`Mod-i`,run:zp,preventDefault:!0},{key:`Mod-[`,run:vm},{key:`Mod-]`,run:_m},{key:`Mod-Alt-\\`,run:gm},{key:`Shift-Mod-k`,run:um},{key:`Shift-Mod-\\`,run:dp},{key:`Mod-/`,run:$d},{key:`Alt-A`,mac:`Ctrl-A`,run:nf},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:ym}].concat(xm),Cm=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,wm=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(Cm(e)):Cm,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return S(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=ie(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=ae(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n,a=!0;;e++){let n=r.charCodeAt(e),o=this.match(n,i,a,this.bufferPos+this.bufferStart,e==r.length-1);if(o)return this.value=o,this;if(e==r.length-1)break;a&&e<t.length&&t.charCodeAt(e)==n?i++:a=!1}}}match(e,t,n,r,i){let a=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],o=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?a={from:n.from,to:r,precise:i&&n.precise}:(n.index++,o=!0)),o?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?a={from:t,to:r,precise:n&&i}:this.matches.push({from:t,index:1,precise:n})),a&&this.test&&!this.test(a.from,a.to,this.buffer,this.bufferStart)&&(a=null),a}};typeof Symbol<`u`&&(wm.prototype[Symbol.iterator]=function(){return this});var Tm={from:-1,to:-1,match:/.*/.exec(``),precise:!0},Em=`gm`+(/x/.unicode==null?``:`u`),Dm=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=Tm,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new Am(e,t,n,r,i);this.re=new RegExp(t,Em+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter();let a=e.lineAt(r);this.curLineStart=a.from,this.matchPos=Mm(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=Mm(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},Om=new WeakMap,km=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=Om.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return Om.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),Om.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},Am=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=Tm,this.matchPos=Mm(e,r),this.re=new RegExp(t,Em+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=km.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,precise:!0,match:t},this.matchPos=Mm(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=km.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(Dm.prototype[Symbol.iterator]=Am.prototype[Symbol.iterator]=function(){return this});function jm(e){try{return new RegExp(e,Em),!0}catch{return!1}}function Mm(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var Nm=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=mc(e,{label:t.phrase(`Go to line`),input:{type:`text`,name:`line`,value:n},focus:!0,submitLabel:t.phrase(`go`)});return i.then(n=>{let i=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!i){e.dispatch({effects:r});return}let a=t.doc.lineAt(t.selection.main.head),[,o,s,c,l]=i,u=c?+c.slice(1):0,d=s?+s:a.number;if(s&&l){let e=d/100;o&&(e=e*(o==`-`?-1:1)+a.number/t.doc.lines),d=Math.round(t.doc.lines*e)}else s&&o&&(d=d*(o==`-`?-1:1)+a.number);let f=t.doc.line(Math.max(1,Math.min(t.doc.lines,d))),p=T.cursor(f.from+Math.max(0,Math.min(u,f.length)));e.dispatch({effects:[r,H.scrollIntoView(p.from,{y:`center`})],selection:p})}),!0},Pm={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Fm=E.define({combine(e){return rt(e,Pm,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function Im(e){let t=[Hm,Vm];return e&&t.push(Fm.of(e)),t}var Lm=F.mark({class:`cm-selectionMatch`}),Rm=F.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function zm(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=O.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=O.Word)}function Bm(e,t,n,r){return e(t.sliceDoc(n,n+1))==O.Word&&e(t.sliceDoc(r-1,r))==O.Word}var Vm=R.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Fm),{state:n}=e,r=n.selection;if(r.ranges.length>1)return F.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return F.none;let e=n.wordAt(i.head);if(!e)return F.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return F.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(zm(o,n,i.from,i.to)&&Bm(o,n,i.from,i.to)))return F.none}else if(a=n.sliceDoc(i.from,i.to),!a)return F.none}let s=[];for(let r of e.visibleRanges){let e=new wm(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||zm(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(Rm.range(r,a)):(r>=i.to||a<=i.from)&&s.push(Lm.range(r,a)),s.length>t.maxMatches))return F.none}}return F.set(s)}},{decorations:e=>e.decorations}),Hm=H.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),Um=({state:e,dispatch:t})=>{let{selection:n}=e,r=T.create(n.ranges.map(t=>e.wordAt(t.head)||T.cursor(t.head)),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)};function Wm(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new wm(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new wm(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var Gm=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return Um({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=Wm(e,r);return i?(t(e.update({selection:e.selection.addRange(T.range(i.from,i.to),!1),effects:H.scrollIntoView(i.to)})),!0):!1},Km=E.define({combine(e){return rt(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Eh(e),scrollToMatch:e=>H.scrollIntoView(e)})}}),qm=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||jm(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`14-`:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new ih(this):new Qm(this)}getCursor(e,t=0,n){let r=e.doc?e:k.create({doc:e});return n??=r.doc.length,this.regexp?eh(this,r,t,n):Xm(this,r,t,n)}},Jm=class{constructor(e){this.spec=e}};function Ym(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function Xm(e,t,n,r){let i;return e.wholeWord&&(i=Zm(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=Ym(e.test,t,i)),new wm(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function Zm(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(th(i,n-a))!=O.Word||t(nh(i,n-a))!=O.Word)&&(t(nh(i,r-a))!=O.Word||t(th(i,r-a))!=O.Word))}var Qm=class extends Jm{constructor(e){super(e)}nextMatch(e,t,n){let r=Xm(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=Xm(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=Xm(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=Xm(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=Xm(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function $m(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function eh(e,t,n,r){let i;return e.wholeWord&&(i=rh(t.charCategorizer(t.selection.main.head))),e.test&&(i=$m(e.test,t,i)),new Dm(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function th(e,t){return e.slice(x(e,t,!1),t)}function nh(e,t){return e.slice(t,x(e,t))}function rh(e){return(t,n,r)=>!r[0].length||(e(th(r.input,r.index))!=O.Word||e(nh(r.input,r.index))!=O.Word)&&(e(nh(r.input,r.index+r[0].length))!=O.Word||e(th(r.input,r.index+r[0].length))!=O.Word)}var ih=class extends Jm{nextMatch(e,t,n){let r=eh(this.spec,e,n,e.doc.length).next();return r.done&&(r=eh(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=eh(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=eh(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=eh(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},ah=D.define(),oh=D.define(),sh=Ce.define({create(e){return new ch(bh(e).create(),null)},update(e,t){for(let n of t.effects)n.is(ah)?e=new ch(n.value.create(),e.panel):n.is(oh)&&(e=new ch(e.query,n.value?yh:null));return e},provide:e=>pc.from(e,e=>e.panel)}),ch=class{constructor(e,t){this.query=e,this.panel=t}},lh=F.mark({class:`cm-searchMatch`}),uh=F.mark({class:`cm-searchMatch cm-searchMatch-selected`}),dh=R.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(sh))}update(e){let t=e.state.field(sh);(t!=e.startState.field(sh)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return F.none;let{view:n}=this,r=new ut;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?uh:lh)})}return r.finish()}},{decorations:e=>e.decorations});function fh(e){return t=>{let n=t.state.field(sh,!1);return n&&n.query.spec.valid?e(t,n):Ch(t)}}var ph=fh((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=T.single(r.from,r.to),a=e.state.facet(Km);return e.dispatch({selection:i,effects:[Ah(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),Sh(e),!0}),mh=fh((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=T.single(i.from,i.to),o=e.state.facet(Km);return e.dispatch({selection:a,effects:[Ah(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),Sh(e),!0}),hh=fh((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:T.create(n.map(e=>T.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),gh=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new wm(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(T.range(t.value.from,t.value.to))}return t(e.update({selection:T.create(a,o),userEvent:`select.search.matches`})),!0},_h=fh((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];o.precise?o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=t.nextMatch(n,o.from,o.to),u.push(H.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`))):o=t.nextMatch(n,o.from,o.to);let d=e.state.changes(s);return o&&(c=T.single(o.from,o.to).map(d),u.push(Ah(e,o)),u.push(n.facet(Km).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effects:u,userEvent:`input.replace`}),!0}),vh=fh((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:e,to:i,precise:a}=r;a&&n.push({from:e,to:i,insert:t.getReplacement(r)})}if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:H.announce.of(r),userEvent:`input.replace.all`}),!0});function yh(e){return e.state.facet(Km).createPanel(e)}function bh(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(Km);return new qm({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function xh(e){let t=lc(e,yh);return t&&t.dom.querySelector(`[main-field]`)}function Sh(e){let t=xh(e);t&&t==e.root.activeElement&&t.select()}var Ch=e=>{let t=e.state.field(sh,!1);if(t&&t.panel){let n=xh(e);if(n&&n!=e.root.activeElement){let r=bh(e.state,t.query.spec);r.valid&&e.dispatch({effects:ah.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[oh.of(!0),t?ah.of(bh(e.state,t.query.spec)):D.appendConfig.of(Mh)]});return!0},wh=e=>{let t=e.state.field(sh,!1);if(!t||!t.panel)return!1;let n=lc(e,yh);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:oh.of(!1)}),!0},Th=[{key:`Mod-f`,run:Ch,scope:`editor search-panel`},{key:`F3`,run:ph,shift:mh,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:ph,shift:mh,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:wh,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:gh},{key:`Mod-Alt-g`,run:Nm},{key:`Mod-d`,run:Gm,preventDefault:!0}],Eh=class{constructor(e){this.view=e;let t=this.query=e.state.field(sh).query.spec;this.commit=this.commit.bind(this),this.searchField=M(`input`,{value:t.search,placeholder:Dh(e,`Find`),"aria-label":Dh(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=M(`input`,{value:t.replace,placeholder:Dh(e,`Replace`),"aria-label":Dh(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=M(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=M(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=M(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return M(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=M(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>ph(e),[Dh(e,`next`)]),n(`prev`,()=>mh(e),[Dh(e,`previous`)]),n(`select`,()=>hh(e),[Dh(e,`all`)]),M(`label`,null,[this.caseField,Dh(e,`match case`)]),M(`label`,null,[this.reField,Dh(e,`regexp`)]),M(`label`,null,[this.wordField,Dh(e,`by word`)]),...e.state.readOnly?[]:[M(`br`),this.replaceField,n(`replace`,()=>_h(e),[Dh(e,`replace`)]),n(`replaceAll`,()=>vh(e),[Dh(e,`replace all`)])],M(`button`,{name:`close`,onclick:()=>wh(e),"aria-label":Dh(e,`close`),type:`button`},[`×`])])}commit(){let e=new qm({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:ah.of(e)}))}keydown(e){Bo(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?mh:ph)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),_h(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(ah)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Km).top}};function Dh(e,t){return e.state.phrase(t)}var Oh=30,kh=/[\s\.,:;?!]/;function Ah(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-Oh),o=Math.min(i,n+Oh),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<Oh;e++)if(!kh.test(s[e+1])&&kh.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-Oh;e--)if(!kh.test(s[e-1])&&kh.test(s[e])){s=s.slice(0,e);break}}return H.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var jh=H.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),Mh=[sh,Ee.low(dh),jh],Nh=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=J(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(Bh(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function Ph(e){let t=Object.keys(e).join(``),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,``)),`[${n?`\\w`:``}${t.replace(/[^\w\s]/g,`\\$&`)}]`}function Fh(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=Ph(t)+Ph(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function Ih(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:Fh(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function Lh(e,t){return n=>{for(let t=J(n.state).resolveInner(n.pos,-1);t;t=t.parent){if(e.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return t(n)}}var Rh=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function zh(e){return e.selection.main.from}function Bh(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var Vh=Ve.define();function Hh(e,t,n,r){let{main:i}=e.selection,a=n-i.from,o=r-i.from;return{...e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+o)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+o,insert:c},range:T.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:`input.complete`}}var Uh=new WeakMap;function Wh(e){if(!Array.isArray(e))return e;let t=Uh.get(e);return t||Uh.set(e,t=Ih(e)),t}var Gh=D.define(),Kh=D.define(),qh=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=S(e,t),r=ae(n);this.chars.push(n);let i=e.slice(t,t+r),a=i.toUpperCase();this.folded.push(S(a==i?i.toLowerCase():a,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:a}=this;if(t.length==1){let r=S(e,0),i=ae(r),a=i==e.length?0:-100;if(r!=t[0]){if(r==n[0])a+=-200;else return null}return this.ret(a,[0,i])}let o=e.indexOf(this.pattern);if(o==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let s=t.length,c=0;if(o<0){for(let i=0,a=Math.min(e.length,200);i<a&&c<s;){let a=S(e,i);(a==t[c]||a==n[c])&&(r[c++]=i),i+=ae(a)}if(c<s)return null}let l=0,u=0,d=!1,f=0,p=-1,m=-1,h=/[a-z]/.test(e),g=!0;for(let r=0,c=Math.min(e.length,200),_=0;r<c&&u<s;){let c=S(e,r);o<0&&(l<s&&c==t[l]&&(i[l++]=r),f<s&&(c==t[f]||c==n[f]?(f==0&&(p=r),m=r+1,f++):f=0));let v,y=c<255?c>=48&&c<=57||c>=97&&c<=122?2:+(c>=65&&c<=90):(v=ie(c))==v.toLowerCase()?v==v.toUpperCase()?0:2:1;(!r||y==1&&h||_==0&&y!=0)&&(t[u]==c||n[u]==c&&(d=!0)?a[u++]=r:a.length&&(g=!1)),_=y,r+=ae(c)}return u==s&&a[0]==0&&g?this.result(-100+(d?-200:0),a,e):f==s&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):f==s?this.ret(-900-e.length,[p,m]):u==s?this.result(-100+(d?-200:0)+-700+(g?0:-1100),a,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?ae(S(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}},Jh=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},X=E.define({combine(e){return rt(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>``,optionClass:()=>``,aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Xh,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>Yh(e(n),t(n)),optionClass:(e,t)=>n=>Yh(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function Yh(e,t){return e?t?e+` `+t:e:t}function Xh(e,t,n,r,i,a){let o=e.textDirection==I.RTL,s=o,c=!1,l=`top`,u,d,f=t.left-i.left,p=i.right-t.right,m=r.right-r.left,h=r.bottom-r.top;if(s&&f<Math.min(m,p)?s=!1:!s&&p<Math.min(m,f)&&(s=!0),m<=(s?f:p))u=Math.max(i.top,Math.min(n.top,i.bottom-h))-t.top,d=Math.min(400,s?f:p);else{c=!0,d=Math.min(400,(o?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=h||e>t.top?u=n.bottom-t.top:(l=`bottom`,u=t.bottom-n.top)}let g=(t.bottom-t.top)/a.offsetHeight,_=(t.right-t.left)/a.offsetWidth;return{style:`${l}: ${u/g}px; max-width: ${d/_}px`,class:`cm-completionInfo-`+(c?o?`left-narrow`:`right-narrow`:s?`left`:`right`)}}var Zh=D.define();function Qh(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement(`div`);return t.classList.add(`cm-completionIcon`),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>`cm-completionIcon-`+e)),t.setAttribute(`aria-hidden`,`true`),t},position:20}),t.push({render(e,t,n,r){let i=document.createElement(`span`);i.className=`cm-completionLabel`;let a=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(a.slice(o,t)));let s=i.appendChild(document.createElement(`span`));s.appendChild(document.createTextNode(a.slice(t,n))),s.className=`cm-completionMatchedText`,o=n}return o<a.length&&i.appendChild(document.createTextNode(a.slice(o))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement(`span`);return t.className=`cm-completionDetail`,t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}function $h(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.ceil((e-t)/n);return{from:e-r*n,to:e-(r-1)*n}}var eg=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass=``;let r=e.state.field(t),{options:i,selected:a}=r.open,o=e.state.facet(X);this.optionContent=Qh(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=$h(i.length,a,o.maxRenderedOptions),this.dom=document.createElement(`div`),this.dom.className=`cm-tooltip-autocomplete`,this.updateTooltipClass(e.state),this.dom.addEventListener(`mousedown`,n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if(t.nodeName==`LI`&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains(`cm-completionListIncompleteTop`)&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains(`cm-completionListIncompleteBottom`)&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;t!=null&&(e.dispatch({effects:Zh.of(t)}),n.preventDefault())}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(X).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:Kh.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(`scroll`,()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:r,selected:i,disabled:a}=t.open;(!n.open||n.open.options!=r)&&(this.range=$h(r.length,i,e.state.facet(X).maxRenderedOptions),this.showOptions(r,t.id)),this.updateSel(),a!=n.open?.disabled&&this.dom.classList.toggle(`cm-tooltip-autocomplete-disabled`,!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(` `))e&&this.dom.classList.remove(e);for(let e of t.split(` `))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=$h(t.options.length,t.selected,this.view.state.facet(X).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let a=typeof i==`string`?document.createTextNode(i):i(r);if(!a)return;`then`in a?a.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>yr(this.view.state,e,`completion info`)):(this.addInfoPane(a,r),n.setAttribute(`aria-describedby`,this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement(`div`);if(n.className=`cm-tooltip cm-completionInfo`,n.id=`cm-completionInfo-`+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!=`LI`||!n.id?r--:r==e?n.hasAttribute(`aria-selected`)||(n.setAttribute(`aria-selected`,`true`),t=n):n.hasAttribute(`aria-selected`)&&(n.removeAttribute(`aria-selected`),n.removeAttribute(`aria-describedby`));return t&&ng(this.list,t),t}measureInfo(){let e=this.dom.querySelector(`[aria-selected]`);if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(X).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className=`cm-tooltip cm-completionInfo `+(e.class||``)):this.info.style.cssText=`top: -1e6px`)}createListBox(e,t,n){let r=document.createElement(`ul`);r.id=t,r.setAttribute(`role`,`listbox`),r.setAttribute(`aria-expanded`,`true`),r.setAttribute(`aria-label`,this.view.state.phrase(`Completions`)),r.addEventListener(`mousedown`,e=>{e.target==r&&e.preventDefault()});let i=null;for(let a=n.from;a<n.to;a++){let{completion:o,match:s}=e[a],{section:c}=o;if(c){let e=typeof c==`string`?c:c.name;if(e!=i&&(a>n.from||n.from==0)){if(i=e,typeof c!=`string`&&c.header)r.appendChild(c.header(c));else{let t=r.appendChild(document.createElement(`completion-section`));t.textContent=e}}}let l=r.appendChild(document.createElement(`li`));l.id=t+`-`+a,l.setAttribute(`role`,`option`);let u=this.optionClass(o);u&&(l.className=u);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,s);t&&l.appendChild(t)}}return n.from&&r.classList.add(`cm-completionListIncompleteTop`),n.to<e.length&&r.classList.add(`cm-completionListIncompleteBottom`),r}destroyInfo(){this.info&&=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null)}destroy(){this.destroyInfo()}};function tg(e,t){return n=>new eg(n,e,t)}function ng(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function rg(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+ +!!e.type}function ig(e,t){let n=[],r=null,i=null,a=e=>{n.push(e);let{section:t}=e.completion;if(t){r||=[];let e=typeof t==`string`?t:t.name;r.some(t=>t.name==e)||r.push(typeof t==`string`?{name:e}:t)}},o=t.facet(X);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(r.result.filter===!1)for(let t of r.result.options)a(new Rh(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),s,c=o.filterStrict?new Jh(n):new qh(n);for(let t of r.result.options)if(s=c.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched,o=s.score+(t.boost||0);if(a(new Rh(t,r.source,n,o)),typeof t.section==`object`&&t.section.rank===`dynamic`){let{name:e}=t.section;i||=Object.create(null),i[e]=Math.max(o,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,a=(e,t)=>(e.rank===`dynamic`&&t.rank===`dynamic`?i[t.name]-i[e.name]:0)||(typeof e.rank==`number`?e.rank:1e9)-(typeof t.rank==`number`?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(a))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e[typeof n==`string`?n:n.name])}}let s=[],c=null,l=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||l(e.completion,t.completion))){let t=e.completion;!c||c.label!=t.label||c.detail!=t.detail||c.type!=null&&t.type!=null&&c.type!=t.type||c.apply!=t.apply||c.boost!=t.boost?s.push(e):rg(e.completion)>rg(c)&&(s[s.length-1]=e),c=e.completion}return s}var ag=class e{constructor(e,t,n,r,i,a){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new e(this.options,ug(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,o){if(i&&!o&&t.some(e=>e.isPending))return i.setDisabled();let s=ig(t,n);if(!s.length)return i&&t.some(e=>e.isPending)?i.setDisabled():null;let c=n.facet(X).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){c=t;break}}return new e(s,ug(r,c),{pos:t.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:yg,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new e(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new e(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},og=class e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new e(dg,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(X),i=(r.override||n.languageDataAt(`autocomplete`,zh(n)).map(Wh)).map(e=>(this.active.find(t=>t.source==e)||new pg(e,+!!this.active.some(e=>e.state!=0))).update(t,r));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let a=this.open,o=t.effects.some(e=>e.is(gg));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!sg(i,this.active)||o?a=ag.build(i,n,this.id,a,r,o):a&&a.disabled&&!i.some(e=>e.isPending)&&(a=null),!a&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new pg(e.source,0):e));for(let e of t.effects)e.is(Zh)&&(a&&=a.setSelected(e.value,this.id));return i==this.active&&a==this.open?this:new e(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?cg:lg}};function sg(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}var cg={"aria-autocomplete":`list`},lg={};function ug(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}var dg=[];function fg(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(Vh);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent(`input.type`);return n&&t.activateOnTyping?5:n?1:e.isUserEvent(`delete.backward`)?2:e.selection?8:e.docChanged?16:0}var pg=class e{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=fg(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new e(i.source,0)),r&4&&i.state==0&&(i=new e(this.source,1)),i=i.updateFor(t,r);for(let n of t.effects)if(n.is(Gh))i=new e(i.source,1,n.value);else if(n.is(Kh))i=new e(i.source,0);else if(n.is(gg))for(let e of n.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(zh(e.state))}},mg=class e extends pg{constructor(e,t,n,r,i,a){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=a}hasResult(){return!0}updateFor(t,n){if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let i=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),o=zh(t.state);if(o>a||!r||n&2&&(zh(t.startState)==this.from||o<this.limit))return new pg(this.source,n&4?1:0);let s=t.changes.mapPos(this.limit);return hg(r.validFor,t.state,i,a)?new e(this.source,this.explicit,s,r,i,a):r.update&&(r=r.update(r,i,a,new Nh(t.state,o,!1)))?new e(this.source,this.explicit,s,r,r.from,r.to??zh(t.state)):new pg(this.source,1,this.explicit)}map(t){if(t.empty)return this;let n=this.result.map?this.result.map(this.result,t):this.result;return n?new e(this.source,this.explicit,t.mapPos(this.limit),n,t.mapPos(this.from),t.mapPos(this.to,1)):new pg(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function hg(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):Bh(e,!0).test(i)}var gg=D.define({map(e,t){return e.map(e=>e.map(t))}}),_g=Ce.define({create(){return og.start()},update(e,t){return e.update(t)},provide:e=>[Ys.from(e,e=>e.tooltip),H.contentAttributes.from(e,e=>e.attrs)]});function vg(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(_g).active.find(e=>e.source==t.source);return r instanceof mg&&(typeof n==`string`?e.dispatch({...Hh(e.state,n,r.from,r.to),annotations:Vh.of(t.completion)}):n(e,t.completion,r.from,r.to),!0)}var yg=tg(_g,vg);function bg(e,t=`option`){return n=>{let r=n.state.field(_g,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(X).interactionDelay)return!1;let i=1,a;t==`page`&&(a=oc(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(a.dom.offsetHeight/a.dom.querySelector(`li`).offsetHeight)-1));let{length:o}=r.open.options,s=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:o-1;return s<0?s=t==`page`?0:o-1:s>=o&&(s=t==`page`?o-1:0),n.dispatch({effects:Zh.of(s)}),!0}}var xg=e=>{let t=e.state.field(_g,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(X).interactionDelay?!1:vg(e,t.open.options[t.open.selected])},Sg=e=>e.state.field(_g,!1)?(e.dispatch({effects:Gh.of(!0)}),!0):!1,Cg=e=>{let t=e.state.field(_g,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(e.dispatch({effects:Kh.of(null)}),!0)},wg=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},Tg=50,Eg=1e3,Dg=R.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(_g).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(_g),n=e.state.facet(X);if(!e.selectionSet&&!e.docChanged&&e.startState.field(_g)==t)return;let r=e.transactions.some(e=>{let t=fg(e,n);return t&8||(e.selection||e.docChanged)&&!(t&3)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>Tg&&Date.now()-n.time>Eg){for(let e of n.context.abortListeners)try{e()}catch(e){yr(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(Gh)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let t of e.transactions)t.isUserEvent(`input.type`)?this.composing=2:this.composing==2&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(_g);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(X).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new Nh(t,zh(t),e.explicit,this.view),r=new wg(e,n);this.running.push(r),Promise.resolve(e.source(n)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:Kh.of(null)}),yr(this.view.state,e)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(X).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(X),n=this.view.state.field(_g);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let n=zh(i.updates.length?i.updates[0].startState:this.view.state),r=Math.min(n,i.done.from+ +!i.active.explicit),a=new mg(i.active.source,i.active.explicit,r,i.done,i.done.from,i.done.to??n);for(let e of i.updates)a=a.update(e,t);if(a.hasResult()){e.push(a);continue}}let a=n.active.find(e=>e.source==i.active.source);if(a&&a.isPending){if(i.done==null){let n=new pg(i.active.source,0);for(let e of i.updates)n=n.update(e,t);n.isPending||e.push(n)}else this.startQuery(a)}}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:gg.of(e)})}},{eventHandlers:{blur(e){let t=this.view.state.field(_g,!1);if(t&&t.tooltip&&this.view.state.facet(X).closeOnBlur){let n=t.open&&oc(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Kh.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Gh.of(!1)}),20),this.composing=0}}}),Og=typeof navigator==`object`&&/Win/.test(navigator.platform),kg=Ee.highest(H.domEventHandlers({keydown(e,t){let n=t.state.field(_g,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(Og&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&vg(t,r),!1}})),Ag=H.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`,cursor:`pointer`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),jg={brackets:[`(`,`[`,`{`,`'`,`"`],before:`)]}:;>`,stringPrefixes:[]},Mg=D.define({map(e,t){return t.mapPos(e,-1,C.TrackAfter)??void 0}}),Ng=new class extends it{};Ng.startSide=1,Ng.endSide=-1;var Pg=Ce.define({create(){return A.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(Mg)&&(e=e.update({add:[Ng.range(n.value,n.value+1)]}));return e}});function Fg(){return[Bg,Pg]}var Ig=`()[]{}<>«»»«[]{}`;function Lg(e){for(let t=0;t<16;t+=2)if(Ig.charCodeAt(t)==e)return Ig.charAt(t+1);return ie(e<128?e:e+1)}function Rg(e,t){return e.languageDataAt(`closeBrackets`,t)[0]||jg}var zg=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),Bg=H.inputHandler.of((e,t,n,r)=>{if((zg?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&ae(S(r,0))==1||t!=i.from||n!=i.to)return!1;let a=Hg(e.state,r);return a?(e.dispatch(a),!0):!1}),Vg=[{key:`Backspace`,run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Rg(e,e.selection.main.head).brackets||jg.brackets,r=null,i=e.changeByRange(t=>{if(t.empty){let r=Gg(e.doc,t.head);for(let i of n)if(i==r&&Wg(e.doc,t.head)==Lg(S(i,0)))return{changes:{from:t.head-i.length,to:t.head+i.length},range:T.cursor(t.head-i.length)}}return{range:r=t}});return r||t(e.update(i,{scrollIntoView:!0,userEvent:`delete.backward`})),!r}}];function Hg(e,t){let n=Rg(e,e.selection.main.head),r=n.brackets||jg.brackets;for(let i of r){let a=Lg(S(i,0));if(t==i)return a==i?Jg(e,i,r.indexOf(i+i+i)>-1,n):Kg(e,i,a,n.before||jg.before);if(t==a&&Ug(e,e.selection.main.from))return qg(e,i,a)}return null}function Ug(e,t){let n=!1;return e.field(Pg).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function Wg(e,t){let n=e.sliceString(t,t+2);return n.slice(0,ae(S(n,0)))}function Gg(e,t){let n=e.sliceString(t-2,t);return ae(S(n,0))==n.length?n:n.slice(1)}function Kg(e,t,n,r){let i=null,a=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],effects:Mg.of(a.to+t.length),range:T.range(a.anchor+t.length,a.head+t.length)};let o=Wg(e.doc,a.head);return!o||/\s/.test(o)||r.indexOf(o)>-1?{changes:{insert:t+n,from:a.head},effects:Mg.of(a.head+t.length),range:T.cursor(a.head+t.length)}:{range:i=a}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:`input.type`})}function qg(e,t,n){let r=null,i=e.changeByRange(t=>t.empty&&Wg(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:T.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(i,{scrollIntoView:!0,userEvent:`input.type`})}function Jg(e,t,n,r){let i=r.stringPrefixes||jg.stringPrefixes,a=null,o=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:Mg.of(r.to+t.length),range:T.range(r.anchor+t.length,r.head+t.length)};let o=r.head,s=Wg(e.doc,o),c;if(s==t){if(Yg(e,o))return{changes:{insert:t+t,from:o},effects:Mg.of(o+t.length),range:T.cursor(o+t.length)};if(Ug(e,o)){let r=n&&e.sliceDoc(o,o+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:o,to:o+r.length,insert:r},range:T.cursor(o+r.length)}}}else if(n&&e.sliceDoc(o-2*t.length,o)==t+t&&(c=Zg(e,o-2*t.length,i))>-1&&Yg(e,c))return{changes:{insert:t+t+t+t,from:o},effects:Mg.of(o+t.length),range:T.cursor(o+t.length)};else if(e.charCategorizer(o)(s)!=O.Word&&Zg(e,o,i)>-1&&!Xg(e,o,t,i))return{changes:{insert:t+t,from:o},effects:Mg.of(o+t.length),range:T.cursor(o+t.length)};return{range:a=r}});return a?null:e.update(o,{scrollIntoView:!0,userEvent:`input.type`})}function Yg(e,t){let n=J(e).resolveInner(t+1);return n.parent&&n.from==t}function Xg(e,t,n,r){let i=J(e).resolveInner(t,-1),a=r.reduce((e,t)=>Math.max(e,t.length),0);for(let o=0;o<5;o++){let o=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+a)),s=o.indexOf(n);if(!s||s>-1&&r.indexOf(o.slice(0,s))>-1){let t=i.firstChild;for(;t&&t.from==i.from&&t.to-t.from>n.length+s;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let c=i.to==t&&i.parent;if(!c)break;i=c}return!1}function Zg(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=O.Word)return t;for(let i of n){let n=t-i.length;if(e.sliceDoc(n,t)==i&&r(e.sliceDoc(n-1,n))!=O.Word)return n}return-1}function Qg(e={}){return[kg,_g,X.of(e),Dg,e_,Ag]}var $g=[{key:`Ctrl-Space`,run:Sg},{mac:"Alt-`",run:Sg},{mac:`Alt-i`,run:Sg},{key:`Escape`,run:Cg},{key:`ArrowDown`,run:bg(!0)},{key:`ArrowUp`,run:bg(!1)},{key:`PageDown`,run:bg(!0,`page`)},{key:`PageUp`,run:bg(!1,`page`)},{key:`Enter`,run:xg}],e_=Ee.highest(Lo.computeN([X],e=>e.facet(X).defaultKeymap?[$g]:[])),t_=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},n_=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(g_).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new ut,s=[],c=0,l=r.doc.iter(),u=0,d=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>d)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,d);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==d))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=D_(s);if(i)o.add(n,n,F.widget({widget:new b_(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,F.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==d)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let f=o.finish();return new e(f,n,r_(f))}};function r_(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0)){if(!r)r=new t_(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new t_(r.from,n,r.diagnostic)}}),r}function i_(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(g_).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(o_))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function a_(e,t){return e.field(l_,!1)?t:t.concat(D.appendConfig.of(k_))}var o_=D.define(),s_=D.define(),c_=D.define(),l_=Ce.define({create(){return new n_(F.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=r_(n,e.selected.diagnostic,i)||r_(n,null,i)}!n.size&&i&&t.state.facet(g_).autoPanel&&(i=null),e=new n_(n,i,r)}for(let n of t.effects)if(n.is(o_)){let r=t.state.facet(g_).autoPanel?n.value.length?S_.open:null:e.panel;e=n_.init(n.value,r,t.state)}else n.is(s_)?e=new n_(e.diagnostics,n.value?S_.open:null,e.selected):n.is(c_)&&(e=new n_(e.diagnostics,e.panel,n.value));return e},provide:e=>[pc.from(e,e=>e.panel),H.decorations.from(e,e=>e.diagnostics)]}),u_=F.mark({class:`cm-lintRange cm-lintRange-active`});function d_(e,t,n){let{diagnostics:r}=e.state.field(l_),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(g_).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:!0,create(){return{dom:f_(e,i)}}}:null}function f_(e,t){return M(`ul`,{class:`cm-tooltip-lint`},t.map(t=>y_(e,t,!1)))}var p_=e=>{let t=e.state.field(l_,!1);(!t||!t.panel)&&e.dispatch({effects:a_(e.state,[s_.of(!0)])});let n=lc(e,S_.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},m_=e=>{let t=e.state.field(l_,!1);return!t||!t.panel?!1:(e.dispatch({effects:s_.of(!1)}),!0)},h_=[{key:`Mod-Shift-m`,run:p_,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(l_,!1);if(!t)return!1;let n=e.state.selection.main,r=r_(t.diagnostics,null,n.to+1);return!r&&(r=r_(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),ac(e,r.from,1,{tooltip:O_,until:e=>e.docChanged||e.newSelection.main.head<r.from||e.newSelection.main.head>r.to}),!0)}}],g_=E.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...rt(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:__,tooltipFilter:__,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function __(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function v_(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function y_(e,t,n){let r=n?v_(t.actions):[];return M(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},M(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=r_(e.state.field(l_).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),M(`u`,s.slice(c,c+1)),s.slice(c+1)];return M(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&M(`div`,{class:`cm-diagnosticSource`},t.source))}var b_=class extends en{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return M(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},x_=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=y_(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},S_=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)m_(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=v_(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=r_(this.view.state.field(l_).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=M(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=M(`div`,{class:`cm-panel-lint`},this.list,M(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>m_(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(l_).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(l_),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new x_(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new x_(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=r_(this.view.state.field(l_).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:c_.of(t)})}static open(t){return new e(t)}};function C_(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function w_(e){return C_(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var T_=H.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:w_(`#f11`)},".cm-lintRange-warning":{backgroundImage:w_(`orange`)},".cm-lintRange-info":{backgroundImage:w_(`#999`)},".cm-lintRange-hint":{backgroundImage:w_(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function E_(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function D_(e){let t=`hint`,n=1;for(let r of e){let e=E_(r.severity);e>n&&(n=e,t=r.severity)}return t}var O_=ic(d_,{hideOn:i_}),k_=[l_,H.decorations.compute([l_],e=>{let{selected:t,panel:n}=e.field(l_);return!t||!n||t.from==t.to?F.none:F.set([u_.range(t.from,t.to)])}),O_,T_],A_=[Bc(),Wc(),xs(),gf(),ad(),ts(),ds(),k.allowMultipleSelections.of(!0),ju(),dd(md,{fallback:!0}),wd(),Fg(),Qg(),Is(),zs(),Os(),Im(),Lo.of([...Vg,...Sm,...Th,...Ff,...Xu,...$g,...h_])],j_=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new M_(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){n<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from;n<r.minRepeatTerm&&s==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&this.buffer[e-4]==0&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new N_(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216)){if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new M_(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},M_=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},N_=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},P_=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new e(this.stack,this.pos,this.index)}};function F_(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var I_=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},L_=new I_,R_=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=L_,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.next=this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?-1:this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=``,this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=L_,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},z_=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;H_(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};z_.prototype.contextual=z_.prototype.fallback=z_.prototype.extend=!1;var B_=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?F_(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(H_(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};B_.prototype.contextual=z_.prototype.fallback=z_.prototype.extend=!1;var V_=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function H_(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;scan:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||W_(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535){o=e[n+u*3-1];continue scan}for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue scan}}break}}function U_(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function W_(e,t,n,r){let i=U_(n,r,t);return i<0||U_(n,r,e)<i}var G_=typeof process<`u`&&/\bparse\b/.test({}.LOG),K_=null;function q_(e,t,n){let r=e.cursor(W.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}var J_=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?q_(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?q_(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],a=this.start[t]+n.positions[r];if(a>e)return this.nextStart=a,null;if(i instanceof G){if(a==e){if(a<this.safeFrom)return null;let e=a+i.length;if(e<=this.safeTo){let t=i.prop(U.lookAhead);if(!t||e+t<this.fragment.to)return i}}this.index[t]++,a+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+i.length}}},Y_=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new I_)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let c=i[r],l=this.tokens[r];if(!(n&&!c.fallback)&&((c.contextual||l.start!=e.pos||l.mask!=a||l.context!=o)&&(this.updateCachedToken(l,c,e),l.mask=a,l.context=o),l.lookAhead>l.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new I_,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new I_,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535){if(o[s+1]==1)s=nv(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(nv(o,s+2),t,n,r));break}}o[s]==t&&(r=this.putAction(nv(o,s+1),t,n,r))}return r}},X_=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new R_(t,r),this.tokens=new Y_(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[j_.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new J_(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&rv(r);if(e)return G_&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw G_&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return G_&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){outer:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500){if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue outer}}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=G_?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let o=this.fragments.nodeAt(r);o;){let r=this.parser.nodeSet.types[o.type.id]==o.type?i.getGoto(e.state,o.type.id):-1;if(r>-1&&o.length&&(!t||(o.prop(U.contextHash)||0)==n))return e.useNode(o,r),G_&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(o.type.id)})`),!0;if(!(o instanceof G)||o.children.length==0||o.positions[0]>0)break;let s=o.children[0];if(s instanceof G&&o.positions[0]==0)o=s;else break}}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),G_&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;o<s.length;){let c=s[o++],l=s[o++],u=s[o++],d=o==s.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(c,l,p?p.start:f.pos,u),G_&&console.log(a+this.stackID(f)+` (via ${c&65536?`reduce of ${i.getName(c&65535)}`:`shift`} for ${i.getName(l)} @ ${r}${f==e?``:`, split`})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return Z_(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=G_?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),G_&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(G_&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)G_&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))G_&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),G_&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),Z_(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),G.build({buffer:P_.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(K_||=new WeakMap).get(e);return t||K_.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function Z_(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}var Q_=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},$_=e=>e,ev=class{constructor(e){this.start=e.start,this.shift=e.shift||$_,this.reduce=e.reduce||$_,this.reuse=e.reuse||$_,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},tv=class e extends bl{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(` `);this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push(``);let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];typeof e==`string`&&(e=U[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let a=t[n+-r];for(let o=-r;o>0;o--)i(t[n++],e,a);n++}}}this.nodeSet=new Zc(t.map((t,i)=>Xc.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:i==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Gc;let a=F_(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(iv),this.states=F_(e.states,Uint32Array),this.data=F_(e.stateData),this.goto=F_(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>typeof e==`number`?new z_(a,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new X_(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535){if(n[i+1]==1)a=n[i=nv(n,i+2)];else if(n[i+1]==2)return nv(n,i+2);else break}if(a==t||a==0)return nv(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=nv(this.data,n+2);else break}r=t(nv(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=nv(this.data,n+2);else break}if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(t){let n=Object.assign(Object.create(e.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let e=this.topRules[t.top];if(!e)throw RangeError(`Invalid top rule name ${t.top}`);n.top=e}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(e=>{let n=t.tokenizers.find(t=>t.from==e);return n?n.to:e})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((e,r)=>{let i=t.specializers.find(t=>t.from==e.external);if(!i)return e;let a=Object.assign(Object.assign({},e),{external:i.to});return n.specializers[r]=iv(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new Q_(e,n,r)}static deserialize(t){return new e(t)}};function nv(e,t){return e[t]|e[t+1]<<16}function rv(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function iv(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}var av=Ol({String:q.string,Number:q.number,"True False":q.bool,PropertyName:q.propertyName,Null:q.null,", :":q.separator,"[ ]":q.squareBracket,"{ }":q.brace}),ov=tv.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:`#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O`,goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:`⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array`,maxTerm:25,nodeProps:[[`isolate`,-2,6,11,``],[`openedBy`,7,`{`,14,`[`],[`closedBy`,8,`}`,15,`]`]],propSources:[av],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),sv=tu.define({name:`json`,parser:ov.configure({props:[vu.add({Object:ku({except:/^\s*\}/}),Array:ku({except:/^\s*\]/})}),Nu.add({"Object Array":Pu})]}),languageData:{closeBrackets:{brackets:[`[`,`{`,`"`]},indentOnInput:/^\s*[\}\]]$/}});function cv(){return new du(sv)}var lv=36,uv=1,dv=2,fv=3,pv=4,mv=5,hv=6,gv=7,_v=8,vv=9,yv=10,bv=11,xv=12,Sv=13,Cv=14,wv=15,Tv=16,Ev=17,Dv=18,Ov=19,kv=20,Av=21,jv=22,Mv=23,Nv=24;function Pv(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function Fv(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function Iv(e,t,n){for(let r=!1;;){if(e.next<0)return;if(e.next==t&&!r){e.advance();return}r=n&&!r&&e.next==92,e.advance()}}function Lv(e,t){scan:for(;;){if(e.next<0)return;if(e.next==36){e.advance();for(let n=0;n<t.length;n++){if(e.next!=t.charCodeAt(n))continue scan;e.advance()}if(e.next==36){e.advance();return}}else e.advance()}}function Rv(e,t){let n=`[{<(`.indexOf(String.fromCharCode(t)),r=n<0?t:`]}>)`.charCodeAt(n);for(;;){if(e.next<0)return;if(e.next==r&&e.peek(1)==39){e.advance(2);return}e.advance()}}function zv(e,t){for(;!(e.next!=95&&!Pv(e.next));)t!=null&&(t+=String.fromCharCode(e.next)),e.advance();return t}function Bv(e){if(e.next==39||e.next==34||e.next==96){let t=e.next;e.advance(),Iv(e,t,!1)}else zv(e)}function Vv(e,t){for(;e.next==48||e.next==49;)e.advance();t&&e.next==t&&e.advance()}function Hv(e,t){for(;;){if(e.next==46){if(t)break;t=!0}else if(e.next<48||e.next>57)break;e.advance()}if(e.next==69||e.next==101)for(e.advance(),(e.next==43||e.next==45)&&e.advance();e.next>=48&&e.next<=57;)e.advance()}function Uv(e){for(;!(e.next<0||e.next==10);)e.advance()}function Wv(e,t){for(let n=0;n<t.length;n++)if(t.charCodeAt(n)==e)return!0;return!1}var Gv=` \r15-`;function Kv(e,t,n){let r=Object.create(null);r.true=r.false=mv,r.null=r.unknown=hv;for(let t of e.split(` `))t&&(r[t]=kv);for(let e of t.split(` `))e&&(r[e]=Av);for(let e of(n||``).split(` `))e&&(r[e]=Nv);return r}var qv=`array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying `,Jv=`absolute action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded case cast catalog check close collate collation column commit condition connect connection constraint constraints constructor continue corresponding count create cross cube current current_date current_default_transform_group current_transform_group_for_type current_path current_role current_time current_timestamp current_user cursor cycle data day deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exists exit external fetch first for foreign found from free full function general get global go goto grant group grouping handle having hold hour identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local localtime localtimestamp locator loop map match method minute modifies module month names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search second section select session session_user set sets signal similar size some space specific specifictype sql sqlexception sqlstate sqlwarning start state static system_user table temporary then timezone_hour timezone_minute to trailing transaction translation treat trigger under undo union unique unnest until update usage user using value values view when whenever where while with without work write year zone `,Yv={backslashEscapes:!1,hashComments:!1,spaceAfterDashes:!1,slashComments:!1,doubleQuotedStrings:!1,doubleDollarQuotedStrings:!1,unquotedBitLiterals:!1,treatBitsAsBytes:!1,charSetCasts:!1,plsqlQuotingMechanism:!1,operatorChars:`*+-%<>!=&|~^/`,specialVar:`?`,identifierQuotes:`"`,caseInsensitiveIdentifiers:!1,words:Kv(Jv,qv)};function Xv(e,t,n,r){let i={};for(let t in Yv)i[t]=(e.hasOwnProperty(t)?e:Yv)[t];return t&&(i.words=Kv(t,n||``,r)),i}function Zv(e){return new V_(t=>{let{next:n}=t;if(t.advance(),Wv(n,Gv)){for(;Wv(t.next,Gv);)t.advance();t.acceptToken(lv)}else if(n==36&&e.doubleDollarQuotedStrings){let e=zv(t,``);t.next==36&&(t.advance(),Lv(t,e),t.acceptToken(fv))}else if(n==39||n==34&&e.doubleQuotedStrings)Iv(t,n,e.backslashEscapes),t.acceptToken(fv);else if(n==35&&e.hashComments||n==47&&t.next==47&&e.slashComments)Uv(t),t.acceptToken(uv);else if(n==45&&t.next==45&&(!e.spaceAfterDashes||t.peek(1)==32))Uv(t),t.acceptToken(uv);else if(n==47&&t.next==42){t.advance();for(let e=1;;){let n=t.next;if(t.next<0)break;if(t.advance(),n==42&&t.next==47){if(e--,t.advance(),!e)break}else n==47&&t.next==42&&(e++,t.advance())}t.acceptToken(dv)}else if((n==101||n==69)&&t.next==39)t.advance(),Iv(t,39,!0),t.acceptToken(fv);else if((n==110||n==78)&&t.next==39&&e.charSetCasts)t.advance(),Iv(t,39,e.backslashEscapes),t.acceptToken(fv);else if(n==95&&e.charSetCasts)for(let n=0;;n++){if(t.next==39&&n>1){t.advance(),Iv(t,39,e.backslashEscapes),t.acceptToken(fv);break}if(!Pv(t.next))break;t.advance()}else if(e.plsqlQuotingMechanism&&(n==113||n==81)&&t.next==39&&t.peek(1)>0&&!Wv(t.peek(1),Gv)){let e=t.peek(1);t.advance(2),Rv(t,e),t.acceptToken(fv)}else if(Wv(n,e.identifierQuotes))Iv(t,n==91?93:n,!1),t.acceptToken(Ov);else if(n==40)t.acceptToken(gv);else if(n==41)t.acceptToken(_v);else if(n==123)t.acceptToken(vv);else if(n==125)t.acceptToken(yv);else if(n==91)t.acceptToken(bv);else if(n==93)t.acceptToken(xv);else if(n==59)t.acceptToken(Sv);else if(e.unquotedBitLiterals&&n==48&&t.next==98)t.advance(),Vv(t),t.acceptToken(jv);else if((n==98||n==66)&&(t.next==39||t.next==34)){let n=t.next;t.advance(),e.treatBitsAsBytes?(Iv(t,n,e.backslashEscapes),t.acceptToken(Mv)):(Vv(t,n),t.acceptToken(jv))}else if(n==48&&(t.next==120||t.next==88)||(n==120||n==88)&&t.next==39){let e=t.next==39;for(t.advance();Fv(t.next);)t.advance();e&&t.next==39&&t.advance(),t.acceptToken(pv)}else if(n==46&&t.next>=48&&t.next<=57)Hv(t,!0),t.acceptToken(pv);else if(n==46)t.acceptToken(Cv);else if(n>=48&&n<=57)Hv(t,!1),t.acceptToken(pv);else if(Wv(n,e.operatorChars)){for(;Wv(t.next,e.operatorChars);)t.advance();t.acceptToken(wv)}else if(Wv(n,e.specialVar))t.next==n&&t.advance(),Bv(t),t.acceptToken(Ev);else if(n==58||n==44)t.acceptToken(Tv);else if(Pv(n)){let r=zv(t,String.fromCharCode(n));t.acceptToken(t.next==46||t.peek(-r.length-1)==46?Dv:e.words[r.toLowerCase()]??Dv)}})}var Qv=Zv(Yv),$v=tv.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:`⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement`,maxTerm:38,nodeProps:[[`isolate`,-4,1,2,3,19,``]],skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:`RORO`,tokenizers:[0,Qv],topRules:{Script:[0,25]},tokenPrec:0});function ey(e){let t=e.cursor().moveTo(e.from,-1);for(;/Comment/.test(t.name);)t.moveTo(t.from,-1);return t.node}function ty(e,t){let n=e.sliceString(t.from,t.to),r=/^([`'"\[])(.*)([`'"\]])$/.exec(n);return r?r[2]:n}function ny(e){return e&&(e.name==`Identifier`||e.name==`QuotedIdentifier`)}function ry(e,t){if(t.name==`CompositeIdentifier`){let n=[];for(let r=t.firstChild;r;r=r.nextSibling)ny(r)&&n.push(ty(e,r));return n}return[ty(e,t)]}function iy(e,t){for(let n=[];;){if(!t||t.name!=`.`)return n;let r=ey(t);if(!ny(r))return n;n.unshift(ty(e,r)),t=ey(r)}}function ay(e,t){let n=J(e).resolveInner(t,-1),r=sy(e.doc,n);return n.name==`Identifier`||n.name==`QuotedIdentifier`||n.name==`Keyword`?{from:n.from,quoted:n.name==`QuotedIdentifier`?e.doc.sliceString(n.from,n.from+1):null,parents:iy(e.doc,ey(n)),aliases:r}:n.name==`.`?{from:t,quoted:null,parents:iy(e.doc,n),aliases:r}:{from:t,quoted:null,parents:[],empty:!0,aliases:r}}var oy=new Set(`where group having order union intersect except all distinct limit offset fetch for`.split(` `));function sy(e,t){let n;for(let e=t;!n;e=e.parent){if(!e)return null;e.name==`Statement`&&(n=e)}let r=null;for(let t=n.firstChild,i=!1,a=null;t;t=t.nextSibling){let n=t.name==`Keyword`?e.sliceString(t.from,t.to).toLowerCase():null,o=null;if(!i)i=n==`from`;else if(n==`as`&&a&&ny(t.nextSibling))o=ty(e,t.nextSibling);else if(n&&oy.has(n))break;else a&&ny(t)&&(o=ty(e,t));o&&(r||=Object.create(null),r[o]=ry(e,a)),a=/Identifier$/.test(t.name)?t:null}return r}function cy(e,t,n){return n.map(n=>({...n,label:n.label[0]==e?n.label:e+n.label+t,apply:void 0}))}var ly=/^\w*$/,uy=/^[`'"\[]?\w*[`'"\]]?$/;function dy(e){return e.self&&typeof e.self.label==`string`}var fy=class e{constructor(e,t){this.idQuote=e,this.idCaseInsensitive=t,this.list=[],this.children=void 0}child(t){let n=this.children||=Object.create(null);return n[t]||(t&&!this.list.some(e=>e.label==t)&&this.list.push(py(t,`type`,this.idQuote,this.idCaseInsensitive)),n[t]=new e(this.idQuote,this.idCaseInsensitive))}maybeChild(e){return this.children?this.children[e]:null}addCompletion(e){let t=this.list.findIndex(t=>t.label==e.label);t>-1?this.list[t]=e:this.list.push(e)}addCompletions(e){for(let t of e)this.addCompletion(typeof t==`string`?py(t,`property`,this.idQuote,this.idCaseInsensitive):t)}addNamespace(e){Array.isArray(e)?this.addCompletions(e):dy(e)?this.addNamespace(e.children):this.addNamespaceObject(e)}addNamespaceObject(e){for(let t of Object.keys(e)){let n=e[t],r=null,i=t.replace(/\\?\./g,e=>e==`.`?`\0`:e).split(`\0`),a=this;dy(n)&&(r=n.self,n=n.children);for(let e=0;e<i.length;e++)r&&e==i.length-1&&a.addCompletion(r),a=a.child(i[e].replace(/\\\./g,`.`));a.addNamespace(n)}}};function py(e,t,n,r){return RegExp(`^[a-z_][a-z_\\d]*$`,r?`i`:``).test(e)?{label:e,type:t}:{label:e,type:t,apply:n+e+my(n)}}function my(e){return e===`[`?`]`:e}function hy(e,t,n,r,i,a){let o=new fy(a?.spec.identifierQuotes?.[0]||`"`,!!a?.spec.caseInsensitiveIdentifiers),s=i?o.child(i):null;return o.addNamespace(e),t&&(s||o).addCompletions(t),n&&o.addCompletions(n),s&&o.addCompletions(s.list),r&&o.addCompletions((s||o).child(r).list),e=>{let{parents:t,from:n,quoted:i,empty:a,aliases:c}=ay(e.state,e.pos);if(a&&!e.explicit)return null;c&&t.length==1&&(t=c[t[0]]||t);let l=o;for(let e of t){for(;!l.children||!l.children[e];)if(l==o&&s)l=s;else if(l==s&&r)l=l.child(r);else return null;let t=l.maybeChild(e);if(!t)return null;l=t}let u=l.list;if(l==o&&c&&(u=u.concat(Object.keys(c).map(e=>({label:e,type:`constant`})))),i){let t=i[0],r=my(t);return{from:n,to:e.state.sliceDoc(e.pos,e.pos+1)==r?e.pos+1:void 0,options:cy(t,r,u),validFor:uy}}return{from:n,options:u,validFor:ly}}}function gy(e){return e==Av?`type`:e==kv?`keyword`:`variable`}function _y(e,t,n){return Lh([`QuotedIdentifier`,`String`,`LineComment`,`BlockComment`,`.`],Ih(Object.keys(e).map(r=>n(t?r.toUpperCase():r,gy(e[r])))))}var vy=$v.configure({props:[vu.add({Statement:ku()}),Nu.add({Statement(e,t){return{from:Math.min(e.from+100,t.doc.lineAt(e.from).to),to:e.to}},BlockComment(e){return{from:e.from+2,to:e.to-2}}}),Ol({Keyword:q.keyword,Type:q.typeName,Builtin:q.standard(q.name),Bits:q.number,Bytes:q.string,Bool:q.bool,Null:q.null,Number:q.number,String:q.string,Identifier:q.name,QuotedIdentifier:q.special(q.string),SpecialVar:q.special(q.name),LineComment:q.lineComment,BlockComment:q.blockComment,Operator:q.operator,"Semi Punctuation":q.punctuation,"( )":q.paren,"{ }":q.brace,"[ ]":q.squareBracket})]}),yy=class e{constructor(e,t,n){this.dialect=e,this.language=t,this.spec=n}get extension(){return this.language.extension}configureLanguage(t,n){return new e(this.dialect,this.language.configure(t,n),this.spec)}static define(t){let n=Xv(t,t.keywords,t.types,t.builtin),r=tu.define({name:`sql`,parser:vy.configure({tokenizers:[{from:Qv,to:Zv(n)}]}),languageData:{commentTokens:{line:`--`,block:{open:`/*`,close:`*/`}},closeBrackets:{brackets:[`(`,`[`,`{`,`'`,`"`,"`"]}}});return new e(n,r,t)}};function by(e,t){return{label:e,type:t,boost:-1}}function xy(e,t=!1,n){return _y(e.dialect.words,t,n||by)}function Sy(e){return e.schema?hy(e.schema,e.tables,e.schemas,e.defaultTable,e.defaultSchema,e.dialect||Ty):()=>null}function Cy(e){return e.schema?(e.dialect||Ty).language.data.of({autocomplete:Sy(e)}):[]}function wy(e={}){let t=e.dialect||Ty;return new du(t.language,[Cy(e),t.language.data.of({autocomplete:xy(t,e.upperCaseKeywords,e.keywordCompletion)})])}var Ty=yy.define({});Jv+``,qv+``;var Ey=`accessible algorithm analyze asensitive authors auto_increment autocommit avg avg_row_length binlog btree cache catalog_name chain change changed checkpoint checksum class_origin client_statistics coalesce code collations columns comment committed completion concurrent consistent contains contributors convert database databases day_hour day_microsecond day_minute day_second delay_key_write delayed delimiter des_key_file dev_pop dev_samp deviance directory disable discard distinctrow div dual dumpfile enable enclosed ends engine engines enum errors escaped even event events every explain extended fast field fields flush force found_rows fulltext grants handler hash high_priority hosts hour_microsecond hour_minute hour_second ignore ignore_server_ids import index index_statistics infile innodb insensitive insert_method install invoker iterate keys kill linear lines list load lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modify mutex mysql_errno no_write_to_binlog offline offset one online optimize optionally outfile pack_keys parser partition partitions password phase plugin plugins prev processlist profile profiles purge query quick range read_write rebuild recover regexp relaylog remove rename reorganize repair repeatable replace require resume rlike row_format rtree schedule schema_name schemas second_microsecond security sensitive separator serializable server share show slave slow snapshot soname spatial sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result ssl starting starts std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace terminated triggers truncate uncommitted uninstall unlock upgrade use use_frm user_resources user_statistics utc_date utc_time utc_timestamp variables views warnings xa xor year_month zerofill`;qv+``,Jv+``+Ey,Jv+``+Ey,Jv+``,qv+``,Jv+``,qv+``,qv+``,Jv+``,qv+``;var Dy=1,Oy=2,ky=3,Ay=4,jy=5,My=36,Ny=37,Py=38,Fy=11,Iy=13;function Ly(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function Ry(e){return e==9||e==10||e==13||e==32}var zy=null,By=null,Vy=0;function Hy(e,t){let n=e.pos+t;if(By==e&&Vy==n)return zy;for(;Ry(e.peek(t));)t++;let r=``;for(;;){let n=e.peek(t);if(!Ly(n))break;r+=String.fromCharCode(n),t++}return By=e,Vy=n,zy=r||null}function Uy(e,t){this.name=e,this.parent=t}var Wy=new ev({start:null,shift(e,t,n,r){return t==Dy?new Uy(Hy(r,1)||``,e):e},reduce(e,t){return t==Fy&&e?e.parent:e},reuse(e,t,n,r){let i=t.type.id;return i==Dy||i==Iy?new Uy(Hy(r,1)||``,e):e},strict:!1}),Gy=new V_((e,t)=>{if(e.next==60){if(e.advance(),e.next==47){e.advance();let n=Hy(e,0);if(!n)return e.acceptToken(jy);if(t.context&&n==t.context.name)return e.acceptToken(Oy);for(let r=t.context;r;r=r.parent)if(r.name==n)return e.acceptToken(ky,-2);e.acceptToken(Ay)}else if(e.next!=33&&e.next!=63)return e.acceptToken(Dy)}},{contextual:!0});function Ky(e,t){return new V_(n=>{let r=0,i=t.charCodeAt(0);scan:for(;!(n.next<0);n.advance(),r++)if(n.next==i){for(let e=1;e<t.length;e++)if(n.peek(e)!=t.charCodeAt(e))continue scan;break}r&&n.acceptToken(e)})}var qy=Ky(My,`-->`),Jy=Ky(Ny,`?>`),Yy=Ky(Py,`]]>`),Xy=Ol({Text:q.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":q.angleBracket,TagName:q.tagName,"MismatchedCloseTag/TagName":[q.tagName,q.invalid],AttributeName:q.attributeName,AttributeValue:q.attributeValue,Is:q.definitionOperator,"EntityReference CharacterReference":q.character,Comment:q.blockComment,ProcessingInst:q.processingInstruction,DoctypeDecl:q.documentMeta,Cdata:q.special(q.string)}),Zy=tv.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C}'#C}O$dOrO,59^OOOP,59^,59^OOOS'#DO'#DOO$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6z-E6zOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6{-E6{OOOP1G.x1G.xOOOS-E6|-E6|OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+$c7+$cO'YOpO,59VO'bOpO,59VO'mO!bO,59eOOOO-E6w-E6wO'{OpO1G.uO'{OpO1G.uOOOP1G.u1G.uO(TOpO7+$fOOOP7+$f7+$fO(]O!bO<<GuOOOP<<Gu<<GuOOOP<<G}<<G}O'bOpO1G.qO'bOpO1G.qO(hO#tO'#CnO(vO&jO'#CnOOOO1G.q1G.qO)UOpO7+$aOOOP7+$a7+$aOOOP<<HQ<<HQOOOPAN=aAN=aOOOPAN=iAN=iO'bOpO7+$]OOOO7+$]7+$]OOOO'#Cz'#CzO)^O#tO,59YOOOO,59Y,59YOOOO'#C{'#C{O)lO&jO,59YOOOP<<G{<<G{OOOO<<Gw<<GwOOOO-E6x-E6xOOOO1G.t1G.tOOOO-E6y-E6y",stateData:")z~OPQOSVOTWOVWOWWOXWOiXOyPO!QTO!SUO~OvZOx]O~O^`Oz^O~OPQOQcOSVOTWOVWOWWOXWOyPO!QTO!SUO~ORdO~P!SOteO!PgO~OuhO!RjO~O^lOz^O~OvZOxoO~O^qOz^O~O[vO`sOdwOz^O~ORyO~P!SO^{Oz^O~OteO!P}O~OuhO!R!PO~O^!QOz^O~O[!SOz^O~O[!VO`sOd!WOz^O~Oa!YOz^O~Oz^O[mX`mXdmX~O[!VO`sOd!WO~O^!]Oz^O~O[!_Oz^O~O[!aOz^O~O[!cO`sOd!dOz^O~O[!cO`sOd!dO~Oa!eOz^O~Oz^O{!gO}!hO~Oz^O[ma`madma~O[!kOz^O~O[!lOz^O~O[!mO`sOd!nO~OW!qOX!qO{!sO|!qO~OW!tOX!tO}!sO!O!tO~O[!vOz^O~OW!qOX!qO{!yO|!qO~OW!tOX!tO}!yO!O!tO~O",goto:"%cxPPPPPPPPPPyyP!PP!VPP!`!jP!pyyyP!v!|#S$[$k$q$w$}%TPPPP%ZXWORYbXRORYb_t`qru!T!U!bQ!i!YS!p!e!fR!w!oQdRRybXSORYbQYORmYQ[PRn[Q_QQkVjp_krz!R!T!X!Z!^!`!f!j!oQr`QzcQ!RlQ!TqQ!XsQ!ZtQ!^{Q!`!QQ!f!YQ!j!]R!o!eQu`S!UqrU![u!U!bR!b!TQ!r!gR!x!rQ!u!hR!z!uQbRRxbQfTR|fQiUR!OiSXOYTaRb",nodeNames:`⚠ StartTag StartCloseTag MissingCloseTag StartCloseTag StartCloseTag Document Text EntityReference CharacterReference Cdata Element EndTag OpenTag TagName Attribute AttributeName Is AttributeValue CloseTag SelfCloseEndTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag DoctypeDecl`,maxTerm:50,context:Wy,nodeProps:[[`closedBy`,1,`SelfCloseEndTag EndTag`,13,`CloseTag MissingCloseTag`],[`openedBy`,12,`StartTag StartCloseTag`,19,`OpenTag`,20,`StartTag`],[`isolate`,-6,13,18,19,21,22,24,``]],propSources:[Xy],skippedNodes:[0],repeatNodeCount:9,tokenData:"!)v~R!YOX$qXY)iYZ)iZ]$q]^)i^p$qpq)iqr$qrs*vsv$qvw+fwx/ix}$q}!O0[!O!P$q!P!Q2z!Q![$q![!]4n!]!^$q!^!_8U!_!`!#t!`!a!$l!a!b!%d!b!c$q!c!}4n!}#P$q#P#Q!'W#Q#R$q#R#S4n#S#T$q#T#o4n#o%W$q%W%o4n%o%p$q%p&a4n&a&b$q&b1p4n1p4U$q4U4d4n4d4e$q4e$IS4n$IS$I`$q$I`$Ib4n$Ib$Kh$q$Kh%#t4n%#t&/x$q&/x&Et4n&Et&FV$q&FV;'S4n;'S;:j8O;:j;=`)c<%l?&r$q?&r?Ah4n?Ah?BY$q?BY?Mn4n?MnO$qi$zXVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qa%nVVP!O`Ov%gwx&Tx!^%g!^!_&o!_;'S%g;'S;=`'W<%lO%gP&YTVPOv&Tw!^&T!_;'S&T;'S;=`&i<%lO&TP&lP;=`<%l&T`&tS!O`Ov&ox;'S&o;'S;=`'Q<%lO&o`'TP;=`<%l&oa'ZP;=`<%l%gX'eWVP|WOr'^rs&Tsv'^w!^'^!^!_'}!_;'S'^;'S;=`(i<%lO'^W(ST|WOr'}sv'}w;'S'};'S;=`(c<%lO'}W(fP;=`<%l'}X(lP;=`<%l'^h(vV|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oh)`P;=`<%l(oi)fP;=`<%l$qo)t`VP|W!O`zUOX$qXY)iYZ)iZ]$q]^)i^p$qpq)iqr$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk+PV{YVP!O`Ov%gwx&Tx!^%g!^!_&o!_;'S%g;'S;=`'W<%lO%g~+iast,n![!]-r!c!}-r#R#S-r#T#o-r%W%o-r%p&a-r&b1p-r4U4d-r4e$IS-r$I`$Ib-r$Kh%#t-r&/x&Et-r&FV;'S-r;'S;:j/c?&r?Ah-r?BY?Mn-r~,qQ!Q![,w#l#m-V~,zQ!Q![,w!]!^-Q~-VOX~~-YR!Q![-c!c!i-c#T#Z-c~-fS!Q![-c!]!^-Q!c!i-c#T#Z-c~-ug}!O-r!O!P-r!Q![-r![!]-r!]!^/^!c!}-r#R#S-r#T#o-r$}%O-r%W%o-r%p&a-r&b1p-r1p4U-r4U4d-r4e$IS-r$I`$Ib-r$Je$Jg-r$Kh%#t-r&/x&Et-r&FV;'S-r;'S;:j/c?&r?Ah-r?BY?Mn-r~/cOW~~/fP;=`<%l-rk/rW}bVP|WOr'^rs&Tsv'^w!^'^!^!_'}!_;'S'^;'S;=`(i<%lO'^k0eZVP|W!O`Or$qrs%gsv$qwx'^x}$q}!O1W!O!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk1aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a2S!a;'S$q;'S;=`)c<%lO$qk2_X!PQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qm3TZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a3v!a;'S$q;'S;=`)c<%lO$qm4RXdSVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qo4{!P`S^QVP|W!O`Or$qrs%gsv$qwx'^x}$q}!O4n!O!P4n!P!Q$q!Q![4n![!]4n!]!^$q!^!_(o!_!c$q!c!}4n!}#R$q#R#S4n#S#T$q#T#o4n#o$}$q$}%O4n%O%W$q%W%o4n%o%p$q%p&a4n&a&b$q&b1p4n1p4U4n4U4d4n4d4e$q4e$IS4n$IS$I`$q$I`$Ib4n$Ib$Je$q$Je$Jg4n$Jg$Kh$q$Kh%#t4n%#t&/x$q&/x&Et4n&Et&FV$q&FV;'S4n;'S;:j8O;:j;=`)c<%l?&r$q?&r?Ah4n?Ah?BY$q?BY?Mn4n?MnO$qo8RP;=`<%l4ni8]Y|W!O`Oq(oqr8{rs&osv(owx'}x!a(o!a!b!#U!b;'S(o;'S;=`)]<%lO(oi9S_|W!O`Or(ors&osv(owx'}x}(o}!O:R!O!f(o!f!g;e!g!}(o!}#ODh#O#W(o#W#XLp#X;'S(o;'S;=`)]<%lO(oi:YX|W!O`Or(ors&osv(owx'}x}(o}!O:u!O;'S(o;'S;=`)]<%lO(oi;OV!QP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oi;lX|W!O`Or(ors&osv(owx'}x!q(o!q!r<X!r;'S(o;'S;=`)]<%lO(oi<`X|W!O`Or(ors&osv(owx'}x!e(o!e!f<{!f;'S(o;'S;=`)]<%lO(oi=SX|W!O`Or(ors&osv(owx'}x!v(o!v!w=o!w;'S(o;'S;=`)]<%lO(oi=vX|W!O`Or(ors&osv(owx'}x!{(o!{!|>c!|;'S(o;'S;=`)]<%lO(oi>jX|W!O`Or(ors&osv(owx'}x!r(o!r!s?V!s;'S(o;'S;=`)]<%lO(oi?^X|W!O`Or(ors&osv(owx'}x!g(o!g!h?y!h;'S(o;'S;=`)]<%lO(oi@QY|W!O`Or?yrs@psv?yvwA[wxBdx!`?y!`!aCr!a;'S?y;'S;=`Db<%lO?ya@uV!O`Ov@pvxA[x!`@p!`!aAy!a;'S@p;'S;=`B^<%lO@pPA_TO!`A[!`!aAn!a;'SA[;'S;=`As<%lOA[PAsOiPPAvP;=`<%lA[aBQSiP!O`Ov&ox;'S&o;'S;=`'Q<%lO&oaBaP;=`<%l@pXBiX|WOrBdrsA[svBdvwA[w!`Bd!`!aCU!a;'SBd;'S;=`Cl<%lOBdXC]TiP|WOr'}sv'}w;'S'};'S;=`(c<%lO'}XCoP;=`<%lBdiC{ViP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oiDeP;=`<%l?yiDoZ|W!O`Or(ors&osv(owx'}x!e(o!e!fEb!f#V(o#V#WIr#W;'S(o;'S;=`)]<%lO(oiEiX|W!O`Or(ors&osv(owx'}x!f(o!f!gFU!g;'S(o;'S;=`)]<%lO(oiF]X|W!O`Or(ors&osv(owx'}x!c(o!c!dFx!d;'S(o;'S;=`)]<%lO(oiGPX|W!O`Or(ors&osv(owx'}x!v(o!v!wGl!w;'S(o;'S;=`)]<%lO(oiGsX|W!O`Or(ors&osv(owx'}x!c(o!c!dH`!d;'S(o;'S;=`)]<%lO(oiHgX|W!O`Or(ors&osv(owx'}x!}(o!}#OIS#O;'S(o;'S;=`)]<%lO(oiI]V|W!O`yPOr(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oiIyX|W!O`Or(ors&osv(owx'}x#W(o#W#XJf#X;'S(o;'S;=`)]<%lO(oiJmX|W!O`Or(ors&osv(owx'}x#T(o#T#UKY#U;'S(o;'S;=`)]<%lO(oiKaX|W!O`Or(ors&osv(owx'}x#h(o#h#iK|#i;'S(o;'S;=`)]<%lO(oiLTX|W!O`Or(ors&osv(owx'}x#T(o#T#UH`#U;'S(o;'S;=`)]<%lO(oiLwX|W!O`Or(ors&osv(owx'}x#c(o#c#dMd#d;'S(o;'S;=`)]<%lO(oiMkX|W!O`Or(ors&osv(owx'}x#V(o#V#WNW#W;'S(o;'S;=`)]<%lO(oiN_X|W!O`Or(ors&osv(owx'}x#h(o#h#iNz#i;'S(o;'S;=`)]<%lO(oi! RX|W!O`Or(ors&osv(owx'}x#m(o#m#n! n#n;'S(o;'S;=`)]<%lO(oi! uX|W!O`Or(ors&osv(owx'}x#d(o#d#e!!b#e;'S(o;'S;=`)]<%lO(oi!!iX|W!O`Or(ors&osv(owx'}x#X(o#X#Y?y#Y;'S(o;'S;=`)]<%lO(oi!#_V!SP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(ok!$PXaQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qo!$wX[UVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!%mZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!&`!a;'S$q;'S;=`)c<%lO$qk!&kX!RQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!'aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_#P$q#P#Q!(S#Q;'S$q;'S;=`)c<%lO$qk!(]ZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!)O!a;'S$q;'S;=`)c<%lO$qk!)ZXxQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$q",tokenizers:[Gy,qy,Jy,Yy,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function Qy(e,t){let n=t&&t.getChild(`TagName`);return n?e.sliceString(n.from,n.to):``}function $y(e,t){let n=t&&t.firstChild;return!n||n.name!=`OpenTag`?``:Qy(e,n)}function eb(e,t,n){let r=t&&t.getChildren(`Attribute`).find(e=>e.from<=n&&e.to>=n),i=r&&r.getChild(`AttributeName`);return i?e.sliceString(i.from,i.to):``}function tb(e){for(let t=e&&e.parent;t;t=t.parent)if(t.name==`Element`)return t;return null}function nb(e,t){let n=J(e).resolveInner(t,-1),r=null;for(let e=n;!r&&e.parent;e=e.parent)(e.name==`OpenTag`||e.name==`CloseTag`||e.name==`SelfClosingTag`||e.name==`MismatchedCloseTag`)&&(r=e);if(r&&(r.to>t||r.lastChild.type.isError)){let e=r.parent;if(n.name==`TagName`)return r.name==`CloseTag`||r.name==`MismatchedCloseTag`?{type:`closeTag`,from:n.from,context:e}:{type:`openTag`,from:n.from,context:tb(e)};if(n.name==`AttributeName`)return{type:`attrName`,from:n.from,context:r};if(n.name==`AttributeValue`)return{type:`attrValue`,from:n.from,context:r};let i=n==r||n.name==`Attribute`?n.childBefore(t):n;return i?.name==`StartTag`?{type:`openTag`,from:t,context:tb(e)}:i?.name==`StartCloseTag`&&i.to<=t?{type:`closeTag`,from:t,context:e}:i?.name==`Is`?{type:`attrValue`,from:t,context:r}:i?{type:`attrName`,from:t,context:r}:null}if(n.name==`StartCloseTag`)return{type:`closeTag`,from:t,context:n.parent};for(;n.parent&&n.to==t&&!n.lastChild?.type.isError;)n=n.parent;return n.name==`Element`||n.name==`Text`||n.name==`Document`?{type:`tag`,from:t,context:n.name==`Element`?n:tb(n)}:null}var rb=class{constructor(e,t,n){this.attrs=t,this.attrValues=n,this.children=[],this.name=e.name,this.completion=Object.assign(Object.assign({type:`type`},e.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:`<`+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:`</`+this.name+`>`,boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+`>`}),this.text=e.textContent?e.textContent.map(e=>({label:e,type:`text`})):[]}},ib=/^[:\-\.\w\u00b7-\uffff]*$/;function ab(e){return Object.assign(Object.assign({type:`property`},e.completion||{}),{label:e.name})}function ob(e){return typeof e==`string`?{label:`"${e}"`,type:`constant`}:/^"/.test(e.label)?e:Object.assign(Object.assign({},e),{label:`"${e.label}"`})}function sb(e,t){let n=[],r=[],i=Object.create(null);for(let e of t){let t=ab(e);n.push(t),e.global&&r.push(t),e.values&&(i[e.name]=e.values.map(ob))}let a=[],o=[],s=Object.create(null);for(let t of e){let e=r,c=i;t.attributes&&(e=e.concat(t.attributes.map(e=>typeof e==`string`?n.find(t=>t.label==e)||{label:e,type:`property`}:(e.values&&(c==i&&(c=Object.create(c)),c[e.name]=e.values.map(ob)),ab(e)))));let l=new rb(t,e,c);s[l.name]=l,a.push(l),t.top&&o.push(l)}o.length||(o=a);for(let t=0;t<a.length;t++){let n=e[t],r=a[t];if(n.children)for(let e of n.children)s[e]&&r.children.push(s[e]);else r.children=a}return e=>{let{doc:t}=e.state,n=nb(e.state,e.pos);if(!n||n.type==`tag`&&!e.explicit)return null;let{type:c,from:l,context:u}=n;if(c==`openTag`){let e=o,n=$y(t,u);return n&&(e=s[n]?.children||a),{from:l,options:e.map(e=>e.completion),validFor:ib}}if(c==`closeTag`){let n=$y(t,u);return n?{from:l,to:e.pos+ +(t.sliceString(e.pos,e.pos+1)==`>`),options:[s[n]?.closeNameCompletion||{label:n+`>`,type:`type`}],validFor:ib}:null}if(c==`attrName`)return{from:l,options:s[Qy(t,u)]?.attrs||r,validFor:ib};if(c==`attrValue`){let n=eb(t,u,l);if(!n)return null;let r=(s[Qy(t,u)]?.attrValues||i)[n];return!r||!r.length?null:{from:l,to:e.pos+ +(t.sliceString(e.pos,e.pos+1)==`"`),options:r,validFor:/^"[^"]*"?$/}}if(c==`tag`){let n=$y(t,u),r=s[n],i=[],c=u&&u.lastChild;n&&(!c||c.name!=`CloseTag`||Qy(t,c)!=n)&&i.push(r?r.closeCompletion:{label:`</`+n+`>`,type:`type`,boost:2});let d=i.concat((r?.children||(u?a:o)).map(e=>e.openCompletion));if(u&&r?.text.length){let t=u.firstChild;t.to>e.pos-20&&!/\S/.test(e.state.sliceDoc(t.to,e.pos))&&(d=d.concat(r.text))}return{from:l,options:d,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}return null}}var cb=tu.define({name:`xml`,parser:Zy.configure({props:[vu.add({Element(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),Nu.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!=`OpenTag`?null:{from:t.to,to:n.name==`CloseTag`?n.from:e.to}}}),Td.add({"OpenTag CloseTag":e=>e.getChild(`TagName`)})]}),languageData:{commentTokens:{block:{open:`<!--`,close:`-->`}},indentOnInput:/^\s*<\/$/}});function lb(e={}){let t=[cb.data.of({autocomplete:sb(e.elements||[],e.attributes||[])})];return e.autoCloseTags!==!1&&t.push(db),new du(cb,t)}function ub(e,t,n=e.length){if(!t)return``;let r=t.firstChild,i=r&&r.getChild(`TagName`);return i?e.sliceString(i.from,Math.min(i.to,n)):``}var db=H.inputHandler.of((e,t,n,r,i)=>{if(e.composing||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!cb.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let{head:t}=e,n=o.doc.sliceString(t-1,t)==r,i=J(o).resolveInner(t,-1),a;if(n&&r==`>`&&i.name==`EndTag`){let n=i.parent;if(n.parent?.lastChild?.name!=`CloseTag`&&(a=ub(o.doc,n.parent,t)))return{range:e,changes:{from:t,to:t+ +(o.doc.sliceString(t,t+1)===`>`),insert:`</${a}>`}}}else if(n&&r==`/`&&i.name==`StartCloseTag`){let e=i.parent;if(i.from==t-2&&e.lastChild?.name!=`CloseTag`&&(a=ub(o.doc,e,t))){let e=t+ +(o.doc.sliceString(t,t+1)===`>`),n=`${a}>`;return{range:T.cursor(t+n.length,-1),changes:{from:t,to:e,insert:n}}}}return{range:e}});return!s.changes.empty&&(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),fb=63,pb=64,mb=1,hb=2,gb=3,_b=4,vb=5,yb=6,bb=7,xb=65,Sb=66,Cb=8,wb=9,Tb=10,Eb=11,Db=12,Ob=13,kb=19,Ab=20,jb=29,Mb=33,Nb=34,Pb=47,Fb=0,Ib=1,Lb=2,Rb=3,zb=4,Bb=class{constructor(e,t,n){this.parent=e,this.depth=t,this.type=n,this.hash=(e?e.hash+e.hash<<8:0)+t+(t<<4)+n}};Bb.top=new Bb(null,-1,Fb);function Vb(e,t){for(let n=0,r=t-e.pos-1;;r--,n++){let t=e.peek(r);if(Ub(t)||t==-1)return n}}function Hb(e){return e==32||e==9}function Ub(e){return e==10||e==13}function Wb(e){return Hb(e)||Ub(e)}function Gb(e){return e<0||Wb(e)}var Kb=new ev({start:Bb.top,reduce(e,t){return e.type==Rb&&(t==Ab||t==Nb)?e.parent:e},shift(e,t,n,r){if(t==gb)return new Bb(e,Vb(r,r.pos),Ib);if(t==xb||t==vb)return new Bb(e,Vb(r,r.pos),Lb);if(t==fb)return e.parent;if(t==kb||t==Mb)return new Bb(e,0,Rb);if(t==Ob&&e.type==zb)return e.parent;if(t==Pb){let t=/[1-9]/.exec(r.read(r.pos,n.pos));if(t)return new Bb(e,e.depth+ +t[0],zb)}return e},hash(e){return e.hash}});function qb(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&Gb(e.peek(n+3))}var Jb=new V_((e,t)=>{if(e.next==-1&&t.canShift(pb))return e.acceptToken(pb);let n=e.peek(-1);if((Ub(n)||n<0)&&t.context.type!=Rb){if(qb(e,45)){if(t.canShift(fb))e.acceptToken(fb);else return e.acceptToken(mb,3)}if(qb(e,46)){if(t.canShift(fb))e.acceptToken(fb);else return e.acceptToken(hb,3)}let n=0;for(;e.next==32;)n++,e.advance();(n<t.context.depth||n==t.context.depth&&t.context.type==Ib&&(e.next!=45||!Gb(e.peek(1))))&&e.next!=-1&&!Ub(e.next)&&e.next!=35&&e.acceptToken(fb,-n)}},{contextual:!0}),Yb=new V_((e,t)=>{if(t.context.type==Rb){e.next==63&&(e.advance(),Gb(e.next)&&e.acceptToken(bb));return}if(e.next==45)e.advance(),Gb(e.next)&&e.acceptToken(t.context.type==Ib&&t.context.depth==Vb(e,e.pos-1)?_b:gb);else if(e.next==63)e.advance(),Gb(e.next)&&e.acceptToken(t.context.type==Lb&&t.context.depth==Vb(e,e.pos-1)?yb:vb);else{let n=e.pos;for(;;)if(Hb(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)$b(e);else if(e.next==38)ex(e);else if(e.next==42){ex(e);break}else if(e.next==39||e.next==34){if(tx(e,!0))break;return}else if(e.next==91||e.next==123){if(!nx(e))return;break}else{ox(e,!0,!1,0);break}for(;Hb(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(jb))return;Gb(e.peek(1))&&e.acceptTokenTo(t.context.type==Lb&&t.context.depth==Vb(e,n)?Sb:xb,n)}}},{contextual:!0});function Xb(e){return e>32&&e<127&&e!=34&&e!=37&&e!=44&&e!=60&&e!=62&&e!=92&&e!=94&&e!=96&&e!=123&&e!=124&&e!=125}function Zb(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function Qb(e,t){return e.next==37?(e.advance(),Zb(e.next)&&e.advance(),Zb(e.next)&&e.advance(),!0):Xb(e.next)||t&&e.next==44?(e.advance(),!0):!1}function $b(e){if(e.advance(),e.next==60){for(e.advance();;)if(!Qb(e,!0)){e.next==62&&e.advance();break}}else for(;Qb(e,!1););}function ex(e){for(e.advance();!Gb(e.next)&&ix(e.next)!=`f`;)e.advance()}function tx(e,t){let n=e.next,r=!1,i=e.pos;for(e.advance();;){let a=e.next;if(a<0)break;if(e.advance(),a==n){if(a==39){if(e.next==39)e.advance();else break}else break}else if(a==92&&n==34)e.next>=0&&e.advance();else if(Ub(a)){if(t)return!1;r=!0}else if(t&&e.pos>=i+1024)return!1}return!r}function nx(e){for(let t=[],n=e.pos+1024;;)if(e.next==91||e.next==123)t.push(e.next),e.advance();else if(e.next==39||e.next==34){if(!tx(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else if(e.next<0||e.pos>n||Ub(e.next))return!1;else e.advance()}var rx=`iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif`;function ix(e){return e<33?`u`:e>125?`s`:rx[e-33]}function ax(e,t){let n=ix(e);return n!=`u`&&!(t&&n==`f`)}function ox(e,t,n,r){if(ix(e.next)==`s`||(e.next==63||e.next==58||e.next==45)&&ax(e.peek(1),n))e.advance();else return!1;let i=e.pos;for(;;){let a=e.next,o=0,s=r+1;for(;Wb(a);){if(Ub(a)){if(t)return!1;s=0}else s++;a=e.peek(++o)}if(!(a>=0&&(a==58?ax(e.peek(o+1),n):a==35?e.peek(o-1)!=32:ax(a,n)))||!n&&s<=r||s==0&&!n&&(qb(e,45,o)||qb(e,46,o)))break;if(t&&ix(a)==`f`)return!1;for(let t=o;t>=0;t--)e.advance();if(t&&e.pos>i+1024)return!1}return!0}var sx=new V_((e,t)=>{if(e.next==33)$b(e),e.acceptToken(Db);else if(e.next==38||e.next==42){let t=e.next==38?Tb:Eb;ex(e),e.acceptToken(t)}else e.next==39||e.next==34?(tx(e,!1),e.acceptToken(wb)):ox(e,!1,t.context.type==Rb,t.context.depth)&&e.acceptToken(Cb)}),cx=new V_((e,t)=>{let n=t.context.type==zb?t.context.depth:-1,r=e.pos;scan:for(;;){let i=0,a=e.next;for(;a==32;)a=e.peek(++i);if(!i&&(qb(e,45,i)||qb(e,46,i))||!Ub(a)&&(n<0&&(n=Math.max(t.context.depth+1,i)),i<n))break;for(;;){if(e.next<0)break scan;let t=Ub(e.next);if(e.advance(),t)continue scan;r=e.pos}}e.acceptTokenTo(Ob,r)}),lx=Ol({DirectiveName:q.keyword,DirectiveContent:q.attributeValue,"DirectiveEnd DocEnd":q.meta,QuotedLiteral:q.string,BlockLiteralHeader:q.special(q.string),BlockLiteralContent:q.content,Literal:q.content,"Key/Literal Key/QuotedLiteral":q.definition(q.propertyName),"Anchor Alias":q.labelName,Tag:q.typeName,Comment:q.lineComment,": , -":q.separator,"?":q.punctuation,"[ ]":q.squareBracket,"{ }":q.brace}),ux=tv.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:`⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document`,maxTerm:74,context:Kb,nodeProps:[[`isolate`,-3,8,9,14,``],[`openedBy`,18,`[`,32,`{`],[`closedBy`,19,`]`,33,`}`]],propSources:[lx],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[Jb,Yb,sx,cx,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),dx=tu.define({name:`yaml`,parser:ux.configure({props:[vu.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name==`BlockLiteralContent`&&t.from<t.to)return e.baseIndentFor(t);if(t.name==`BlockLiteral`)return e.baseIndentFor(t)+e.unit;if(t.name==`BlockSequence`||t.name==`BlockMapping`)return e.column(t.firstChild.from,1);if(t.name==`QuotedLiteral`)return null;if(t.name==`Literal`){let n=e.column(t.from,1);if(n==e.lineIndent(t.from,1))return n;if(t.to>e.pos)return null}}return null},FlowMapping:Du({closing:`}`}),FlowSequence:Du({closing:`]`})}),Nu.add({"FlowMapping FlowSequence":Pu,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:`#`},indentOnInput:/^\s*[\]\}]$/}});function fx(){return new du(dx)}q.meta;var px=[[`plantuml`,`PlantUML`],[`mermaid`,`Mermaid`],[`graphviz`,`GraphViz`],[`d2`,`D2`],[`c4plantuml`,`C4 PlantUML`],[`blockdiag`,`BlockDiag`],[`seqdiag`,`SeqDiag`],[`actdiag`,`ActDiag`],[`nwdiag`,`NwDiag`],[`packetdiag`,`PacketDiag`],[`rackdiag`,`RackDiag`],[`bpmn`,`BPMN`],[`bytefield`,`Bytefield`],[`dbml`,`DBML`],[`diagramsnet`,`Diagrams.net`],[`ditaa`,`Ditaa`],[`erd`,`ERD`],[`excalidraw`,`Excalidraw`],[`goat`,`GoAT`],[`nomnoml`,`Nomnoml`],[`pikchr`,`Pikchr`],[`structurizr`,`Structurizr`],[`svgbob`,`Svgbob`],[`symbolator`,`Symbolator`],[`tikz`,`TikZ`],[`umlet`,`UMLet`],[`vega`,`Vega`],[`vegalite`,`Vega-Lite`],[`wavedrom`,`WaveDrom`],[`wireviz`,`WireViz`]].map(([e,t])=>({id:e,label:t})),mx=new Set(`actor.alt.and.as.class.component.database.direction.else.end.endnote.endif.endwhile.flowchart.graph.group.if.interface.loop.namespace.node.note.package.participant.rectangle.return.skinparam.start.state.stop.subgraph.then.title.while`.split(`.`)),hx=Id.define({startState:()=>({blockComment:!1}),token(e,t){return t.blockComment?(e.skipTo(`*/`)?(e.match(`*/`),t.blockComment=!1):e.skipToEnd(),`blockComment`):e.match(`/*`)?(t.blockComment=!0,`blockComment`):e.match(/^\s*(?:%%|\/\/|'|#).*/)?`lineComment`:e.match(/^@(?:start|end)[a-z0-9_]*/i)?`keyword`:e.match(/^"(?:[^"\\]|\\.)*"/)?`string`:e.match(/^(?:--?>|<--?|==>|<==|\.\.>|<\.\.|->|<-|=>|<=|--|\.\.)/)?`operator`:e.match(/^#[0-9a-f]{3,8}\b/i)?`color`:e.match(/^\b\d+(?:\.\d+)?\b/)?`number`:e.match(/^\b[a-z_][\w-]*\b/i)?mx.has(e.current().toLowerCase())?`keyword`:`variableName`:(e.next(),null)}}),gx=new Set([`bytefield`,`excalidraw`,`vega`,`vegalite`,`wavedrom`]),_x=new Set([`bpmn`,`diagramsnet`,`umlet`]);function vx(e){return gx.has(e)?cv():_x.has(e)?lb():e===`wireviz`?fx():e===`dbml`?wy():hx}function yx(e){return px.some(t=>t.id===e)}var bx=`<?xml version="1.0" encoding="UTF-8"?>16-<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:qa="http://some-company/schema/bpmn/qa" id="_RdgBELNaEeSYkoSLDs6j-w" targetNamespace="http://activiti.org/bpmn">17- <bpmn2:process id="Process_1">18- <bpmn2:task id="Task_1" name="Examine Situation" qa:suitable="0.7">19- <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>20- <bpmn2:extensionElements>21- <qa:analysisDetails lastChecked="2015-01-20" nextCheck="2015-07-15">22- <qa:comment author="Klaus">23- Our operators always have a hard time to figure out, what they need to do here.24- </qa:comment>25- <qa:comment author="Walter">26- I believe this can be split up in a number of activities and partly automated.27- </qa:comment>28- </qa:analysisDetails>29- </bpmn2:extensionElements>30- </bpmn2:task>31- <bpmn2:sequenceFlow id="SequenceFlow_1" name="" sourceRef="Task_1" targetRef="ExclusiveGateway_1"/>32- <bpmn2:exclusiveGateway id="ExclusiveGateway_1" name="Things OK?">33- <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>34- <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing>35- <bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing>36- </bpmn2:exclusiveGateway>37- <bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="ExclusiveGateway_1" targetRef="EndEvent_1"/>38- <bpmn2:sequenceFlow id="SequenceFlow_5" name="" sourceRef="ExclusiveGateway_1" targetRef="EndEvent_2"/>39- <bpmn2:endEvent id="EndEvent_1" name="Notification Sent">40- <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>41- <bpmn2:messageEventDefinition id="MessageEventDefinition_1"/>42- </bpmn2:endEvent>43- <bpmn2:endEvent id="EndEvent_2" name="Error Propagated">44- <bpmn2:incoming>SequenceFlow_5</bpmn2:incoming>45- <bpmn2:errorEventDefinition id="ErrorEventDefinition_1"/>46- </bpmn2:endEvent>47- </bpmn2:process>48- <bpmndi:BPMNDiagram id="BPMNDiagram_1">49- <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">50- <bpmndi:BPMNShape id="_BPMNShape_Task_2" bpmnElement="Task_1">51- <dc:Bounds height="80.0" width="100.0" x="96.0" y="196.0"/>52- </bpmndi:BPMNShape>53- <bpmndi:BPMNShape id="_BPMNShape_EndEvent_2" bpmnElement="EndEvent_1">54- <dc:Bounds height="36.0" width="36.0" x="396.0" y="300.0"/>55- <bpmndi:BPMNLabel>56- <dc:Bounds height="0.0" width="0.0" x="414.0" y="341.0"/>57- </bpmndi:BPMNLabel>58- </bpmndi:BPMNShape>59- <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_2" bpmnElement="ExclusiveGateway_1" isMarkerVisible="true">60- <dc:Bounds height="50.0" width="50.0" x="276.0" y="210.0"/>61- <bpmndi:BPMNLabel>62- <dc:Bounds height="21.0" width="74.0" x="333.0" y="226.0"/>63- </bpmndi:BPMNLabel>64- </bpmndi:BPMNShape>65- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_Task_2" targetElement="_BPMNShape_ExclusiveGateway_2">66- <di:waypoint xsi:type="dc:Point" x="196.0" y="236.0"/>67- <di:waypoint xsi:type="dc:Point" x="276.0" y="235.0"/>68- <bpmndi:BPMNLabel>69- <dc:Bounds height="6.0" width="6.0" x="214.0" y="236.0"/>70- </bpmndi:BPMNLabel>71- </bpmndi:BPMNEdge>72- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="_BPMNShape_ExclusiveGateway_2" targetElement="_BPMNShape_EndEvent_2">73- <di:waypoint xsi:type="dc:Point" x="301.0" y="260.0"/>74- <di:waypoint xsi:type="dc:Point" x="301.0" y="318.0"/>75- <di:waypoint xsi:type="dc:Point" x="396.0" y="318.0"/>76- <bpmndi:BPMNLabel>77- <dc:Bounds height="6.0" width="6.0" x="298.0" y="301.0"/>78- </bpmndi:BPMNLabel>79- </bpmndi:BPMNEdge>80- <bpmndi:BPMNShape id="_BPMNShape_EndEvent_3" bpmnElement="EndEvent_2">81- <dc:Bounds height="36.0" width="36.0" x="396.0" y="132.0"/>82- <bpmndi:BPMNLabel>83- <dc:Bounds height="0.0" width="0.0" x="414.0" y="173.0"/>84- </bpmndi:BPMNLabel>85- </bpmndi:BPMNShape>86- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_5" sourceElement="_BPMNShape_ExclusiveGateway_2" targetElement="_BPMNShape_EndEvent_3">87- <di:waypoint xsi:type="dc:Point" x="301.0" y="210.0"/>88- <di:waypoint xsi:type="dc:Point" x="301.0" y="150.0"/>89- <di:waypoint xsi:type="dc:Point" x="396.0" y="150.0"/>90- <bpmndi:BPMNLabel>91- <dc:Bounds height="6.0" width="6.0" x="333.0" y="150.0"/>92- </bpmndi:BPMNLabel>93- </bpmndi:BPMNEdge>94- </bpmndi:BPMNPlane>95- </bpmndi:BPMNDiagram>96-</bpmn2:definitions>97-`,xx=`(draw-column-headers)98-(draw-box "Address" {:span 4})99-(draw-box "Size" {:span 2})100-(draw-box 0 {:span 2})101-(draw-gap "Payload")102-(draw-bottom)103-`,Sx=`dogs -> cats -> mice: chase104-replica 1 <-> replica 2105-a -> b: To err is human, to moo bovine {106- style.animated: true107- source-arrowhead: 1108- target-arrowhead: * {109- shape: diamond110- }111-}112-`,Cx=`Table users {113- id integer114- username varchar115- role varchar116- created_at timestamp117-}118-119-Table posts {120- id integer [primary key]121- title varchar122- body text [note: 'Content of the post']123- user_id integer124- status post_status125- created_at timestamp126-}127-128-Enum post_status {129- draft130- published131- private [note: 'visible via URL only']132-}133-134-Ref: posts.user_id > users.id // many-to-one135-`,wx=`<mxfile host="localhost" modified="2021-05-13T15:13:49.065Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" etag="wSTZ0NLKJqQDPf-wjMNB" version="@DRAWIO-VERSION@" type="device"><diagram id="3228e29e-7158-1315-38df-8450db1d8a1d" name="Page-1">3VpdU+s4DP01PK5HtiTLfmwL3H3ZJ3Zmn0Mb2s4tTSeEBfbXr0LT2wbncvkI7WYDMzSy3CTnyEeSwxlObh+/ldlm8Ucxy1dnDmaPZ3h+5pwlCPqntjxtLUKNYV4uZ43T3nC1/CdvjNBY75ez/K7lWBXFqlpu2sZpsV7n06ply8qyeGi73RSr9lU32TxPDFfTbJVa/1rOqkVjtT7uB37Pl/NFc+ngZDtwnU2/z8vift1cb12s8+3Ibbb7muYZ7xbZrHg4MOHFGU7Koqi2n24fJ/mqhnWH2Hbe5U9Gf9xyma+rt0xwlqmZ9He2um+evLm36mkHhU5S1PVk/LBYVvnVJpvWIw9KvNrKosqqZbFWy28IarhZrlaTYlWUz7PxEoIAq73QecuqDgdfu91VZfE93zk+o4TjRXW70jOrH9OH2d1qXlb544GpebhveXGbV+WTujSj6MAgWYsueI8hNAw1EenYG+/QEgs7jLaJz4c92zrFQAAOzlvhgNFvXRYHvFv9FhSOFAOCOAqNT9bE3/zHXe2J0A8NFz/nxfXIi0VOebkI7PUqp+DFW2fIO6+/7NFjygt7G0J0IZLeJSbE2MgmgKOamaAnMeXFARknMQrqohUl0fbDC36Wlxc0uEsey+QkNDBYDd0YrUdG8YDU5gHZOOuDJ3ZgrfPp+hDoWBAE/SBNPSNt3Wg0fqsQHa4e7h15wmgsB+s9K7awg/ZpB6s1KkkcKIJlQKAEeRetcQREEFXYkEQ6iHA9EcF9pgjqSBGCfjIKJ1kDpBIfiFBCtFFUcNpMeDQYFGjkCACRO4hgQ6A5RKcCk0TqIALEuEBWPFJEiNH1w4tPeBklxCgMVY1kDex6/mexqTl4zgbFurpq/GB3vq3CLLVhrocOE/rz0RP84gy3IbdBARUBDwGDIHfITofq9BXrkmA6HhqmwvACUw1Qzaiq7xIFNBKjHBXTkGA6GRqmAYLRYkUlNWrVwbEt2FpenjJmY4Lv+dDw9ULtUqQdvwLGa65UB4xoO2T4C+FlSOC9GBq8TIkkxHaN4Y4qCZx2naPBaQIzGZF6wQNq+xjbpYPKrDlunKYd43hwmIrnpB44pbZy2u6Nhoeqd+EVdXXxpAinbd54MjiB1S75FYQRgxGwQThErjeLjgpw2r6N/2/4hlPWt5z2YePhFWBRO12P2gVLBPL2RbWApF2yDb7eM6r37Y6Kb0dPdj68CE67MutMjBEic0Br/XGrhbQpGw0uaElrLF37pFAK2wD+Remgw0E1g2zUoCXXscH/hQB3dGWDC1ptD14pcYlOKbs+7cvS7a8370t27ErefPDF1bzMZst8z0njccggfy1tCrFhODhebFcwGl06on21hQAdyyLWwrQ/OvY0lfrgg3gR0gN3+eKznKZ9Ybr99hlO8w++9Do2eW0dg1/wRR2rTEtOiFrb67L1tfpRPwSlTWbaDb3v/dcNX8t0aIywN6CwkmZuAXkrJWLIqVoGbbL0x0o/lKQtaprI3/miLMuuPyB8J6WEgA1GrVRBIvlgO7rYIy6TtKlNc/9ndEzQT7MPvDH77yQhYjIuIEBg9BARO8rfX6chdXFgRbkTFUfaFV3voE9P9/9w8zx28A9NePEv</diagram></mxfile>`,Tx=`[Person]136-*name137-height138-weight139-+birth_location_id140-141-[Location]142-*id143-city144-state145-country146-147-Person *--1 Location148-`,Ex=`{149- "type": "excalidraw",150- "version": 2,151- "source": "https://excalidraw.com",152- "elements": [153- {154- "id": "vWrqOAfkind2qcm7LDAGZ",155- "type": "ellipse",156- "x": 414,157- "y": 237,158- "width": 214,159- "height": 214,160- "angle": 0,161- "strokeColor": "#000000",162- "backgroundColor": "#15aabf",163- "fillStyle": "hachure",164- "strokeWidth": 1,165- "strokeStyle": "solid",166- "roughness": 1,167- "opacity": 100,168- "groupIds": [],169- "strokeSharpness": "sharp",170- "seed": 1041657908,171- "version": 120,172- "versionNonce": 1188004276,173- "isDeleted": false,174- "boundElementIds": null175- },176- {177- "id": "rC-02l026X3SWaucOxDw9",178- "type": "ellipse",179- "x": 563,180- "y": 236,181- "width": 214,182- "height": 214,183- "angle": 0,184- "strokeColor": "#000000",185- "backgroundColor": "#40c057",186- "fillStyle": "hachure",187- "strokeWidth": 1,188- "strokeStyle": "solid",189- "roughness": 1,190- "opacity": 100,191- "groupIds": [],192- "strokeSharpness": "sharp",193- "seed": 476355980,194- "version": 169,195- "versionNonce": 830055604,196- "isDeleted": false,197- "boundElementIds": null198- },199- {200- "id": "DrhW4ZSEpniMojuzsiqvi",201- "type": "ellipse",202- "x": 476,203- "y": 358,204- "width": 214,205- "height": 214,206- "angle": 0,207- "strokeColor": "#000000",208- "backgroundColor": "#7950f2",209- "fillStyle": "hachure",210- "strokeWidth": 1,211- "strokeStyle": "solid",212- "roughness": 1,213- "opacity": 100,214- "groupIds": [],215- "strokeSharpness": "sharp",216- "seed": 1966042508,217- "version": 119,218- "versionNonce": 1553878324,219- "isDeleted": false,220- "boundElementIds": null221- },222- {223- "id": "NMI4ix1W7sQ6z9EDdYwc7",224- "type": "arrow",225- "x": 384.12748830144295,226- "y": 207.60779895196669,227- "width": 119.87251169855705,228- "height": 100.39220104803331,229- "angle": 0,230- "strokeColor": "#000000",231- "backgroundColor": "#7950f2",232- "fillStyle": "hachure",233- "strokeWidth": 1,234- "strokeStyle": "solid",235- "roughness": 1,236- "opacity": 100,237- "groupIds": [],238- "strokeSharpness": "round",239- "seed": 1656470796,240- "version": 69,241- "versionNonce": 1460943500,242- "isDeleted": false,243- "boundElementIds": null,244- "points": [245- [246- 0,247- 0248- ],249- [250- 119.87251169855705,251- 100.39220104803331252- ]253- ],254- "lastCommittedPoint": null,255- "startBinding": {256- "elementId": "3J8-URSbMsKSvZ2TvCc3K",257- "focus": 0.2594107757283838,258- "gap": 7.607798951966686259- },260- "endBinding": null261- },262- {263- "id": "QixLrxvPLw7TbG6VJJ9dj",264- "type": "arrow",265- "x": 652.9917772874236,266- "y": 609.5185939229559,267- "width": 61.74239993095398,268- "height": 105.02421977738851,269- "angle": 0,270- "strokeColor": "#000000",271- "backgroundColor": "#40c057",272- "fillStyle": "hachure",273- "strokeWidth": 1,274- "strokeStyle": "solid",275- "roughness": 1,276- "opacity": 100,277- "groupIds": [],278- "strokeSharpness": "round",279- "seed": 738941452,280- "version": 107,281- "versionNonce": 1655140148,282- "isDeleted": false,283- "boundElementIds": null,284- "points": [285- [286- 0,287- 0288- ],289- [290- -61.74239993095398,291- -105.02421977738851292- ]293- ],294- "lastCommittedPoint": null,295- "startBinding": {296- "elementId": "dhyExWoj7pia0unVwtXeL",297- "focus": 0.1480924722475781,298- "gap": 8.481406077044085299- },300- "endBinding": null301- },302- {303- "id": "LBRnTRdXKmkt5IwhKJLDC",304- "type": "arrow",305- "x": 806.9784146802895,306- "y": 212.38825479040858,307- "width": 104.97841468028946,308- "height": 96.61174520959142,309- "angle": 0,310- "strokeColor": "#000000",311- "backgroundColor": "#40c057",312- "fillStyle": "hachure",313- "strokeWidth": 1,314- "strokeStyle": "solid",315- "roughness": 1,316- "opacity": 100,317- "groupIds": [],318- "strokeSharpness": "round",319- "seed": 751503500,320- "version": 69,321- "versionNonce": 1180701708,322- "isDeleted": false,323- "boundElementIds": null,324- "points": [325- [326- 0,327- 0328- ],329- [330- -104.97841468028946,331- 96.61174520959142332- ]333- ],334- "lastCommittedPoint": null,335- "startBinding": {336- "elementId": "7fiPETvGUweaqK1VIn2zu",337- "focus": -0.07338204068894764,338- "gap": 9.388254790408553339- },340- "endBinding": null341- },342- {343- "id": "VFSwfD_HsZyf5SBKdiFDz",344- "type": "arrow",345- "x": 599.140263160093,346- "y": 191.4445904184276,347- "width": 3.62529516014456,348- "height": 206.31238589940077,349- "angle": 0.13471642395161876,350- "strokeColor": "#000000",351- "backgroundColor": "#40c057",352- "fillStyle": "hachure",353- "strokeWidth": 1,354- "strokeStyle": "solid",355- "roughness": 1,356- "opacity": 100,357- "groupIds": [],358- "strokeSharpness": "round",359- "seed": 1721266612,360- "version": 192,361- "versionNonce": 1388066444,362- "isDeleted": false,363- "boundElementIds": null,364- "points": [365- [366- 0,367- 0368- ],369- [370- 3.62529516014456,371- 206.31238589940077372- ]373- ],374- "lastCommittedPoint": null,375- "startBinding": null,376- "endBinding": null377- },378- {379- "id": "3J8-URSbMsKSvZ2TvCc3K",380- "type": "text",381- "x": 314,382- "y": 175,383- "width": 135,384- "height": 25,385- "angle": 0,386- "strokeColor": "#000000",387- "backgroundColor": "#40c057",388- "fillStyle": "hachure",389- "strokeWidth": 1,390- "strokeStyle": "solid",391- "roughness": 1,392- "opacity": 100,393- "groupIds": [],394- "strokeSharpness": "sharp",395- "seed": 1793099060,396- "version": 43,397- "versionNonce": 2135655476,398- "isDeleted": false,399- "boundElementIds": [400- "NMI4ix1W7sQ6z9EDdYwc7"401- ],402- "text": "want to draw",403- "fontSize": 20,404- "fontFamily": 1,405- "textAlign": "left",406- "verticalAlign": "top",407- "baseline": 18408- },409- {410- "id": "7fiPETvGUweaqK1VIn2zu",411- "type": "text",412- "x": 782,413- "y": 178,414- "width": 89,415- "height": 25,416- "angle": 0,417- "strokeColor": "#000000",418- "backgroundColor": "#40c057",419- "fillStyle": "hachure",420- "strokeWidth": 1,421- "strokeStyle": "solid",422- "roughness": 1,423- "opacity": 100,424- "groupIds": [],425- "strokeSharpness": "sharp",426- "seed": 1750780940,427- "version": 38,428- "versionNonce": 1584702860,429- "isDeleted": false,430- "boundElementIds": [431- "LBRnTRdXKmkt5IwhKJLDC"432- ],433- "text": "can draw",434- "fontSize": 20,435- "fontFamily": 1,436- "textAlign": "left",437- "verticalAlign": "top",438- "baseline": 18439- },440- {441- "id": "dhyExWoj7pia0unVwtXeL",442- "type": "text",443- "x": 612,444- "y": 618,445- "width": 91,446- "height": 25,447- "angle": 0,448- "strokeColor": "#000000",449- "backgroundColor": "#40c057",450- "fillStyle": "hachure",451- "strokeWidth": 1,452- "strokeStyle": "solid",453- "roughness": 1,454- "opacity": 100,455- "groupIds": [],456- "strokeSharpness": "sharp",457- "seed": 1228201396,458- "version": 105,459- "versionNonce": 288443916,460- "isDeleted": false,461- "boundElementIds": [462- "QixLrxvPLw7TbG6VJJ9dj"463- ],464- "text": "have time",465- "fontSize": 20,466- "fontFamily": 1,467- "textAlign": "left",468- "verticalAlign": "top",469- "baseline": 18470- },471- {472- "id": "PKjjaNpqiOpZQ7kml-d18",473- "type": "text",474- "x": 567,475- "y": 148,476- "width": 88,477- "height": 25,478- "angle": 0,479- "strokeColor": "#000000",480- "backgroundColor": "#40c057",481- "fillStyle": "hachure",482- "strokeWidth": 1,483- "strokeStyle": "solid",484- "roughness": 1,485- "opacity": 100,486- "groupIds": [],487- "strokeSharpness": "sharp",488- "seed": 152899636,489- "version": 105,490- "versionNonce": 1333089972,491- "isDeleted": false,492- "boundElementIds": [],493- "text": "NOT ME!",494- "fontSize": 20,495- "fontFamily": 1,496- "textAlign": "left",497- "verticalAlign": "top",498- "baseline": 18499- }500- ],501- "appState": {502- "viewBackgroundColor": "#ffffff",503- "gridSize": null504- }505-}506-`,Dx=`+-------------------+ ^ .---.507-| ‗A Box‗ |__.--.__ __.--> | .-. | |508-| | '--' v | * |<--- | |509-+-------------------+ '-' | |510- \`Round\` *---(-. |511- .-----------------. .-------. .----------. .-------. | | |512- | Mixed Rounded | | | / Diagonals \\ | | | | | |513- | & Square Corners | '--. .--' / \\ |---+---| '-)-' .--------.514- '--+------------+-' .--. | '-------+--------' | | | | / Search /515- | | | | '---. | '-------' | '-+------'516- |<---------->| | | | v Interior | ^517- ' <---' '----' .-----------. ---. .--- v |518- .------------------. Diag line | .-------. +---. \\ / . |519- | if (a > b) +---. .--->| | | | |\`Curved line\` \\ / / \\ |520- | obj->fcn() | \\ / | '-------' |<--' + / \\ |521- '------------------' '--' '--+--------' .--. .--. | .-. +Done?+-'522- .---+-----. | ^ |\\ | | /| .--+ | | \\ /523- | | | Join \\|/ | | \`Curved\` | \\| |/ | | \\ | \\ /524- | | +----> o --o-- '-' Vertical '--' '--' '-- '--' + .---.525- <--+---+-----' | /|\\ | | 3 |526- v not:line 'quotes' .-' '---'527- .-. .---+--------. / A || B ·bold· | ^528- | | | Not a dot | <---+---<-- A dash--is not a line v |529- '-' '---------+--' / Nor/is this. ---530-`,Ox=`[Pirate|eyeCount: Int|raid();pillage()|531- [beard]--[parrot]532- [beard]-:>[foul mouth]533-]534-535-[<abstract>Marauder]<:--[Pirate]536-[Pirate]- 0..7[mischief]537-[jollyness]->[Pirate]538-[jollyness]->[rum]539-[jollyness]->[singing]540-[Pirate]-> *[rum|tastiness: Int|swig()]541-[Pirate]->[singing]542-[singing]<->[rum]543-`,kx=`nwdiag {544- network dmz {545- address = "210.x.x.x/24"546-547- web01 [address = "210.x.x.1"];548- web02 [address = "210.x.x.2"];549- }550- network internal {551- address = "172.x.x.x/24";552-553- web01 [address = "172.x.x.1"];554- web02 [address = "172.x.x.2"];555- db01;556- db02;557- }558-}559-`,Ax=`packetdiag {560- colwidth = 32;561- node_height = 72;562-563- 0-15: Source Port;564- 16-31: Destination Port;565- 32-63: Sequence Number;566- 64-95: Acknowledgment Number;567- 96-99: Data Offset;568- 100-105: Reserved;569- 106: URG [rotate = 270];570- 107: ACK [rotate = 270];571- 108: PSH [rotate = 270];572- 109: RST [rotate = 270];573- 110: SYN [rotate = 270];574- 111: FIN [rotate = 270];575- 112-127: Window;576- 128-143: Checksum;577- 144-159: Urgent Pointer;578- 160-191: (Options and Padding);579- 192-223: data [colheight = 3];580-}581-`,jx=`D: diamond "Cardinal" "Points"582- dot ".n" above at D.n583- dot " .e" ljust at D.e584- dot ".s" below at D.s585- dot ".w " rjust at D.w586-`,Mx=`rackdiag {587- 16U;588- 1: UPS [2U];589- 3: DB Server;590- 4: Web Server;591- 5: Web Server;592- 6: Web Server;593- 7: Load Balancer;594- 8: L3 Switch;595-}596-`,Nx=` .-,( ),-.597- ___ _ .-( )-.598- [___]|=| -->( ) __________599- /::/ |_| '-( ).-' --->[_...__... ]600- '-.( ).-'601- \\ ____ __602- '--->| | |==|603- |____| | |604- /::::/ |__|605-`,Px=`module demo_device #(606- //# {{}}607- parameter SIZE = 8,608- parameter RESET_ACTIVE_LEVEL = 1609-) (610- //# {{clocks|Clocking}}611- input wire clock,612- //# {{control|Control signals}}613- input wire reset,614- input wire enable,615- //# {{data|Data ports}}616- input wire [SIZE-1:0] data_in,617- output wire [SIZE-1:0] data_out618-);619- // ...620-endmodule`,Fx=`% From: https://tikz.net/periodic-table/621-622-% Adapted from https://texample.net/tikz/examples/periodic-table-of-chemical-elements.623-% All Credit to Ivan Griffin.624-625-\\documentclass[tikz,border=5mm]{standalone}626-\\usetikzlibrary{shapes,calc}627-628-\\begin{document}629-630-\\newcommand{\\ElemLabel}[4]{631- \\begin{minipage}{2.2cm}632- \\centering633- {\\textbf{#1} \\hfill #2}%634- \\linebreak \\linebreak635- {\\textbf{#3}}%636- \\linebreak \\linebreak637- {{#4}}638- \\end{minipage}639-}640-641-\\newcommand{\\NaturalElem}[4]{\\ElemLabel{#1}{#2}{\\huge {#3}}{#4}}642-643-\\newcommand{\\SyntheticElem}[4]{\\ElemLabel{#1}{#2}{\\color{gray}{\\huge #3}}{#4}}644-645-\\begin{tikzpicture}[font=\\sffamily]646-647- % Fill Color Styles648- \\tikzstyle{ElementFill} = [fill=yellow!15]649- \\tikzstyle{AlkaliMetalFill} = [fill=blue!55]650- \\tikzstyle{AlkalineEarthMetalFill} = [fill=blue!40]651- \\tikzstyle{MetalFill} = [fill=blue!25]652- \\tikzstyle{MetalloidFill} = [fill=orange!40]653- \\tikzstyle{NonmetalFill} = [fill=teal!40]654- \\tikzstyle{HalogenFill} = [fill=yellow!40]655- \\tikzstyle{NobleGasFill} = [fill=green!55]656- \\tikzstyle{LanthanideActinideFill} = [fill=red!40]657-658- % Element Styles659- \\tikzstyle{Element} = [ElementFill,660- minimum width=2.5cm, minimum height=2.5cm, node distance=2.75cm]661- \\tikzstyle{AlkaliMetal} = [Element, AlkaliMetalFill]662- \\tikzstyle{AlkalineEarthMetal} = [Element, AlkalineEarthMetalFill]663- \\tikzstyle{Metal} = [Element, MetalFill]664- \\tikzstyle{Metalloid} = [Element, MetalloidFill]665- \\tikzstyle{Nonmetal} = [Element, NonmetalFill]666- \\tikzstyle{Halogen} = [Element, HalogenFill]667- \\tikzstyle{NobleGas} = [Element, NobleGasFill]668- \\tikzstyle{LanthanideActinide} = [Element, LanthanideActinideFill]669- \\tikzstyle{PeriodLabel} = [font={\\sffamily\\LARGE}, node distance=2.0cm]670- \\tikzstyle{GroupLabel} = [font={\\sffamily\\LARGE}, minimum width=2.75cm, node distance=2.0cm]671-672- % Group 1 - IA673- \\node[Element] (H) {\\NaturalElem{1} {1.0079}{H}{Hydrogen}};674- \\node[below of=H, AlkaliMetal] (Li) {\\NaturalElem{3}{6.941}{Li}{Lithium}};675- \\node[below of=Li, AlkaliMetal] (Na) {\\NaturalElem{11}{22.990}{Na}{Sodium}};676- \\node[below of=Na, AlkaliMetal] (K) {\\NaturalElem{19}{39.098}{K}{Potassium}};677- \\node[below of=K, AlkaliMetal] (Rb) {\\NaturalElem{37}{85.468}{Rb}{Rubidium}};678- \\node[below of=Rb, AlkaliMetal] (Cs) {\\NaturalElem{55}{132.91}{Cs}{Caesium}};679- \\node[below of=Cs, AlkaliMetal] (Fr) {\\NaturalElem{87}{223}{Fr}{Francium}};680-681- % Group 2 - IIA682- \\node[right of=Li, AlkalineEarthMetal] (Be) {\\NaturalElem{4}{9.0122}{Be}{Beryllium}};683- \\node[below of=Be, AlkalineEarthMetal] (Mg) {\\NaturalElem{12}{24.305}{Mg}{Magnesium}};684- \\node[below of=Mg, AlkalineEarthMetal] (Ca) {\\NaturalElem{20}{40.078}{Ca}{Calcium}};685- \\node[below of=Ca, AlkalineEarthMetal] (Sr) {\\NaturalElem{38}{87.62}{Sr}{Strontium}};686- \\node[below of=Sr, AlkalineEarthMetal] (Ba) {\\NaturalElem{56}{137.33}{Ba}{Barium}};687- \\node[below of=Ba, AlkalineEarthMetal] (Ra) {\\NaturalElem{88}{226}{Ra}{Radium}};688-689- % Group 3 - IIIB690- \\node[right of=Ca, Metal] (Sc) {\\NaturalElem{21}{44.956}{Sc}{Scandium}};691- \\node[below of=Sc, Metal] (Y) {\\NaturalElem{39}{88.906}{Y}{Yttrium}};692- \\node[below of=Y, LanthanideActinide] (LaLu) {\\NaturalElem{57-71}{}{La-Lu}{Lanthanide}};693- \\node[below of=LaLu, LanthanideActinide] (AcLr) {\\NaturalElem{89-103}{}{Ac-Lr}{Actinide}};694-695- % Group 4 - IVB696- \\node[right of=Sc, Metal] (Ti) {\\NaturalElem{22}{47.867}{Ti}{Titanium}};697- \\node[below of=Ti, Metal] (Zr) {\\NaturalElem{40}{91.224}{Zr}{Zirconium}};698- \\node[below of=Zr, Metal] (Hf) {\\NaturalElem{72}{178.49}{Hf}{Hafnium}};699- \\node[below of=Hf, Metal] (Rf) {\\SyntheticElem{104}{261}{Rf}{Rutherfordium}};700-701- % Group 5 - VB702- \\node[right of=Ti, Metal] (V) {\\NaturalElem{23}{50.942}{V}{Vanadium}};703- \\node[below of=V, Metal] (Nb) {\\NaturalElem{41}{92.906}{Nb}{Niobium}};704- \\node[below of=Nb, Metal] (Ta) {\\NaturalElem{73}{180.95}{Ta}{Tantalum}};705- \\node[below of=Ta, Metal] (Db) {\\SyntheticElem{105}{262}{Db}{Dubnium}};706-707- % Group 6 - VIB708- \\node[right of=V, Metal] (Cr) {\\NaturalElem{24}{51.996}{Cr}{Chromium}};709- \\node[below of=Cr, Metal] (Mo) {\\NaturalElem{42}{95.94}{Mo}{Molybdenum}};710- \\node[below of=Mo, Metal] (W) {\\NaturalElem{74}{183.84}{W}{Tungsten}};711- \\node[below of=W, Metal] (Sg) {\\SyntheticElem{106}{266}{Sg}{Seaborgium}};712-713- % Group 7 - VIIB714- \\node[right of=Cr, Metal] (Mn) {\\NaturalElem{25}{54.938}{Mn}{Manganese}};715- \\node[below of=Mn, Metal] (Tc) {\\NaturalElem{43}{96}{Tc}{Technetium}};716- \\node[below of=Tc, Metal] (Re) {\\NaturalElem{75}{186.21}{Re}{Rhenium}};717- \\node[below of=Re, Metal] (Bh) {\\SyntheticElem{107}{264}{Bh}{Bohrium}};718-719- % Group 8 - VIIIB720- \\node[right of=Mn, Metal] (Fe) {\\NaturalElem{26}{55.845}{Fe}{Iron}};721- \\node[below of=Fe, Metal] (Ru) {\\NaturalElem{44}{101.07}{Ru}{Ruthenium}};722- \\node[below of=Ru, Metal] (Os) {\\NaturalElem{76}{190.23}{Os}{Osmium}};723- \\node[below of=Os, Metal] (Hs) {\\SyntheticElem{108}{277}{Hs}{Hassium}};724-725- % Group 9 - VIIIB726- \\node[right of=Fe, Metal] (Co) {\\NaturalElem{27}{58.933}{Co}{Cobalt}};727- \\node[below of=Co, Metal] (Rh) {\\NaturalElem{45}{102.91}{Rh}{Rhodium}};728- \\node[below of=Rh, Metal] (Ir) {\\NaturalElem{77}{192.22}{Ir}{Iridium}};729- \\node[below of=Ir, Metal] (Mt) {\\SyntheticElem{109}{268}{Mt}{Meitnerium}};730-731- % Group 10 - VIIIB732- \\node[right of=Co, Metal] (Ni) {\\NaturalElem{28}{58.693}{Ni}{Nickel}};733- \\node[below of=Ni, Metal] (Pd) {\\NaturalElem{46}{106.42}{Pd}{Palladium}};734- \\node[below of=Pd, Metal] (Pt) {\\NaturalElem{78}{195.08}{Pt}{Platinum}};735- \\node[below of=Pt, Metal] (Ds) {\\SyntheticElem{110}{281}{Ds}{Darmstadtium}};736-737- % Group 11 - IB738- \\node[right of=Ni, Metal] (Cu) {\\NaturalElem{29}{63.546}{Cu}{Copper}};739- \\node[below of=Cu, Metal] (Ag) {\\NaturalElem{47}{107.87}{Ag}{Silver}};740- \\node[below of=Ag, Metal] (Au) {\\NaturalElem{79}{196.97}{Au}{Gold}};741- \\node[below of=Au, Metal] (Rg) {\\SyntheticElem{111}{280}{Rg}{Roentgenium}};742-743- % Group 12 - IIB744- \\node[right of=Cu, Metal] (Zn) {\\NaturalElem{30}{65.39}{Zn}{Zinc}};745- \\node[below of=Zn, Metal] (Cd) {\\NaturalElem{48}{112.41}{Cd}{Cadmium}};746- \\node[below of=Cd, Metal] (Hg) {\\NaturalElem{80}{200.59}{Hg}{Mercury}};747- \\node[below of=Hg, Metal] (Uub) {\\SyntheticElem{112}{285}{Uub}{Ununbium}};748-749- % Group 13 - IIIA750- \\node[right of=Zn, Metal] (Ga) {\\NaturalElem{31}{69.723}{Ga}{Gallium}};751- \\node[above of=Ga, Metal] (Al) {\\NaturalElem{13}{26.982}{Al}{Aluminium}};752- \\node[above of=Al, Metalloid] (B) {\\NaturalElem{5}{10.811}{B}{Boron}};753- \\node[below of=Ga, Metal] (In) {\\NaturalElem{49}{114.82}{In}{Indium}};754- \\node[below of=In, Metal] (Tl) {\\NaturalElem{81}{204.38}{Tl}{Thallium}};755- \\node[below of=Tl, Metal] (Uut) {\\SyntheticElem{113}{284}{Uut}{Ununtrium}};756-757- % Group 14 - IVA758- \\node[right of=B, Nonmetal] (C) {\\NaturalElem{6}{12.011}{C}{Carbon}};759- \\node[below of=C, Metalloid] (Si) {\\NaturalElem{14}{28.086}{Si}{Silicon}};760- \\node[below of=Si, Metalloid] (Ge) {\\NaturalElem{32}{72.64}{Ge}{Germanium}};761- \\node[below of=Ge, Metal] (Sn) {\\NaturalElem{50}{118.71}{Sn}{Tin}};762- \\node[below of=Sn, Metal] (Pb) {\\NaturalElem{82}{207.2}{Pb}{Lead}};763- \\node[below of=Pb, Metal] (Uuq) {\\SyntheticElem{114}{289}{Uuq}{Ununquadium}};764-765- % Group 15 - VA766- \\node[right of=C, Nonmetal] (N) {\\NaturalElem{7}{14.007}{N}{Nitrogen}};767- \\node[below of=N, Nonmetal] (P) {\\NaturalElem{15}{30.974}{P}{Phosphorus}};768- \\node[below of=P, Metalloid] (As) {\\NaturalElem{33}{74.922}{As}{Arsenic}};769- \\node[below of=As, Metalloid] (Sb) {\\NaturalElem{51}{121.76}{Sb}{Antimony}};770- \\node[below of=Sb, Metal] (Bi) {\\NaturalElem{83}{208.98}{Bi}{Bismuth}};771- \\node[below of=Bi, Metal] (Uup) {\\SyntheticElem{115}{288}{Uup}{Ununpentium}};772-773- % Group 16 - VIA774- \\node[right of=N, Nonmetal] (O) {\\NaturalElem{8}{15.999}{O}{Oxygen}};775- \\node[below of=O, Nonmetal] (S) {\\NaturalElem{16}{32.065}{S}{Sulphur}};776- \\node[below of=S, Nonmetal] (Se) {\\NaturalElem{34}{78.96}{Se}{Selenium}};777- \\node[below of=Se, Metalloid] (Te) {\\NaturalElem{52}{127.6}{Te}{Tellurium}};778- \\node[below of=Te, Metalloid] (Po) {\\NaturalElem{84}{209}{Po}{Polonium}};779- \\node[below of=Po, Metal] (Uuh) {\\SyntheticElem{116}{293}{Uuh}{Ununhexium}};780-781- % Group 17 - VIIA782- \\node[right of=O, Halogen] (F) {\\NaturalElem{9}{18.998}{F}{Fluorine}};783- \\node[below of=F, Halogen] (Cl) {\\NaturalElem{17}{35.453}{Cl}{Chlorine}};784- \\node[below of=Cl, Halogen] (Br) {\\NaturalElem{35}{79.904}{Br}{Bromine}};785- \\node[below of=Br, Halogen] (I) {\\NaturalElem{53}{126.9}{I}{Iodine}};786- \\node[below of=I, Halogen] (At) {\\NaturalElem{85}{210}{At}{Astatine}};787- \\node[below of=At, Element] (Uus) {\\SyntheticElem{117}{292}{Uus}{Ununseptium}};788-789- % Group 18 - VIIIA790- \\node[right of=F, NobleGas] (Ne) {\\NaturalElem{10}{20.180}{Ne}{Neon}};791- \\node[above of=Ne, NobleGas] (He) {\\NaturalElem{2}{4.0025}{He}{Helium}};792- \\node[below of=Ne, NobleGas] (Ar) {\\NaturalElem{18}{39.948}{Ar}{Argon}};793- \\node[below of=Ar, NobleGas] (Kr) {\\NaturalElem{36}{83.8}{Kr}{Krypton}};794- \\node[below of=Kr, NobleGas] (Xe) {\\NaturalElem{54}{131.29}{Xe}{Xenon}};795- \\node[below of=Xe, NobleGas] (Rn) {\\NaturalElem{86}{222}{Rn}{Radon}};796- \\node[below of=Rn, Nonmetal] (Uuo) {\\SyntheticElem{118}{294}{Uuo}{Ununoctium}};797-798- % Period799- \\node[left of=H, PeriodLabel] (Period1) {1};800- \\node[left of=Li, PeriodLabel] (Period2) {2};801- \\node[left of=Na, PeriodLabel] (Period3) {3};802- \\node[left of=K, PeriodLabel] (Period4) {4};803- \\node[left of=Rb, PeriodLabel] (Period5) {5};804- \\node[left of=Cs, PeriodLabel] (Period6) {6};805- \\node[left of=Fr, PeriodLabel] (Period7) {7};806-807- % Group808- \\node[above of=H, GroupLabel] (Group1) {1 \\hfill IA};809- \\node[above of=Be, GroupLabel] (Group2) {2 \\hfill IIA};810- \\node[above of=Sc, GroupLabel] (Group3) {3 \\hfill IIIA};811- \\node[above of=Ti, GroupLabel] (Group4) {4 \\hfill IVB};812- \\node[above of=V, GroupLabel] (Group5) {5 \\hfill VB};813- \\node[above of=Cr, GroupLabel] (Group6) {6 \\hfill VIB};814- \\node[above of=Mn, GroupLabel] (Group7) {7 \\hfill VIIB};815- \\node[above of=Fe, GroupLabel] (Group8) {8 \\hfill VIIIB};816- \\node[above of=Co, GroupLabel] (Group9) {9 \\hfill VIIIB};817- \\node[above of=Ni, GroupLabel] (Group10) {10 \\hfill VIIIB};818- \\node[above of=Cu, GroupLabel] (Group11) {11 \\hfill IB};819- \\node[above of=Zn, GroupLabel] (Group12) {12 \\hfill IIB};820- \\node[above of=B, GroupLabel] (Group13) {13 \\hfill IIIA};821- \\node[above of=C, GroupLabel] (Group14) {14 \\hfill IVA};822- \\node[above of=N, GroupLabel] (Group15) {15 \\hfill VA};823- \\node[above of=O, GroupLabel] (Group16) {16 \\hfill VIA};824- \\node[above of=F, GroupLabel] (Group17) {17 \\hfill VIIA};825- \\node[above of=He, GroupLabel] (Group18) {18 \\hfill VIIIA};826-827- % Lanthanide828- \\node[below of=Rf, LanthanideActinide, yshift=-1cm] (La) {\\NaturalElem{57}{138.91}{La}{Lanthanum}};829- \\node[right of=La, LanthanideActinide] (Ce) {\\NaturalElem{58}{140.12}{Ce}{Cerium}};830- \\node[right of=Ce, LanthanideActinide] (Pr) {\\NaturalElem{59}{140.91}{Pr}{Praseodymium}};831- \\node[right of=Pr, LanthanideActinide] (Nd) {\\NaturalElem{60}{144.24}{Nd}{Neodymium}};832- \\node[right of=Nd, LanthanideActinide] (Pm) {\\NaturalElem{61}{145}{Pm}{Promethium}};833- \\node[right of=Pm, LanthanideActinide] (Sm) {\\NaturalElem{62}{150.36}{Sm}{Samarium}};834- \\node[right of=Sm, LanthanideActinide] (Eu) {\\NaturalElem{63}{151.96}{Eu}{Europium}};835- \\node[right of=Eu, LanthanideActinide] (Gd) {\\NaturalElem{64}{157.25}{Gd}{Gadolinium}};836- \\node[right of=Gd, LanthanideActinide] (Tb) {\\NaturalElem{65}{158.93}{Tb}{Terbium}};837- \\node[right of=Tb, LanthanideActinide] (Dy) {\\NaturalElem{66}{162.50}{Dy}{Dysprosium}};838- \\node[right of=Dy, LanthanideActinide] (Ho) {\\NaturalElem{67}{164.93}{Ho}{Holmium}};839- \\node[right of=Ho, LanthanideActinide] (Er) {\\NaturalElem{68}{167.26}{Er}{Erbium}};840- \\node[right of=Er, LanthanideActinide] (Tm) {\\NaturalElem{69}{168.93}{Tm}{Thulium}};841- \\node[right of=Tm, LanthanideActinide] (Yb) {\\NaturalElem{70}{173.04}{Yb}{Ytterbium}};842- \\node[right of=Yb, LanthanideActinide] (Lu) {\\NaturalElem{71}{174.97}{Lu}{Lutetium}};843-844- % Actinide845- \\node[below of=La, LanthanideActinide, yshift=-1cm] (Ac) {\\NaturalElem{89}{227}{Ac}{Actinium}};846- \\node[right of=Ac, LanthanideActinide] (Th) {\\NaturalElem{90}{232.04}{Th}{Thorium}};847- \\node[right of=Th, LanthanideActinide] (Pa) {\\NaturalElem{91}{231.04}{Pa}{Protactinium}};848- \\node[right of=Pa, LanthanideActinide] (U) {\\NaturalElem{92}{238.03}{U}{Uranium}};849- \\node[right of=U, LanthanideActinide] (Np) {\\SyntheticElem{93}{237}{Np}{Neptunium}};850- \\node[right of=Np, LanthanideActinide] (Pu) {\\SyntheticElem{94}{244}{Pu}{Plutonium}};851- \\node[right of=Pu, LanthanideActinide] (Am) {\\SyntheticElem{95}{243}{Am}{Americium}};852- \\node[right of=Am, LanthanideActinide] (Cm) {\\SyntheticElem{96}{247}{Cm}{Curium}};853- \\node[right of=Cm, LanthanideActinide] (Bk) {\\SyntheticElem{97}{247}{Bk}{Berkelium}};854- \\node[right of=Bk, LanthanideActinide] (Cf) {\\SyntheticElem{98}{251}{Cf}{Californium}};855- \\node[right of=Cf, LanthanideActinide] (Es) {\\SyntheticElem{99}{252}{Es}{Einsteinium}};856- \\node[right of=Es, LanthanideActinide] (Fm) {\\SyntheticElem{100}{257}{Fm}{Fermium}};857- \\node[right of=Fm, LanthanideActinide] (Md) {\\SyntheticElem{101}{258}{Md}{Mendelevium}};858- \\node[right of=Md, LanthanideActinide] (No) {\\SyntheticElem{102}{259}{No}{Nobelium}};859- \\node[right of=No, LanthanideActinide] (Lr) {\\SyntheticElem{103}{262}{Lr}{Lawrencium}};860-861- % Draw dotted lines connecting Lanthanide breakout to main table862- \\draw[thick,dotted] (LaLu.north west) -- (La.north west)863- (LaLu.south west) -- (La.south west);864- % Draw dotted lines connecting Actinide breakout to main table865- \\draw[thick,dotted] (AcLr.north west) -- (Ac.north west)866- (AcLr.south west) -- (Ac.south west);867-868- % Legend869- \\fill[AlkaliMetalFill] ($(La.north -| Fr.west) + (0,1em)$)870- rectangle +(1em, 1em) node[right, yshift=-1.2ex] (AlkaliMetal) {Alkali Metal};871- \\fill[AlkalineEarthMetalFill] ($(AlkaliMetal.west) - (1em,2em)$)872- rectangle +(1em, 1em) node[right, yshift=-1.2ex] (AlkalineEarthMetal) {Alkaline Earth Metal};873- \\fill[MetalFill] ($(AlkalineEarthMetal.west) - (1em,2em)$)874- rectangle +(1em, 1em) node[right, yshift=-1.2ex] (Metal) {Metal};875- \\fill[MetalloidFill] ($(Metal.west) - (1em,2em)$)876- rectangle +(1em, 1em) node[right, yshift=-1.2ex] (Metalloid) {Metalloid};877- \\fill[NonmetalFill] ($(Metalloid.west) - (1em,2em)$)878- rectangle +(1em, 1em) node[right, yshift=-1.2ex] (Non-metal) {Non-metal};879- \\fill[HalogenFill] ($(Non-metal.west) - (1em,2em)$)880- rectangle +(1em, 1em) node[right, yshift=-1.2ex] (Halogen) {Halogen};881- \\fill[NobleGasFill] ($(Halogen.west) - (1em,2em)$)882- rectangle +(1em, 1em) node[right, yshift=-1.2ex] (NobleGas) {Noble Gas};883- \\fill[LanthanideActinideFill] ($(NobleGas.west) - (1em,2em)$)884- rectangle +(1em, 1em) node[right, yshift=-1.2ex] (Lanthanide/Actinide) {Lanthanide/Actinide};885-886- \\node at (Ac -| Fr) [draw, Element, fill=white] (legend) {\\NaturalElem{Z}{mass}{\\LARGE Symbol}{Name}};887- \\node[align=left] at (Ac -| Ra) {black: natural\\\\\\color{gray}gray: man-made};888-889- % Diagram Title890- \\node at (H.west -| Fe.north) [scale=2, font={\\sffamily\\Huge\\bfseries}]891- {Periodic Table of Elements};892-893-\\end{tikzpicture}894-895-\\end{document}896-`,Ix=`<?xml version="1.0" encoding="UTF-8"?>897-<umlet_diagram>898- <element>899- <type>com.umlet.element.base.Relation</type>900- <coordinates>901- <x>739</x>902- <y>16</y>903- <w>232</w>904- <h>264</h>905- </coordinates>906- <panel_attributes>lt=<-907- when(spidersensor="rotate")908- /block spider909- </panel_attributes>910- <additional_attributes>161;244;161;34;71;34;71;74</additional_attributes>911- </element>912- <element>913- <type>com.umlet.element.custom.FinalState</type>914- <coordinates>915- <x>890</x>916- <y>260</y>917- <w>20</w>918- <h>20</h>919- </coordinates>920- <panel_attributes></panel_attributes>921- <additional_attributes>transparentSelection=false</additional_attributes>922- </element>923- <element>924- <type>com.umlet.element.base.Relation</type>925- <coordinates>926- <x>750</x>927- <y>170</y>928- <w>160</w>929- <h>137</h>930- </coordinates>931- <panel_attributes>lt=<-932- after (10s)933- / block spider934- </panel_attributes>935- <additional_attributes>140;100;66;100;66;20</additional_attributes>936- </element>937- <element>938- <type>com.umlet.element.custom.State</type>939- <coordinates>940- <x>340</x>941- <y>420</y>942- <w>100</w>943- <h>40</h>944- </coordinates>945- <panel_attributes>wait</panel_attributes>946- <additional_attributes>transparentSelection=false</additional_attributes>947- </element>948- <element>949- <type>com.umlet.element.custom.HistoryState</type>950- <coordinates>951- <x>230</x>952- <y>440</y>953- <w>20</w>954- <h>20</h>955- </coordinates>956- <panel_attributes></panel_attributes>957- <additional_attributes>transparentSelection=false</additional_attributes>958- </element>959- <element>960- <type>com.umlet.element.base.Relation</type>961- <coordinates>962- <x>230</x>963- <y>416</y>964- <w>130</w>965- <h>54</h>966- </coordinates>967- <panel_attributes>lt=<-968- restart969- </panel_attributes>970- <additional_attributes>20;34;110;34</additional_attributes>971- </element>972- <element>973- <type>com.umlet.element.base.Relation</type>974- <coordinates>975- <x>270</x>976- <y>396</y>977- <w>90</w>978- <h>54</h>979- </coordinates>980- <panel_attributes>lt=<-981- pause982- </panel_attributes>983- <additional_attributes>70;34;20;34</additional_attributes>984- </element>985- <element>986- <type>com.umlet.element.custom.FinalState</type>987- <coordinates>988- <x>90</x>989- <y>400</y>990- <w>20</w>991- <h>20</h>992- </coordinates>993- <panel_attributes></panel_attributes>994- <additional_attributes>transparentSelection=false</additional_attributes>995- </element>996- <element>997- <type>com.umlet.element.base.Relation</type>998- <coordinates>999- <x>46</x>1000- <y>256</y>1001- <w>114</w>1002- <h>164</h>1003- </coordinates>1004- <panel_attributes>lt=<-1005- after (10s)1006- /timeout1007- </panel_attributes>1008- <additional_attributes>54;144;54;34;94;34</additional_attributes>1009- </element>1010- <element>1011- <type>com.umlet.element.base.Relation</type>1012- <coordinates>1013- <x>230</x>1014- <y>110</y>1015- <w>190</w>1016- <h>170</h>1017- </coordinates>1018- <panel_attributes>lt=<-1019- timeout1020- </panel_attributes>1021- <additional_attributes>20;150;110;150;110;20;170;20</additional_attributes>1022- </element>1023- <element>1024- <type>com.umlet.element.custom.State</type>1025- <coordinates>1026- <x>700</x>1027- <y>90</y>1028- <w>180</w>1029- <h>100</h>1030- </coordinates>1031- <panel_attributes>accept1032- boarding pass1033- --1034- entry/ release card1035- do/release spider1036- </panel_attributes>1037- <additional_attributes>transparentSelection=true</additional_attributes>1038- </element>1039- <element>1040- <type>com.umlet.element.base.Relation</type>1041- <coordinates>1042- <x>540</x>1043- <y>140</y>1044- <w>205</w>1045- <h>100</h>1046- </coordinates>1047- <panel_attributes>lt=<-1048- [passenger booked]1049- </panel_attributes>1050- <additional_attributes>160;20;120;80;20;80</additional_attributes>1051- </element>1052- <element>1053- <type>com.umlet.element.base.Relation</type>1054- <coordinates>1055- <x>450</x>1056- <y>210</y>1057- <w>239</w>1058- <h>190</h>1059- </coordinates>1060- <panel_attributes>lt=<-1061- [passenger not booked]1062- </panel_attributes>1063- <additional_attributes>219;170;99;170;99;20</additional_attributes>1064- </element>1065- <element>1066- <type>com.umlet.element.custom.State</type>1067- <coordinates>1068- <x>670</x>1069- <y>350</y>1070- <w>120</w>1071- <h>50</h>1072- </coordinates>1073- <panel_attributes>reject1074- boarding pass1075- </panel_attributes>1076- <additional_attributes>transparentSelection=false</additional_attributes>1077- </element>1078- <element>1079- <type>com.umlet.element.base.Relation</type>1080- <coordinates>1081- <x>480</x>1082- <y>130</y>1083- <w>142</w>1084- <h>100</h>1085- </coordinates>1086- <panel_attributes>lt=<-1087- result of search1088- </panel_attributes>1089- <additional_attributes>71;80;71;20</additional_attributes>1090- </element>1091- <element>1092- <type>com.umlet.element.base.Relation</type>1093- <coordinates>1094- <x>270</x>1095- <y>70</y>1096- <w>150</w>1097- <h>40</h>1098- </coordinates>1099- <panel_attributes>lt=<-</panel_attributes>1100- <additional_attributes>130;20;20;20</additional_attributes>1101- </element>1102- <element>1103- <type>com.umlet.element.custom.ThreeWayRelation</type>1104- <coordinates>1105- <x>540</x>1106- <y>210</y>1107- <w>20</w>1108- <h>20</h>1109- </coordinates>1110- <panel_attributes></panel_attributes>1111- <additional_attributes>transparentSelection=false</additional_attributes>1112- </element>1113- <element>1114- <type>com.umlet.element.custom.State</type>1115- <coordinates>1116- <x>140</x>1117- <y>60</y>1118- <w>150</w>1119- <h>420</h>1120- </coordinates>1121- <panel_attributes>read boarding pass1122- --1123- </panel_attributes>1124- <additional_attributes>transparentSelection=true</additional_attributes>1125- </element>1126- <element>1127- <type>com.umlet.element.custom.State</type>1128- <coordinates>1129- <x>400</x>1130- <y>60</y>1131- <w>180</w>1132- <h>90</h>1133- </coordinates>1134- <panel_attributes>check passenger1135- --1136- entry/start search1137- do/blink lamp1138- </panel_attributes>1139- <additional_attributes>transparentSelection=true</additional_attributes>1140- </element>1141- <element>1142- <type>com.umlet.element.custom.FinalState</type>1143- <coordinates>1144- <x>170</x>1145- <y>410</y>1146- <w>20</w>1147- <h>20</h>1148- </coordinates>1149- <panel_attributes></panel_attributes>1150- <additional_attributes>transparentSelection=false</additional_attributes>1151- </element>1152- <element>1153- <type>com.umlet.element.custom.State</type>1154- <coordinates>1155- <x>150</x>1156- <y>240</y>1157- <w>100</w>1158- <h>40</h>1159- </coordinates>1160- <panel_attributes>read1161- passenger ID1162- </panel_attributes>1163- <additional_attributes>transparentSelection=false</additional_attributes>1164- </element>1165- <element>1166- <type>com.umlet.element.custom.State</type>1167- <coordinates>1168- <x>150</x>1169- <y>330</y>1170- <w>100</w>1171- <h>40</h>1172- </coordinates>1173- <panel_attributes>identify1174- passenger1175- </panel_attributes>1176- <additional_attributes>transparentSelection=false</additional_attributes>1177- </element>1178- <element>1179- <type>com.umlet.element.base.Relation</type>1180- <coordinates>1181- <x>160</x>1182- <y>260</y>1183- <w>40</w>1184- <h>90</h>1185- </coordinates>1186- <panel_attributes>lt=<-</panel_attributes>1187- <additional_attributes>20;70;20;20</additional_attributes>1188- </element>1189- <element>1190- <type>com.umlet.element.base.Relation</type>1191- <coordinates>1192- <x>160</x>1193- <y>100</y>1194- <w>40</w>1195- <h>70</h>1196- </coordinates>1197- <panel_attributes>lt=<-</panel_attributes>1198- <additional_attributes>20;50;20;20</additional_attributes>1199- </element>1200- <element>1201- <type>com.umlet.element.base.Relation</type>1202- <coordinates>1203- <x>160</x>1204- <y>350</y>1205- <w>40</w>1206- <h>80</h>1207- </coordinates>1208- <panel_attributes>lt=<-</panel_attributes>1209- <additional_attributes>20;60;20;20</additional_attributes>1210- </element>1211- <element>1212- <type>com.umlet.element.base.Relation</type>1213- <coordinates>1214- <x>140</x>1215- <y>170</y>1216- <w>78</w>1217- <h>90</h>1218- </coordinates>1219- <panel_attributes>lt=<-1220- [valid]1221- </panel_attributes>1222- <additional_attributes>39;70;39;20</additional_attributes>1223- </element>1224- <element>1225- <type>com.umlet.element.custom.State</type>1226- <coordinates>1227- <x>150</x>1228- <y>150</y>1229- <w>100</w>1230- <h>40</h>1231- </coordinates>1232- <panel_attributes>check1233- validity1234- </panel_attributes>1235- <additional_attributes>transparentSelection=false</additional_attributes>1236- </element>1237- <element>1238- <type>com.umlet.element.custom.InitialState</type>1239- <coordinates>1240- <x>170</x>1241- <y>100</y>1242- <w>20</w>1243- <h>20</h>1244- </coordinates>1245- <panel_attributes></panel_attributes>1246- <additional_attributes>transparentSelection=false</additional_attributes>1247- </element>1248-</umlet_diagram>1249-`,Lx=`{1250- "$schema": "https://vega.github.io/schema/vega/v5.json",1251- "width": 400,1252- "height": 200,1253- "padding": 5,1254-1255- "data": [1256- {1257- "name": "table",1258- "values": [1259- {"category": "A", "amount": 28},1260- {"category": "B", "amount": 55},1261- {"category": "C", "amount": 43},1262- {"category": "D", "amount": 91},1263- {"category": "E", "amount": 81},1264- {"category": "F", "amount": 53},1265- {"category": "G", "amount": 19},1266- {"category": "H", "amount": 87}1267- ]1268- }1269- ],1270-1271- "signals": [1272- {1273- "name": "tooltip",1274- "value": {},1275- "on": [1276- {"events": "rect:mouseover", "update": "datum"},1277- {"events": "rect:mouseout", "update": "{}"}1278- ]1279- }1280- ],1281-1282- "scales": [1283- {1284- "name": "xscale",1285- "type": "band",1286- "domain": {"data": "table", "field": "category"},1287- "range": "width",1288- "padding": 0.05,1289- "round": true1290- },1291- {1292- "name": "yscale",1293- "domain": {"data": "table", "field": "amount"},1294- "nice": true,1295- "range": "height"1296- }1297- ],1298-1299- "axes": [1300- { "orient": "bottom", "scale": "xscale" },1301- { "orient": "left", "scale": "yscale" }1302- ],1303-1304- "marks": [1305- {1306- "type": "rect",1307- "from": {"data":"table"},1308- "encode": {1309- "enter": {1310- "x": {"scale": "xscale", "field": "category"},1311- "width": {"scale": "xscale", "band": 1},1312- "y": {"scale": "yscale", "field": "amount"},1313- "y2": {"scale": "yscale", "value": 0}1314- },1315- "update": {1316- "fill": {"value": "steelblue"}1317- },1318- "hover": {1319- "fill": {"value": "red"}1320- }1321- }1322- },1323- {1324- "type": "text",1325- "encode": {1326- "enter": {1327- "align": {"value": "center"},1328- "baseline": {"value": "bottom"},1329- "fill": {"value": "#333"}1330- },1331- "update": {1332- "x": {"scale": "xscale", "signal": "tooltip.category", "band": 0.5},1333- "y": {"scale": "yscale", "signal": "tooltip.amount", "offset": -2},1334- "text": {"signal": "tooltip.amount"},1335- "fillOpacity": [1336- {"test": "datum === tooltip", "value": 0},1337- {"value": 1}1338- ]1339- }1340- }1341- }1342- ]1343-}1344-`,Rx=`{1345- "$schema": "https://vega.github.io/schema/vega-lite/v4.json",1346- "description": "Horizontally concatenated charts that show different types of discretizing scales.",1347- "data": {1348- "values": [1349- {"a": "A", "b": 28},1350- {"a": "B", "b": 55},1351- {"a": "C", "b": 43},1352- {"a": "D", "b": 91},1353- {"a": "E", "b": 81},1354- {"a": "F", "b": 53},1355- {"a": "G", "b": 19},1356- {"a": "H", "b": 87},1357- {"a": "I", "b": 52}1358- ]1359- },1360- "hconcat": [1361- {1362- "mark": "circle",1363- "encoding": {1364- "y": {1365- "field": "b",1366- "type": "nominal",1367- "sort": null,1368- "axis": {1369- "ticks": false,1370- "domain": false,1371- "title": null1372- }1373- },1374- "size": {1375- "field": "b",1376- "type": "quantitative",1377- "scale": {1378- "type": "quantize"1379- }1380- },1381- "color": {1382- "field": "b",1383- "type": "quantitative",1384- "scale": {1385- "type": "quantize",1386- "zero": true1387- },1388- "legend": {1389- "title": "Quantize"1390- }1391- }1392- }1393- },1394- {1395- "mark": "circle",1396- "encoding": {1397- "y": {1398- "field": "b",1399- "type": "nominal",1400- "sort": null,1401- "axis": {1402- "ticks": false,1403- "domain": false,1404- "title": null1405- }1406- },1407- "size": {1408- "field": "b",1409- "type": "quantitative",1410- "scale": {1411- "type": "quantile",1412- "range": [80, 160, 240, 320, 400]1413- }1414- },1415- "color": {1416- "field": "b",1417- "type": "quantitative",1418- "scale": {1419- "type": "quantile",1420- "scheme": "magma"1421- },1422- "legend": {1423- "format": "d",1424- "title": "Quantile"1425- }1426- }1427- }1428- },1429- {1430- "mark": "circle",1431- "encoding": {1432- "y": {1433- "field": "b",1434- "type": "nominal",1435- "sort": null,1436- "axis": {1437- "ticks": false,1438- "domain": false,1439- "title": null1440- }1441- },1442- "size": {1443- "field": "b",1444- "type": "quantitative",1445- "scale": {1446- "type": "threshold",1447- "domain": [30, 70],1448- "range": [80, 200, 320]1449- }1450- },1451- "color": {1452- "field": "b",1453- "type": "quantitative",1454- "scale": {1455- "type": "threshold",1456- "domain": [30, 70],1457- "scheme": "viridis"1458- },1459- "legend": {1460- "title": "Threshold"1461- }1462- }1463- }1464- }1465- ],1466- "resolve": {1467- "scale": {1468- "color": "independent",1469- "size": "independent"1470- }1471- }1472-}1473-`,zx=`{ signal: [1474- { name: "clk", wave: "p.....|..." },1475- { name: "Data", wave: "x.345x|=.x", data: ["head", "body", "tail", "data"] },1476- { name: "Request", wave: "0.1..0|1.0" },1477- {},1478- { name: "Acknowledge", wave: "1.....|01." }1479-]}1480-`,Bx=`connectors:1481- X1:1482- type: D-Sub1483- subtype: female1484- pinlabels: [DCD, RX, TX, DTR, GND, DSR, RTS, CTS, RI]1485- X2:1486- type: Molex KK 2541487- subtype: female1488- pinlabels: [GND, RX, TX]1489-1490-cables:1491- W1:1492- gauge: 0.25 mm21493- length: 0.21494- color_code: DIN1495- wirecount: 31496- shield: true1497-1498-connections:1499- -1500- - X1: [5,2,3]1501- - W1: [1,2,3]1502- - X2: [1,3,2]1503- -1504- - X1: 51505- - W1: s1506-`;function Vx(e){return e^e>>1}function Hx(e,t){let n=Vx(e);return{meta:{title:n&1?t.title:``,description:n&2?t.description:``},presentation:{background:n&4?`#f4f4f4`:``,padding:n&8?24:0,frame:!!(n&16)}}}var Ux=4,Wx=0,Gx=1,Kx=2;function qx(e){let t=e.length;for(;--t>=0;)e[t]=0}var Jx=29,Yx=256,Xx=286,Zx=30,Qx=19,$x=573,eS=15,tS=16,nS=256,rS=16,iS=17,aS=18,oS=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),sS=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]);new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]);var cS=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),lS=512,uS=Array(576);qx(uS);var dS=Array(Zx*2);qx(dS);var fS=Array(lS);qx(fS);var pS=Array(256);qx(pS);var mS=Array(Jx);qx(mS);var hS=Array(Zx);qx(hS);var gS=e=>e<256?fS[e]:fS[256+(e>>>7)],_S=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},vS=(e,t,n)=>{e.bi_valid>tS-n?(e.bi_buf|=t<<e.bi_valid&65535,_S(e,e.bi_buf),e.bi_buf=t>>tS-e.bi_valid,e.bi_valid+=n-tS):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},yS=(e,t,n)=>{vS(e,n[t*2],n[t*2+1])},bS=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},xS=(e,t)=>{let n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,l,u,d,f,p,m,h=0;for(f=0;f<=eS;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<$x;l++)u=e.heap[l],f=n[n[u*2+1]*2+1]+1,f>c&&(f=c,h++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,p=0,u>=s&&(p=o[u-s]),m=n[u*2],e.opt_len+=m*(f+p),a&&(e.static_len+=m*(i[u*2+1]+p)));if(h!==0){do{for(f=c-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,h-=2}while(h>0);for(f=c;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--l],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}},SS=(e,t,n)=>{let r=Array(16),i=0,a,o;for(a=1;a<=eS;a++)i=i+n[a-1]<<1,r[a]=i;for(o=0;o<=t;o++){let t=e[o*2+1];t!==0&&(e[o*2]=bS(r[t]++,t))}},CS=e=>{let t;for(t=0;t<Xx;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Zx;t++)e.dyn_dtree[t*2]=0;for(t=0;t<Qx;t++)e.bl_tree[t*2]=0;e.dyn_ltree[nS*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},wS=e=>{e.bi_valid>8?_S(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},TS=(e,t,n,r)=>{let i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]},ES=(e,t,n)=>{let r=e.heap[n],i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&TS(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!TS(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},DS=(e,t,n)=>{let r,i,a=0,o,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+a++]&255,r+=(e.pending_buf[e.sym_buf+a++]&255)<<8,i=e.pending_buf[e.sym_buf+a++],r===0?yS(e,i,t):(o=pS[i],yS(e,o+Yx+1,t),s=oS[o],s!==0&&(i-=mS[o],vS(e,i,s)),r--,o=gS(r),yS(e,o,n),s=sS[o],s!==0&&(r-=hS[o],vS(e,r,s)));while(a<e.sym_next);yS(e,nS,t)},OS=(e,t)=>{let n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,c=-1,l;for(e.heap_len=0,e.heap_max=$x,o=0;o<a;o++)n[o*2]===0?n[o*2+1]=0:(e.heap[++e.heap_len]=c=o,e.depth[o]=0);for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)ES(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ES(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,ES(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],xS(e,t),SS(n,c,e.bl_count)},kS=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a===0?s<=10?e.bl_tree[34]++:e.bl_tree[36]++:(a!==i&&e.bl_tree[a*2]++,e.bl_tree[32]++),s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))},AS=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do yS(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(yS(e,iS,e.bl_tree),vS(e,s-3,3)):(yS(e,aS,e.bl_tree),vS(e,s-11,7)):(a!==i&&(yS(e,a,e.bl_tree),s--),yS(e,rS,e.bl_tree),vS(e,s-3,2));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}},jS=e=>{let t;for(kS(e,e.dyn_ltree,e.l_desc.max_code),kS(e,e.dyn_dtree,e.d_desc.max_code),OS(e,e.bl_desc),t=18;t>=3&&e.bl_tree[cS[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},MS=(e,t,n,r)=>{let i;for(vS(e,t-257,5),vS(e,n-1,5),vS(e,r-4,4),i=0;i<r;i++)vS(e,e.bl_tree[cS[i]*2+1],3);AS(e,e.dyn_ltree,t-1),AS(e,e.dyn_dtree,n-1)},NS=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return Wx;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return Gx;for(n=32;n<Yx;n++)if(e.dyn_ltree[n*2]!==0)return Gx;return Wx},PS=(e,t,n,r)=>{vS(e,0+ +!!r,3),wS(e),_S(e,n),_S(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},FS=(e,t,n,r)=>{let i,a,o=0;e.level>0?(e.strm.data_type===Kx&&(e.strm.data_type=NS(e)),OS(e,e.l_desc),OS(e,e.d_desc),o=jS(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?PS(e,t,n,r):e.strategy===Ux||a===i?(vS(e,2+ +!!r,3),DS(e,uS,dS)):(vS(e,4+ +!!r,3),MS(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),DS(e,e.dyn_ltree,e.dyn_dtree)),CS(e),r&&wS(e)},IS=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(pS[n]+Yx+1)*2]++,e.dyn_dtree[gS(t)*2]++),e.sym_next===e.sym_end),LS=(e,t,n,r)=>{let i=e&65535|0,a=e>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0},RS=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t})()),zS=(e,t,n,r)=>{let i=RS,a=r+n;e^=-1;for(let n=r;n<a;n++)e=e>>>8^i[(e^t[n])&255];return e^-1},Z=3,BS=258,VS=262,HS=1,US=2,WS=3,GS=4,KS=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)},qS=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,JS=(e,t)=>{let n;if(e.legacy_hash)n=e.ins_h=qS(e,e.ins_h,e.window[t+Z-1]);else{let r=e.window,i=r[t]|r[t+1]<<8|r[t+2]<<16|r[t+3]<<24;n=e.ins_h=Math.imul(i,66521)+66521>>>16&e.hash_mask}let r=e.prev[t&e.w_mask]=e.head[n];return e.head[n]=t,r},YS=e=>{let t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},XS=(e,t)=>{FS(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,YS(e.strm)},ZS=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=LS(e.adler,t,i,n):e.state.wrap===2&&(e.adler=zS(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},QS=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-VS?e.strstart-(e.w_size-VS):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+BS,p=l[r+o-1],m=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,l[i+o]===m&&l[i+o-1]===p&&l[i]===l[r]&&l[++i]===l[r+1]){r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<f);if(a=BS-(f-r),r=f-BS,a>o){if(e.match_start=t,o=a,a>=s)break;p=l[r+o-1],m=l[r+o]}}while((t=d[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead},$S=e=>{let t=e.w_size,n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-VS)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),KS(e),r+=t),e.strm.avail_in===0)break;if(n=ZS(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,!e.legacy_hash){if(e.lookahead+e.insert>Z)for(i=e.strstart-e.insert;e.insert&&(JS(e,i),i++,e.insert--,!(e.lookahead+e.insert<=Z)););}else if(e.lookahead+e.insert>=Z)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=qS(e,e.ins_h,e.window[i+1]);e.insert&&(JS(e,i),i++,e.insert--,!(e.lookahead+e.insert<Z)););}while(e.lookahead<VS&&e.strm.avail_in!==0)},eC=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,a,o=0,s=e.strm.avail_in;do{if(r=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a||(a=e.strm.avail_out-a,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>a&&(r=a),r<n&&(r===0&&t!==4||t===0||r!==i+e.strm.avail_in)))break;o=+(t===4&&r===i+e.strm.avail_in),PS(e,0,0,o),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,YS(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(ZS(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(o===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?GS:t!==0&&t!==4&&e.strm.avail_in===0&&e.strstart===e.block_start?US:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(ZS(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,n=a>e.w_size?e.w_size:a,i=e.strstart-e.block_start,(i>=n||(i||t===4)&&t!==0&&e.strm.avail_in===0&&i<=a)&&(r=i>a?a:i,o=+(t===4&&e.strm.avail_in===0&&r===i),PS(e,e.block_start,r,o),e.block_start+=r,YS(e.strm)),o?WS:HS)},tC=(e,t)=>{let n,r;for(;;){if(e.lookahead<VS){if($S(e),e.lookahead<VS&&t===0)return HS;if(e.lookahead===0)break}if(n=0,e.lookahead>=Z&&(n=JS(e,e.strstart)),n!==0&&e.strstart-n<=e.w_size-VS&&(e.match_length=QS(e,n)),e.match_length>=Z){if(r=IS(e,e.strstart-e.match_start,e.match_length-Z),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Z){e.match_length--;do e.strstart++,n=JS(e,e.strstart);while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.legacy_hash&&(e.ins_h=e.window[e.strstart],e.ins_h=qS(e,e.ins_h,e.window[e.strstart+1]))}else r=IS(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(XS(e,!1),e.strm.avail_out===0))return HS}return e.insert=e.strstart<Z-1?e.strstart:Z-1,t===4?(XS(e,!0),e.strm.avail_out===0?WS:GS):e.sym_next&&(XS(e,!1),e.strm.avail_out===0)?HS:US},nC=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<VS){if($S(e),e.lookahead<VS&&t===0)return HS;if(e.lookahead===0)break}if(n=0,e.lookahead>=Z&&(n=JS(e,e.strstart)),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=Z-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-VS&&(e.match_length=QS(e,n),e.match_length<=5&&(e.strategy===1||e.match_length===Z&&e.strstart-e.match_start>4096)&&(e.match_length=Z-1)),e.prev_length>=Z&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-Z,r=IS(e,e.strstart-1-e.prev_match,e.prev_length-Z),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(n=JS(e,e.strstart));while(--e.prev_length!==0);if(e.match_available=0,e.match_length=Z-1,e.strstart++,r&&(XS(e,!1),e.strm.avail_out===0))return HS}else if(e.match_available){if(r=IS(e,0,e.window[e.strstart-1]),r&&XS(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return HS}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(r=IS(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<Z-1?e.strstart:Z-1,t===4?(XS(e,!0),e.strm.avail_out===0?WS:GS):e.sym_next&&(XS(e,!1),e.strm.avail_out===0)?HS:US},rC=class{constructor(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}};new rC(0,0,0,0,eC),new rC(4,4,8,4,tC),new rC(4,5,16,8,tC),new rC(4,6,32,32,tC),new rC(4,4,16,16,nC),new rC(8,16,32,32,nC),new rC(8,16,128,128,nC),new rC(8,32,128,256,nC),new rC(32,128,258,1024,nC),new rC(32,258,258,4096,nC),new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,199,75]),new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var iC=`plantuml`,aC=`@startuml1507-skinparam monochrome true1508-skinparam shadowing false1509-1510-actor Alice1511-participant "Alice Agent" as AliceAgent1512-participant "Tandem App" as Tandem1513-participant "Bob Agent" as BobAgent1514-actor Bob1515-1516-Alice -> AliceAgent: Describe a shared to-do app1517-AliceAgent -> Tandem: Draft the task flow1518-Bob -> BobAgent: Build and test the API1519-BobAgent -> Tandem: Ship task sync1520-Alice -> Tandem: Add "Buy paint"1521-Tandem -> Bob: Share the new task1522-Bob -> Tandem: Mark it done1523-Tandem --> Alice: Everyone is in sync1524-@enduml`;new TextEncoder,new TextDecoder;function oC(e={}){if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`Invalid diagram metadata.`);let t=e.title??``,n=e.description??``;if(typeof t!=`string`||typeof n!=`string`)throw Error(`Invalid diagram metadata.`);return{title:t,description:n}}function sC(e={}){if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`Invalid diagram presentation.`);let t=e.background??``,n=e.padding??0,r=e.frame??!1;if(typeof t!=`string`||t&&!/^#[0-9a-f]{6}$/i.test(t)||!Number.isInteger(n)||n<0||n>256||typeof r!=`boolean`)throw Error(`Invalid diagram presentation.`);return{background:t,padding:n,frame:r}}var cC={plantuml:aC,mermaid:`flowchart LR1525- Alice([Alice]) -->|describes the shared list| AliceAgent["Alice Agent"]1526- AliceAgent -->|drafts the experience| Tandem["Tandem App"]1527- Bob([Bob]) -->|reviews the plan| BobAgent["Bob Agent"]1528- BobAgent -->|builds and tests the API| Tandem1529- Tandem -->|keeps tasks in sync| Alice1530- Tandem -->|keeps tasks in sync| Bob`,graphviz:`digraph Tandem {1531- rankdir=LR1532- node [shape=box, style="rounded,filled", fillcolor="#eef2ff"]1533- Alice [shape=oval, fillcolor="#fef3c7"]1534- Bob [shape=oval, fillcolor="#dcfce7"]1535- AliceAgent [label="Alice Agent"]1536- BobAgent [label="Bob Agent"]1537- Tandem [label="Tandem App", fillcolor="#ddd6fe"]1538- Alice -> AliceAgent [label="shares an idea"]1539- AliceAgent -> Tandem [label="proposes the flow"]1540- Bob -> BobAgent [label="asks for an API"]1541- BobAgent -> Tandem [label="ships + tests"]1542- Tandem -> { Alice Bob } [label="syncs tasks"]1543-}`,c4plantuml:`@startuml1544-!include <C4/C4_Context>1545-1546-Person(alice, "Alice", "Plans the product and creates shared tasks")1547-Person(bob, "Bob", "Builds the app and completes shared tasks")1548-System(aliceAgent, "Alice Agent", "Turns Alice's ideas into product flows")1549-System(bobAgent, "Bob Agent", "Implements and tests Bob's changes")1550-System(tandem, "Tandem App", "A tiny shared to-do list")1551-1552-Rel(alice, aliceAgent, "Explains what friends need")1553-Rel(aliceAgent, tandem, "Proposes task flows")1554-Rel(bob, bobAgent, "Requests implementation help")1555-Rel(bobAgent, tandem, "Builds and verifies")1556-Rel(alice, tandem, "Creates tasks")1557-Rel(bob, tandem, "Completes tasks")1558-@enduml`,blockdiag:`blockdiag {1559- orientation = portrait1560- Alice -> "Alice Agent" -> "Tandem App";1561- Bob -> "Bob Agent" -> "Tandem App";1562- "Tandem App" -> "Shared task list";1563-1564- Alice [color = "#fde68a"];1565- Bob [color = "#bbf7d0"];1566- "Alice Agent" [color = "#bfdbfe"];1567- "Bob Agent" [color = "#bfdbfe"];1568- "Tandem App" [color = "#ddd6fe"];1569- "Shared task list" [color = "#fecdd3"];1570-}`,seqdiag:`seqdiag {1571- Alice; "Alice Agent"; "Tandem App"; "Bob Agent"; Bob;1572- Alice -> "Alice Agent" [label = "Sketch our shared errands"];1573- "Alice Agent" -> "Tandem App" [label = "Create task: Buy paint"];1574- "Tandem App" -> "Bob Agent" [label = "Task assigned to Bob"];1575- "Bob Agent" -> Bob [label = "Offer a reminder"];1576- Bob -> "Tandem App" [label = "Mark task complete"];1577- "Tandem App" -> Alice [label = "List synced"];1578-}`,actdiag:`actdiag {1579- describe -> shape -> implement -> verify -> share1580-1581- lane Alice {1582- label = "Alice"1583- describe [label = "Describe shared tasks"];1584- share [label = "Try Tandem with Bob"];1585- }1586- lane "Alice Agent" {1587- shape [label = "Shape the task flow"];1588- }1589- lane "Bob Agent" {1590- implement [label = "Build Tandem"];1591- verify [label = "Test task sync"];1592- }1593-}`,structurizr:`workspace "Tandem" "Alice and Bob build a shared to-do app with their agents" {1594- model {1595- alice = person "Alice" "Plans Tandem and creates tasks"1596- bob = person "Bob" "Builds Tandem and completes tasks"1597- aliceAgent = softwareSystem "Alice Agent" "Shapes Alice's ideas into product flows"1598- bobAgent = softwareSystem "Bob Agent" "Implements and tests Bob's changes"1599- tandem = softwareSystem "Tandem App" "Keeps Alice and Bob's tasks in sync"1600-1601- alice -> aliceAgent "Describes the experience"1602- aliceAgent -> tandem "Proposes task flows"1603- bob -> bobAgent "Requests implementation help"1604- bobAgent -> tandem "Builds and tests"1605- alice -> tandem "Creates tasks"1606- bob -> tandem "Completes tasks"1607- }1608- views {1609- systemLandscape "TandemLandscape" {1610- include *1611- autolayout lr1612- }1613- theme default1614- }1615-}`,ditaa:`+-------------+ +-------------+1616-| | | |1617-| Alice | | Bob |1618-| | | |1619-+------+------+ +------+------+1620- | product idea | implementation1621- v v1622-+------+------+ +------+------+1623-| | | |1624-| Alice Agent | | Bob Agent |1625-| | | |1626-+------+------+ +------+------+1627- | task flow | tested build1628- | |1629- +------------------+ +--------------+1630- | |1631- v v1632- +------+---+------+1633- | |1634- | Tandem App |1635- | |1636- +--------+--------+1637- |1638- | persist and sync1639- v1640- +--------+--------+1641- | Shared Tasks |1642- | {s} |1643- +-----------------+`,d2:Sx,nwdiag:kx,packetdiag:Ax,rackdiag:Mx,bpmn:bx.replaceAll(`Examine Situation`,`Bob Agent tests Tandem`).replaceAll(`Things OK?`,`Tests pass?`).replaceAll(`Notification Sent`,`Alice and Bob share tasks`).replaceAll(`Error Propagated`,`Alice Agent revises flow`).replaceAll(`Klaus`,`Alice`).replaceAll(`Walter`,`Bob`),bytefield:xx,dbml:Cx,diagramsnet:wx,erd:Tx,excalidraw:Ex,goat:Dx,nomnoml:Ox,pikchr:jx,svgbob:Nx,symbolator:Px,tikz:Fx,umlet:Ix,vega:Lx,vegalite:Rx,wavedrom:zx,wireviz:Bx},lC={plantuml:[`Tandem task sync`,`Alice and Bob coordinate shared tasks through their agents.`],mermaid:[`Shared task flow`,`A compact view of ideas moving through the Tandem team.`],graphviz:[`Tandem collaboration graph`,`People and agents converge on one synchronized task list.`],d2:[`Connection styles`,`D2 connection, arrowhead, shape, and animation syntax.`],c4plantuml:[`Tandem system context`,`The people and software systems surrounding Tandem.`],blockdiag:[`Tandem block flow`,`A block-oriented view of the shared task workflow.`],seqdiag:[`Tandem task sequence`,`A task moves from Alice to Bob and back through Tandem.`],actdiag:[`Tandem delivery activities`,`Work crosses Alice, Alice Agent, and Bob Agent lanes.`],nwdiag:[`Network layout`,`A sample network topology and its connected address ranges.`],packetdiag:[`TCP packet structure`,`The bit-level layout of a TCP packet header.`],rackdiag:[`Rack layout`,`A sample equipment rack rendered from rackdiag syntax.`],bpmn:[`Agent-assisted review`,`A BPMN review flow that branches on test results.`],bytefield:[`Byte field layout`,`A compact byte-oriented protocol field example.`],dbml:[`Database schema`,`Tables and relationships expressed with DBML.`],diagramsnet:[`Venn diagram`,`An overlapping-set example imported from diagrams.net.`],ditaa:[`Tandem ASCII architecture`,`An ASCII sketch becomes a rendered system diagram.`],erd:[`Data model`,`Entities and relationships in a small relational schema.`],excalidraw:[`Venn sketch`,`A hand-drawn overlapping-set diagram.`],goat:[`Component shapes`,`GoAT exercises boxes, connectors, curves, and symbols.`],nomnoml:[`Pirate class diagram`,`A playful class diagram demonstrating Nomnoml syntax.`],pikchr:[`Cardinal points`,`A diamond marks north, east, south, and west.`],structurizr:[`Tandem landscape`,`A software landscape linking people, agents, and Tandem.`],svgbob:[`Cloud network`,`An ASCII cloud connects clients and services.`],symbolator:[`Hardware component`,`A component symbol generated from interface declarations.`],tikz:[`Periodic table`,`A color-coded periodic table rendered with TikZ.`],umlet:[`UML example`,`A UMLet document rendered directly from its XML form.`],vega:[`Bar chart`,`A declarative bar chart expressed with Vega.`],vegalite:[`Discretizing scale`,`A Vega-Lite example comparing discretized values.`],wavedrom:[`Timing diagram`,`Digital signals and timing relationships rendered by WaveDrom.`],wireviz:[`Wiring harness`,`Connections, cables, and pins described with WireViz.`]};function uC(e){return cC[e]??aC}function dC(e){let t=px.findIndex(t=>t.id===e),[n,r]=lC[e]??[`Diagram example`,`A diagram.zip catalog example.`];return{type:e,source:uC(e),options:{},...Hx(Math.max(t,0),{title:n,description:r})}}function fC(e,t,n,r,i){return e.set(t,{...r,type:t}),e.get(n)??i(n)}var pC=`/api/v1`,mC=/^[A-Za-z0-9_-]{16}$/,hC=/^[A-Za-z0-9_-]{43}$/;function gC(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/,``)}function _C(){return gC(crypto.getRandomValues(new Uint8Array(32)))}function vC(e){return e.match(/^\/d\/([A-Za-z0-9_-]{16})\/?$/)?.[1]??null}function yC(e,t){if(!mC.test(t))throw Error(`Invalid diagram alias.`);return new URL(`/d/${t}`,e).toString()}function bC(e,t,n){if(!hC.test(n))throw Error(`Invalid write capability.`);let r=new URL(yC(e,t));return r.hash=`w=${n}`,r.toString()}function xC(e,t,n=`svg`){if(!mC.test(t))throw Error(`Invalid diagram alias.`);if(n!==`svg`&&n!==`png`)throw Error(`Invalid render format.`);return new URL(`${pC}/aliases/${t}/renders/${n}`,e).toString()}function SC(e){return e.match(/^#w=([A-Za-z0-9_-]{43})$/)?.[1]??null}var CC=class extends Error{constructor(e,{status:t,code:n}={}){super(e),this.status=t,this.code=n}};function wC(e){if(!e||typeof e!=`object`||typeof e.type!=`string`||typeof e.source!=`string`)throw Error(`Invalid diagram state.`);return{mode:`open`,diagram:{type:e.type,source:e.source,options:e.options??{},presentation:sC(e.presentation)},metadata:oC(e.meta)}}function TC(e){if(!e||typeof e!=`object`||!mC.test(e.aliasId)||!hC.test(e.contentId)||!hC.test(e.renderId)||!Number.isSafeInteger(e.revision)||e.mode!==`open`&&e.mode!==`locked`)throw new CC(`The persistence service returned an invalid response.`,{code:`invalid_response`});let t={aliasId:e.aliasId,contentId:e.contentId,renderId:e.renderId,revision:e.revision,mode:e.mode,createdAt:e.createdAt,updatedAt:e.updatedAt};if(e.mode===`locked`){if(!e.encryptedContent||!e.encryptedMetadata||!e.keyEnvelope)throw new CC(`The persistence service returned an invalid locked diagram.`,{code:`invalid_response`});return{...t,encryptedContent:e.encryptedContent,encryptedMetadata:e.encryptedMetadata,keyEnvelope:e.keyEnvelope}}if(!e.diagram||typeof e.diagram!=`object`)throw new CC(`The persistence service returned an invalid open diagram.`,{code:`invalid_response`});return{...t,state:{type:e.diagram.type,source:e.diagram.source,options:e.diagram.options??{},presentation:sC(e.diagram.presentation),meta:oC(e.metadata)}}}var EC=class{constructor({fetchImpl:e=globalThis.fetch,origin:t=globalThis.location?.origin??`http://localhost`,apiPrefix:n=pC}={}){this.fetch=(...t)=>e(...t),this.origin=t,this.apiPrefix=n.replace(/\/$/,``)}url(e=``){return new URL(`${this.apiPrefix}/aliases${e}`,this.origin)}async request(e,t){let n=await this.fetch(e,t),r=await n.json().catch(()=>null);if(!n.ok)throw new CC(r?.error?.message||`Persistence request failed with HTTP ${n.status}.`,{status:n.status,code:r?.error?.code});return TC(r)}async errorFor(e){let t=await e.json().catch(()=>null);return new CC(t?.error?.message||`Persistence request failed with HTTP ${e.status}.`,{status:e.status,code:t?.error?.code})}async createPayload(e){let t=_C();return{...await this.request(this.url(),{method:`POST`,headers:{Authorization:`Bearer ${t}`,"Content-Type":`application/json`},body:JSON.stringify(e)}),writeCapability:t}}createAlias(e){return this.createPayload(wC(e))}createLockedAlias(e){if(e?.mode!==`locked`)throw Error(`Invalid locked diagram payload.`);return this.createPayload(e)}getAlias(e){if(!mC.test(e))throw Error(`Invalid diagram alias.`);return this.request(this.url(`/${e}`),{headers:{Accept:`application/json`}})}updatePayload(e,t,n,r){if(!mC.test(e))throw Error(`Invalid diagram alias.`);if(!Number.isSafeInteger(n)||n<1)throw Error(`Invalid alias revision.`);if(!hC.test(r))throw Error(`Invalid write capability.`);return this.request(this.url(`/${e}`),{method:`PUT`,headers:{Accept:`application/json`,Authorization:`Bearer ${r}`,"Content-Type":`application/json`,"If-Match":`"${n}"`},body:JSON.stringify(t)})}updateAlias(e,t,n,r){return this.updatePayload(e,wC(t),n,r)}updateLockedAlias(e,t,n,r){if(t?.mode!==`locked`)throw Error(`Invalid locked diagram payload.`);return this.updatePayload(e,t,n,r)}async uploadRender({aliasId:e,renderId:t,revision:n,writeCapability:r,format:i,mode:a,render:o}){if(!mC.test(e))throw Error(`Invalid diagram alias.`);if(!hC.test(t))throw Error(`Invalid render ID.`);if(!Number.isSafeInteger(n)||n<1)throw Error(`Invalid alias revision.`);if(!hC.test(r))throw Error(`Invalid write capability.`);if(i!==`svg`&&i!==`png`)throw Error(`Invalid render format.`);if(a!==`open`&&a!==`locked`)throw Error(`Invalid diagram mode.`);let s=a===`locked`?`application/json`:i===`svg`?`image/svg+xml`:`image/png`,c=a===`locked`?JSON.stringify(o):o,l=await this.fetch(this.url(`/${e}/renders/${i}`),{method:`PUT`,headers:{Authorization:`Bearer ${r}`,"Content-Type":s,"If-Match":`"${n}"`,"X-Render-Id":t},body:c});if(!l.ok)throw await this.errorFor(l)}async getEncryptedRender(e,t){if(!mC.test(e))throw Error(`Invalid diagram alias.`);if(t!==`svg`&&t!==`png`)throw Error(`Invalid render format.`);let n=this.url(`/${e}/renders/${t}`);n.searchParams.set(`encrypted`,`1`);let r=await this.fetch(n,{headers:{Accept:`application/json`}});if(!r.ok)throw await this.errorFor(r);return r.json()}},DC=6e5,OC=new TextEncoder,kC=new TextDecoder,AC=OC.encode(`diagram.zip:content:v1`),jC=OC.encode(`diagram.zip:metadata:v1`),MC=OC.encode(`diagram.zip:bundle-key:v1`);function NC(e){if(e!==`svg`&&e!==`png`)throw Error(`Invalid render format.`);return OC.encode(`diagram.zip:render:${e}:v1`)}function PC(e){let t=``,n=32768;for(let r=0;r<e.length;r+=n)t+=String.fromCharCode(...e.subarray(r,r+n));return btoa(t).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/,``)}function FC(e){if(typeof e!=`string`||!/^[A-Za-z0-9_-]+$/.test(e))throw Error(`Invalid encrypted diagram.`);let t=e.replaceAll(`-`,`+`).replaceAll(`_`,`/`),n=t+`=`.repeat((4-t.length%4)%4),r=atob(n),i=Uint8Array.from(r,e=>e.charCodeAt(0));if(PC(i)!==e)throw Error(`Invalid encrypted diagram.`);return i}function IC(e){return crypto.getRandomValues(new Uint8Array(e))}async function LC(e,t){if(!(e instanceof Uint8Array)||e.byteLength!==32)throw Error(`Invalid diagram key.`);return crypto.subtle.importKey(`raw`,e,{name:`AES-GCM`},!1,t)}async function RC(e,{iterations:t,salt:n}){if(typeof e!=`string`)throw Error(`Password is required.`);let r=await crypto.subtle.importKey(`raw`,OC.encode(e),`PBKDF2`,!1,[`deriveKey`]);return crypto.subtle.deriveKey({name:`PBKDF2`,hash:`SHA-256`,iterations:t,salt:n},r,{name:`AES-GCM`,length:256},!1,[`encrypt`,`decrypt`])}async function zC(e,t,n){let r=IC(12),i=await crypto.subtle.encrypt({name:`AES-GCM`,iv:r,additionalData:n,tagLength:128},t,e);return{v:1,alg:`A256GCM`,iv:PC(r),ciphertext:PC(new Uint8Array(i))}}async function BC(e,t,n){if(!e||e.v!==1||e.alg!==`A256GCM`)throw Error(`Invalid encrypted diagram.`);let r=FC(e.iv);if(r.byteLength!==12)throw Error(`Invalid encrypted diagram.`);let i=FC(e.ciphertext);if(i.byteLength<16)throw Error(`Invalid encrypted diagram.`);return new Uint8Array(await crypto.subtle.decrypt({name:`AES-GCM`,iv:r,additionalData:n,tagLength:128},t,i))}async function VC(e,t,n){return zC(OC.encode(JSON.stringify(e)),t,n)}async function HC(e,t,n){return JSON.parse(kC.decode(await BC(e,t,n)))}function UC(e,t){if(!e||typeof e!=`object`||!yx(e.type)||typeof e.source!=`string`||!e.options||typeof e.options!=`object`||Array.isArray(e.options))throw Error(`Invalid encrypted diagram.`);return{type:e.type,source:e.source,options:e.options,presentation:sC(e.presentation),meta:oC(t)}}async function WC(e,t){if(typeof t!=`string`||t.length<8)throw Error(`Password must be at least 8 characters.`);let n=IC(16),r={name:`PBKDF2`,hash:`SHA-256`,iterations:DC,salt:PC(n)};return{v:1,kdf:r,wrap:await zC(e,await RC(t,{iterations:r.iterations,salt:n}),MC)}}async function GC(e,t){if(!e||e.v!==1||e.kdf?.name!==`PBKDF2`||e.kdf.hash!==`SHA-256`||!Number.isInteger(e.kdf.iterations)||e.kdf.iterations<1e5||e.kdf.iterations>5e6)throw Error(`Invalid encrypted diagram.`);let n=FC(e.kdf.salt);if(n.byteLength!==16)throw Error(`Invalid encrypted diagram.`);let r=await RC(t,{iterations:e.kdf.iterations,salt:n}),i=await BC(e.wrap,r,MC);if(i.byteLength!==32)throw Error(`Invalid encrypted diagram.`);return i}async function KC(e,t,n){let r=UC({type:e.type,source:e.source,options:e.options??{},presentation:e.presentation},e.meta),i=await LC(t,[`encrypt`]);return{mode:`locked`,encryptedContent:await VC({type:r.type,source:r.source,options:r.options,presentation:r.presentation},i,AC),encryptedMetadata:await VC(r.meta,i,jC),keyEnvelope:n}}async function qC(e,t){let n=IC(32);return{bundleKey:n,payload:await KC(e,n,await WC(n,t))}}async function JC(e,t){if(!e||e.mode!==`locked`)throw Error(`Invalid encrypted diagram.`);try{let n=await GC(e.keyEnvelope,t),r=await LC(n,[`decrypt`]),[i,a]=await Promise.all([HC(e.encryptedContent,r,AC),HC(e.encryptedMetadata,r,jC)]);return{bundleKey:n,state:UC(i,a)}}catch{throw Error(`Wrong password or damaged diagram.`)}}async function YC(e,t,n){if(!(e instanceof Blob))throw Error(`Invalid rendered image.`);let r=await LC(t,[`encrypt`]);return zC(new Uint8Array(await e.arrayBuffer()),r,NC(n))}function XC(e,t,n){return Math.min(Math.max(e,t),n)}var ZC=class{constructor({stage:e,image:t,status:n,minimap:r,minimapImage:i,minimapViewport:a}){this.stage=e,this.image=t,this.status=n,this.minimap=r,this.minimapImage=i,this.minimapViewport=a,this.scale=1,this.x=0,this.y=0,this.objectUrl=null,this.abortController=null,this.requestNumber=0,this.pendingRender=null,this.renderLoop=null,this.latestRenderKey=null,this.latestSvgBlob=null,this.imageFallbackUrl=null,this.activeImageUrl=null,this.drag=null,this.image.addEventListener(`load`,()=>{this.image.src===this.activeImageUrl&&(this.imageFallbackUrl=null,this.setStatus(`Rendered`,`ready`),this.fit())}),this.image.addEventListener(`error`,()=>this.retryBlockedImage()),this.stage.addEventListener(`pointerdown`,e=>this.startPan(e)),this.stage.addEventListener(`pointermove`,e=>this.pan(e)),this.stage.addEventListener(`pointerup`,e=>this.endPan(e)),this.stage.addEventListener(`pointercancel`,e=>this.endPan(e)),this.stage.addEventListener(`wheel`,e=>this.wheelZoom(e),{passive:!1}),this.minimap.addEventListener(`pointerdown`,e=>this.moveFromMinimap(e)),new ResizeObserver(()=>this.updateTransform()).observe(this.stage)}render({type:e,source:t,options:n={},meta:r={},presentation:i={}}){if(!t.trim()){this.requestNumber++,this.pendingRender=null,this.abortController?.abort(),this.setStatus(`Write something to render.`,`idle`);return}let a=JSON.stringify({type:e,source:t,options:n,meta:r,presentation:i});return this.latestRenderKey===a&&this.latestSvgBlob?Promise.resolve():(this.pendingRender={type:e,source:t,options:n,meta:r,presentation:i,renderKey:a,requestNumber:++this.requestNumber},this.abortController?.abort(),this.renderLoop||=this.drainRenderQueue(),this.renderLoop)}async drainRenderQueue(){try{for(;this.pendingRender;){let e=this.pendingRender;this.pendingRender=null,await this.performRender(e)}}finally{this.renderLoop=null,this.pendingRender&&(this.renderLoop=this.drainRenderQueue())}}async performRender({type:e,source:t,options:n,meta:r,presentation:i,renderKey:a,requestNumber:o}){let s=new AbortController;this.abortController=s,this.setStatus(`Rendering…`,`loading`),this.stage.style.setProperty(`--render-background`,`var(--preview-bg)`);try{let c=await fetch(`/render/v1/svg`,{method:`POST`,headers:{Accept:`image/svg+xml`,"Content-Type":`application/json`},body:JSON.stringify({engine:e,source:t,format:`svg`,options:n,metadata:r,presentation:i}),signal:s.signal});if(o!==this.requestNumber)return;if(!c.ok)throw Error(await this.errorMessage(c));this.status.dataset.cache=c.headers.get(`X-Diagram-Cache`)?.toLowerCase()??`browser`;let{blob:l,background:u}=this.normalizedSvgBlob(await c.text());this.latestRenderKey=a,this.latestSvgBlob=l,this.imageFallbackUrl=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(await l.text())}`,this.stage.style.setProperty(`--render-background`,u);let d=URL.createObjectURL(l),f=this.objectUrl;this.objectUrl=d,this.activeImageUrl=d,this.image.src=d,this.minimapImage.src=d,this.image.hidden=!1,this.setStatus(`Loading image…`,`loading`),f&&URL.revokeObjectURL(f)}catch(e){if(e.name===`AbortError`)return;this.setStatus(e.message||`Could not render this diagram.`,`error`)}finally{this.abortController===s&&(this.abortController=null)}}retryBlockedImage(){if(this.image.src===this.activeImageUrl){if(this.imageFallbackUrl&&this.activeImageUrl.startsWith(`blob:`)){let e=this.imageFallbackUrl;this.imageFallbackUrl=null,this.objectUrl&&URL.revokeObjectURL(this.objectUrl),this.objectUrl=null,this.activeImageUrl=e,this.image.src=e,this.minimapImage.src=e;return}this.setStatus(`The rendered image was blocked or invalid.`,`error`)}}svgBlobFor(e){let{type:t,source:n,options:r={},meta:i={},presentation:a={}}=e,o=JSON.stringify({type:t,source:n,options:r,meta:i,presentation:a});return this.latestRenderKey===o?this.latestSvgBlob:null}async errorMessage(e){let t=await e.text();if(e.headers.get(`Content-Type`)?.includes(`application/json`))try{let e=JSON.parse(t);if(typeof e?.error?.message==`string`)return e.error.message}catch{}return new DOMParser().parseFromString(t,`text/html`).body.textContent.trim().replace(/\s+/g,` `)||`Render failed with HTTP ${e.status}.`}normalizedSvgBlob(e){let t=new DOMParser().parseFromString(e,`image/svg+xml`).documentElement,n=t.getAttribute(`viewBox`)?.trim().split(/[\s,]+/).map(Number);t.nodeName===`svg`&&n?.length===4&&n.every(Number.isFinite)&&(t.hasAttribute(`width`)||t.setAttribute(`width`,String(n[2])),t.hasAttribute(`height`)||t.setAttribute(`height`,String(n[3])),e=new XMLSerializer().serializeToString(t));let r=t.style.backgroundColor||t.style.background,i=r&&r!==`transparent`?r:`#ffffff`;return{blob:new Blob([e],{type:`image/svg+xml`}),background:i}}setStatus(e,t){this.status.textContent=e,this.status.dataset.state=t}zoom(e){if(this.image.hidden)return;let t=this.stage.getBoundingClientRect();this.zoomAt(e,t.width/2,t.height/2)}zoomAt(e,t,n){let r=XC(this.scale*e,.1,8),i=(t-this.x)/this.scale,a=(n-this.y)/this.scale;this.x=t-i*r,this.y=n-a*r,this.scale=r,this.updateTransform()}wheelZoom(e){if(this.image.hidden||e.target.closest(`.preview-toolbar, .minimap`))return;e.preventDefault();let t=this.stage.getBoundingClientRect(),n=e.deltaY*(e.deltaMode===WheelEvent.DOM_DELTA_LINE?16:e.deltaMode===WheelEvent.DOM_DELTA_PAGE?t.height:1);this.zoomAt(Math.exp(-XC(n,-240,240)*.002),e.clientX-t.left,e.clientY-t.top)}oneToOne(){if(this.image.hidden)return;let e=this.stage.getBoundingClientRect();this.scale=1,this.x=(e.width-this.image.naturalWidth)/2,this.y=(e.height-this.image.naturalHeight)/2,this.updateTransform()}fit(){if(!this.image.naturalWidth||!this.image.naturalHeight)return;let e=this.stage.getBoundingClientRect(),t=Math.min(64,e.width*.12);this.scale=XC(Math.min((e.width-t*2)/this.image.naturalWidth,(e.height-t*2)/this.image.naturalHeight),.1,2),this.x=(e.width-this.image.naturalWidth*this.scale)/2,this.y=(e.height-this.image.naturalHeight*this.scale)/2,this.updateTransform()}updateTransform(){this.image.style.transform=`translate(${this.x}px, ${this.y}px) scale(${this.scale})`,this.updateMinimap()}startPan(e){this.image.hidden||e.button!==0||e.target.closest(`.preview-toolbar, .minimap`)||(this.drag={pointerId:e.pointerId,x:e.clientX,y:e.clientY,originX:this.x,originY:this.y},this.stage.setPointerCapture(e.pointerId),this.stage.dataset.dragging=`true`)}pan(e){!this.drag||e.pointerId!==this.drag.pointerId||(this.x=this.drag.originX+e.clientX-this.drag.x,this.y=this.drag.originY+e.clientY-this.drag.y,this.updateTransform())}endPan(e){!this.drag||e.pointerId!==this.drag.pointerId||(this.drag=null,delete this.stage.dataset.dragging)}moveFromMinimap(e){if(!this.image.naturalWidth||!this.image.naturalHeight)return;let t=this.minimap.getBoundingClientRect(),n=Math.min(t.width/this.image.naturalWidth,t.height/this.image.naturalHeight),r=(t.width-this.image.naturalWidth*n)/2,i=(t.height-this.image.naturalHeight*n)/2,a=(e.clientX-t.left-r)/n,o=(e.clientY-t.top-i)/n,s=this.stage.getBoundingClientRect();this.x=s.width/2-a*this.scale,this.y=s.height/2-o*this.scale,this.updateTransform()}updateMinimap(){if(!this.image.naturalWidth||!this.image.naturalHeight)return;let e=this.stage.getBoundingClientRect(),t=this.image.naturalWidth*this.scale,n=this.image.naturalHeight*this.scale,r=this.x>=0&&this.y>=0&&this.x+t<=e.width&&this.y+n<=e.height;if(this.minimap.hidden=r,r)return;let i=this.minimap.getBoundingClientRect(),a=Math.min(i.width/this.image.naturalWidth,i.height/this.image.naturalHeight),o=(i.width-this.image.naturalWidth*a)/2,s=(i.height-this.image.naturalHeight*a)/2,c=XC(-this.x/this.scale,0,this.image.naturalWidth),l=XC(-this.y/this.scale,0,this.image.naturalHeight),u=XC((e.width-this.x)/this.scale,0,this.image.naturalWidth),d=XC((e.height-this.y)/this.scale,0,this.image.naturalHeight);this.minimapViewport.style.left=`${o+c*a}px`,this.minimapViewport.style.top=`${s+l*a}px`,this.minimapViewport.style.width=`${Math.max(4,(u-c)*a)}px`,this.minimapViewport.style.height=`${Math.max(4,(d-l)*a)}px`}},QC=`diagram.zip:draft:local:v2`,$C=`diagram.zip:draft:alias:v1:`,ew=`diagram.zip:write:v1:`,tw=new Oe,nw=new EC,rw,iw=!1,aw,ow=!1,sw=``,Q={aliasId:null,contentId:null,renderId:null,revision:null,mode:`open`,savedMode:null,writeCapability:null,savedState:null,savedSnapshot:null,bundleKey:null,keyEnvelope:null,encryptedContent:null,encryptedMetadata:null,keyEnvelopeDirty:!1,dirty:!0},cw=new Map;document.querySelector(`#app`).innerHTML=`1644- <main class="app-shell">1645- <header class="app-header">1646- <a class="brand" href="/" aria-label="New diagram"><img class="brand-mark" src="/diagram.zip/icon.svg" alt=""><span>diagram.zip</span></a>1647- <div class="header-meta">1648- <span class="render-status" data-state="idle" role="status">Ready</span>1649- <label class="type-picker">1650- <span class="sr-only">Diagram type</span>1651- <select id="diagram-type"></select>1652- </label>1653- <button class="secondary-action" id="details" type="button">Details</button>1654- <button class="secondary-action" id="save" type="button">Save</button>1655- <button class="primary-action" id="share" type="button">Share</button>1656- </div>1657- </header>1658-1659- <div class="mobile-tabs" role="tablist" aria-label="Workspace panel">1660- <button type="button" role="tab" aria-selected="true" data-panel="editor">Edit</button>1661- <button type="button" role="tab" aria-selected="false" data-panel="preview">Preview</button>1662- </div>1663-1664- <div class="workspace" data-mobile-panel="editor">1665- <section class="editor-panel" aria-label="Diagram source">1666- <div id="editor"></div>1667- </section>1668- <section class="preview-panel" aria-label="Diagram preview">1669- <div class="preview-stage" id="preview-stage">1670- <img id="preview-image" alt="Rendered diagram" draggable="false" hidden>1671- <p class="preview-empty">Your diagram will appear here.</p>1672- <div class="preview-toolbar" aria-label="Preview controls">1673- <button type="button" data-preview-action="zoom-out" aria-label="Zoom out">−</button>1674- <button type="button" data-preview-action="zoom-in" aria-label="Zoom in">+</button>1675- <button type="button" data-preview-action="fit">Fit</button>1676- <button type="button" data-preview-action="one-to-one">1:1</button>1677- </div>1678- <div class="minimap" id="minimap" aria-label="Preview minimap" hidden>1679- <img id="minimap-image" alt="" draggable="false">1680- <span id="minimap-viewport" aria-hidden="true"></span>1681- </div>1682- </div>1683- </section>1684- </div>1685- </main>1686-1687- <dialog id="details-dialog" aria-labelledby="details-title">1688- <form method="dialog" class="dialog-card">1689- <div class="dialog-header">1690- <h1 id="details-title">Diagram details</h1>1691- <button class="icon-button" value="cancel" aria-label="Close">×</button>1692- </div>1693- <div class="details-fields">1694- <label>1695- <span>Title</span>1696- <input id="diagram-title" maxlength="200" placeholder="Untitled diagram">1697- </label>1698- <label>1699- <span>Description</span>1700- <textarea id="diagram-description" maxlength="2000" rows="4" placeholder="What does this diagram show?"></textarea>1701- </label>1702- <fieldset class="presentation-fields">1703- <legend>Presentation</legend>1704- <label>1705- <span>Canvas</span>1706- <select id="diagram-background">1707- <option value="">Renderer default</option>1708- <option value="#ffffff">White</option>1709- <option value="#f4f4f4">Soft gray</option>1710- </select>1711- </label>1712- <label>1713- <span>Padding</span>1714- <div class="number-field"><input id="diagram-padding" type="number" min="0" max="256" step="4"><span>px</span></div>1715- </label>1716- <label class="checkbox-field"><input id="diagram-frame" type="checkbox"><span>Frame</span></label>1717- </fieldset>1718- <fieldset class="privacy-fields">1719- <legend>Privacy</legend>1720- <div>1721- <strong id="privacy-label">Open</strong>1722- <p id="privacy-description">Anyone with the read link can open and embed this diagram.</p>1723- </div>1724- <div class="privacy-actions">1725- <button class="secondary-action" id="lock-diagram" type="button">Lock with password</button>1726- <button class="secondary-action" id="change-password" type="button" hidden>Change password</button>1727- <button class="secondary-action" id="unlock-diagram" type="button" hidden>Remove password</button>1728- </div>1729- </fieldset>1730- </div>1731- <div class="dialog-actions">1732- <button class="primary-action" value="done">Done</button>1733- </div>1734- </form>1735- </dialog>1736-1737- <dialog id="share-dialog" aria-labelledby="share-title">1738- <form method="dialog" class="dialog-card">1739- <div class="dialog-header">1740- <h1 id="share-title">Share diagram</h1>1741- <button class="icon-button" value="cancel" aria-label="Close">×</button>1742- </div>1743- <p class="share-status" id="share-status"></p>1744- <div class="share-options">1745- <label><span>Read link</span><div><input id="viewer-link" readonly><button type="button" data-copy="viewer-link">Copy</button></div></label>1746- <label><span>Edit link</span><div><input id="editor-link" readonly><button type="button" data-copy="editor-link">Copy</button></div><small id="editor-link-note">Anyone with this link can update the diagram.</small></label>1747- <label><span>SVG image</span><div><input id="image-link" readonly><button type="button" data-copy="image-link">Copy</button></div><small id="image-link-note"></small></label>1748- <label><span>Markdown</span><div><input id="markdown-link" readonly><button type="button" data-copy="markdown-link">Copy</button></div></label>1749- </div>1750- <div class="dialog-actions share-actions">1751- <button class="primary-action" id="share-save" type="button">Save</button>1752- </div>1753- </form>1754- </dialog>1755-1756- <dialog id="conflict-dialog" aria-labelledby="conflict-title">1757- <form method="dialog" class="dialog-card">1758- <div class="dialog-header">1759- <h1 id="conflict-title">Save conflict</h1>1760- <button class="icon-button" value="cancel" aria-label="Close">×</button>1761- </div>1762- <p class="dialog-copy">Reload the saved version, or keep your work by saving it as a new diagram.</p>1763- <div class="dialog-actions conflict-actions">1764- <button class="secondary-action" value="reload">Reload saved</button>1765- <button class="primary-action" value="copy">Save as new</button>1766- </div>1767- </form>1768- </dialog>1769-1770- <dialog id="password-dialog" aria-labelledby="password-title">1771- <form class="dialog-card" id="password-form">1772- <div class="dialog-header">1773- <h1 id="password-title">Enter password</h1>1774- <button class="icon-button" id="password-cancel" type="button" aria-label="Close">×</button>1775- </div>1776- <p class="dialog-copy" id="password-copy"></p>1777- <div class="details-fields">1778- <label><span>Password</span><input id="diagram-password" type="password" autocomplete="current-password" required></label>1779- <label id="password-confirm-field" hidden><span>Confirm password</span><input id="diagram-password-confirm" type="password" autocomplete="new-password"></label>1780- </div>1781- <p class="form-error" id="password-error" role="alert"></p>1782- <div class="dialog-actions">1783- <button class="primary-action" id="password-submit" type="submit">Unlock</button>1784- </div>1785- </form>1786- </dialog>1787-1788- <div class="toast" id="toast" role="status" aria-live="polite"></div>1789-`;var lw=document.querySelector(`#diagram-type`),uw=document.querySelector(`#diagram-title`),dw=document.querySelector(`#diagram-description`),fw=document.querySelector(`#diagram-background`),pw=document.querySelector(`#diagram-padding`),mw=document.querySelector(`#diagram-frame`);for(let{id:e,label:t}of px)lw.add(new Option(t,e));var hw=await Tw(),gw=oC(hw.meta),_w=sC(hw.presentation);lw.value=hw.type,uw.value=gw.title,dw.value=gw.description,fw.value=_w.background,pw.value=String(_w.padding),mw.checked=_w.frame,$w(),aw=hw.type,cw.set(hw.type,hw);var vw=sd.define([{tag:q.keyword,color:`var(--syntax-keyword)`,fontWeight:`650`},{tag:q.string,color:`var(--syntax-string)`},{tag:[q.comment,q.lineComment,q.blockComment],color:`var(--syntax-comment)`,fontStyle:`italic`},{tag:[q.number,q.bool],color:`var(--syntax-number)`},{tag:[q.operator,q.punctuation],color:`var(--syntax-operator)`},{tag:[q.variableName,q.typeName],color:`var(--syntax-variable)`}]),yw=new H({state:k.create({doc:hw.source,extensions:[A_,tw.of(vx(hw.type)),dd(vw),H.theme({"&":{height:`100%`,backgroundColor:`transparent`},".cm-scroller":{fontFamily:`var(--font-mono)`,lineHeight:`1.65`},".cm-content":{padding:`28px 10px 80px`},".cm-gutters":{backgroundColor:`transparent`,border:`0`,paddingLeft:`12px`},".cm-activeLine, .cm-activeLineGutter":{backgroundColor:`var(--editor-active-line)`},".cm-cursor, .cm-dropCursor":{borderLeftColor:`var(--ink)`},"&.cm-focused":{outline:`none`}}),H.updateListener.of(e=>{e.docChanged&&!iw&&Sw()})]}),parent:document.querySelector(`#editor`)}),bw=new ZC({stage:document.querySelector(`#preview-stage`),image:document.querySelector(`#preview-image`),status:document.querySelector(`.render-status`),minimap:document.querySelector(`#minimap`),minimapImage:document.querySelector(`#minimap-image`),minimapViewport:document.querySelector(`#minimap-viewport`)});lw.addEventListener(`change`,()=>{let e=lw.value;Ew(fC(cw,aw,e,xw(),dC))}),document.querySelector(`#details`).addEventListener(`click`,()=>{document.querySelector(`#details-dialog`).showModal(),uw.focus()});for(let e of[uw,dw,fw,pw,mw])e.addEventListener(`input`,()=>{$w(),clearTimeout(ww.timeout),ww.timeout=setTimeout(ww,220)});document.querySelector(`#details-dialog`).addEventListener(`close`,ww),document.querySelector(`#lock-diagram`).addEventListener(`click`,Fw),document.querySelector(`#change-password`).addEventListener(`click`,Iw),document.querySelector(`#unlock-diagram`).addEventListener(`click`,Lw),document.querySelector(`#save`).addEventListener(`click`,()=>Aw()),document.querySelector(`#share`).addEventListener(`click`,Dw),document.querySelector(`#share-save`).addEventListener(`click`,async()=>{await Aw(),Ow()}),document.querySelector(`.brand`).addEventListener(`click`,e=>{e.preventDefault(),confirm(`Start a new diagram?`)&&Qw()}),document.querySelectorAll(`[data-preview-action]`).forEach(e=>{e.addEventListener(`click`,()=>{let t=e.dataset.previewAction;t===`zoom-out`&&bw.zoom(.8),t===`zoom-in`&&bw.zoom(1.25),t===`fit`&&bw.fit(),t===`one-to-one`&&bw.oneToOne()})}),document.querySelectorAll(`.mobile-tabs button`).forEach(e=>{e.addEventListener(`click`,()=>{document.querySelector(`.workspace`).dataset.mobilePanel=e.dataset.panel,document.querySelectorAll(`.mobile-tabs button`).forEach(t=>{t.setAttribute(`aria-selected`,String(t===e))}),e.dataset.panel===`preview`&&bw.fit()})}),document.querySelectorAll(`[data-copy]`).forEach(e=>{e.addEventListener(`click`,async()=>{let t=document.querySelector(`#${e.dataset.copy}`);t.value&&(await eT(t.value),$(`Copied`))})}),window.addEventListener(`popstate`,()=>location.reload()),window.addEventListener(`keydown`,e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),Aw())});function xw(){let e=Math.min(256,Math.max(0,Number.parseInt(pw.value,10)||0));return{type:lw.value,source:yw.state.doc.toString(),options:{},meta:oC({title:uw.value,description:dw.value}),presentation:sC({background:fw.value,padding:e,frame:mw.checked})}}function Sw(e=1200){clearTimeout(rw),rw=setTimeout(Cw,e)}function Cw(e=!0){let t=xw();Gw(t),Q.dirty=Q.keyEnvelopeDirty||Q.savedSnapshot!==Hw(t,Q.mode),Xw(),Zw(),e&&bw.render(t)}function ww(){clearTimeout(ww.timeout),Cw()}async function Tw(){let e=vC(location.pathname);if(e){let t=SC(location.hash);t&&qw(e,t),location.hash&&history.replaceState(null,``,`${location.pathname}${location.search}`);try{let n=await nw.getAlias(e),r=t??Jw(e);if(n.mode===`locked`){let e=await Rw(n);return e?(Yw(n,r,e.state,e.bundleKey),e.state):(sw=`A password is required to open this diagram.`,dC(iC))}Yw(n,r,n.state);let i=Ww(`${$C}${e}`);return i?.revision===n.revision?i.state:n.state}catch(e){sw=e instanceof CC?e.message:`This saved diagram could not be loaded.`}}location.hash&&history.replaceState(null,``,`${location.pathname}${location.search}`);let t=Ww(QC);return t?t.state:dC(iC)}function Ew(e,t=!0){if(!yx(e.type))throw Error(`Unsupported diagram type.`);let n=oC(e.meta),r=sC(e.presentation);iw=!0,aw=e.type,cw.set(e.type,{...e,meta:n,presentation:r}),lw.value=e.type,uw.value=n.title,dw.value=n.description,fw.value=r.background,pw.value=String(r.padding),mw.checked=r.frame,$w(),yw.dispatch({changes:{from:0,to:yw.state.doc.length,insert:e.source},effects:tw.reconfigure(vx(e.type))}),iw=!1,t?Cw():bw.render(xw())}function Dw(){Cw(),Ow(),document.querySelector(`#share-dialog`).showModal()}function Ow(){let e=!!Q.aliasId,t=e&&Q.savedMode===`locked`,n=e?yC(location.origin,Q.aliasId):``,r=e&&Q.writeCapability?bC(location.origin,Q.aliasId,Q.writeCapability):``,i=t?null:Q.savedState,a=i?xC(location.origin,Q.aliasId,`svg`):``,o=document.querySelector(`#image-link`),s=document.querySelector(`#markdown-link`),c=i?.meta.title.trim().replace(/[\[\]\r\n]/g,` `)||`Diagram`;kw(`viewer-link`,n,`Save to create a read link`),kw(`editor-link`,r,e?`No write capability on this device`:`Save to create an edit link`),kw(`image-link`,a,t?`Encrypted diagrams cannot be embedded`:e?`Unavailable for this diagram`:`Save to create an image link`),kw(`markdown-link`,a?``:``,t?`Encrypted diagrams cannot be embedded`:e?`Unavailable for this diagram`:`Save to create Markdown`),document.querySelector(`#editor-link-note`).textContent=r?`Anyone with this link can update the diagram.`:e?`This device has read-only access. Save a copy to create a new edit link.`:`The edit link is a bearer credential and appears after saving.`,document.querySelector(`#image-link-note`).textContent=t?`This diagram is encrypted in your browser. Image embeds are disabled because they cannot ask for its password.`:``,o.dataset.state=t?`unavailable`:`ready`,s.dataset.state=t?`unavailable`:`ready`;let l=document.querySelector(`#share-status`),u=document.querySelector(`#share-save`);u.hidden=e&&!Q.dirty,e?Q.dirty&&Q.writeCapability?(l.textContent=`These links show the last saved version. Save your changes before sharing.`,u.textContent=`Save changes`):Q.dirty?(l.textContent=`You are editing a read-only diagram. Save a copy to share your changes.`,u.textContent=`Save as new`):l.textContent=t?Q.writeCapability?`The read link asks for the password. The edit link also grants permission to save changes.`:`The read link asks for the password. This device has read-only access.`:Q.writeCapability?`Copy a read link, or share the edit capability carefully.`:`This diagram is read-only on this device.`:(l.textContent=`Save this diagram to create stable share links.`,u.textContent=`Save diagram`)}function kw(e,t,n){let r=document.querySelector(`#${e}`),i=document.querySelector(`[data-copy="${e}"]`);r.value=t,r.placeholder=t?``:n,i.disabled=!t}async function Aw(){if(ow)return!1;Cw(!1);let e=xw();if(Q.aliasId&&!Q.dirty)return $(`Already saved`),!0;ow=!0,Xw();try{if(Q.aliasId&&Q.writeCapability)return Yw(Q.mode===`locked`?await nw.updateLockedAlias(Q.aliasId,await Mw(e),Q.revision,Q.writeCapability):await nw.updateAlias(Q.aliasId,e,Q.revision,Q.writeCapability),Q.writeCapability,e,Q.mode===`locked`?Q.bundleKey:null),Kw(`${$C}${Q.aliasId}`),await Nw(e),$(`Saved`),!0;let t=!!Q.aliasId;return await jw(e),$(t?`Saved as a new diagram`:`Saved`),!0}catch(t){return t instanceof CC&&t.status===412&&Q.aliasId?await Bw(e):($(t instanceof Error?t.message:`Could not save this diagram.`),!1)}finally{ow=!1,Xw()}}async function jw(e){let t=Q.aliasId,n=t?`${$C}${t}`:QC,r=Q.bundleKey,i=Q.mode===`locked`?await nw.createLockedAlias(await Mw(e)):await nw.createAlias(e);Yw(i,i.writeCapability,e,Q.mode===`locked`?r:null),qw(i.aliasId,i.writeCapability),Kw(n),history.pushState(null,``,`/d/${i.aliasId}`),await Nw(e)}async function Mw(e){if(!(Q.bundleKey instanceof Uint8Array)||!Q.keyEnvelope)throw Error(`This diagram is missing its browser encryption key.`);return Q.savedMode===`locked`&&Q.savedSnapshot===Hw(e,`locked`)&&Q.encryptedContent&&Q.encryptedMetadata?{mode:`locked`,encryptedContent:Q.encryptedContent,encryptedMetadata:Q.encryptedMetadata,keyEnvelope:Q.keyEnvelope}:KC(e,Q.bundleKey,Q.keyEnvelope)}async function Nw(e){if(!Q.aliasId||!Q.writeCapability)return;await bw.render(e);let t=bw.svgBlobFor(e);if(!t)return;let n=[[`svg`,t]];try{n.push([`png`,await Pw(t)])}catch{}let r=n.map(async([e,t])=>{let n=Q.mode===`locked`?await YC(t,Q.bundleKey,e):t;return nw.uploadRender({aliasId:Q.aliasId,renderId:Q.renderId,revision:Q.revision,writeCapability:Q.writeCapability,format:e,mode:Q.mode,render:n})});(await Promise.allSettled(r)).every(e=>e.status===`rejected`)&&bw.setStatus(`Saved; render cache unavailable`,`ready`)}async function Pw(e){let t=URL.createObjectURL(e);try{let e=new Image;e.src=t,await e.decode();let n=Math.min(1,4096/Math.max(e.naturalWidth,e.naturalHeight)),r=Math.max(1,Math.round(e.naturalWidth*n)),i=Math.max(1,Math.round(e.naturalHeight*n)),a=document.createElement(`canvas`);a.width=r,a.height=i;let o=a.getContext(`2d`);if(!o)throw Error(`Canvas is unavailable.`);o.drawImage(e,0,0,r,i);let s=await new Promise(e=>a.toBlob(e,`image/png`));if(!s)throw Error(`Could not create a PNG render.`);return s}finally{URL.revokeObjectURL(t)}}async function Fw(){let e=await zw({title:`Lock diagram`,copy:`The source, metadata, and saved render will be encrypted in this browser. The password cannot be recovered.`,submitLabel:`Lock diagram`,confirm:!0});if(e!==null)try{let{bundleKey:t,payload:n}=await qC(xw(),e);Q.mode=`locked`,Q.bundleKey=t,Q.keyEnvelope=n.keyEnvelope,Q.encryptedContent=n.encryptedContent,Q.encryptedMetadata=n.encryptedMetadata,Q.keyEnvelopeDirty=!0,Kw(Q.aliasId?`${$C}${Q.aliasId}`:QC),Cw(!1),$(`Locked in this browser — save to persist`)}catch(e){$(e instanceof Error?e.message:`Could not lock this diagram.`)}}async function Iw(){if(Q.mode!==`locked`||!(Q.bundleKey instanceof Uint8Array))return;let e=await zw({title:`Change password`,copy:`Only the encrypted bundle key will be rewrapped. The diagram content does not need to be re-encrypted.`,submitLabel:`Change password`,confirm:!0});if(e!==null)try{Q.keyEnvelope=await WC(Q.bundleKey,e),Q.keyEnvelopeDirty=!0,Cw(!1),$(`Password changed — save to persist`)}catch(e){$(e instanceof Error?e.message:`Could not change the password.`)}}function Lw(){Q.mode===`locked`&&confirm(`Remove password protection? The next save will store the diagram in plaintext.`)&&(Q.mode=`open`,Q.keyEnvelopeDirty=!1,Cw(!1),$(`Password removed — save to persist`))}async function Rw(e){for(;;){let t=await zw({title:`Unlock diagram`,copy:`Decryption happens only in this browser. The password is never sent to diagram.zip.`,submitLabel:`Unlock`,confirm:!1});if(t===null)return null;try{return await JC(e,t)}catch(e){$(e instanceof Error?e.message:`Could not unlock this diagram.`)}}}function zw({title:e,copy:t,submitLabel:n,confirm:r}){let i=document.querySelector(`#password-dialog`),a=document.querySelector(`#password-form`),o=document.querySelector(`#diagram-password`),s=document.querySelector(`#diagram-password-confirm`),c=document.querySelector(`#password-confirm-field`),l=document.querySelector(`#password-error`);return document.querySelector(`#password-title`).textContent=e,document.querySelector(`#password-copy`).textContent=t,document.querySelector(`#password-submit`).textContent=n,c.hidden=!r,o.autocomplete=r?`new-password`:`current-password`,o.value=``,s.value=``,l.textContent=``,new Promise(e=>{let t=!1,n=n=>{t||(t=!0,a.removeEventListener(`submit`,c),document.querySelector(`#password-cancel`).removeEventListener(`click`,u),i.removeEventListener(`cancel`,u),i.removeEventListener(`close`,d),e(n))},c=e=>{e.preventDefault();let t=o.value;if(r&&t.length<8){l.textContent=`Use at least 8 characters.`,o.focus();return}if(r&&t!==s.value){l.textContent=`The passwords do not match.`,s.focus();return}i.close(),n(t)},u=e=>{e.preventDefault(),i.close(),n(null)},d=()=>n(null);a.addEventListener(`submit`,c),document.querySelector(`#password-cancel`).addEventListener(`click`,u),i.addEventListener(`cancel`,u),i.addEventListener(`close`,d),i.showModal(),o.focus()})}async function Bw(e){let t=await Vw();if(t===`reload`){let e=Q.aliasId,t=Q.writeCapability;try{let n=await nw.getAlias(e),r=n.state,i=null;if(n.mode===`locked`){let e=await Rw(n);if(!e)return!1;r=e.state,i=e.bundleKey}return Yw(n,t,r,i),Kw(`${$C}${e}`),Ew(r,!1),Xw(),$(`Reloaded saved diagram`),!0}catch(e){return $(e instanceof Error?e.message:`Could not reload this diagram.`),!1}}return t===`copy`&&(await jw(e),$(`Saved as a new diagram`),!0)}function Vw(){let e=document.querySelector(`#conflict-dialog`);return e.returnValue=``,e.showModal(),new Promise(t=>{e.addEventListener(`close`,()=>t(e.returnValue),{once:!0})})}function Hw(e,t=`open`){return JSON.stringify({mode:t,type:e.type,source:e.source,options:e.options??{},meta:oC(e.meta),presentation:sC(e.presentation)})}function Uw(e){if(!e||typeof e!=`object`||!yx(e.type)||typeof e.source!=`string`)return null;try{return{type:e.type,source:e.source,options:e.options??{},meta:oC(e.meta),presentation:sC(e.presentation)}}catch{return null}}function Ww(e){try{let t=JSON.parse(localStorage.getItem(e)),n=Uw(t?.state);return n?{state:n,revision:t.revision??null}:null}catch{return null}}function Gw(e){if(Q.mode===`locked`)return;let t=Q.aliasId?`${$C}${Q.aliasId}`:QC;try{localStorage.setItem(t,JSON.stringify({state:e,revision:Q.revision}))}catch{}}function Kw(e){try{localStorage.removeItem(e)}catch{}}function qw(e,t){try{localStorage.setItem(`${ew}${e}`,t)}catch{}}function Jw(e){try{return SC(`#w=${localStorage.getItem(`${ew}${e}`)??``}`)}catch{return null}}function Yw(e,t,n,r=null){Q={aliasId:e.aliasId,contentId:e.contentId,renderId:e.renderId,revision:e.revision,mode:e.mode,savedMode:e.mode,writeCapability:t,savedState:n,savedSnapshot:Hw(n,e.mode),bundleKey:r,keyEnvelope:e.mode===`locked`?e.keyEnvelope:null,encryptedContent:e.mode===`locked`?e.encryptedContent:null,encryptedMetadata:e.mode===`locked`?e.encryptedMetadata:null,keyEnvelopeDirty:!1,dirty:!1},Zw(),Xw()}function Xw(){let e=document.querySelector(`#save`);if(ow){e.textContent=`Saving…`,e.disabled=!0;return}if(Q.aliasId&&!Q.dirty){e.textContent=`Saved`,e.disabled=!0;return}e.textContent=Q.aliasId&&!Q.writeCapability?`Save copy`:`Save`,e.disabled=!1}function Zw(){let e=Q.mode===`locked`;document.querySelector(`#privacy-label`).textContent=e?`Password locked`:`Open`,document.querySelector(`#privacy-description`).textContent=e?`Source, metadata, and saved renders are encrypted in your browser. Password-locked diagrams cannot be embedded.`:`Anyone with the read link can open and embed this diagram.`,document.querySelector(`#lock-diagram`).hidden=e,document.querySelector(`#change-password`).hidden=!e,document.querySelector(`#unlock-diagram`).hidden=!e}function Qw(){Q={aliasId:null,contentId:null,renderId:null,revision:null,mode:`open`,savedMode:null,writeCapability:null,savedState:null,savedSnapshot:null,bundleKey:null,keyEnvelope:null,encryptedContent:null,encryptedMetadata:null,keyEnvelopeDirty:!1,dirty:!0},cw.clear(),history.pushState(null,``,`/`),Ew(dC(iC))}function $w(){let e=uw.value.trim(),t=dw.value.trim();document.title=e?`${e} — diagram.zip`:`diagram.zip`,document.querySelector(`meta[name="description"]`).content=t||`Create diagrams from text and share them as a link.`}async function eT(e){if(navigator.clipboard)return navigator.clipboard.writeText(e);let t=document.createElement(`textarea`);t.value=e,document.body.append(t),t.select(),document.execCommand(`copy`),t.remove()}function $(e){let t=document.querySelector(`#toast`);t.textContent=e,t.dataset.visible=`true`,clearTimeout($.timeout),$.timeout=setTimeout(()=>delete t.dataset.visible,1800)}Cw(),sw&&$(sw);\ No newline at end of file@@ -7,7 +7,7 @@
77 <meta name="description" content="Create diagrams from text and share them as a link.">88 <link rel="icon" href="/diagram.zip/icon.svg" type="image/svg+xml">99 <title>diagram.zip</title>10- <script type="module" crossorigin src="/diagram.zip/assets/index-DkSU_3-S.js"></script>10+ <script type="module" crossorigin src="/diagram.zip/assets/index-Ddnf8em0.js"></script>1111 <link rel="stylesheet" crossorigin href="/diagram.zip/assets/index-B2XsKz37.css">1212 </head>1313 <body>@@ -0,0 +1,14 @@
1+2+<html lang="en">3+ <head>4+ <meta charset="UTF-8">5+ <meta6+ http-equiv="Content-Security-Policy"7+ content="default-src 'none'; script-src *; style-src 'unsafe-inline'; img-src data:; font-src data:; connect-src 'none'; worker-src 'none'; frame-src 'none'"8+ >9+ <title>diagram.zip renderer</title>10+ </head>11+ <body>12+ <script src="/diagram.zip/renderer-frame.js"></script>13+ </body>14+</html>@@ -0,0 +1,3590 @@
1+(function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),l=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},u=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var l=r(i),u=0,d=l.length,f;u<d;u++)f=l[u],!a.call(e,f)&&f!==o&&t(e,f,{get:(e=>i[e]).bind(null,f),enumerable:!(s=n(i,f))||s.enumerable});return e},d=(n,r,o)=>(o=n==null?{}:e(i(n)),u(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),f,p,m,h=o((()=>{f=Object.defineProperty,p=(e,t)=>f(e,`name`,{value:t,configurable:!0}),m=(e,t)=>{for(var n in t)f(e,n,{get:t[n],enumerable:!0})}})),g=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){"use strict";var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,l=`week`,u=`month`,d=`quarter`,f=`year`,p=`date`,m=`Invalid Date`,h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,_={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},v=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},y={s:v,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+v(r,2,`0`)+`:`+v(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,u),a=n-i<0,o=t.clone().add(r+(a?-1:1),u);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:f,w:l,d:s,D:p,h:o,m:a,s:i,ms:r,Q:d}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},b=`en`,x={};x[b]=_;var S=`$isDayjsObject`,C=function(e){return e instanceof D||!(!e||!e[S])},w=function e(t,n,r){var i;if(!t)return b;if(typeof t==`string`){var a=t.toLowerCase();x[a]&&(i=a),n&&(x[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;x[s]=t,i=s}return!r&&i&&(b=i),i||!r&&b},T=function(e,t){if(C(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new D(n)},E=y;E.l=w,E.i=C,E.w=function(e,t){return T(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var D=function(){function _(e){this.$L=w(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[S]=!0}var v=_.prototype;return v.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(E.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(h);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},v.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},v.$utils=function(){return E},v.isValid=function(){return this.$d.toString()!==m},v.isSame=function(e,t){var n=T(e);return this.startOf(t)<=n&&n<=this.endOf(t)},v.isAfter=function(e,t){return T(e)<this.startOf(t)},v.isBefore=function(e,t){return this.endOf(t)<T(e)},v.$g=function(e,t,n){return E.u(e)?this[t]:this.set(n,e)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(e,t){var n=this,r=!!E.u(t)||t,d=E.p(e),m=function(e,t){var i=E.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},h=function(e,t){return E.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},g=this.$W,_=this.$M,v=this.$D,y=`set`+(this.$u?`UTC`:``);switch(d){case f:return r?m(1,0):m(31,11);case u:return r?m(1,_):m(0,_+1);case l:var b=this.$locale().weekStart||0,x=(g<b?g+7:g)-b;return m(r?v-x:v+(6-x),_);case s:case p:return h(y+`Hours`,0);case o:return h(y+`Minutes`,1);case a:return h(y+`Seconds`,2);case i:return h(y+`Milliseconds`,3);default:return this.clone()}},v.endOf=function(e){return this.startOf(e,!1)},v.$set=function(e,t){var n,l=E.p(e),d=`set`+(this.$u?`UTC`:``),m=(n={},n[s]=d+`Date`,n[p]=d+`Date`,n[u]=d+`Month`,n[f]=d+`FullYear`,n[o]=d+`Hours`,n[a]=d+`Minutes`,n[i]=d+`Seconds`,n[r]=d+`Milliseconds`,n)[l],h=l===s?this.$D+(t-this.$W):t;if(l===u||l===f){var g=this.clone().set(p,1);g.$d[m](h),g.init(),this.$d=g.set(p,Math.min(this.$D,g.daysInMonth())).$d}else m&&this.$d[m](h);return this.init(),this},v.set=function(e,t){return this.clone().$set(e,t)},v.get=function(e){return this[E.p(e)]()},v.add=function(r,d){var p,m=this;r=Number(r);var h=E.p(d),g=function(e){var t=T(m);return E.w(t.date(t.date()+Math.round(e*r)),m)};if(h===u)return this.set(u,this.$M+r);if(h===f)return this.set(f,this.$y+r);if(h===s)return g(1);if(h===l)return g(7);var _=(p={},p[a]=t,p[o]=n,p[i]=e,p)[h]||1,v=this.$d.getTime()+r*_;return E.w(v,this)},v.subtract=function(e,t){return this.add(-1*e,t)},v.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||m;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=E.z(this),a=this.$H,o=this.$m,s=this.$M,l=n.weekdays,u=n.months,d=n.meridiem,f=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},p=function(e){return E.s(a%12||12,e,`0`)},h=d||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(g,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return E.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return E.s(s+1,2,`0`);case`MMM`:return f(n.monthsShort,s,u,3);case`MMMM`:return f(u,s);case`D`:return t.$D;case`DD`:return E.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return f(n.weekdaysMin,t.$W,l,2);case`ddd`:return f(n.weekdaysShort,t.$W,l,3);case`dddd`:return l[t.$W];case`H`:return String(a);case`HH`:return E.s(a,2,`0`);case`h`:return p(1);case`hh`:return p(2);case`a`:return h(a,o,!0);case`A`:return h(a,o,!1);case`m`:return String(o);case`mm`:return E.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return E.s(t.$s,2,`0`);case`SSS`:return E.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(r,p,m){var h,g=this,_=E.p(p),v=T(r),y=(v.utcOffset()-this.utcOffset())*t,b=this-v,x=function(){return E.m(g,v)};switch(_){case f:h=x()/12;break;case u:h=x();break;case d:h=x()/3;break;case l:h=(b-y)/6048e5;break;case s:h=(b-y)/864e5;break;case o:h=b/n;break;case a:h=b/t;break;case i:h=b/e;break;default:h=b}return m?h:E.a(h)},v.daysInMonth=function(){return this.endOf(u).$D},v.$locale=function(){return x[this.$L]},v.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=w(e,t,!0);return r&&(n.$L=r),n},v.clone=function(){return E.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},_}(),O=D.prototype;return T.prototype=O,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,u],[`$y`,f],[`$D`,p]].forEach((function(e){O[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),T.extend=function(e,t){return e.$i||=(e(t,D,T),!0),T},T.locale=w,T.isDayjs=C,T.unix=function(e){return T(1e3*e)},T.en=x[b],T.Ls=x,T.p={},T}))})),_,v,y,b,x,S=o((()=>{h(),_=d(g(),1),v={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},y={trace:p((...e)=>{},`trace`),debug:p((...e)=>{},`debug`),info:p((...e)=>{},`info`),warn:p((...e)=>{},`warn`),error:p((...e)=>{},`error`),fatal:p((...e)=>{},`fatal`)},b=p(function(e=`fatal`){let t=v.fatal;typeof e==`string`?e.toLowerCase()in v&&(t=v[e]):typeof e==`number`&&(t=e),y.trace=()=>{},y.debug=()=>{},y.info=()=>{},y.warn=()=>{},y.error=()=>{},y.fatal=()=>{},t<=v.fatal&&(y.fatal=console.error?console.error.bind(console,x(`FATAL`),`color: orange`):console.log.bind(console,`\x1B[35m`,x(`FATAL`))),t<=v.error&&(y.error=console.error?console.error.bind(console,x(`ERROR`),`color: orange`):console.log.bind(console,`\x1B[31m`,x(`ERROR`))),t<=v.warn&&(y.warn=console.warn?console.warn.bind(console,x(`WARN`),`color: orange`):console.log.bind(console,`\x1B[33m`,x(`WARN`))),t<=v.info&&(y.info=console.info?console.info.bind(console,x(`INFO`),`color: lightblue`):console.log.bind(console,`\x1B[34m`,x(`INFO`))),t<=v.debug&&(y.debug=console.debug?console.debug.bind(console,x(`DEBUG`),`color: lightgreen`):console.log.bind(console,`\x1B[32m`,x(`DEBUG`))),t<=v.trace&&(y.trace=console.debug?console.debug.bind(console,x(`TRACE`),`color: lightgreen`):console.log.bind(console,`\x1B[32m`,x(`TRACE`)))},`setLogLevel`),x=p(e=>`%c${(0,_.default)().format(`ss.SSS`)} : ${e} : `,`format`)})),C,w=o((()=>{C={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{let t=e/255;return e>.03928?((t+.055)/1.055)**2.4:t/12.92},hue2rgb:(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),hsl2rgb:({h:e,s:t,l:n},r)=>{if(!t)return n*2.55;e/=360,t/=100,n/=100;let i=n<.5?n*(1+t):n+t-n*t,a=2*n-i;switch(r){case`r`:return C.hue2rgb(a,i,e+1/3)*255;case`g`:return C.hue2rgb(a,i,e)*255;case`b`:return C.hue2rgb(a,i,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:n},r)=>{e/=255,t/=255,n/=255;let i=Math.max(e,t,n),a=Math.min(e,t,n),o=(i+a)/2;if(r===`l`)return o*100;if(i===a)return 0;let s=i-a,l=o>.5?s/(2-i-a):s/(i+a);if(r===`s`)return l*100;switch(i){case e:return((t-n)/s+(t<n?6:0))*60;case t:return((n-e)/s+2)*60;case n:return((e-t)/s+4)*60;default:return-1}}}})),T,E=o((()=>{T={clamp:(e,t,n)=>t>n?Math.min(t,Math.max(n,e)):Math.min(n,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10}})),D,O=o((()=>{D={dec2hex:e=>{let t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}}})),k,A=o((()=>{w(),E(),O(),k={channel:C,lang:T,unit:D}})),j,M,N=o((()=>{A(),j={};for(let e=0;e<=255;e++)j[e]=k.unit.dec2hex(e);M={ALL:0,RGB:1,HSL:2}})),P,F=o((()=>{N(),P=class{constructor(){this.type=M.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw Error(`Cannot change both RGB and HSL channels at the same time`);this.type=e}reset(){this.type=M.ALL}is(e){return this.type===e}}})),I,L=o((()=>{A(),F(),N(),I=class{constructor(e,t){this.color=t,this.changed=!1,this.data=e,this.type=new P}set(e,t){return this.color=t,this.changed=!1,this.data=e,this.type.type=M.ALL,this}_ensureHSL(){let e=this.data,{h:t,s:n,l:r}=e;t===void 0&&(e.h=k.channel.rgb2hsl(e,`h`)),n===void 0&&(e.s=k.channel.rgb2hsl(e,`s`)),r===void 0&&(e.l=k.channel.rgb2hsl(e,`l`))}_ensureRGB(){let e=this.data,{r:t,g:n,b:r}=e;t===void 0&&(e.r=k.channel.hsl2rgb(e,`r`)),n===void 0&&(e.g=k.channel.hsl2rgb(e,`g`)),r===void 0&&(e.b=k.channel.hsl2rgb(e,`b`))}get r(){let e=this.data,t=e.r;return!this.type.is(M.HSL)&&t!==void 0?t:(this._ensureHSL(),k.channel.hsl2rgb(e,`r`))}get g(){let e=this.data,t=e.g;return!this.type.is(M.HSL)&&t!==void 0?t:(this._ensureHSL(),k.channel.hsl2rgb(e,`g`))}get b(){let e=this.data,t=e.b;return!this.type.is(M.HSL)&&t!==void 0?t:(this._ensureHSL(),k.channel.hsl2rgb(e,`b`))}get h(){let e=this.data,t=e.h;return!this.type.is(M.RGB)&&t!==void 0?t:(this._ensureRGB(),k.channel.rgb2hsl(e,`h`))}get s(){let e=this.data,t=e.s;return!this.type.is(M.RGB)&&t!==void 0?t:(this._ensureRGB(),k.channel.rgb2hsl(e,`s`))}get l(){let e=this.data,t=e.l;return!this.type.is(M.RGB)&&t!==void 0?t:(this._ensureRGB(),k.channel.rgb2hsl(e,`l`))}get a(){return this.data.a}set r(e){this.type.set(M.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(M.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(M.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(M.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(M.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(M.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}})),R,ee=o((()=>{L(),R=new I({r:0,g:0,b:0,a:0},`transparent`)})),z,B=o((()=>{ee(),N(),z={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;let t=e.match(z.re);if(!t)return;let n=t[1],r=parseInt(n,16),i=n.length,a=i%4==0,o=i>4,s=o?1:17,l=o?8:4,u=a?0:-1,d=o?255:15;return R.set({r:(r>>l*(u+3)&d)*s,g:(r>>l*(u+2)&d)*s,b:(r>>l*(u+1)&d)*s,a:a?(r&d)*s/255:1},e)},stringify:e=>{let{r:t,g:n,b:r,a:i}=e;return i<1?`#${j[Math.round(t)]}${j[Math.round(n)]}${j[Math.round(r)]}${j[Math.round(i*255)]}`:`#${j[Math.round(t)]}${j[Math.round(n)]}${j[Math.round(r)]}`}}})),te,ne=o((()=>{A(),ee(),te={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{let t=e.match(te.hueRe);if(t){let[,e,n]=t;switch(n){case`grad`:return k.channel.clamp.h(parseFloat(e)*.9);case`rad`:return k.channel.clamp.h(parseFloat(e)*180/Math.PI);case`turn`:return k.channel.clamp.h(parseFloat(e)*360)}}return k.channel.clamp.h(parseFloat(e))},parse:e=>{let t=e.charCodeAt(0);if(t!==104&&t!==72)return;let n=e.match(te.re);if(!n)return;let[,r,i,a,o,s]=n;return R.set({h:te._hue2deg(r),s:k.channel.clamp.s(parseFloat(i)),l:k.channel.clamp.l(parseFloat(a)),a:o?k.channel.clamp.a(s?parseFloat(o)/100:parseFloat(o)):1},e)},stringify:e=>{let{h:t,s:n,l:r,a:i}=e;return i<1?`hsla(${k.lang.round(t)}, ${k.lang.round(n)}%, ${k.lang.round(r)}%, ${i})`:`hsl(${k.lang.round(t)}, ${k.lang.round(n)}%, ${k.lang.round(r)}%)`}}})),re,ie=o((()=>{B(),re={colors:{aliceblue:`#f0f8ff`,antiquewhite:`#faebd7`,aqua:`#00ffff`,aquamarine:`#7fffd4`,azure:`#f0ffff`,beige:`#f5f5dc`,bisque:`#ffe4c4`,black:`#000000`,blanchedalmond:`#ffebcd`,blue:`#0000ff`,blueviolet:`#8a2be2`,brown:`#a52a2a`,burlywood:`#deb887`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,cornflowerblue:`#6495ed`,cornsilk:`#fff8dc`,crimson:`#dc143c`,cyanaqua:`#00ffff`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,darkkhaki:`#bdb76b`,darkmagenta:`#8b008b`,darkolivegreen:`#556b2f`,darkorange:`#ff8c00`,darkorchid:`#9932cc`,darkred:`#8b0000`,darksalmon:`#e9967a`,darkseagreen:`#8fbc8f`,darkslateblue:`#483d8b`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,darkturquoise:`#00ced1`,darkviolet:`#9400d3`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1e90ff`,firebrick:`#b22222`,floralwhite:`#fffaf0`,forestgreen:`#228b22`,fuchsia:`#ff00ff`,gainsboro:`#dcdcdc`,ghostwhite:`#f8f8ff`,gold:`#ffd700`,goldenrod:`#daa520`,gray:`#808080`,green:`#008000`,greenyellow:`#adff2f`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,indianred:`#cd5c5c`,indigo:`#4b0082`,ivory:`#fffff0`,khaki:`#f0e68c`,lavender:`#e6e6fa`,lavenderblush:`#fff0f5`,lawngreen:`#7cfc00`,lemonchiffon:`#fffacd`,lightblue:`#add8e6`,lightcoral:`#f08080`,lightcyan:`#e0ffff`,lightgoldenrodyellow:`#fafad2`,lightgray:`#d3d3d3`,lightgreen:`#90ee90`,lightgrey:`#d3d3d3`,lightpink:`#ffb6c1`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,lightskyblue:`#87cefa`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#b0c4de`,lightyellow:`#ffffe0`,lime:`#00ff00`,limegreen:`#32cd32`,linen:`#faf0e6`,magenta:`#ff00ff`,maroon:`#800000`,mediumaquamarine:`#66cdaa`,mediumblue:`#0000cd`,mediumorchid:`#ba55d3`,mediumpurple:`#9370db`,mediumseagreen:`#3cb371`,mediumslateblue:`#7b68ee`,mediumspringgreen:`#00fa9a`,mediumturquoise:`#48d1cc`,mediumvioletred:`#c71585`,midnightblue:`#191970`,mintcream:`#f5fffa`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,navajowhite:`#ffdead`,navy:`#000080`,oldlace:`#fdf5e6`,olive:`#808000`,olivedrab:`#6b8e23`,orange:`#ffa500`,orangered:`#ff4500`,orchid:`#da70d6`,palegoldenrod:`#eee8aa`,palegreen:`#98fb98`,paleturquoise:`#afeeee`,palevioletred:`#db7093`,papayawhip:`#ffefd5`,peachpuff:`#ffdab9`,peru:`#cd853f`,pink:`#ffc0cb`,plum:`#dda0dd`,powderblue:`#b0e0e6`,purple:`#800080`,rebeccapurple:`#663399`,red:`#ff0000`,rosybrown:`#bc8f8f`,royalblue:`#4169e1`,saddlebrown:`#8b4513`,salmon:`#fa8072`,sandybrown:`#f4a460`,seagreen:`#2e8b57`,seashell:`#fff5ee`,sienna:`#a0522d`,silver:`#c0c0c0`,skyblue:`#87ceeb`,slateblue:`#6a5acd`,slategray:`#708090`,slategrey:`#708090`,snow:`#fffafa`,springgreen:`#00ff7f`,tan:`#d2b48c`,teal:`#008080`,thistle:`#d8bfd8`,transparent:`#00000000`,turquoise:`#40e0d0`,violet:`#ee82ee`,wheat:`#f5deb3`,white:`#ffffff`,whitesmoke:`#f5f5f5`,yellow:`#ffff00`,yellowgreen:`#9acd32`},parse:e=>{e=e.toLowerCase();let t=re.colors[e];if(t)return z.parse(t)},stringify:e=>{let t=z.stringify(e);for(let e in re.colors)if(re.colors[e]===t)return e}}})),ae,oe=o((()=>{A(),ee(),ae={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{let t=e.charCodeAt(0);if(t!==114&&t!==82)return;let n=e.match(ae.re);if(!n)return;let[,r,i,a,o,s,l,u,d]=n;return R.set({r:k.channel.clamp.r(i?parseFloat(r)*2.55:parseFloat(r)),g:k.channel.clamp.g(o?parseFloat(a)*2.55:parseFloat(a)),b:k.channel.clamp.b(l?parseFloat(s)*2.55:parseFloat(s)),a:u?k.channel.clamp.a(d?parseFloat(u)/100:parseFloat(u)):1},e)},stringify:e=>{let{r:t,g:n,b:r,a:i}=e;return i<1?`rgba(${k.lang.round(t)}, ${k.lang.round(n)}, ${k.lang.round(r)}, ${k.lang.round(i)})`:`rgb(${k.lang.round(t)}, ${k.lang.round(n)}, ${k.lang.round(r)})`}}})),se,ce=o((()=>{B(),ne(),ie(),oe(),N(),se={format:{keyword:re,hex:z,rgb:ae,rgba:ae,hsl:te,hsla:te},parse:e=>{if(typeof e!=`string`)return e;let t=z.parse(e)||ae.parse(e)||te.parse(e)||re.parse(e);if(t)return t;throw Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(M.HSL)||e.data.r===void 0?te.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?ae.stringify(e):z.stringify(e)}})),le,ue=o((()=>{A(),ce(),le=(e,t)=>{let n=se.parse(e);for(let e in t)n[e]=k.channel.clamp[e](t[e]);return se.stringify(n)}})),de,fe=o((()=>{A(),ee(),ce(),ue(),de=(e,t,n=0,r=1)=>{if(typeof e!=`number`)return le(e,{a:t});let i=R.set({r:k.channel.clamp.r(e),g:k.channel.clamp.g(t),b:k.channel.clamp.b(n),a:k.channel.clamp.a(r)});return se.stringify(i)}})),pe,me=o((()=>{A(),ce(),pe=(e,t)=>k.lang.round(se.parse(e)[t])})),he,ge=o((()=>{A(),ce(),he=e=>{let{r:t,g:n,b:r}=se.parse(e),i=.2126*k.channel.toLinear(t)+.7152*k.channel.toLinear(n)+.0722*k.channel.toLinear(r);return k.lang.round(i)}})),_e,ve=o((()=>{ge(),_e=e=>he(e)>=.5})),ye,be=o((()=>{ve(),ye=e=>!_e(e)})),xe,Se=o((()=>{A(),ce(),xe=(e,t,n)=>{let r=se.parse(e),i=r[t],a=k.channel.clamp[t](i+n);return i!==a&&(r[t]=a),se.stringify(r)}})),V,Ce=o((()=>{Se(),V=(e,t)=>xe(e,`l`,t)})),we,Te=o((()=>{Se(),we=(e,t)=>xe(e,`l`,-t)})),Ee,De=o((()=>{Se(),Ee=(e,t)=>xe(e,`a`,-t)})),H,Oe=o((()=>{ce(),ue(),H=(e,t)=>{let n=se.parse(e),r={};for(let e in t)t[e]&&(r[e]=n[e]+t[e]);return le(e,r)}})),ke,Ae=o((()=>{ce(),fe(),ke=(e,t,n=50)=>{let{r,g:i,b:a,a:o}=se.parse(e),{r:s,g:l,b:u,a:d}=se.parse(t),f=n/100,p=f*2-1,m=o-d,h=((p*m===-1?p:(p+m)/(1+p*m))+1)/2,g=1-h,_=r*h+s*g,v=i*h+l*g,y=a*h+u*g,b=o*f+d*(1-f);return de(_,v,y,b)}})),U,je=o((()=>{ce(),Ae(),U=(e,t=100)=>{let n=se.parse(e);return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,ke(n,e,t)}})),Me=o((()=>{fe(),me(),be(),Ce(),Te(),De(),Oe(),je()})),Ne=o((()=>{Me()}));function Pe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Fe(e){if(Array.isArray(e))return e}function Ie(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}function Le(){throw TypeError(`Invalid attempt to destructure non-iterable instance.2+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Re(e,t){return Fe(e)||Ie(e,t)||ze(e,t)||Le()}function ze(e,t){if(e){if(typeof e==`string`)return Pe(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pe(e,t):void 0}}function Be(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return it(e,t,r)}}function Ve(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return at(e,n)}}function He(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ft;if(Xe&&Xe(e,null),!dt(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Ze(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Ue(e){for(let t=0;t<e.length;t++)xt(e,t)||(e[t]=null);return e}function We(e){let t=nt(null);for(let r of Ye(e)){var n=Re(r,2);let i=n[0],a=n[1];xt(e,i)&&(t[i]=dt(a)?Ue(a):a&&typeof a==`object`&&a.constructor===Object?We(a):a)}return t}function Ge(e){switch(typeof e){case`string`:return e;case`number`:return _t(e);case`boolean`:return vt(e);case`bigint`:return yt?yt(e):`0`;case`symbol`:return bt?bt(e):`Symbol()`;case`undefined`:return St(e);case`function`:case`object`:{if(e===null)return St(e);let t=e,n=Ke(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:St(e)}return St(e)}default:return St(e)}}function Ke(e,t){for(;e!==null;){let n=$e(e,t);if(n){if(n.get)return Be(n.get);if(typeof n.value==`function`)return Be(n.value)}e=Qe(e)}function n(){return null}return n}function qe(e){try{return Ct(e,``),!0}catch{return!1}}function Je(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fee(),t=e=>Je(e);if(t.version=`3.4.14`,t.removed=[],!e||!e.document||e.document.nodeType!==Vt.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,l=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let u=e.DOMParser,d=e.trustedTypes,f=s.prototype,p=Ke(f,`cloneNode`),m=Ke(f,`remove`),h=Ke(f,`nextSibling`),g=Ke(f,`childNodes`),_=Ke(f,`parentNode`),v=Ke(f,`shadowRoot`),y=Ke(f,`attributes`),b=o&&o.prototype?Ke(o.prototype,`nodeType`):null,x=o&&o.prototype?Ke(o.prototype,`nodeName`):null,S=o&&o.prototype?Ke(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let T,E=``,D,O=!1,k=0,A=function(){if(k>0)throw wt(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},j=function(e){A(),k++;try{return T.createHTML(e)}finally{k--}},M=function(e){A(),k++;try{return T.createScriptURL(e)}finally{k--}},N=function(){return O||=(D=pee(d,i),!0),D},P=n,F=P.implementation,I=P.createNodeIterator,L=P.createDocumentFragment,R=P.getElementsByTagName,ee=r.importNode,z=Ut();t.isSupported=typeof Ye==`function`&&typeof _==`function`&&F&&F.createHTMLDocument!==void 0;let B=nee,te=ree,ne=iee,re=aee,ie=Ft,ae=Lt,oe=Rt,se=see,ce=It,le=null,ue=He({},[...Tt,...Et,...Dt,...Ot,...At]),de=null,fe=He({},[...jt,...Mt,...Nt,...Pt]),pe=Object.seal(nt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),me=null,he=null,ge=Object.seal(nt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),_e=!0,ve=!0,ye=!1,be=!0,xe=!1,Se=!0,V=!1,Ce=!1,we=null,Te=null,Ee=!1,De=!1,H=!1,Oe=!1,ke=!0,Ae=!1,U=`user-content-`,je=!0,Me=!1,Ne={},Pe=null,Fe=He({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ie=null,Le=He({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Re=null,ze=He({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Be=`http://www.w3.org/1998/Math/MathML`,Ve=`http://www.w3.org/2000/svg`,Ue=`http://www.w3.org/1999/xhtml`,Xe=Ue,Ze=!1,Qe=null,$e=He({},[Be,Ve,Ue],pt),rt=et([`mi`,`mo`,`mn`,`ms`,`mtext`]),it=He({},rt),at=et([`annotation-xml`]),_t=He({},at),vt=He({},[`title`,`style`,`font`,`a`,`script`]),yt=null,bt=[`application/xhtml+xml`,`text/html`],St=null,Ht=null,Kt=n.createElement(`form`),qt=function(e){return e instanceof RegExp||e instanceof Function},Jt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ht&&Ht===e)return;(!e||typeof e!=`object`)&&(e={}),e=We(e),yt=bt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,St=yt===`application/xhtml+xml`?pt:ft,le=Wt(e,`ALLOWED_TAGS`,ue,{transform:St}),de=Wt(e,`ALLOWED_ATTR`,fe,{transform:St}),Qe=Wt(e,`ALLOWED_NAMESPACES`,$e,{transform:pt}),Re=Wt(e,`ADD_URI_SAFE_ATTR`,ze,{transform:St,base:ze}),Ie=Wt(e,`ADD_DATA_URI_TAGS`,Le,{transform:St,base:Le}),Pe=Wt(e,`FORBID_CONTENTS`,Fe,{transform:St}),me=Wt(e,`FORBID_TAGS`,We({}),{transform:St}),he=Wt(e,`FORBID_ATTR`,We({}),{transform:St}),Ne=xt(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?We(e.USE_PROFILES):e.USE_PROFILES:!1,_e=e.ALLOW_ARIA_ATTR!==!1,ve=e.ALLOW_DATA_ATTR!==!1,ye=e.ALLOW_UNKNOWN_PROTOCOLS||!1,be=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,xe=e.SAFE_FOR_TEMPLATES||!1,Se=e.SAFE_FOR_XML!==!1,V=e.WHOLE_DOCUMENT||!1,De=e.RETURN_DOM||!1,H=e.RETURN_DOM_FRAGMENT||!1,Oe=e.RETURN_TRUSTED_TYPE||!1,Ee=e.FORCE_BODY||!1,ke=e.SANITIZE_DOM!==!1,Ae=e.SANITIZE_NAMED_PROPS||!1,je=e.KEEP_CONTENT!==!1,Me=e.IN_PLACE||!1,ce=qe(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:It,Xe=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ue,it=Gt(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>He({},rt)),_t=Gt(e,`HTML_INTEGRATION_POINTS`,()=>He({},at));let t=Gt(e,`CUSTOM_ELEMENT_HANDLING`,()=>nt(null));if(pe=nt(null),xt(t,`tagNameCheck`)&&qt(t.tagNameCheck)&&(pe.tagNameCheck=t.tagNameCheck),xt(t,`attributeNameCheck`)&&qt(t.attributeNameCheck)&&(pe.attributeNameCheck=t.attributeNameCheck),xt(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(pe.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),tt(pe),xe&&(ve=!1),H&&(De=!0),Ne&&(le=He({},At),de=nt(null),Ne.html===!0&&(He(le,Tt),He(de,jt)),Ne.svg===!0&&(He(le,Et),He(de,Mt),He(de,Pt)),Ne.svgFilters===!0&&(He(le,Dt),He(de,Mt),He(de,Pt)),Ne.mathMl===!0&&(He(le,Ot),He(de,Nt),He(de,Pt))),ge.tagCheck=null,ge.attributeCheck=null,xt(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?ge.tagCheck=e.ADD_TAGS:dt(e.ADD_TAGS)&&(le===ue&&(le=We(le)),He(le,e.ADD_TAGS,St))),xt(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?ge.attributeCheck=e.ADD_ATTR:dt(e.ADD_ATTR)&&(de===fe&&(de=We(de)),He(de,e.ADD_ATTR,St))),xt(e,`ADD_FORBID_CONTENTS`)&&dt(e.ADD_FORBID_CONTENTS)&&(Pe===Fe&&(Pe=We(Pe)),He(Pe,e.ADD_FORBID_CONTENTS,St)),je&&(le[`#text`]=!0),V&&He(le,[`html`,`head`,`body`]),le.table&&(He(le,[`tbody`]),delete me.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw wt(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw wt(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=T;T=e.TRUSTED_TYPES_POLICY;try{E=j(``)}catch(e){throw T=t,e}}else e.TRUSTED_TYPES_POLICY===null?(T=void 0,E=``):(T===void 0&&(T=N()),T&&typeof E==`string`&&(E=j(``)));et&&et(e),Ht=e},Yt=He({},[...Et,...Dt,...tee]),Xt=He({},[...Ot,...kt]),mee=function(e,t,n){return t.namespaceURI===Ue?e===`svg`:t.namespaceURI===Be?e===`svg`&&(n===`annotation-xml`||it[n]):!!Yt[e]},hee=function(e,t,n){return t.namespaceURI===Ue?e===`math`:t.namespaceURI===Ve?e===`math`&&_t[n]:!!Xt[e]},Zt=function(e,t,n){return t.namespaceURI===Ve&&!_t[n]||t.namespaceURI===Be&&!it[n]?!1:!Xt[e]&&(vt[e]||!Yt[e])},gee=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:Xe,tagName:`template`});let n=ft(e.tagName),r=ft(t.tagName);return Qe[e.namespaceURI]?e.namespaceURI===Ve?mee(n,t,r):e.namespaceURI===Be?hee(n,t,r):e.namespaceURI===Ue?Zt(n,t,r):!!(yt===`application/xhtml+xml`&&Qe[e.namespaceURI]):!1},Qt=function(e){lt(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(m(e),!_(e))throw wt(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},$t=function(e,t,n){try{e.removeAttributeNode(t)}catch{try{e.removeAttribute(n)}catch{}}},en=function(e){W(e);let t=g(e);if(t){let e=[];ot(t,t=>{lt(e,t)}),ot(e,e=>{try{m(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&$t(e,r,i)}},tn=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}lt(t.removed,{attribute:r||null,from:n});try{r?n.removeAttributeNode(r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(De||H)try{Qt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},_ee=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||de[St(i)]||$t(e,r,i)}},W=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===Vt.element&&_ee(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},nn=function(e,t){return Se?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},rn=function(e){if(!Se)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===Vt.processingInstruction||n===Vt.comment&&Ct(Bt,e.data)){try{m(e)}catch{}continue}if(n===Vt.element){let t=e,n=St(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&nn(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},an=function(e){let t=null,r=null;if(Ee)e=`<remove></remove>`+e;else{let t=mt(e,/^[\r\n\t ]+/);r=t&&t[0]}yt===`application/xhtml+xml`&&Xe===Ue&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=T?j(e):e;if(Xe===Ue)try{t=new u().parseFromString(i,yt)}catch{}if(!t||!t.documentElement){t=F.createDocument(Xe,`template`,null);try{t.documentElement.innerHTML=Ze?E:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Xe===Ue?R.call(t,V?`html`:`body`)[0]:V?t.documentElement:a},on=function(e){let t=S?S(e):e.ownerDocument;return I.call(t||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},sn=function(e){return e=ht(e,B,` `),e=ht(e,te,` `),e=ht(e,ne,` `),e},cn=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=I.call(t||e,e,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=sn(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&ot(i,e=>{un(e.content)&&cn(e.content)})},ln=function(e){let t=x?x(e):null;return typeof t!=`string`||St(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},un=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===Vt.documentFragment}catch{return!1}},dn=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function fn(e,n,r){e.length!==0&&ot(e,e=>{e.call(t,n,r,Ht)})}let pn=function(e,t){return!!(Se&&e.hasChildNodes()&&!dn(e.firstElementChild)&&Ct(zt,e.textContent)&&Ct(zt,e.innerHTML)||Se&&e.namespaceURI===Ue&&uee[t]&&(dn(e.firstElementChild)||typeof e.textContent==`string`&&Ct(dee[t],e.textContent))||e.nodeType===Vt.processingInstruction||Se&&e.nodeType===Vt.comment&&Ct(Bt,e.data))},mn=function(e,t){if(e instanceof RegExp)return Ct(e,t);if(e instanceof Function){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return!!e(t,...r)}return!1},hn=function(e,t,n){if(!me[t]&&xn(t)&&mn(pe.tagNameCheck,t))return!1;if(je&&!Pe[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?p(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return Qt(e),!0},gn=function(e,t,n,r){return e.length===0?t:t===n||t===r?We(t):t},_n=function(e,t){return e===t||_(e)!==null?!1:(Me&&W(e),!0)},vn=function(e,n){if(fn(z.beforeSanitizeElements,e,null),_n(e,n))return!0;if(ln(e))return Qt(e),!0;let r=St(w(e));if(le=gn(z.uponSanitizeElement,le,ue,we),fn(z.uponSanitizeElement,e,{tagName:r,allowedTags:le}),_n(e,n))return!0;if(pn(e,r))return Qt(e),!0;if(me[r]||!(ge.tagCheck instanceof Function&&ge.tagCheck(r))&&!le[r]){let t=hn(e,r,n);return t===!1&&fn(z.afterSanitizeElements,e,null),t}if(C(e)===Vt.element&&!gee(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Ct(cee,e.innerHTML))return Qt(e),!0;if(xe&&e.nodeType===Vt.text){let n=sn(e.textContent);e.textContent!==n&&(lt(t.removed,{element:e.cloneNode()}),e.textContent=n)}return fn(z.afterSanitizeElements,e,null),!1},yn=function(e,t,r){if(he[t]||nn(t,e)||ke&&(t===`id`||t===`name`)&&(r in n||r in Kt))return!1;let i=de[t]||ge.attributeCheck instanceof Function&&ge.attributeCheck(t,e);return ve&&Ct(re,t)||_e&&Ct(ie,t)?!0:i?Re[t]||Ct(ce,ht(r,oe,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&>(r,`data:`)===0&&Ie[e]||ye&&!Ct(ae,ht(r,oe,``))?!0:!r:xn(e)&&mn(pe.tagNameCheck,e)&&mn(pe.attributeNameCheck,t,e)||t===`is`&&pe.allowCustomizedBuiltInElements&&mn(pe.tagNameCheck,r)},bn=He({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),xn=function(e){return!bn[ft(e)]&&Ct(se,e)},G=function(e,t,n,r){if(T&&typeof d==`object`&&typeof d.getAttributeType==`function`&&!n)switch(d.getAttributeType(e,t)){case`TrustedHTML`:return j(r);case`TrustedScriptURL`:return M(r)}return r},Sn=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),ln(e)?Qt(e):ct(t.removed)}catch{tn(n,e)}},Cn=function(e){fn(z.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||ln(e))return;de=gn(z.uponSanitizeAttribute,de,fe,Te);let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:de,forceKeepAttr:void 0},r=t.length,i=St(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,l=a.value,u=St(o),d=l,f=o===`value`?d:eee(d);if(n.attrName=u,n.attrValue=f,n.keepAttr=!0,n.forceKeepAttr=void 0,fn(z.uponSanitizeAttribute,e,n),f=n.attrValue,Ae&&(u===`id`||u===`name`)&>(f,U)!==0&&(tn(o,e,a),f=U+f),Se&&Ct(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){tn(o,e,a);continue}if(u===`attributename`&&mt(f,`href`)){tn(o,e,a);continue}if(!n.forceKeepAttr){if(!n.keepAttr){tn(o,e,a);continue}if(!be&&Ct(lee,f)){tn(o,e,a);continue}if(xe&&(f=sn(f)),!yn(i,u,f)){tn(o,e,a);continue}f=G(i,u,s,f),f!==d&&Sn(e,o,s,f)}}fn(z.afterSanitizeAttributes,e,null)},wn=function(e){let t=null,n=on(e);for(fn(z.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(fn(z.uponSanitizeShadowNode,t,null),vn(t,e),Cn(t),un(t.content)&&wn(t.content),C(t)===Vt.element){let e=v(t);un(e)&&(Tn(e),wn(e))}fn(z.afterSanitizeShadowDOM,e,null)},Tn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){wn(e.shadow);continue}let n=e.node,r=C(n)===Vt.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&St(e)===`template`){let e=n.content;un(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);un(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Ze=!e,Ze&&(e=`<!-->`),typeof e!=`string`&&!dn(e)&&(e=Ge(e),typeof e!=`string`))throw wt(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ce?(le=we,de=Te):Jt(n),(z.uponSanitizeElement.length>0||z.uponSanitizeAttribute.length>0)&&(le=We(le)),z.uponSanitizeAttribute.length>0&&(de=We(de)),t.removed=[];let l=Me&&typeof e!=`string`&&dn(e);if(l){rn(e);let t=w(e);if(typeof t==`string`){let n=St(t);if(!le[n]||me[n])throw en(e),wt(`root node is forbidden and cannot be sanitized in-place`)}if(ln(e))throw en(e),wt(`root node is clobbered and cannot be sanitized in-place`);try{Tn(e)}catch(t){throw en(e),t}}else if(dn(e))i=an(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===Vt.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Tn(a);else{if(!De&&!xe&&!V&&e.indexOf(`<`)===-1)return T&&Oe?j(e):e;if(i=an(e),!i)return De?null:Oe?E:``}i&&Ee&&Qt(i.firstChild);let u=l?e:i;try{let e=on(u);for(;o=e.nextNode();)vn(o,u),Cn(o),un(o.content)&&wn(o.content)}catch(n){throw l&&(en(e),ot(t.removed,e=>{e.element&&W(e.element)})),n}if(l)return ot(t.removed,e=>{e.element&&W(e.element)}),xe&&cn(e),e;if(De){if(xe&&cn(i),H)for(s=L.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(de.shadowroot||de.shadowrootmode)&&(s=ee.call(r,s,!0)),s}let d=V?i.outerHTML:i.innerHTML;return V&&le[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Ct(oee,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>3+`+d),xe&&(d=sn(d)),T&&Oe?j(d):d},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Jt(e),Ce=!0,we=le,Te=de},t.clearConfig=function(){Ht=null,Ce=!1,we=null,Te=null,T=D,E=``},t.isValidAttribute=function(e,t,n){Ht||Jt({});let r=St(e),i=St(t);return yn(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&xt(z,e)&<(z[e],t)},t.removeHook=function(e,t){if(xt(z,e)){if(t!==void 0){let n=st(z[e],t);return n===-1?void 0:ut(z[e],n,1)[0]}return ct(z[e])}},t.removeHooks=function(e){xt(z,e)&&(z[e]=[])},t.removeAllHooks=function(){z=Ut()},t}var Ye,Xe,Ze,Qe,$e,et,tt,nt,rt,it,at,ot,st,ct,lt,ut,dt,ft,pt,mt,ht,gt,eee,_t,vt,yt,bt,xt,St,Ct,wt,Tt,Et,Dt,tee,Ot,kt,At,jt,Mt,Nt,Pt,nee,ree,iee,aee,Ft,It,Lt,Rt,oee,see,zt,Bt,cee,lee,Vt,Ht,uee,dee,fee,pee,Ut,Wt,Gt,Kt,qt=o((()=>{Ye=Object.entries,Xe=Object.setPrototypeOf,Ze=Object.isFrozen,Qe=Object.getPrototypeOf,$e=Object.getOwnPropertyDescriptor,et=Object.freeze,tt=Object.seal,nt=Object.create,rt=typeof Reflect<`u`&&Reflect,it=rt.apply,at=rt.construct,et||=function(e){return e},tt||=function(e){return e},it||=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)},at||=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)},ot=Be(Array.prototype.forEach),st=Be(Array.prototype.lastIndexOf),ct=Be(Array.prototype.pop),lt=Be(Array.prototype.push),ut=Be(Array.prototype.splice),dt=Array.isArray,ft=Be(String.prototype.toLowerCase),pt=Be(String.prototype.toString),mt=Be(String.prototype.match),ht=Be(String.prototype.replace),gt=Be(String.prototype.indexOf),eee=Be(String.prototype.trim),_t=Be(Number.prototype.toString),vt=Be(Boolean.prototype.toString),yt=typeof BigInt>`u`?null:Be(BigInt.prototype.toString),bt=typeof Symbol>`u`?null:Be(Symbol.prototype.toString),xt=Be(Object.prototype.hasOwnProperty),St=Be(Object.prototype.toString),Ct=Be(RegExp.prototype.test),wt=Ve(TypeError),Tt=et(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Et=et(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Dt=et([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),tee=et([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Ot=et(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),kt=et([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),At=et([`#text`]),jt=et(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Mt=et(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Nt=et(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Pt=et([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),nee=tt(/{{[\w\W]*|^[\w\W]*}}/g),ree=tt(/<%[\w\W]*|^[\w\W]*%>/g),iee=tt(/\${[\w\W]*/g),aee=tt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ft=tt(/^aria-[\-\w]+$/),It=tt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Lt=tt(/^(?:\w+script|data):/i),Rt=tt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),oee=tt(/^html$/i),see=tt(/^[a-z][.\w]*(-[.\w]+)+$/i),zt=tt(/<[/\w!]/g),Bt=tt(/<[/\w]/g),cee=tt(/<\/no(script|embed|frames)/i),lee=tt(/\/>/i),Vt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ht=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],uee=et(He({},Ht)),dee=function(){let e={};return ot(Ht,t=>{e[t]=tt(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),et(e)}(),fee=function(){return typeof window>`u`?null:window},pee=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Ut=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Wt=function(e,t,n,r){return xt(e,t)&&dt(e[t])?He(r.base?We(r.base):{},e[t],r.transform):n},Gt=function(e,t,n){let r=xt(e,t)?e[t]:void 0;return r&&typeof r==`object`?We(r):n()},Kt=Je()})),Jt=l({ParseError:()=>En,SETTINGS_SCHEMA:()=>An,__defineFunction:()=>nn,__defineMacro:()=>G,__defineSymbol:()=>W,__domTree:()=>Wo,__parse:()=>zo,__renderToDomTree:()=>Vo,__renderToHTMLTree:()=>Ho,__setFontMetrics:()=>en,default:()=>Ute,render:()=>Lo,renderToString:()=>Ro,version:()=>Uo});function Yt(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function Xt(e){return e.default===void 0?Yt(Array.isArray(e.type)?e.type[0]:e.type):e.default}function mee(e,t,n,r){var i=n[t];e[t]=i===void 0?Xt(r):r.processor?r.processor(i):i}function hee(e){for(var t=0;t<Un.length;t++)for(var n=Un[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}function Zt(e){for(var t=0;t<Wn.length;t+=2)if(e>=Wn[t]&&e<=Wn[t+1])return!0;return!1}function gee(e){return`toText`in e}function Qt(e){if(e instanceof sr)return e;throw Error(`Expected symbolNode but got `+String(e)+`.`)}function $t(e){if(e instanceof ir)return e;throw Error(`Expected span<HtmlDomNode> but got `+String(e)+`.`)}function en(e,t){dr[e]=t}function tn(e,t,n){if(!dr[t])throw Error(`Font metrics not found for font: `+t+`.`);var r=e.charCodeAt(0),i=dr[t][r];if(!i&&e[0]in pr&&(r=pr[e[0]].charCodeAt(0),i=dr[t][r]),!i&&n===`text`&&Zt(r)&&(i=dr[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}function _ee(e){var t=e>=5?0:e>=3?1:2;if(!mr[t]){var n=mr[t]={cssEmPerMu:fr.quad[t]/18};for(var r in fr)fr.hasOwnProperty(r)&&(n[r]=fr[r][t])}return mr[t]}function W(e,t,n,r,i,a){hr[e][i]={font:t,group:n,replace:r},a&&r&&(hr[e][r]=hr[e][i])}function nn(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0||r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},l=0;l<n.length;++l)Si[n[l]]=s;t&&(a&&(Ci[t]=a),o&&(wi[t]=o))}function rn(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;nn({type:t,names:[],props:{numArgs:0},handler(){throw Error(`Should never be called.`)},htmlBuilder:n,mathmlBuilder:r})}function an(e,t){var n=ci([`base`],e,t),r=ci([`strut`]);return r.style.height=Qn(n.height+n.depth),n.depth&&(r.style.verticalAlign=Qn(-n.depth)),n.children.unshift(r),n}function on(e,t){var n=null;e.length===1&&e[0].type===`tag`&&(n=e[0].tag,e=e[0].body);var r=Di(e,t,`root`),i;r.length===2&&r[1].hasClass(`tag`)&&(i=r.pop());for(var a=[],o=[],s=0;s<r.length;s++)if(o.push(r[s]),r[s].hasClass(`mbin`)||r[s].hasClass(`mrel`)||r[s].hasClass(`allowbreak`)){for(var l=!1;s<r.length-1&&r[s+1].hasClass(`mspace`)&&!r[s+1].hasClass(`newline`);)s++,o.push(r[s]),r[s].hasClass(`nobreak`)&&(l=!0);l||(a.push(an(o,t)),o=[])}else r[s].hasClass(`newline`)&&(o.pop(),o.length>0&&(a.push(an(o,t)),o=[]),a.push(r[s]));o.length>0&&a.push(an(o,t));var u;n?(u=an(Di(n,t,!0),t),u.classes=[`tag`],a.push(u)):i&&a.push(i);var d=ci([`katex-html`],a);if(d.setAttribute(`aria-hidden`,`true`),u){var f=u.children[0];f.style.height=Qn(d.height+d.depth),d.depth&&(f.style.verticalAlign=Qn(-d.depth))}return d}function sn(e){return new Jn(e)}function cn(e){if(!e)return!1;if(e.type===`mi`&&e.children.length===1){var t=e.children[0];return t instanceof Fi&&t.text===`.`}if(e.type===`mo`&&e.children.length===1&&e.getAttribute(`separator`)===`true`&&e.getAttribute(`lspace`)===`0em`&&e.getAttribute(`rspace`)===`0em`){var n=e.children[0];return n instanceof Fi&&n.text===`,`}return!1}function ln(e,t,n,r,i){var a=Bi(e,n),o=a.length===1&&a[0]instanceof Pi&&ote.has(a[0].type)?a[0]:new Pi(`mrow`,a),s=new Pi(`annotation`,[new Fi(t)]);s.setAttribute(`encoding`,`application/x-tex`);var l=new Pi(`semantics`,[o,s]),u=new Pi(`math`,[l]);return u.setAttribute(`xmlns`,`http://www.w3.org/1998/Math/MathML`),r&&u.setAttribute(`display`,`block`),ci([i?`katex`:`katex-mathml`],[u])}function un(e){return e in Qi}function dn(e,t){if(!e||e.type!==t)throw Error(`Expected node of type `+t+`, but got `+(e?`node of type `+e.type:String(e)));return e}function fn(e){var t=pn(e);if(!t)throw Error(`Expected node of symbol group type, but got `+(e?`node of type `+e.type:String(e)));return t}function pn(e){return e&&(e.type===`atom`||$i.hasOwnProperty(e.type))?e:null}function mn(e,t){var n=Di(e.body,t,!0);return ci([e.mclass],n,t)}function hn(e,t){var n,r=Bi(e.body,t);return e.mclass===`minner`?n=new Pi(`mpadded`,r):e.mclass===`mord`?e.isCharacterBox?(n=r[0],n.type=`mi`):n=new Pi(`mi`,r):(e.isCharacterBox?(n=r[0],n.type=`mo`):n=new Pi(`mo`,r),e.mclass===`mbin`?(n.attributes.lspace=`0.22em`,n.attributes.rspace=`0.22em`):e.mclass===`mpunct`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0.17em`):e.mclass===`mopen`||e.mclass===`mclose`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0em`):e.mclass===`minner`&&(n.attributes.lspace=`0.0556em`,n.attributes.width=`+0.1111em`)),n}function gn(e,t,n){var r=pte[e];switch(r){case`\\\\cdrightarrow`:case`\\\\cdleftarrow`:return n.callFunction(r,[t[0]],[t[1]]);case`\\uparrow`:case`\\downarrow`:var i=n.callFunction(`\\\\cdleft`,[t[0]],[]),a={type:`atom`,text:r,mode:`math`,family:`rel`},o={type:`ordgroup`,mode:`math`,body:[i,n.callFunction(`\\Big`,[a],[]),n.callFunction(`\\\\cdright`,[t[1]],[])]};return n.callFunction(`\\\\cdparent`,[o],[]);case`\\\\cdlongequal`:return n.callFunction(`\\\\cdlongequal`,[],[]);case`\\Vert`:return n.callFunction(`\\Big`,[{type:`textord`,text:`\\Vert`,mode:`math`}],[]);default:return{type:`textord`,text:` `,mode:`math`}}}function _n(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set(`\\cr`,`\\\\\\relax`),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,`\\\\`)),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n===`&`||n===`\\\\`)e.consume();else if(n===`\\end`){t[t.length-1].length===0&&t.pop();break}else throw new En(`Expected \\\\ or \\cr or \\end`,e.nextToken)}for(var r=[],i=[r],a=0;a<t.length;a++){for(var o=t[a],s=oa(),l=0;l<o.length;l++)if(!sa(o[l]))s.body.push(o[l]);else{r.push(s),l+=1;var u=fn(o[l]).text,d=[,,];if(d[0]={type:`ordgroup`,mode:`math`,body:[]},d[1]={type:`ordgroup`,mode:`math`,body:[]},!`=|.`.includes(u)){if(`<>AV`.includes(u))for(var f=0;f<2;f++){for(var p=!0,m=l+1;m<o.length;m++){if(mte(o[m],u)){p=!1,l=m;break}if(sa(o[m]))throw new En(`Missing a `+u+` character to complete a CD arrow.`,o[m]);d[f].body.push(o[m])}if(p)throw new En(`Missing a `+u+` character to complete a CD arrow.`,o[l])}else throw new En(`Expected one of "<>AV=|." after @`,o[l])}var h={type:`styling`,body:[gn(u,d,e)],mode:`math`,style:`display`,resetFont:!0};r.push(h),s=oa()}a%2==0?r.push(s):r.shift(),r=[],i.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:`math`,body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:Array(i[0].length).fill({type:`align`,align:`c`,pregap:.25,postgap:.25}),colSeparationType:`CD`,hLinesBeforeRow:Array(i.length+1).fill([])}}function vn(e){return`isMiddle`in e}function yn(e,t){var n=pn(e);if(n&&Tte.has(n.text))return n;throw n?new En(`Invalid delimiter '`+n.text+`' after '`+t.funcName+`'`,e):new En(`Invalid delimiter type '`+e.type+`'`,e)}function bn(e){if(!e.body)throw Error(`Bug: The leftright ParseNode wasn't fully parsed.`)}function xn(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l<n.length;++l)Ia[n[l]]=s;a&&(Ci[t]=a),o&&(wi[t]=o)}function G(e,t){La[e]=t}function Sn(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n===`\\relax`&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n===`\\hline`||n===`\\hdashline`;)e.consume(),t.push(n===`\\hdashline`),e.consumeSpaces(),n=e.fetch().text;return t}function Cn(e){if(!e.includes(`ed`))return!e.includes(`*`)}function wn(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:a,arraystretch:o,colSeparationType:s,autoTag:l,singleRow:u,emptySingleRow:d,maxNumCols:f,leqno:p}=t;if(e.gullet.beginGroup(),u||e.gullet.macros.set(`\\cr`,`\\\\\\relax`),!o){var m=e.gullet.expandMacroAsText(`\\arraystretch`);if(m==null)o=1;else if(o=parseFloat(m),!o||o<0)throw new En(`Invalid \\arraystretch: `+m)}e.gullet.beginGroup();var h=[],g=[h],_=[],v=[],y=l==null?void 0:[];function b(){l&&e.gullet.macros.set(`\\@eqnsw`,`1`,!0)}function x(){y&&(e.gullet.macros.get(`\\df@tag`)?(y.push(e.subparse([new za(`\\df@tag`)])),e.gullet.macros.set(`\\df@tag`,void 0,!0)):y.push(!!l&&e.gullet.macros.get(`\\@eqnsw`)===`1`))}for(b(),v.push(Sn(e));;){var S=e.parseExpression(!1,u?`\\end`:`\\\\`);e.gullet.endGroup(),e.gullet.beginGroup();var C={type:`ordgroup`,mode:e.mode,body:S};n&&(C={type:`styling`,mode:e.mode,style:n,resetFont:!0,body:[C]}),h.push(C);var w=e.fetch().text;if(w===`&`){if(f&&h.length===f){if(u||s)throw new En(`Too many tab characters: &`,e.nextToken);e.settings.reportNonstrict(`textEnv`,`Too few columns specified in the {array} column argument.`)}e.consume()}else if(w===`\\end`){x(),h.length===1&&C.type===`styling`&&C.body.length===1&&C.body[0].type===`ordgroup`&&C.body[0].body.length===0&&(g.length>1||!d)&&g.pop(),v.length<g.length+1&&v.push([]);break}else if(w===`\\\\`){e.consume();var T=void 0;e.gullet.future().text!==` `&&(T=e.parseSizeGroup(!0)),_.push(T?T.value:null),x(),v.push(Sn(e)),h=[],g.push(h),b()}else throw new En(`Expected & or \\\\ or \\cr or \\end`,e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:e.mode,addJot:i,arraystretch:o,body:g,cols:a,rowGaps:_,hskipBeforeAndAfter:r,hLinesBeforeRow:v,colSeparationType:s,tags:y,leqno:p}}function Tn(e){return e.slice(0,1)===`d`?`display`:`text`}function vee(e,t,n){for(var r=Di(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a<r.length;a++){var o=r[a].classes.indexOf(`sizing`);o<0?Array.prototype.push.apply(r[a].classes,t.sizingClasses(n)):r[a].classes[o+1]===`reset-size`+t.size&&(r[a].classes[o+1]=`reset-size`+n.size),r[a].height*=i,r[a].depth*=i}return di(r)}function yee(e){return e in oo}var En,bee,xee,See,Cee,Dn,On,wee,kn,Tee,An,jn,Mn,Nn,Pn,Fn,In,Ln,Rn,zn,Bn,Vn,Eee,Dee,Oee,kee,Aee,jee,Hn,Un,Wn,Gn,Kn,Mee,Nee,Pee,Fee,Iee,Lee,Ree,zee,Bee,qn,Vee,Jn,Yn,Hee,Xn,Zn,Qn,$n,er,tr,nr,Uee,rr,ir,ar,Wee,or,sr,cr,lr,ur,Gee,dr,fr,pr,mr,hr,K,gr,q,J,_r,vr,yr,br,xr,Sr,Cr,wr,Y,Tr,X,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr,Br,Vr,Hr,Ur,Wr,Gr,Kr,Kee,qr,Jr,Yr,Xr,Zr,Qr,$r,ei,ti,qee,Jee,ni,ri,ii,Yee,ai,Xee,oi,si,ci,li,ui,Zee,di,fi,Qee,pi,mi,hi,gi,_i,vi,yi,bi,xi,$ee,ete,Si,Ci,wi,Ti,Ei,tte,nte,rte,ite,Di,Oi,ki,Ai,ji,Mi,Ni,Pi,Fi,Ii,ate,ote,Li,Ri,ste,zi,Bi,Vi,Hi,cte,Ui,Wi,Gi,Ki,qi,lte,ute,dte,Ji,fte,Yi,Xi,Zi,Qi,$i,ea,ta,na,ra,ia,aa,pte,oa,sa,mte,ca,la,ua,da,hte,fa,pa,ma,ha,gte,_te,ga,_a,va,ya,ba,vte,yte,xa,Sa,Ca,wa,bte,Ta,xte,Ea,Da,Oa,Ste,Cte,ka,wte,Aa,ja,Ma,Na,Tte,Pa,Fa,Ia,La,Ra,za,Ba,Ete,Va,Dte,Ha,Ua,Wa,Ga,Ka,qa,Ote,kte,Ja,Ya,Xa,Za,Ate,Qa,$a,eo,to,no,ro,jte,Mte,io,Nte,ao,Pte,oo,Fte,so,co,lo,uo,fo,po,Ite,mo,ho,go,_o,Lte,Rte,zte,Bte,vo,Vte,Hte,yo,bo,xo,So,Co,wo,To,Eo,Do,Oo,ko,Ao,jo,Mo,No,Po,Fo,Io,Lo,Ro,zo,Bo,Vo,Ho,Uo,Wo,Ute,Wte=o((()=>{for(En=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var l=s.slice(i,a).replace(/[^]/g,`$&̲`),u=i>15?`…`+s.slice(i-15,i):s.slice(0,i),d=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=u+l+d}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},bee=/([A-Z])/g,xee=e=>e.replace(bee,`-$1`).toLowerCase(),See={"&":`&`,">":`>`,"<":`<`,'"':`"`,"'":`'`},Cee=/[&><"']/g,Dn=e=>String(e).replace(Cee,e=>See[e]),On=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?On(e.body[0]):e:e.type===`font`?On(e.body):e,wee=new Set([`mathord`,`textord`,`atom`]),kn=e=>wee.has(On(e).type),Tee=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},An={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}},jn=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(An)){var n=An[t];n&&mee(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),!(!r||r===`ignore`)){if(r===!0||r===`error`)throw new En(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=Tee(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},Mn=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Vn[Eee[this.id]]}sub(){return Vn[Dee[this.id]]}fracNum(){return Vn[Oee[this.id]]}fracDen(){return Vn[kee[this.id]]}cramp(){return Vn[Aee[this.id]]}text(){return Vn[jee[this.id]]}isTight(){return this.size>=2}},Nn=0,Pn=1,Fn=2,In=3,Ln=4,Rn=5,zn=6,Bn=7,Vn=[new Mn(Nn,0,!1),new Mn(Pn,0,!0),new Mn(Fn,1,!1),new Mn(In,1,!0),new Mn(Ln,2,!1),new Mn(Rn,2,!0),new Mn(zn,3,!1),new Mn(Bn,3,!0)],Eee=[Ln,Rn,Ln,Rn,zn,Bn,zn,Bn],Dee=[Rn,Rn,Rn,Rn,Bn,Bn,Bn,Bn],Oee=[Fn,In,Ln,Rn,zn,Bn,zn,Bn],kee=[In,In,Rn,Rn,Bn,Bn,Bn,Bn],Aee=[Pn,Pn,In,In,Rn,Rn,Bn,Bn],jee=[Nn,Pn,Fn,In,Fn,In,Fn,In],Hn={DISPLAY:Vn[Nn],TEXT:Vn[Fn],SCRIPT:Vn[Ln],SCRIPTSCRIPT:Vn[zn]},Un=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}],Wn=[],Un.forEach(e=>e.blocks.forEach(e=>Wn.push(...e))),Gn=e=>e+` `+e,Kn=80,Mee=function(e,t){return`M95,`+(622+e+t)+`4+c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-145+c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-546+c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,107+s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-4298+c69,-144,104.5,-217.7,106.5,-2219+l`+e/2.075+` -`+e+`10+c5.3,-9.3,12,-14,20,-1411+H400000v`+(40+e)+`H845.272412+s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,713+c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z14+M`+(834+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},Nee=function(e,t){return`M263,`+(601+e+t)+`c0.7,0,18,39.7,52,11915+c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,12016+c340,-704.7,510.7,-1060.3,512,-106717+l`+e/2.084+` -`+e+`18+c4.7,-7.3,11,-11,19,-1119+H40000v`+(40+e)+`H1012.320+s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,23221+c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-122+s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,2623+c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z24+M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},Pee=function(e,t){return`M983 `+(10+e+t)+`25+l`+e/3.13+` -`+e+`26+c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`27+H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,728+s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-74429+c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-3030+c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,72231+c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.532+c53.7,-170.3,84.5,-266.8,92.5,-289.5z33+M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},Fee=function(e,t){return`M424,`+(2398+e+t)+`34+c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-51435+c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,2036+s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-12137+s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-108138+l`+e/4.223+` -`+e+`c4,-6.7,10,-10,18,-10 H40000039+v`+(40+e)+`H1014.640+s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,118541+c-2,6,-10,9,-24,942+c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+` `+t+`43+h400000v`+(40+e)+`h-400000z`},Iee=function(e,t){return`M473,`+(2713+e+t)+`44+c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+` -`+e+`45+c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.746+s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,947+c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-120048+c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-2649+s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,50+606zM`+(1001+e)+` `+t+`h400000v`+(40+e)+`H1017.7z`},Lee=function(e){var t=e/2;return`M400000 `+e+` H0 L`+t+` 0 l65 45 L145 `+(e-80)+` H400000z`},Ree=function(e,t,n){var r=n-54-t-e;return`M702 `+(e+t)+`H400000`+(40+e)+`51+H742v`+r+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 152+h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 17053+c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.66754+219 661 l218 661zM702 `+t+`H400000v`+(40+e)+`H742z`},zee=function(e,t,n){t=1e3*t;var r=``;switch(e){case`sqrtMain`:r=Mee(t,Kn);break;case`sqrtSize1`:r=Nee(t,Kn);break;case`sqrtSize2`:r=Pee(t,Kn);break;case`sqrtSize3`:r=Fee(t,Kn);break;case`sqrtSize4`:r=Iee(t,Kn);break;case`sqrtTall`:r=Ree(t,Kn,n)}return r},Bee=function(e,t){switch(e){case`⎜`:return Gn(`M291 0 H417 V`+t+` H291z`);case`∣`:return Gn(`M145 0 H188 V`+t+` H145z`);case`∥`:return Gn(`M145 0 H188 V`+t+` H145z`)+Gn(`M367 0 H410 V`+t+` H367z`);case`⎟`:return Gn(`M457 0 H583 V`+t+` H457z`);case`⎢`:return Gn(`M319 0 H403 V`+t+` H319z`);case`⎥`:return Gn(`M263 0 H347 V`+t+` H263z`);case`⎪`:return Gn(`M384 0 H504 V`+t+` H384z`);case`⏐`:return Gn(`M312 0 H355 V`+t+` H312z`);case`‖`:return Gn(`M257 0 H300 V`+t+` H257z`)+Gn(`M478 0 H521 V`+t+` H478z`);default:return``}},qn={doubleleftarrow:`M262 15755+l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.356+ 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-2857+ 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.558+c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.559+ 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-8760+-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.761+-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z62+m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l63+-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.564+ 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 8865+-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-6866+-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-1867+-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h39978268+c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.369+-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-12070+ 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.871+-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 24772+c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 20873+ 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.374+ 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-20275+ l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 11776+-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.777+ 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 1378+ 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.68879+ 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.780+-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 8081+H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 082+ 435 0h399565z`,leftgroupunder:`M400000 26283+H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 21984+ 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.385+-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 586+-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.787+-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.588+ 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.389+-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.790+-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z91+m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.33392+ 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 593+ 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.66794+-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 1295+ 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.796+-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 097+v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.598+-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.399+-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21100+ 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:Gn(`M40 281 V428 H0 V94 H40 V241 H400000 v40z`),leftbracketunder:Gn(`M0 0 h120 V290 H399995 v120 H0z`),leftbracketover:Gn(`M0 440 h120 V150 H399995 v-120 H0z`),leftmapsto:Gn(`M40 281 V448H0V74H40V241H400000v40z`),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23101+-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8102+c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3103+ 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:Gn(`M0 50 h400000 v40H0z m0 194h40000v40H0z`),midbrace:`M200428 334104+c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14105+-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7106+ 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11107+ 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214108+c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14109+ 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3110+ 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0111+-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6112+-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z113+m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8114+60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8115+-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z116+m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2117+c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6118+-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z119+m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0120+85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8121+-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z122+m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1123+c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128124+-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20125+ 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7126+ 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85127+-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5128+-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67129+ 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l130+-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5131+s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1132+c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3133+ 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237134+-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0135+ 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18136+ 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3137+-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2138+-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58139+ 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11140+-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7141+ 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z142+m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8143+ 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5144+-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95145+-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8146+ 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3147+ 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3148+-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z149+m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3150+ 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0151+-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21152+ 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:Gn(`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`),rightbracketunder:Gn(`M399995 0 h-120 V290 H0 v120 H400000z`),rightbracketover:Gn(`M399995 440 h-120 V150 H0 v-120 H399995z`),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23153+ 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32154+-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142155+-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40156+ 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69157+-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3158+-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19159+-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101160+ 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167161+c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3162+ 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42163+ 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333164+-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70165+ 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7166+-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0167+ 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0168+ 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128169+-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418170+-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9171+ 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114172+c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751173+ 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457174+-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0175+ 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697176+ 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696177+ -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345178+-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409179+ 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9180+ 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409181+ -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5182+3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11183+10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63184+-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1185+-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59186+H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359187+c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22188+c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10189+-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10190+-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10191+-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,192+-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,193+-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,194+-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,195+-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202196+c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5197+c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130198+s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47199+121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6200+s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11201+c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z202+M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32203+-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0204+13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39205+-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5206+-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5207+-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67208+151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11209+c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17210+c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21211+c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40212+c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z213+M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0214+c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,215+-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6216+c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z217+M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11218+c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,219+1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,220+-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z221+M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0222+c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,223+-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6224+c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z225+M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},Vee=function(e,t){switch(e){case`lbrack`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v1759 v84 h347 v-84226+H403z M403 1759 V0 H319 V1759 v`+t+` v1759 v84 h84z`;case`rbrack`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v1759 H0 v84 H347z227+M347 1759 V0 H263 V1759 v`+t+` v1759 h84z`;case`vert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15228+c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15229+c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z`;case`doublevert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15230+c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15231+c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z232+M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15233+c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15234+c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+` v585 h43z`;case`lfloor`:return`M319 602 V0 H403 V602 v`+t+` v1715 h263 v84 H319z235+MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`rfloor`:return`M319 602 V0 H403 V602 v`+t+` v1799 H0 v-84 H319z236+MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`lceil`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v602 h84z237+M403 1759 V0 H319 V1759 v`+t+` v602 h84z`;case`rceil`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v602 h84z238+M347 1759 V0 h-84 V1759 v`+t+` v602 h84z`;case`lparen`:return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1239+c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,240+-36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,241+949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9242+c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,243+-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189244+l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,245+-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case`rparen`:return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,246+63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5247+c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+`248+c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664249+c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11250+c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17251+c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558252+l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,253+-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw Error(`Unknown stretchy delimiter.`)}},Jn=class{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e=``,t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>{if(gee(e))return e.toText();throw Error(`Expected MathDomNode with toText, got `+e.constructor.name)}).join(``)}},Yn={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},Hee={ex:!0,em:!0,mu:!0},Xn=function(e){return typeof e!=`string`&&(e=e.unit),e in Yn||e in Hee||e===`ex`},Zn=function(e,t){var n;if(e.unit in Yn)n=Yn[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit===`mu`)n=t.fontMetrics().cssEmPerMu;else{var r=t.style.isTight()?t.havingStyle(t.style.text()):t;if(e.unit===`ex`)n=r.fontMetrics().xHeight;else if(e.unit===`em`)n=r.fontMetrics().quad;else throw new En(`Invalid unit: '`+e.unit+`'`);r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},Qn=function(e){return+e.toFixed(4)+`em`},$n=function(e){return e.filter(e=>e).join(` `)},er=function(e){var t=``;for(var n of Object.keys(e)){var r=e[n];r!==void 0&&(t+=xee(n)+`:`+r+`;`)}return t},tr=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push(`mtight`);var r=t.getColor();r&&(this.style.color=r)}},nr=function(e){var t=document.createElement(e);t.className=$n(this.classes),Object.assign(t.style,this.style);for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},Uee=/[\s"'>/=\x00-\x1f]/,rr=function(e){var t=`<`+e;this.classes.length&&(t+=` class="`+Dn($n(this.classes))+`"`);var n=er(this.style);n&&(t+=` style="`+Dn(n)+`"`);for(var r of Object.keys(this.attributes)){if(Uee.test(r))throw new En(`Invalid attribute name '`+r+`'`);t+=` `+r+`="`+Dn(this.attributes[r])+`"`}t+=`>`;for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup();return t+=`</`+e+`>`,t},ir=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,tr.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return nr.call(this,`span`)}toMarkup(){return rr.call(this,`span`)}},ar=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,tr.call(this,t,r),this.children=n||[],this.setAttribute(`href`,e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return nr.call(this,`a`)}toMarkup(){return rr.call(this,`a`)}},Wee=class{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=[`mord`],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement(`img`);return e.src=this.src,e.alt=this.alt,e.className=`mord`,Object.assign(e.style,this.style),e}toMarkup(){var e=`<img src="`+Dn(this.src)+`"`+(` alt="`+Dn(this.alt)+`"`),t=er(this.style);return t&&(e+=` style="`+Dn(t)+`"`),e+=`'/>`,e}},or={î:`ı̂`,ï:`ı̈`,í:`ı́`,ì:`ı̀`},sr=class{constructor(e,t,n,r,i,a,o,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=i||0,this.width=a||0,this.classes=o||[],this.style=s||{},this.maxFontSize=0;var l=hee(this.text.charCodeAt(0));l&&this.classes.push(l+`_fallback`),/[îïíì]/.test(this.text)&&(this.text=or[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&(t=document.createElement(`span`),t.style.marginRight=Qn(this.italic)),this.classes.length>0&&(t||=document.createElement(`span`),t.className=$n(this.classes)),Object.keys(this.style).length>0&&(t||=document.createElement(`span`),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t=`<span`;this.classes.length&&(e=!0,t+=` class="`,t+=Dn($n(this.classes)),t+=`"`);var n=``;this.italic>0&&(n+=`margin-right:`+Qn(this.italic)+`;`),n+=er(this.style),n&&(e=!0,t+=` style="`+Dn(n)+`"`);var r=Dn(this.text);return e?(t+=`>`,t+=r,t+=`</span>`,t):r}},cr=class{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<svg xmlns="http://www.w3.org/2000/svg"`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+Dn(this.attributes[t])+`"`;e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</svg>`,e}},lr=class{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return this.alternate?e.setAttribute(`d`,this.alternate):e.setAttribute(`d`,qn[this.pathName]),e}toMarkup(){return this.alternate?`<path d="`+Dn(this.alternate)+`"/>`:`<path d="`+Dn(qn[this.pathName])+`"/>`}},ur=class{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e=`<line`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+Dn(this.attributes[t])+`"`;return e+=`/>`,e}},Gee=e=>e instanceof ir||e instanceof ar||e instanceof Jn,dr={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},fr={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},pr={Å:`A`,Ð:`D`,Þ:`o`,å:`a`,ð:`d`,þ:`o`,А:`A`,Б:`B`,В:`B`,Г:`F`,Д:`A`,Е:`E`,Ж:`K`,З:`3`,И:`N`,Й:`N`,К:`K`,Л:`N`,М:`M`,Н:`H`,О:`O`,П:`N`,Р:`P`,С:`C`,Т:`T`,У:`y`,Ф:`O`,Х:`X`,Ц:`U`,Ч:`h`,Ш:`W`,Щ:`W`,Ъ:`B`,Ы:`X`,Ь:`B`,Э:`3`,Ю:`X`,Я:`R`,а:`a`,б:`b`,в:`a`,г:`r`,д:`y`,е:`e`,ж:`m`,з:`e`,и:`n`,й:`n`,к:`n`,л:`n`,м:`m`,н:`n`,о:`o`,п:`n`,р:`p`,с:`c`,т:`o`,у:`y`,ф:`b`,х:`x`,ц:`n`,ч:`n`,ш:`w`,щ:`w`,ъ:`a`,ы:`m`,ь:`a`,э:`e`,ю:`m`,я:`r`},mr={},hr={math:{},text:{}},K=`math`,gr=`text`,q=`main`,J=`ams`,_r=`accent-token`,vr=`bin`,yr=`close`,br=`inner`,xr=`mathord`,Sr=`op-token`,Cr=`open`,wr=`punct`,Y=`rel`,Tr=`spacing`,X=`textord`,W(K,q,Y,`≡`,`\\equiv`,!0),W(K,q,Y,`≺`,`\\prec`,!0),W(K,q,Y,`≻`,`\\succ`,!0),W(K,q,Y,`∼`,`\\sim`,!0),W(K,q,Y,`⊥`,`\\perp`),W(K,q,Y,`⪯`,`\\preceq`,!0),W(K,q,Y,`⪰`,`\\succeq`,!0),W(K,q,Y,`≃`,`\\simeq`,!0),W(K,q,Y,`∣`,`\\mid`,!0),W(K,q,Y,`≪`,`\\ll`,!0),W(K,q,Y,`≫`,`\\gg`,!0),W(K,q,Y,`≍`,`\\asymp`,!0),W(K,q,Y,`∥`,`\\parallel`),W(K,q,Y,`⋈`,`\\bowtie`,!0),W(K,q,Y,`⌣`,`\\smile`,!0),W(K,q,Y,`⊑`,`\\sqsubseteq`,!0),W(K,q,Y,`⊒`,`\\sqsupseteq`,!0),W(K,q,Y,`≐`,`\\doteq`,!0),W(K,q,Y,`⌢`,`\\frown`,!0),W(K,q,Y,`∋`,`\\ni`,!0),W(K,q,Y,`∝`,`\\propto`,!0),W(K,q,Y,`⊢`,`\\vdash`,!0),W(K,q,Y,`⊣`,`\\dashv`,!0),W(K,q,Y,`∋`,`\\owns`),W(K,q,wr,`.`,`\\ldotp`),W(K,q,wr,`⋅`,`\\cdotp`),W(K,q,wr,`⋅`,`·`),W(gr,q,X,`⋅`,`·`),W(K,q,X,`#`,`\\#`),W(gr,q,X,`#`,`\\#`),W(K,q,X,`&`,`\\&`),W(gr,q,X,`&`,`\\&`),W(K,q,X,`ℵ`,`\\aleph`,!0),W(K,q,X,`∀`,`\\forall`,!0),W(K,q,X,`ℏ`,`\\hbar`,!0),W(K,q,X,`∃`,`\\exists`,!0),W(K,q,X,`∇`,`\\nabla`,!0),W(K,q,X,`♭`,`\\flat`,!0),W(K,q,X,`ℓ`,`\\ell`,!0),W(K,q,X,`♮`,`\\natural`,!0),W(K,q,X,`♣`,`\\clubsuit`,!0),W(K,q,X,`℘`,`\\wp`,!0),W(K,q,X,`♯`,`\\sharp`,!0),W(K,q,X,`♢`,`\\diamondsuit`,!0),W(K,q,X,`ℜ`,`\\Re`,!0),W(K,q,X,`♡`,`\\heartsuit`,!0),W(K,q,X,`ℑ`,`\\Im`,!0),W(K,q,X,`♠`,`\\spadesuit`,!0),W(K,q,X,`§`,`\\S`,!0),W(gr,q,X,`§`,`\\S`),W(K,q,X,`¶`,`\\P`,!0),W(gr,q,X,`¶`,`\\P`),W(K,q,X,`†`,`\\dag`),W(gr,q,X,`†`,`\\dag`),W(gr,q,X,`†`,`\\textdagger`),W(K,q,X,`‡`,`\\ddag`),W(gr,q,X,`‡`,`\\ddag`),W(gr,q,X,`‡`,`\\textdaggerdbl`),W(K,q,yr,`⎱`,`\\rmoustache`,!0),W(K,q,Cr,`⎰`,`\\lmoustache`,!0),W(K,q,yr,`⟯`,`\\rgroup`,!0),W(K,q,Cr,`⟮`,`\\lgroup`,!0),W(K,q,vr,`∓`,`\\mp`,!0),W(K,q,vr,`⊖`,`\\ominus`,!0),W(K,q,vr,`⊎`,`\\uplus`,!0),W(K,q,vr,`⊓`,`\\sqcap`,!0),W(K,q,vr,`∗`,`\\ast`),W(K,q,vr,`⊔`,`\\sqcup`,!0),W(K,q,vr,`◯`,`\\bigcirc`,!0),W(K,q,vr,`∙`,`\\bullet`,!0),W(K,q,vr,`‡`,`\\ddagger`),W(K,q,vr,`≀`,`\\wr`,!0),W(K,q,vr,`⨿`,`\\amalg`),W(K,q,vr,`&`,`\\And`),W(K,q,Y,`⟵`,`\\longleftarrow`,!0),W(K,q,Y,`⇐`,`\\Leftarrow`,!0),W(K,q,Y,`⟸`,`\\Longleftarrow`,!0),W(K,q,Y,`⟶`,`\\longrightarrow`,!0),W(K,q,Y,`⇒`,`\\Rightarrow`,!0),W(K,q,Y,`⟹`,`\\Longrightarrow`,!0),W(K,q,Y,`↔`,`\\leftrightarrow`,!0),W(K,q,Y,`⟷`,`\\longleftrightarrow`,!0),W(K,q,Y,`⇔`,`\\Leftrightarrow`,!0),W(K,q,Y,`⟺`,`\\Longleftrightarrow`,!0),W(K,q,Y,`↦`,`\\mapsto`,!0),W(K,q,Y,`⟼`,`\\longmapsto`,!0),W(K,q,Y,`↗`,`\\nearrow`,!0),W(K,q,Y,`↩`,`\\hookleftarrow`,!0),W(K,q,Y,`↪`,`\\hookrightarrow`,!0),W(K,q,Y,`↘`,`\\searrow`,!0),W(K,q,Y,`↼`,`\\leftharpoonup`,!0),W(K,q,Y,`⇀`,`\\rightharpoonup`,!0),W(K,q,Y,`↙`,`\\swarrow`,!0),W(K,q,Y,`↽`,`\\leftharpoondown`,!0),W(K,q,Y,`⇁`,`\\rightharpoondown`,!0),W(K,q,Y,`↖`,`\\nwarrow`,!0),W(K,q,Y,`⇌`,`\\rightleftharpoons`,!0),W(K,J,Y,`≮`,`\\nless`,!0),W(K,J,Y,``,`\\@nleqslant`),W(K,J,Y,``,`\\@nleqq`),W(K,J,Y,`⪇`,`\\lneq`,!0),W(K,J,Y,`≨`,`\\lneqq`,!0),W(K,J,Y,``,`\\@lvertneqq`),W(K,J,Y,`⋦`,`\\lnsim`,!0),W(K,J,Y,`⪉`,`\\lnapprox`,!0),W(K,J,Y,`⊀`,`\\nprec`,!0),W(K,J,Y,`⋠`,`\\npreceq`,!0),W(K,J,Y,`⋨`,`\\precnsim`,!0),W(K,J,Y,`⪹`,`\\precnapprox`,!0),W(K,J,Y,`≁`,`\\nsim`,!0),W(K,J,Y,``,`\\@nshortmid`),W(K,J,Y,`∤`,`\\nmid`,!0),W(K,J,Y,`⊬`,`\\nvdash`,!0),W(K,J,Y,`⊭`,`\\nvDash`,!0),W(K,J,Y,`⋪`,`\\ntriangleleft`),W(K,J,Y,`⋬`,`\\ntrianglelefteq`,!0),W(K,J,Y,`⊊`,`\\subsetneq`,!0),W(K,J,Y,``,`\\@varsubsetneq`),W(K,J,Y,`⫋`,`\\subsetneqq`,!0),W(K,J,Y,``,`\\@varsubsetneqq`),W(K,J,Y,`≯`,`\\ngtr`,!0),W(K,J,Y,``,`\\@ngeqslant`),W(K,J,Y,``,`\\@ngeqq`),W(K,J,Y,`⪈`,`\\gneq`,!0),W(K,J,Y,`≩`,`\\gneqq`,!0),W(K,J,Y,``,`\\@gvertneqq`),W(K,J,Y,`⋧`,`\\gnsim`,!0),W(K,J,Y,`⪊`,`\\gnapprox`,!0),W(K,J,Y,`⊁`,`\\nsucc`,!0),W(K,J,Y,`⋡`,`\\nsucceq`,!0),W(K,J,Y,`⋩`,`\\succnsim`,!0),W(K,J,Y,`⪺`,`\\succnapprox`,!0),W(K,J,Y,`≆`,`\\ncong`,!0),W(K,J,Y,``,`\\@nshortparallel`),W(K,J,Y,`∦`,`\\nparallel`,!0),W(K,J,Y,`⊯`,`\\nVDash`,!0),W(K,J,Y,`⋫`,`\\ntriangleright`),W(K,J,Y,`⋭`,`\\ntrianglerighteq`,!0),W(K,J,Y,``,`\\@nsupseteqq`),W(K,J,Y,`⊋`,`\\supsetneq`,!0),W(K,J,Y,``,`\\@varsupsetneq`),W(K,J,Y,`⫌`,`\\supsetneqq`,!0),W(K,J,Y,``,`\\@varsupsetneqq`),W(K,J,Y,`⊮`,`\\nVdash`,!0),W(K,J,Y,`⪵`,`\\precneqq`,!0),W(K,J,Y,`⪶`,`\\succneqq`,!0),W(K,J,Y,``,`\\@nsubseteqq`),W(K,J,vr,`⊴`,`\\unlhd`),W(K,J,vr,`⊵`,`\\unrhd`),W(K,J,Y,`↚`,`\\nleftarrow`,!0),W(K,J,Y,`↛`,`\\nrightarrow`,!0),W(K,J,Y,`⇍`,`\\nLeftarrow`,!0),W(K,J,Y,`⇏`,`\\nRightarrow`,!0),W(K,J,Y,`↮`,`\\nleftrightarrow`,!0),W(K,J,Y,`⇎`,`\\nLeftrightarrow`,!0),W(K,J,Y,`△`,`\\vartriangle`),W(K,J,X,`ℏ`,`\\hslash`),W(K,J,X,`▽`,`\\triangledown`),W(K,J,X,`◊`,`\\lozenge`),W(K,J,X,`Ⓢ`,`\\circledS`),W(K,J,X,`®`,`\\circledR`),W(gr,J,X,`®`,`\\circledR`),W(K,J,X,`∡`,`\\measuredangle`,!0),W(K,J,X,`∄`,`\\nexists`),W(K,J,X,`℧`,`\\mho`),W(K,J,X,`Ⅎ`,`\\Finv`,!0),W(K,J,X,`⅁`,`\\Game`,!0),W(K,J,X,`‵`,`\\backprime`),W(K,J,X,`▲`,`\\blacktriangle`),W(K,J,X,`▼`,`\\blacktriangledown`),W(K,J,X,`■`,`\\blacksquare`),W(K,J,X,`⧫`,`\\blacklozenge`),W(K,J,X,`★`,`\\bigstar`),W(K,J,X,`∢`,`\\sphericalangle`,!0),W(K,J,X,`∁`,`\\complement`,!0),W(K,J,X,`ð`,`\\eth`,!0),W(gr,q,X,`ð`,`ð`),W(K,J,X,`╱`,`\\diagup`),W(K,J,X,`╲`,`\\diagdown`),W(K,J,X,`□`,`\\square`),W(K,J,X,`□`,`\\Box`),W(K,J,X,`◊`,`\\Diamond`),W(K,J,X,`¥`,`\\yen`,!0),W(gr,J,X,`¥`,`\\yen`,!0),W(K,J,X,`✓`,`\\checkmark`,!0),W(gr,J,X,`✓`,`\\checkmark`),W(K,J,X,`ℶ`,`\\beth`,!0),W(K,J,X,`ℸ`,`\\daleth`,!0),W(K,J,X,`ℷ`,`\\gimel`,!0),W(K,J,X,`ϝ`,`\\digamma`,!0),W(K,J,X,`ϰ`,`\\varkappa`),W(K,J,Cr,`┌`,`\\@ulcorner`,!0),W(K,J,yr,`┐`,`\\@urcorner`,!0),W(K,J,Cr,`└`,`\\@llcorner`,!0),W(K,J,yr,`┘`,`\\@lrcorner`,!0),W(K,J,Y,`≦`,`\\leqq`,!0),W(K,J,Y,`⩽`,`\\leqslant`,!0),W(K,J,Y,`⪕`,`\\eqslantless`,!0),W(K,J,Y,`≲`,`\\lesssim`,!0),W(K,J,Y,`⪅`,`\\lessapprox`,!0),W(K,J,Y,`≊`,`\\approxeq`,!0),W(K,J,vr,`⋖`,`\\lessdot`),W(K,J,Y,`⋘`,`\\lll`,!0),W(K,J,Y,`≶`,`\\lessgtr`,!0),W(K,J,Y,`⋚`,`\\lesseqgtr`,!0),W(K,J,Y,`⪋`,`\\lesseqqgtr`,!0),W(K,J,Y,`≑`,`\\doteqdot`),W(K,J,Y,`≓`,`\\risingdotseq`,!0),W(K,J,Y,`≒`,`\\fallingdotseq`,!0),W(K,J,Y,`∽`,`\\backsim`,!0),W(K,J,Y,`⋍`,`\\backsimeq`,!0),W(K,J,Y,`⫅`,`\\subseteqq`,!0),W(K,J,Y,`⋐`,`\\Subset`,!0),W(K,J,Y,`⊏`,`\\sqsubset`,!0),W(K,J,Y,`≼`,`\\preccurlyeq`,!0),W(K,J,Y,`⋞`,`\\curlyeqprec`,!0),W(K,J,Y,`≾`,`\\precsim`,!0),W(K,J,Y,`⪷`,`\\precapprox`,!0),W(K,J,Y,`⊲`,`\\vartriangleleft`),W(K,J,Y,`⊴`,`\\trianglelefteq`),W(K,J,Y,`⊨`,`\\vDash`,!0),W(K,J,Y,`⊪`,`\\Vvdash`,!0),W(K,J,Y,`⌣`,`\\smallsmile`),W(K,J,Y,`⌢`,`\\smallfrown`),W(K,J,Y,`≏`,`\\bumpeq`,!0),W(K,J,Y,`≎`,`\\Bumpeq`,!0),W(K,J,Y,`≧`,`\\geqq`,!0),W(K,J,Y,`⩾`,`\\geqslant`,!0),W(K,J,Y,`⪖`,`\\eqslantgtr`,!0),W(K,J,Y,`≳`,`\\gtrsim`,!0),W(K,J,Y,`⪆`,`\\gtrapprox`,!0),W(K,J,vr,`⋗`,`\\gtrdot`),W(K,J,Y,`⋙`,`\\ggg`,!0),W(K,J,Y,`≷`,`\\gtrless`,!0),W(K,J,Y,`⋛`,`\\gtreqless`,!0),W(K,J,Y,`⪌`,`\\gtreqqless`,!0),W(K,J,Y,`≖`,`\\eqcirc`,!0),W(K,J,Y,`≗`,`\\circeq`,!0),W(K,J,Y,`≜`,`\\triangleq`,!0),W(K,J,Y,`∼`,`\\thicksim`),W(K,J,Y,`≈`,`\\thickapprox`),W(K,J,Y,`⫆`,`\\supseteqq`,!0),W(K,J,Y,`⋑`,`\\Supset`,!0),W(K,J,Y,`⊐`,`\\sqsupset`,!0),W(K,J,Y,`≽`,`\\succcurlyeq`,!0),W(K,J,Y,`⋟`,`\\curlyeqsucc`,!0),W(K,J,Y,`≿`,`\\succsim`,!0),W(K,J,Y,`⪸`,`\\succapprox`,!0),W(K,J,Y,`⊳`,`\\vartriangleright`),W(K,J,Y,`⊵`,`\\trianglerighteq`),W(K,J,Y,`⊩`,`\\Vdash`,!0),W(K,J,Y,`∣`,`\\shortmid`),W(K,J,Y,`∥`,`\\shortparallel`),W(K,J,Y,`≬`,`\\between`,!0),W(K,J,Y,`⋔`,`\\pitchfork`,!0),W(K,J,Y,`∝`,`\\varpropto`),W(K,J,Y,`◀`,`\\blacktriangleleft`),W(K,J,Y,`∴`,`\\therefore`,!0),W(K,J,Y,`∍`,`\\backepsilon`),W(K,J,Y,`▶`,`\\blacktriangleright`),W(K,J,Y,`∵`,`\\because`,!0),W(K,J,Y,`⋘`,`\\llless`),W(K,J,Y,`⋙`,`\\gggtr`),W(K,J,vr,`⊲`,`\\lhd`),W(K,J,vr,`⊳`,`\\rhd`),W(K,J,Y,`≂`,`\\eqsim`,!0),W(K,q,Y,`⋈`,`\\Join`),W(K,J,Y,`≑`,`\\Doteq`,!0),W(K,J,vr,`∔`,`\\dotplus`,!0),W(K,J,vr,`∖`,`\\smallsetminus`),W(K,J,vr,`⋒`,`\\Cap`,!0),W(K,J,vr,`⋓`,`\\Cup`,!0),W(K,J,vr,`⩞`,`\\doublebarwedge`,!0),W(K,J,vr,`⊟`,`\\boxminus`,!0),W(K,J,vr,`⊞`,`\\boxplus`,!0),W(K,J,vr,`⋇`,`\\divideontimes`,!0),W(K,J,vr,`⋉`,`\\ltimes`,!0),W(K,J,vr,`⋊`,`\\rtimes`,!0),W(K,J,vr,`⋋`,`\\leftthreetimes`,!0),W(K,J,vr,`⋌`,`\\rightthreetimes`,!0),W(K,J,vr,`⋏`,`\\curlywedge`,!0),W(K,J,vr,`⋎`,`\\curlyvee`,!0),W(K,J,vr,`⊝`,`\\circleddash`,!0),W(K,J,vr,`⊛`,`\\circledast`,!0),W(K,J,vr,`⋅`,`\\centerdot`),W(K,J,vr,`⊺`,`\\intercal`,!0),W(K,J,vr,`⋒`,`\\doublecap`),W(K,J,vr,`⋓`,`\\doublecup`),W(K,J,vr,`⊠`,`\\boxtimes`,!0),W(K,J,Y,`⇢`,`\\dashrightarrow`,!0),W(K,J,Y,`⇠`,`\\dashleftarrow`,!0),W(K,J,Y,`⇇`,`\\leftleftarrows`,!0),W(K,J,Y,`⇆`,`\\leftrightarrows`,!0),W(K,J,Y,`⇚`,`\\Lleftarrow`,!0),W(K,J,Y,`↞`,`\\twoheadleftarrow`,!0),W(K,J,Y,`↢`,`\\leftarrowtail`,!0),W(K,J,Y,`↫`,`\\looparrowleft`,!0),W(K,J,Y,`⇋`,`\\leftrightharpoons`,!0),W(K,J,Y,`↶`,`\\curvearrowleft`,!0),W(K,J,Y,`↺`,`\\circlearrowleft`,!0),W(K,J,Y,`↰`,`\\Lsh`,!0),W(K,J,Y,`⇈`,`\\upuparrows`,!0),W(K,J,Y,`↿`,`\\upharpoonleft`,!0),W(K,J,Y,`⇃`,`\\downharpoonleft`,!0),W(K,q,Y,`⊶`,`\\origof`,!0),W(K,q,Y,`⊷`,`\\imageof`,!0),W(K,J,Y,`⊸`,`\\multimap`,!0),W(K,J,Y,`↭`,`\\leftrightsquigarrow`,!0),W(K,J,Y,`⇉`,`\\rightrightarrows`,!0),W(K,J,Y,`⇄`,`\\rightleftarrows`,!0),W(K,J,Y,`↠`,`\\twoheadrightarrow`,!0),W(K,J,Y,`↣`,`\\rightarrowtail`,!0),W(K,J,Y,`↬`,`\\looparrowright`,!0),W(K,J,Y,`↷`,`\\curvearrowright`,!0),W(K,J,Y,`↻`,`\\circlearrowright`,!0),W(K,J,Y,`↱`,`\\Rsh`,!0),W(K,J,Y,`⇊`,`\\downdownarrows`,!0),W(K,J,Y,`↾`,`\\upharpoonright`,!0),W(K,J,Y,`⇂`,`\\downharpoonright`,!0),W(K,J,Y,`⇝`,`\\rightsquigarrow`,!0),W(K,J,Y,`⇝`,`\\leadsto`),W(K,J,Y,`⇛`,`\\Rrightarrow`,!0),W(K,J,Y,`↾`,`\\restriction`),W(K,q,X,`‘`,"`"),W(K,q,X,`$`,`\\$`),W(gr,q,X,`$`,`\\$`),W(gr,q,X,`$`,`\\textdollar`),W(K,q,X,`%`,`\\%`),W(gr,q,X,`%`,`\\%`),W(K,q,X,`_`,`\\_`),W(gr,q,X,`_`,`\\_`),W(gr,q,X,`_`,`\\textunderscore`),W(K,q,X,`∠`,`\\angle`,!0),W(K,q,X,`∞`,`\\infty`,!0),W(K,q,X,`′`,`\\prime`),W(K,q,X,`△`,`\\triangle`),W(K,q,X,`Γ`,`\\Gamma`,!0),W(K,q,X,`Δ`,`\\Delta`,!0),W(K,q,X,`Θ`,`\\Theta`,!0),W(K,q,X,`Λ`,`\\Lambda`,!0),W(K,q,X,`Ξ`,`\\Xi`,!0),W(K,q,X,`Π`,`\\Pi`,!0),W(K,q,X,`Σ`,`\\Sigma`,!0),W(K,q,X,`Υ`,`\\Upsilon`,!0),W(K,q,X,`Φ`,`\\Phi`,!0),W(K,q,X,`Ψ`,`\\Psi`,!0),W(K,q,X,`Ω`,`\\Omega`,!0),W(K,q,X,`A`,`Α`),W(K,q,X,`B`,`Β`),W(K,q,X,`E`,`Ε`),W(K,q,X,`Z`,`Ζ`),W(K,q,X,`H`,`Η`),W(K,q,X,`I`,`Ι`),W(K,q,X,`K`,`Κ`),W(K,q,X,`M`,`Μ`),W(K,q,X,`N`,`Ν`),W(K,q,X,`O`,`Ο`),W(K,q,X,`P`,`Ρ`),W(K,q,X,`T`,`Τ`),W(K,q,X,`X`,`Χ`),W(K,q,X,`¬`,`\\neg`,!0),W(K,q,X,`¬`,`\\lnot`),W(K,q,X,`⊤`,`\\top`),W(K,q,X,`⊥`,`\\bot`),W(K,q,X,`∅`,`\\emptyset`),W(K,J,X,`∅`,`\\varnothing`),W(K,q,xr,`α`,`\\alpha`,!0),W(K,q,xr,`β`,`\\beta`,!0),W(K,q,xr,`γ`,`\\gamma`,!0),W(K,q,xr,`δ`,`\\delta`,!0),W(K,q,xr,`ϵ`,`\\epsilon`,!0),W(K,q,xr,`ζ`,`\\zeta`,!0),W(K,q,xr,`η`,`\\eta`,!0),W(K,q,xr,`θ`,`\\theta`,!0),W(K,q,xr,`ι`,`\\iota`,!0),W(K,q,xr,`κ`,`\\kappa`,!0),W(K,q,xr,`λ`,`\\lambda`,!0),W(K,q,xr,`μ`,`\\mu`,!0),W(K,q,xr,`ν`,`\\nu`,!0),W(K,q,xr,`ξ`,`\\xi`,!0),W(K,q,xr,`ο`,`\\omicron`,!0),W(K,q,xr,`π`,`\\pi`,!0),W(K,q,xr,`ρ`,`\\rho`,!0),W(K,q,xr,`σ`,`\\sigma`,!0),W(K,q,xr,`τ`,`\\tau`,!0),W(K,q,xr,`υ`,`\\upsilon`,!0),W(K,q,xr,`ϕ`,`\\phi`,!0),W(K,q,xr,`χ`,`\\chi`,!0),W(K,q,xr,`ψ`,`\\psi`,!0),W(K,q,xr,`ω`,`\\omega`,!0),W(K,q,xr,`ε`,`\\varepsilon`,!0),W(K,q,xr,`ϑ`,`\\vartheta`,!0),W(K,q,xr,`ϖ`,`\\varpi`,!0),W(K,q,xr,`ϱ`,`\\varrho`,!0),W(K,q,xr,`ς`,`\\varsigma`,!0),W(K,q,xr,`φ`,`\\varphi`,!0),W(K,q,vr,`∗`,`*`,!0),W(K,q,vr,`+`,`+`),W(K,q,vr,`−`,`-`,!0),W(K,q,vr,`⋅`,`\\cdot`,!0),W(K,q,vr,`∘`,`\\circ`,!0),W(K,q,vr,`÷`,`\\div`,!0),W(K,q,vr,`±`,`\\pm`,!0),W(K,q,vr,`×`,`\\times`,!0),W(K,q,vr,`∩`,`\\cap`,!0),W(K,q,vr,`∪`,`\\cup`,!0),W(K,q,vr,`∖`,`\\setminus`,!0),W(K,q,vr,`∧`,`\\land`),W(K,q,vr,`∨`,`\\lor`),W(K,q,vr,`∧`,`\\wedge`,!0),W(K,q,vr,`∨`,`\\vee`,!0),W(K,q,X,`√`,`\\surd`),W(K,q,Cr,`⟨`,`\\langle`,!0),W(K,q,Cr,`∣`,`\\lvert`),W(K,q,Cr,`∥`,`\\lVert`),W(K,q,yr,`?`,`?`),W(K,q,yr,`!`,`!`),W(K,q,yr,`⟩`,`\\rangle`,!0),W(K,q,yr,`∣`,`\\rvert`),W(K,q,yr,`∥`,`\\rVert`),W(K,q,Y,`=`,`=`),W(K,q,Y,`:`,`:`),W(K,q,Y,`≈`,`\\approx`,!0),W(K,q,Y,`≅`,`\\cong`,!0),W(K,q,Y,`≥`,`\\ge`),W(K,q,Y,`≥`,`\\geq`,!0),W(K,q,Y,`←`,`\\gets`),W(K,q,Y,`>`,`\\gt`,!0),W(K,q,Y,`∈`,`\\in`,!0),W(K,q,Y,``,`\\@not`),W(K,q,Y,`⊂`,`\\subset`,!0),W(K,q,Y,`⊃`,`\\supset`,!0),W(K,q,Y,`⊆`,`\\subseteq`,!0),W(K,q,Y,`⊇`,`\\supseteq`,!0),W(K,J,Y,`⊈`,`\\nsubseteq`,!0),W(K,J,Y,`⊉`,`\\nsupseteq`,!0),W(K,q,Y,`⊨`,`\\models`),W(K,q,Y,`←`,`\\leftarrow`,!0),W(K,q,Y,`≤`,`\\le`),W(K,q,Y,`≤`,`\\leq`,!0),W(K,q,Y,`<`,`\\lt`,!0),W(K,q,Y,`→`,`\\rightarrow`,!0),W(K,q,Y,`→`,`\\to`),W(K,J,Y,`≱`,`\\ngeq`,!0),W(K,J,Y,`≰`,`\\nleq`,!0),W(K,q,Tr,`\xA0`,`\\ `),W(K,q,Tr,`\xA0`,`\\space`),W(K,q,Tr,`\xA0`,`\\nobreakspace`),W(gr,q,Tr,`\xA0`,`\\ `),W(gr,q,Tr,`\xA0`,` `),W(gr,q,Tr,`\xA0`,`\\space`),W(gr,q,Tr,`\xA0`,`\\nobreakspace`),W(K,q,Tr,``,`\\nobreak`),W(K,q,Tr,``,`\\allowbreak`),W(K,q,wr,`,`,`,`),W(K,q,wr,`;`,`;`),W(K,J,vr,`⊼`,`\\barwedge`,!0),W(K,J,vr,`⊻`,`\\veebar`,!0),W(K,q,vr,`⊙`,`\\odot`,!0),W(K,q,vr,`⊕`,`\\oplus`,!0),W(K,q,vr,`⊗`,`\\otimes`,!0),W(K,q,X,`∂`,`\\partial`,!0),W(K,q,vr,`⊘`,`\\oslash`,!0),W(K,J,vr,`⊚`,`\\circledcirc`,!0),W(K,J,vr,`⊡`,`\\boxdot`,!0),W(K,q,vr,`△`,`\\bigtriangleup`),W(K,q,vr,`▽`,`\\bigtriangledown`),W(K,q,vr,`†`,`\\dagger`),W(K,q,vr,`⋄`,`\\diamond`),W(K,q,vr,`⋆`,`\\star`),W(K,q,vr,`◃`,`\\triangleleft`),W(K,q,vr,`▹`,`\\triangleright`),W(K,q,Cr,`{`,`\\{`),W(gr,q,X,`{`,`\\{`),W(gr,q,X,`{`,`\\textbraceleft`),W(K,q,yr,`}`,`\\}`),W(gr,q,X,`}`,`\\}`),W(gr,q,X,`}`,`\\textbraceright`),W(K,q,Cr,`{`,`\\lbrace`),W(K,q,yr,`}`,`\\rbrace`),W(K,q,Cr,`[`,`\\lbrack`,!0),W(gr,q,X,`[`,`\\lbrack`,!0),W(K,q,yr,`]`,`\\rbrack`,!0),W(gr,q,X,`]`,`\\rbrack`,!0),W(K,q,Cr,`(`,`\\lparen`,!0),W(K,q,yr,`)`,`\\rparen`,!0),W(gr,q,X,`<`,`\\textless`,!0),W(gr,q,X,`>`,`\\textgreater`,!0),W(K,q,Cr,`⌊`,`\\lfloor`,!0),W(K,q,yr,`⌋`,`\\rfloor`,!0),W(K,q,Cr,`⌈`,`\\lceil`,!0),W(K,q,yr,`⌉`,`\\rceil`,!0),W(K,q,X,`\\`,`\\backslash`),W(K,q,X,`∣`,`|`),W(K,q,X,`∣`,`\\vert`),W(gr,q,X,`|`,`\\textbar`,!0),W(K,q,X,`∥`,`\\|`),W(K,q,X,`∥`,`\\Vert`),W(gr,q,X,`∥`,`\\textbardbl`),W(gr,q,X,`~`,`\\textasciitilde`),W(gr,q,X,`\\`,`\\textbackslash`),W(gr,q,X,`^`,`\\textasciicircum`),W(K,q,Y,`↑`,`\\uparrow`,!0),W(K,q,Y,`⇑`,`\\Uparrow`,!0),W(K,q,Y,`↓`,`\\downarrow`,!0),W(K,q,Y,`⇓`,`\\Downarrow`,!0),W(K,q,Y,`↕`,`\\updownarrow`,!0),W(K,q,Y,`⇕`,`\\Updownarrow`,!0),W(K,q,Sr,`∐`,`\\coprod`),W(K,q,Sr,`⋁`,`\\bigvee`),W(K,q,Sr,`⋀`,`\\bigwedge`),W(K,q,Sr,`⨄`,`\\biguplus`),W(K,q,Sr,`⋂`,`\\bigcap`),W(K,q,Sr,`⋃`,`\\bigcup`),W(K,q,Sr,`∫`,`\\int`),W(K,q,Sr,`∫`,`\\intop`),W(K,q,Sr,`∬`,`\\iint`),W(K,q,Sr,`∭`,`\\iiint`),W(K,q,Sr,`∏`,`\\prod`),W(K,q,Sr,`∑`,`\\sum`),W(K,q,Sr,`⨂`,`\\bigotimes`),W(K,q,Sr,`⨁`,`\\bigoplus`),W(K,q,Sr,`⨀`,`\\bigodot`),W(K,q,Sr,`∮`,`\\oint`),W(K,q,Sr,`∯`,`\\oiint`),W(K,q,Sr,`∰`,`\\oiiint`),W(K,q,Sr,`⨆`,`\\bigsqcup`),W(K,q,Sr,`∫`,`\\smallint`),W(gr,q,br,`…`,`\\textellipsis`),W(K,q,br,`…`,`\\mathellipsis`),W(gr,q,br,`…`,`\\ldots`,!0),W(K,q,br,`…`,`\\ldots`,!0),W(K,q,br,`⋯`,`\\@cdots`,!0),W(K,q,br,`⋱`,`\\ddots`,!0),W(K,q,X,`⋮`,`\\varvdots`),W(gr,q,X,`⋮`,`\\varvdots`),W(K,q,_r,`ˊ`,`\\acute`),W(K,q,_r,`ˋ`,`\\grave`),W(K,q,_r,`¨`,`\\ddot`),W(K,q,_r,`~`,`\\tilde`),W(K,q,_r,`ˉ`,`\\bar`),W(K,q,_r,`˘`,`\\breve`),W(K,q,_r,`ˇ`,`\\check`),W(K,q,_r,`^`,`\\hat`),W(K,q,_r,`⃗`,`\\vec`),W(K,q,_r,`˙`,`\\dot`),W(K,q,_r,`˚`,`\\mathring`),W(K,q,xr,``,`\\@imath`),W(K,q,xr,``,`\\@jmath`),W(K,q,X,`ı`,`ı`),W(K,q,X,`ȷ`,`ȷ`),W(gr,q,X,`ı`,`\\i`,!0),W(gr,q,X,`ȷ`,`\\j`,!0),W(gr,q,X,`ß`,`\\ss`,!0),W(gr,q,X,`æ`,`\\ae`,!0),W(gr,q,X,`œ`,`\\oe`,!0),W(gr,q,X,`ø`,`\\o`,!0),W(gr,q,X,`Æ`,`\\AE`,!0),W(gr,q,X,`Œ`,`\\OE`,!0),W(gr,q,X,`Ø`,`\\O`,!0),W(gr,q,_r,`ˊ`,`\\'`),W(gr,q,_r,`ˋ`,"\\`"),W(gr,q,_r,`ˆ`,`\\^`),W(gr,q,_r,`˜`,`\\~`),W(gr,q,_r,`ˉ`,`\\=`),W(gr,q,_r,`˘`,`\\u`),W(gr,q,_r,`˙`,`\\.`),W(gr,q,_r,`¸`,`\\c`),W(gr,q,_r,`˚`,`\\r`),W(gr,q,_r,`ˇ`,`\\v`),W(gr,q,_r,`¨`,`\\"`),W(gr,q,_r,`˝`,`\\H`),W(gr,q,_r,`◯`,`\\textcircled`),Er={"--":!0,"---":!0,"``":!0,"''":!0},W(gr,q,X,`–`,`--`,!0),W(gr,q,X,`–`,`\\textendash`),W(gr,q,X,`—`,`---`,!0),W(gr,q,X,`—`,`\\textemdash`),W(gr,q,X,`‘`,"`",!0),W(gr,q,X,`‘`,`\\textquoteleft`),W(gr,q,X,`’`,`'`,!0),W(gr,q,X,`’`,`\\textquoteright`),W(gr,q,X,`“`,"``",!0),W(gr,q,X,`“`,`\\textquotedblleft`),W(gr,q,X,`”`,`''`,!0),W(gr,q,X,`”`,`\\textquotedblright`),W(K,q,X,`°`,`\\degree`,!0),W(gr,q,X,`°`,`\\degree`),W(gr,q,X,`°`,`\\textdegree`,!0),W(K,q,X,`£`,`\\pounds`),W(K,q,X,`£`,`\\mathsterling`,!0),W(gr,q,X,`£`,`\\pounds`),W(gr,q,X,`£`,`\\textsterling`,!0),W(K,J,X,`✠`,`\\maltese`),W(gr,J,X,`✠`,`\\maltese`),Dr=`0123456789/@."`,Or=0;Or<Dr.length;Or++)kr=Dr.charAt(Or),W(K,q,X,kr,kr);for(Ar=`0123456789!@*()-=+";:?/.,`,jr=0;jr<Ar.length;jr++)Mr=Ar.charAt(jr),W(gr,q,X,Mr,Mr);for(Nr=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,Pr=0;Pr<Nr.length;Pr++)Fr=Nr.charAt(Pr),W(K,q,xr,Fr,Fr),W(gr,q,X,Fr,Fr);for(W(K,J,X,`C`,`ℂ`),W(gr,J,X,`C`,`ℂ`),W(K,J,X,`H`,`ℍ`),W(gr,J,X,`H`,`ℍ`),W(K,J,X,`N`,`ℕ`),W(gr,J,X,`N`,`ℕ`),W(K,J,X,`P`,`ℙ`),W(gr,J,X,`P`,`ℙ`),W(K,J,X,`Q`,`ℚ`),W(gr,J,X,`Q`,`ℚ`),W(K,J,X,`R`,`ℝ`),W(gr,J,X,`R`,`ℝ`),W(K,J,X,`Z`,`ℤ`),W(gr,J,X,`Z`,`ℤ`),W(K,q,xr,`h`,`ℎ`),W(gr,q,xr,`h`,`ℎ`),Lr=0;Lr<Nr.length;Lr++)Rr=Nr.charAt(Lr),Ir=String.fromCharCode(55349,56320+Lr),W(K,q,xr,Rr,Ir),W(gr,q,X,Rr,Ir),Ir=String.fromCharCode(55349,56372+Lr),W(K,q,xr,Rr,Ir),W(gr,q,X,Rr,Ir),Ir=String.fromCharCode(55349,56424+Lr),W(K,q,xr,Rr,Ir),W(gr,q,X,Rr,Ir),Ir=String.fromCharCode(55349,56580+Lr),W(K,q,xr,Rr,Ir),W(gr,q,X,Rr,Ir),Ir=String.fromCharCode(55349,56684+Lr),W(K,q,xr,Rr,Ir),W(gr,q,X,Rr,Ir),Ir=String.fromCharCode(55349,56736+Lr),W(K,q,xr,Rr,Ir),W(gr,q,X,Rr,Ir),Ir=String.fromCharCode(55349,56788+Lr),W(K,q,xr,Rr,Ir),W(gr,q,X,Rr,Ir),Ir=String.fromCharCode(55349,56840+Lr),W(K,q,xr,Rr,Ir),W(gr,q,X,Rr,Ir),Ir=String.fromCharCode(55349,56944+Lr),W(K,q,xr,Rr,Ir),W(gr,q,X,Rr,Ir),Lr<26&&(Ir=String.fromCharCode(55349,56632+Lr),W(K,q,xr,Rr,Ir),W(gr,q,X,Rr,Ir),Ir=String.fromCharCode(55349,56476+Lr),W(K,q,xr,Rr,Ir),W(gr,q,X,Rr,Ir));for(Ir=String.fromCharCode(55349,56668),W(K,q,xr,`k`,Ir),W(gr,q,X,`k`,Ir),zr=0;zr<10;zr++)Br=zr.toString(),Ir=String.fromCharCode(55349,57294+zr),W(K,q,xr,Br,Ir),W(gr,q,X,Br,Ir),Ir=String.fromCharCode(55349,57314+zr),W(K,q,xr,Br,Ir),W(gr,q,X,Br,Ir),Ir=String.fromCharCode(55349,57324+zr),W(K,q,xr,Br,Ir),W(gr,q,X,Br,Ir),Ir=String.fromCharCode(55349,57334+zr),W(K,q,xr,Br,Ir),W(gr,q,X,Br,Ir);for(Vr=`ÐÞþ`,Hr=0;Hr<Vr.length;Hr++)Ur=Vr.charAt(Hr),W(K,q,xr,Ur,Ur),W(gr,q,X,Ur,Ur);Wr={mathClass:`mathbf`,textClass:`textbf`,font:`Main-Bold`},Gr={mathClass:`mathnormal`,textClass:`textit`,font:`Math-Italic`},Kr={mathClass:`boldsymbol`,textClass:`boldsymbol`,font:`Main-BoldItalic`},Kee={mathClass:`mathscr`,textClass:`textscr`,font:`Script-Regular`},qr={mathClass:``,textClass:``,font:``},Jr={mathClass:`mathfrak`,textClass:`textfrak`,font:`Fraktur-Regular`},Yr={mathClass:`mathbb`,textClass:`textbb`,font:`AMS-Regular`},Xr={mathClass:`mathboldfrak`,textClass:`textboldfrak`,font:`Fraktur-Regular`},Zr={mathClass:`mathsf`,textClass:`textsf`,font:`SansSerif-Regular`},Qr={mathClass:`mathboldsf`,textClass:`textboldsf`,font:`SansSerif-Bold`},$r={mathClass:`mathitsf`,textClass:`textitsf`,font:`SansSerif-Italic`},ei={mathClass:`mathtt`,textClass:`texttt`,font:`Typewriter-Regular`},ti=[Wr,Wr,Gr,Gr,Kr,Kr,Kee,qr,qr,qr,Jr,Jr,Yr,Yr,Xr,Xr,Zr,Zr,Qr,Qr,$r,$r,qr,qr,ei,ei],qee=[Wr,qr,Zr,Qr,ei],Jee=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484)return ti[Math.floor((r-119808)/26)];if(120782<=r&&r<=120831)return qee[Math.floor((r-120782)/10)];if(r===120485||r===120486)return ti[0];if(120486<r&&r<120782)return qr;throw new En(`Unsupported character: `+e)},ni=function(e,t,n){if(hr[n][e]){var r=hr[n][e].replace;r&&(e=r)}return{value:e,metrics:tn(e,t,n)}},ri=function(e,t,n,r,i){var a=ni(e,t,n),o=a.metrics;e=a.value;var s;if(o){var l=o.italic;(n===`text`||r&&r.font===`mathit`)&&(l=0),s=new sr(e,o.height,o.depth,l,o.skew,o.width,i)}else typeof console<`u`&&console.warn(`No character metrics `+(`for '`+e+`' in style '`+t+`' and mode '`+n+`'`)),s=new sr(e,0,0,0,0,0,i);if(r){s.maxFontSize=r.sizeMultiplier,r.style.isTight()&&s.classes.push(`mtight`);var u=r.getColor();u&&(s.style.color=u)}return s},ii=function(e,t,n,r){return r===void 0&&(r=[]),n.font===`boldsymbol`&&ni(e,`Main-Bold`,t).metrics?ri(e,`Main-Bold`,t,n,r.concat([`mathbf`])):e===`\\`||hr[t][e].font===`main`?ri(e,`Main-Regular`,t,n,r):ri(e,`AMS-Regular`,t,n,r.concat([`amsrm`]))},Yee=function(e,t,n){return n!==`textord`&&ni(e,`Math-BoldItalic`,t).metrics?{fontName:`Math-BoldItalic`,fontClass:`boldsymbol`}:{fontName:`Main-Bold`,fontClass:`mathbf`}},ai=function(e,t,n){var r=e.mode,i=e.text,a=[`mord`],{font:o,fontFamily:s,fontWeight:l,fontShape:u}=t,d=r===`math`||r===`text`&&!!o,f=d?o:s,p=``,m=``;if(i.charCodeAt(0)===55349){var h=Jee(i);p=h.font,m=h[r+`Class`]}if(p)return ri(i,p,r,t,a.concat(m));if(f){var g,_;if(f===`boldsymbol`){var v=Yee(i,r,n);g=v.fontName,_=[v.fontClass]}else d?(g=gi[o].fontName,_=[o]):(g=hi(s,l,u),_=[s,l,u]);if(ni(i,g,r).metrics)return ri(i,g,r,t,a.concat(_));if(Er.hasOwnProperty(i)&&g.slice(0,10)===`Typewriter`){for(var y=[],b=0;b<i.length;b++)y.push(ri(i[b],g,r,t,a.concat(_)));return di(y)}}if(n===`mathord`)return ri(i,`Math-Italic`,r,t,a.concat([`mathnormal`]));if(n===`textord`){var x=hr[r][i]&&hr[r][i].font;if(x===`ams`)return ri(i,hi(`amsrm`,l,u),r,t,a.concat(`amsrm`,l,u));if(x===`main`||!x)return ri(i,hi(`textrm`,l,u),r,t,a.concat(l,u));var S=hi(x,l,u);return ri(i,S,r,t,a.concat(S,l,u))}throw Error(`unexpected type: `+n+` in makeOrd`)},Xee=(e,t)=>{if($n(e.classes)!==$n(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass(`mathnormal`))return!1;if(e.classes.length===1){var n=e.classes[0];if(n===`mbin`||n===`mord`)return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},oi=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof sr&&r instanceof sr&&Xee(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},si=function(e){for(var t=0,n=0,r=0,i=0;i<e.children.length;i++){var a=e.children[i];a.height>t&&(t=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>r&&(r=a.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},ci=function(e,t,n,r){var i=new ir(e,t,n,r);return si(i),i},li=(e,t,n,r)=>new ir(e,t,n,r),ui=function(e,t,n){var r=ci([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=Qn(r.height),r.maxFontSize=1,r},Zee=function(e,t,n,r){var i=new ar(e,t,n,r);return si(i),i},di=function(e){var t=new Jn(e);return si(t),t},fi=function(e,t){return e instanceof Jn?ci([],[e],t):e},Qee=function(e){if(e.positionType===`individualShift`){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,a=1;a<t.length;a++){var o=-t[a].shift-i-t[a].elem.depth,s=o-(t[a-1].elem.height+t[a-1].elem.depth);i+=o,n.push({type:`kern`,size:s}),n.push(t[a])}return{children:n,depth:r}}var l;if(e.positionType===`top`){for(var u=e.positionData,d=0;d<e.children.length;d++){var f=e.children[d];u-=f.type===`kern`?f.size:f.elem.height+f.elem.depth}l=u}else if(e.positionType===`bottom`)l=-e.positionData;else{var p=e.children[0];if(p.type!==`elem`)throw Error(`First child must have type "elem".`);if(e.positionType===`shift`)l=-p.elem.depth-e.positionData;else if(e.positionType===`firstBaseline`)l=-p.elem.depth;else throw Error(`Invalid positionType `+e.positionType+`.`)}return{children:e.children,depth:l}},pi=function(e,t){for(var{children:n,depth:r}=Qee(e),i=0,a=0;a<n.length;a++){var o=n[a];if(o.type===`elem`){var s=o.elem;i=Math.max(i,s.maxFontSize,s.height)}}i+=2;var l=ci([`pstrut`],[]);l.style.height=Qn(i);for(var u=[],d=r,f=r,p=r,m=0;m<n.length;m++){var h=n[m];if(h.type===`kern`)p+=h.size;else{var g=h.elem,_=h.wrapperClasses||[],v=h.wrapperStyle||{},y=ci(_,[l,g],void 0,v);y.style.top=Qn(-i-p-g.depth),h.marginLeft&&(y.style.marginLeft=h.marginLeft),h.marginRight&&(y.style.marginRight=h.marginRight),u.push(y),p+=g.height+g.depth}d=Math.min(d,p),f=Math.max(f,p)}var b=ci([`vlist`],u);b.style.height=Qn(f);var x;if(d<0){var S=ci([`vlist`],[ci([],[])]);S.style.height=Qn(-d),x=[ci([`vlist-r`],[b,ci([`vlist-s`],[new sr(``)])]),ci([`vlist-r`],[S])]}else x=[ci([`vlist-r`],[b])];var C=ci([`vlist-t`],x);return x.length===2&&C.classes.push(`vlist-t2`),C.height=f,C.depth=-d,C},mi=(e,t)=>{var n=ci([`mspace`],[],t),r=Zn(e,t);return n.style.marginRight=Qn(r),n},hi=(e,t,n)=>{var r,i;switch(e){case`amsrm`:r=`AMS`;break;case`textrm`:r=`Main`;break;case`textsf`:r=`SansSerif`;break;case`texttt`:r=`Typewriter`;break;default:r=e}return i=t===`textbf`&&n===`textit`?`BoldItalic`:t===`textbf`?`Bold`:n===`textit`?`Italic`:`Regular`,r+`-`+i},gi={mathbf:{variant:`bold`,fontName:`Main-Bold`},mathrm:{variant:`normal`,fontName:`Main-Regular`},textit:{variant:`italic`,fontName:`Main-Italic`},mathit:{variant:`italic`,fontName:`Main-Italic`},mathnormal:{variant:`italic`,fontName:`Math-Italic`},mathsfit:{variant:`sans-serif-italic`,fontName:`SansSerif-Italic`},mathbb:{variant:`double-struck`,fontName:`AMS-Regular`},mathcal:{variant:`script`,fontName:`Caligraphic-Regular`},mathfrak:{variant:`fraktur`,fontName:`Fraktur-Regular`},mathscr:{variant:`script`,fontName:`Script-Regular`},mathsf:{variant:`sans-serif`,fontName:`SansSerif-Regular`},mathtt:{variant:`monospace`,fontName:`Typewriter-Regular`}},_i={vec:[`vec`,.471,.714],oiintSize1:[`oiintSize1`,.957,.499],oiintSize2:[`oiintSize2`,1.472,.659],oiiintSize1:[`oiiintSize1`,1.304,.499],oiiintSize2:[`oiiintSize2`,1.98,.659]},vi=function(e,t){var[n,r,i]=_i[e],a=new lr(n),o=li([`overlay`],[new cr([a],{width:Qn(r),height:Qn(i),style:`width:`+Qn(r),viewBox:`0 0 `+1e3*r+` `+1e3*i,preserveAspectRatio:`xMinYMin`})],t);return o.height=i,o.style.height=Qn(i),o.style.width=Qn(r),o},yi={number:3,unit:`mu`},bi={number:4,unit:`mu`},xi={number:5,unit:`mu`},$ee={mord:{mop:yi,mbin:bi,mrel:xi,minner:yi},mop:{mord:yi,mop:yi,mrel:xi,minner:yi},mbin:{mord:bi,mop:bi,mopen:bi,minner:bi},mrel:{mord:xi,mop:xi,mopen:xi,minner:xi},mopen:{},mclose:{mop:yi,mbin:bi,mrel:xi,minner:yi},mpunct:{mord:yi,mop:yi,mrel:xi,mopen:yi,mclose:yi,mpunct:yi,minner:yi},minner:{mord:yi,mop:yi,mbin:bi,mrel:xi,mopen:yi,mpunct:yi,minner:yi}},ete={mord:{mop:yi},mop:{mord:yi,mop:yi},mbin:{},mrel:{},mopen:{},mclose:{mop:yi},mpunct:{},minner:{mop:yi}},Si={},Ci={},wi={},Ti=function(e){return e.type===`ordgroup`&&e.body.length===1?e.body[0]:e},Ei=function(e){return e.type===`ordgroup`?e.body:[e]},tte=new Set([`leftmost`,`mbin`,`mopen`,`mrel`,`mop`,`mpunct`]),nte=new Set([`rightmost`,`mrel`,`mclose`,`mpunct`]),rte={display:Hn.DISPLAY,text:Hn.TEXT,script:Hn.SCRIPT,scriptscript:Hn.SCRIPTSCRIPT},ite={mord:`mord`,mop:`mop`,mbin:`mbin`,mrel:`mrel`,mopen:`mopen`,mclose:`mclose`,mpunct:`mpunct`,minner:`minner`},Di=function(e,t,n,r){r===void 0&&(r=[null,null]);for(var i=[],a=0;a<e.length;a++){var o=Ni(e[a],t);if(o instanceof Jn){var s=o.children;i.push(...s)}else i.push(o)}if(oi(i),!n)return i;var l=t;if(e.length===1){var u=e[0];u.type===`sizing`?l=t.havingSize(u.size):u.type===`styling`&&(l=t.havingStyle(rte[u.style]))}var d=ci([r[0]||`leftmost`],[],t),f=ci([r[1]||`rightmost`],[],t),p=n===`root`;return Oi(i,(e,t)=>{var n=t.classes[0],r=e.classes[0];n===`mbin`&&nte.has(r)?t.classes[0]=`mord`:r===`mbin`&&tte.has(n)&&(e.classes[0]=`mord`)},{node:d},f,p),Oi(i,(e,t)=>{var n=ji(t),r=ji(e),i=n&&r?e.hasClass(`mtight`)?ete[n]?.[r]:$ee[n]?.[r]:null;if(i)return mi(i,l)},{node:d},f,p),i},Oi=function(e,t,n,r,i){r&&e.push(r);for(var a=0;a<e.length;a++){var o=e[a],s=ki(o);if(s){Oi(s.children,t,n,null,i);continue}var l=!o.hasClass(`mspace`);if(l){var u=t(o,n.node);u&&(n.insertAfter?n.insertAfter(u):(e.unshift(u),a++))}l?n.node=o:i&&o.hasClass(`newline`)&&(n.node=ci([`leftmost`])),n.insertAfter=(t=>n=>{e.splice(t+1,0,n),a++})(a)}r&&e.pop()},ki=function(e){return e instanceof Jn||e instanceof ar||e instanceof ir&&e.hasClass(`enclosing`)?e:null},Ai=function(e,t){var n=ki(e);if(n){var r=n.children;if(r.length){if(t===`right`)return Ai(r[r.length-1],`right`);if(t===`left`)return Ai(r[0],`left`)}}return e},ji=function(e,t){return e?(t&&(e=Ai(e,t)),ite[e.classes[0]]||null):null},Mi=function(e,t){var n=[`nulldelimiter`].concat(e.baseSizingClasses());return ci(t.concat(n))},Ni=function(e,t,n){if(!e)return ci();if(Ci[e.type]){var r=Ci[e.type](e,t);if(n&&t.size!==n.size){r=ci(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}throw new En(`Got group of unknown type: '`+e.type+`'`)},Pi=class{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=$n(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof Fi&&this.children[n+1]instanceof Fi){for(var r=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof Fi;)r+=this.children[++n].toText();e.appendChild(new Fi(r).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<`+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=` `+t+`="`,e+=Dn(this.attributes[t]),e+=`"`);this.classes.length>0&&(e+=` class ="`+Dn($n(this.classes))+`"`),e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</`+this.type+`>`,e}toText(){return this.children.map(e=>e.toText()).join(``)}},Fi=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Dn(this.toText())}toText(){return this.text}},Ii=class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?` `:e>=.1666&&e<=.1667?` `:e>=.2222&&e<=.2223?` `:e>=.2777&&e<=.2778?` `:e>=-.05556&&e<=-.05555?` `:e>=-.1667&&e<=-.1666?` `:e>=-.2223&&e<=-.2222?` `:e>=-.2778&&e<=-.2777?` `:null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`mspace`);return e.setAttribute(`width`,Qn(this.width)),e}toMarkup(){return this.character?`<mtext>`+this.character+`</mtext>`:`<mspace width="`+Qn(this.width)+`"/>`}toText(){return this.character?this.character:` `}},ate=new Set([`\\imath`,`\\jmath`]),ote=new Set([`mrow`,`mtable`]),Li=function(e,t,n){return hr[t][e]&&hr[t][e].replace&&e.charCodeAt(0)!==55349&&!(Er.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)===`tt`||n.font&&n.font.slice(4,6)===`tt`))&&(e=hr[t][e].replace),new Fi(e)},Ri=function(e){return e.length===1?e[0]:new Pi(`mrow`,e)},ste={mathit:`italic`,boldsymbol:e=>e.type===`textord`?`bold`:`bold-italic`,mathbf:`bold`,mathbb:`double-struck`,mathsfit:`sans-serif-italic`,mathfrak:`fraktur`,mathscr:`script`,mathcal:`script`,mathsf:`sans-serif`,mathtt:`monospace`},zi=(e,t)=>{if(e.mode===`text`){if(t.fontFamily===`texttt`)return`monospace`;if(t.fontFamily===`textsf`)return t.fontShape===`textit`&&t.fontWeight===`textbf`?`sans-serif-bold-italic`:t.fontShape===`textit`?`sans-serif-italic`:t.fontWeight===`textbf`?`bold-sans-serif`:`sans-serif`;if(t.fontShape===`textit`&&t.fontWeight===`textbf`)return`bold-italic`;if(t.fontShape===`textit`)return`italic`;if(t.fontWeight===`textbf`)return`bold`}var n=t.font;if(!n||n===`mathnormal`)return null;var r=e.mode,i=ste[n];if(i)return typeof i==`function`?i(e):i;var a=e.text;if(ate.has(a))return null;if(hr[r][a]){var o=hr[r][a].replace;o&&(a=o)}var s=gi[n].fontName;return tn(a,s,r)?gi[n].variant:null},Bi=function(e,t,n){if(e.length===1){var r=Hi(e[0],t);return n&&r instanceof Pi&&r.type===`mo`&&(r.setAttribute(`lspace`,`0em`),r.setAttribute(`rspace`,`0em`)),[r]}for(var i=[],a,o=0;o<e.length;o++){var s=Hi(e[o],t);if(s instanceof Pi&&a instanceof Pi){if(s.type===`mtext`&&a.type===`mtext`&&s.getAttribute(`mathvariant`)===a.getAttribute(`mathvariant`)){a.children.push(...s.children);continue}if(s.type===`mn`&&a.type===`mn`){a.children.push(...s.children);continue}if(cn(s)&&a.type===`mn`){a.children.push(...s.children);continue}if(s.type===`mn`&&cn(a))s.children=[...a.children,...s.children],i.pop();else if((s.type===`msup`||s.type===`msub`)&&s.children.length>=1&&(a.type===`mn`||cn(a))){var l=s.children[0];l instanceof Pi&&l.type===`mn`&&(l.children=[...a.children,...l.children],i.pop())}else if(a.type===`mi`&&a.children.length===1){var u=a.children[0];if(u instanceof Fi&&u.text===`̸`&&(s.type===`mo`||s.type===`mi`||s.type===`mn`)){var d=s.children[0];d instanceof Fi&&d.text.length>0&&(d.text=d.text.slice(0,1)+`̸`+d.text.slice(1),i.pop())}}}i.push(s),a=s}return i},Vi=function(e,t,n){return Ri(Bi(e,t,n))},Hi=function(e,t){if(!e)return new Pi(`mrow`);if(wi[e.type])return wi[e.type](e,t);throw new En(`Got group of unknown type: '`+e.type+`'`)},cte=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Ui=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Wi=function(e,t){return t.size<2?e:cte[e-1][t.size-1]},Gi=class e{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||e.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||``,this.fontFamily=t.fontFamily||``,this.fontWeight=t.fontWeight||``,this.fontShape=t.fontShape||``,this.sizeMultiplier=Ui[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(n,t),new e(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Wi(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Ui[e-1]})}havingBaseStyle(t){t||=this.style.text();var n=Wi(e.BASESIZE,t);return this.size===n&&this.textSize===e.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:``})}withTextFontWeight(e){return this.extend({fontWeight:e,font:``})}withTextFontShape(e){return this.extend({fontShape:e,font:``})}sizingClasses(e){return e.size===this.size?[]:[`sizing`,`reset-size`+e.size,`size`+this.size]}baseSizingClasses(){return this.size===e.BASESIZE?[]:[`sizing`,`reset-size`+this.size,`size`+e.BASESIZE]}fontMetrics(){return this._fontMetrics||=_ee(this.size),this._fontMetrics}getColor(){return this.phantom?`transparent`:this.color}},Gi.BASESIZE=6,Ki=function(e){return new Gi({style:e.displayMode?Hn.DISPLAY:Hn.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},qi=function(e,t){if(t.displayMode){var n=[`katex-display`];t.leqno&&n.push(`leqno`),t.fleqn&&n.push(`fleqn`),e=ci(n,[e])}return e},lte=function(e,t,n){var r=Ki(n),i;return n.output===`mathml`?ln(e,t,r,n.displayMode,!0):(i=n.output===`html`?ci([`katex`],[on(e,r)]):ci([`katex`],[ln(e,t,r,n.displayMode,!1),on(e,r)]),qi(i,n))},ute=function(e,t,n){return qi(ci([`katex`],[on(e,Ki(n))]),n)},dte={widehat:`^`,widecheck:`ˇ`,widetilde:`~`,utilde:`~`,overleftarrow:`←`,underleftarrow:`←`,xleftarrow:`←`,overrightarrow:`→`,underrightarrow:`→`,xrightarrow:`→`,underbrace:`⏟`,overbrace:`⏞`,underbracket:`⎵`,overbracket:`⎴`,overgroup:`⏠`,undergroup:`⏡`,overleftrightarrow:`↔`,underleftrightarrow:`↔`,xleftrightarrow:`↔`,Overrightarrow:`⇒`,xRightarrow:`⇒`,overleftharpoon:`↼`,xleftharpoonup:`↼`,overrightharpoon:`⇀`,xrightharpoonup:`⇀`,xLeftarrow:`⇐`,xLeftrightarrow:`⇔`,xhookleftarrow:`↩`,xhookrightarrow:`↪`,xmapsto:`↦`,xrightharpoondown:`⇁`,xleftharpoondown:`↽`,xrightleftharpoons:`⇌`,xleftrightharpoons:`⇋`,xtwoheadleftarrow:`↞`,xtwoheadrightarrow:`↠`,xlongequal:`=`,xtofrom:`⇄`,xrightleftarrows:`⇄`,xrightequilibrium:`⇌`,xleftequilibrium:`⇋`,"\\cdrightarrow":`→`,"\\cdleftarrow":`←`,"\\cdlongequal":`=`},Ji=function(e){var t=new Pi(`mo`,[new Fi(dte[e.replace(/^\\/,``)])]);return t.setAttribute(`stretchy`,`true`),t},fte={overrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],overleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],underrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],underleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],xrightarrow:[[`rightarrow`],1.469,522,`xMaxYMin`],"\\cdrightarrow":[[`rightarrow`],3,522,`xMaxYMin`],xleftarrow:[[`leftarrow`],1.469,522,`xMinYMin`],"\\cdleftarrow":[[`leftarrow`],3,522,`xMinYMin`],Overrightarrow:[[`doublerightarrow`],.888,560,`xMaxYMin`],xRightarrow:[[`doublerightarrow`],1.526,560,`xMaxYMin`],xLeftarrow:[[`doubleleftarrow`],1.526,560,`xMinYMin`],overleftharpoon:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoonup:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoondown:[[`leftharpoondown`],.888,522,`xMinYMin`],overrightharpoon:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoonup:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoondown:[[`rightharpoondown`],.888,522,`xMaxYMin`],xlongequal:[[`longequal`],.888,334,`xMinYMin`],"\\cdlongequal":[[`longequal`],3,334,`xMinYMin`],xtwoheadleftarrow:[[`twoheadleftarrow`],.888,334,`xMinYMin`],xtwoheadrightarrow:[[`twoheadrightarrow`],.888,334,`xMaxYMin`],overleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],overbrace:[[`leftbrace`,`midbrace`,`rightbrace`],1.6,548],underbrace:[[`leftbraceunder`,`midbraceunder`,`rightbraceunder`],1.6,548],underleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],xleftrightarrow:[[`leftarrow`,`rightarrow`],1.75,522],xLeftrightarrow:[[`doubleleftarrow`,`doublerightarrow`],1.75,560],xrightleftharpoons:[[`leftharpoondownplus`,`rightharpoonplus`],1.75,716],xleftrightharpoons:[[`leftharpoonplus`,`rightharpoondownplus`],1.75,716],xhookleftarrow:[[`leftarrow`,`righthook`],1.08,522],xhookrightarrow:[[`lefthook`,`rightarrow`],1.08,522],overlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],underlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],overbracket:[[`leftbracketover`,`rightbracketover`],1.6,440],underbracket:[[`leftbracketunder`,`rightbracketunder`],1.6,410],overgroup:[[`leftgroup`,`rightgroup`],.888,342],undergroup:[[`leftgroupunder`,`rightgroupunder`],.888,342],xmapsto:[[`leftmapsto`,`rightarrow`],1.5,522],xtofrom:[[`leftToFrom`,`rightToFrom`],1.75,528],xrightleftarrows:[[`baraboveleftarrow`,`rightarrowabovebar`],1.75,901],xrightequilibrium:[[`baraboveshortleftharpoon`,`rightharpoonaboveshortbar`],1.75,716],xleftequilibrium:[[`shortbaraboveleftharpoon`,`shortrightharpoonabovebar`],1.75,716]},Yi=new Set([`widehat`,`widecheck`,`widetilde`,`utilde`]),Xi=function(e,t){function n(){var n=4e5,r=e.label.slice(1);if(Yi.has(r)&&`base`in e){var i=e.base.type===`ordgroup`?e.base.body.length:1,a,o,s;if(i>5)r===`widehat`||r===`widecheck`?(a=420,n=2364,s=.42,o=r+`4`):(a=312,n=2340,s=.34,o=`tilde4`);else{var l=[1,1,2,2,3,3][i];r===`widehat`||r===`widecheck`?(n=[0,1062,2364,2364,2364][l],a=[0,239,300,360,420][l],s=[0,.24,.3,.3,.36,.42][l],o=r+l):(n=[0,600,1033,2339,2340][l],a=[0,260,286,306,312][l],s=[0,.26,.286,.3,.306,.34][l],o=`tilde`+l)}var u=new lr(o);return{span:li([],[new cr([u],{width:`100%`,height:Qn(s),viewBox:`0 0 `+n+` `+a,preserveAspectRatio:`none`})],t),minWidth:0,height:s}}var d=[],f=fte[r];if(!f)throw Error(`No SVG data for "`+r+`".`);var[p,m,h]=f,g=h/1e3,_=p.length,v,y;if(_===1){if(f.length!==4)throw Error(`Expected 4-tuple for single-path SVG data "`+r+`".`);v=[`hide-tail`],y=[f[3]]}else if(_===2)v=[`halfarrow-left`,`halfarrow-right`],y=[`xMinYMin`,`xMaxYMin`];else if(_===3)v=[`brace-left`,`brace-center`,`brace-right`],y=[`xMinYMin`,`xMidYMin`,`xMaxYMin`];else throw Error(`Correct katexImagesData or update code here to support254+ `+_+` children.`);for(var b=0;b<_;b++){var x=new lr(p[b]),S=new cr([x],{width:`400em`,height:Qn(g),viewBox:`0 0 `+n+` `+h,preserveAspectRatio:y[b]+` slice`}),C=li([v[b]],[S],t);if(_===1)return{span:C,minWidth:m,height:g};C.style.height=Qn(g),d.push(C)}return{span:ci([`stretchy`],d,t),minWidth:m,height:g}}var{span:r,minWidth:i,height:a}=n();return r.height=a,r.style.height=Qn(a),i>0&&(r.style.minWidth=Qn(i)),r},Zi=function(e,t,n,r,i){var a,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(a=ci([`stretchy`,t],[],i),t===`fbox`){var s=i.color&&i.getColor();s&&(a.style.borderColor=s)}}else{var l=[];/^[bx]cancel$/.test(t)&&l.push(new ur({x1:`0`,y1:`0`,x2:`100%`,y2:`100%`,"stroke-width":`0.046em`})),/^x?cancel$/.test(t)&&l.push(new ur({x1:`0`,y1:`100%`,x2:`100%`,y2:`0`,"stroke-width":`0.046em`})),a=li([],[new cr(l,{width:`100%`,height:Qn(o)})],i)}return a.height=o,a.style.height=Qn(o),a},Qi={bin:1,close:1,inner:1,open:1,punct:1,rel:1},$i={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},ea=e=>{if(e instanceof sr)return e;if(Gee(e)&&e.children.length===1)return ea(e.children[0])},ta=(e,t)=>{var n,r,i;e&&e.type===`supsub`?(r=dn(e.base,`accent`),n=r.base,e.base=n,i=$t(Ni(e,t)),e.base=r):(r=dn(e,`accent`),n=r.base);var a=Ni(n,t.havingCrampedStyle()),o=r.isShifty&&kn(n),s=0;o&&(s=ea(a)?.skew??0);var l=r.label===`\\c`,u=l?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),d;if(r.isStretchy)d=Xi(r,t),d=pi({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`elem`,elem:d,wrapperClasses:[`svg-align`],wrapperStyle:s>0?{width:`calc(100% - `+Qn(2*s)+`)`,marginLeft:Qn(2*s)}:void 0}]});else{var f,p;r.label===`\\vec`?(f=vi(`vec`,t),p=_i.vec[1]):(f=ai({type:`textord`,mode:r.mode,text:r.label},t,`textord`),f=Qt(f),f.italic=0,p=f.width,l&&(u+=f.depth)),d=ci([`accent-body`],[f]);var m=r.label===`\\textcircled`;m&&(d.classes.push(`accent-full`),u=a.height);var h=s;m||(h-=p/2),d.style.left=Qn(h),r.label===`\\textcircled`&&(d.style.top=`.2em`),d=pi({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:-u},{type:`elem`,elem:d}]})}var g=ci([`mord`,`accent`],[d],t);return i?(i.children[0]=g,i.height=Math.max(g.height,i.height),i.classes[0]=`mord`,i):g},na=(e,t)=>{var n=e.isStretchy?Ji(e.label):new Pi(`mo`,[Li(e.label,e.mode)]),r=new Pi(`mover`,[Hi(e.base,t),n]);return r.setAttribute(`accent`,`true`),r},ra=new RegExp([`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`].map(e=>`\\`+e).join(`|`)),nn({type:`accent`,names:[`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`,`\\widecheck`,`\\widehat`,`\\widetilde`,`\\overrightarrow`,`\\overleftarrow`,`\\Overrightarrow`,`\\overleftrightarrow`,`\\overgroup`,`\\overlinesegment`,`\\overleftharpoon`,`\\overrightharpoon`],props:{numArgs:1},handler:(e,t)=>{var n=Ti(t[0]),r=!ra.test(e.funcName),i=!r||e.funcName===`\\widehat`||e.funcName===`\\widetilde`||e.funcName===`\\widecheck`;return{type:`accent`,mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:ta,mathmlBuilder:na}),nn({type:`accent`,names:[`\\'`,"\\`",`\\^`,`\\~`,`\\=`,`\\u`,`\\.`,`\\"`,`\\c`,`\\r`,`\\H`,`\\v`,`\\textcircled`],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`primitive`]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r===`math`&&(e.parser.settings.reportNonstrict(`mathVsTextAccents`,`LaTeX's accent `+e.funcName+` works only in text mode`),r=`text`),{type:`accent`,mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:ta,mathmlBuilder:na}),nn({type:`accentUnder`,names:[`\\underleftarrow`,`\\underrightarrow`,`\\underleftrightarrow`,`\\undergroup`,`\\underlinesegment`,`\\utilde`],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`accentUnder`,mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=Ni(e.base,t),r=Xi(e,t),i=e.label===`\\utilde`?.12:0;return ci([`mord`,`accentunder`],[pi({positionType:`top`,positionData:n.height,children:[{type:`elem`,elem:r,wrapperClasses:[`svg-align`]},{type:`kern`,size:i},{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=Ji(e.label),r=new Pi(`munder`,[Hi(e.base,t),n]);return r.setAttribute(`accentunder`,`true`),r}}),ia=e=>{var t=new Pi(`mpadded`,e?[e]:[]);return t.setAttribute(`width`,`+0.6em`),t.setAttribute(`lspace`,`0.3em`),t},nn({type:`xArrow`,names:[`\\xleftarrow`,`\\xrightarrow`,`\\xLeftarrow`,`\\xRightarrow`,`\\xleftrightarrow`,`\\xLeftrightarrow`,`\\xhookleftarrow`,`\\xhookrightarrow`,`\\xmapsto`,`\\xrightharpoondown`,`\\xrightharpoonup`,`\\xleftharpoondown`,`\\xleftharpoonup`,`\\xrightleftharpoons`,`\\xleftrightharpoons`,`\\xlongequal`,`\\xtwoheadrightarrow`,`\\xtwoheadleftarrow`,`\\xtofrom`,`\\xrightleftarrows`,`\\xrightequilibrium`,`\\xleftequilibrium`,`\\\\cdrightarrow`,`\\\\cdleftarrow`,`\\\\cdlongequal`],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:i}=e;return{type:`xArrow`,mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=fi(Ni(e.body,r,t),t),a=e.label.slice(0,2)===`\\x`?`x`:`cd`;i.classes.push(a+`-arrow-pad`);var o;e.below&&(r=t.havingStyle(n.sub()),o=fi(Ni(e.below,r,t),t),o.classes.push(a+`-arrow-pad`));var s=Xi(e,t),l=-t.fontMetrics().axisHeight+.5*s.height,u=-t.fontMetrics().axisHeight-.5*s.height-.111;(i.depth>.25||e.label===`\\xleftequilibrium`)&&(u-=i.depth);var d;if(o){var f=-t.fontMetrics().axisHeight+o.height+.5*s.height+.111;d=pi({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:u},{type:`elem`,elem:s,shift:l,wrapperClasses:[`svg-align`]},{type:`elem`,elem:o,shift:f}]})}else d=pi({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:u},{type:`elem`,elem:s,shift:l,wrapperClasses:[`svg-align`]}]});return ci([`mrel`,`x-arrow`],[d],t)},mathmlBuilder(e,t){var n=Ji(e.label);n.setAttribute(`minsize`,e.label.charAt(0)===`x`?`1.75em`:`3.0em`);var r;if(e.body){var i=ia(Hi(e.body,t));if(e.below){var a=ia(Hi(e.below,t));r=new Pi(`munderover`,[n,a,i])}else r=new Pi(`mover`,[n,i])}else if(e.below){var o=ia(Hi(e.below,t));r=new Pi(`munder`,[n,o])}else r=ia(),r=new Pi(`mover`,[n,r]);return r}}),nn({type:`mclass`,names:[`\\mathord`,`\\mathbin`,`\\mathrel`,`\\mathopen`,`\\mathclose`,`\\mathpunct`,`\\mathinner`],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`mclass`,mode:n.mode,mclass:`m`+r.slice(5),body:Ei(i),isCharacterBox:kn(i)}},htmlBuilder:mn,mathmlBuilder:hn}),aa=e=>{var t=e.type===`ordgroup`&&e.body.length?e.body[0]:e;return t.type===`atom`&&(t.family===`bin`||t.family===`rel`)?`m`+t.family:`mord`},nn({type:`mclass`,names:[`\\@binrel`],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:`mclass`,mode:n.mode,mclass:aa(t[0]),body:Ei(t[1]),isCharacterBox:kn(t[1])}}}),nn({type:`mclass`,names:[`\\stackrel`,`\\overset`,`\\underset`],props:{numArgs:2},handler(e,t){var{parser:n,funcName:r}=e,i=t[1],a=t[0],o=r===`\\stackrel`?`mrel`:aa(i),s={type:`op`,mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!==`\\stackrel`,body:Ei(i)},l={type:`supsub`,mode:a.mode,base:s,sup:r===`\\underset`?null:a,sub:r===`\\underset`?a:null};return{type:`mclass`,mode:n.mode,mclass:o,body:[l],isCharacterBox:kn(l)}},htmlBuilder:mn,mathmlBuilder:hn}),nn({type:`pmb`,names:[`\\pmb`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`pmb`,mode:n.mode,mclass:aa(t[0]),body:Ei(t[0])}},htmlBuilder(e,t){var n=Di(e.body,t,!0),r=ci([e.mclass],n,t);return r.style.textShadow=`0.02em 0.01em 0.04px`,r},mathmlBuilder(e,t){var n=Bi(e.body,t),r=new Pi(`mstyle`,n);return r.setAttribute(`style`,`text-shadow: 0.02em 0.01em 0.04px`),r}}),pte={">":`\\\\cdrightarrow`,"<":`\\\\cdleftarrow`,"=":`\\\\cdlongequal`,A:`\\uparrow`,V:`\\downarrow`,"|":`\\Vert`,".":`no arrow`},oa=()=>({type:`styling`,body:[],mode:`math`,style:`display`,resetFont:!0}),sa=e=>e.type===`textord`&&e.text===`@`,mte=(e,t)=>(e.type===`mathord`||e.type===`atom`)&&e.text===t,nn({type:`cdlabel`,names:[`\\\\cdleft`,`\\\\cdright`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:`cdlabel`,mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=fi(Ni(e.label,n,t),t);return r.classes.push(`cd-label-`+e.side),r.style.bottom=Qn(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Pi(`mrow`,[Hi(e.label,t)]);return n=new Pi(`mpadded`,[n]),n.setAttribute(`width`,`0`),e.side===`left`&&n.setAttribute(`lspace`,`-1width`),n.setAttribute(`voffset`,`0.7em`),n=new Pi(`mstyle`,[n]),n.setAttribute(`displaystyle`,`false`),n.setAttribute(`scriptlevel`,`1`),n}}),nn({type:`cdlabelparent`,names:[`\\\\cdparent`],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:`cdlabelparent`,mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=fi(Ni(e.fragment,t),t);return n.classes.push(`cd-vert-arrow`),n},mathmlBuilder(e,t){return new Pi(`mrow`,[Hi(e.fragment,t)])}}),nn({type:`textord`,names:[`\\@char`],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=dn(t[0],`ordgroup`).body,i=``,a=0;a<r.length;a++){var o=dn(r[a],`textord`);i+=o.text}var s=parseInt(i),l;if(isNaN(s))throw new En(`\\@char has non-numeric argument `+i);if(s<0||s>=1114111)throw new En(`\\@char with invalid code point `+i);return s<=65535?l=String.fromCharCode(s):(s-=65536,l=String.fromCharCode((s>>10)+55296,(s&1023)+56320)),{type:`textord`,mode:n.mode,text:l}}}),ca=(e,t)=>di(Di(e.body,t.withColor(e.color),!1)),la=(e,t)=>{var n=Bi(e.body,t.withColor(e.color)),r=new Pi(`mstyle`,n);return r.setAttribute(`mathcolor`,e.color),r},nn({type:`color`,names:[`\\textcolor`],props:{numArgs:2,allowedInText:!0,argTypes:[`color`,`original`]},handler(e,t){var{parser:n}=e,r=dn(t[0],`color-token`).color,i=t[1];return{type:`color`,mode:n.mode,color:r,body:Ei(i)}},htmlBuilder:ca,mathmlBuilder:la}),nn({type:`color`,names:[`\\color`],props:{numArgs:1,allowedInText:!0,argTypes:[`color`]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=dn(t[0],`color-token`).color;n.gullet.macros.set(`\\current@color`,i);var a=n.parseExpression(!0,r);return{type:`color`,mode:n.mode,color:i,body:a}},htmlBuilder:ca,mathmlBuilder:la}),nn({type:`cr`,names:[`\\\\`],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i=r.gullet.future().text===`[`?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior(`newLineInDisplayMode`,`In LaTeX, \\\\ or \\newline does nothing in display mode`);return{type:`cr`,mode:r.mode,newLine:a,size:i&&dn(i,`size`).value}},htmlBuilder(e,t){var n=ci([`mspace`],[],t);return e.newLine&&(n.classes.push(`newline`),e.size&&(n.style.marginTop=Qn(Zn(e.size,t)))),n},mathmlBuilder(e,t){var n=new Pi(`mspace`);return e.newLine&&(n.setAttribute(`linebreak`,`newline`),e.size&&n.setAttribute(`height`,Qn(Zn(e.size,t)))),n}}),ua={"\\global":`\\global`,"\\long":`\\\\globallong`,"\\\\globallong":`\\\\globallong`,"\\def":`\\gdef`,"\\gdef":`\\gdef`,"\\edef":`\\xdef`,"\\xdef":`\\xdef`,"\\let":`\\\\globallet`,"\\futurelet":`\\\\globalfuture`},da=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new En(`Expected a control sequence`,e);return t},hte=e=>{var t=e.gullet.popToken();return t.text===`=`&&(t=e.gullet.popToken(),t.text===` `&&(t=e.gullet.popToken())),t},fa=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i??=(n.noexpand=!0,{tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)},nn({type:`internal`,names:[`\\global`,`\\long`,`\\\\globallong`],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(ua[r.text])return(n===`\\global`||n===`\\\\globallong`)&&(r.text=ua[r.text]),dn(t.parseFunction(),`internal`);throw new En(`Invalid token after macro prefix`,r)}}),nn({type:`internal`,names:[`\\def`,`\\gdef`,`\\edef`,`\\xdef`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new En(`Expected a control sequence`,r);for(var a=0,o,s=[[]];t.gullet.future().text!==`{`;)if(r=t.gullet.popToken(),r.text===`#`){if(t.gullet.future().text===`{`){o=t.gullet.future(),s[a].push(`{`);break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new En(`Invalid argument number "`+r.text+`"`);if(parseInt(r.text)!==a+1)throw new En(`Argument number "`+r.text+`" out of order`);a++,s.push([])}else if(r.text===`EOF`)throw new En(`Expected a macro definition`);else s[a].push(r.text);var{tokens:l}=t.gullet.consumeArg();return o&&l.unshift(o),(n===`\\edef`||n===`\\xdef`)&&(l=t.gullet.expandTokens(l),l.reverse()),t.gullet.macros.set(i,{tokens:l,numArgs:a,delimiters:s},n===ua[n]),{type:`internal`,mode:t.mode}}}),nn({type:`internal`,names:[`\\let`,`\\\\globallet`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=da(t.gullet.popToken());return t.gullet.consumeSpaces(),fa(t,r,hte(t),n===`\\\\globallet`),{type:`internal`,mode:t.mode}}}),nn({type:`internal`,names:[`\\futurelet`,`\\\\globalfuture`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=da(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return fa(t,r,a,n===`\\\\globalfuture`),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:`internal`,mode:t.mode}}}),pa=function(e,t,n){var r=tn(hr.math[e]&&hr.math[e].replace||e,t,n);if(!r)throw Error(`Unsupported symbol `+e+` and font size `+t+`.`);return r},ma=function(e,t,n,r){var i=n.havingBaseStyle(t),a=ci(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},ha=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push(`delimcenter`),e.style.top=Qn(i),e.height-=i,e.depth+=i},gte=function(e,t,n,r,i,a){var o=ma(ri(e,`Main-Regular`,i,r),t,r,a);return n&&ha(o,r,t),o},_te=function(e,t,n,r){return ri(e,`Size`+t+`-Regular`,n,r)},ga=function(e,t,n,r,i,a){var o=_te(e,t,i,r),s=ma(ci([`delimsizing`,`size`+t],[o],r),Hn.TEXT,r,a);return n&&ha(s,r,Hn.TEXT),s},_a=function(e,t,n){return{type:`elem`,elem:ci([`delimsizinginner`,t===`Size1-Regular`?`delim-size1`:`delim-size4`],[ci([],[ri(e,t,n)])])}},va=function(e,t,n){var r=dr[`Size4-Regular`][e.charCodeAt(0)]?dr[`Size4-Regular`][e.charCodeAt(0)][4]:dr[`Size1-Regular`][e.charCodeAt(0)][4],i=new lr(`inner`,Bee(e,Math.round(1e3*t))),a=li([],[new cr([i],{width:Qn(r),height:Qn(t),style:`width:`+Qn(r),viewBox:`0 0 `+1e3*r+` `+Math.round(1e3*t),preserveAspectRatio:`xMinYMin`})],n);return a.height=t,a.style.height=Qn(t),a.style.width=Qn(r),{type:`elem`,elem:a}},ya=.008,ba={type:`kern`,size:-1*ya},vte=new Set([`|`,`\\lvert`,`\\rvert`,`\\vert`]),yte=new Set([`\\|`,`\\lVert`,`\\rVert`,`\\Vert`]),xa=function(e,t,n,r,i,a){var o,s,l,u,d=``,f=0;o=l=u=e,s=null;var p=`Size1-Regular`;e===`\\uparrow`?l=u=`⏐`:e===`\\Uparrow`?l=u=`‖`:e===`\\downarrow`?o=l=`⏐`:e===`\\Downarrow`?o=l=`‖`:e===`\\updownarrow`?(o=`\\uparrow`,l=`⏐`,u=`\\downarrow`):e===`\\Updownarrow`?(o=`\\Uparrow`,l=`‖`,u=`\\Downarrow`):vte.has(e)?(l=`∣`,d=`vert`,f=333):yte.has(e)?(l=`∥`,d=`doublevert`,f=556):e===`[`||e===`\\lbrack`?(o=`⎡`,l=`⎢`,u=`⎣`,p=`Size4-Regular`,d=`lbrack`,f=667):e===`]`||e===`\\rbrack`?(o=`⎤`,l=`⎥`,u=`⎦`,p=`Size4-Regular`,d=`rbrack`,f=667):e===`\\lfloor`||e===`⌊`?(l=o=`⎢`,u=`⎣`,p=`Size4-Regular`,d=`lfloor`,f=667):e===`\\lceil`||e===`⌈`?(o=`⎡`,l=u=`⎢`,p=`Size4-Regular`,d=`lceil`,f=667):e===`\\rfloor`||e===`⌋`?(l=o=`⎥`,u=`⎦`,p=`Size4-Regular`,d=`rfloor`,f=667):e===`\\rceil`||e===`⌉`?(o=`⎤`,l=u=`⎥`,p=`Size4-Regular`,d=`rceil`,f=667):e===`(`||e===`\\lparen`?(o=`⎛`,l=`⎜`,u=`⎝`,p=`Size4-Regular`,d=`lparen`,f=875):e===`)`||e===`\\rparen`?(o=`⎞`,l=`⎟`,u=`⎠`,p=`Size4-Regular`,d=`rparen`,f=875):e===`\\{`||e===`\\lbrace`?(o=`⎧`,s=`⎨`,u=`⎩`,l=`⎪`,p=`Size4-Regular`):e===`\\}`||e===`\\rbrace`?(o=`⎫`,s=`⎬`,u=`⎭`,l=`⎪`,p=`Size4-Regular`):e===`\\lgroup`||e===`⟮`?(o=`⎧`,u=`⎩`,l=`⎪`,p=`Size4-Regular`):e===`\\rgroup`||e===`⟯`?(o=`⎫`,u=`⎭`,l=`⎪`,p=`Size4-Regular`):e===`\\lmoustache`||e===`⎰`?(o=`⎧`,u=`⎭`,l=`⎪`,p=`Size4-Regular`):(e===`\\rmoustache`||e===`⎱`)&&(o=`⎫`,u=`⎩`,l=`⎪`,p=`Size4-Regular`);var m=pa(o,p,i),h=m.height+m.depth,g=pa(l,p,i),_=g.height+g.depth,v=pa(u,p,i),y=v.height+v.depth,b=0,x=1;if(s!==null){var S=pa(s,p,i);b=S.height+S.depth,x=2}var C=h+y+b,w=C+Math.max(0,Math.ceil((t-C)/(x*_)))*x*_,T=r.fontMetrics().axisHeight;n&&(T*=r.sizeMultiplier);var E=w/2-T,D=[];if(d.length>0){var O=w-h-y,k=Math.round(w*1e3),A=Vee(d,Math.round(O*1e3)),j=new lr(d,A),M=Qn(f/1e3),N=Qn(k/1e3),P=li([],[new cr([j],{width:M,height:N,viewBox:`0 0 `+f+` `+k})],r);P.height=k/1e3,P.style.width=M,P.style.height=N,D.push({type:`elem`,elem:P})}else{if(D.push(_a(u,p,i)),D.push(ba),s===null){var F=w-h-y+2*ya;D.push(va(l,F,r))}else{var I=(w-h-y-b)/2+2*ya;D.push(va(l,I,r)),D.push(ba),D.push(_a(s,p,i)),D.push(ba),D.push(va(l,I,r))}D.push(ba),D.push(_a(o,p,i))}var L=r.havingBaseStyle(Hn.TEXT);return ma(ci([`delimsizing`,`mult`],[pi({positionType:`bottom`,positionData:E,children:D})],L),Hn.TEXT,r,a)},Sa=80,Ca=.08,wa=function(e,t,n,r,i){var a=zee(e,r,n),o=new lr(e,a);return li([`hide-tail`],[new cr([o],{width:`400em`,height:Qn(t),viewBox:`0 0 400000 `+n,preserveAspectRatio:`xMinYMin slice`})],i)},bte=function(e,t){var n=t.havingBaseSizing(),r=Aa(`\\surd`,e*n.sizeMultiplier,ka,n),i=n.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,s,l,u,d;return r.type===`small`?(u=1e3+1e3*a+Sa,e<1?i=1:e<1.4&&(i=.7),s=(1+a+Ca)/i,l=(1+a)/i,o=wa(`sqrtMain`,s,u,a,t),o.style.minWidth=`0.853em`,d=.833/i):r.type===`large`?(u=(1e3+Sa)*Da[r.size],l=(Da[r.size]+a)/i,s=(Da[r.size]+a+Ca)/i,o=wa(`sqrtSize`+r.size,s,u,a,t),o.style.minWidth=`1.02em`,d=1/i):(s=e+a+Ca,l=e+a,u=Math.floor(1e3*e+a)+Sa,o=wa(`sqrtTall`,s,u,a,t),o.style.minWidth=`0.742em`,d=1.056),o.height=l,o.style.height=Qn(s),{span:o,advanceWidth:d,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},Ta=new Set([`(`,`\\lparen`,`)`,`\\rparen`,`[`,`\\lbrack`,`]`,`\\rbrack`,`\\{`,`\\lbrace`,`\\}`,`\\rbrace`,`\\lfloor`,`\\rfloor`,`⌊`,`⌋`,`\\lceil`,`\\rceil`,`⌈`,`⌉`,`\\surd`]),xte=new Set([`\\uparrow`,`\\downarrow`,`\\updownarrow`,`\\Uparrow`,`\\Downarrow`,`\\Updownarrow`,`|`,`\\|`,`\\vert`,`\\Vert`,`\\lvert`,`\\rvert`,`\\lVert`,`\\rVert`,`\\lgroup`,`\\rgroup`,`⟮`,`⟯`,`\\lmoustache`,`\\rmoustache`,`⎰`,`⎱`]),Ea=new Set([`<`,`>`,`\\langle`,`\\rangle`,`/`,`\\backslash`,`\\lt`,`\\gt`]),Da=[0,1.2,1.8,2.4,3],Oa=function(e,t,n,r,i){if(e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`),Ta.has(e)||Ea.has(e))return ga(e,t,!1,n,r,i);if(xte.has(e))return xa(e,Da[t],!1,n,r,i);throw new En(`Illegal delimiter: '`+e+`'`)},Ste=[{type:`small`,style:Hn.SCRIPTSCRIPT},{type:`small`,style:Hn.SCRIPT},{type:`small`,style:Hn.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4}],Cte=[{type:`small`,style:Hn.SCRIPTSCRIPT},{type:`small`,style:Hn.SCRIPT},{type:`small`,style:Hn.TEXT},{type:`stack`}],ka=[{type:`small`,style:Hn.SCRIPTSCRIPT},{type:`small`,style:Hn.SCRIPT},{type:`small`,style:Hn.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4},{type:`stack`}],wte=function(e){if(e.type===`small`)return`Main-Regular`;if(e.type===`large`)return`Size`+e.size+`-Regular`;if(e.type===`stack`)return`Size4-Regular`;var t=e.type;throw Error(`Add support for delim type '`+t+`' here.`)},Aa=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);i<n.length;i++){var a=n[i];if(a.type===`stack`)break;var o=pa(e,wte(a),`math`),s=o.height+o.depth;if(a.type===`small`){var l=r.havingBaseStyle(a.style);s*=l.sizeMultiplier}if(s>t)return a}return n[n.length-1]},ja=function(e,t,n,r,i,a){e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`);var o=Ea.has(e)?Ste:Ta.has(e)?ka:Cte,s=Aa(e,t,o,r);return s.type===`small`?gte(e,s.style,n,r,i,a):s.type===`large`?ga(e,s.size,n,r,i,a):xa(e,t,n,r,i,a)},Ma=function(e,t,n,r,i,a){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,s=901,l=5/r.fontMetrics().ptPerEm,u=Math.max(t-o,n+o);return ja(e,Math.max(u/500*s,2*u-l),!0,r,i,a)},Na={"\\bigl":{mclass:`mopen`,size:1},"\\Bigl":{mclass:`mopen`,size:2},"\\biggl":{mclass:`mopen`,size:3},"\\Biggl":{mclass:`mopen`,size:4},"\\bigr":{mclass:`mclose`,size:1},"\\Bigr":{mclass:`mclose`,size:2},"\\biggr":{mclass:`mclose`,size:3},"\\Biggr":{mclass:`mclose`,size:4},"\\bigm":{mclass:`mrel`,size:1},"\\Bigm":{mclass:`mrel`,size:2},"\\biggm":{mclass:`mrel`,size:3},"\\Biggm":{mclass:`mrel`,size:4},"\\big":{mclass:`mord`,size:1},"\\Big":{mclass:`mord`,size:2},"\\bigg":{mclass:`mord`,size:3},"\\Bigg":{mclass:`mord`,size:4}},Tte=new Set(`(,\\lparen,),\\rparen,[,\\lbrack,],\\rbrack,\\{,\\lbrace,\\},\\rbrace,\\lfloor,\\rfloor,⌊,⌋,\\lceil,\\rceil,⌈,⌉,<,>,\\langle,⟨,\\rangle,⟩,\\lt,\\gt,\\lvert,\\rvert,\\lVert,\\rVert,\\lgroup,\\rgroup,⟮,⟯,\\lmoustache,\\rmoustache,⎰,⎱,/,\\backslash,|,\\vert,\\|,\\Vert,\\uparrow,\\Uparrow,\\downarrow,\\Downarrow,\\updownarrow,\\Updownarrow,.`.split(`,`)),nn({type:`delimsizing`,names:[`\\bigl`,`\\Bigl`,`\\biggl`,`\\Biggl`,`\\bigr`,`\\Bigr`,`\\biggr`,`\\Biggr`,`\\bigm`,`\\Bigm`,`\\biggm`,`\\Biggm`,`\\big`,`\\Big`,`\\bigg`,`\\Bigg`],props:{numArgs:1,argTypes:[`primitive`]},handler:(e,t)=>{var n=yn(t[0],e);return{type:`delimsizing`,mode:e.parser.mode,size:Na[e.funcName].size,mclass:Na[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim===`.`?ci([e.mclass]):Oa(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!==`.`&&t.push(Li(e.delim,e.mode));var n=new Pi(`mo`,t);e.mclass===`mopen`||e.mclass===`mclose`?n.setAttribute(`fence`,`true`):n.setAttribute(`fence`,`false`),n.setAttribute(`stretchy`,`true`);var r=Qn(Da[e.size]);return n.setAttribute(`minsize`,r),n.setAttribute(`maxsize`,r),n}}),nn({type:`leftright-right`,names:[`\\right`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get(`\\current@color`);if(n&&typeof n!=`string`)throw new En(`\\current@color set to non-string in \\right`);return{type:`leftright-right`,mode:e.parser.mode,delim:yn(t[0],e).text,color:n}}}),nn({type:`leftright`,names:[`\\left`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=yn(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect(`\\right`,!1);var a=dn(r.parseFunction(),`leftright-right`);return{type:`leftright`,mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{bn(e);for(var n=Di(e.body,t,!0,[`mopen`,`mclose`]),r=0,i=0,a=!1,o=0;o<n.length;o++){var s=n[o];vn(s)?a=!0:(r=Math.max(n[o].height,r),i=Math.max(n[o].depth,i))}r*=t.sizeMultiplier,i*=t.sizeMultiplier;var l=e.left===`.`?Mi(t,[`mopen`]):Ma(e.left,r,i,t,e.mode,[`mopen`]);if(n.unshift(l),a)for(var u=1;u<n.length;u++){var d=n[u];if(vn(d)){var f=d.isMiddle;n[u]=Ma(f.delim,r,i,f.options,e.mode,[])}}var p;if(e.right===`.`)p=Mi(t,[`mclose`]);else{var m=e.rightColor?t.withColor(e.rightColor):t;p=Ma(e.right,r,i,m,e.mode,[`mclose`])}return n.push(p),ci([`minner`],n,t)},mathmlBuilder:(e,t)=>{bn(e);var n=Bi(e.body,t);if(e.left!==`.`){var r=new Pi(`mo`,[Li(e.left,e.mode)]);r.setAttribute(`fence`,`true`),n.unshift(r)}if(e.right!==`.`){var i=new Pi(`mo`,[Li(e.right,e.mode)]);i.setAttribute(`fence`,`true`),e.rightColor&&i.setAttribute(`mathcolor`,e.rightColor),n.push(i)}return Ri(n)}}),nn({type:`middle`,names:[`\\middle`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=yn(t[0],e);if(!e.parser.leftrightDepth)throw new En(`\\middle without preceding \\left`,n);return{type:`middle`,mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim===`.`?n=Mi(t,[]):(n=Oa(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=e.delim===`\\vert`||e.delim===`|`?Li(`|`,`text`):Li(e.delim,e.mode),r=new Pi(`mo`,[n]);return r.setAttribute(`fence`,`true`),r.setAttribute(`lspace`,`0.05em`),r.setAttribute(`rspace`,`0.05em`),r}}),Pa=(e,t)=>{var n=fi(Ni(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o,s=kn(e.body);if(r===`sout`)a=ci([`stretchy`,`sout`]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r===`phase`){var l=Zn({number:.6,unit:`pt`},t),u=Zn({number:.35,unit:`ex`},t),d=t.havingBaseSizing();i/=d.sizeMultiplier;var f=n.height+n.depth+l+u;n.style.paddingLeft=Qn(f/2+l);var p=Math.floor(1e3*f*i),m=Lee(p);a=li([`hide-tail`],[new cr([new lr(`phase`,m)],{width:`400em`,height:Qn(p/1e3),viewBox:`0 0 400000 `+p,preserveAspectRatio:`xMinYMin slice`})],t),a.style.height=Qn(f),o=n.depth+l+u}else{/cancel/.test(r)?s||n.classes.push(`cancel-pad`):r===`angl`?n.classes.push(`anglpad`):n.classes.push(`boxpad`);var h,g,_=0;/box/.test(r)?(_=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),h=t.fontMetrics().fboxsep+(r===`colorbox`?0:_),g=h):r===`angl`?(_=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),h=4*_,g=Math.max(0,.25-n.depth)):(h=s?.2:0,g=h),a=Zi(n,r,h,g,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle=`solid`,a.style.borderWidth=Qn(_)):r===`angl`&&_!==.049&&(a.style.borderTopWidth=Qn(_),a.style.borderRightWidth=Qn(_)),o=n.depth+g,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var v;if(e.backgroundColor)v=pi({positionType:`individualShift`,children:[{type:`elem`,elem:a,shift:o},{type:`elem`,elem:n,shift:0}]});else{var y=/cancel|phase/.test(r)?[`svg-align`]:[];v=pi({positionType:`individualShift`,children:[{type:`elem`,elem:n,shift:0},{type:`elem`,elem:a,shift:o,wrapperClasses:y}]})}return/cancel/.test(r)&&(v.height=n.height,v.depth=n.depth),/cancel/.test(r)&&!s?ci([`mord`,`cancel-lap`],[v],t):ci([`mord`],[v],t)},Fa=(e,t)=>{var n,r=new Pi(e.label.includes(`colorbox`)?`mpadded`:`menclose`,[Hi(e.body,t)]);switch(e.label){case`\\cancel`:r.setAttribute(`notation`,`updiagonalstrike`);break;case`\\bcancel`:r.setAttribute(`notation`,`downdiagonalstrike`);break;case`\\phase`:r.setAttribute(`notation`,`phasorangle`);break;case`\\sout`:r.setAttribute(`notation`,`horizontalstrike`);break;case`\\fbox`:r.setAttribute(`notation`,`box`);break;case`\\angl`:r.setAttribute(`notation`,`actuarial`);break;case`\\fcolorbox`:case`\\colorbox`:if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute(`width`,`+`+2*n+`pt`),r.setAttribute(`height`,`+`+2*n+`pt`),r.setAttribute(`lspace`,n+`pt`),r.setAttribute(`voffset`,n+`pt`),e.label===`\\fcolorbox`){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute(`style`,`border: `+Qn(i)+` solid `+e.borderColor)}break;case`\\xcancel`:r.setAttribute(`notation`,`updiagonalstrike downdiagonalstrike`)}return e.backgroundColor&&r.setAttribute(`mathbackground`,e.backgroundColor),r},nn({type:`enclose`,names:[`\\colorbox`],props:{numArgs:2,allowedInText:!0,argTypes:[`color`,`hbox`]},handler(e,t,n){var{parser:r,funcName:i}=e,a=dn(t[0],`color-token`).color,o=t[1];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:Pa,mathmlBuilder:Fa}),nn({type:`enclose`,names:[`\\fcolorbox`],props:{numArgs:3,allowedInText:!0,argTypes:[`color`,`color`,`hbox`]},handler(e,t,n){var{parser:r,funcName:i}=e,a=dn(t[0],`color-token`).color,o=dn(t[1],`color-token`).color,s=t[2];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:s}},htmlBuilder:Pa,mathmlBuilder:Fa}),nn({type:`enclose`,names:[`\\fbox`],props:{numArgs:1,argTypes:[`hbox`],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`enclose`,mode:n.mode,label:`\\fbox`,body:t[0]}}}),nn({type:`enclose`,names:[`\\cancel`,`\\bcancel`,`\\xcancel`,`\\phase`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}},htmlBuilder:Pa,mathmlBuilder:Fa}),nn({type:`enclose`,names:[`\\sout`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e;n.mode===`math`&&n.settings.reportNonstrict(`mathVsSout`,`LaTeX's \\sout works only in text mode`);var i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}},htmlBuilder:Pa,mathmlBuilder:Fa}),nn({type:`enclose`,names:[`\\angl`],props:{numArgs:1,argTypes:[`hbox`],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:`enclose`,mode:n.mode,label:`\\angl`,body:t[0]}}}),Ia={},La={},Ra=class e{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new e(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}},za=class e{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(t,n){return new e(n,Ra.range(this,t))}},Ba=e=>{if(!e.parser.settings.displayMode)throw new En(`{`+e.envName+`} can be used only in display mode.`)},Ete=new Set([`gather`,`gather*`]),Va=function(e,t){var n,r,i=e.body.length,a=e.hLinesBeforeRow,o=0,s=Array(i),l=[],u=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),d=1/t.fontMetrics().ptPerEm,f=5*d;e.colSeparationType&&e.colSeparationType===`small`&&(f=.2778*(t.havingStyle(Hn.SCRIPT).sizeMultiplier/t.sizeMultiplier));var p=e.colSeparationType===`CD`?Zn({number:3,unit:`ex`},t):12*d,m=3*d,h=e.arraystretch*p,g=.7*h,_=.3*h,v=0;function y(e){for(var t=0;t<e.length;++t)t>0&&(v+=.25),l.push({pos:v,isDashed:e[t]})}for(y(a[0]),n=0;n<e.body.length;++n){var b=e.body[n],x=g,S=_;o<b.length&&(o=b.length);var C={cells:Array(b.length),height:0,depth:0,pos:0};for(r=0;r<b.length;++r){var w=Ni(b[r],t);S<w.depth&&(S=w.depth),x<w.height&&(x=w.height),C.cells[r]=w}var T=e.rowGaps[n],E=0;T&&(E=Zn(T,t),E>0&&(E+=_,S<E&&(S=E),E=0)),e.addJot&&n<e.body.length-1&&(S+=m),C.height=x,C.depth=S,v+=x,C.pos=v,v+=S+E,s[n]=C,y(a[n+1])}var D=v/2+t.fontMetrics().axisHeight,O=e.cols||[],k=[],A,j,M=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<i;++n){var N=s[n],P=N.pos-D,F=e.tags[n],I=void 0;I=F===!0?ci([`eqn-num`],[],t):F===!1?ci([],[],t):ci([],Di(F,t,!0),t),I.depth=N.depth,I.height=N.height,M.push({type:`elem`,elem:I,shift:P})}for(r=0,j=0;r<o||j<O.length;++r,++j){for(var L=O[j],R=!0;(ee=L)?.type===`separator`;){var ee;if(R||(A=ci([`arraycolsep`],[]),A.style.width=Qn(t.fontMetrics().doubleRuleSep),k.push(A)),L.separator===`|`||L.separator===`:`){var z=L.separator===`|`?`solid`:`dashed`,B=ci([`vertical-separator`],[],t);B.style.height=Qn(v),B.style.borderRightWidth=Qn(u),B.style.borderRightStyle=z,B.style.margin=`0 `+Qn(-u/2);var te=v-D;te&&(B.style.verticalAlign=Qn(-te)),k.push(B)}else throw new En(`Invalid separator type: `+L.separator);j++,L=O[j],R=!1}if(!(r>=o)){var ne=void 0;(r>0||e.hskipBeforeAndAfter)&&(ne=L?.pregap??f,ne!==0&&(A=ci([`arraycolsep`],[]),A.style.width=Qn(ne),k.push(A)));var re=[];for(n=0;n<i;++n){var ie=s[n],ae=ie.cells[r];if(ae){var oe=ie.pos-D;ae.depth=ie.depth,ae.height=ie.height,re.push({type:`elem`,elem:ae,shift:oe})}}var se=pi({positionType:`individualShift`,children:re}),ce=ci([`col-align-`+(L?.align||`c`)],[se]);k.push(ce),(r<o-1||e.hskipBeforeAndAfter)&&(ne=L?.postgap??f,ne!==0&&(A=ci([`arraycolsep`],[]),A.style.width=Qn(ne),k.push(A)))}}var le=ci([`mtable`],k);if(l.length>0){for(var ue=ui(`hline`,t,u),de=ui(`hdashline`,t,u),fe=[{type:`elem`,elem:le,shift:0}];l.length>0;){var pe=l.pop(),me=pe.pos-D;pe.isDashed?fe.push({type:`elem`,elem:de,shift:me}):fe.push({type:`elem`,elem:ue,shift:me})}le=pi({positionType:`individualShift`,children:fe})}if(M.length===0)return ci([`mord`],[le],t);var he=ci([`tag`],[pi({positionType:`individualShift`,children:M})],t);return di([le,he])},Dte={c:`center `,l:`left `,r:`right `},Ha=function(e,t){for(var n=[],r=new Pi(`mtd`,[],[`mtr-glue`]),i=new Pi(`mtd`,[],[`mml-eqn-num`]),a=0;a<e.body.length;a++){for(var o=e.body[a],s=[],l=0;l<o.length;l++)s.push(new Pi(`mtd`,[Hi(o[l],t)]));e.tags&&e.tags[a]&&(s.unshift(r),s.push(r),e.leqno?s.unshift(i):s.push(i)),n.push(new Pi(`mtr`,s))}var u=new Pi(`mtable`,n),d=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);u.setAttribute(`rowspacing`,Qn(d));var f=``,p=``;if(e.cols&&e.cols.length>0){var m=e.cols,h=``,g=!1,_=0,v=m.length;m[0].type===`separator`&&(f+=`top `,_=1),m[m.length-1].type===`separator`&&(f+=`bottom `,--v);for(var y=_;y<v;y++){var b=m[y];b.type===`align`?(p+=Dte[b.align],g&&(h+=`none `),g=!0):b.type===`separator`&&(g&&=(h+=b.separator===`|`?`solid `:`dashed `,!1))}u.setAttribute(`columnalign`,p.trim()),/[sd]/.test(h)&&u.setAttribute(`columnlines`,h.trim())}if(e.colSeparationType===`align`){for(var x=e.cols||[],S=``,C=1;C<x.length;C++)S+=C%2?`0em `:`1em `;u.setAttribute(`columnspacing`,S.trim())}else e.colSeparationType===`alignat`||e.colSeparationType===`gather`?u.setAttribute(`columnspacing`,`0em`):e.colSeparationType===`small`?u.setAttribute(`columnspacing`,`0.2778em`):e.colSeparationType===`CD`?u.setAttribute(`columnspacing`,`0.5em`):u.setAttribute(`columnspacing`,`1em`);var w=``,T=e.hLinesBeforeRow;f+=T[0].length>0?`left `:``,f+=T[T.length-1].length>0?`right `:``;for(var E=1;E<T.length-1;E++)w+=T[E].length===0?`none `:T[E][0]?`dashed `:`solid `;return/[sd]/.test(w)&&u.setAttribute(`rowlines`,w.trim()),f!==``&&(u=new Pi(`menclose`,[u]),u.setAttribute(`notation`,f.trim())),e.arraystretch&&e.arraystretch<1&&(u=new Pi(`mstyle`,[u]),u.setAttribute(`scriptlevel`,`1`)),u},Ua=function(e,t){e.envName.includes(`ed`)||Ba(e);var n=[],r=e.envName.includes(`at`)?`alignat`:`align`,i=e.envName===`split`,a=wn(e.parser,{cols:n,addJot:!0,autoTag:i?void 0:Cn(e.envName),emptySingleRow:!0,colSeparationType:r,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},`display`),o=0,s=0,l={type:`ordgroup`,mode:e.mode,body:[]};if(t[0]&&t[0].type===`ordgroup`){for(var u=``,d=0;d<t[0].body.length;d++){var f=dn(t[0].body[d],`textord`);u+=f.text}o=Number(u),s=o*2}var p=!s;a.body.forEach(function(e){for(var t=1;t<e.length;t+=2)dn(dn(e[t],`styling`).body[0],`ordgroup`).body.unshift(l);if(p)s<e.length&&(s=e.length);else{var n=e.length/2;if(o<n)throw new En(`Too many math in a row: `+(`expected `+o+`, but got `+n),e[0])}});for(var m=0;m<s;++m){var h=`r`,g=0;m%2==1?h=`l`:m>0&&p&&(g=1),n[m]={type:`align`,align:h,pregap:g,postgap:0}}return a.colSeparationType=p?`align`:`alignat`,a},xn({type:`array`,names:[`array`,`darray`],props:{numArgs:1},handler(e,t){var n=(pn(t[0])?[t[0]]:dn(t[0],`ordgroup`).body).map(function(e){var t=fn(e).text;if(`lcr`.includes(t))return{type:`align`,align:t};if(t===`|`)return{type:`separator`,separator:`|`};if(t===`:`)return{type:`separator`,separator:`:`};throw new En(`Unknown column alignment: `+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return wn(e.parser,r,Tn(e.envName))},htmlBuilder:Va,mathmlBuilder:Ha}),xn({type:`array`,names:[`matrix`,`pmatrix`,`bmatrix`,`Bmatrix`,`vmatrix`,`Vmatrix`,`matrix*`,`pmatrix*`,`bmatrix*`,`Bmatrix*`,`vmatrix*`,`Vmatrix*`],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:[`(`,`)`],bmatrix:[`[`,`]`],Bmatrix:[`\\{`,`\\}`],vmatrix:[`|`,`|`],Vmatrix:[`\\Vert`,`\\Vert`]}[e.envName.replace(`*`,``)],n=`c`,r={hskipBeforeAndAfter:!1,cols:[{type:`align`,align:n}]};if(e.envName.charAt(e.envName.length-1)===`*`){var i=e.parser;if(i.consumeSpaces(),i.fetch().text===`[`){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!`lcr`.includes(n))throw new En(`Expected l or c or r`,i.nextToken);i.consume(),i.consumeSpaces(),i.expect(`]`),i.consume(),r.cols=[{type:`align`,align:n}]}}var a=wn(e.parser,r,Tn(e.envName)),o=Math.max(0,...a.body.map(e=>e.length));return a.cols=Array(o).fill({type:`align`,align:n}),t?{type:`leftright`,mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:Va,mathmlBuilder:Ha}),xn({type:`array`,names:[`smallmatrix`],props:{numArgs:0},handler(e){var t=wn(e.parser,{arraystretch:.5},`script`);return t.colSeparationType=`small`,t},htmlBuilder:Va,mathmlBuilder:Ha}),xn({type:`array`,names:[`subarray`],props:{numArgs:1},handler(e,t){var n=(pn(t[0])?[t[0]]:dn(t[0],`ordgroup`).body).map(function(e){var t=fn(e).text;if(`lc`.includes(t))return{type:`align`,align:t};throw new En(`Unknown column alignment: `+t,e)});if(n.length>1)throw new En(`{subarray} can contain only one column`);var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5},i=wn(e.parser,r,`script`);if(i.body.length>0&&i.body[0].length>1)throw new En(`{subarray} can contain only one column`);return i},htmlBuilder:Va,mathmlBuilder:Ha}),xn({type:`array`,names:[`cases`,`dcases`,`rcases`,`drcases`],props:{numArgs:0},handler(e){var t=wn(e.parser,{arraystretch:1.2,cols:[{type:`align`,align:`l`,pregap:0,postgap:1},{type:`align`,align:`l`,pregap:0,postgap:0}]},Tn(e.envName));return{type:`leftright`,mode:e.mode,body:[t],left:e.envName.includes(`r`)?`.`:`\\{`,right:e.envName.includes(`r`)?`\\}`:`.`,rightColor:void 0}},htmlBuilder:Va,mathmlBuilder:Ha}),xn({type:`array`,names:[`align`,`align*`,`aligned`,`split`],props:{numArgs:0},handler:Ua,htmlBuilder:Va,mathmlBuilder:Ha}),xn({type:`array`,names:[`gathered`,`gather`,`gather*`],props:{numArgs:0},handler(e){Ete.has(e.envName)&&Ba(e);var t={cols:[{type:`align`,align:`c`}],addJot:!0,colSeparationType:`gather`,autoTag:Cn(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return wn(e.parser,t,`display`)},htmlBuilder:Va,mathmlBuilder:Ha}),xn({type:`array`,names:[`alignat`,`alignat*`,`alignedat`],props:{numArgs:1},handler:Ua,htmlBuilder:Va,mathmlBuilder:Ha}),xn({type:`array`,names:[`equation`,`equation*`],props:{numArgs:0},handler(e){Ba(e);var t={autoTag:Cn(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return wn(e.parser,t,`display`)},htmlBuilder:Va,mathmlBuilder:Ha}),xn({type:`array`,names:[`CD`],props:{numArgs:0},handler(e){return Ba(e),_n(e.parser)},htmlBuilder:Va,mathmlBuilder:Ha}),G(`\\nonumber`,`\\gdef\\@eqnsw{0}`),G(`\\notag`,`\\nonumber`),nn({type:`text`,names:[`\\hline`,`\\hdashline`],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new En(e.funcName+` valid only within array environment`)}}),Wa=Ia,nn({type:`environment`,names:[`\\begin`,`\\end`],props:{numArgs:1,argTypes:[`text`]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if(i.type!==`ordgroup`)throw new En(`Invalid environment name`,i);for(var a=``,o=0;o<i.body.length;++o)a+=dn(i.body[o],`textord`).text;if(r===`\\begin`){if(!Wa.hasOwnProperty(a))throw new En(`No such environment: `+a,i);var s=Wa[a],{args:l,optArgs:u}=n.parseArguments(`\\begin{`+a+`}`,s),d={mode:n.mode,envName:a,parser:n},f=s.handler(d,l,u);n.expect(`\\end`,!1);var p=n.nextToken,m=dn(n.parseFunction(),`environment`);if(m.name!==a)throw new En(`Mismatch: \\begin{`+a+`} matched by \\end{`+m.name+`}`,p);return f}return{type:`environment`,mode:n.mode,name:a,nameGroup:i}}}),Ga=(e,t)=>{var n=e.font,r=t.withFont(n);return Ni(e.body,r)},Ka=(e,t)=>{var n=e.font,r=t.withFont(n);return Hi(e.body,r)},qa={"\\Bbb":`\\mathbb`,"\\bold":`\\mathbf`,"\\frak":`\\mathfrak`},nn({type:`font`,names:[`\\mathrm`,`\\mathit`,`\\mathbf`,`\\mathnormal`,`\\mathsfit`,`\\mathbb`,`\\mathcal`,`\\mathfrak`,`\\mathscr`,`\\mathsf`,`\\mathtt`,`\\Bbb`,`\\bold`,`\\frak`],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=Ti(t[0]),a=r;return a in qa&&(a=qa[a]),{type:`font`,mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:Ga,mathmlBuilder:Ka}),nn({type:`mclass`,names:[`\\boldsymbol`,`\\bm`],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`mclass`,mode:n.mode,mclass:aa(r),body:[{type:`font`,mode:n.mode,font:`boldsymbol`,body:r}],isCharacterBox:kn(r)}}}),nn({type:`font`,names:[`\\rm`,`\\sf`,`\\tt`,`\\bf`,`\\it`,`\\cal`],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:a}=n,o=n.parseExpression(!0,i);return{type:`font`,mode:a,font:`math`+r.slice(1),body:{type:`ordgroup`,mode:n.mode,body:o}}},htmlBuilder:Ga,mathmlBuilder:Ka}),Ote=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a=t.havingStyle(r),o=Ni(e.numer,a,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;o.height=o.height<s?s:o.height,o.depth=o.depth<l?l:o.depth}a=t.havingStyle(i);var u=Ni(e.denom,a,t),d,f,p;e.hasBarLine?(e.barSize?(f=Zn(e.barSize,t),d=ui(`frac-line`,t,f)):d=ui(`frac-line`,t),f=d.height,p=d.height):(d=null,f=0,p=t.fontMetrics().defaultRuleThickness);var m,h,g;n.size===Hn.DISPLAY.size?(m=t.fontMetrics().num1,h=f>0?3*p:7*p,g=t.fontMetrics().denom1):(f>0?(m=t.fontMetrics().num2,h=p):(m=t.fontMetrics().num3,h=3*p),g=t.fontMetrics().denom2);var _;if(d){var v=t.fontMetrics().axisHeight;m-o.depth-(v+.5*f)<h&&(m+=h-(m-o.depth-(v+.5*f))),v-.5*f-(u.height-g)<h&&(g+=h-(v-.5*f-(u.height-g)));var y=-(v-.5*f);_=pi({positionType:`individualShift`,children:[{type:`elem`,elem:u,shift:g},{type:`elem`,elem:d,shift:y},{type:`elem`,elem:o,shift:-m}]})}else{var b=m-o.depth-(u.height-g);b<h&&(m+=.5*(h-b),g+=.5*(h-b)),_=pi({positionType:`individualShift`,children:[{type:`elem`,elem:u,shift:g},{type:`elem`,elem:o,shift:-m}]})}a=t.havingStyle(n),_.height*=a.sizeMultiplier/t.sizeMultiplier,_.depth*=a.sizeMultiplier/t.sizeMultiplier;var x=n.size===Hn.DISPLAY.size?t.fontMetrics().delim1:n.size===Hn.SCRIPTSCRIPT.size?t.havingStyle(Hn.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,S=e.leftDelim==null?Mi(t,[`mopen`]):ja(e.leftDelim,x,!0,t.havingStyle(n),e.mode,[`mopen`]),C=e.continued?ci([]):e.rightDelim==null?Mi(t,[`mclose`]):ja(e.rightDelim,x,!0,t.havingStyle(n),e.mode,[`mclose`]);return ci([`mord`].concat(a.sizingClasses(t)),[S,ci([`mfrac`],[_]),C],t)},kte=(e,t)=>{var n=new Pi(`mfrac`,[Hi(e.numer,t),Hi(e.denom,t)]);if(!e.hasBarLine)n.setAttribute(`linethickness`,`0px`);else if(e.barSize){var r=Zn(e.barSize,t);n.setAttribute(`linethickness`,Qn(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new Pi(`mo`,[new Fi(e.leftDelim.replace(`\\`,``))]);a.setAttribute(`fence`,`true`),i.push(a)}if(i.push(n),e.rightDelim!=null){var o=new Pi(`mo`,[new Fi(e.rightDelim.replace(`\\`,``))]);o.setAttribute(`fence`,`true`),i.push(o)}return Ri(i)}return n},Ja=(e,t)=>t?{type:`styling`,mode:e.mode,style:t,body:[e]}:e,nn({type:`genfrac`,names:[`\\cfrac`,`\\dfrac`,`\\frac`,`\\tfrac`,`\\dbinom`,`\\binom`,`\\tbinom`,`\\\\atopfrac`,`\\\\bracefrac`,`\\\\brackfrac`],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=t[1],o,s=null,l=null;switch(r){case`\\cfrac`:case`\\dfrac`:case`\\frac`:case`\\tfrac`:o=!0;break;case`\\\\atopfrac`:o=!1;break;case`\\dbinom`:case`\\binom`:case`\\tbinom`:o=!1,s=`(`,l=`)`;break;case`\\\\bracefrac`:o=!1,s=`\\{`,l=`\\}`;break;case`\\\\brackfrac`:o=!1,s=`[`,l=`]`;break;default:throw Error(`Unrecognized genfrac command`)}var u=r===`\\cfrac`,d=null;return u||r.startsWith(`\\d`)?d=`display`:r.startsWith(`\\t`)&&(d=`text`),Ja({type:`genfrac`,mode:n.mode,numer:i,denom:a,continued:u,hasBarLine:o,leftDelim:s,rightDelim:l,barSize:null},d)},htmlBuilder:Ote,mathmlBuilder:kte}),nn({type:`infix`,names:[`\\over`,`\\choose`,`\\atop`,`\\brace`,`\\brack`],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:r}=e,i;switch(n){case`\\over`:i=`\\frac`;break;case`\\choose`:i=`\\binom`;break;case`\\atop`:i=`\\\\atopfrac`;break;case`\\brace`:i=`\\\\bracefrac`;break;case`\\brack`:i=`\\\\brackfrac`;break;default:throw Error(`Unrecognized infix genfrac command`)}return{type:`infix`,mode:t.mode,replaceWith:i,token:r}}}),Ya=[`display`,`text`,`script`,`scriptscript`],Xa=function(e){var t=null;return e.length>0&&(t=e,t=t===`.`?null:t),t},nn({type:`genfrac`,names:[`\\genfrac`],props:{numArgs:6,allowedInArgument:!0,argTypes:[`math`,`math`,`size`,`text`,`math`,`math`]},handler(e,t){var{parser:n}=e,r=t[4],i=t[5],a=Ti(t[0]),o=a.type===`atom`&&a.family===`open`?Xa(a.text):null,s=Ti(t[1]),l=s.type===`atom`&&s.family===`close`?Xa(s.text):null,u=dn(t[2],`size`),d,f=null;u.isBlank?d=!0:(f=u.value,d=f.number>0);var p=null,m=t[3];if(m.type===`ordgroup`){if(m.body.length>0){var h=dn(m.body[0],`textord`);p=Ya[Number(h.text)]}}else m=dn(m,`textord`),p=Ya[Number(m.text)];return Ja({type:`genfrac`,mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:d,barSize:f,leftDelim:o,rightDelim:l},p)}}),nn({type:`infix`,names:[`\\above`],props:{numArgs:1,argTypes:[`size`],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:`infix`,mode:n.mode,replaceWith:`\\\\abovefrac`,size:dn(t[0],`size`).value,token:i}}}),nn({type:`genfrac`,names:[`\\\\abovefrac`],props:{numArgs:3,argTypes:[`math`,`size`,`math`]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=dn(t[1],`infix`).size;if(!a)throw Error(`\\\\abovefrac expected size, but got `+String(a));var o=t[2],s=a.number>0;return{type:`genfrac`,mode:n.mode,numer:i,denom:o,continued:!1,hasBarLine:s,barSize:a,leftDelim:null,rightDelim:null}}}),Za=(e,t)=>{var n=t.style,r,i;e.type===`supsub`?(r=e.sup?Ni(e.sup,t.havingStyle(n.sup()),t):Ni(e.sub,t.havingStyle(n.sub()),t),i=dn(e.base,`horizBrace`)):i=dn(e,`horizBrace`);var a=Ni(i.base,t.havingBaseStyle(Hn.DISPLAY)),o=Xi(i,t),s=i.isOver?pi({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:.1},{type:`elem`,elem:o,wrapperClasses:[`svg-align`]}]}):pi({positionType:`bottom`,positionData:a.depth+.1+o.height,children:[{type:`elem`,elem:o,wrapperClasses:[`svg-align`]},{type:`kern`,size:.1},{type:`elem`,elem:a}]});if(r){var l=ci([`minner`,i.isOver?`mover`:`munder`],[s],t);s=i.isOver?pi({positionType:`firstBaseline`,children:[{type:`elem`,elem:l},{type:`kern`,size:.2},{type:`elem`,elem:r}]}):pi({positionType:`bottom`,positionData:l.depth+.2+r.height+r.depth,children:[{type:`elem`,elem:r},{type:`kern`,size:.2},{type:`elem`,elem:l}]})}return ci([`minner`,i.isOver?`mover`:`munder`],[s],t)},Ate=(e,t)=>{var n=Ji(e.label);return new Pi(e.isOver?`mover`:`munder`,[Hi(e.base,t),n])},nn({type:`horizBrace`,names:[`\\overbrace`,`\\underbrace`,`\\overbracket`,`\\underbracket`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:`horizBrace`,mode:n.mode,label:r,isOver:r.includes(`\\over`),base:t[0]}},htmlBuilder:Za,mathmlBuilder:Ate}),nn({type:`href`,names:[`\\href`],props:{numArgs:2,argTypes:[`url`,`original`],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=dn(t[0],`url`).url;return n.settings.isTrusted({command:`\\href`,url:i})?{type:`href`,mode:n.mode,href:i,body:Ei(r)}:n.formatUnsupportedCmd(`\\href`)},htmlBuilder:(e,t)=>{var n=Di(e.body,t,!1);return Zee(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=Vi(e.body,t);return n instanceof Pi||(n=new Pi(`mrow`,[n])),n.setAttribute(`href`,e.href),n}}),nn({type:`href`,names:[`\\url`],props:{numArgs:1,argTypes:[`url`],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=dn(t[0],`url`).url;if(!n.settings.isTrusted({command:`\\url`,url:r}))return n.formatUnsupportedCmd(`\\url`);for(var i=[],a=0;a<r.length;a++){var o=r[a];o===`~`&&(o=`\\textasciitilde`),i.push({type:`textord`,mode:`text`,text:o})}var s={type:`text`,mode:n.mode,font:`\\texttt`,body:i};return{type:`href`,mode:n.mode,href:r,body:Ei(s)}}}),nn({type:`hbox`,names:[`\\hbox`],props:{numArgs:1,argTypes:[`text`],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:`hbox`,mode:n.mode,body:Ei(t[0])}},htmlBuilder(e,t){return di(Di(e.body,t.withFont(``),!1))},mathmlBuilder(e,t){return new Pi(`mrow`,Bi(e.body,t.withFont(``)))}}),nn({type:`html`,names:[`\\htmlClass`,`\\htmlId`,`\\htmlStyle`,`\\htmlData`],props:{numArgs:2,argTypes:[`raw`,`original`],allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,token:i}=e,a=dn(t[0],`raw`).string,o=t[1];n.settings.strict&&n.settings.reportNonstrict(`htmlExtension`,`HTML extension is disabled on strict mode`);var s,l={};switch(r){case`\\htmlClass`:l.class=a,s={command:`\\htmlClass`,class:a};break;case`\\htmlId`:l.id=a,s={command:`\\htmlId`,id:a};break;case`\\htmlStyle`:l.style=a,s={command:`\\htmlStyle`,style:a};break;case`\\htmlData`:for(var u=a.split(`,`),d=0;d<u.length;d++){var f=u[d],p=f.indexOf(`=`);if(p<0)throw new En(`\\htmlData key/value '`+f+`' missing equals sign`);var m=f.slice(0,p),h=f.slice(p+1);l[`data-`+m.trim()]=h}s={command:`\\htmlData`,attributes:l};break;default:throw Error(`Unrecognized html command`)}return n.settings.isTrusted(s)?{type:`html`,mode:n.mode,attributes:l,body:Ei(o)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=Di(e.body,t,!1),r=[`enclosing`];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=ci(r,n,t);for(var a in e.attributes)a!==`class`&&e.attributes.hasOwnProperty(a)&&i.setAttribute(a,e.attributes[a]);return i},mathmlBuilder:(e,t)=>Vi(e.body,t)}),nn({type:`htmlmathml`,names:[`\\html@mathml`],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:`htmlmathml`,mode:n.mode,html:Ei(t[0]),mathml:Ei(t[1])}},htmlBuilder:(e,t)=>di(Di(e.html,t,!1)),mathmlBuilder:(e,t)=>Vi(e.mathml,t)}),Qa=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:`bp`};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new En(`Invalid size: '`+e+`' in \\includegraphics`);var n={number:+(t[1]+t[2]),unit:t[3]};if(!Xn(n))throw new En(`Invalid unit: '`+n.unit+`' in \\includegraphics.`);return n},nn({type:`includegraphics`,names:[`\\includegraphics`],props:{numArgs:1,numOptionalArgs:1,argTypes:[`raw`,`url`],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:`em`},a={number:.9,unit:`em`},o={number:0,unit:`em`},s=``;if(n[0])for(var l=dn(n[0],`raw`).string.split(`,`),u=0;u<l.length;u++){var d=l[u].split(`=`);if(d.length===2){var f=d[1].trim();switch(d[0].trim()){case`alt`:s=f;break;case`width`:i=Qa(f);break;case`height`:a=Qa(f);break;case`totalheight`:o=Qa(f);break;default:throw new En(`Invalid key: '`+d[0]+`' in \\includegraphics.`)}}}var p=dn(t[0],`url`).url;return s===``&&(s=p,s=s.replace(/^.*[\\/]/,``),s=s.substring(0,s.lastIndexOf(`.`))),r.settings.isTrusted({command:`\\includegraphics`,url:p})?{type:`includegraphics`,mode:r.mode,alt:s,width:i,height:a,totalheight:o,src:p}:r.formatUnsupportedCmd(`\\includegraphics`)},htmlBuilder:(e,t)=>{var n=Zn(e.height,t),r=0;e.totalheight.number>0&&(r=Zn(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=Zn(e.width,t));var a={height:Qn(n+r)};i>0&&(a.width=Qn(i)),r>0&&(a.verticalAlign=Qn(-r));var o=new Wee(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new Pi(`mglyph`,[]);n.setAttribute(`alt`,e.alt);var r=Zn(e.height,t),i=0;if(e.totalheight.number>0&&(i=Zn(e.totalheight,t)-r,n.setAttribute(`valign`,Qn(-i))),n.setAttribute(`height`,Qn(r+i)),e.width.number>0){var a=Zn(e.width,t);n.setAttribute(`width`,Qn(a))}return n.setAttribute(`src`,e.src),n}}),nn({type:`kern`,names:[`\\kern`,`\\mkern`,`\\hskip`,`\\mskip`],props:{numArgs:1,argTypes:[`size`],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=dn(t[0],`size`);if(n.settings.strict){var a=r[1]===`m`,o=i.value.unit===`mu`;a?(o||n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` supports only mu units, `+(`not `+i.value.unit+` units`)),n.mode!==`math`&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` works only in math mode`)):o&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` doesn't support mu units`)}return{type:`kern`,mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return mi(e.dimension,t)},mathmlBuilder(e,t){var n=Zn(e.dimension,t);return new Ii(n)}}),nn({type:`lap`,names:[`\\mathllap`,`\\mathrlap`,`\\mathclap`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`lap`,mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment===`clap`?(n=ci([],[Ni(e.body,t)]),n=ci([`inner`],[n],t)):n=ci([`inner`],[Ni(e.body,t)]);var r=ci([`fix`],[]),i=ci([e.alignment],[n,r],t),a=ci([`strut`]);return a.style.height=Qn(i.height+i.depth),i.depth&&(a.style.verticalAlign=Qn(-i.depth)),i.children.unshift(a),i=ci([`thinbox`],[i],t),ci([`mord`,`vbox`],[i],t)},mathmlBuilder:(e,t)=>{var n=new Pi(`mpadded`,[Hi(e.body,t)]);if(e.alignment!==`rlap`){var r=e.alignment===`llap`?`-1`:`-0.5`;n.setAttribute(`lspace`,r+`width`)}return n.setAttribute(`width`,`0px`),n}}),nn({type:`styling`,names:[`\\(`,`$`],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode(`math`);var a=n===`\\(`?`\\)`:`$`,o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:`styling`,mode:r.mode,style:`text`,resetFont:!0,body:o}}}),nn({type:`text`,names:[`\\)`,`\\]`],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new En(`Mismatched `+e.funcName)}}),$a=(e,t)=>{switch(t.style.size){case Hn.DISPLAY.size:return e.display;case Hn.TEXT.size:return e.text;case Hn.SCRIPT.size:return e.script;case Hn.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}},nn({type:`mathchoice`,names:[`\\mathchoice`],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:`mathchoice`,mode:n.mode,display:Ei(t[0]),text:Ei(t[1]),script:Ei(t[2]),scriptscript:Ei(t[3])}},htmlBuilder:(e,t)=>di(Di($a(e,t),t,!1)),mathmlBuilder:(e,t)=>Vi($a(e,t),t)}),eo=(e,t,n,r,i,a,o)=>{e=ci([],[e]);var s=n&&kn(n),l,u;if(t){var d=Ni(t,r.havingStyle(i.sup()),r);u={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-d.depth)}}if(n){var f=Ni(n,r.havingStyle(i.sub()),r);l={elem:f,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-f.height)}}var p;if(u&&l)p=pi({positionType:`bottom`,positionData:r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:l.elem,marginLeft:Qn(-a)},{type:`kern`,size:l.kern},{type:`elem`,elem:e},{type:`kern`,size:u.kern},{type:`elem`,elem:u.elem,marginLeft:Qn(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else if(l)p=pi({positionType:`top`,positionData:e.height-o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:l.elem,marginLeft:Qn(-a)},{type:`kern`,size:l.kern},{type:`elem`,elem:e}]});else if(u)p=pi({positionType:`bottom`,positionData:e.depth+o,children:[{type:`elem`,elem:e},{type:`kern`,size:u.kern},{type:`elem`,elem:u.elem,marginLeft:Qn(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else return e;var m=[p];if(l&&a!==0&&!s){var h=ci([`mspace`],[],r);h.style.marginRight=Qn(a),m.unshift(h)}return ci([`mop`,`op-limits`],m,r)},to=new Set([`\\smallint`]),no=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=dn(e.base,`op`),i=!0):a=dn(e,`op`);var o=t.style,s=!1;o.size===Hn.DISPLAY.size&&a.symbol&&!to.has(a.name)&&(s=!0);var l,u;if(a.symbol){var d=s?`Size2-Regular`:`Size1-Regular`,f=``;if((a.name===`\\oiint`||a.name===`\\oiiint`)&&(f=a.name.slice(1),a.name=f===`oiint`?`\\iint`:`\\iiint`),l=ri(a.name,d,`math`,t,[`mop`,`op-symbol`,s?`large-op`:`small-op`]),u=l.italic,f.length>0){var p=vi(f+`Size`+(s?`2`:`1`),t);l=pi({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:0},{type:`elem`,elem:p,shift:s?.08:0}]}),a.name=`\\`+f,l.classes.unshift(`mop`),l.italic=u}}else if(a.body){var m=Di(a.body,t,!0);m.length===1&&m[0]instanceof sr?(l=m[0],l.classes[0]=`mop`):l=ci([`mop`],m,t)}else{for(var h=[],g=1;g<a.name.length;g++)h.push(ii(a.name[g],a.mode,t));l=ci([`mop`],h,t)}var _=0,v=0;return(l instanceof sr||a.name===`\\oiint`||a.name===`\\oiiint`)&&!a.suppressBaseShift&&(_=(l.height-l.depth)/2-t.fontMetrics().axisHeight,v=l.italic??0),i?eo(l,n,r,t,o,v,_):(_&&(l.style.position=`relative`,l.style.top=Qn(_)),l)},ro=(e,t)=>{var n;if(e.symbol)n=new Pi(`mo`,[Li(e.name,e.mode)]),to.has(e.name)&&n.setAttribute(`largeop`,`false`);else if(e.body)n=new Pi(`mo`,Bi(e.body,t));else{n=new Pi(`mi`,[new Fi(e.name.slice(1))]);var r=new Pi(`mo`,[Li(``,`text`)]);n=e.parentIsSupSub?new Pi(`mrow`,[n,r]):sn([n,r])}return n},jte={"∏":`\\prod`,"∐":`\\coprod`,"∑":`\\sum`,"⋀":`\\bigwedge`,"⋁":`\\bigvee`,"⋂":`\\bigcap`,"⋃":`\\bigcup`,"⨀":`\\bigodot`,"⨁":`\\bigoplus`,"⨂":`\\bigotimes`,"⨄":`\\biguplus`,"⨆":`\\bigsqcup`},nn({type:`op`,names:`\\coprod.\\bigvee.\\bigwedge.\\biguplus.\\bigcap.\\bigcup.\\intop.\\prod.\\sum.\\bigotimes.\\bigoplus.\\bigodot.\\bigsqcup.\\smallint.∏.∐.∑.⋀.⋁.⋂.⋃.⨀.⨁.⨂.⨄.⨆`.split(`.`),props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return i.length===1&&(i=jte[i]),{type:`op`,mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:no,mathmlBuilder:ro}),nn({type:`op`,names:[`\\mathop`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`op`,mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Ei(r)}},htmlBuilder:no,mathmlBuilder:ro}),Mte={"∫":`\\int`,"∬":`\\iint`,"∭":`\\iiint`,"∮":`\\oint`,"∯":`\\oiint`,"∰":`\\oiiint`},nn({type:`op`,names:`\\arcsin.\\arccos.\\arctan.\\arctg.\\arcctg.\\arg.\\ch.\\cos.\\cosec.\\cosh.\\cot.\\cotg.\\coth.\\csc.\\ctg.\\cth.\\deg.\\dim.\\exp.\\hom.\\ker.\\lg.\\ln.\\log.\\sec.\\sin.\\sinh.\\sh.\\tan.\\tanh.\\tg.\\th`.split(`.`),props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:no,mathmlBuilder:ro}),nn({type:`op`,names:[`\\det`,`\\gcd`,`\\inf`,`\\lim`,`\\max`,`\\min`,`\\Pr`,`\\sup`],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:`op`,mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:no,mathmlBuilder:ro}),nn({type:`op`,names:[`\\int`,`\\iint`,`\\iiint`,`\\oint`,`\\oiint`,`\\oiiint`,`∫`,`∬`,`∭`,`∮`,`∯`,`∰`],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=Mte[r]),{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:no,mathmlBuilder:ro}),io=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=dn(e.base,`operatorname`),i=!0):a=dn(e,`operatorname`);var o;if(a.body.length>0){for(var s=Di(a.body.map(e=>{var t=`text`in e?e.text:void 0;return typeof t==`string`?{type:`textord`,mode:e.mode,text:t}:e}),t.withFont(`mathrm`),!0),l=0;l<s.length;l++){var u=s[l];u instanceof sr&&(u.text=u.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`))}o=ci([`mop`],s,t)}else o=ci([`mop`],[],t);return i?eo(o,n,r,t,t.style,0,0):o},Nte=(e,t)=>{for(var n=Bi(e.body,t.withFont(`mathrm`)),r=!0,i=0;i<n.length;i++){var a=n[i];if(!(a instanceof Ii)){if(a instanceof Pi)switch(a.type){case`mi`:case`mn`:case`mspace`:case`mtext`:break;case`mo`:var o=a.children[0];a.children.length===1&&o instanceof Fi?o.text=o.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`):r=!1;break;default:r=!1}else r=!1}}if(r){var s=n.map(e=>e.toText()).join(``);n=[new Fi(s)]}var l=new Pi(`mi`,n);l.setAttribute(`mathvariant`,`normal`);var u=new Pi(`mo`,[Li(``,`text`)]);return e.parentIsSupSub?new Pi(`mrow`,[l,u]):sn([l,u])},nn({type:`operatorname`,names:[`\\operatorname@`,`\\operatornamewithlimits`],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`operatorname`,mode:n.mode,body:Ei(i),alwaysHandleSupSub:r===`\\operatornamewithlimits`,limits:!1,parentIsSupSub:!1}},htmlBuilder:io,mathmlBuilder:Nte}),G(`\\operatorname`,`\\@ifstar\\operatornamewithlimits\\operatorname@`),rn({type:`ordgroup`,htmlBuilder(e,t){return e.semisimple?di(Di(e.body,t,!1)):ci([`mord`],Di(e.body,t,!0),t)},mathmlBuilder(e,t){return Vi(e.body,t,!0)}}),nn({type:`overline`,names:[`\\overline`],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:`overline`,mode:n.mode,body:r}},htmlBuilder(e,t){var n=Ni(e.body,t.havingCrampedStyle()),r=ui(`overline-line`,t),i=t.fontMetrics().defaultRuleThickness;return ci([`mord`,`overline`],[pi({positionType:`firstBaseline`,children:[{type:`elem`,elem:n},{type:`kern`,size:3*i},{type:`elem`,elem:r},{type:`kern`,size:i}]})],t)},mathmlBuilder(e,t){var n=new Pi(`mo`,[new Fi(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Pi(`mover`,[Hi(e.body,t),n]);return r.setAttribute(`accent`,`true`),r}}),nn({type:`phantom`,names:[`\\phantom`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`phantom`,mode:n.mode,body:Ei(r)}},htmlBuilder:(e,t)=>di(Di(e.body,t.withPhantom(),!1)),mathmlBuilder:(e,t)=>{var n=Bi(e.body,t);return new Pi(`mphantom`,n)}}),G(`\\hphantom`,`\\smash{\\phantom{#1}}`),nn({type:`vphantom`,names:[`\\vphantom`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`vphantom`,mode:n.mode,body:r}},htmlBuilder:(e,t)=>ci([`mord`,`rlap`],[ci([`inner`],[Ni(e.body,t.withPhantom())]),ci([`fix`],[])],t),mathmlBuilder:(e,t)=>{var n=Bi(Ei(e.body),t),r=new Pi(`mphantom`,n),i=new Pi(`mpadded`,[r]);return i.setAttribute(`width`,`0px`),i}}),nn({type:`raisebox`,names:[`\\raisebox`],props:{numArgs:2,argTypes:[`size`,`hbox`],allowedInText:!0},handler(e,t){var{parser:n}=e,r=dn(t[0],`size`).value,i=t[1];return{type:`raisebox`,mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=Ni(e.body,t);return pi({positionType:`shift`,positionData:-Zn(e.dy,t),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){var n=new Pi(`mpadded`,[Hi(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute(`voffset`,r),n}}),nn({type:`internal`,names:[`\\relax`],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:`internal`,mode:t.mode}}}),nn({type:`rule`,names:[`\\rule`],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`size`,`size`,`size`]},handler(e,t,n){var{parser:r}=e,i=n[0],a=dn(t[0],`size`),o=dn(t[1],`size`);return{type:`rule`,mode:r.mode,shift:i&&dn(i,`size`).value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=ci([`mord`,`rule`],[],t),r=Zn(e.width,t),i=Zn(e.height,t),a=e.shift?Zn(e.shift,t):0;return n.style.borderRightWidth=Qn(r),n.style.borderTopWidth=Qn(i),n.style.bottom=Qn(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=Zn(e.width,t),r=Zn(e.height,t),i=e.shift?Zn(e.shift,t):0,a=t.color&&t.getColor()||`black`,o=new Pi(`mspace`);o.setAttribute(`mathbackground`,a),o.setAttribute(`width`,Qn(n)),o.setAttribute(`height`,Qn(r));var s=new Pi(`mpadded`,[o]);return i>=0?s.setAttribute(`height`,Qn(i)):(s.setAttribute(`height`,Qn(i)),s.setAttribute(`depth`,Qn(-i))),s.setAttribute(`voffset`,Qn(i)),s}}),ao=[`\\tiny`,`\\sixptsize`,`\\scriptsize`,`\\footnotesize`,`\\small`,`\\normalsize`,`\\large`,`\\Large`,`\\LARGE`,`\\huge`,`\\Huge`],Pte=(e,t)=>{var n=t.havingSize(e.size);return vee(e.body,n,t)},nn({type:`sizing`,names:ao,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!1,n);return{type:`sizing`,mode:i.mode,size:ao.indexOf(r)+1,body:a}},htmlBuilder:Pte,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=Bi(e.body,n),i=new Pi(`mstyle`,r);return i.setAttribute(`mathsize`,Qn(n.sizeMultiplier)),i}}),nn({type:`smash`,names:[`\\smash`],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,a=!1,o=n[0]&&dn(n[0],`ordgroup`);if(o)for(var s,l=0;l<o.body.length;++l){var u=o.body[l];if(s=fn(u).text,s===`t`)i=!0;else if(s===`b`)a=!0;else{i=!1,a=!1;break}}else i=!0,a=!0;var d=t[0];return{type:`smash`,mode:r.mode,body:d,smashHeight:i,smashDepth:a}},htmlBuilder:(e,t)=>{var n=ci([],[Ni(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return ci([`mord`,`smash`],[n],t);if(n.children)for(var r=0;r<n.children.length;r++)e.smashHeight&&(n.children[r].height=0),e.smashDepth&&(n.children[r].depth=0);return ci([`mord`],[pi({positionType:`firstBaseline`,children:[{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=new Pi(`mpadded`,[Hi(e.body,t)]);return e.smashHeight&&n.setAttribute(`height`,`0px`),e.smashDepth&&n.setAttribute(`depth`,`0px`),n}}),nn({type:`sqrt`,names:[`\\sqrt`],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],a=t[0];return{type:`sqrt`,mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=Ni(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=fi(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.id<Hn.TEXT.id&&(i=t.fontMetrics().xHeight);var a=r+i/4,{span:o,ruleWidth:s,advanceWidth:l}=bte(n.height+n.depth+a+r,t),u=o.height-s;u>n.height+n.depth+a&&(a=(a+u-n.height-n.depth)/2);var d=o.height-n.height-a-s;n.style.paddingLeft=Qn(l);var f=pi({positionType:`firstBaseline`,children:[{type:`elem`,elem:n,wrapperClasses:[`svg-align`]},{type:`kern`,size:-(n.height+d)},{type:`elem`,elem:o},{type:`kern`,size:s}]});if(e.index){var p=t.havingStyle(Hn.SCRIPTSCRIPT),m=Ni(e.index,p,t);return ci([`mord`,`sqrt`],[ci([`root`],[pi({positionType:`shift`,positionData:-(.6*(f.height-f.depth)),children:[{type:`elem`,elem:m}]})]),f],t)}return ci([`mord`,`sqrt`],[f],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new Pi(`mroot`,[Hi(n,t),Hi(r,t)]):new Pi(`msqrt`,[Hi(n,t)])}}),oo={display:Hn.DISPLAY,text:Hn.TEXT,script:Hn.SCRIPT,scriptscript:Hn.SCRIPTSCRIPT},nn({type:`styling`,names:[`\\displaystyle`,`\\textstyle`,`\\scriptstyle`,`\\scriptscriptstyle`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);if(!yee(o))throw Error(`Unknown style: `+o);return{type:`styling`,mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=oo[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont(``)),vee(e.body,r,t)},mathmlBuilder(e,t){var n=oo[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(``));var i=Bi(e.body,r),a=new Pi(`mstyle`,i),o={display:[`0`,`true`],text:[`0`,`false`],script:[`1`,`false`],scriptscript:[`2`,`false`]}[e.style];return a.setAttribute(`scriptlevel`,o[0]),a.setAttribute(`displaystyle`,o[1]),a}}),Fte=function(e,t){var n=e.base;return n?n.type===`op`?n.limits&&(t.style.size===Hn.DISPLAY.size||n.alwaysHandleSupSub)?no:null:n.type===`operatorname`?n.alwaysHandleSupSub&&(t.style.size===Hn.DISPLAY.size||n.limits)?io:null:n.type===`accent`?kn(n.base)?ta:null:n.type===`horizBrace`&&!e.sub===n.isOver?Za:null:null},rn({type:`supsub`,htmlBuilder(e,t){var n=Fte(e,t);if(n)return n(e,t);var{base:r,sup:i,sub:a}=e,o=Ni(r,t),s,l,u=t.fontMetrics(),d=0,f=0,p=r&&kn(r);if(i){var m=t.havingStyle(t.style.sup());s=Ni(i,m,t),p||(d=o.height-m.fontMetrics().supDrop*m.sizeMultiplier/t.sizeMultiplier)}if(a){var h=t.havingStyle(t.style.sub());l=Ni(a,h,t),p||(f=o.depth+h.fontMetrics().subDrop*h.sizeMultiplier/t.sizeMultiplier)}var g=t.style===Hn.DISPLAY?u.sup1:t.style.cramped?u.sup3:u.sup2,_=t.sizeMultiplier,v=Qn(.5/u.ptPerEm/_),y=null;if(l){var b=e.base&&e.base.type===`op`&&e.base.name&&(e.base.name===`\\oiint`||e.base.name===`\\oiiint`);(o instanceof sr||b)&&(y=Qn(-(o.italic??0)))}var x;if(s&&l){d=Math.max(d,g,s.depth+.25*u.xHeight),f=Math.max(f,u.sub2);var S=4*u.defaultRuleThickness;if(d-s.depth-(l.height-f)<S){f=S-(d-s.depth)+l.height;var C=.8*u.xHeight-(d-s.depth);C>0&&(d+=C,f-=C)}x=pi({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:f,marginRight:v,marginLeft:y},{type:`elem`,elem:s,shift:-d,marginRight:v}]})}else if(l)f=Math.max(f,u.sub1,l.height-.8*u.xHeight),x=pi({positionType:`shift`,positionData:f,children:[{type:`elem`,elem:l,marginLeft:y,marginRight:v}]});else if(s)d=Math.max(d,g,s.depth+.25*u.xHeight),x=pi({positionType:`shift`,positionData:-d,children:[{type:`elem`,elem:s,marginRight:v}]});else throw Error(`supsub must have either sup or sub.`);return ci([ji(o,`right`)||`mord`],[o,ci([`msupsub`],[x])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type===`horizBrace`&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type===`op`||e.base.type===`operatorname`)&&(e.base.parentIsSupSub=!0);var a=[Hi(e.base,t)];e.sub&&a.push(Hi(e.sub,t)),e.sup&&a.push(Hi(e.sup,t));var o;if(n)o=r?`mover`:`munder`;else if(!e.sub){var s=e.base;o=s&&s.type===`op`&&s.limits&&(t.style===Hn.DISPLAY||s.alwaysHandleSupSub)||s&&s.type===`operatorname`&&s.alwaysHandleSupSub&&(s.limits||t.style===Hn.DISPLAY)?`mover`:`msup`}else if(e.sup){var l=e.base;o=l&&l.type===`op`&&l.limits&&t.style===Hn.DISPLAY||l&&l.type===`operatorname`&&l.alwaysHandleSupSub&&(t.style===Hn.DISPLAY||l.limits)?`munderover`:`msubsup`}else{var u=e.base;o=u&&u.type===`op`&&u.limits&&(t.style===Hn.DISPLAY||u.alwaysHandleSupSub)||u&&u.type===`operatorname`&&u.alwaysHandleSupSub&&(u.limits||t.style===Hn.DISPLAY)?`munder`:`msub`}return new Pi(o,a)}}),rn({type:`atom`,htmlBuilder(e,t){return ii(e.text,e.mode,t,[`m`+e.family])},mathmlBuilder(e,t){var n=new Pi(`mo`,[Li(e.text,e.mode)]);if(e.family===`bin`){var r=zi(e,t);r===`bold-italic`&&n.setAttribute(`mathvariant`,r)}else e.family===`punct`?n.setAttribute(`separator`,`true`):(e.family===`open`||e.family===`close`)&&n.setAttribute(`stretchy`,`false`);return n}}),so={mi:`italic`,mn:`normal`,mtext:`normal`},rn({type:`mathord`,htmlBuilder(e,t){return ai(e,t,`mathord`)},mathmlBuilder(e,t){var n=new Pi(`mi`,[Li(e.text,e.mode,t)]),r=zi(e,t)||`italic`;return r!==so[n.type]&&n.setAttribute(`mathvariant`,r),n}}),rn({type:`textord`,htmlBuilder(e,t){return ai(e,t,`textord`)},mathmlBuilder(e,t){var n=Li(e.text,e.mode,t),r=zi(e,t)||`normal`,i=e.mode===`text`?new Pi(`mtext`,[n]):/[0-9]/.test(e.text)?new Pi(`mn`,[n]):e.text===`\\prime`?new Pi(`mo`,[n]):new Pi(`mi`,[n]);return r!==so[i.type]&&i.setAttribute(`mathvariant`,r),i}}),co={"\\nobreak":`nobreak`,"\\allowbreak":`allowbreak`},lo={" ":{},"\\ ":{},"~":{className:`nobreak`},"\\space":{},"\\nobreakspace":{className:`nobreak`}},rn({type:`spacing`,htmlBuilder(e,t){if(lo.hasOwnProperty(e.text)){var n=lo[e.text].className||``;if(e.mode===`text`){var r=ai(e,t,`textord`);return r.classes.push(n),r}return ci([`mspace`,n],[ii(e.text,e.mode,t)],t)}if(co.hasOwnProperty(e.text))return ci([`mspace`,co[e.text]],[],t);throw new En(`Unknown type of space "`+e.text+`"`)},mathmlBuilder(e,t){var n;if(lo.hasOwnProperty(e.text))n=new Pi(`mtext`,[new Fi(`\xA0`)]);else if(co.hasOwnProperty(e.text))return new Pi(`mspace`);else throw new En(`Unknown type of space "`+e.text+`"`);return n}}),uo=()=>{var e=new Pi(`mtd`,[]);return e.setAttribute(`width`,`50%`),e},rn({type:`tag`,mathmlBuilder(e,t){var n=new Pi(`mtable`,[new Pi(`mtr`,[uo(),new Pi(`mtd`,[Vi(e.body,t)]),uo(),new Pi(`mtd`,[Vi(e.tag,t)])])]);return n.setAttribute(`width`,`100%`),n}}),fo={"\\text":void 0,"\\textrm":`textrm`,"\\textsf":`textsf`,"\\texttt":`texttt`,"\\textnormal":`textrm`},po={"\\textbf":`textbf`,"\\textmd":`textmd`},Ite={"\\textit":`textit`,"\\textup":`textup`},mo=(e,t)=>{var n=e.font;return n?fo[n]?t.withTextFontFamily(fo[n]):po[n]?t.withTextFontWeight(po[n]):n===`\\emph`?t.fontShape===`textit`?t.withTextFontShape(`textup`):t.withTextFontShape(`textit`):t.withTextFontShape(Ite[n]):t},nn({type:`text`,names:[`\\text`,`\\textrm`,`\\textsf`,`\\texttt`,`\\textnormal`,`\\textbf`,`\\textmd`,`\\textit`,`\\textup`,`\\emph`],props:{numArgs:1,argTypes:[`text`],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`text`,mode:n.mode,body:Ei(i),font:r}},htmlBuilder(e,t){var n=mo(e,t);return ci([`mord`,`text`],Di(e.body,n,!0),n)},mathmlBuilder(e,t){var n=mo(e,t);return Vi(e.body,n)}}),nn({type:`underline`,names:[`\\underline`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`underline`,mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Ni(e.body,t),r=ui(`underline-line`,t),i=t.fontMetrics().defaultRuleThickness;return ci([`mord`,`underline`],[pi({positionType:`top`,positionData:n.height,children:[{type:`kern`,size:i},{type:`elem`,elem:r},{type:`kern`,size:3*i},{type:`elem`,elem:n}]})],t)},mathmlBuilder(e,t){var n=new Pi(`mo`,[new Fi(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Pi(`munder`,[Hi(e.body,t),n]);return r.setAttribute(`accentunder`,`true`),r}}),nn({type:`vcenter`,names:[`\\vcenter`],props:{numArgs:1,argTypes:[`original`],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:`vcenter`,mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Ni(e.body,t),r=t.fontMetrics().axisHeight;return pi({positionType:`shift`,positionData:.5*(n.height-r-(n.depth+r)),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){var n=new Pi(`mpadded`,[Hi(e.body,t)],[`vcenter`]);return new Pi(`mrow`,[n])}}),nn({type:`verb`,names:[`\\verb`],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new En(`\\verb ended by end of line instead of matching delimiter`)},htmlBuilder(e,t){for(var n=ho(e),r=[],i=t.havingStyle(t.style.text()),a=0;a<n.length;a++){var o=n[a];o===`~`&&(o=`\\textasciitilde`),r.push(ri(o,`Typewriter-Regular`,e.mode,i,[`mord`,`texttt`]))}return ci([`mord`,`text`].concat(i.sizingClasses(t)),oi(r),i)},mathmlBuilder(e,t){var n=new Fi(ho(e)),r=new Pi(`mtext`,[n]);return r.setAttribute(`mathvariant`,`monospace`),r}}),ho=e=>e.body.replace(/ /g,e.star?`␣`:`\xA0`),go=Si,_o=`[ \r255+ ]`,Lte=`\\\\[a-zA-Z@]+`,Rte=`\\\\[^\ud800-\udfff]`,zte=`(`+Lte+`)`+_o+`*`,Bte=`\\\\(256+|[ \r ]+257+?)[ \r ]*`,vo=`[̀-ͯ]`,Vte=RegExp(vo+`+$`),Hte=`(`+_o+`+)|`+(Bte+`|`)+`([!-\\[\\]-‧-豈-]`+(vo+`*`)+`|[\ud800-\udbff][\udc00-\udfff]`+(vo+`*`)+`|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5`+(`|`+zte)+(`|`+Rte+`)`),yo=class{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(Hte,`g`),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new za(`EOF`,new Ra(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new En(`Unexpected character: '`+e[t]+`'`,new za(e[t],new Ra(this,t,t+1)));var r=n[6]||n[3]||(n[2]?`\\ `:` `);if(this.catcodes[r]===14){var i=e.indexOf(`258+`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict(`commentAtEnd`,`% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)`)):this.tokenRegex.lastIndex=i+1,this.lex()}return new za(r,new Ra(this,t,this.tokenRegex.lastIndex))}},bo=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new En(`Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug`);var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}},xo=La,G(`\\noexpand`,function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),G(`\\expandafter`,function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),G(`\\@firstoftwo`,function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),G(`\\@secondoftwo`,function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),G(`\\@ifnextchar`,function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),G(`\\@ifstar`,`\\@ifnextchar *{\\@firstoftwo{#1}}`),G(`\\TextOrMath`,function(e){var t=e.consumeArgs(2);return e.mode===`text`?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}}),So={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15},G(`\\char`,function(e){var t=e.popToken(),n,r=0;if(t.text===`'`)n=8,t=e.popToken();else if(t.text===`"`)n=16,t=e.popToken();else if(t.text==="`"){if(t=e.popToken(),t.text[0]===`\\`)r=t.text.charCodeAt(1);else if(t.text===`EOF`)throw new En("\\char` missing argument");else r=t.text.charCodeAt(0)}else n=10;if(n){if(r=So[t.text],r==null||r>=n)throw new En(`Invalid base-`+n+` digit `+t.text);for(var i;(i=So[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return`\\@char{`+r+`}`}),Co=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new En(`\\newcommand's first argument must be a macro name`);var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new En(`\\newcommand{`+a+`} attempting to redefine `+(a+`; use \\renewcommand`));if(!o&&!n)throw new En(`\\renewcommand{`+a+`} when command `+a+` does not yet exist; use \\newcommand`);var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text===`[`){for(var l=``,u=e.expandNextToken();u.text!==`]`&&u.text!==`EOF`;)l+=u.text,u=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new En(`Invalid number of arguments: `+l);s=parseInt(l),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),``},G(`\\newcommand`,e=>Co(e,!1,!0,!1)),G(`\\renewcommand`,e=>Co(e,!0,!1,!1)),G(`\\providecommand`,e=>Co(e,!0,!0,!0)),G(`\\message`,e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join(``)),``}),G(`\\errmessage`,e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join(``)),``}),G(`\\show`,e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),go[n],hr.math[n],hr.text[n]),``}),G(`\\bgroup`,`{`),G(`\\egroup`,`}`),G(`~`,`\\nobreakspace`),G(`\\lq`,"`"),G(`\\rq`,`'`),G(`\\aa`,`\\r a`),G(`\\AA`,`\\r A`),G(`\\textcopyright`,"\\html@mathml{\\textcircled{c}}{\\char`©}"),G(`\\copyright`,`\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}`),G(`\\textregistered`,"\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),G(`ℬ`,`\\mathscr{B}`),G(`ℰ`,`\\mathscr{E}`),G(`ℱ`,`\\mathscr{F}`),G(`ℋ`,`\\mathscr{H}`),G(`ℐ`,`\\mathscr{I}`),G(`ℒ`,`\\mathscr{L}`),G(`ℳ`,`\\mathscr{M}`),G(`ℛ`,`\\mathscr{R}`),G(`ℭ`,`\\mathfrak{C}`),G(`ℌ`,`\\mathfrak{H}`),G(`ℨ`,`\\mathfrak{Z}`),G(`\\Bbbk`,`\\Bbb{k}`),G(`\\llap`,`\\mathllap{\\textrm{#1}}`),G(`\\rlap`,`\\mathrlap{\\textrm{#1}}`),G(`\\clap`,`\\mathclap{\\textrm{#1}}`),G(`\\mathstrut`,`\\vphantom{(}`),G(`\\underbar`,`\\underline{\\text{#1}}`),G(`\\not`,`\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}`),G(`\\neq`,"\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),G(`\\ne`,`\\neq`),G(`≠`,`\\neq`),G(`\\notin`,"\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),G(`∉`,`\\notin`),G(`≘`,"\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),G(`≙`,"\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),G(`≚`,"\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),G(`≛`,"\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),G(`≝`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),G(`≞`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),G(`≟`,"\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),G(`⟂`,`\\perp`),G(`‼`,`\\mathclose{!\\mkern-0.8mu!}`),G(`∌`,`\\notni`),G(`⌜`,`\\ulcorner`),G(`⌝`,`\\urcorner`),G(`⌞`,`\\llcorner`),G(`⌟`,`\\lrcorner`),G(`©`,`\\copyright`),G(`®`,`\\textregistered`),G(`\\ulcorner`,`\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}`),G(`\\urcorner`,`\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}`),G(`\\llcorner`,`\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}`),G(`\\lrcorner`,`\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}`),G(`\\vdots`,`{\\varvdots\\rule{0pt}{15pt}}`),G(`⋮`,`\\vdots`),G(`\\varGamma`,`\\mathit{\\Gamma}`),G(`\\varDelta`,`\\mathit{\\Delta}`),G(`\\varTheta`,`\\mathit{\\Theta}`),G(`\\varLambda`,`\\mathit{\\Lambda}`),G(`\\varXi`,`\\mathit{\\Xi}`),G(`\\varPi`,`\\mathit{\\Pi}`),G(`\\varSigma`,`\\mathit{\\Sigma}`),G(`\\varUpsilon`,`\\mathit{\\Upsilon}`),G(`\\varPhi`,`\\mathit{\\Phi}`),G(`\\varPsi`,`\\mathit{\\Psi}`),G(`\\varOmega`,`\\mathit{\\Omega}`),G(`\\substack`,`\\begin{subarray}{c}#1\\end{subarray}`),G(`\\colon`,`\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax`),G(`\\boxed`,`\\fbox{$\\displaystyle{#1}$}`),G(`\\iff`,`\\DOTSB\\;\\Longleftrightarrow\\;`),G(`\\implies`,`\\DOTSB\\;\\Longrightarrow\\;`),G(`\\impliedby`,`\\DOTSB\\;\\Longleftarrow\\;`),G(`\\dddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}`),G(`\\ddddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}`),wo={",":`\\dotsc`,"\\not":`\\dotsb`,"+":`\\dotsb`,"=":`\\dotsb`,"<":`\\dotsb`,">":`\\dotsb`,"-":`\\dotsb`,"*":`\\dotsb`,":":`\\dotsb`,"\\DOTSB":`\\dotsb`,"\\coprod":`\\dotsb`,"\\bigvee":`\\dotsb`,"\\bigwedge":`\\dotsb`,"\\biguplus":`\\dotsb`,"\\bigcap":`\\dotsb`,"\\bigcup":`\\dotsb`,"\\prod":`\\dotsb`,"\\sum":`\\dotsb`,"\\bigotimes":`\\dotsb`,"\\bigoplus":`\\dotsb`,"\\bigodot":`\\dotsb`,"\\bigsqcup":`\\dotsb`,"\\And":`\\dotsb`,"\\longrightarrow":`\\dotsb`,"\\Longrightarrow":`\\dotsb`,"\\longleftarrow":`\\dotsb`,"\\Longleftarrow":`\\dotsb`,"\\longleftrightarrow":`\\dotsb`,"\\Longleftrightarrow":`\\dotsb`,"\\mapsto":`\\dotsb`,"\\longmapsto":`\\dotsb`,"\\hookrightarrow":`\\dotsb`,"\\doteq":`\\dotsb`,"\\mathbin":`\\dotsb`,"\\mathrel":`\\dotsb`,"\\relbar":`\\dotsb`,"\\Relbar":`\\dotsb`,"\\xrightarrow":`\\dotsb`,"\\xleftarrow":`\\dotsb`,"\\DOTSI":`\\dotsi`,"\\int":`\\dotsi`,"\\oint":`\\dotsi`,"\\iint":`\\dotsi`,"\\iiint":`\\dotsi`,"\\iiiint":`\\dotsi`,"\\idotsint":`\\dotsi`,"\\DOTSX":`\\dotsx`},To=new Set([`bin`,`rel`]),G(`\\dots`,function(e){var t=`\\dotso`,n=e.expandAfterFuture().text;return n in wo?t=wo[n]:(n.slice(0,4)===`\\not`||n in hr.math&&To.has(hr.math[n].group))&&(t=`\\dotsb`),t}),Eo={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0},G(`\\dotso`,function(e){return e.future().text in Eo?`\\ldots\\,`:`\\ldots`}),G(`\\dotsc`,function(e){var t=e.future().text;return t in Eo&&t!==`,`?`\\ldots\\,`:`\\ldots`}),G(`\\cdots`,function(e){return e.future().text in Eo?`\\@cdots\\,`:`\\@cdots`}),G(`\\dotsb`,`\\cdots`),G(`\\dotsm`,`\\cdots`),G(`\\dotsi`,`\\!\\cdots`),G(`\\dotsx`,`\\ldots\\,`),G(`\\DOTSI`,`\\relax`),G(`\\DOTSB`,`\\relax`),G(`\\DOTSX`,`\\relax`),G(`\\tmspace`,`\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax`),G(`\\,`,`\\tmspace+{3mu}{.1667em}`),G(`\\thinspace`,`\\,`),G(`\\>`,`\\mskip{4mu}`),G(`\\:`,`\\tmspace+{4mu}{.2222em}`),G(`\\medspace`,`\\:`),G(`\\;`,`\\tmspace+{5mu}{.2777em}`),G(`\\thickspace`,`\\;`),G(`\\!`,`\\tmspace-{3mu}{.1667em}`),G(`\\negthinspace`,`\\!`),G(`\\negmedspace`,`\\tmspace-{4mu}{.2222em}`),G(`\\negthickspace`,`\\tmspace-{5mu}{.277em}`),G(`\\enspace`,`\\kern.5em `),G(`\\enskip`,`\\hskip.5em\\relax`),G(`\\quad`,`\\hskip1em\\relax`),G(`\\qquad`,`\\hskip2em\\relax`),G(`\\tag`,`\\@ifstar\\tag@literal\\tag@paren`),G(`\\tag@paren`,`\\tag@literal{({#1})}`),G(`\\tag@literal`,e=>{if(e.macros.get(`\\df@tag`))throw new En(`Multiple \\tag`);return`\\gdef\\df@tag{\\text{#1}}`}),G(`\\bmod`,`\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}`),G(`\\pod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)`),G(`\\pmod`,`\\pod{{\\rm mod}\\mkern6mu#1}`),G(`\\mod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1`),G(`\\newline`,`\\\\\\relax`),G(`\\TeX`,`\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}`),Do=Qn(dr[`Main-Regular`][84][1]-.7*dr[`Main-Regular`][65][1]),G(`\\LaTeX`,`\\textrm{\\html@mathml{`+(`L\\kern-.36em\\raisebox{`+Do+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{LaTeX}}`),G(`\\KaTeX`,`\\textrm{\\html@mathml{`+(`K\\kern-.17em\\raisebox{`+Do+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{KaTeX}}`),G(`\\hspace`,`\\@ifstar\\@hspacer\\@hspace`),G(`\\@hspace`,`\\hskip #1\\relax`),G(`\\@hspacer`,`\\rule{0pt}{0pt}\\hskip #1\\relax`),G(`\\ordinarycolon`,`:`),G(`\\vcentcolon`,`\\mathrel{\\mathop\\ordinarycolon}`),G(`\\dblcolon`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}`),G(`\\coloneqq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}`),G(`\\Coloneqq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}`),G(`\\coloneq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}`),G(`\\Coloneq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}`),G(`\\eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}`),G(`\\Eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}`),G(`\\eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}`),G(`\\Eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}`),G(`\\colonapprox`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}`),G(`\\Colonapprox`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}`),G(`\\colonsim`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}`),G(`\\Colonsim`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}`),G(`∷`,`\\dblcolon`),G(`∹`,`\\eqcolon`),G(`≔`,`\\coloneqq`),G(`≕`,`\\eqqcolon`),G(`⩴`,`\\Coloneqq`),G(`\\ratio`,`\\vcentcolon`),G(`\\coloncolon`,`\\dblcolon`),G(`\\colonequals`,`\\coloneqq`),G(`\\coloncolonequals`,`\\Coloneqq`),G(`\\equalscolon`,`\\eqqcolon`),G(`\\equalscoloncolon`,`\\Eqqcolon`),G(`\\colonminus`,`\\coloneq`),G(`\\coloncolonminus`,`\\Coloneq`),G(`\\minuscolon`,`\\eqcolon`),G(`\\minuscoloncolon`,`\\Eqcolon`),G(`\\coloncolonapprox`,`\\Colonapprox`),G(`\\coloncolonsim`,`\\Colonsim`),G(`\\simcolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),G(`\\simcoloncolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}`),G(`\\approxcolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),G(`\\approxcoloncolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}`),G(`\\notni`,"\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),G(`\\limsup`,`\\DOTSB\\operatorname*{lim\\,sup}`),G(`\\liminf`,`\\DOTSB\\operatorname*{lim\\,inf}`),G(`\\injlim`,`\\DOTSB\\operatorname*{inj\\,lim}`),G(`\\projlim`,`\\DOTSB\\operatorname*{proj\\,lim}`),G(`\\varlimsup`,`\\DOTSB\\operatorname*{\\overline{lim}}`),G(`\\varliminf`,`\\DOTSB\\operatorname*{\\underline{lim}}`),G(`\\varinjlim`,`\\DOTSB\\operatorname*{\\underrightarrow{lim}}`),G(`\\varprojlim`,`\\DOTSB\\operatorname*{\\underleftarrow{lim}}`),G(`\\gvertneqq`,`\\html@mathml{\\@gvertneqq}{≩}`),G(`\\lvertneqq`,`\\html@mathml{\\@lvertneqq}{≨}`),G(`\\ngeqq`,`\\html@mathml{\\@ngeqq}{≱}`),G(`\\ngeqslant`,`\\html@mathml{\\@ngeqslant}{≱}`),G(`\\nleqq`,`\\html@mathml{\\@nleqq}{≰}`),G(`\\nleqslant`,`\\html@mathml{\\@nleqslant}{≰}`),G(`\\nshortmid`,`\\html@mathml{\\@nshortmid}{∤}`),G(`\\nshortparallel`,`\\html@mathml{\\@nshortparallel}{∦}`),G(`\\nsubseteqq`,`\\html@mathml{\\@nsubseteqq}{⊈}`),G(`\\nsupseteqq`,`\\html@mathml{\\@nsupseteqq}{⊉}`),G(`\\varsubsetneq`,`\\html@mathml{\\@varsubsetneq}{⊊}`),G(`\\varsubsetneqq`,`\\html@mathml{\\@varsubsetneqq}{⫋}`),G(`\\varsupsetneq`,`\\html@mathml{\\@varsupsetneq}{⊋}`),G(`\\varsupsetneqq`,`\\html@mathml{\\@varsupsetneqq}{⫌}`),G(`\\imath`,`\\html@mathml{\\@imath}{ı}`),G(`\\jmath`,`\\html@mathml{\\@jmath}{ȷ}`),G(`\\llbracket`,"\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),G(`\\rrbracket`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),G(`⟦`,`\\llbracket`),G(`⟧`,`\\rrbracket`),G(`\\lBrace`,"\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),G(`\\rBrace`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),G(`⦃`,`\\lBrace`),G(`⦄`,`\\rBrace`),G(`\\minuso`,"\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),G(`⦵`,`\\minuso`),G(`\\darr`,`\\downarrow`),G(`\\dArr`,`\\Downarrow`),G(`\\Darr`,`\\Downarrow`),G(`\\lang`,`\\langle`),G(`\\rang`,`\\rangle`),G(`\\uarr`,`\\uparrow`),G(`\\uArr`,`\\Uparrow`),G(`\\Uarr`,`\\Uparrow`),G(`\\N`,`\\mathbb{N}`),G(`\\R`,`\\mathbb{R}`),G(`\\Z`,`\\mathbb{Z}`),G(`\\alef`,`\\aleph`),G(`\\alefsym`,`\\aleph`),G(`\\Alpha`,`\\mathrm{A}`),G(`\\Beta`,`\\mathrm{B}`),G(`\\bull`,`\\bullet`),G(`\\Chi`,`\\mathrm{X}`),G(`\\clubs`,`\\clubsuit`),G(`\\cnums`,`\\mathbb{C}`),G(`\\Complex`,`\\mathbb{C}`),G(`\\Dagger`,`\\ddagger`),G(`\\diamonds`,`\\diamondsuit`),G(`\\empty`,`\\emptyset`),G(`\\Epsilon`,`\\mathrm{E}`),G(`\\Eta`,`\\mathrm{H}`),G(`\\exist`,`\\exists`),G(`\\harr`,`\\leftrightarrow`),G(`\\hArr`,`\\Leftrightarrow`),G(`\\Harr`,`\\Leftrightarrow`),G(`\\hearts`,`\\heartsuit`),G(`\\image`,`\\Im`),G(`\\infin`,`\\infty`),G(`\\Iota`,`\\mathrm{I}`),G(`\\isin`,`\\in`),G(`\\Kappa`,`\\mathrm{K}`),G(`\\larr`,`\\leftarrow`),G(`\\lArr`,`\\Leftarrow`),G(`\\Larr`,`\\Leftarrow`),G(`\\lrarr`,`\\leftrightarrow`),G(`\\lrArr`,`\\Leftrightarrow`),G(`\\Lrarr`,`\\Leftrightarrow`),G(`\\Mu`,`\\mathrm{M}`),G(`\\natnums`,`\\mathbb{N}`),G(`\\Nu`,`\\mathrm{N}`),G(`\\Omicron`,`\\mathrm{O}`),G(`\\plusmn`,`\\pm`),G(`\\rarr`,`\\rightarrow`),G(`\\rArr`,`\\Rightarrow`),G(`\\Rarr`,`\\Rightarrow`),G(`\\real`,`\\Re`),G(`\\reals`,`\\mathbb{R}`),G(`\\Reals`,`\\mathbb{R}`),G(`\\Rho`,`\\mathrm{P}`),G(`\\sdot`,`\\cdot`),G(`\\sect`,`\\S`),G(`\\spades`,`\\spadesuit`),G(`\\sub`,`\\subset`),G(`\\sube`,`\\subseteq`),G(`\\supe`,`\\supseteq`),G(`\\Tau`,`\\mathrm{T}`),G(`\\thetasym`,`\\vartheta`),G(`\\weierp`,`\\wp`),G(`\\Zeta`,`\\mathrm{Z}`),G(`\\argmin`,`\\DOTSB\\operatorname*{arg\\,min}`),G(`\\argmax`,`\\DOTSB\\operatorname*{arg\\,max}`),G(`\\plim`,`\\DOTSB\\mathop{\\operatorname{plim}}\\limits`),G(`\\bra`,`\\mathinner{\\langle{#1}|}`),G(`\\ket`,`\\mathinner{|{#1}\\rangle}`),G(`\\braket`,`\\mathinner{\\langle{#1}\\rangle}`),G(`\\Bra`,`\\left\\langle#1\\right|`),G(`\\Ket`,`\\left|#1\\right\\rangle`),Oo=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get(`|`),s=t.macros.get(`\\|`);t.macros.beginGroup();var l=t=>n=>{e&&(n.macros.set(`|`,o),i.length&&n.macros.set(`\\|`,s));var a=t;return!t&&i.length&&n.future().text===`|`&&(n.popToken(),a=!0),{tokens:a?i:r,numArgs:0}};t.macros.set(`|`,l(!1)),i.length&&t.macros.set(`\\|`,l(!0));var u=t.consumeArg().tokens,d=t.expandTokens([...a,...u,...n]);return t.macros.endGroup(),{tokens:d.reverse(),numArgs:0}},G(`\\bra@ket`,Oo(!1)),G(`\\bra@set`,Oo(!0)),G(`\\Braket`,`\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}`),G(`\\Set`,`\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}`),G(`\\set`,`\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}`),G(`\\angln`,`{\\angl n}`),G(`\\blue`,`\\textcolor{##6495ed}{#1}`),G(`\\orange`,`\\textcolor{##ffa500}{#1}`),G(`\\pink`,`\\textcolor{##ff00af}{#1}`),G(`\\red`,`\\textcolor{##df0030}{#1}`),G(`\\green`,`\\textcolor{##28ae7b}{#1}`),G(`\\gray`,`\\textcolor{gray}{#1}`),G(`\\purple`,`\\textcolor{##9d38bd}{#1}`),G(`\\blueA`,`\\textcolor{##ccfaff}{#1}`),G(`\\blueB`,`\\textcolor{##80f6ff}{#1}`),G(`\\blueC`,`\\textcolor{##63d9ea}{#1}`),G(`\\blueD`,`\\textcolor{##11accd}{#1}`),G(`\\blueE`,`\\textcolor{##0c7f99}{#1}`),G(`\\tealA`,`\\textcolor{##94fff5}{#1}`),G(`\\tealB`,`\\textcolor{##26edd5}{#1}`),G(`\\tealC`,`\\textcolor{##01d1c1}{#1}`),G(`\\tealD`,`\\textcolor{##01a995}{#1}`),G(`\\tealE`,`\\textcolor{##208170}{#1}`),G(`\\greenA`,`\\textcolor{##b6ffb0}{#1}`),G(`\\greenB`,`\\textcolor{##8af281}{#1}`),G(`\\greenC`,`\\textcolor{##74cf70}{#1}`),G(`\\greenD`,`\\textcolor{##1fab54}{#1}`),G(`\\greenE`,`\\textcolor{##0d923f}{#1}`),G(`\\goldA`,`\\textcolor{##ffd0a9}{#1}`),G(`\\goldB`,`\\textcolor{##ffbb71}{#1}`),G(`\\goldC`,`\\textcolor{##ff9c39}{#1}`),G(`\\goldD`,`\\textcolor{##e07d10}{#1}`),G(`\\goldE`,`\\textcolor{##a75a05}{#1}`),G(`\\redA`,`\\textcolor{##fca9a9}{#1}`),G(`\\redB`,`\\textcolor{##ff8482}{#1}`),G(`\\redC`,`\\textcolor{##f9685d}{#1}`),G(`\\redD`,`\\textcolor{##e84d39}{#1}`),G(`\\redE`,`\\textcolor{##bc2612}{#1}`),G(`\\maroonA`,`\\textcolor{##ffbde0}{#1}`),G(`\\maroonB`,`\\textcolor{##ff92c6}{#1}`),G(`\\maroonC`,`\\textcolor{##ed5fa6}{#1}`),G(`\\maroonD`,`\\textcolor{##ca337c}{#1}`),G(`\\maroonE`,`\\textcolor{##9e034e}{#1}`),G(`\\purpleA`,`\\textcolor{##ddd7ff}{#1}`),G(`\\purpleB`,`\\textcolor{##c6b9fc}{#1}`),G(`\\purpleC`,`\\textcolor{##aa87ff}{#1}`),G(`\\purpleD`,`\\textcolor{##7854ab}{#1}`),G(`\\purpleE`,`\\textcolor{##543b78}{#1}`),G(`\\mintA`,`\\textcolor{##f5f9e8}{#1}`),G(`\\mintB`,`\\textcolor{##edf2df}{#1}`),G(`\\mintC`,`\\textcolor{##e0e5cc}{#1}`),G(`\\grayA`,`\\textcolor{##f6f7f7}{#1}`),G(`\\grayB`,`\\textcolor{##f0f1f2}{#1}`),G(`\\grayC`,`\\textcolor{##e3e5e6}{#1}`),G(`\\grayD`,`\\textcolor{##d6d8da}{#1}`),G(`\\grayE`,`\\textcolor{##babec2}{#1}`),G(`\\grayF`,`\\textcolor{##888d93}{#1}`),G(`\\grayG`,`\\textcolor{##626569}{#1}`),G(`\\grayH`,`\\textcolor{##3b3e40}{#1}`),G(`\\grayI`,`\\textcolor{##21242c}{#1}`),G(`\\kaBlue`,`\\textcolor{##314453}{#1}`),G(`\\kaGreen`,`\\textcolor{##71B307}{#1}`),ko={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},Ao=class{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new bo(xo,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new yo(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),this.future().text!==`[`)return null;t=this.popToken(),{tokens:r,end:n}=this.consumeArg([`]`])}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new za(`EOF`,n.loc)),this.pushTokens(r),new za(``,Ra.range(t,n))}consumeSpaces(){for(;this.future().text===` `;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text===`{`)++a;else if(i.text===`}`){if(--a,a===-1)throw new En(`Extra }`,i)}else if(i.text===`EOF`)throw new En(`Unexpected end of input in a macro argument, expected '`+(e&&n?e[o]:`}`)+`'`,i);if(e&&n){if((a===0||a===1&&e[o]===`{`)&&i.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}}while(a!==0||n);return r.text===`{`&&t[t.length-1].text===`}`&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new En(`The length of delimiters doesn't match the number of args!`);for(var n=t[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new En(`Use of the macro doesn't match its definition`,i)}}for(var a=[],o=0;o<e;o++)a.push(this.consumeArg(t&&t[o+1]).tokens);return a}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new En(`Too many expansions: infinite loop or need to increase maxExpand setting`)}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(r==null||e&&r.unexpandable){if(e&&r==null&&n[0]===`\\`&&!this.isDefined(n))throw new En(`Undefined control sequence: `+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var s=i[o];if(s.text===`#`){if(o===0)throw new En(`Incomplete placeholder at end of macro body`,s);if(s=i[--o],s.text===`#`)i.splice(o+1,1);else if(/^[1-9]$/.test(s.text))i.splice(o,2,...a[s.text-1]);else throw new En(`Not a valid argument number`,s)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text=`\\relax`),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new za(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var r=this.stack.pop();r.treatAsRelax&&=(r.noexpand=!1,!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(e=>e.text).join(``)}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var r=typeof t==`function`?t(this):t;if(typeof r==`string`){var i=0;if(r.includes(`#`))for(var a=r.replace(/##/g,``);a.includes(`#`+(i+1));)++i;for(var o=new yo(r,this.settings),s=[],l=o.lex();l.text!==`EOF`;)s.push(l),l=o.lex();return s.reverse(),{tokens:s,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||go.hasOwnProperty(e)||hr.math.hasOwnProperty(e)||hr.text.hasOwnProperty(e)||ko.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t==null?go.hasOwnProperty(e)&&!go[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},jo=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Mo=Object.freeze({"₊":`+`,"₋":`-`,"₌":`=`,"₍":`(`,"₎":`)`,"₀":`0`,"₁":`1`,"₂":`2`,"₃":`3`,"₄":`4`,"₅":`5`,"₆":`6`,"₇":`7`,"₈":`8`,"₉":`9`,ₐ:`a`,ₑ:`e`,ₕ:`h`,ᵢ:`i`,ⱼ:`j`,ₖ:`k`,ₗ:`l`,ₘ:`m`,ₙ:`n`,ₒ:`o`,ₚ:`p`,ᵣ:`r`,ₛ:`s`,ₜ:`t`,ᵤ:`u`,ᵥ:`v`,ₓ:`x`,ᵦ:`β`,ᵧ:`γ`,ᵨ:`ρ`,ᵩ:`ϕ`,ᵪ:`χ`,"⁺":`+`,"⁻":`-`,"⁼":`=`,"⁽":`(`,"⁾":`)`,"⁰":`0`,"¹":`1`,"²":`2`,"³":`3`,"⁴":`4`,"⁵":`5`,"⁶":`6`,"⁷":`7`,"⁸":`8`,"⁹":`9`,ᴬ:`A`,ᴮ:`B`,ᴰ:`D`,ᴱ:`E`,ᴳ:`G`,ᴴ:`H`,ᴵ:`I`,ᴶ:`J`,ᴷ:`K`,ᴸ:`L`,ᴹ:`M`,ᴺ:`N`,ᴼ:`O`,ᴾ:`P`,ᴿ:`R`,ᵀ:`T`,ᵁ:`U`,ⱽ:`V`,ᵂ:`W`,ᵃ:`a`,ᵇ:`b`,ᶜ:`c`,ᵈ:`d`,ᵉ:`e`,ᶠ:`f`,ᵍ:`g`,ʰ:`h`,ⁱ:`i`,ʲ:`j`,ᵏ:`k`,ˡ:`l`,ᵐ:`m`,ⁿ:`n`,ᵒ:`o`,ᵖ:`p`,ʳ:`r`,ˢ:`s`,ᵗ:`t`,ᵘ:`u`,ᵛ:`v`,ʷ:`w`,ˣ:`x`,ʸ:`y`,ᶻ:`z`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),No={"́":{text:`\\'`,math:`\\acute`},"̀":{text:"\\`",math:`\\grave`},"̈":{text:`\\"`,math:`\\ddot`},"̃":{text:`\\~`,math:`\\tilde`},"̄":{text:`\\=`,math:`\\bar`},"̆":{text:`\\u`,math:`\\breve`},"̌":{text:`\\v`,math:`\\check`},"̂":{text:`\\^`,math:`\\hat`},"̇":{text:`\\.`,math:`\\dot`},"̊":{text:`\\r`,math:`\\mathring`},"̋":{text:`\\H`},"̧":{text:`\\c`}},Po={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,ḉ:`ḉ`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ç:`ç`,ď:`ď`,ḋ:`ḋ`,ḑ:`ḑ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ḝ:`ḝ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ȩ:`ȩ`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ģ:`ģ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,ḩ:`ḩ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ķ:`ķ`,ĺ:`ĺ`,ľ:`ľ`,ļ:`ļ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ņ:`ņ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ŗ:`ŗ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ş:`ş`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ţ:`ţ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Ḉ:`Ḉ`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ç:`Ç`,Ď:`Ď`,Ḋ:`Ḋ`,Ḑ:`Ḑ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ḝ:`Ḝ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ȩ:`Ȩ`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ģ:`Ģ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Ḩ:`Ḩ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ķ:`Ķ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ļ:`Ļ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ņ:`Ņ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ŗ:`Ŗ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ş:`Ş`,Ť:`Ť`,Ṫ:`Ṫ`,Ţ:`Ţ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},Fo=class e{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode=`math`,this.gullet=new Ao(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new En(`Expected '`+e+`', got '`+this.fetch().text+`'`,this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken??=this.gullet.expandNextToken(),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set(`\\color`,`\\textcolor`);try{var e=this.parseExpression(!1);return this.expect(`EOF`),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new za(`}`)),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect(`}`),this.nextToken=t,n}parseExpression(t,n){for(var r=[];;){this.mode===`math`&&this.consumeSpaces();var i=this.fetch();if(e.endOfExpression.has(i.text)||n&&i.text===n||t&&go[i.text]&&go[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;a.type!==`internal`&&r.push(a)}return this.mode===`text`&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t=-1,n,r=0;r<e.length;r++){var i=e[r];if(i.type===`infix`){if(t!==-1)throw new En(`only one infix operator per group`,i.token);t=r,n=i.replaceWith}}if(t!==-1&&n){var a,o,s=e.slice(0,t),l=e.slice(t+1);return a=s.length===1&&s[0].type===`ordgroup`?s[0]:{type:`ordgroup`,mode:this.mode,body:s},o=l.length===1&&l[0].type===`ordgroup`?l[0]:{type:`ordgroup`,mode:this.mode,body:l},[n===`\\\\abovefrac`?this.callFunction(n,[a,e[t],o],[]):this.callFunction(n,[a,o],[])]}return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var r;do r=this.parseGroup(e);while(r?.type===`internal`);if(!r)throw new En(`Expected group after '`+n+`'`,t);return r}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:`textord`,mode:`text`,text:e[n]});var r={type:`text`,mode:this.mode,body:t};return{type:`color`,mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t=this.parseGroup(`atom`,e);if(t?.type===`internal`||this.mode===`text`)return t;for(var n,r;;){this.consumeSpaces();var i=this.fetch();if(i.text===`\\limits`||i.text===`\\nolimits`){if(t&&t.type===`op`)t.limits=i.text===`\\limits`,t.alwaysHandleSupSub=!0;else if(t&&t.type===`operatorname`)t.alwaysHandleSupSub&&(t.limits=i.text===`\\limits`);else throw new En(`Limit controls must follow a math operator`,i);this.consume()}else if(i.text===`^`){if(n)throw new En(`Double superscript`,i);n=this.handleSupSubscript(`superscript`)}else if(i.text===`_`){if(r)throw new En(`Double subscript`,i);r=this.handleSupSubscript(`subscript`)}else if(i.text===`'`){if(n)throw new En(`Double superscript`,i);var a={type:`textord`,mode:this.mode,text:`\\prime`},o=[a];for(this.consume();this.fetch().text===`'`;)o.push(a),this.consume();this.fetch().text===`^`&&o.push(this.handleSupSubscript(`superscript`)),n={type:`ordgroup`,mode:this.mode,body:o}}else if(Mo[i.text]){var s=jo.test(i.text),l=[];for(l.push(new za(Mo[i.text])),this.consume();;){var u=this.fetch().text;if(!Mo[u]||jo.test(u)!==s)break;l.unshift(new za(Mo[u])),this.consume()}var d=this.subparse(l);s?r={type:`ordgroup`,mode:`math`,body:d}:n={type:`ordgroup`,mode:`math`,body:d}}else break}return n||r?{type:`supsub`,mode:this.mode,base:t,sup:n,sub:r}:t}parseFunction(e,t){var n=this.fetch(),r=n.text,i=go[r];if(!i)return null;if(this.consume(),t&&t!==`atom`&&!i.allowedInArgument)throw new En(`Got function '`+r+`' with no arguments`+(t?` as `+t:``),n);if(this.mode===`text`&&!i.allowedInText)throw new En(`Can't use function '`+r+`' in text mode`,n);if(this.mode===`math`&&i.allowedInMath===!1)throw new En(`Can't use function '`+r+`' in math mode`,n);var{args:a,optArgs:o}=this.parseArguments(r,i);return this.callFunction(r,a,o,n,e)}callFunction(e,t,n,r,i){var a={funcName:e,parser:this,token:r,breakOnTokenText:i},o=go[e];if(o&&o.handler)return o.handler(a,t,n);throw new En(`No function handler for `+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(n===0)return{args:[],optArgs:[]};for(var r=[],i=[],a=0;a<n;a++){var o=t.argTypes&&t.argTypes[a],s=a<t.numOptionalArgs;(`primitive`in t&&t.primitive&&o==null||t.type===`sqrt`&&a===1&&i[0]==null)&&(o=`primitive`);var l=this.parseGroupOfType(`argument to '`+e+`'`,o,s);if(s)i.push(l);else if(l!=null)r.push(l);else throw new En(`Null argument, please report this as a bug`)}return{args:r,optArgs:i}}parseGroupOfType(e,t,n){switch(t){case`color`:return this.parseColorGroup(n);case`size`:return this.parseSizeGroup(n);case`url`:return this.parseUrlGroup(n);case`math`:case`text`:return this.parseArgumentGroup(n,t);case`hbox`:var r=this.parseArgumentGroup(n,`text`);return r==null?null:{type:`styling`,mode:r.mode,body:[r],style:`text`,resetFont:!0};case`raw`:var i=this.parseStringGroup(`raw`,n);return i==null?null:{type:`raw`,mode:`text`,string:i.text};case`primitive`:if(n)throw new En(`A primitive argument cannot be optional`);var a=this.parseGroup(e);if(a==null)throw new En(`Expected group as `+e,this.fetch());return a;case`original`:case null:case void 0:return this.parseArgumentGroup(n);default:throw new En(`Unknown group type as `+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===` `;)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(n==null)return null;for(var r=``,i;(i=this.fetch()).text!==`EOF`;)r+=i.text,this.consume();return this.consume(),n.text=r,n}parseRegexGroup(e,t){for(var n=this.fetch(),r=n,i=``,a;(a=this.fetch()).text!==`EOF`&&e.test(i+a.text);)r=a,i+=r.text,this.consume();if(i===``)throw new En(`Invalid `+t+`: '`+n.text+`'`,n);return n.range(r,i)}parseColorGroup(e){var t=this.parseStringGroup(`color`,e);if(t==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new En(`Invalid color: '`+t.text+`'`,t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r=`#`+r),{type:`color-token`,mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),t=!e&&this.gullet.future().text!==`{`?this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,`size`):this.parseStringGroup(`size`,e),!t)return null;!e&&t.text.length===0&&(t.text=`0pt`,n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new En(`Invalid size: '`+t.text+`'`,t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!Xn(i))throw new En(`Invalid unit: '`+i.unit+`'`,t);return{type:`size`,mode:this.mode,value:i,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode(`%`,13),this.gullet.lexer.setCatcode(`~`,12);var t=this.parseStringGroup(`url`,e);if(this.gullet.lexer.setCatcode(`%`,14),this.gullet.lexer.setCatcode(`~`,13),t==null)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,`$1`);return{type:`url`,mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,`EOF`);this.expect(`EOF`),this.gullet.endGroup();var a={type:`ordgroup`,mode:this.mode,loc:n.loc,body:i};return t&&this.switchMode(r),a}parseGroup(e,t){var n=this.fetch(),r=n.text,i;if(r===`{`||r===`\\begingroup`){this.consume();var a=r===`{`?`}`:`\\endgroup`;this.gullet.beginGroup();var o=this.parseExpression(!1,a),s=this.fetch();this.expect(a),this.gullet.endGroup(),i={type:`ordgroup`,mode:this.mode,loc:Ra.range(n,s),body:o,semisimple:r===`\\begingroup`||void 0}}else if(i=this.parseFunction(t,e)||this.parseSymbol(),i==null&&r[0]===`\\`&&!ko.hasOwnProperty(r)){if(this.settings.throwOnError)throw new En(`Undefined control sequence: `+r,n);i=this.formatUnsupportedCmd(r),this.consume()}return i}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n];if(r.type===`textord`){var i=r.text,a=e[n+1];if(!(!a||a.type!==`textord`)){if(i===`-`&&a.text===`-`){var o=e[n+2];n+1<t&&o&&o.type===`textord`&&o.text===`-`?(e.splice(n,3,{type:`textord`,mode:`text`,loc:Ra.range(r,o),text:`---`}),t-=2):(e.splice(n,2,{type:`textord`,mode:`text`,loc:Ra.range(r,a),text:`--`}),--t)}(i===`'`||i==="`")&&a.text===i&&(e.splice(n,2,{type:`textord`,mode:`text`,loc:Ra.range(r,a),text:i+i}),--t)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r=n.charAt(0)===`*`;if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new En(`\\verb assertion failed --259+ please report what input caused this bug`);return n=n.slice(1,-1),{type:`verb`,mode:`text`,body:n,star:r}}Po.hasOwnProperty(t[0])&&!hr[this.mode][t[0]]&&(this.settings.strict&&this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Accented Unicode text character "`+t[0]+`" used in math mode`,e),t=Po[t[0]]+t.slice(1));var i=Vte.exec(t);i&&(t=t.substring(0,i.index),t===`i`?t=`ı`:t===`j`&&(t=`ȷ`));var a;if(hr[this.mode][t]){this.settings.strict&&this.mode===`math`&&Vr.includes(t)&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Latin-1/Unicode text character "`+t[0]+`" used in math mode`,e);var o=hr[this.mode][t].group,s=Ra.range(e);a=un(o)?{type:`atom`,mode:this.mode,family:o,loc:s,text:t}:{type:o,mode:this.mode,loc:s,text:t}}else if(t.charCodeAt(0)>=128)this.settings.strict&&(Zt(t.charCodeAt(0))?this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Unicode text character "`+t[0]+`" used in math mode`,e):this.settings.reportNonstrict(`unknownSymbol`,`Unrecognized Unicode character "`+t[0]+`"`+(` (`+t.charCodeAt(0)+`)`),e)),a={type:`textord`,mode:`text`,loc:Ra.range(e),text:t};else return null;if(this.consume(),i)for(var l=0;l<i[0].length;l++){var u=i[0][l];if(!No[u])throw new En(`Unknown accent ' `+u+`'`,e);var d=No[u][this.mode]||No[u].text;if(!d)throw new En(`Accent `+u+` unsupported in `+this.mode+` mode`,e);a={type:`accent`,mode:this.mode,loc:Ra.range(e),label:d,isStretchy:!1,isShifty:!0,base:a}}return a}},Fo.endOfExpression=new Set([`}`,`\\endgroup`,`\\end`,`\\right`,`&`]),Io=function(e,t){if(!(typeof e==`string`||e instanceof String))throw TypeError(`KaTeX can only parse string typed expression`);var n=new Fo(e,t);delete n.gullet.macros.current[`\\df@tag`];var r=n.parse();if(delete n.gullet.macros.current[`\\current@color`],delete n.gullet.macros.current[`\\color`],n.gullet.macros.get(`\\df@tag`)){if(!t.displayMode)throw new En(`\\tag works only in display equations`);r=[{type:`tag`,mode:`text`,body:r,tag:n.subparse([new za(`\\df@tag`)])}]}return r},Lo=function(e,t,n){t.textContent=``;var r=Vo(e,n).toNode();t.appendChild(r)},typeof document<`u`&&document.compatMode!==`CSS1Compat`&&(typeof console<`u`&&console.warn(`Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype.`),Lo=function(){throw new En(`KaTeX doesn't work in quirks mode.`)}),Ro=function(e,t){return Vo(e,t).toMarkup()},zo=function(e,t){return Io(e,new jn(t))},Bo=function(e,t,n){if(n.throwOnError||!(e instanceof En))throw e;var r=ci([`katex-error`],[new sr(t)]);return r.setAttribute(`title`,e.toString()),r.setAttribute(`style`,`color:`+n.errorColor),r},Vo=function(e,t){var n=new jn(t);try{return lte(Io(e,n),e,n)}catch(t){return Bo(t,e,n)}},Ho=function(e,t){var n=new jn(t);try{return ute(Io(e,n),e,n)}catch(t){return Bo(t,e,n)}},Uo=`0.16.47`,Wo={Span:ir,Anchor:ar,SymbolNode:sr,SvgNode:cr,PathNode:lr,LineNode:ur},Ute={version:Uo,render:Lo,renderToString:Ro,ParseError:En,SETTINGS_SCHEMA:An,__parse:zo,__renderToDomTree:Vo,__renderToHTMLTree:Ho,__setFontMetrics:en,__defineSymbol:W,__defineFunction:nn,__defineMacro:G,__domTree:Wo}}));function Gte(){let e=`data-temp-href-target`;Kt.addHook(`beforeSanitizeAttributes`,t=>{t.tagName===`A`&&t.hasAttribute(`target`)&&t.setAttribute(e,t.getAttribute(`target`)??``)}),Kt.addHook(`afterSanitizeAttributes`,t=>{t.tagName===`A`&&t.hasAttribute(e)&&(t.setAttribute(`target`,t.getAttribute(e)??``),t.removeAttribute(e),t.getAttribute(`target`)===`_blank`&&t.setAttribute(`rel`,`noopener`))})}function Go(e){return[...e.cssRules].map(e=>e.cssText).join(`260+`)}var Ko,qo,Jo,Yo,Xo,Kte,qte,Jte,Yte,Xte,Zo,Zte,Qte,$te,ene,tne,nne,rne,ine,ane,one,sne,cne,lne,une,dne,Qo,$o,es,ts,fne,ns,pne,mne,rs,is,as,os,ss,cs,ls,us,ds,hne,gne,_ne,fs,ps,ms,hs,vne,gs,yne,_s,vs,bne,ys,bs,xs,Ss,xne,Cs,ws,Ts,Es,Ds,Sne,Os,Cne,wne,ks,As,js,Tne,Ene,Dne,One,Ms,Ns,kne,Ane,Ps,Fs,jne,Mne,Is,Ls,Rs,zs,Nne,Bs,Vs,Pne,Fne,Hs,Us,Ws,Ine,Lne,Rne,Gs,Ks,qs,Js,Ys,Xs,Zs,Qs,$s,ec,tc,nc,rc,zne,Z,ic,ac,oc,sc,Bne,cc,lc,uc,Vne,dc=o((()=>{S(),h(),Ne(),qt(),Ko=p((e,t,{depth:n=2}={})=>{let r={depth:n};if(Array.isArray(t)&&!Array.isArray(e))return t.forEach(t=>Ko(e,t,r)),e;if(Array.isArray(t)&&Array.isArray(e))return t.forEach(t=>{e.includes(t)||e.push(t)}),e;if(e==null||n<=0)return typeof e==`object`&&e&&typeof t==`object`?Object.assign(e,t):t;if(t!=null&&typeof e==`object`&&typeof t==`object`){let r=e;Object.entries(t).forEach(([t,i])=>{if(typeof i==`object`){if(i===null)return;Object.hasOwn(e,t)||Object.defineProperty(e,t,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),r[t]===void 0&&(r[t]=Array.isArray(i)?[]:{}),typeof r[t]==`object`&&(r[t]=Ko(r[t],i,{depth:n-1}))}else typeof r[t]!=`object`&&(Object.hasOwn(e,t)?r[t]=i:Object.defineProperty(e,t,{value:i,writable:!0,enumerable:!0,configurable:!0}))})}return e},`assignWithDepth`),qo=Ko,Jo=`#ffffff`,Yo=`#f2f2f2`,Xo=p((e,t)=>t?H(e,{s:-40,l:10}):H(e,{s:-40,l:-10}),`mkBorder`),Kte=class{static{p(this,`Theme`)}constructor(){this.background=`#f4f4f4`,this.primaryColor=`#fff4dd`,this.noteBkgColor=`#fff5ad`,this.noteTextColor=`#333`,this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily=`"trebuchet ms", verdana, arial, sans-serif`,this.fontSize=`16px`,this.useGradient=!0,this.dropShadow=`drop-shadow( 1px 2px 2px rgba(185,185,185,1))`}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?`#eee`:`#333`),this.secondaryColor=this.secondaryColor||H(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||H(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Xo(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Xo(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Xo(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Xo(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||`#fff5ad`,this.noteTextColor=this.noteTextColor||`#333`,this.secondaryTextColor=this.secondaryTextColor||U(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||U(this.tertiaryColor),this.lineColor=this.lineColor||U(this.background),this.arrowheadColor=this.arrowheadColor||U(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?we(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||we(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||U(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||`white`,this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||`#eeeeee`,this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||V(this.primaryColor,23),this.gridColor=this.gridColor||`lightgrey`,this.doneTaskBkgColor=this.doneTaskBkgColor||`lightgrey`,this.doneTaskBorderColor=this.doneTaskBorderColor||`grey`,this.critBorderColor=this.critBorderColor||`#ff8888`,this.critBkgColor=this.critBkgColor||`red`,this.todayLineColor=this.todayLineColor||`red`,this.vertLineColor=this.vertLineColor||`navy`,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||`#003163`,this.noteFontWeight=this.noteFontWeight||`normal`,this.fontWeight=this.fontWeight||`normal`,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||we(this.mainBkg,5)||`#ffffff`,this.rowEven=this.rowEven||we(this.mainBkg,10)):(this.rowOdd=this.rowOdd||V(this.mainBkg,75)||`#ffffff`,this.rowEven=this.rowEven||V(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||H(this.primaryColor,{h:30}),this.cScale4=this.cScale4||H(this.primaryColor,{h:60}),this.cScale5=this.cScale5||H(this.primaryColor,{h:90}),this.cScale6=this.cScale6||H(this.primaryColor,{h:120}),this.cScale7=this.cScale7||H(this.primaryColor,{h:150}),this.cScale8=this.cScale8||H(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||H(this.primaryColor,{h:270}),this.cScale10=this.cScale10||H(this.primaryColor,{h:300}),this.cScale11=this.cScale11||H(this.primaryColor,{h:330}),this.darkMode)for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=we(this[`cScale`+e],75);else for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=we(this[`cScale`+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleInv`+e]=this[`cScaleInv`+e]||U(this[`cScale`+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this[`cScalePeer`+e]=this[`cScalePeer`+e]||V(this[`cScale`+e],10):this[`cScalePeer`+e]=this[`cScalePeer`+e]||we(this[`cScale`+e],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleLabel`+e]=this[`cScaleLabel`+e]||this.scaleLabelColor;let e=this.darkMode?-4:-1;for(let t=0;t<5;t++)this[`surface`+t]=this[`surface`+t]||H(this.mainBkg,{h:180,s:-15,l:e*(5+t*3)}),this[`surfacePeer`+t]=this[`surfacePeer`+t]||H(this.mainBkg,{h:180,s:-15,l:e*(8+t*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||H(this.primaryColor,{h:64}),this.fillType3=this.fillType3||H(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||H(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||H(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||H(this.primaryColor,{h:128}),this.fillType7=this.fillType7||H(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||H(this.primaryColor,{l:-10}),this.pie5=this.pie5||H(this.secondaryColor,{l:-10}),this.pie6=this.pie6||H(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||H(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||H(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||H(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||H(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||H(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||H(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||`25px`,this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||`17px`,this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||`17px`,this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||`black`,this.pieStrokeWidth=this.pieStrokeWidth||`2px`,this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||`2px`,this.pieOuterStrokeColor=this.pieOuterStrokeColor||`black`,this.pieOpacity=this.pieOpacity||`0.7`,this.venn1=this.venn1??H(this.primaryColor,{l:-30}),this.venn2=this.venn2??H(this.secondaryColor,{l:-30}),this.venn3=this.venn3??H(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??H(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??H(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??H(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??H(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??H(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||`#8B0000`,cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||`#E8F5E9`,complicatedBg:this.cynefin?.complicatedBg||`#E3F2FD`,chaoticBg:this.cynefin?.chaoticBg||`#FBE9E7`,clearBg:this.cynefin?.clearBg||`#FFF8E1`,confusionBg:this.cynefin?.confusionBg||`#F3E5F5`,textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||`#DEDEDE`,graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||`#dc3545`,this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.archEdgeColor=this.archEdgeColor||`#777`,this.archEdgeArrowColor=this.archEdgeArrowColor||`#777`,this.archEdgeWidth=this.archEdgeWidth||`3`,this.archGroupBorderColor=this.archGroupBorderColor||`#000`,this.archGroupBorderWidth=this.archGroupBorderWidth||`2px`,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||H(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||H(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||H(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||H(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||H(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||H(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ye(this.quadrant1Fill)?V(this.quadrant1Fill):we(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||`#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0`},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||`1`,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?we(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||H(this.primaryColor,{h:-30}),this.git4=this.git4||H(this.primaryColor,{h:-60}),this.git5=this.git5||H(this.primaryColor,{h:-90}),this.git6=this.git6||H(this.primaryColor,{h:60}),this.git7=this.git7||H(this.primaryColor,{h:120}),this.darkMode?(this.git0=V(this.git0,25),this.git1=V(this.git1,25),this.git2=V(this.git2,25),this.git3=V(this.git3,25),this.git4=V(this.git4,25),this.git5=V(this.git5,25),this.git6=V(this.git6,25),this.git7=V(this.git7,25)):(this.git0=we(this.git0,25),this.git1=we(this.git1,25),this.git2=we(this.git2,25),this.git3=we(this.git3,25),this.git4=we(this.git4,25),this.git5=we(this.git5,25),this.git6=we(this.git6,25),this.git7=we(this.git7,25)),this.gitInv0=this.gitInv0||U(this.git0),this.gitInv1=this.gitInv1||U(this.git1),this.gitInv2=this.gitInv2||U(this.git2),this.gitInv3=this.gitInv3||U(this.git3),this.gitInv4=this.gitInv4||U(this.git4),this.gitInv5=this.gitInv5||U(this.git5),this.gitInv6=this.gitInv6||U(this.git6),this.gitInv7=this.gitInv7||U(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?`black`:this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||`10px`,this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||`10px`,this.emUiFill=this.emUiFill||`white`,this.emUiStroke=this.emUiStroke||`#dbdada`,this.emProcessorFill=this.emProcessorFill||`#edb3f6`,this.emProcessorStroke=this.emProcessorStroke||`#b88cbf`,this.emReadModelFill=this.emReadModelFill||`#d3f1a2`,this.emReadModelStroke=this.emReadModelStroke||`#a3b732`,this.emCommandFill=this.emCommandFill||`#bcd6fe`,this.emCommandStroke=this.emCommandStroke||`#679ac3`,this.emEventFill=this.emEventFill||`#ffb778`,this.emEventStroke=this.emEventStroke||`#c19a0f`,this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||`rgb(250,250,250)`,this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||`rgb(240,240,240)`,this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Jo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Yo,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor}calculate(e){if(typeof e!=`object`){this.updateColors();return}let t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},qte=p(e=>{let t=new Kte;return t.calculate(e),t},`getThemeVariables`),Jte=class{static{p(this,`Theme`)}constructor(){this.background=`#333`,this.primaryColor=`#1f2020`,this.secondaryColor=V(this.primaryColor,16),this.tertiaryColor=H(this.primaryColor,{h:-160}),this.primaryBorderColor=U(this.background),this.secondaryBorderColor=Xo(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Xo(this.tertiaryColor,this.darkMode),this.primaryTextColor=U(this.primaryColor),this.secondaryTextColor=U(this.secondaryColor),this.tertiaryTextColor=U(this.tertiaryColor),this.lineColor=U(this.background),this.textColor=U(this.background),this.mainBkg=`#1f2020`,this.secondBkg=`calculated`,this.mainContrastColor=`lightgrey`,this.darkTextColor=V(U(`#323D47`),10),this.lineColor=`calculated`,this.border1=`#ccc`,this.border2=de(255,255,255,.25),this.arrowheadColor=`calculated`,this.fontFamily=`"trebuchet ms", verdana, arial, sans-serif`,this.fontSize=`16px`,this.labelBackground=`#181818`,this.textColor=`#ccc`,this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg=`calculated`,this.nodeBorder=`calculated`,this.clusterBkg=`calculated`,this.clusterBorder=`calculated`,this.defaultLinkColor=`calculated`,this.titleColor=`#F9FFFE`,this.edgeLabelBackground=`calculated`,this.actorBorder=`calculated`,this.actorBkg=`calculated`,this.actorTextColor=`calculated`,this.actorLineColor=`calculated`,this.signalColor=`calculated`,this.signalTextColor=`calculated`,this.labelBoxBkgColor=`calculated`,this.labelBoxBorderColor=`calculated`,this.labelTextColor=`calculated`,this.loopTextColor=`calculated`,this.noteBorderColor=`calculated`,this.noteBkgColor=`#fff5ad`,this.noteTextColor=`calculated`,this.activationBorderColor=`calculated`,this.activationBkgColor=`calculated`,this.sequenceNumberColor=`black`,this.clusterBkg=`#302F3D`,this.sectionBkgColor=we(`#EAE8D9`,30),this.altSectionBkgColor=`calculated`,this.sectionBkgColor2=`#EAE8D9`,this.excludeBkgColor=we(this.sectionBkgColor,10),this.taskBorderColor=de(255,255,255,70),this.taskBkgColor=`calculated`,this.taskTextColor=`calculated`,this.taskTextLightColor=`calculated`,this.taskTextOutsideColor=`calculated`,this.taskTextClickableColor=`#003163`,this.activeTaskBorderColor=de(255,255,255,50),this.activeTaskBkgColor=`#81B1DB`,this.gridColor=`calculated`,this.doneTaskBkgColor=`calculated`,this.doneTaskBorderColor=`grey`,this.critBorderColor=`#E83737`,this.critBkgColor=`#E83737`,this.taskTextDarkColor=`calculated`,this.todayLineColor=`#DB5757`,this.vertLineColor=`#00BFFF`,this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor=`calculated`,this.archEdgeArrowColor=`calculated`,this.archEdgeWidth=`3`,this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth=`2px`,this.rowOdd=this.rowOdd||V(this.mainBkg,5)||`#ffffff`,this.rowEven=this.rowEven||we(this.mainBkg,10),this.labelColor=`calculated`,this.errorBkgColor=`#a44141`,this.errorTextColor=`#ddd`,this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow=`drop-shadow( 1px 2px 2px rgba(185,185,185,1))`,this.noteFontWeight=this.noteFontWeight||`normal`,this.fontWeight=this.fontWeight||`normal`}updateColors(){this.secondBkg=V(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=V(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=V(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=U(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||`#555`,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=`#f4f4f4`,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=H(this.primaryColor,{h:64}),this.fillType3=H(this.secondaryColor,{h:64}),this.fillType4=H(this.primaryColor,{h:-64}),this.fillType5=H(this.secondaryColor,{h:-64}),this.fillType6=H(this.primaryColor,{h:128}),this.fillType7=H(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||`#0b0000`,this.cScale2=this.cScale2||`#4d1037`,this.cScale3=this.cScale3||`#3f5258`,this.cScale4=this.cScale4||`#4f2f1b`,this.cScale5=this.cScale5||`#6e0a0a`,this.cScale6=this.cScale6||`#3b0048`,this.cScale7=this.cScale7||`#995a01`,this.cScale8=this.cScale8||`#154706`,this.cScale9=this.cScale9||`#161722`,this.cScale10=this.cScale10||`#00296f`,this.cScale11=this.cScale11||`#01629c`,this.cScale12=this.cScale12||`#010029`,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||H(this.primaryColor,{h:30}),this.cScale4=this.cScale4||H(this.primaryColor,{h:60}),this.cScale5=this.cScale5||H(this.primaryColor,{h:90}),this.cScale6=this.cScale6||H(this.primaryColor,{h:120}),this.cScale7=this.cScale7||H(this.primaryColor,{h:150}),this.cScale8=this.cScale8||H(this.primaryColor,{h:210}),this.cScale9=this.cScale9||H(this.primaryColor,{h:270}),this.cScale10=this.cScale10||H(this.primaryColor,{h:300}),this.cScale11=this.cScale11||H(this.primaryColor,{h:330});for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleInv`+e]=this[`cScaleInv`+e]||U(this[`cScale`+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScalePeer`+e]=this[`cScalePeer`+e]||V(this[`cScale`+e],10);for(let e=0;e<5;e++)this[`surface`+e]=this[`surface`+e]||H(this.mainBkg,{h:30,s:-30,l:-(-10+e*4)}),this[`surfacePeer`+e]=this[`surfacePeer`+e]||H(this.mainBkg,{h:30,s:-30,l:-(-7+e*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?`black`:this.labelTextColor);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleLabel`+e]=this[`cScaleLabel`+e]||this.scaleLabelColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`pie`+e]=this[`cScale`+e];this.pieTitleTextSize=this.pieTitleTextSize||`25px`,this.pieTitleTextColor=this.pieTitleTextColor||this.mainContrastColor,this.pieSectionTextSize=this.pieSectionTextSize||`17px`,this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||`17px`,this.pieLegendTextColor=this.pieLegendTextColor||this.mainContrastColor,this.pieStrokeColor=this.pieStrokeColor||`black`,this.pieStrokeWidth=this.pieStrokeWidth||`2px`,this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||`2px`,this.pieOuterStrokeColor=this.pieOuterStrokeColor||`black`,this.pieOpacity=this.pieOpacity||`0.7`;for(let e=0;e<8;e++)this[`venn`+(e+1)]=this[`venn`+(e+1)]??V(this[`cScale`+e],30);this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||`#FF6B6B`,cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||`#1B5E20`,complicatedBg:this.cynefin?.complicatedBg||`#0D47A1`,chaoticBg:this.cynefin?.chaoticBg||`#BF360C`,clearBg:this.cynefin?.clearBg||`#F57F17`,confusionBg:this.cynefin?.confusionBg||`#4A148C`,textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||H(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||H(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||H(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||H(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||H(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||H(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ye(this.quadrant1Fill)?V(this.quadrant1Fill):we(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||`#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22`},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||`#DEDEDE`,graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||`#ff6b6b`,this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.mainBkg,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.mainBkg},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||`1`,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?we(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=V(this.secondaryColor,20),this.git1=V(this.pie2||this.secondaryColor,20),this.git2=V(this.pie3||this.tertiaryColor,20),this.git3=V(this.pie4||H(this.primaryColor,{h:-30}),20),this.git4=V(this.pie5||H(this.primaryColor,{h:-60}),20),this.git5=V(this.pie6||H(this.primaryColor,{h:-90}),10),this.git6=V(this.pie7||H(this.primaryColor,{h:60}),10),this.git7=V(this.pie8||H(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||U(this.git0),this.gitInv1=this.gitInv1||U(this.git1),this.gitInv2=this.gitInv2||U(this.git2),this.gitInv3=this.gitInv3||U(this.git3),this.gitInv4=this.gitInv4||U(this.git4),this.gitInv5=this.gitInv5||U(this.git5),this.gitInv6=this.gitInv6||U(this.git6),this.gitInv7=this.gitInv7||U(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||U(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||U(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||`10px`,this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||`10px`,this.emUiFill=this.emUiFill||`#2d2d2d`,this.emUiStroke=this.emUiStroke||`#555`,this.emProcessorFill=this.emProcessorFill||V(`#5a3d5c`,10),this.emProcessorStroke=this.emProcessorStroke||`#8a6d8c`,this.emReadModelFill=this.emReadModelFill||V(`#3d5a2d`,10),this.emReadModelStroke=this.emReadModelStroke||`#6d8c5c`,this.emCommandFill=this.emCommandFill||V(`#2d3d5a`,10),this.emCommandStroke=this.emCommandStroke||`#5c6d8c`,this.emEventFill=this.emEventFill||V(`#5a452d`,10),this.emEventStroke=this.emEventStroke||`#8c755c`,this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||V(this.background,5),this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||V(this.background,12),this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||V(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||V(this.background,2),this.nodeBorder=this.nodeBorder||`#999`}calculate(e){if(typeof e!=`object`){this.updateColors();return}let t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},Yte=p(e=>{let t=new Jte;return t.calculate(e),t},`getThemeVariables`),Xte=class{static{p(this,`Theme`)}constructor(){this.background=`#f4f4f4`,this.primaryColor=`#ECECFF`,this.secondaryColor=H(this.primaryColor,{h:120}),this.secondaryColor=`#ffffde`,this.tertiaryColor=H(this.primaryColor,{h:-160}),this.primaryBorderColor=Xo(this.primaryColor,this.darkMode),this.secondaryBorderColor=Xo(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Xo(this.tertiaryColor,this.darkMode),this.primaryTextColor=U(this.primaryColor),this.secondaryTextColor=U(this.secondaryColor),this.tertiaryTextColor=U(this.tertiaryColor),this.lineColor=U(this.background),this.textColor=U(this.background),this.background=`white`,this.mainBkg=`#ECECFF`,this.secondBkg=`#ffffde`,this.lineColor=`#333333`,this.border1=`#9370DB`,this.primaryBorderColor=Xo(this.primaryColor,this.darkMode),this.border2=`#aaaa33`,this.arrowheadColor=`#333333`,this.fontFamily=`"trebuchet ms", verdana, arial, sans-serif`,this.fontSize=`16px`,this.labelBackground=`rgba(232,232,232, 0.8)`,this.textColor=`#333`,this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg=`calculated`,this.nodeBorder=`calculated`,this.clusterBkg=`calculated`,this.clusterBorder=`calculated`,this.defaultLinkColor=`calculated`,this.titleColor=`calculated`,this.edgeLabelBackground=`calculated`,this.actorBorder=`calculated`,this.actorBkg=`calculated`,this.actorTextColor=`black`,this.actorLineColor=`calculated`,this.signalColor=`calculated`,this.signalTextColor=`calculated`,this.labelBoxBkgColor=`calculated`,this.labelBoxBorderColor=`calculated`,this.labelTextColor=`calculated`,this.loopTextColor=`calculated`,this.noteBorderColor=`calculated`,this.noteBkgColor=`#fff5ad`,this.noteTextColor=`calculated`,this.activationBorderColor=`#666`,this.activationBkgColor=`#f4f4f4`,this.sequenceNumberColor=`white`,this.clusterBkg=`#FBFBFF`,this.sectionBkgColor=`calculated`,this.altSectionBkgColor=`calculated`,this.sectionBkgColor2=`calculated`,this.excludeBkgColor=`#eeeeee`,this.taskBorderColor=`calculated`,this.taskBkgColor=`calculated`,this.taskTextLightColor=`calculated`,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=`calculated`,this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor=`calculated`,this.activeTaskBorderColor=`calculated`,this.activeTaskBkgColor=`calculated`,this.gridColor=`calculated`,this.doneTaskBkgColor=`calculated`,this.doneTaskBorderColor=`calculated`,this.critBorderColor=`calculated`,this.critBkgColor=`calculated`,this.todayLineColor=`calculated`,this.vertLineColor=`calculated`,this.sectionBkgColor=de(102,102,255,.49),this.altSectionBkgColor=`white`,this.sectionBkgColor2=`#fff400`,this.taskBorderColor=`#534fbc`,this.taskBkgColor=`#8a90dd`,this.taskTextLightColor=`white`,this.taskTextColor=`calculated`,this.taskTextDarkColor=`black`,this.taskTextOutsideColor=`calculated`,this.taskTextClickableColor=`#003163`,this.activeTaskBorderColor=`#534fbc`,this.activeTaskBkgColor=`#bfc7ff`,this.gridColor=`lightgrey`,this.doneTaskBkgColor=`lightgrey`,this.doneTaskBorderColor=`grey`,this.critBorderColor=`#ff8888`,this.critBkgColor=`red`,this.todayLineColor=`red`,this.vertLineColor=`navy`,this.noteFontWeight=this.noteFontWeight||`normal`,this.fontWeight=this.fontWeight||`normal`,this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor=`calculated`,this.archEdgeArrowColor=`calculated`,this.archEdgeWidth=`3`,this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth=`2px`,this.rowOdd=`calculated`,this.rowEven=`calculated`,this.labelColor=`black`,this.errorBkgColor=`#552222`,this.errorTextColor=`#552222`,this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow=`drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))`,this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||H(this.primaryColor,{h:30}),this.cScale4=this.cScale4||H(this.primaryColor,{h:60}),this.cScale5=this.cScale5||H(this.primaryColor,{h:90}),this.cScale6=this.cScale6||H(this.primaryColor,{h:120}),this.cScale7=this.cScale7||H(this.primaryColor,{h:150}),this.cScale8=this.cScale8||H(this.primaryColor,{h:210}),this.cScale9=this.cScale9||H(this.primaryColor,{h:270}),this.cScale10=this.cScale10||H(this.primaryColor,{h:300}),this.cScale11=this.cScale11||H(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||we(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||we(this.tertiaryColor,40);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=we(this[`cScale`+e],10),this[`cScalePeer`+e]=this[`cScalePeer`+e]||we(this[`cScale`+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleInv`+e]=this[`cScaleInv`+e]||H(this[`cScale`+e],{h:180});for(let e=0;e<5;e++)this[`surface`+e]=this[`surface`+e]||H(this.mainBkg,{h:30,l:-(5+e*5)}),this[`surfacePeer`+e]=this[`surfacePeer`+e]||H(this.mainBkg,{h:30,l:-(7+e*5)});if(this.scaleLabelColor=this.scaleLabelColor!==`calculated`&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!==`calculated`){this.cScaleLabel0=this.cScaleLabel0||U(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||U(this.labelTextColor);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleLabel`+e]=this[`cScaleLabel`+e]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||V(this.primaryColor,75)||`#ffffff`,this.rowEven=this.rowEven||V(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||`#f0f0f0`,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=H(this.primaryColor,{h:64}),this.fillType3=H(this.secondaryColor,{h:64}),this.fillType4=H(this.primaryColor,{h:-64}),this.fillType5=H(this.secondaryColor,{h:-64}),this.fillType6=H(this.primaryColor,{h:128}),this.fillType7=H(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||H(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||H(this.primaryColor,{l:-10}),this.pie5=this.pie5||H(this.secondaryColor,{l:-30}),this.pie6=this.pie6||H(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||H(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||H(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||H(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||H(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||H(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||H(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||`25px`,this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||`17px`,this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||`17px`,this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||`black`,this.pieStrokeWidth=this.pieStrokeWidth||`2px`,this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||`2px`,this.pieOuterStrokeColor=this.pieOuterStrokeColor||`black`,this.pieOpacity=this.pieOpacity||`0.7`,this.venn1=this.venn1??H(this.primaryColor,{l:-30}),this.venn2=this.venn2??H(this.secondaryColor,{l:-30}),this.venn3=this.venn3??H(this.tertiaryColor,{l:-40}),this.venn4=this.venn4??H(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??H(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??H(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??H(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??H(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||`#8B0000`,cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||`#E8F5E9`,complicatedBg:this.cynefin?.complicatedBg||`#E3F2FD`,chaoticBg:this.cynefin?.chaoticBg||`#FBE9E7`,clearBg:this.cynefin?.clearBg||`#FFF8E1`,confusionBg:this.cynefin?.confusionBg||`#F3E5F5`,textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||H(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||H(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||H(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||H(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||H(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||H(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ye(this.quadrant1Fill)?V(this.quadrant1Fill):we(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||`#DEDEDE`,graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||`#dc3545`,this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||`#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3`},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||`1`,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||H(this.primaryColor,{h:-30}),this.git4=this.git4||H(this.primaryColor,{h:-60}),this.git5=this.git5||H(this.primaryColor,{h:-90}),this.git6=this.git6||H(this.primaryColor,{h:60}),this.git7=this.git7||H(this.primaryColor,{h:120}),this.darkMode?(this.git0=V(this.git0,25),this.git1=V(this.git1,25),this.git2=V(this.git2,25),this.git3=V(this.git3,25),this.git4=V(this.git4,25),this.git5=V(this.git5,25),this.git6=V(this.git6,25),this.git7=V(this.git7,25)):(this.git0=we(this.git0,25),this.git1=we(this.git1,25),this.git2=we(this.git2,25),this.git3=we(this.git3,25),this.git4=we(this.git4,25),this.git5=we(this.git5,25),this.git6=we(this.git6,25),this.git7=we(this.git7,25)),this.gitInv0=this.gitInv0||we(U(this.git0),25),this.gitInv1=this.gitInv1||U(this.git1),this.gitInv2=this.gitInv2||U(this.git2),this.gitInv3=this.gitInv3||U(this.git3),this.gitInv4=this.gitInv4||U(this.git4),this.gitInv5=this.gitInv5||U(this.git5),this.gitInv6=this.gitInv6||U(this.git6),this.gitInv7=this.gitInv7||U(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||U(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||U(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||`10px`,this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||`10px`,this.emUiFill=this.emUiFill||`white`,this.emUiStroke=this.emUiStroke||`#dbdada`,this.emProcessorFill=this.emProcessorFill||`#edb3f6`,this.emProcessorStroke=this.emProcessorStroke||`#b88cbf`,this.emReadModelFill=this.emReadModelFill||`#d3f1a2`,this.emReadModelStroke=this.emReadModelStroke||`#a3b732`,this.emCommandFill=this.emCommandFill||`#bcd6fe`,this.emCommandStroke=this.emCommandStroke||`#679ac3`,this.emEventFill=this.emEventFill||`#ffb778`,this.emEventStroke=this.emEventStroke||`#c19a0f`,this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||`rgb(250,250,250)`,this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||`rgb(240,240,240)`,this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Jo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Yo}calculate(e){if(Object.keys(this).forEach(e=>{this[e]===`calculated`&&(this[e]=void 0)}),typeof e!=`object`){this.updateColors();return}let t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},Zo=p(e=>{let t=new Xte;return t.calculate(e),t},`getThemeVariables`),Zte=class{static{p(this,`Theme`)}constructor(){this.background=`#f4f4f4`,this.primaryColor=`#cde498`,this.secondaryColor=`#cdffb2`,this.background=`white`,this.mainBkg=`#cde498`,this.secondBkg=`#cdffb2`,this.lineColor=`green`,this.border1=`#13540c`,this.border2=`#6eaa49`,this.arrowheadColor=`green`,this.fontFamily=`"trebuchet ms", verdana, arial, sans-serif`,this.fontSize=`16px`,this.tertiaryColor=V(`#cde498`,10),this.primaryBorderColor=Xo(this.primaryColor,this.darkMode),this.secondaryBorderColor=Xo(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Xo(this.tertiaryColor,this.darkMode),this.primaryTextColor=U(this.primaryColor),this.secondaryTextColor=U(this.secondaryColor),this.tertiaryTextColor=U(this.primaryColor),this.lineColor=U(this.background),this.textColor=U(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg=`calculated`,this.nodeBorder=`calculated`,this.clusterBkg=`calculated`,this.clusterBorder=`calculated`,this.defaultLinkColor=`calculated`,this.titleColor=`#333`,this.edgeLabelBackground=`#e8e8e8`,this.actorBorder=`calculated`,this.actorBkg=`calculated`,this.actorTextColor=`black`,this.actorLineColor=`calculated`,this.signalColor=`#333`,this.signalTextColor=`#333`,this.labelBoxBkgColor=`calculated`,this.labelBoxBorderColor=`#326932`,this.labelTextColor=`calculated`,this.loopTextColor=`calculated`,this.noteBorderColor=`calculated`,this.noteBkgColor=`#fff5ad`,this.noteTextColor=`calculated`,this.activationBorderColor=`#666`,this.activationBkgColor=`#f4f4f4`,this.sequenceNumberColor=`white`,this.sectionBkgColor=`#6eaa49`,this.altSectionBkgColor=`white`,this.sectionBkgColor2=`#6eaa49`,this.excludeBkgColor=`#eeeeee`,this.taskBorderColor=`calculated`,this.taskBkgColor=`#487e3a`,this.taskTextLightColor=`white`,this.taskTextColor=`calculated`,this.taskTextDarkColor=`black`,this.taskTextOutsideColor=`calculated`,this.taskTextClickableColor=`#003163`,this.activeTaskBorderColor=`calculated`,this.activeTaskBkgColor=`calculated`,this.gridColor=`lightgrey`,this.doneTaskBkgColor=`lightgrey`,this.doneTaskBorderColor=`grey`,this.critBorderColor=`#ff8888`,this.critBkgColor=`red`,this.todayLineColor=`red`,this.vertLineColor=`#00BFFF`,this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor=`calculated`,this.archEdgeArrowColor=`calculated`,this.archEdgeWidth=`3`,this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth=`2px`,this.noteFontWeight=`normal`,this.fontWeight=`normal`,this.labelColor=`black`,this.errorBkgColor=`#552222`,this.errorTextColor=`#552222`,this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow=`drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))`}updateColors(){this.actorBorder=we(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||H(this.primaryColor,{h:30}),this.cScale4=this.cScale4||H(this.primaryColor,{h:60}),this.cScale5=this.cScale5||H(this.primaryColor,{h:90}),this.cScale6=this.cScale6||H(this.primaryColor,{h:120}),this.cScale7=this.cScale7||H(this.primaryColor,{h:150}),this.cScale8=this.cScale8||H(this.primaryColor,{h:210}),this.cScale9=this.cScale9||H(this.primaryColor,{h:270}),this.cScale10=this.cScale10||H(this.primaryColor,{h:300}),this.cScale11=this.cScale11||H(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||we(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||we(this.tertiaryColor,40);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=we(this[`cScale`+e],10),this[`cScalePeer`+e]=this[`cScalePeer`+e]||we(this[`cScale`+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleInv`+e]=this[`cScaleInv`+e]||H(this[`cScale`+e],{h:180});this.scaleLabelColor=this.scaleLabelColor!==`calculated`&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleLabel`+e]=this[`cScaleLabel`+e]||this.scaleLabelColor;for(let e=0;e<5;e++)this[`surface`+e]=this[`surface`+e]||H(this.mainBkg,{h:30,s:-30,l:-(5+e*5)}),this[`surfacePeer`+e]=this[`surfacePeer`+e]||H(this.mainBkg,{h:30,s:-30,l:-(8+e*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||V(this.mainBkg,75)||`#ffffff`,this.rowEven=this.rowEven||V(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||`#f0f0f0`,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=H(this.primaryColor,{h:64}),this.fillType3=H(this.secondaryColor,{h:64}),this.fillType4=H(this.primaryColor,{h:-64}),this.fillType5=H(this.secondaryColor,{h:-64}),this.fillType6=H(this.primaryColor,{h:128}),this.fillType7=H(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||H(this.primaryColor,{l:-30}),this.pie5=this.pie5||H(this.secondaryColor,{l:-30}),this.pie6=this.pie6||H(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||H(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||H(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||H(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||H(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||H(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||H(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||`25px`,this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||`17px`,this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||`17px`,this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||`black`,this.pieStrokeWidth=this.pieStrokeWidth||`2px`,this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||`2px`,this.pieOuterStrokeColor=this.pieOuterStrokeColor||`black`,this.pieOpacity=this.pieOpacity||`0.7`,this.venn1=this.venn1??H(this.primaryColor,{l:-30}),this.venn2=this.venn2??H(this.secondaryColor,{l:-30}),this.venn3=this.venn3??H(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??H(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??H(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??H(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??H(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??H(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||`#8B4513`,cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||`#C8E6C9`,complicatedBg:this.cynefin?.complicatedBg||`#DCEDC8`,chaoticBg:this.cynefin?.chaoticBg||`#FFE0B2`,clearBg:this.cynefin?.clearBg||`#FFF9C4`,confusionBg:this.cynefin?.confusionBg||`#D7CCC8`,textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||H(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||H(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||H(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||H(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||H(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||H(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ye(this.quadrant1Fill)?V(this.quadrant1Fill):we(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||`#DEDEDE`,graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||`#dc3545`,this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||`#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176`},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||`1`,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||H(this.primaryColor,{h:-30}),this.git4=this.git4||H(this.primaryColor,{h:-60}),this.git5=this.git5||H(this.primaryColor,{h:-90}),this.git6=this.git6||H(this.primaryColor,{h:60}),this.git7=this.git7||H(this.primaryColor,{h:120}),this.darkMode?(this.git0=V(this.git0,25),this.git1=V(this.git1,25),this.git2=V(this.git2,25),this.git3=V(this.git3,25),this.git4=V(this.git4,25),this.git5=V(this.git5,25),this.git6=V(this.git6,25),this.git7=V(this.git7,25)):(this.git0=we(this.git0,25),this.git1=we(this.git1,25),this.git2=we(this.git2,25),this.git3=we(this.git3,25),this.git4=we(this.git4,25),this.git5=we(this.git5,25),this.git6=we(this.git6,25),this.git7=we(this.git7,25)),this.gitInv0=this.gitInv0||U(this.git0),this.gitInv1=this.gitInv1||U(this.git1),this.gitInv2=this.gitInv2||U(this.git2),this.gitInv3=this.gitInv3||U(this.git3),this.gitInv4=this.gitInv4||U(this.git4),this.gitInv5=this.gitInv5||U(this.git5),this.gitInv6=this.gitInv6||U(this.git6),this.gitInv7=this.gitInv7||U(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||U(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||U(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||`10px`,this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||`10px`,this.emUiFill=this.emUiFill||`white`,this.emUiStroke=this.emUiStroke||`#dbdada`,this.emProcessorFill=this.emProcessorFill||`#edb3f6`,this.emProcessorStroke=this.emProcessorStroke||`#b88cbf`,this.emReadModelFill=this.emReadModelFill||`#d3f1a2`,this.emReadModelStroke=this.emReadModelStroke||`#a3b732`,this.emCommandFill=this.emCommandFill||`#bcd6fe`,this.emCommandStroke=this.emCommandStroke||`#679ac3`,this.emEventFill=this.emEventFill||`#ffb778`,this.emEventStroke=this.emEventStroke||`#c19a0f`,this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||`rgb(250,250,250)`,this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||`rgb(240,240,240)`,this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Jo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Yo}calculate(e){if(typeof e!=`object`){this.updateColors();return}let t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},Qte=p(e=>{let t=new Zte;return t.calculate(e),t},`getThemeVariables`),$te=class{static{p(this,`Theme`)}constructor(){this.primaryColor=`#eee`,this.contrast=`#707070`,this.secondaryColor=V(this.contrast,55),this.background=`#ffffff`,this.tertiaryColor=H(this.primaryColor,{h:-160}),this.primaryBorderColor=Xo(this.primaryColor,this.darkMode),this.secondaryBorderColor=Xo(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Xo(this.tertiaryColor,this.darkMode),this.primaryTextColor=U(this.primaryColor),this.secondaryTextColor=U(this.secondaryColor),this.tertiaryTextColor=U(this.tertiaryColor),this.lineColor=U(this.background),this.textColor=U(this.background),this.mainBkg=`#eee`,this.secondBkg=`calculated`,this.lineColor=`#666`,this.border1=`#999`,this.border2=`calculated`,this.note=`#ffa`,this.text=`#333`,this.critical=`#d42`,this.done=`#bbb`,this.arrowheadColor=`#333333`,this.fontFamily=`"trebuchet ms", verdana, arial, sans-serif`,this.fontSize=`16px`,this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg=`calculated`,this.nodeBorder=`calculated`,this.clusterBkg=`calculated`,this.clusterBorder=`calculated`,this.defaultLinkColor=`calculated`,this.titleColor=`calculated`,this.edgeLabelBackground=`white`,this.actorBorder=`calculated`,this.actorBkg=`calculated`,this.actorTextColor=`calculated`,this.actorLineColor=this.actorBorder,this.signalColor=`calculated`,this.signalTextColor=`calculated`,this.labelBoxBkgColor=`calculated`,this.labelBoxBorderColor=`calculated`,this.labelTextColor=`calculated`,this.loopTextColor=`calculated`,this.noteBorderColor=`calculated`,this.noteBkgColor=`calculated`,this.noteTextColor=`calculated`,this.activationBorderColor=`#666`,this.activationBkgColor=`#f4f4f4`,this.sequenceNumberColor=`white`,this.sectionBkgColor=`calculated`,this.altSectionBkgColor=`white`,this.sectionBkgColor2=`calculated`,this.excludeBkgColor=`#eeeeee`,this.taskBorderColor=`calculated`,this.taskBkgColor=`calculated`,this.taskTextLightColor=`white`,this.taskTextColor=`calculated`,this.taskTextDarkColor=`calculated`,this.taskTextOutsideColor=`calculated`,this.taskTextClickableColor=`#003163`,this.activeTaskBorderColor=`calculated`,this.activeTaskBkgColor=`calculated`,this.gridColor=`calculated`,this.doneTaskBkgColor=`calculated`,this.doneTaskBorderColor=`calculated`,this.critBkgColor=`calculated`,this.critBorderColor=`calculated`,this.todayLineColor=`calculated`,this.vertLineColor=`calculated`,this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor=`calculated`,this.archEdgeArrowColor=`calculated`,this.archEdgeWidth=`3`,this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth=`2px`,this.noteFontWeight=`normal`,this.fontWeight=`normal`,this.rowOdd=this.rowOdd||V(this.mainBkg,75)||`#ffffff`,this.rowEven=this.rowEven||`#f4f4f4`,this.labelColor=`black`,this.errorBkgColor=`#552222`,this.errorTextColor=`#552222`,this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow=`drop-shadow( 1px 2px 2px rgba(185,185,185,1))`}updateColors(){this.secondBkg=V(this.contrast,55),this.border2=this.contrast,this.actorBorder=V(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor=`#999`,this.noteBkgColor=`#666`,this.noteTextColor=`#fff`,this.cScale0=this.cScale0||`#555`,this.cScale1=this.cScale1||`#F4F4F4`,this.cScale2=this.cScale2||`#555`,this.cScale3=this.cScale3||`#BBB`,this.cScale4=this.cScale4||`#777`,this.cScale5=this.cScale5||`#999`,this.cScale6=this.cScale6||`#DDD`,this.cScale7=this.cScale7||`#FFF`,this.cScale8=this.cScale8||`#DDD`,this.cScale9=this.cScale9||`#BBB`,this.cScale10=this.cScale10||`#999`,this.cScale11=this.cScale11||`#777`;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleInv`+e]=this[`cScaleInv`+e]||U(this[`cScale`+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this[`cScalePeer`+e]=this[`cScalePeer`+e]||V(this[`cScale`+e],10):this[`cScalePeer`+e]=this[`cScalePeer`+e]||we(this[`cScale`+e],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?`black`:this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleLabel`+e]=this[`cScaleLabel`+e]||this.scaleLabelColor;for(let e=0;e<5;e++)this[`surface`+e]=this[`surface`+e]||H(this.mainBkg,{l:-(5+e*5)}),this[`surfacePeer`+e]=this[`surfacePeer`+e]||H(this.mainBkg,{l:-(8+e*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=V(this.contrast,30),this.sectionBkgColor2=V(this.contrast,30),this.taskBorderColor=we(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=V(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=we(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||`#000`,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||`#f4f4f4`,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||`#000`,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=`#222`,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=H(this.primaryColor,{h:64}),this.fillType3=H(this.secondaryColor,{h:64}),this.fillType4=H(this.primaryColor,{h:-64}),this.fillType5=H(this.secondaryColor,{h:-64}),this.fillType6=H(this.primaryColor,{h:128}),this.fillType7=H(this.secondaryColor,{h:128});for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`pie`+e]=this[`cScale`+e];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||`25px`,this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||`17px`,this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||`17px`,this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||`black`,this.pieStrokeWidth=this.pieStrokeWidth||`2px`,this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||`2px`,this.pieOuterStrokeColor=this.pieOuterStrokeColor||`black`,this.pieOpacity=this.pieOpacity||`0.7`;for(let e=0;e<8;e++)this[`venn`+(e+1)]=this[`venn`+(e+1)]??this[`cScale`+e];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||`#8B0000`,cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||`#E8F5E9`,complicatedBg:this.cynefin?.complicatedBg||`#E3F2FD`,chaoticBg:this.cynefin?.chaoticBg||`#FBE9E7`,clearBg:this.cynefin?.clearBg||`#FFF8E1`,confusionBg:this.cynefin?.confusionBg||`#F3E5F5`,textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||H(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||H(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||H(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||H(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||H(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||H(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ye(this.quadrant1Fill)?V(this.quadrant1Fill):we(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||`#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0`},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||`#DEDEDE`,graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||`#dc3545`,this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||`1`,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=we(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||H(this.primaryColor,{h:-30}),this.git4=this.pie5||H(this.primaryColor,{h:-60}),this.git5=this.pie6||H(this.primaryColor,{h:-90}),this.git6=this.pie7||H(this.primaryColor,{h:60}),this.git7=this.pie8||H(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||U(this.git0),this.gitInv1=this.gitInv1||U(this.git1),this.gitInv2=this.gitInv2||U(this.git2),this.gitInv3=this.gitInv3||U(this.git3),this.gitInv4=this.gitInv4||U(this.git4),this.gitInv5=this.gitInv5||U(this.git5),this.gitInv6=this.gitInv6||U(this.git6),this.gitInv7=this.gitInv7||U(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1=`white`,this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3=`white`,this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||`10px`,this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||`10px`,this.emUiFill=this.emUiFill||`white`,this.emUiStroke=this.emUiStroke||`#dbdada`,this.emProcessorFill=this.emProcessorFill||`#edb3f6`,this.emProcessorStroke=this.emProcessorStroke||`#b88cbf`,this.emReadModelFill=this.emReadModelFill||`#d3f1a2`,this.emReadModelStroke=this.emReadModelStroke||`#a3b732`,this.emCommandFill=this.emCommandFill||`#bcd6fe`,this.emCommandStroke=this.emCommandStroke||`#679ac3`,this.emEventFill=this.emEventFill||`#ffb778`,this.emEventStroke=this.emEventStroke||`#c19a0f`,this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||`rgb(250,250,250)`,this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||`rgb(240,240,240)`,this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Jo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Yo}calculate(e){if(typeof e!=`object`){this.updateColors();return}let t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},ene=p(e=>{let t=new $te;return t.calculate(e),t},`getThemeVariables`),tne=class{static{p(this,`Theme`)}constructor(){this.background=`#ffffff`,this.primaryColor=`#cccccc`,this.mainBkg=`#ffffff`,this.noteBkgColor=`#fff5ad`,this.noteTextColor=`#333`,this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=Xo(this.primaryColor,this.darkMode),this.fontFamily=`arial, sans-serif`,this.fontSize=`14px`,this.nodeBorder=`#000000`,this.stateBorder=`#000000`,this.useGradient=!0,this.gradientStart=`#0042eb`,this.gradientStop=`#eb0042`,this.dropShadow=`drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));`,this.tertiaryColor=`#ffffff`,this.archEdgeColor=`calculated`,this.archEdgeArrowColor=`calculated`,this.archEdgeWidth=`3`,this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth=`2px`,this.noteFontWeight=`normal`,this.fontWeight=`normal`}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?`#eee`:`#333`),this.secondaryColor=this.secondaryColor||H(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||H(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Xo(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Xo(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Xo(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Xo(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||`#fff5ad`,this.noteTextColor=this.noteTextColor||`#333`,this.secondaryTextColor=this.secondaryTextColor||U(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||U(this.tertiaryColor),this.lineColor=this.lineColor||U(this.background),this.arrowheadColor=this.arrowheadColor||U(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?we(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||we(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||U(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;let e=`#ECECFE`,t=`#E9E9F1`,n=H(e,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||`white`,this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||`#eeeeee`,this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||V(e,23),this.gridColor=this.gridColor||`lightgrey`,this.doneTaskBkgColor=this.doneTaskBkgColor||`lightgrey`,this.doneTaskBorderColor=this.doneTaskBorderColor||`grey`,this.critBorderColor=this.critBorderColor||`#ff8888`,this.critBkgColor=this.critBkgColor||`red`,this.todayLineColor=this.todayLineColor||`red`,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||`#003163`,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||`#f0f0f0`,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||e,this.cScale1=this.cScale1||t,this.cScale2=this.cScale2||n,this.cScale3=this.cScale3||H(e,{h:30}),this.cScale4=this.cScale4||H(e,{h:60}),this.cScale5=this.cScale5||H(e,{h:90}),this.cScale6=this.cScale6||H(e,{h:120}),this.cScale7=this.cScale7||H(e,{h:150}),this.cScale8=this.cScale8||H(e,{h:210,l:150}),this.cScale9=this.cScale9||H(e,{h:270}),this.cScale10=this.cScale10||H(e,{h:300}),this.cScale11=this.cScale11||H(e,{h:330}),this.darkMode)for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=we(this[`cScale`+e],75);else for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=we(this[`cScale`+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleInv`+e]=this[`cScaleInv`+e]||U(this[`cScale`+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this[`cScalePeer`+e]=this[`cScalePeer`+e]||V(this[`cScale`+e],10):this[`cScalePeer`+e]=this[`cScalePeer`+e]||we(this[`cScale`+e],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleLabel`+e]=this[`cScaleLabel`+e]||this.scaleLabelColor;let r=this.darkMode?-4:-1;for(let e=0;e<5;e++)this[`surface`+e]=this[`surface`+e]||H(this.mainBkg,{h:180,s:-15,l:r*(5+e*3)}),this[`surfacePeer`+e]=this[`surfacePeer`+e]||H(this.mainBkg,{h:180,s:-15,l:r*(8+e*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||e,this.fillType1=this.fillType1||t,this.fillType2=this.fillType2||H(e,{h:64}),this.fillType3=this.fillType3||H(t,{h:64}),this.fillType4=this.fillType4||H(e,{h:-64}),this.fillType5=this.fillType5||H(t,{h:-64}),this.fillType6=this.fillType6||H(e,{h:128}),this.fillType7=this.fillType7||H(t,{h:128}),this.pie1=this.pie1||e,this.pie2=this.pie2||t,this.pie3=this.pie3||n,this.pie4=this.pie4||H(e,{l:-10}),this.pie5=this.pie5||H(t,{l:-10}),this.pie6=this.pie6||H(n,{l:-10}),this.pie7=this.pie7||H(e,{h:60,l:-10}),this.pie8=this.pie8||H(e,{h:-60,l:-10}),this.pie9=this.pie9||H(e,{h:120,l:0}),this.pie10=this.pie10||H(e,{h:60,l:-20}),this.pie11=this.pie11||H(e,{h:-60,l:-20}),this.pie12=this.pie12||H(e,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||`25px`,this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||`17px`,this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||`17px`,this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||`black`,this.pieStrokeWidth=this.pieStrokeWidth||`2px`,this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||`2px`,this.pieOuterStrokeColor=this.pieOuterStrokeColor||`black`,this.pieOpacity=this.pieOpacity||`0.7`,this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||e,this.quadrant2Fill=this.quadrant2Fill||H(e,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||H(e,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||H(e,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||H(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||H(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||H(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ye(this.quadrant1Fill)?V(this.quadrant1Fill):we(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||`#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0`},this.requirementBackground=this.requirementBackground||e,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||`1`,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?we(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||e,this.git1=this.git1||t,this.git2=this.git2||n,this.git3=this.git3||H(e,{h:-30}),this.git4=this.git4||H(e,{h:-60}),this.git5=this.git5||H(e,{h:-90}),this.git6=this.git6||H(e,{h:60}),this.git7=this.git7||H(e,{h:120}),this.darkMode?(this.git0=V(this.git0,25),this.git1=V(this.git1,25),this.git2=V(this.git2,25),this.git3=V(this.git3,25),this.git4=V(this.git4,25),this.git5=V(this.git5,25),this.git6=V(this.git6,25),this.git7=V(this.git7,25)):(this.git0=we(this.git0,25),this.git1=we(this.git1,25),this.git2=we(this.git2,25),this.git3=we(this.git3,25),this.git4=we(this.git4,25),this.git5=we(this.git5,25),this.git6=we(this.git6,25),this.git7=we(this.git7,25)),this.gitInv0=this.gitInv0||U(this.git0),this.gitInv1=this.gitInv1||U(this.git1),this.gitInv2=this.gitInv2||U(this.git2),this.gitInv3=this.gitInv3||U(this.git3),this.gitInv4=this.gitInv4||U(this.git4),this.gitInv5=this.gitInv5||U(this.git5),this.gitInv6=this.gitInv6||U(this.git6),this.gitInv7=this.gitInv7||U(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?`black`:this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||`10px`,this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||`10px`,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Jo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Yo}calculate(e){if(typeof e!=`object`){this.updateColors();return}let t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},nne=p(e=>{let t=new tne;return t.calculate(e),t},`getThemeVariables`),rne=class{static{p(this,`Theme`)}constructor(){this.background=`#333`,this.primaryColor=`#1f2020`,this.secondaryColor=V(this.primaryColor,16),this.tertiaryColor=H(this.primaryColor,{h:-160}),this.primaryBorderColor=U(this.background),this.secondaryBorderColor=Xo(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Xo(this.tertiaryColor,this.darkMode),this.primaryTextColor=U(this.primaryColor),this.secondaryTextColor=U(this.secondaryColor),this.tertiaryTextColor=U(this.tertiaryColor),this.mainBkg=`#2a2020`,this.secondBkg=`calculated`,this.mainContrastColor=`lightgrey`,this.darkTextColor=V(U(`#323D47`),10),this.border1=`#ccc`,this.border2=de(255,255,255,.25),this.arrowheadColor=U(this.background),this.fontFamily=`arial, sans-serif`,this.fontSize=`14px`,this.labelBackground=`#181818`,this.textColor=`#ccc`,this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor=`#fff5ad`,this.noteTextColor=`#333`,this.THEME_COLOR_LIMIT=12,this.fontFamily=`arial, sans-serif`,this.fontSize=`14px`,this.useGradient=!0,this.gradientStart=`#0042eb`,this.gradientStop=`#eb0042`,this.dropShadow=`drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))`,this.archEdgeColor=`calculated`,this.archEdgeArrowColor=`calculated`,this.archEdgeWidth=`3`,this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth=`2px`,this.noteFontWeight=`normal`,this.fontWeight=`normal`}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?`#eee`:`#333`),this.secondaryColor=this.secondaryColor||H(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||H(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Xo(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Xo(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Xo(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Xo(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||`#fff5ad`,this.noteTextColor=this.noteTextColor||`#333`,this.secondaryTextColor=this.secondaryTextColor||U(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||U(this.tertiaryColor),this.lineColor=this.lineColor||U(this.background),this.arrowheadColor=this.arrowheadColor||U(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?we(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||we(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||U(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||`white`,this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||`#eeeeee`,this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||V(this.primaryColor,23),this.gridColor=this.gridColor||`lightgrey`,this.doneTaskBkgColor=this.doneTaskBkgColor||`lightgrey`,this.doneTaskBorderColor=this.doneTaskBorderColor||`grey`,this.critBorderColor=this.critBorderColor||`#ff8888`,this.critBkgColor=this.critBkgColor||`red`,this.todayLineColor=this.todayLineColor||`red`,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||`#003163`,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||`#f0f0f0`,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||H(this.primaryColor,{h:30}),this.cScale4=this.cScale4||H(this.primaryColor,{h:60}),this.cScale5=this.cScale5||H(this.primaryColor,{h:90}),this.cScale6=this.cScale6||H(this.primaryColor,{h:120}),this.cScale7=this.cScale7||H(this.primaryColor,{h:150}),this.cScale8=this.cScale8||H(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||H(this.primaryColor,{h:270}),this.cScale10=this.cScale10||H(this.primaryColor,{h:300}),this.cScale11=this.cScale11||H(this.primaryColor,{h:330}),this.darkMode)for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=we(this[`cScale`+e],75);else for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=we(this[`cScale`+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleInv`+e]=this[`cScaleInv`+e]||U(this[`cScale`+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this[`cScalePeer`+e]=this[`cScalePeer`+e]||V(this[`cScale`+e],10):this[`cScalePeer`+e]=this[`cScalePeer`+e]||we(this[`cScale`+e],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleLabel`+e]=this[`cScaleLabel`+e]||this.scaleLabelColor;let e=this.darkMode?-4:-1;for(let t=0;t<5;t++)this[`surface`+t]=this[`surface`+t]||H(this.mainBkg,{h:180,s:-15,l:e*(5+t*3)}),this[`surfacePeer`+t]=this[`surfacePeer`+t]||H(this.mainBkg,{h:180,s:-15,l:e*(8+t*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||H(this.primaryColor,{h:64}),this.fillType3=this.fillType3||H(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||H(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||H(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||H(this.primaryColor,{h:128}),this.fillType7=this.fillType7||H(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||H(this.primaryColor,{l:-10}),this.pie5=this.pie5||H(this.secondaryColor,{l:-10}),this.pie6=this.pie6||H(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||H(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||H(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||H(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||H(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||H(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||H(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||`25px`,this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||`17px`,this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||`17px`,this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||`black`,this.pieStrokeWidth=this.pieStrokeWidth||`2px`,this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||`2px`,this.pieOuterStrokeColor=this.pieOuterStrokeColor||`black`,this.pieOpacity=this.pieOpacity||`0.7`,this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||H(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||H(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||H(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||H(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||H(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||H(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ye(this.quadrant1Fill)?V(this.quadrant1Fill):we(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||`#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0`},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||`1`,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?we(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||`#0b0000`,this.git1=this.git1||`#4d1037`,this.git2=this.git2||`#3f5258`,this.git3=this.git3||`#4f2f1b`,this.git4=this.git4||`#6e0a0a`,this.git5=this.git5||`#3b0048`,this.git6=this.git6||`#995a01`,this.git7=this.git7||`#154706`,this.gitDarkMode=!0,this.gitDarkMode?(this.git0=V(this.git0,25),this.git1=V(this.git1,25),this.git2=V(this.git2,25),this.git3=V(this.git3,25),this.git4=V(this.git4,25),this.git5=V(this.git5,25),this.git6=V(this.git6,25),this.git7=V(this.git7,25)):(this.git0=we(this.git0,25),this.git1=we(this.git1,25),this.git2=we(this.git2,25),this.git3=we(this.git3,25),this.git4=we(this.git4,25),this.git5=we(this.git5,25),this.git6=we(this.git6,25),this.git7=we(this.git7,25)),this.gitInv0=this.gitInv0||U(this.git0),this.gitInv1=this.gitInv1||U(this.git1),this.gitInv2=this.gitInv2||U(this.git2),this.gitInv3=this.gitInv3||U(this.git3),this.gitInv4=this.gitInv4||U(this.git4),this.gitInv5=this.gitInv5||U(this.git5),this.gitInv6=this.gitInv6||U(this.git6),this.gitInv7=this.gitInv7||U(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?`black`:this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||`10px`,this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||`10px`,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Jo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Yo}calculate(e){if(typeof e!=`object`){this.updateColors();return}let t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},ine=p(e=>{let t=new rne;return t.calculate(e),t},`getThemeVariables`),ane=class{static{p(this,`Theme`)}constructor(){this.background=`#ffffff`,this.primaryColor=`#cccccc`,this.mainBkg=`#ffffff`,this.noteBkgColor=`#fff5ad`,this.noteTextColor=`#28253D`,this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=Xo(`#28253D`,this.darkMode),this.fontFamily=`"Recursive Variable", arial, sans-serif`,this.fontSize=`14px`,this.nodeBorder=`#28253D`,this.stateBorder=`#28253D`,this.useGradient=!1,this.gradientStart=`#0042eb`,this.gradientStop=`#eb0042`,this.dropShadow=`url(#drop-shadow)`,this.nodeShadow=!0,this.tertiaryColor=`#ffffff`,this.clusterBkg=`#F9F9FB`,this.clusterBorder=`#BDBCCC`,this.noteBorderColor=`#FACC15`,this.archEdgeColor=`calculated`,this.archEdgeArrowColor=`calculated`,this.archEdgeWidth=`3`,this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth=`2px`,this.actorBorder=`#28253D`,this.filterColor=`#000000`}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?`#eee`:`#28253D`),this.secondaryColor=this.secondaryColor||H(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||H(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Xo(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Xo(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Xo(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Xo(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||`#FEF9C3`,this.noteTextColor=this.noteTextColor||`#28253D`,this.secondaryTextColor=this.secondaryTextColor||U(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||U(this.tertiaryColor),this.lineColor=this.lineColor||U(this.background),this.arrowheadColor=this.arrowheadColor||U(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?we(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||we(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||U(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;let e=`#ECECFE`,t=`#E9E9F1`,n=H(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||`white`,this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||`#eeeeee`,this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||V(e,23),this.gridColor=this.gridColor||`lightgrey`,this.doneTaskBkgColor=this.doneTaskBkgColor||`lightgrey`,this.doneTaskBorderColor=this.doneTaskBorderColor||`grey`,this.critBorderColor=this.critBorderColor||`#ff8888`,this.critBkgColor=this.critBkgColor||`red`,this.todayLineColor=this.todayLineColor||`red`,this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||`#003163`,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground=`#F9F9FB`,this.altBackground=`#F9F9FB`,this.stateEdgeLabelBackground=`#FFFFFF`,this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||`#f0f0f0`,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=this.mainBkg;if(this.darkMode)for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=we(this[`cScale`+e],75);else for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=we(this[`cScale`+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleInv`+e]=this[`cScaleInv`+e]||U(this[`cScale`+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this[`cScalePeer`+e]=this[`cScalePeer`+e]||V(this[`cScale`+e],10):this[`cScalePeer`+e]=this[`cScalePeer`+e]||we(this[`cScale`+e],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleLabel`+e]=this[`cScaleLabel`+e]||this.scaleLabelColor;let r=this.darkMode?-4:-1;for(let e=0;e<5;e++)this[`surface`+e]=this[`surface`+e]||H(this.mainBkg,{h:180,s:-15,l:r*(5+e*3)}),this[`surfacePeer`+e]=this[`surfacePeer`+e]||H(this.mainBkg,{h:180,s:-15,l:r*(8+e*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||e,this.fillType1=this.fillType1||t,this.fillType2=this.fillType2||H(e,{h:64}),this.fillType3=this.fillType3||H(t,{h:64}),this.fillType4=this.fillType4||H(e,{h:-64}),this.fillType5=this.fillType5||H(t,{h:-64}),this.fillType6=this.fillType6||H(e,{h:128}),this.fillType7=this.fillType7||H(t,{h:128}),this.pie1=this.pie1||e,this.pie2=this.pie2||t,this.pie3=this.pie3||n,this.pie4=this.pie4||H(e,{l:-10}),this.pie5=this.pie5||H(t,{l:-10}),this.pie6=this.pie6||H(n,{l:-10}),this.pie7=this.pie7||H(e,{h:60,l:-10}),this.pie8=this.pie8||H(e,{h:-60,l:-10}),this.pie9=this.pie9||H(e,{h:120,l:0}),this.pie10=this.pie10||H(e,{h:60,l:-20}),this.pie11=this.pie11||H(e,{h:-60,l:-20}),this.pie12=this.pie12||H(e,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||`25px`,this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||`17px`,this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||`17px`,this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||`black`,this.pieStrokeWidth=this.pieStrokeWidth||`2px`,this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||`2px`,this.pieOuterStrokeColor=this.pieOuterStrokeColor||`black`,this.pieOpacity=this.pieOpacity||`0.7`,this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||e,this.quadrant2Fill=this.quadrant2Fill||H(e,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||H(e,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||H(e,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||H(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||H(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||H(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ye(this.quadrant1Fill)?V(this.quadrant1Fill):we(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||`#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0`},this.requirementBackground=this.requirementBackground||e,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||`1`,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?we(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground=`#FFFFFF`,this.git0=this.git0||e,this.git1=this.git1||t,this.git2=this.git2||n,this.git3=this.git3||H(e,{h:-30}),this.git4=this.git4||H(e,{h:-60}),this.git5=this.git5||H(e,{h:-90}),this.git6=this.git6||H(e,{h:60}),this.git7=this.git7||H(e,{h:120}),this.darkMode?(this.git0=V(this.git0,25),this.git1=V(this.git1,25),this.git2=V(this.git2,25),this.git3=V(this.git3,25),this.git4=V(this.git4,25),this.git5=V(this.git5,25),this.git6=V(this.git6,25),this.git7=V(this.git7,25)):(this.git0=we(this.git0,25),this.git1=we(this.git1,25),this.git2=we(this.git2,25),this.git3=we(this.git3,25),this.git4=we(this.git4,25),this.git5=we(this.git5,25),this.git6=we(this.git6,25),this.git7=we(this.git7,25)),this.gitInv0=this.gitInv0||U(this.git0),this.gitInv1=this.gitInv1||U(this.git1),this.gitInv2=this.gitInv2||U(this.git2),this.gitInv3=this.gitInv3||U(this.git3),this.gitInv4=this.gitInv4||U(this.git4),this.gitInv5=this.gitInv5||U(this.git5),this.gitInv6=this.gitInv6||U(this.git6),this.gitInv7=this.gitInv7||U(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?`black`:this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||`10px`,this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||`10px`,this.commitLineColor=this.commitLineColor??`#BDBCCC`,this.erEdgeLabelBackground=`#FFFFFF`,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Jo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Yo}calculate(e){if(typeof e!=`object`){this.updateColors();return}let t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},one=p(e=>{let t=new ane;return t.calculate(e),t},`getThemeVariables`),sne=class{static{p(this,`Theme`)}constructor(){this.background=`#333`,this.primaryColor=`#1f2020`,this.secondaryColor=V(this.primaryColor,16),this.tertiaryColor=H(this.primaryColor,{h:-160}),this.primaryBorderColor=U(this.background),this.secondaryBorderColor=Xo(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Xo(this.tertiaryColor,this.darkMode),this.primaryTextColor=U(this.primaryColor),this.secondaryTextColor=U(this.secondaryColor),this.tertiaryTextColor=U(this.tertiaryColor),this.mainBkg=`#111113`,this.secondBkg=`calculated`,this.mainContrastColor=`lightgrey`,this.darkTextColor=V(U(`#323D47`),10),this.border1=`#ccc`,this.border2=de(255,255,255,.25),this.arrowheadColor=U(this.background),this.fontFamily=`"Recursive Variable", arial, sans-serif`,this.fontSize=`14px`,this.labelBackground=`#111113`,this.textColor=`#ccc`,this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??`#FEF9C3`,this.noteTextColor=this.noteTextColor??`#28253D`,this.THEME_COLOR_LIMIT=12,this.fontFamily=`"Recursive Variable", arial, sans-serif`,this.fontSize=`14px`,this.nodeBorder=`#FFFFFF`,this.stateBorder=`#FFFFFF`,this.useGradient=!1,this.gradientStart=`#0042eb`,this.gradientStop=`#eb0042`,this.dropShadow=`url(#drop-shadow)`,this.nodeShadow=!0,this.archEdgeColor=`calculated`,this.archEdgeArrowColor=`calculated`,this.archEdgeWidth=`3`,this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth=`2px`,this.clusterBkg=`#1E1A2E`,this.clusterBorder=`#BDBCCC`,this.noteBorderColor=`#FACC15`,this.noteFontWeight=600,this.filterColor=`#FFFFFF`}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?`#eee`:`#FFFFFF`),this.secondaryColor=this.secondaryColor||H(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||H(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Xo(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Xo(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Xo(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Xo(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||`#fff5ad`,this.noteTextColor=this.noteTextColor||`#FFFFFF`,this.secondaryTextColor=this.secondaryTextColor||U(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||U(this.tertiaryColor),this.lineColor=this.lineColor||U(this.background),this.arrowheadColor=this.arrowheadColor||U(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?we(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=`#FFFFFF`,this.signalColor=`#FFFFFF`,this.labelBoxBorderColor=`#BDBCCC`,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||we(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||U(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||`white`,this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||`#eeeeee`,this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||V(this.primaryColor,23),this.gridColor=this.gridColor||`lightgrey`,this.doneTaskBkgColor=this.doneTaskBkgColor||`lightgrey`,this.doneTaskBorderColor=this.doneTaskBorderColor||`grey`,this.critBorderColor=this.critBorderColor||`#ff8888`,this.critBkgColor=this.critBkgColor||`red`,this.todayLineColor=this.todayLineColor||`red`,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||`#003163`,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground=`#16141F`,this.altBackground=`#16141F`,this.compositeTitleBackground=`#16141F`,this.stateEdgeLabelBackground=`#16141F`,this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||`#f0f0f0`,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||H(this.primaryColor,{h:30}),this.cScale4=this.cScale4||H(this.primaryColor,{h:60}),this.cScale5=this.cScale5||H(this.primaryColor,{h:90}),this.cScale6=this.cScale6||H(this.primaryColor,{h:120}),this.cScale7=this.cScale7||H(this.primaryColor,{h:150}),this.cScale8=this.cScale8||H(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||H(this.primaryColor,{h:270}),this.cScale10=this.cScale10||H(this.primaryColor,{h:300}),this.cScale11=this.cScale11||H(this.primaryColor,{h:330}),this.darkMode)for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=we(this[`cScale`+e],75);else for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=we(this[`cScale`+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleInv`+e]=this[`cScaleInv`+e]||U(this[`cScale`+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this[`cScalePeer`+e]=this[`cScalePeer`+e]||V(this[`cScale`+e],10):this[`cScalePeer`+e]=this[`cScalePeer`+e]||we(this[`cScale`+e],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleLabel`+e]=this[`cScaleLabel`+e]||this.scaleLabelColor;let e=this.darkMode?-4:-1;for(let t=0;t<5;t++)this[`surface`+t]=this[`surface`+t]||H(this.mainBkg,{h:180,s:-15,l:e*(5+t*3)}),this[`surfacePeer`+t]=this[`surfacePeer`+t]||H(this.mainBkg,{h:180,s:-15,l:e*(8+t*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||H(this.primaryColor,{h:64}),this.fillType3=this.fillType3||H(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||H(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||H(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||H(this.primaryColor,{h:128}),this.fillType7=this.fillType7||H(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||H(this.primaryColor,{l:-10}),this.pie5=this.pie5||H(this.secondaryColor,{l:-10}),this.pie6=this.pie6||H(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||H(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||H(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||H(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||H(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||H(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||H(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||`25px`,this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||`17px`,this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||`17px`,this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||`black`,this.pieStrokeWidth=this.pieStrokeWidth||`2px`,this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||`2px`,this.pieOuterStrokeColor=this.pieOuterStrokeColor||`black`,this.pieOpacity=this.pieOpacity||`0.7`,this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||H(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||H(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||H(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||H(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||H(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||H(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ye(this.quadrant1Fill)?V(this.quadrant1Fill):we(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||`#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0`},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||`1`,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?we(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground=`#16141F`,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||H(this.primaryColor,{h:-30}),this.git4=this.git4||H(this.primaryColor,{h:-60}),this.git5=this.git5||H(this.primaryColor,{h:-90}),this.git6=this.git6||H(this.primaryColor,{h:60}),this.git7=this.git7||H(this.primaryColor,{h:120}),this.darkMode?(this.git0=V(this.git0,25),this.git1=V(this.git1,25),this.git2=V(this.git2,25),this.git3=V(this.git3,25),this.git4=V(this.git4,25),this.git5=V(this.git5,25),this.git6=V(this.git6,25),this.git7=V(this.git7,25)):(this.git0=we(this.git0,25),this.git1=we(this.git1,25),this.git2=we(this.git2,25),this.git3=we(this.git3,25),this.git4=we(this.git4,25),this.git5=we(this.git5,25),this.git6=we(this.git6,25),this.git7=we(this.git7,25)),this.gitInv0=this.gitInv0||U(this.git0),this.gitInv1=this.gitInv1||U(this.git1),this.gitInv2=this.gitInv2||U(this.git2),this.gitInv3=this.gitInv3||U(this.git3),this.gitInv4=this.gitInv4||U(this.git4),this.gitInv5=this.gitInv5||U(this.git5),this.gitInv6=this.gitInv6||U(this.git6),this.gitInv7=this.gitInv7||U(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?`black`:this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||`10px`,this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||`10px`,this.commitLineColor=this.commitLineColor??`#BDBCCC`,this.erEdgeLabelBackground=`#16141F`,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Jo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Yo}calculate(e){if(typeof e!=`object`){this.updateColors();return}let t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},cne=p(e=>{let t=new sne;return t.calculate(e),t},`getThemeVariables`),lne=class{static{p(this,`Theme`)}constructor(){this.background=`#ffffff`,this.primaryColor=`#cccccc`,this.mainBkg=`#ffffff`,this.noteBkgColor=`#fff5ad`,this.noteTextColor=`#28253D`,this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=Xo(this.primaryColor,this.darkMode),this.fontFamily=`"Recursive Variable", arial, sans-serif`,this.fontSize=`14px`,this.nodeBorder=`#28253D`,this.stateBorder=`#28253D`,this.useGradient=!1,this.gradientStart=`#0042eb`,this.gradientStop=`#eb0042`,this.dropShadow=`url(#drop-shadow)`,this.nodeShadow=!0,this.tertiaryColor=`#ffffff`,this.archEdgeColor=`calculated`,this.archEdgeArrowColor=`calculated`,this.archEdgeWidth=`3`,this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth=`2px`,this.actorBorder=`#28253D`,this.noteBorderColor=`#FACC15`,this.noteFontWeight=600,this.borderColorArray=[`#E879F9`,`#2DD4BF`,`#FB923C`,`#22D3EE`,`#4ADE80`,`#A78BFA`,`#F87171`,`#FACC15`,`#818CF8`,`#A3E635 `,`#38BDF8`,`#FB7185`],this.bkgColorArray=[`#FDF4FF`,`#F0FDFA`,`#FFF7ED`,`#ECFEFF`,`#F0FDF4`,`#F5F3FF`,`#FEF2F2`,`#FEFCE8`,`#EEF2FF`,`#F7FEE7`,`#F0F9FF`,`#FFF1F2`],this.filterColor=`#000000`}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?`#eee`:`#28253D`),this.secondaryColor=this.secondaryColor||H(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||H(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Xo(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Xo(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Xo(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Xo(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||`#fff5ad`,this.noteTextColor=this.noteTextColor||`#28253D`,this.secondaryTextColor=this.secondaryTextColor||U(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||U(this.tertiaryColor),this.lineColor=this.lineColor||U(this.background),this.arrowheadColor=this.arrowheadColor||U(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?we(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||we(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||U(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;let e=`#ECECFE`,t=`#E9E9F1`,n=H(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||`white`,this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||`#eeeeee`,this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||V(e,23),this.gridColor=this.gridColor||`lightgrey`,this.doneTaskBkgColor=this.doneTaskBkgColor||`lightgrey`,this.doneTaskBorderColor=this.doneTaskBorderColor||`grey`,this.critBorderColor=this.critBorderColor||`#ff8888`,this.critBkgColor=this.critBkgColor||`red`,this.todayLineColor=this.todayLineColor||`red`,this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||`#003163`,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||`#f0f0f0`,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||`#f4a8ff`,this.cScale1=this.cScale1||`#46ecd5`,this.cScale2=this.cScale2||`#ffb86a`,this.cScale3=this.cScale3||`#dab2ff`,this.cScale4=this.cScale4||`#7bf1a8`,this.cScale5=this.cScale5||`#c4b4ff`,this.cScale6=this.cScale6||`#ffa2a2`,this.cScale7=this.cScale7||`#ffdf20`,this.cScale8=this.cScale8||`#a3b3ff`,this.cScale9=this.cScale9||`#bbf451`,this.cScale10=this.cScale10||`#74d4ff`,this.cScale11=this.cScale11||`#ffa1ad`;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleInv`+e]=this[`cScaleInv`+e]||U(this[`cScale`+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this[`cScalePeer`+e]=this[`cScalePeer`+e]||V(this[`cScale`+e],10):this[`cScalePeer`+e]=this[`cScalePeer`+e]||we(this[`cScale`+e],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleLabel`+e]=this[`cScaleLabel`+e]||this.scaleLabelColor;let r=this.darkMode?-4:-1;for(let e=0;e<5;e++)this[`surface`+e]=this[`surface`+e]||H(this.mainBkg,{h:180,s:-15,l:r*(5+e*3)}),this[`surfacePeer`+e]=this[`surfacePeer`+e]||H(this.mainBkg,{h:180,s:-15,l:r*(8+e*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||e,this.fillType1=this.fillType1||t,this.fillType2=this.fillType2||H(e,{h:64}),this.fillType3=this.fillType3||H(t,{h:64}),this.fillType4=this.fillType4||H(e,{h:-64}),this.fillType5=this.fillType5||H(t,{h:-64}),this.fillType6=this.fillType6||H(e,{h:128}),this.fillType7=this.fillType7||H(t,{h:128}),this.pie1=this.pie1||e,this.pie2=this.pie2||t,this.pie3=this.pie3||n,this.pie4=this.pie4||H(e,{l:-10}),this.pie5=this.pie5||H(t,{l:-10}),this.pie6=this.pie6||H(n,{l:-10}),this.pie7=this.pie7||H(e,{h:60,l:-10}),this.pie8=this.pie8||H(e,{h:-60,l:-10}),this.pie9=this.pie9||H(e,{h:120,l:0}),this.pie10=this.pie10||H(e,{h:60,l:-20}),this.pie11=this.pie11||H(e,{h:-60,l:-20}),this.pie12=this.pie12||H(e,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||`25px`,this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||`17px`,this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||`17px`,this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||`black`,this.pieStrokeWidth=this.pieStrokeWidth||`2px`,this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||`2px`,this.pieOuterStrokeColor=this.pieOuterStrokeColor||`black`,this.pieOpacity=this.pieOpacity||`0.7`,this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||e,this.quadrant2Fill=this.quadrant2Fill||H(e,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||H(e,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||H(e,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||H(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||H(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||H(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ye(this.quadrant1Fill)?V(this.quadrant1Fill):we(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||`#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0`},this.requirementBackground=this.requirementBackground||e,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||`1`,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?we(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||e,this.git1=this.git1||t,this.git2=this.git2||n,this.git3=this.git3||H(e,{h:-30}),this.git4=this.git4||H(e,{h:-60}),this.git5=this.git5||H(e,{h:-90}),this.git6=this.git6||H(e,{h:60}),this.git7=this.git7||H(e,{h:120}),this.darkMode?(this.git0=V(this.git0,25),this.git1=V(this.git1,25),this.git2=V(this.git2,25),this.git3=V(this.git3,25),this.git4=V(this.git4,25),this.git5=V(this.git5,25),this.git6=V(this.git6,25),this.git7=V(this.git7,25)):(this.git0=we(this.git0,25),this.git1=we(this.git1,25),this.git2=we(this.git2,25),this.git3=we(this.git3,25),this.git4=we(this.git4,25),this.git5=we(this.git5,25),this.git6=we(this.git6,25),this.git7=we(this.git7,25)),this.gitInv0=this.gitInv0||U(this.git0),this.gitInv1=this.gitInv1||U(this.git1),this.gitInv2=this.gitInv2||U(this.git2),this.gitInv3=this.gitInv3||U(this.git3),this.gitInv4=this.gitInv4||U(this.git4),this.gitInv5=this.gitInv5||U(this.git5),this.gitInv6=this.gitInv6||U(this.git6),this.gitInv7=this.gitInv7||U(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?`black`:this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||`10px`,this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLineColor=this.commitLineColor??`#BDBCCC`,this.commitLabelFontSize=this.commitLabelFontSize||`10px`,this.fontWeight=600,this.erEdgeLabelBackground=`#FFFFFF`,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Jo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Yo}calculate(e){if(typeof e!=`object`){this.updateColors();return}let t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},une=p(e=>{let t=new lne;return t.calculate(e),t},`getThemeVariables`),dne=class{static{p(this,`Theme`)}constructor(){this.background=`#333`,this.primaryColor=`#1f2020`,this.secondaryColor=V(this.primaryColor,16),this.tertiaryColor=H(this.primaryColor,{h:-160}),this.primaryBorderColor=U(this.background),this.secondaryBorderColor=Xo(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Xo(this.tertiaryColor,this.darkMode),this.primaryTextColor=U(this.primaryColor),this.secondaryTextColor=U(this.secondaryColor),this.tertiaryTextColor=U(this.tertiaryColor),this.mainBkg=`#111113`,this.secondBkg=`calculated`,this.mainContrastColor=`lightgrey`,this.darkTextColor=V(U(`#323D47`),10),this.border1=`#ccc`,this.border2=de(255,255,255,.25),this.arrowheadColor=U(this.background),this.fontFamily=`"Recursive Variable", arial, sans-serif`,this.fontSize=`14px`,this.labelBackground=`#111113`,this.textColor=`#ccc`,this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??`#FEF9C3`,this.noteTextColor=this.noteTextColor??`#28253D`,this.THEME_COLOR_LIMIT=12,this.fontFamily=`"Recursive Variable", arial, sans-serif`,this.fontSize=`14px`,this.nodeBorder=`#FFFFFF`,this.stateBorder=`#FFFFFF`,this.useGradient=!1,this.gradientStart=`#0042eb`,this.gradientStop=`#eb0042`,this.dropShadow=`url(#drop-shadow)`,this.nodeShadow=!0,this.archEdgeColor=`calculated`,this.archEdgeArrowColor=`calculated`,this.archEdgeWidth=`3`,this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth=`2px`,this.clusterBkg=`#1E1A2E`,this.clusterBorder=`#BDBCCC`,this.noteBorderColor=`#FACC15`,this.noteFontWeight=600,this.borderColorArray=[`#E879F9`,`#2DD4BF`,`#FB923C`,`#22D3EE`,`#4ADE80`,`#A78BFA`,`#F87171`,`#FACC15`,`#818CF8`,`#A3E635 `,`#38BDF8`,`#FB7185`],this.bkgColorArray=[],this.filterColor=`#FFFFFF`}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?`#eee`:`#FFFFFF`),this.secondaryColor=this.secondaryColor||H(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||H(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Xo(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Xo(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Xo(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Xo(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||`#fff5ad`,this.noteTextColor=this.noteTextColor||`#FFFFFF`,this.secondaryTextColor=this.secondaryTextColor||U(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||U(this.tertiaryColor),this.lineColor=this.lineColor||U(this.background),this.arrowheadColor=this.arrowheadColor||U(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?we(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=`#FFFFFF`,this.signalColor=`#FFFFFF`,this.labelBoxBorderColor=`#BDBCCC`,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||we(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||U(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor=`#FFFFFF`,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||`white`,this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||`#eeeeee`,this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||V(this.primaryColor,23),this.gridColor=this.gridColor||`lightgrey`,this.doneTaskBkgColor=this.doneTaskBkgColor||`lightgrey`,this.doneTaskBorderColor=this.doneTaskBorderColor||`grey`,this.critBorderColor=this.critBorderColor||`#ff8888`,this.critBkgColor=this.critBkgColor||`red`,this.todayLineColor=this.todayLineColor||`red`,this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||`#003163`,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||`#f0f0f0`,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||`#f4a8ff`,this.cScale1=this.cScale1||`#46ecd5`,this.cScale2=this.cScale2||`#ffb86a`,this.cScale3=this.cScale3||`#dab2ff`,this.cScale4=this.cScale4||`#7bf1a8`,this.cScale5=this.cScale5||`#c4b4ff`,this.cScale6=this.cScale6||`#ffa2a2`,this.cScale7=this.cScale7||`#ffdf20`,this.cScale8=this.cScale8||`#a3b3ff`,this.cScale9=this.cScale9||`#bbf451`,this.cScale10=this.cScale10||`#74d4ff`,this.cScale11=this.cScale11||`#ffa1ad`;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleInv`+e]=this[`cScaleInv`+e]||U(this[`cScale`+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this[`cScalePeer`+e]=this[`cScalePeer`+e]||V(this[`cScale`+e],10):this[`cScalePeer`+e]=this[`cScalePeer`+e]||we(this[`cScale`+e],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleLabel`+e]=we(this[`cScale`+e],75);let e=this.darkMode?-4:-1;for(let t=0;t<5;t++)this[`surface`+t]=this[`surface`+t]||H(this.mainBkg,{h:180,s:-15,l:e*(5+t*3)}),this[`surfacePeer`+t]=this[`surfacePeer`+t]||H(this.mainBkg,{h:180,s:-15,l:e*(8+t*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||H(this.primaryColor,{h:64}),this.fillType3=this.fillType3||H(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||H(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||H(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||H(this.primaryColor,{h:128}),this.fillType7=this.fillType7||H(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||H(this.primaryColor,{l:-10}),this.pie5=this.pie5||H(this.secondaryColor,{l:-10}),this.pie6=this.pie6||H(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||H(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||H(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||H(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||H(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||H(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||H(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||`25px`,this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||`17px`,this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||`17px`,this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||`black`,this.pieStrokeWidth=this.pieStrokeWidth||`2px`,this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||`2px`,this.pieOuterStrokeColor=this.pieOuterStrokeColor||`black`,this.pieOpacity=this.pieOpacity||`0.7`,this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||H(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||H(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||H(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||H(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||H(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||H(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ye(this.quadrant1Fill)?V(this.quadrant1Fill):we(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||`#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0`},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||`1`,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?we(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||H(this.primaryColor,{h:-30}),this.git4=this.git4||H(this.primaryColor,{h:-60}),this.git5=this.git5||H(this.primaryColor,{h:-90}),this.git6=this.git6||H(this.primaryColor,{h:60}),this.git7=this.git7||H(this.primaryColor,{h:120}),this.darkMode?(this.git0=V(this.git0,25),this.git1=V(this.git1,25),this.git2=V(this.git2,25),this.git3=V(this.git3,25),this.git4=V(this.git4,25),this.git5=V(this.git5,25),this.git6=V(this.git6,25),this.git7=V(this.git7,25)):(this.git0=we(this.git0,25),this.git1=we(this.git1,25),this.git2=we(this.git2,25),this.git3=we(this.git3,25),this.git4=we(this.git4,25),this.git5=we(this.git5,25),this.git6=we(this.git6,25),this.git7=we(this.git7,25)),this.gitInv0=this.gitInv0||U(this.git0),this.gitInv1=this.gitInv1||U(this.git1),this.gitInv2=this.gitInv2||U(this.git2),this.gitInv3=this.gitInv3||U(this.git3),this.gitInv4=this.gitInv4||U(this.git4),this.gitInv5=this.gitInv5||U(this.git5),this.gitInv6=this.gitInv6||U(this.git6),this.gitInv7=this.gitInv7||U(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?`black`:this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||`10px`,this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||`10px`,this.commitLineColor=this.commitLineColor??`#BDBCCC`,this.fontWeight=600,this.erEdgeLabelBackground=`#16141F`,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Jo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Yo}calculate(e){if(typeof e!=`object`){this.updateColors();return}let t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},Qo={base:{getThemeVariables:qte},dark:{getThemeVariables:Yte},default:{getThemeVariables:Zo},forest:{getThemeVariables:Qte},neutral:{getThemeVariables:ene},neo:{getThemeVariables:nne},"neo-dark":{getThemeVariables:ine},redux:{getThemeVariables:one},"redux-dark":{getThemeVariables:cne},"redux-color":{getThemeVariables:une},"redux-dark-color":{getThemeVariables:p(e=>{let t=new dne;return t.calculate(e),t},`getThemeVariables`)}},$o={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:`basis`,padding:15,defaultRenderer:`dagre-wrapper`,wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:`arc`,ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:`center`,mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:`"Open Sans", sans-serif`,actorFontWeight:400,noteFontSize:14,noteFontFamily:`"trebuchet ms", verdana, arial, sans-serif`,noteFontWeight:400,noteAlign:`center`,messageFontSize:16,messageFontFamily:`"trebuchet ms", verdana, arial, sans-serif`,messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:`%Y-%m-%d`,topAxis:!1,displayMode:``,weekday:`sunday`},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:`center`,bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:`"Open Sans", sans-serif`,taskMargin:50,activationWidth:10,textPlacement:`fo`,actorColours:[`#8FBC8F`,`#7CFC00`,`#00FFFF`,`#20B2AA`,`#B0E0E6`,`#FFFFE0`],sectionFills:[`#191970`,`#8B008B`,`#4B0082`,`#2F4F4F`,`#800000`,`#8B4513`,`#00008B`],sectionColours:[`#fff`],titleColor:``,titleFontFamily:`"trebuchet ms", verdana, arial, sans-serif`,titleFontSize:`4ex`},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:`dagre-wrapper`,htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:`20`,compositTitleSize:35,radius:5,defaultRenderer:`dagre-wrapper`},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:`TB`,minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:`gray`,fill:`honeydew`,fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:`right`,highlightSlice:``},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:`top`,yAxisPosition:`left`,quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,showLegend:!0,legendFontSize:14,legendPadding:10,xAxis:{$ref:`#/$defs/XYChartAxisConfig`,showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:`#/$defs/XYChartAxisConfig`,showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:`vertical`,plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:`#f9f9f9`,text_color:`#333`,rect_border_size:`0.5px`,rect_border_color:`#bbb`,rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:`cose-bilkent`},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:``},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:`center`,bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:`"Open Sans", sans-serif`,taskMargin:50,activationWidth:10,textPlacement:`fo`,actorColours:[`#8FBC8F`,`#7CFC00`,`#00FFFF`,`#20B2AA`,`#B0E0E6`,`#FFFFE0`],sectionFills:[`#191970`,`#8B008B`,`#4B0082`,`#2F4F4F`,`#800000`,`#8B4513`,`#00008B`],sectionColours:[`#fff`],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:`main`,mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:`"Open Sans", sans-serif`,personFontWeight:`normal`,external_personFontSize:14,external_personFontFamily:`"Open Sans", sans-serif`,external_personFontWeight:`normal`,systemFontSize:14,systemFontFamily:`"Open Sans", sans-serif`,systemFontWeight:`normal`,external_systemFontSize:14,external_systemFontFamily:`"Open Sans", sans-serif`,external_systemFontWeight:`normal`,system_dbFontSize:14,system_dbFontFamily:`"Open Sans", sans-serif`,system_dbFontWeight:`normal`,external_system_dbFontSize:14,external_system_dbFontFamily:`"Open Sans", sans-serif`,external_system_dbFontWeight:`normal`,system_queueFontSize:14,system_queueFontFamily:`"Open Sans", sans-serif`,system_queueFontWeight:`normal`,external_system_queueFontSize:14,external_system_queueFontFamily:`"Open Sans", sans-serif`,external_system_queueFontWeight:`normal`,boundaryFontSize:14,boundaryFontFamily:`"Open Sans", sans-serif`,boundaryFontWeight:`normal`,messageFontSize:12,messageFontFamily:`"Open Sans", sans-serif`,messageFontWeight:`normal`,containerFontSize:14,containerFontFamily:`"Open Sans", sans-serif`,containerFontWeight:`normal`,external_containerFontSize:14,external_containerFontFamily:`"Open Sans", sans-serif`,external_containerFontWeight:`normal`,container_dbFontSize:14,container_dbFontFamily:`"Open Sans", sans-serif`,container_dbFontWeight:`normal`,external_container_dbFontSize:14,external_container_dbFontFamily:`"Open Sans", sans-serif`,external_container_dbFontWeight:`normal`,container_queueFontSize:14,container_queueFontFamily:`"Open Sans", sans-serif`,container_queueFontWeight:`normal`,external_container_queueFontSize:14,external_container_queueFontFamily:`"Open Sans", sans-serif`,external_container_queueFontWeight:`normal`,componentFontSize:14,componentFontFamily:`"Open Sans", sans-serif`,componentFontWeight:`normal`,external_componentFontSize:14,external_componentFontFamily:`"Open Sans", sans-serif`,external_componentFontWeight:`normal`,component_dbFontSize:14,component_dbFontFamily:`"Open Sans", sans-serif`,component_dbFontWeight:`normal`,external_component_dbFontSize:14,external_component_dbFontFamily:`"Open Sans", sans-serif`,external_component_dbFontWeight:`normal`,component_queueFontSize:14,component_queueFontFamily:`"Open Sans", sans-serif`,component_queueFontWeight:`normal`,external_component_queueFontSize:14,external_component_queueFontFamily:`"Open Sans", sans-serif`,external_component_queueFontWeight:`normal`,wrap:!0,wrapPadding:10,person_bg_color:`#08427B`,person_border_color:`#073B6F`,external_person_bg_color:`#686868`,external_person_border_color:`#8A8A8A`,system_bg_color:`#1168BD`,system_border_color:`#3C7FC0`,system_db_bg_color:`#1168BD`,system_db_border_color:`#3C7FC0`,system_queue_bg_color:`#1168BD`,system_queue_border_color:`#3C7FC0`,external_system_bg_color:`#999999`,external_system_border_color:`#8A8A8A`,external_system_db_bg_color:`#999999`,external_system_db_border_color:`#8A8A8A`,external_system_queue_bg_color:`#999999`,external_system_queue_border_color:`#8A8A8A`,container_bg_color:`#438DD5`,container_border_color:`#3C7FC0`,container_db_bg_color:`#438DD5`,container_db_border_color:`#3C7FC0`,container_queue_bg_color:`#438DD5`,container_queue_border_color:`#3C7FC0`,external_container_bg_color:`#B3B3B3`,external_container_border_color:`#A6A6A6`,external_container_db_bg_color:`#B3B3B3`,external_container_db_border_color:`#A6A6A6`,external_container_queue_bg_color:`#B3B3B3`,external_container_queue_border_color:`#A6A6A6`,component_bg_color:`#85BBF0`,component_border_color:`#78A8D8`,component_db_bg_color:`#85BBF0`,component_db_border_color:`#78A8D8`,component_queue_bg_color:`#85BBF0`,component_queue_border_color:`#78A8D8`,external_component_bg_color:`#CCCCCC`,external_component_border_color:`#BFBFBF`,external_component_db_bg_color:`#CCCCCC`,external_component_db_border_color:`#BFBFBF`,external_component_queue_bg_color:`#CCCCCC`,external_component_queue_border_color:`#BFBFBF`},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:`gradient`,nodeAlignment:`justify`,showValues:!0,prefix:``,suffix:``,nodeWidth:10,nodePadding:12,labelStyle:`legacy`},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:``,filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:`default`,look:`classic`,handDrawnSeed:0,layout:`dagre`,maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:`"trebuchet ms", verdana, arial, sans-serif;`,logLevel:5,securityLevel:`strict`,startOnLoad:!0,arrowMarkerAbsolute:!1,secure:[`secure`,`securityLevel`,`startOnLoad`,`maxTextSize`,`suppressErrorRendering`,`maxEdges`],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},es={...$o,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:`BRANDES_KOEPF`,nodePlacementAlignment:`NONE`,forceNodeModelOrder:!1,considerModelOrder:`NODES_AND_EDGES`,keepEntryNodeOnTop:!1},themeCSS:void 0,themeVariables:Qo.default.getThemeVariables(),sequence:{...$o.sequence,messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},`messageFont`),noteFont:p(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},`noteFont`),actorFont:p(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},`actorFont`)},class:{defaultRenderer:`dagre-wrapper`,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...$o.gantt,tickInterval:void 0,useWidth:void 0},c4:{...$o.c4,useWidth:void 0,personFont:p(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},`personFont`),flowchart:{...$o.flowchart,inheritDir:!1},external_personFont:p(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},`external_personFont`),systemFont:p(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},`systemFont`),external_systemFont:p(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},`external_systemFont`),system_dbFont:p(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},`system_dbFont`),external_system_dbFont:p(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},`external_system_dbFont`),system_queueFont:p(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},`system_queueFont`),external_system_queueFont:p(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},`external_system_queueFont`),containerFont:p(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},`containerFont`),external_containerFont:p(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},`external_containerFont`),container_dbFont:p(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},`container_dbFont`),external_container_dbFont:p(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},`external_container_dbFont`),container_queueFont:p(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},`container_queueFont`),external_container_queueFont:p(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},`external_container_queueFont`),componentFont:p(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},`componentFont`),external_componentFont:p(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},`external_componentFont`),component_dbFont:p(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},`component_dbFont`),external_component_dbFont:p(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},`external_component_dbFont`),component_queueFont:p(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},`component_queueFont`),external_component_queueFont:p(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},`external_component_queueFont`),boundaryFont:p(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},`boundaryFont`),messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},`messageFont`)},pie:{...$o.pie,useWidth:984},xyChart:{...$o.xyChart,useWidth:void 0},requirement:{...$o.requirement,useWidth:void 0},packet:{...$o.packet},eventmodeling:{...$o.eventmodeling},treeView:{...$o.treeView,useWidth:void 0},radar:{...$o.radar},railroad:{...$o.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...$o.ishikawa},sankey:{...$o.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:`,`},venn:{...$o.venn},cynefin:{...$o.cynefin}},ts=p((e,t=``)=>Object.keys(e).reduce((n,r)=>Array.isArray(e[r])?n:typeof e[r]==`object`&&e[r]!==null?[...n,t+r,...ts(e[r],``)]:[...n,t+r],[]),`keyify`),fne=new Set(ts(es,``)),ns=es,pne={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},mne=p((e,t)=>{for(let n of Object.keys(e)){let r=e[n];(n.startsWith(`__`)||n.includes(`proto`)||n.includes(`constr`)||typeof r!=`string`||!t.test(r))&&(y.debug(`sanitize deleting dictionary entry:`,n,r),delete e[n])}},`sanitizeDictionaryConfig`),rs=p(e=>{if(y.debug(`sanitizeDirective called with`,e),!(typeof e!=`object`||!e)){if(Array.isArray(e)){e.forEach(e=>rs(e));return}for(let t of Object.keys(e)){if(y.debug(`Checking key`,t),t.startsWith(`__`)||t.includes(`proto`)||t.includes(`constr`)||!fne.has(t)||e[t]==null){y.debug(`sanitize deleting key: `,t),delete e[t];continue}if(typeof e[t]==`object`){let n=pne[t];n?mne(e[t],n):(y.debug(`sanitizing object`,t),rs(e[t]));continue}for(let n of[`themeCSS`,`fontFamily`,`altFontFamily`])t.includes(n)&&(y.debug(`sanitizing css option`,t),e[t]=is(e[t]))}if(e.themeVariables)for(let t of Object.keys(e.themeVariables)){let n=e.themeVariables[t];n?.match&&!n.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]=``)}y.debug(`After sanitization`,e)}},`sanitizeDirective`),is=p(e=>{let t=0,n=0;for(let r of e){if(t<n)return`{ /* ERROR: Unbalanced CSS */ }`;r===`{`?t++:r===`}`&&n++}return t===n?e:`{ /* ERROR: Unbalanced CSS */ }`},`sanitizeCss`),as=Object.freeze(ns),os=p(e=>!(e===!1||[`false`,`null`,`0`].includes(String(e).trim().toLowerCase())),`evaluate`),ss=qo({},as),ls=[],us=qo({},as),ds=p((e,t)=>{let n=qo({},e),r={};for(let e of t)hs(e),r=qo(r,e);if(n=qo(n,r),r.theme&&r.theme in Qo){let e=qo(qo({},cs).themeVariables||{},r.themeVariables);n.theme&&n.theme in Qo&&(n.themeVariables=Qo[n.theme].getThemeVariables(e))}return us=n,bne(us),us},`updateCurrentConfig`),hne=p(e=>(ss=qo({},as),ss=qo(ss,e),e.theme&&Qo[e.theme]&&(ss.themeVariables=Qo[e.theme].getThemeVariables(e.themeVariables)),ds(ss,ls),ss),`setSiteConfig`),gne=p(e=>{cs=qo({},e)},`saveConfigFromInitialize`),_ne=p(e=>(ss=qo(ss,e),ds(ss,ls),ss),`updateSiteConfig`),fs=p(()=>qo({},ss),`getSiteConfig`),ps=p(e=>(ds(us,[e]),ms()),`setConfig`),ms=p(()=>qo({},us),`getConfig`),hs=p(e=>{e&&([`secure`,...ss.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(y.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith(`__`)&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]==`string`&&(e[t].includes(`<`)||e[t].includes(`>`)||e[t].includes(`url(data:`))&&delete e[t],typeof e[t]==`object`&&hs(e[t])}))},`sanitize`),vne=p(e=>{rs(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),ls.push(e),ds(ss,ls)},`addDirective`),gs=p((e=ss)=>{ls=[],ds(e,ls)},`reset`),yne={LAZY_LOAD_DEPRECATED:`The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.`,FLOWCHART_HTML_LABELS_DEPRECATED:`flowchart.htmlLabels is deprecated. Please use global htmlLabels instead.`},_s={},vs=p(e=>{_s[e]||(y.warn(yne[e]),_s[e]=!0)},`issueWarning`),bne=p(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&vs(`LAZY_LOAD_DEPRECATED`)},`checkConfig`),ys=p(()=>{let e={};cs&&(e=qo(e,cs));for(let t of ls)e=qo(e,t);return e},`getUserDefinedConfig`),bs=p(e=>(e.flowchart?.htmlLabels!=null&&vs(`FLOWCHART_HTML_LABELS_DEPRECATED`),os(e.htmlLabels??e.flowchart?.htmlLabels??!0)),`getEffectiveHtmlLabels`),xs=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,Ss=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,xne=/\s*%%.*\n/gm,Cs=class extends Error{static{p(this,`UnknownDiagramError`)}constructor(e){super(e),this.name=`UnknownDiagramError`}},ws={},Ts=p(function(e,t){e=e.replace(xs,``).replace(Ss,``).replace(xne,`261+`);for(let[n,{detector:r}]of Object.entries(ws))if(r(e,t))return n;throw new Cs(`No diagram type detected matching given configuration for text: ${e}`)},`detectType`),Es=p((...e)=>{for(let{id:t,detector:n,loader:r}of e)Ds(t,n,r)},`registerLazyLoadedDiagrams`),Ds=p((e,t,n)=>{ws[e]&&y.warn(`Detector with key ${e} already exists. Overwriting.`),ws[e]={detector:t,loader:n},y.debug(`Detector with key ${e} added${n?` with loader`:``}`)},`addDetector`),Sne=p(e=>ws[e].loader,`getDiagramLoader`),Os=/<br\s*\/?>/gi,Cne=p(e=>e?Ms(e).replace(/\\n/g,`#br#`).split(`#br#`):[``],`getRows`),wne=(()=>{let e=!1;return()=>{e||=(Gte(),!0)}})(),p(Gte,`setupDompurifyHooks`),ks=p(e=>(wne(),Kt.sanitize(e)),`removeScript`),As=p((e,t)=>{if(bs(t)){let n=t.securityLevel;n===`antiscript`||n===`strict`||n===`sandbox`?e=ks(e):n!==`loose`&&(e=Ms(e),e=e.replace(/</g,`<`).replace(/>/g,`>`),e=e.replace(/=/g,`=`),e=One(e))}return e},`sanitizeMore`),js=p((e,t)=>e&&(e=t.dompurifyConfig?Kt.sanitize(As(e,t),t.dompurifyConfig).toString():Kt.sanitize(As(e,t),{FORBID_TAGS:[`style`]}).toString(),e),`sanitizeText`),Tne=p((e,t)=>typeof e==`string`?js(e,t):e.flat().map(e=>js(e,t)),`sanitizeTextOrArray`),Ene=p(e=>Os.test(e),`hasBreaks`),Dne=p(e=>e.split(Os),`splitBreaks`),One=p(e=>e.replace(/#br#/g,`<br/>`),`placeholderToBreak`),Ms=p(e=>e.replace(Os,`#br#`),`breakToPlaceholder`),Ns=p(e=>{let t=``;return e&&(t=window.location.protocol+`//`+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},`getUrl`),kne=p(function(...e){let t=e.filter(e=>!isNaN(e));return Math.max(...t)},`getMax`),Ane=p(function(...e){let t=e.filter(e=>!isNaN(e));return Math.min(...t)},`getMin`),Ps=p(function(e){let t=e.split(/(,)/),n=[];for(let e=0;e<t.length;e++){let r=t[e];if(r===`,`&&e>0&&e+1<t.length){let i=t[e-1],a=t[e+1];jne(i,a)&&(r=i+`,`+a,e++,n.pop())}n.push(Mne(r))}return n.join(``)},`parseGenericTypes`),Fs=p((e,t)=>Math.max(0,e.split(t).length-1),`countOccurrence`),jne=p((e,t)=>{let n=Fs(e,`~`),r=Fs(t,`~`);return n===1&&r===1},`shouldCombineSets`),Mne=p(e=>{let t=Fs(e,`~`),n=!1;if(t<=1)return e;t%2!=0&&e.startsWith(`~`)&&(e=e.substring(1),n=!0);let r=[...e],i=r.indexOf(`~`),a=r.lastIndexOf(`~`);for(;i!==-1&&a!==-1&&i!==a;)r[i]=`<`,r[a]=`>`,i=r.indexOf(`~`),a=r.lastIndexOf(`~`);return n&&r.unshift(`~`),r.join(``)},`processSet`),Is=p(()=>window.MathMLElement!==void 0,`isMathMLSupported`),Ls=/\$\$(.*?)\$\$/g,Rs=p(e=>(e.match(Ls)?.length??0)>0,`hasKatex`),zs=p(async(e,t)=>{let n=document.createElement(`div`);n.innerHTML=await Bs(e,t),n.id=`katex-temp`,n.style.visibility=`hidden`,n.style.position=`absolute`,n.style.top=`0`,document.querySelector(`body`)?.insertAdjacentElement(`beforeend`,n);let r={width:n.clientWidth,height:n.clientHeight};return n.remove(),r},`calculateMathMLDimensions`),Nne=p(async(e,t)=>{if(!Rs(e))return e;if(!(Is()||t.legacyMathML||t.forceLegacyMathML))return e.replace(Ls,`MathML is unsupported in this environment.`);{let{default:n}=await Promise.resolve().then(()=>(Wte(),Jt)),r=t.forceLegacyMathML||!Is()&&t.legacyMathML?`htmlAndMathml`:`mathml`;return e.split(Os).map(e=>Rs(e)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${e}</div>`:`<div>${e}</div>`).join(``).replace(Ls,(e,t)=>n.renderToString(t,{throwOnError:!0,displayMode:!0,output:r}).replace(/\n/g,` `).replace(/<annotation.*<\/annotation>/g,``))}},`renderKatexUnsanitized`),Bs=p(async(e,t)=>js(await Nne(e,t),t),`renderKatexSanitized`),Vs={getRows:Cne,sanitizeText:js,sanitizeTextOrArray:Tne,hasBreaks:Ene,splitBreaks:Dne,lineBreakRegex:Os,removeScript:ks,getUrl:Ns,evaluate:os,getMax:kne,getMin:Ane},Pne=p(function(e,t){for(let n of t)e.attr(n[0],n[1])},`d3Attrs`),Fne=p(function(e,t,n){let r=new Map;return n?(r.set(`width`,`100%`),r.set(`style`,`max-width: ${t}px;`)):(r.set(`height`,e),r.set(`width`,t)),r},`calculateSvgSizeAttrs`),Hs=p(function(e,t,n,r){Pne(e,Fne(t,n,r))},`configureSvgSize`),Us=p(function(e,t,n,r){let i=t.node().getBBox(),a=i.width,o=i.height;y.info(`SVG bounds: ${a}x${o}`,i);let s=0,l=0;y.info(`Graph bounds: ${s}x${l}`,e),s=a+n*2,l=o+n*2,y.info(`Calculated bounds: ${s}x${l}`),Hs(t,l,s,r);let u=`${i.x-n} ${i.y-n} ${i.width+2*n} ${i.height+2*n}`;t.attr(`viewBox`,u)},`setupGraphViewbox`),Ws={},p(Go,`cssStyleSheetToString`),Ine=p((e,t,n,r)=>{let i=``;return e in Ws&&Ws[e]?i=Ws[e]({...n,svgId:r}):y.warn(`No theme found for ${e}`),`& {262+ font-family: ${n.fontFamily};263+ font-size: ${n.fontSize};264+ fill: ${n.textColor}265+ }266+ @keyframes edge-animation-frame {267+ from {268+ stroke-dashoffset: 0;269+ }270+ }271+ @keyframes dash {272+ to {273+ stroke-dashoffset: 0;274+ }275+ }276+ & .edge-animation-slow {277+ stroke-dasharray: 9,5 !important;278+ stroke-dashoffset: 900;279+ animation: dash 50s linear infinite;280+ stroke-linecap: round;281+ }282+ & .edge-animation-fast {283+ stroke-dasharray: 9,5 !important;284+ stroke-dashoffset: 900;285+ animation: dash 20s linear infinite;286+ stroke-linecap: round;287+ }288+ /* Classes common for multiple diagrams */289+290+ & .error-icon {291+ fill: ${n.errorBkgColor};292+ }293+ & .error-text {294+ fill: ${n.errorTextColor};295+ stroke: ${n.errorTextColor};296+ }297+298+ & .edge-thickness-normal {299+ stroke-width: ${n.strokeWidth??1}px;300+ }301+ & .edge-thickness-thick {302+ stroke-width: 3.5px303+ }304+ & .edge-pattern-solid {305+ stroke-dasharray: 0;306+ }307+ & .edge-thickness-invisible {308+ stroke-width: 0;309+ fill: none;310+ }311+ & .edge-pattern-dashed{312+ stroke-dasharray: 3;313+ }314+ .edge-pattern-dotted {315+ stroke-dasharray: 2;316+ }317+318+ & .marker {319+ fill: ${n.lineColor};320+ stroke: ${n.lineColor};321+ }322+ & .marker.cross {323+ stroke: ${n.lineColor};324+ }325+326+ & svg {327+ font-family: ${n.fontFamily};328+ font-size: ${n.fontSize};329+ }330+ & p {331+ margin: 0332+ }333+334+ ${i}335+ .node .neo-node {336+ stroke: ${n.nodeBorder};337+ }338+339+ [data-look="neo"].node rect, [data-look="neo"].cluster rect, [data-look="neo"].node polygon {340+ stroke: ${n.useGradient?`url(`+r+`-gradient)`:n.nodeBorder};341+ filter: ${n.dropShadow?n.dropShadow.replace(`url(#drop-shadow)`,`url(${r}-drop-shadow)`):`none`};342+ }343+ [data-look="neo"].swimlane.cluster rect {344+ filter: none;345+ }346+347+348+ [data-look="neo"].node path {349+ stroke: ${n.useGradient?`url(`+r+`-gradient)`:n.nodeBorder};350+ stroke-width: ${n.strokeWidth??1}px;351+ }352+353+ [data-look="neo"].node .outer-path {354+ filter: ${n.dropShadow?n.dropShadow.replace(`url(#drop-shadow)`,`url(${r}-drop-shadow)`):`none`};355+ }356+357+ [data-look="neo"].node .neo-line path {358+ stroke: ${n.nodeBorder};359+ filter: none;360+ }361+362+ [data-look="neo"].node circle{363+ stroke: ${n.useGradient?`url(`+r+`-gradient)`:n.nodeBorder};364+ filter: ${n.dropShadow?n.dropShadow.replace(`url(#drop-shadow)`,`url(${r}-drop-shadow)`):`none`};365+ }366+367+ [data-look="neo"].node circle .state-start{368+ fill: #000000;369+ }370+371+ [data-look="neo"].icon-shape .icon {372+ fill: ${n.useGradient?`url(`+r+`-gradient)`:n.nodeBorder};373+ filter: ${n.dropShadow?n.dropShadow.replace(`url(#drop-shadow)`,`url(${r}-drop-shadow)`):`none`};374+ }375+376+ [data-look="neo"].icon-shape .icon-neo path {377+ stroke: ${n.useGradient?`url(`+r+`-gradient)`:n.nodeBorder};378+ filter: ${n.dropShadow?n.dropShadow.replace(`url(#drop-shadow)`,`url(${r}-drop-shadow)`):`none`};379+ }380+381+ ${t}382+`},`getStyles`),Lne=p((e,t)=>{t!==void 0&&(Ws[e]=t)},`addStylesForDiagram`),Rne=Ine,Gs={},m(Gs,{clear:()=>Xs,getAccDescription:()=>ec,getAccTitle:()=>Qs,getDiagramTitle:()=>nc,setAccDescription:()=>$s,setAccTitle:()=>Zs,setDiagramTitle:()=>tc}),Ks=``,qs=``,Js=``,Ys=p(e=>js(e,ms()),`sanitizeText`),Xs=p(()=>{Ks=``,Js=``,qs=``},`clear`),Zs=p(e=>{Ks=Ys(e).replace(/^\s+/g,``)},`setAccTitle`),Qs=p(()=>Ks,`getAccTitle`),$s=p(e=>{Js=Ys(e).replace(/\n\s+/g,`383+`)},`setAccDescription`),ec=p(()=>Js,`getAccDescription`),tc=p(e=>{qs=Ys(e)},`setDiagramTitle`),nc=p(()=>qs,`getDiagramTitle`),rc=y,zne=b,Z=ms,ic=ps,ac=as,oc=p(e=>js(e,Z()),`sanitizeText`),sc=Us,Bne=p(()=>Gs,`getCommonDb`),cc={},lc=p((e,t,n)=>{cc[e]&&rc.warn(`Diagram with id ${e} already registered. Overwriting.`),cc[e]=t,n&&Ds(e,n),Lne(e,t.styles),t.injectUtils?.(rc,zne,Z,oc,sc,Bne(),()=>{})},`registerDiagram`),uc=p(e=>{if(e in cc)return cc[e];throw new Vne(e)},`getDiagram`),Vne=class extends Error{static{p(this,`DiagramNotFoundError`)}constructor(e){super(`Diagram ${e} not found.`)}}}));function fc(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}var pc=o((()=>{}));function Hne(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}var Une=o((()=>{}));function mc(e){let t,n,r;e.length===2?(t=e===fc||e===Hne?e:Wne,n=e,r=e):(t=fc,n=(t,n)=>fc(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function Wne(){return 0}var Gne=o((()=>{pc(),Une()}));function Kne(e){return e===null?NaN:+e}var qne=o((()=>{})),hc,Jne,Yne=o((()=>{pc(),Gne(),qne(),hc=mc(fc),Jne=hc.right,hc.left,mc(Kne).center}));function Xne({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function Zne({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Qne({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function $ne(e){return typeof e==`object`&&e?e.valueOf():e}var gc,ere=o((()=>{gc=class extends Map{constructor(e,t=$ne){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(Xne(this,e))}has(e){return super.has(Xne(this,e))}set(e,t){return super.set(Zne(this,e),t)}delete(e){return super.delete(Qne(this,e))}}}));function _c(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=nre?10:a>=rre?5:a>=ire?2:1,s,l,u;return i<0?(u=10**-i/o,s=Math.round(e*u),l=Math.round(t*u),s/u<e&&++s,l/u>t&&--l,u=-u):(u=10**i*o,s=Math.round(e/u),l=Math.round(t/u),s*u<e&&++s,l*u>t&&--l),l<s&&.5<=n&&n<2?_c(e,t,n*2):[s,l,u]}function tre(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?_c(t,e,n):_c(e,t,n);if(!(a>=i))return[];let s=a-i+1,l=Array(s);if(r){if(o<0)for(let e=0;e<s;++e)l[e]=(a-e)/-o;else for(let e=0;e<s;++e)l[e]=(a-e)*o}else if(o<0)for(let e=0;e<s;++e)l[e]=(i+e)/-o;else for(let e=0;e<s;++e)l[e]=(i+e)*o;return l}function vc(e,t,n){return t=+t,e=+e,n=+n,_c(e,t,n)[2]}function yc(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?vc(t,e,n):vc(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}var nre,rre,ire,are=o((()=>{nre=Math.sqrt(50),rre=Math.sqrt(10),ire=Math.sqrt(2)}));function ore(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}var sre=o((()=>{}));function cre(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}var lre=o((()=>{}));function ure(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}var dre=o((()=>{})),bc=o((()=>{Yne(),pc(),Gne(),Une(),ere(),are(),sre(),lre(),qne(),dre()}));function fre(e){return e}var pre=o((()=>{}));function mre(e){return`translate(`+e+`,0)`}function hre(e){return`translate(0,`+e+`)`}function gre(e){return t=>+e(t)}function _re(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function vre(){return!this.__axis}function xc(e,t){var n=[],r=null,i=null,a=6,o=6,s=3,l=typeof window<`u`&&window.devicePixelRatio>1?0:.5,u=e===Sc||e===Tc?-1:1,d=e===Tc||e===Cc?`x`:`y`,f=e===Sc||e===wc?mre:hre;function p(p){var m=r??(t.ticks?t.ticks.apply(t,n):t.domain()),h=i??(t.tickFormat?t.tickFormat.apply(t,n):fre),g=Math.max(a,0)+s,_=t.range(),v=+_[0]+l,y=+_[_.length-1]+l,b=(t.bandwidth?_re:gre)(t.copy(),l),x=p.selection?p.selection():p,S=x.selectAll(`.domain`).data([null]),C=x.selectAll(`.tick`).data(m,t).order(),w=C.exit(),T=C.enter().append(`g`).attr(`class`,`tick`),E=C.select(`line`),D=C.select(`text`);S=S.merge(S.enter().insert(`path`,`.tick`).attr(`class`,`domain`).attr(`stroke`,`currentColor`)),C=C.merge(T),E=E.merge(T.append(`line`).attr(`stroke`,`currentColor`).attr(d+`2`,u*a)),D=D.merge(T.append(`text`).attr(`fill`,`currentColor`).attr(d,u*g).attr(`dy`,e===Sc?`0em`:e===wc?`0.71em`:`0.32em`)),p!==x&&(S=S.transition(p),C=C.transition(p),E=E.transition(p),D=D.transition(p),w=w.transition(p).attr(`opacity`,Ec).attr(`transform`,function(e){return isFinite(e=b(e))?f(e+l):this.getAttribute(`transform`)}),T.attr(`opacity`,Ec).attr(`transform`,function(e){var t=this.parentNode.__axis;return f((t&&isFinite(t=t(e))?t:b(e))+l)})),w.remove(),S.attr(`d`,e===Tc||e===Cc?o?`M`+u*o+`,`+v+`H`+l+`V`+y+`H`+u*o:`M`+l+`,`+v+`V`+y:o?`M`+v+`,`+u*o+`V`+l+`H`+y+`V`+u*o:`M`+v+`,`+l+`H`+y),C.attr(`opacity`,1).attr(`transform`,function(e){return f(b(e)+l)}),E.attr(d+`2`,u*a),D.attr(d,u*g).text(h),x.filter(vre).attr(`fill`,`none`).attr(`font-size`,10).attr(`font-family`,`sans-serif`).attr(`text-anchor`,e===Cc?`start`:e===Tc?`end`:`middle`),x.each(function(){this.__axis=b})}return p.scale=function(e){return arguments.length?(t=e,p):t},p.ticks=function(){return n=Array.from(arguments),p},p.tickArguments=function(e){return arguments.length?(n=e==null?[]:Array.from(e),p):n.slice()},p.tickValues=function(e){return arguments.length?(r=e==null?null:Array.from(e),p):r&&r.slice()},p.tickFormat=function(e){return arguments.length?(i=e,p):i},p.tickSize=function(e){return arguments.length?(a=o=+e,p):a},p.tickSizeInner=function(e){return arguments.length?(a=+e,p):a},p.tickSizeOuter=function(e){return arguments.length?(o=+e,p):o},p.tickPadding=function(e){return arguments.length?(s=+e,p):s},p.offset=function(e){return arguments.length?(l=+e,p):l},p}function yre(e){return xc(Sc,e)}function bre(e){return xc(wc,e)}var Sc,Cc,wc,Tc,Ec,xre=o((()=>{pre(),Sc=1,Cc=2,wc=3,Tc=4,Ec=1e-6})),Sre=o((()=>{xre()}));function Dc(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new Oc(n)}function Oc(e){this._=e}function Cre(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}function wre(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function kc(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Ac,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ac,Tre=o((()=>{Ac={value:()=>{}},Oc.prototype=Dc.prototype={constructor:Oc,on:function(e,t){var n=this._,r=Cre(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=wre(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=kc(n[i],e.name,t);else if(t==null)for(i in n)n[i]=kc(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Oc(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}}})),jc=o((()=>{Tre()})),Mc,Nc,Pc=o((()=>{Mc=`http://www.w3.org/1999/xhtml`,Nc={svg:`http://www.w3.org/2000/svg`,xhtml:Mc,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`}}));function Fc(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),Nc.hasOwnProperty(t)?{space:Nc[t],local:e}:e}var Ic=o((()=>{Pc()}));function Ere(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function Dre(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Lc(e){var t=Fc(e);return(t.local?Dre:Ere)(t)}var Rc=o((()=>{Ic(),Pc()}));function Ore(){}function zc(e){return e==null?Ore:function(){return this.querySelector(e)}}var Bc=o((()=>{}));function kre(e){typeof e!=`function`&&(e=zc(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),l,u,d=0;d<o;++d)(l=a[d])&&(u=e.call(l,l.__data__,d,a))&&(`__data__`in l&&(u.__data__=l.__data__),s[d]=u);return new Yc(r,this._parents)}var Are=o((()=>{Qc(),Bc()}));function jre(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}var Vc=o((()=>{}));function Mre(){return[]}function Hc(e){return e==null?Mre:function(){return this.querySelectorAll(e)}}var Uc=o((()=>{}));function Nre(e){return function(){return jre(e.apply(this,arguments))}}function Pre(e){e=typeof e==`function`?Nre(e):Hc(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,l,u=0;u<s;++u)(l=o[u])&&(r.push(e.call(l,l.__data__,u,o)),i.push(l));return new Yc(r,i)}var Fre=o((()=>{Qc(),Vc(),Uc()}));function Ire(e){return function(){return this.matches(e)}}function Lre(e){return function(t){return t.matches(e)}}var Wc=o((()=>{}));function Rre(e){return function(){return Vre.call(this.children,e)}}function zre(){return this.firstElementChild}function Bre(e){return this.select(e==null?zre:Rre(typeof e==`function`?e:Lre(e)))}var Vre,Hre=o((()=>{Wc(),Vre=Array.prototype.find}));function Ure(){return Array.from(this.children)}function Wre(e){return function(){return Kre.call(this.children,e)}}function Gre(e){return this.selectAll(e==null?Ure:Wre(typeof e==`function`?e:Lre(e)))}var Kre,qre=o((()=>{Wc(),Kre=Array.prototype.filter}));function Jre(e){typeof e!=`function`&&(e=Ire(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],l,u=0;u<o;++u)(l=a[u])&&e.call(l,l.__data__,u,a)&&s.push(l);return new Yc(r,this._parents)}var Yre=o((()=>{Qc(),Wc()}));function Xre(e){return Array(e.length)}var Zre=o((()=>{}));function Qre(){return new Yc(this._enter||this._groups.map(Xre),this._parents)}function Gc(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}var $re=o((()=>{Zre(),Qc(),Gc.prototype={constructor:Gc,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}}}));function eie(e){return function(){return e}}var tie=o((()=>{}));function nie(e,t,n,r,i,a){for(var o=0,s,l=t.length,u=a.length;o<u;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new Gc(e,a[o]);for(;o<l;++o)(s=t[o])&&(i[o]=s)}function rie(e,t,n,r,i,a,o){var s,l,u=new Map,d=t.length,f=a.length,p=Array(d),m;for(s=0;s<d;++s)(l=t[s])&&(p[s]=m=o.call(l,l.__data__,s,t)+``,u.has(m)?i[s]=l:u.set(m,l));for(s=0;s<f;++s)m=o.call(e,a[s],s,a)+``,(l=u.get(m))?(r[s]=l,l.__data__=a[s],u.delete(m)):n[s]=new Gc(e,a[s]);for(s=0;s<d;++s)(l=t[s])&&u.get(p[s])===l&&(i[s]=l)}function iie(e){return e.__data__}function aie(e,t){if(!arguments.length)return Array.from(this,iie);var n=t?rie:nie,r=this._parents,i=this._groups;typeof e!=`function`&&(e=eie(e));for(var a=i.length,o=Array(a),s=Array(a),l=Array(a),u=0;u<a;++u){var d=r[u],f=i[u],p=f.length,m=oie(e.call(d,d&&d.__data__,u,r)),h=m.length,g=s[u]=Array(h),_=o[u]=Array(h);n(d,f,g,_,l[u]=Array(p),m,t);for(var v=0,y=0,b,x;v<h;++v)if(b=g[v]){for(v>=y&&(y=v+1);!(x=_[y])&&++y<h;);b._next=x||null}}return o=new Yc(o,r),o._enter=s,o._exit=l,o}function oie(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}var sie=o((()=>{Qc(),$re(),tie()}));function cie(){return new Yc(this._exit||this._groups.map(Xre),this._parents)}var lie=o((()=>{Zre(),Qc()}));function uie(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}var die=o((()=>{}));function fie(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),l=0;l<o;++l)for(var u=n[l],d=r[l],f=u.length,p=s[l]=Array(f),m,h=0;h<f;++h)(m=u[h]||d[h])&&(p[h]=m);for(;l<i;++l)s[l]=n[l];return new Yc(s,this._parents)}var pie=o((()=>{Qc()}));function mie(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}var hie=o((()=>{}));function gie(e){e||=_ie;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,l=i[a]=Array(s),u,d=0;d<s;++d)(u=o[d])&&(l[d]=u);l.sort(t)}return new Yc(i,this._parents).order()}function _ie(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}var vie=o((()=>{Qc()}));function yie(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}var bie=o((()=>{}));function xie(){return Array.from(this)}var Sie=o((()=>{}));function Cie(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}var wie=o((()=>{}));function Tie(){let e=0;for(let t of this)++e;return e}var Eie=o((()=>{}));function Die(){return!this.node()}var Oie=o((()=>{}));function kie(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}var Aie=o((()=>{}));function jie(e){return function(){this.removeAttribute(e)}}function Mie(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Nie(e,t){return function(){this.setAttribute(e,t)}}function Pie(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Fie(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Iie(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Lie(e,t){var n=Fc(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Mie:jie:typeof t==`function`?n.local?Iie:Fie:n.local?Pie:Nie)(n,t))}var Rie=o((()=>{Ic()}));function zie(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}var Kc=o((()=>{}));function Bie(e){return function(){this.style.removeProperty(e)}}function Vie(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Hie(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Uie(e,t,n){return arguments.length>1?this.each((t==null?Bie:typeof t==`function`?Hie:Vie)(e,t,n??``)):qc(this.node(),e)}function qc(e,t){return e.style.getPropertyValue(t)||zie(e).getComputedStyle(e,null).getPropertyValue(t)}var Wie=o((()=>{Kc()}));function Gie(e){return function(){delete this[e]}}function Kie(e,t){return function(){this[e]=t}}function qie(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Jie(e,t){return arguments.length>1?this.each((t==null?Gie:typeof t==`function`?qie:Kie)(e,t)):this.node()[e]}var Yie=o((()=>{}));function Xie(e){return e.trim().split(/^|\s+/)}function Jc(e){return e.classList||new Zie(e)}function Zie(e){this._node=e,this._names=Xie(e.getAttribute(`class`)||``)}function Qie(e,t){for(var n=Jc(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function $ie(e,t){for(var n=Jc(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function eae(e){return function(){Qie(this,e)}}function tae(e){return function(){$ie(this,e)}}function nae(e,t){return function(){(t.apply(this,arguments)?Qie:$ie)(this,e)}}function rae(e,t){var n=Xie(e+``);if(arguments.length<2){for(var r=Jc(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?nae:t?eae:tae)(n,t))}var iae=o((()=>{Zie.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}}}));function aae(){this.textContent=``}function oae(e){return function(){this.textContent=e}}function sae(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function cae(e){return arguments.length?this.each(e==null?aae:(typeof e==`function`?sae:oae)(e)):this.node().textContent}var lae=o((()=>{}));function uae(){this.innerHTML=``}function dae(e){return function(){this.innerHTML=e}}function fae(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function pae(e){return arguments.length?this.each(e==null?uae:(typeof e==`function`?fae:dae)(e)):this.node().innerHTML}var mae=o((()=>{}));function hae(){this.nextSibling&&this.parentNode.appendChild(this)}function gae(){return this.each(hae)}var _ae=o((()=>{}));function vae(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function yae(){return this.each(vae)}var bae=o((()=>{}));function xae(e){var t=typeof e==`function`?e:Lc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}var Sae=o((()=>{Rc()}));function Cae(){return null}function wae(e,t){var n=typeof e==`function`?e:Lc(e),r=t==null?Cae:typeof t==`function`?t:zc(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}var Tae=o((()=>{Rc(),Bc()}));function Eae(){var e=this.parentNode;e&&e.removeChild(this)}function Dae(){return this.each(Eae)}var Oae=o((()=>{}));function kae(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Aae(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function jae(e){return this.select(e?Aae:kae)}var Mae=o((()=>{}));function Nae(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}var Pae=o((()=>{}));function Fae(e){return function(t){e.call(this,t,this.__data__)}}function Iae(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function Lae(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function Rae(e,t,n){return function(){var r=this.__on,i,a=Fae(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function zae(e,t,n){var r=Iae(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,u=s.length,d;l<u;++l)for(i=0,d=s[l];i<a;++i)if((o=r[i]).type===d.type&&o.name===d.name)return d.value}return}for(s=t?Rae:Lae,i=0;i<a;++i)this.each(s(r[i],t,n));return this}var Bae=o((()=>{}));function Vae(e,t,n){var r=zie(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Hae(e,t){return function(){return Vae(this,e,t)}}function Uae(e,t){return function(){return Vae(this,e,t.apply(this,arguments))}}function Wae(e,t){return this.each((typeof t==`function`?Uae:Hae)(e,t))}var Gae=o((()=>{Kc()}));function*Kae(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var qae=o((()=>{}));function Yc(e,t){this._groups=e,this._parents=t}function Xc(){return new Yc([[document.documentElement]],Zc)}function Jae(){return this}var Zc,Qc=o((()=>{Are(),Fre(),Hre(),qre(),Yre(),sie(),$re(),lie(),die(),pie(),hie(),vie(),bie(),Sie(),wie(),Eie(),Oie(),Aie(),Rie(),Wie(),Yie(),iae(),lae(),mae(),_ae(),bae(),Sae(),Tae(),Oae(),Mae(),Pae(),Bae(),Gae(),qae(),Zc=[null],Yc.prototype=Xc.prototype={constructor:Yc,select:kre,selectAll:Pre,selectChild:Bre,selectChildren:Gre,filter:Jre,data:aie,enter:Qre,exit:cie,join:uie,merge:fie,selection:Jae,order:mie,sort:gie,call:yie,nodes:xie,node:Cie,size:Tie,empty:Die,each:kie,attr:Lie,style:Uie,property:Jie,classed:rae,text:cae,html:pae,raise:gae,lower:yae,append:xae,insert:wae,remove:Dae,clone:jae,datum:Nae,on:zae,dispatch:Wae,[Symbol.iterator]:Kae}}));function $c(e){return typeof e==`string`?new Yc([[document.querySelector(e)]],[document.documentElement]):new Yc([[e]],Zc)}var Yae=o((()=>{Qc()})),el=o((()=>{Rc(),Yae(),Wc(),Ic(),Pc(),Vc(),Qc(),Bc(),Uc(),Wie(),Kc()})),Xae=o((()=>{jc(),el()}));function tl(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function nl(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}var rl=o((()=>{}));function il(){}function Zae(){return this.rgb().formatHex()}function Qae(){return this.rgb().formatHex8()}function $ae(){return soe(this).formatHsl()}function eoe(){return this.rgb().formatRgb()}function al(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=uoe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?toe(t):n===3?new cl(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ol(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ol(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=doe.exec(e))?new cl(t[1],t[2],t[3],1):(t=foe.exec(e))?new cl(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=poe.exec(e))?ol(t[1],t[2],t[3],t[4]):(t=moe.exec(e))?ol(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=hoe.exec(e))?ooe(t[1],t[2]/100,t[3]/100,1):(t=goe.exec(e))?ooe(t[1],t[2]/100,t[3]/100,t[4]):bl.hasOwnProperty(e)?toe(bl[e]):e===`transparent`?new cl(NaN,NaN,NaN,0):null}function toe(e){return new cl(e>>16&255,e>>8&255,e&255,1)}function ol(e,t,n,r){return r<=0&&(e=t=n=NaN),new cl(e,t,n,r)}function noe(e){return e instanceof il||(e=al(e)),e?(e=e.rgb(),new cl(e.r,e.g,e.b,e.opacity)):new cl}function sl(e,t,n,r){return arguments.length===1?noe(e):new cl(e,t,n,r??1)}function cl(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function roe(){return`#${dl(this.r)}${dl(this.g)}${dl(this.b)}`}function ioe(){return`#${dl(this.r)}${dl(this.g)}${dl(this.b)}${dl((isNaN(this.opacity)?1:this.opacity)*255)}`}function aoe(){let e=ll(this.opacity);return`${e===1?`rgb(`:`rgba(`}${ul(this.r)}, ${ul(this.g)}, ${ul(this.b)}${e===1?`)`:`, ${e})`}`}function ll(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ul(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function dl(e){return e=ul(e),(e<16?`0`:``)+e.toString(16)}function ooe(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fl(e,t,n,r)}function soe(e){if(e instanceof fl)return new fl(e.h,e.s,e.l,e.opacity);if(e instanceof il||(e=al(e)),!e)return new fl;if(e instanceof fl)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,l=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=l>0&&l<1?0:o,new fl(o,s,l,e.opacity)}function coe(e,t,n,r){return arguments.length===1?soe(e):new fl(e,t,n,r??1)}function fl(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function loe(e){return e=(e||0)%360,e<0?e+360:e}function pl(e){return Math.max(0,Math.min(1,e||0))}function ml(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var hl,gl,_l,vl,yl,uoe,doe,foe,poe,moe,hoe,goe,bl,_oe=o((()=>{rl(),hl=.7,gl=1/hl,_l=`\\s*([+-]?\\d+)\\s*`,vl=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,yl=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,uoe=/^#([0-9a-f]{3,8})$/,doe=RegExp(`^rgb\\(${_l},${_l},${_l}\\)$`),foe=RegExp(`^rgb\\(${yl},${yl},${yl}\\)$`),poe=RegExp(`^rgba\\(${_l},${_l},${_l},${vl}\\)$`),moe=RegExp(`^rgba\\(${yl},${yl},${yl},${vl}\\)$`),hoe=RegExp(`^hsl\\(${vl},${yl},${yl}\\)$`),goe=RegExp(`^hsla\\(${vl},${yl},${yl},${vl}\\)$`),bl={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},tl(il,al,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Zae,formatHex:Zae,formatHex8:Qae,formatHsl:$ae,formatRgb:eoe,toString:eoe}),tl(cl,sl,nl(il,{brighter(e){return e=e==null?gl:gl**+e,new cl(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?hl:hl**+e,new cl(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new cl(ul(this.r),ul(this.g),ul(this.b),ll(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:roe,formatHex:roe,formatHex8:ioe,formatRgb:aoe,toString:aoe})),tl(fl,coe,nl(il,{brighter(e){return e=e==null?gl:gl**+e,new fl(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?hl:hl**+e,new fl(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new cl(ml(e>=240?e-240:e+120,i,r),ml(e,i,r),ml(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new fl(loe(this.h),pl(this.s),pl(this.l),ll(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=ll(this.opacity);return`${e===1?`hsl(`:`hsla(`}${loe(this.h)}, ${pl(this.s)*100}%, ${pl(this.l)*100}%${e===1?`)`:`, ${e})`}`}}))})),voe,yoe,boe=o((()=>{voe=Math.PI/180,yoe=180/Math.PI}));function xoe(e){if(e instanceof xl)return new xl(e.l,e.a,e.b,e.opacity);if(e instanceof Dl)return woe(e);e instanceof cl||(e=noe(e));var t=Tl(e.r),n=Tl(e.g),r=Tl(e.b),i=Sl((.2225045*t+.7168786*n+.0606169*r)/Al),a,o;return t===n&&n===r?a=o=i:(a=Sl((.4360747*t+.3850649*n+.1430804*r)/kl),o=Sl((.0139322*t+.0971045*n+.7141733*r)/jl)),new xl(116*i-16,500*(a-i),200*(i-o),e.opacity)}function Soe(e,t,n,r){return arguments.length===1?xoe(e):new xl(e,t,n,r??1)}function xl(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Sl(e){return e>Toe?e**(1/3):e/Pl+Ml}function Cl(e){return e>Nl?e*e*e:Pl*(e-Ml)}function wl(e){return 255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)}function Tl(e){return(e/=255)<=.04045?e/12.92:((e+.055)/1.055)**2.4}function Coe(e){if(e instanceof Dl)return new Dl(e.h,e.c,e.l,e.opacity);if(e instanceof xl||(e=xoe(e)),e.a===0&&e.b===0)return new Dl(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*yoe;return new Dl(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function El(e,t,n,r){return arguments.length===1?Coe(e):new Dl(e,t,n,r??1)}function Dl(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function woe(e){if(isNaN(e.h))return new xl(e.l,0,0,e.opacity);var t=e.h*voe;return new xl(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}var Ol,kl,Al,jl,Ml,Nl,Pl,Toe,Eoe=o((()=>{rl(),_oe(),boe(),Ol=18,kl=.96422,Al=1,jl=.82521,Ml=4/29,Nl=6/29,Pl=3*Nl*Nl,Toe=Nl*Nl*Nl,tl(xl,Soe,nl(il,{brighter(e){return new xl(this.l+Ol*(e??1),this.a,this.b,this.opacity)},darker(e){return new xl(this.l-Ol*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=kl*Cl(t),e=Al*Cl(e),n=jl*Cl(n),new cl(wl(3.1338561*t-1.6168667*e-.4906146*n),wl(-.9787684*t+1.9161415*e+.033454*n),wl(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),tl(Dl,El,nl(il,{brighter(e){return new Dl(this.h,this.c,this.l+Ol*(e??1),this.opacity)},darker(e){return new Dl(this.h,this.c,this.l-Ol*(e??1),this.opacity)},rgb(){return woe(this).rgb()}}))})),Fl=o((()=>{_oe(),Eoe(),rl(),boe()})),Il=o((()=>{})),Doe=o((()=>{Il()})),Ll,Ooe=o((()=>{Ll=e=>()=>e}));function koe(e,t){return function(n){return e+n*t}}function Aoe(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function joe(e,t){var n=t-e;return n?koe(e,n>180||n<-180?n-360*Math.round(n/360):n):Ll(isNaN(e)?t:e)}function Moe(e){return(e=+e)==1?Rl:function(t,n){return n-t?Aoe(t,n,e):Ll(isNaN(t)?n:t)}}function Rl(e,t){var n=t-e;return n?koe(e,n):Ll(isNaN(e)?t:e)}var zl=o((()=>{Ooe()})),Bl,Noe=o((()=>{Fl(),Il(),Doe(),zl(),Bl=(function e(t){var n=Moe(t);function r(e,t){var r=n((e=sl(e)).r,(t=sl(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Rl(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1)}));function Poe(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Foe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}var Ioe=o((()=>{}));function Loe(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=Gl(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}var Roe=o((()=>{Kl()}));function zoe(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}var Boe=o((()=>{}));function Vl(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Hl=o((()=>{}));function Voe(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=Gl(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var Hoe=o((()=>{Kl()}));function Uoe(e){return function(){return e}}function Woe(e){return function(t){return e(t)+``}}function Goe(e,t){var n=Ul.lastIndex=Wl.lastIndex=0,r,i,a,o=-1,s=[],l=[];for(e+=``,t+=``;(r=Ul.exec(e))&&(i=Wl.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:Vl(r,i)})),n=Wl.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?l[0]?Woe(l[0].x):Uoe(t):(t=l.length,function(e){for(var n=0,r;n<t;++n)s[(r=l[n]).i]=r.x(e);return s.join(``)})}var Ul,Wl,Koe=o((()=>{Hl(),Ul=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Wl=new RegExp(Ul.source,`g`)}));function Gl(e,t){var n=typeof t,r;return t==null||n===`boolean`?Ll(t):(n===`number`?Vl:n===`string`?(r=al(t))?(t=r,Bl):Goe:t instanceof al?Bl:t instanceof Date?zoe:Foe(t)?Poe:Array.isArray(t)?Loe:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?Voe:Vl)(e,t)}var Kl=o((()=>{Fl(),Noe(),Roe(),Boe(),Hl(),Hoe(),Koe(),Ooe(),Ioe()}));function qoe(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var Joe=o((()=>{}));function Yoe(e,t,n,r,i,a){var o,s,l;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r<t*n&&(e=-e,t=-t,l=-l,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*ql,skewX:Math.atan(l)*ql,scaleX:o,scaleY:s}}var ql,Jl,Xoe=o((()=>{ql=180/Math.PI,Jl={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}}));function Zoe(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?Jl:Yoe(t.a,t.b,t.c,t.d,t.e,t.f)}function Qoe(e){return e==null||(Yl||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),Yl.setAttribute(`transform`,e),!(e=Yl.transform.baseVal.consolidate()))?Jl:(e=e.matrix,Yoe(e.a,e.b,e.c,e.d,e.e,e.f))}var Yl,$oe=o((()=>{Xoe()}));function ese(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var l=o.push(`translate(`,null,t,null,n);s.push({i:l-4,x:Vl(e,i)},{i:l-2,x:Vl(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:Vl(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:Vl(e,t)})}function l(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:Vl(e,n)},{i:s-2,x:Vl(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),l(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var tse,nse,rse=o((()=>{Hl(),$oe(),tse=ese(Zoe,`px, `,`px)`,`deg)`),nse=ese(Qoe,`, `,`)`,`)`)}));function ise(e){return function(t,n){var r=e((t=El(t)).h,(n=El(n)).h),i=Rl(t.c,n.c),a=Rl(t.l,n.l),o=Rl(t.opacity,n.opacity);return function(e){return t.h=r(e),t.c=i(e),t.l=a(e),t.opacity=o(e),t+``}}}var ase,ose=o((()=>{Fl(),zl(),ase=ise(joe)})),Xl=o((()=>{Kl(),Roe(),Il(),Doe(),Boe(),zl(),Hl(),Ioe(),Hoe(),Joe(),Koe(),rse(),Noe(),Fl(),ose()}));function Zl(){return su||=(uu(sse),lu.now()+cu)}function sse(){su=0}function Ql(){this._call=this._time=this._next=null}function cse(e,t,n){var r=new Ql;return r.restart(e,t,n),r}function lse(){Zl(),++eu;for(var e=iu,t;e;)(t=su-e._time)>=0&&e._call.call(void 0,t),e=e._next;--eu}function use(){su=(ou=lu.now())+cu,eu=tu=0;try{lse()}finally{eu=0,fse(),su=0}}function dse(){var e=lu.now(),t=e-ou;t>ru&&(cu-=t,ou=e)}function fse(){for(var e,t=iu,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:iu=n);au=e,$l(r)}function $l(e){eu||(tu&&=clearTimeout(tu),e-su>24?(e<1/0&&(tu=setTimeout(use,e-lu.now()-cu)),nu&&=clearInterval(nu)):(nu||=(ou=lu.now(),setInterval(dse,ru)),eu=1,uu(use)))}var eu,tu,nu,ru,iu,au,ou,su,cu,lu,uu,pse=o((()=>{eu=0,tu=0,nu=0,ru=1e3,ou=0,su=0,cu=0,lu=typeof performance==`object`&&performance.now?performance:Date,uu=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)},Ql.prototype=cse.prototype={constructor:Ql,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Zl():+n)+(t==null?0:+t),!this._next&&au!==this&&(au?au._next=this:iu=this,au=this),this._call=e,this._time=n,$l()},stop:function(){this._call&&(this._call=null,this._time=1/0,$l())}}}));function mse(e,t,n){var r=new Ql;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var hse=o((()=>{pse()})),du=o((()=>{pse(),hse()}));function fu(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;gse(e,n,{name:t,index:r,group:i,on:_se,tween:vse,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function pu(e,t){var n=hu(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function mu(e,t){var n=hu(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function hu(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function gse(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=cse(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var u,d,f,p;if(n.state!==1)return l();for(u in r)if(p=r[u],p.name===n.name){if(p.state===3)return mse(o);p.state===4?(p.state=6,p.timer.stop(),p.on.call(`interrupt`,e,e.__data__,p.index,p.group),delete r[u]):+u<t&&(p.state=6,p.timer.stop(),p.on.call(`cancel`,e,e.__data__,p.index,p.group),delete r[u])}if(mse(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(f=n.tween.length),u=0,d=-1;u<f;++u)(p=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=p);i.length=d+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),l())}function l(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}var _se,vse,gu=o((()=>{jc(),du(),_se=Dc(`start`,`end`,`cancel`,`interrupt`),vse=[]}));function yse(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}var bse=o((()=>{gu()}));function xse(e){return this.each(function(){yse(this,e)})}var Sse=o((()=>{bse()}));function Cse(e,t){var n,r;return function(){var i=mu(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function wse(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=mu(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=s;break}l===u&&i.push(s)}a.tween=i}}function Tse(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=hu(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Cse:wse)(n,e,t))}function _u(e,t,n){var r=e._id;return e.each(function(){var e=mu(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return hu(e,r).value[t]}}var vu=o((()=>{gu()}));function Ese(e,t){var n;return(typeof t==`number`?Vl:t instanceof al?Bl:(n=al(t))?(t=n,Bl):Goe)(e,t)}var Dse=o((()=>{Fl(),Xl()}));function Ose(e){return function(){this.removeAttribute(e)}}function kse(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ase(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function jse(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function Mse(e,t,n){var r,i,a;return function(){var o,s=n(this),l;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),l=s+``,o===l?null:o===r&&l===i?a:(i=l,a=t(r=o,s)))}}function Nse(e,t,n){var r,i,a;return function(){var o,s=n(this),l;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),l=s+``,o===l?null:o===r&&l===i?a:(i=l,a=t(r=o,s)))}}function Pse(e,t){var n=Fc(e),r=n===`transform`?nse:Ese;return this.attrTween(e,typeof t==`function`?(n.local?Nse:Mse)(n,r,_u(this,`attr.`+e,t)):t==null?(n.local?kse:Ose)(n):(n.local?jse:Ase)(n,r,t))}var Fse=o((()=>{Xl(),el(),vu(),Dse()}));function Ise(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Lse(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Rse(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Lse(e,i)),n}return i._value=t,i}function zse(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Ise(e,i)),n}return i._value=t,i}function Bse(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=Fc(e);return this.tween(n,(r.local?Rse:zse)(r,t))}var Vse=o((()=>{el()}));function Hse(e,t){return function(){pu(this,e).delay=+t.apply(this,arguments)}}function Use(e,t){return t=+t,function(){pu(this,e).delay=t}}function Wse(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Hse:Use)(t,e)):hu(this.node(),t).delay}var Gse=o((()=>{gu()}));function Kse(e,t){return function(){mu(this,e).duration=+t.apply(this,arguments)}}function qse(e,t){return t=+t,function(){mu(this,e).duration=t}}function Jse(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Kse:qse)(t,e)):hu(this.node(),t).duration}var Yse=o((()=>{gu()}));function Xse(e,t){if(typeof t!=`function`)throw Error();return function(){mu(this,e).ease=t}}function Zse(e){var t=this._id;return arguments.length?this.each(Xse(t,e)):hu(this.node(),t).ease}var Qse=o((()=>{gu()}));function $se(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();mu(this,e).ease=n}}function ece(e){if(typeof e!=`function`)throw Error();return this.each($se(this._id,e))}var tce=o((()=>{gu()}));function nce(e){typeof e!=`function`&&(e=Ire(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],l,u=0;u<o;++u)(l=a[u])&&e.call(l,l.__data__,u,a)&&s.push(l);return new yu(r,this._parents,this._name,this._id)}var rce=o((()=>{el(),xu()}));function ice(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var l=t[s],u=n[s],d=l.length,f=o[s]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;s<r;++s)o[s]=t[s];return new yu(o,this._parents,this._name,this._id)}var ace=o((()=>{xu()}));function oce(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function sce(e,t,n){var r,i,a=oce(t)?pu:mu;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function cce(e,t){var n=this._id;return arguments.length<2?hu(this.node(),n).on.on(e):this.each(sce(n,e,t))}var lce=o((()=>{gu()}));function uce(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function dce(){return this.on(`end.remove`,uce(this._id))}var fce=o((()=>{}));function pce(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=zc(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],l=s.length,u=a[o]=Array(l),d,f,p=0;p<l;++p)(d=s[p])&&(f=e.call(d,d.__data__,p,s))&&(`__data__`in d&&(f.__data__=d.__data__),u[p]=f,fu(u[p],t,n,p,u,hu(d,n)));return new yu(a,this._parents,t,n)}var mce=o((()=>{el(),xu(),gu()}));function hce(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Hc(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var l=r[s],u=l.length,d,f=0;f<u;++f)if(d=l[f]){for(var p=e.call(d,d.__data__,f,l),m,h=hu(d,n),g=0,_=p.length;g<_;++g)(m=p[g])&&fu(m,t,n,g,p,h);a.push(p),o.push(d)}return new yu(a,o,t,n)}var gce=o((()=>{el(),xu(),gu()}));function _ce(){return new vce(this._groups,this._parents)}var vce,yce=o((()=>{el(),vce=Xc.prototype.constructor}));function bce(e,t){var n,r,i;return function(){var a=qc(this,e),o=(this.style.removeProperty(e),qc(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function xce(e){return function(){this.style.removeProperty(e)}}function Sce(e,t,n){var r,i=n+``,a;return function(){var o=qc(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Cce(e,t,n){var r,i,a;return function(){var o=qc(this,e),s=n(this),l=s+``;return s??(l=s=(this.style.removeProperty(e),qc(this,e))),o===l?null:o===r&&l===i?a:(i=l,a=t(r=o,s))}}function wce(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var l=mu(this,e),u=l.on,d=l.value[a]==null?s||=xce(t):void 0;(u!==n||i!==d)&&(r=(n=u).copy()).on(o,i=d),l.on=r}}function Tce(e,t,n){var r=(e+=``)==`transform`?tse:Ese;return t==null?this.styleTween(e,bce(e,r)).on(`end.style.`+e,xce(e)):typeof t==`function`?this.styleTween(e,Cce(e,r,_u(this,`style.`+e,t))).each(wce(this._id,e)):this.styleTween(e,Sce(e,r,t),n).on(`end.style.`+e,null)}var Ece=o((()=>{Xl(),el(),gu(),vu(),Dse()}));function Dce(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Oce(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Dce(e,a,n)),r}return a._value=t,a}function kce(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,Oce(e,t,n??``))}var Ace=o((()=>{}));function jce(e){return function(){this.textContent=e}}function Mce(e){return function(){var t=e(this);this.textContent=t??``}}function Nce(e){return this.tween(`text`,typeof e==`function`?Mce(_u(this,`text`,e)):jce(e==null?``:e+``))}var Pce=o((()=>{vu()}));function Fce(e){return function(t){this.textContent=e.call(this,t)}}function Ice(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Fce(r)),t}return r._value=e,r}function Lce(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,Ice(e))}var Rce=o((()=>{}));function zce(){for(var e=this._name,t=this._id,n=Uce(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,l,u=0;u<s;++u)if(l=o[u]){var d=hu(l,t);fu(l,e,n,u,o,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new yu(r,this._parents,e,n)}var Bce=o((()=>{xu(),gu()}));function Vce(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},l={value:function(){--i===0&&a()}};n.each(function(){var n=mu(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),n.on=t}),i===0&&a()})}var Hce=o((()=>{gu()}));function yu(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Uce(){return++Wce}var Wce,bu,xu=o((()=>{el(),Fse(),Vse(),Gse(),Yse(),Qse(),tce(),rce(),ace(),lce(),fce(),mce(),gce(),yce(),Ece(),Ace(),Pce(),Rce(),Bce(),vu(),Hce(),Wce=0,bu=Xc.prototype,yu.prototype={constructor:yu,select:pce,selectAll:hce,selectChild:bu.selectChild,selectChildren:bu.selectChildren,filter:nce,merge:ice,selection:_ce,transition:zce,call:bu.call,nodes:bu.nodes,node:bu.node,size:bu.size,empty:bu.empty,each:bu.each,on:cce,attr:Pse,attrTween:Bse,style:Tce,styleTween:kce,text:Nce,textTween:Lce,remove:dce,tween:Tse,delay:Wse,duration:Jse,ease:Zse,easeVarying:ece,end:Vce,[Symbol.iterator]:bu[Symbol.iterator]}}));function Gce(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Kce=o((()=>{})),qce=o((()=>{Kce()}));function Jce(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function Yce(e){var t,n;e instanceof yu?(t=e._id,e=e._name):(t=Uce(),(n=Xce).time=Zl(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,l,u=0;u<s;++u)(l=o[u])&&fu(l,e,t,u,o,n||Jce(l,t));return new yu(r,this._parents,e,t)}var Xce,Zce=o((()=>{xu(),gu(),qce(),du(),Xce={time:null,delay:0,duration:250,ease:Gce}})),Qce=o((()=>{el(),Sse(),Zce(),Xc.prototype.interrupt=xse,Xc.prototype.transition=Yce})),Su=o((()=>{Qce(),xu(),gu(),bse()}));function Cu(e){return{type:e}}var $ce,ele,tle,nle=o((()=>{Su(),{abs:$ce,max:ele,min:tle}=Math,[`w`,`e`].map(Cu),[`n`,`s`].map(Cu),[`n`,`w`,`e`,`s`,`nw`,`ne`,`sw`,`se`].map(Cu)})),rle=o((()=>{nle()}));function ile(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function ale(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return ile;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var wu,Tu,Eu,ole,Du,sle=o((()=>{wu=Math.PI,Tu=2*wu,Eu=1e-6,ole=Tu-Eu,Du=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?ile:ale(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,l=r-t,u=a-e,d=o-t,f=u*u+d*d;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(f>Eu){if(!(Math.abs(d*s-l*u)>Eu)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let p=n-a,m=r-o,h=s*s+l*l,g=p*p+m*m,_=Math.sqrt(h),v=Math.sqrt(f),y=i*Math.tan((wu-Math.acos((h+f-g)/(2*_*v)))/2),b=y/v,x=y/_;Math.abs(b-1)>Eu&&this._append`L${e+b*u},${t+b*d}`,this._append`A${i},${i},0,0,${+(d*p>u*m)},${this._x1=e+x*s},${this._y1=t+x*l}`}}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),l=e+o,u=t+s,d=1^a,f=a?r-i:i-r;this._x1===null?this._append`M${l},${u}`:(Math.abs(this._x1-l)>Eu||Math.abs(this._y1-u)>Eu)&&this._append`L${l},${u}`,n&&(f<0&&(f=f%Tu+Tu),f>ole?this._append`A${n},${n},0,1,${d},${e-o},${t-s}A${n},${n},0,1,${d},${this._x1=l},${this._y1=u}`:f>Eu&&this._append`A${n},${n},0,${+(f>=wu)},${d},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}},Du.prototype})),Ou=o((()=>{sle()})),cle=o((()=>{Ou()})),lle=o((()=>{bc()})),ule=o((()=>{})),dle=o((()=>{})),fle=o((()=>{dle()})),ple=o((()=>{})),mle=o((()=>{ple(),jc(),du()}));function hle(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function ku(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}var Au=o((()=>{}));function ju(e){return e=ku(Math.abs(e)),e?e[1]:NaN}var Mu=o((()=>{Au()}));function gle(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),a.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}var _le=o((()=>{}));function vle(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var yle=o((()=>{}));function Nu(e){if(!(t=ble.exec(e)))throw Error(`invalid format: `+e);var t;return new Pu({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function Pu(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}var ble,xle=o((()=>{ble=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i,Nu.prototype=Pu.prototype,Pu.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type}}));function Sle(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(i+1):e}var Cle=o((()=>{}));function wle(e,t){var n=ku(e,t);if(!n)return Fu=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Fu=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+ku(e,Math.max(0,t+a-1))[0]}var Fu,Tle=o((()=>{Au()}));function Ele(e,t){var n=ku(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var Dle=o((()=>{Au()})),Iu,Ole=o((()=>{Au(),Tle(),Dle(),Iu={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:hle,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Ele(e*100,t),r:Ele,s:wle,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)}}));function kle(e){return e}var Ale=o((()=>{}));function jle(e){var t=e.grouping===void 0||e.thousands===void 0?kle:gle(Lu.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?kle:vle(Lu.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,l=e.nan===void 0?`NaN`:e.nan+``;function u(e,u){e=Nu(e);var d=e.fill,f=e.align,p=e.sign,m=e.symbol,h=e.zero,g=e.width,_=e.comma,v=e.precision,y=e.trim,b=e.type;b===`n`?(_=!0,b=`g`):Iu[b]||(v===void 0&&(v=12),y=!0,b=`g`),(h||d===`0`&&f===`=`)&&(h=!0,d=`0`,f=`=`);var x=(u&&u.prefix!==void 0?u.prefix:``)+(m===`$`?n:m===`#`&&/[boxX]/.test(b)?`0`+b.toLowerCase():``),S=(m===`$`?r:/[%p]/.test(b)?o:``)+(u&&u.suffix!==void 0?u.suffix:``),C=Iu[b],w=/[defgprs%]/.test(b);v=v===void 0?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function T(e){var n=x,r=S,o,u,m;if(b===`c`)r=C(e)+r,e=``;else{e=+e;var T=e<0||1/e<0;if(e=isNaN(e)?l:C(Math.abs(e),v),y&&(e=Sle(e)),T&&+e==0&&p!==`+`&&(T=!1),n=(T?p===`(`?p:s:p===`-`||p===`(`?``:p)+n,r=(b===`s`&&!isNaN(e)&&Fu!==void 0?Ru[8+Fu/3]:``)+r+(T&&p===`(`?`)`:``),w){for(o=-1,u=e.length;++o<u;)if(m=e.charCodeAt(o),48>m||m>57){r=(m===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}_&&!h&&(e=t(e,1/0));var E=n.length+e.length+r.length,D=E<g?Array(g-E+1).join(d):``;switch(_&&h&&(e=t(D+e,D.length?g-r.length:1/0),D=``),f){case`<`:e=n+e+r+D;break;case`=`:e=n+D+e+r;break;case`^`:e=D.slice(0,E=D.length>>1)+n+e+r+D.slice(E);break;default:e=D+n+e+r}return a(e)}return T.toString=function(){return e+``},T}function d(e,t){var n=Math.max(-8,Math.min(8,Math.floor(ju(t)/3)))*3,r=10**-n,i=u((e=Nu(e),e.type=`f`,e),{suffix:Ru[8+n/3]});return function(e){return i(r*e)}}return{format:u,formatPrefix:d}}var Lu,Ru,Mle=o((()=>{Mu(),_le(),yle(),xle(),Cle(),Ole(),Tle(),Ale(),Lu=Array.prototype.map,Ru=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`]}));function Nle(e){return zu=jle(e),Bu=zu.format,Ple=zu.formatPrefix,zu}var zu,Bu,Ple,Fle=o((()=>{Mle(),Nle({thousands:`,`,grouping:[3],currency:[`$`,``]})}));function Ile(e){return Math.max(0,-ju(Math.abs(e)))}var Lle=o((()=>{Mu()}));function Rle(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ju(t)/3)))*3-ju(Math.abs(e)))}var zle=o((()=>{Mu()}));function Ble(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ju(t)-ju(e))+1}var Vle=o((()=>{Mu()})),Vu=o((()=>{Fle(),Mle(),xle(),Lle(),zle(),Vle()})),Hle=o((()=>{bc()}));function Ule(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function Wle(){return this.eachAfter(Ule)}var Gle=o((()=>{}));function Kle(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}var qle=o((()=>{}));function Jle(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}var Yle=o((()=>{}));function Xle(e,t){for(var n=this,r=[n],i=[],a,o,s,l=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++l,this);return this}var Zle=o((()=>{}));function Qle(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}var $le=o((()=>{}));function eue(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}var tue=o((()=>{}));function nue(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}var rue=o((()=>{}));function iue(e){for(var t=this,n=aue(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function aue(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}var oue=o((()=>{}));function sue(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}var cue=o((()=>{}));function lue(){return Array.from(this)}var uue=o((()=>{}));function due(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}var fue=o((()=>{}));function pue(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}var mue=o((()=>{}));function*hue(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}var gue=o((()=>{}));function Hu(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=yue)):t===void 0&&(t=vue);for(var n=new Uu(e),r,i=[n],a,o,s,l;r=i.pop();)if((o=t(r.data))&&(l=(o=Array.from(o)).length))for(r.children=o,s=l-1;s>=0;--s)i.push(a=o[s]=new Uu(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(xue)}function _ue(){return Hu(this).eachBefore(bue)}function vue(e){return e.children}function yue(e){return Array.isArray(e)?e[1]:null}function bue(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function xue(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Uu(e){this.data=e,this.depth=this.height=0,this.parent=null}var Sue=o((()=>{Gle(),qle(),Yle(),Zle(),$le(),tue(),rue(),oue(),cue(),uue(),fue(),mue(),gue(),Uu.prototype=Hu.prototype={constructor:Uu,count:Wle,each:Kle,eachAfter:Xle,eachBefore:Jle,find:Qle,sum:eue,sort:nue,path:iue,ancestors:sue,descendants:lue,leaves:due,links:pue,copy:_ue,[Symbol.iterator]:hue}}));function Cue(e){if(typeof e!=`function`)throw Error();return e}var wue=o((()=>{}));function Wu(){return 0}function Gu(e){return function(){return e}}var Tue=o((()=>{}));function Eue(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}var Due=o((()=>{}));function Oue(e,t,n,r,i){for(var a=e.children,o,s=-1,l=a.length,u=e.value&&(r-t)/e.value;++s<l;)o=a[s],o.y0=n,o.y1=i,o.x0=t,o.x1=t+=o.value*u}var kue=o((()=>{}));function Aue(e,t,n,r,i){for(var a=e.children,o,s=-1,l=a.length,u=e.value&&(i-n)/e.value;++s<l;)o=a[s],o.x0=t,o.x1=r,o.y0=n,o.y1=n+=o.value*u}var jue=o((()=>{}));function Mue(e,t,n,r,i,a){for(var o=[],s=t.children,l,u,d=0,f=0,p=s.length,m,h,g=t.value,_,v,y,b,x,S,C;d<p;){m=i-n,h=a-r;do _=s[f++].value;while(!_&&f<p);for(v=y=_,S=Math.max(h/m,m/h)/(g*e),C=_*_*S,x=Math.max(y/C,C/v);f<p;++f){if(_+=u=s[f].value,u<v&&(v=u),u>y&&(y=u),C=_*_*S,b=Math.max(y/C,C/v),b>x){_-=u;break}x=b}o.push(l={value:_,dice:m<h,children:s.slice(d,f)}),l.dice?Oue(l,n,r,i,g?r+=h*_/g:a):Aue(l,n,r,g?n+=m*_/g:i,a),g-=_,d=f}return o}var Nue,Pue,Fue=o((()=>{kue(),jue(),Nue=(1+Math.sqrt(5))/2,Pue=(function e(t){function n(e,n,r,i,a){Mue(t,e,n,r,i,a)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(Nue)}));function Iue(){var e=Pue,t=!1,n=1,r=1,i=[0],a=Wu,o=Wu,s=Wu,l=Wu,u=Wu;function d(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(f),i=[0],t&&e.eachBefore(Eue),e}function f(t){var n=i[t.depth],r=t.x0+n,d=t.y0+n,f=t.x1-n,p=t.y1-n;f<r&&(r=f=(r+f)/2),p<d&&(d=p=(d+p)/2),t.x0=r,t.y0=d,t.x1=f,t.y1=p,t.children&&(n=i[t.depth+1]=a(t)/2,r+=u(t)-n,d+=o(t)-n,f-=s(t)-n,p-=l(t)-n,f<r&&(r=f=(r+f)/2),p<d&&(d=p=(d+p)/2),e(t,r,d,f,p))}return d.round=function(e){return arguments.length?(t=!!e,d):t},d.size=function(e){return arguments.length?(n=+e[0],r=+e[1],d):[n,r]},d.tile=function(t){return arguments.length?(e=Cue(t),d):e},d.padding=function(e){return arguments.length?d.paddingInner(e).paddingOuter(e):d.paddingInner()},d.paddingInner=function(e){return arguments.length?(a=typeof e==`function`?e:Gu(+e),d):a},d.paddingOuter=function(e){return arguments.length?d.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):d.paddingTop()},d.paddingTop=function(e){return arguments.length?(o=typeof e==`function`?e:Gu(+e),d):o},d.paddingRight=function(e){return arguments.length?(s=typeof e==`function`?e:Gu(+e),d):s},d.paddingBottom=function(e){return arguments.length?(l=typeof e==`function`?e:Gu(+e),d):l},d.paddingLeft=function(e){return arguments.length?(u=typeof e==`function`?e:Gu(+e),d):u},d}var Lue=o((()=>{Due(),Fue(),wue(),Tue()})),Rue=o((()=>{Sue(),Tue(),Due(),kue(),Lue(),jue(),Fue()})),zue=o((()=>{})),Bue=o((()=>{}));function Ku(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var qu=o((()=>{}));function Ju(){var e=new gc,t=[],n=[],r=Yu;function i(i){let a=e.get(i);if(a===void 0){if(r!==Yu)return r;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new gc;for(let r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return Ju(t,n).unknown(r)},Ku.apply(i,arguments),i}var Yu,Vue=o((()=>{bc(),qu(),Yu=Symbol(`implicit`)}));function Xu(){var e=Ju().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,l=0,u=0,d=.5;delete e.unknown;function f(){var e=t().length,f=i<r,p=f?i:r,m=f?r:i;a=(m-p)/Math.max(1,e-l+u*2),s&&(a=Math.floor(a)),p+=(m-p-a*(e-l))*d,o=a*(1-l),s&&(p=Math.round(p),o=Math.round(o));var h=ure(e).map(function(e){return p+a*e});return n(f?h.reverse():h)}return e.domain=function(e){return arguments.length?(t(e),f()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,f()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,f()):s},e.padding=function(e){return arguments.length?(l=Math.min(1,u=+e),f()):l},e.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),f()):l},e.paddingOuter=function(e){return arguments.length?(u=+e,f()):u},e.align=function(e){return arguments.length?(d=Math.max(0,Math.min(1,e)),f()):d},e.copy=function(){return Xu(t(),[r,i]).round(s).paddingInner(l).paddingOuter(u).align(d)},Ku.apply(f(),arguments)}var Hue=o((()=>{bc(),qu(),Vue()}));function Uue(e){return function(){return e}}var Wue=o((()=>{}));function Gue(e){return+e}var Kue=o((()=>{}));function Zu(e){return e}function Qu(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Uue(isNaN(t)?NaN:.5)}function que(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function Jue(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=Qu(i,r),a=n(o,a)):(r=Qu(r,i),a=n(a,o)),function(e){return a(r(e))}}function Yue(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=Qu(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=Jne(e,t,1,r)-1;return a[n](i[n](t))}}function Xue(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Zue(){var e=$u,t=$u,n=Gl,r,i,a,o=Zu,s,l,u;function d(){var n=Math.min(e.length,t.length);return o!==Zu&&(o=que(e[0],e[n-1])),s=n>2?Yue:Jue,l=u=null,f}function f(i){return i==null||isNaN(i=+i)?a:(l||=s(e.map(r),t,n))(r(o(i)))}return f.invert=function(n){return o(i((u||=s(t,e.map(r),Vl))(n)))},f.domain=function(t){return arguments.length?(e=Array.from(t,Gue),d()):e.slice()},f.range=function(e){return arguments.length?(t=Array.from(e),d()):t.slice()},f.rangeRound=function(e){return t=Array.from(e),n=qoe,d()},f.clamp=function(e){return arguments.length?(o=e?!0:Zu,d()):o!==Zu},f.interpolate=function(e){return arguments.length?(n=e,d()):n},f.unknown=function(e){return arguments.length?(a=e,f):a},function(e,t){return r=e,i=t,d()}}function Que(){return Zue()(Zu,Zu)}var $u,ed=o((()=>{bc(),Xl(),Wue(),Kue(),$u=[0,1]}));function $ue(e,t,n,r){var i=yc(e,t,n),a;switch(r=Nu(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Rle(i,o))&&(r.precision=a),Ple(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=Ble(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=Ile(i))&&(r.precision=a-(r.type===`%`)*2)}return Bu(r)}var ede=o((()=>{bc(),Vu()}));function tde(e){var t=e.domain;return e.ticks=function(e){var n=t();return tre(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return $ue(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],l,u,d=10;for(s<o&&(u=o,o=s,s=u,u=i,i=a,a=u);d-->0;){if(u=vc(o,s,n),u===l)return r[i]=o,r[a]=s,t(r);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function td(){var e=Que();return e.copy=function(){return Xue(e,td())},Ku.apply(e,arguments),tde(e)}var nde=o((()=>{bc(),ed(),qu(),ede()}));function rde(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}var ide=o((()=>{}));function nd(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>nd(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e){if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}}),n&&(i.count=(t,r)=>(rd.setTime(+t),id.setTime(+r),e(rd),e(id),Math.floor(n(rd,id))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var rd,id,ad=o((()=>{rd=new Date,id=new Date})),od,ade=o((()=>{ad(),od=nd(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e),od.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?nd(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):od),od.range})),sd,cd,ld,ud,dd,fd,pd,md=o((()=>{sd=1e3,cd=sd*60,ld=cd*60,ud=ld*24,dd=ud*7,fd=ud*30,pd=ud*365})),hd,ode=o((()=>{ad(),md(),hd=nd(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*sd)},(e,t)=>(t-e)/sd,e=>e.getUTCSeconds()),hd.range})),gd,_d,sde=o((()=>{ad(),md(),gd=nd(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*sd)},(e,t)=>{e.setTime(+e+t*cd)},(e,t)=>(t-e)/cd,e=>e.getMinutes()),gd.range,_d=nd(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*cd)},(e,t)=>(t-e)/cd,e=>e.getUTCMinutes()),_d.range})),vd,yd,cde=o((()=>{ad(),md(),vd=nd(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*sd-e.getMinutes()*cd)},(e,t)=>{e.setTime(+e+t*ld)},(e,t)=>(t-e)/ld,e=>e.getHours()),vd.range,yd=nd(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ld)},(e,t)=>(t-e)/ld,e=>e.getUTCHours()),yd.range})),bd,xd,Sd,lde=o((()=>{ad(),md(),bd=nd(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*cd)/ud,e=>e.getDate()-1),bd.range,xd=nd(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ud,e=>e.getUTCDate()-1),xd.range,Sd=nd(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ud,e=>Math.floor(e/ud)),Sd.range}));function Cd(e){return nd(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*cd)/dd)}function wd(e){return nd(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/dd)}var Td,Ed,Dd,Od,kd,Ad,jd,Md,Nd,ude,dde,Pd,fde,pde,mde=o((()=>{ad(),md(),Td=Cd(0),Ed=Cd(1),Dd=Cd(2),Od=Cd(3),kd=Cd(4),Ad=Cd(5),jd=Cd(6),Td.range,Ed.range,Dd.range,Od.range,kd.range,Ad.range,jd.range,Md=wd(0),Nd=wd(1),ude=wd(2),dde=wd(3),Pd=wd(4),fde=wd(5),pde=wd(6),Md.range,Nd.range,ude.range,dde.range,Pd.range,fde.range,pde.range})),Fd,Id,hde=o((()=>{ad(),Fd=nd(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth()),Fd.range,Id=nd(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()),Id.range})),Ld,Rd,gde=o((()=>{ad(),Ld=nd(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear()),Ld.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:nd(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),Ld.range,Rd=nd(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear()),Rd.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:nd(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),Rd.range}));function _de(e,t,n,r,i,a){let o=[[hd,1,sd],[hd,5,5*sd],[hd,15,15*sd],[hd,30,30*sd],[a,1,cd],[a,5,5*cd],[a,15,15*cd],[a,30,30*cd],[i,1,ld],[i,3,3*ld],[i,6,6*ld],[i,12,12*ld],[r,1,ud],[r,2,2*ud],[n,1,dd],[t,1,fd],[t,3,3*fd],[e,1,pd]];function s(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let i=n&&typeof n.range==`function`?n:l(e,t,n),a=i?i.range(e,+t+1):[];return r?a.reverse():a}function l(t,n,r){let i=Math.abs(n-t)/r,a=mc(([,,e])=>e).right(o,i);if(a===o.length)return e.every(yc(t/pd,n/pd,r));if(a===0)return od.every(Math.max(yc(t,n,r),1));let[s,l]=o[i/o[a-1][2]<o[a][2]/i?a-1:a];return s.every(l)}return[s,l]}var vde,yde,bde,xde,Sde=o((()=>{bc(),md(),ade(),ode(),sde(),cde(),lde(),mde(),hde(),gde(),[vde,yde]=_de(Rd,Id,Md,Sd,yd,_d),[bde,xde]=_de(Ld,Fd,Td,bd,vd,gd)})),zd=o((()=>{ad(),ade(),ode(),sde(),cde(),lde(),mde(),hde(),gde(),Sde()}));function Bd(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Vd(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Hd(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Cde(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,l=e.shortMonths,u=Wd(i),d=Gd(i),f=Wd(a),p=Gd(a),m=Wd(o),h=Gd(o),g=Wd(s),_=Gd(s),v=Wd(l),y=Gd(l),b={a:P,A:F,b:I,B:L,c:null,d:Gde,e:Gde,f:Xde,g:sfe,G:lfe,H:Kde,I:qde,j:Jde,L:Yde,m:Zde,M:Qde,p:R,q:ee,Q:Mfe,s:Nfe,S:$de,u:efe,U:tfe,V:rfe,w:ife,W:afe,x:null,X:null,y:ofe,Y:cfe,Z:ufe,"%":jfe},x={a:z,A:B,b:te,B:ne,c:null,d:dfe,e:dfe,f:gfe,g:Dfe,G:kfe,H:ffe,I:pfe,j:mfe,L:hfe,m:_fe,M:vfe,p:re,q:ie,Q:Mfe,s:Nfe,S:yfe,u:bfe,U:xfe,V:Cfe,w:wfe,W:Tfe,x:null,X:null,y:Efe,Y:Ofe,Z:Afe,"%":jfe},S={a:D,A:O,b:k,B:A,c:j,d:Fde,e:Fde,f:Vde,g:jde,G:Ade,H:Lde,I:Lde,j:Ide,L:Bde,m:Pde,M:Rde,p:E,q:Nde,Q:Ude,s:Wde,S:zde,u:Ede,U:Dde,V:Ode,w:Tde,W:kde,x:M,X:N,y:jde,Y:Ade,Z:Mde,"%":Hde};b.x=C(n,b),b.X=C(r,b),b.c=C(t,b),x.x=C(n,x),x.X=C(r,x),x.c=C(t,x);function C(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,l,u;for(n instanceof Date||(n=new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(l=Kd[s=e.charAt(++i)])==null?l=s===`e`?` `:`0`:s=e.charAt(++i),(u=t[s])&&(s=u(n,l)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function w(e,t){return function(n){var r=Hd(1900,void 0,1),i=T(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=Vd(Hd(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?Nd.ceil(a):Nd(a),a=xd.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=Bd(Hd(r.y,0,1)),o=a.getDay(),a=o>4||o===0?Ed.ceil(a):Ed(a),a=bd.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else(`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?Vd(Hd(r.y,0,1)).getUTCDay():Bd(Hd(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,Vd(r)):Bd(r)}}function T(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,l;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),l=S[s in Kd?t.charAt(i++):s],!l||(r=l(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function E(e,t,n){var r=u.exec(t.slice(n));return r?(e.p=d.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=m.exec(t.slice(n));return r?(e.w=h.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){var r=v.exec(t.slice(n));return r?(e.m=y.get(r[0].toLowerCase()),n+r[0].length):-1}function A(e,t,n){var r=g.exec(t.slice(n));return r?(e.m=_.get(r[0].toLowerCase()),n+r[0].length):-1}function j(e,n,r){return T(e,t,n,r)}function M(e,t,r){return T(e,n,t,r)}function N(e,t,n){return T(e,r,t,n)}function P(e){return o[e.getDay()]}function F(e){return a[e.getDay()]}function I(e){return l[e.getMonth()]}function L(e){return s[e.getMonth()]}function R(e){return i[+(e.getHours()>=12)]}function ee(e){return 1+~~(e.getMonth()/3)}function z(e){return o[e.getUTCDay()]}function B(e){return a[e.getUTCDay()]}function te(e){return l[e.getUTCMonth()]}function ne(e){return s[e.getUTCMonth()]}function re(e){return i[+(e.getUTCHours()>=12)]}function ie(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=C(e+=``,b);return t.toString=function(){return e},t},parse:function(e){var t=w(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=C(e+=``,x);return t.toString=function(){return e},t},utcParse:function(e){var t=w(e+=``,!0);return t.toString=function(){return e},t}}}function Ud(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function wde(e){return e.replace(Ffe,`\\$&`)}function Wd(e){return RegExp(`^(?:`+e.map(wde).join(`|`)+`)`,`i`)}function Gd(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function Tde(e,t,n){var r=qd.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Ede(e,t,n){var r=qd.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Dde(e,t,n){var r=qd.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Ode(e,t,n){var r=qd.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function kde(e,t,n){var r=qd.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Ade(e,t,n){var r=qd.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function jde(e,t,n){var r=qd.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Mde(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function Nde(e,t,n){var r=qd.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Pde(e,t,n){var r=qd.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Fde(e,t,n){var r=qd.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Ide(e,t,n){var r=qd.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Lde(e,t,n){var r=qd.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Rde(e,t,n){var r=qd.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function zde(e,t,n){var r=qd.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Bde(e,t,n){var r=qd.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Vde(e,t,n){var r=qd.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Hde(e,t,n){var r=Pfe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Ude(e,t,n){var r=qd.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Wde(e,t,n){var r=qd.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Gde(e,t){return Ud(e.getDate(),t,2)}function Kde(e,t){return Ud(e.getHours(),t,2)}function qde(e,t){return Ud(e.getHours()%12||12,t,2)}function Jde(e,t){return Ud(1+bd.count(Ld(e),e),t,3)}function Yde(e,t){return Ud(e.getMilliseconds(),t,3)}function Xde(e,t){return Yde(e,t)+`000`}function Zde(e,t){return Ud(e.getMonth()+1,t,2)}function Qde(e,t){return Ud(e.getMinutes(),t,2)}function $de(e,t){return Ud(e.getSeconds(),t,2)}function efe(e){var t=e.getDay();return t===0?7:t}function tfe(e,t){return Ud(Td.count(Ld(e)-1,e),t,2)}function nfe(e){var t=e.getDay();return t>=4||t===0?kd(e):kd.ceil(e)}function rfe(e,t){return e=nfe(e),Ud(kd.count(Ld(e),e)+(Ld(e).getDay()===4),t,2)}function ife(e){return e.getDay()}function afe(e,t){return Ud(Ed.count(Ld(e)-1,e),t,2)}function ofe(e,t){return Ud(e.getFullYear()%100,t,2)}function sfe(e,t){return e=nfe(e),Ud(e.getFullYear()%100,t,2)}function cfe(e,t){return Ud(e.getFullYear()%1e4,t,4)}function lfe(e,t){var n=e.getDay();return e=n>=4||n===0?kd(e):kd.ceil(e),Ud(e.getFullYear()%1e4,t,4)}function ufe(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+Ud(t/60|0,`0`,2)+Ud(t%60,`0`,2)}function dfe(e,t){return Ud(e.getUTCDate(),t,2)}function ffe(e,t){return Ud(e.getUTCHours(),t,2)}function pfe(e,t){return Ud(e.getUTCHours()%12||12,t,2)}function mfe(e,t){return Ud(1+xd.count(Rd(e),e),t,3)}function hfe(e,t){return Ud(e.getUTCMilliseconds(),t,3)}function gfe(e,t){return hfe(e,t)+`000`}function _fe(e,t){return Ud(e.getUTCMonth()+1,t,2)}function vfe(e,t){return Ud(e.getUTCMinutes(),t,2)}function yfe(e,t){return Ud(e.getUTCSeconds(),t,2)}function bfe(e){var t=e.getUTCDay();return t===0?7:t}function xfe(e,t){return Ud(Md.count(Rd(e)-1,e),t,2)}function Sfe(e){var t=e.getUTCDay();return t>=4||t===0?Pd(e):Pd.ceil(e)}function Cfe(e,t){return e=Sfe(e),Ud(Pd.count(Rd(e),e)+(Rd(e).getUTCDay()===4),t,2)}function wfe(e){return e.getUTCDay()}function Tfe(e,t){return Ud(Nd.count(Rd(e)-1,e),t,2)}function Efe(e,t){return Ud(e.getUTCFullYear()%100,t,2)}function Dfe(e,t){return e=Sfe(e),Ud(e.getUTCFullYear()%100,t,2)}function Ofe(e,t){return Ud(e.getUTCFullYear()%1e4,t,4)}function kfe(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Pd(e):Pd.ceil(e),Ud(e.getUTCFullYear()%1e4,t,4)}function Afe(){return`+0000`}function jfe(){return`%`}function Mfe(e){return+e}function Nfe(e){return Math.floor(e/1e3)}var Kd,qd,Pfe,Ffe,Ife=o((()=>{zd(),Kd={"-":``,_:` `,0:`0`},qd=/^\s*\d+/,Pfe=/^%/,Ffe=/[\\^$*+?|[\]().{}]/g}));function Lfe(e){return Jd=Cde(e),Yd=Jd.format,Rfe=Jd.parse,zfe=Jd.utcFormat,Bfe=Jd.utcParse,Jd}var Jd,Yd,Rfe,zfe,Bfe,Vfe=o((()=>{Ife(),Lfe({dateTime:`%x, %X`,date:`%-m/%-d/%Y`,time:`%-I:%M:%S %p`,periods:[`AM`,`PM`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`]})})),Xd=o((()=>{Vfe(),Ife()}));function Hfe(e){return new Date(e)}function Ufe(e){return e instanceof Date?+e:+new Date(+e)}function Wfe(e,t,n,r,i,a,o,s,l,u){var d=Que(),f=d.invert,p=d.domain,m=u(`.%L`),h=u(`:%S`),g=u(`%I:%M`),_=u(`%I %p`),v=u(`%a %d`),y=u(`%b %d`),b=u(`%B`),x=u(`%Y`);function S(e){return(l(e)<e?m:s(e)<e?h:o(e)<e?g:a(e)<e?_:r(e)<e?i(e)<e?v:y:n(e)<e?b:x)(e)}return d.invert=function(e){return new Date(f(e))},d.domain=function(e){return arguments.length?p(Array.from(e,Ufe)):p().map(Hfe)},d.ticks=function(t){var n=p();return e(n[0],n[n.length-1],t??10)},d.tickFormat=function(e,t){return t==null?S:u(t)},d.nice=function(e){var n=p();return(!e||typeof e.range!=`function`)&&(e=t(n[0],n[n.length-1],e??10)),e?p(rde(n,e)):d},d.copy=function(){return Xue(d,Wfe(e,t,n,r,i,a,o,s,l,u))},d}function Gfe(){return Ku.apply(Wfe(bde,xde,Ld,Fd,Td,bd,vd,gd,hd,Yd).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}var Kfe=o((()=>{zd(),Xd(),ed(),qu(),ide()})),qfe=o((()=>{Hue(),nde(),Kue(),bc(),Vu(),ide(),ed(),Vue(),Kfe(),zd(),Xd(),Xl(),ede()}));function Jfe(e){for(var t=e.length/6|0,n=Array(t),r=0;r<t;)n[r]=`#`+e.slice(r*6,++r*6);return n}var Yfe=o((()=>{})),Xfe,Zfe=o((()=>{Yfe(),Xfe=Jfe(`4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab`)})),Qfe=o((()=>{Yfe(),Zfe(),Xl(),Fl()}));function Zd(e){return function(){return e}}var Qd=o((()=>{}));function $fe(e){return e>1?0:e<-1?sf:Math.acos(e)}function epe(e){return e>=1?cf:e<=-1?-cf:Math.asin(e)}var $d,ef,tf,nf,rf,af,of,sf,cf,lf,uf=o((()=>{$d=Math.abs,ef=Math.atan2,tf=Math.cos,nf=Math.max,rf=Math.min,af=Math.sin,of=Math.sqrt,sf=Math.PI,cf=sf/2,lf=2*sf}));function df(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new Du(t)}var ff=o((()=>{Ou()}));function tpe(e){return e.innerRadius}function npe(e){return e.outerRadius}function rpe(e){return e.startAngle}function ipe(e){return e.endAngle}function ape(e){return e&&e.padAngle}function ope(e,t,n,r,i,a,o,s){var l=n-e,u=r-t,d=o-i,f=s-a,p=f*l-d*u;if(!(p*p<1e-12))return p=(d*(t-a)-f*(e-i))/p,[e+p*l,t+p*u]}function pf(e,t,n,r,i,a,o){var s=e-n,l=t-r,u=(o?a:-a)/of(s*s+l*l),d=u*l,f=-u*s,p=e+d,m=t+f,h=n+d,g=r+f,_=(p+h)/2,v=(m+g)/2,y=h-p,b=g-m,x=y*y+b*b,S=i-a,C=p*g-h*m,w=(b<0?-1:1)*of(nf(0,S*S*x-C*C)),T=(C*b-y*w)/x,E=(-C*y-b*w)/x,D=(C*b+y*w)/x,O=(-C*y+b*w)/x,k=T-_,A=E-v,j=D-_,M=O-v;return k*k+A*A>j*j+M*M&&(T=D,E=O),{cx:T,cy:E,x01:-d,y01:-f,x11:T*(i/S-1),y11:E*(i/S-1)}}function mf(){var e=tpe,t=npe,n=Zd(0),r=null,i=rpe,a=ipe,o=ape,s=null,l=df(u);function u(){var u,d,f=+e.apply(this,arguments),p=+t.apply(this,arguments),m=i.apply(this,arguments)-cf,h=a.apply(this,arguments)-cf,g=$d(h-m),_=h>m;if(s||=u=l(),p<f&&(d=p,p=f,f=d),!(p>1e-12))s.moveTo(0,0);else if(g>lf-1e-12)s.moveTo(p*tf(m),p*af(m)),s.arc(0,0,p,m,h,!_),f>1e-12&&(s.moveTo(f*tf(h),f*af(h)),s.arc(0,0,f,h,m,_));else{var v=m,y=h,b=m,x=h,S=g,C=g,w=o.apply(this,arguments)/2,T=w>1e-12&&(r?+r.apply(this,arguments):of(f*f+p*p)),E=rf($d(p-f)/2,+n.apply(this,arguments)),D=E,O=E,k,A;if(T>1e-12){var j=epe(T/f*af(w)),M=epe(T/p*af(w));(S-=j*2)>1e-12?(j*=_?1:-1,b+=j,x-=j):(S=0,b=x=(m+h)/2),(C-=M*2)>1e-12?(M*=_?1:-1,v+=M,y-=M):(C=0,v=y=(m+h)/2)}var N=p*tf(v),P=p*af(v),F=f*tf(x),I=f*af(x);if(E>1e-12){var L=p*tf(y),R=p*af(y),ee=f*tf(b),z=f*af(b),B;if(g<sf){if(B=ope(N,P,ee,z,L,R,F,I)){var te=N-B[0],ne=P-B[1],re=L-B[0],ie=R-B[1],ae=1/af($fe((te*re+ne*ie)/(of(te*te+ne*ne)*of(re*re+ie*ie)))/2),oe=of(B[0]*B[0]+B[1]*B[1]);D=rf(E,(f-oe)/(ae-1)),O=rf(E,(p-oe)/(ae+1))}else D=O=0}}C>1e-12?O>1e-12?(k=pf(ee,z,N,P,p,O,_),A=pf(L,R,F,I,p,O,_),s.moveTo(k.cx+k.x01,k.cy+k.y01),O<E?s.arc(k.cx,k.cy,O,ef(k.y01,k.x01),ef(A.y01,A.x01),!_):(s.arc(k.cx,k.cy,O,ef(k.y01,k.x01),ef(k.y11,k.x11),!_),s.arc(0,0,p,ef(k.cy+k.y11,k.cx+k.x11),ef(A.cy+A.y11,A.cx+A.x11),!_),s.arc(A.cx,A.cy,O,ef(A.y11,A.x11),ef(A.y01,A.x01),!_))):(s.moveTo(N,P),s.arc(0,0,p,v,y,!_)):s.moveTo(N,P),!(f>1e-12)||!(S>1e-12)?s.lineTo(F,I):D>1e-12?(k=pf(F,I,L,R,f,-D,_),A=pf(N,P,ee,z,f,-D,_),s.lineTo(k.cx+k.x01,k.cy+k.y01),D<E?s.arc(k.cx,k.cy,D,ef(k.y01,k.x01),ef(A.y01,A.x01),!_):(s.arc(k.cx,k.cy,D,ef(k.y01,k.x01),ef(k.y11,k.x11),!_),s.arc(0,0,f,ef(k.cy+k.y11,k.cx+k.x11),ef(A.cy+A.y11,A.cx+A.x11),_),s.arc(A.cx,A.cy,D,ef(A.y11,A.x11),ef(A.y01,A.x01),!_))):s.arc(0,0,f,x,b,_)}if(s.closePath(),u)return s=null,u+``||null}return u.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-sf/2;return[tf(r)*n,af(r)*n]},u.innerRadius=function(t){return arguments.length?(e=typeof t==`function`?t:Zd(+t),u):e},u.outerRadius=function(e){return arguments.length?(t=typeof e==`function`?e:Zd(+e),u):t},u.cornerRadius=function(e){return arguments.length?(n=typeof e==`function`?e:Zd(+e),u):n},u.padRadius=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:Zd(+e),u):r},u.startAngle=function(e){return arguments.length?(i=typeof e==`function`?e:Zd(+e),u):i},u.endAngle=function(e){return arguments.length?(a=typeof e==`function`?e:Zd(+e),u):a},u.padAngle=function(e){return arguments.length?(o=typeof e==`function`?e:Zd(+e),u):o},u.context=function(e){return arguments.length?(s=e??null,u):s},u}var spe=o((()=>{Qd(),uf(),ff()}));function hf(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}var gf=o((()=>{Array.prototype.slice}));function _f(e){this._context=e}function vf(e){return new _f(e)}var yf=o((()=>{_f.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}}}));function cpe(e){return e[0]}function lpe(e){return e[1]}var upe=o((()=>{}));function bf(e,t){var n=Zd(!0),r=null,i=vf,a=null,o=df(s);e=typeof e==`function`?e:e===void 0?cpe:Zd(e),t=typeof t==`function`?t:t===void 0?lpe:Zd(t);function s(s){var l,u=(s=hf(s)).length,d,f=!1,p;for(r??(a=i(p=o())),l=0;l<=u;++l)!(l<u&&n(d=s[l],l,s))===f&&((f=!f)?a.lineStart():a.lineEnd()),f&&a.point(+e(d,l,s),+t(d,l,s));if(p)return a=null,p+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:Zd(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:Zd(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:Zd(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}var dpe=o((()=>{gf(),Qd(),yf(),ff(),upe()}));function fpe(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}var ppe=o((()=>{}));function mpe(e){return e}var hpe=o((()=>{}));function gpe(){var e=mpe,t=fpe,n=null,r=Zd(0),i=Zd(lf),a=Zd(0);function o(o){var s,l=(o=hf(o)).length,u,d,f=0,p=Array(l),m=Array(l),h=+r.apply(this,arguments),g=Math.min(lf,Math.max(-lf,i.apply(this,arguments)-h)),_,v=Math.min(Math.abs(g)/l,a.apply(this,arguments)),y=v*(g<0?-1:1),b;for(s=0;s<l;++s)(b=m[p[s]=s]=+e(o[s],s,o))>0&&(f+=b);for(t==null?n!=null&&p.sort(function(e,t){return n(o[e],o[t])}):p.sort(function(e,n){return t(m[e],m[n])}),s=0,d=f?(g-l*y)/f:0;s<l;++s,h=_)u=p[s],b=m[u],_=h+(b>0?b*d:0)+y,m[u]={data:o[u],index:s,value:b,startAngle:h,endAngle:_,padAngle:v};return m}return o.value=function(t){return arguments.length?(e=typeof t==`function`?t:Zd(+t),o):e},o.sortValues=function(e){return arguments.length?(t=e,n=null,o):t},o.sort=function(e){return arguments.length?(n=e,t=null,o):n},o.startAngle=function(e){return arguments.length?(r=typeof e==`function`?e:Zd(+e),o):r},o.endAngle=function(e){return arguments.length?(i=typeof e==`function`?e:Zd(+e),o):i},o.padAngle=function(e){return arguments.length?(a=typeof e==`function`?e:Zd(+e),o):a},o}var _pe=o((()=>{gf(),Qd(),ppe(),hpe(),uf()}));function xf(e){return new Cf(e,!0)}function Sf(e){return new Cf(e,!1)}var Cf,vpe=o((()=>{Cf=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}}}));function wf(){}var Tf=o((()=>{}));function Ef(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Df(e){this._context=e}function Of(e){return new Df(e)}var kf=o((()=>{Df.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ef(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ef(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}}));function Af(e){this._context=e}function ype(e){return new Af(e)}var bpe=o((()=>{Tf(),kf(),Af.prototype={areaStart:wf,areaEnd:wf,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Ef(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}}));function jf(e){this._context=e}function xpe(e){return new jf(e)}var Spe=o((()=>{kf(),jf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Ef(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}}));function Mf(e,t){this._basis=new Df(e),this._beta=t}var Nf,Cpe=o((()=>{kf(),Mf.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],a=e[n]-r,o=t[n]-i,s=-1,l;++s<=n;)l=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+l*a),this._beta*t[s]+(1-this._beta)*(i+l*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}},Nf=(function e(t){function n(e){return t===1?new Df(e):new Mf(e,t)}return n.beta=function(t){return e(+t)},n})(.85)}));function Pf(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Ff(e,t){this._context=e,this._k=(1-t)/6}var If,Lf=o((()=>{Ff.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Pf(this,this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Pf(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},If=(function e(t){function n(e){return new Ff(e,t)}return n.tension=function(t){return e(+t)},n})(0)}));function Rf(e,t){this._context=e,this._k=(1-t)/6}var zf,Bf=o((()=>{Tf(),Lf(),Rf.prototype={areaStart:wf,areaEnd:wf,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Pf(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},zf=(function e(t){function n(e){return new Rf(e,t)}return n.tension=function(t){return e(+t)},n})(0)}));function Vf(e,t){this._context=e,this._k=(1-t)/6}var Hf,Uf=o((()=>{Lf(),Vf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Pf(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},Hf=(function e(t){function n(e){return new Vf(e,t)}return n.tension=function(t){return e(+t)},n})(0)}));function Wf(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>1e-12){var u=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,d=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*u+e._x1*e._l23_2a-t*e._l12_2a)/d,o=(o*u+e._y1*e._l23_2a-n*e._l12_2a)/d}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}function Gf(e,t){this._context=e,this._alpha=t}var Kf,qf=o((()=>{uf(),Lf(),Gf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Wf(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},Kf=(function e(t){function n(e){return t?new Gf(e,t):new Ff(e,0)}return n.alpha=function(t){return e(+t)},n})(.5)}));function Jf(e,t){this._context=e,this._alpha=t}var Yf,wpe=o((()=>{Bf(),Tf(),qf(),Jf.prototype={areaStart:wf,areaEnd:wf,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Wf(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},Yf=(function e(t){function n(e){return t?new Jf(e,t):new Rf(e,0)}return n.alpha=function(t){return e(+t)},n})(.5)}));function Xf(e,t){this._context=e,this._alpha=t}var Zf,Tpe=o((()=>{Uf(),qf(),Xf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Wf(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},Zf=(function e(t){function n(e){return t?new Xf(e,t):new Vf(e,0)}return n.alpha=function(t){return e(+t)},n})(.5)}));function Qf(e){this._context=e}function Epe(e){return new Qf(e)}var Dpe=o((()=>{Tf(),Qf.prototype={areaStart:wf,areaEnd:wf,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}}}));function $f(e){return e<0?-1:1}function ep(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return($f(a)+$f(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function tp(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function np(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function rp(e){this._context=e}function ip(e){this._context=new ap(e)}function ap(e){this._context=e}function op(e){return new rp(e)}function sp(e){return new ip(e)}var Ope=o((()=>{rp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:np(this,this._t0,tp(this,this._t0))}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,e!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,np(this,tp(this,n=ep(this,e,t)),n);break;default:np(this,this._t0,n=ep(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(ip.prototype=Object.create(rp.prototype)).point=function(e,t){rp.prototype.point.call(this,t,e)},ap.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}}}));function cp(e){this._context=e}function lp(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function up(e){return new cp(e)}var kpe=o((()=>{cp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n){if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=lp(e),i=lp(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o])}(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}}}));function dp(e,t){this._context=e,this._t=t}function fp(e){return new dp(e,.5)}function pp(e){return new dp(e,0)}function mp(e){return new dp(e,1)}var Ape=o((()=>{dp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}}})),jpe=o((()=>{spe(),gf(),Qd(),yf(),dpe(),ff(),_pe(),vpe(),uf(),bpe(),Spe(),kf(),Cpe(),Bf(),Uf(),Lf(),wpe(),Tpe(),qf(),Dpe(),Ope(),kpe(),Ape()}));function hp(e,t,n){this.k=e,this.x=t,this.y=n}var gp=o((()=>{hp.prototype={constructor:hp,scale:function(e){return e===1?this:new hp(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new hp(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}},new hp(1,0,0),hp.prototype})),Mpe=o((()=>{Su(),gp()})),Npe=o((()=>{Mpe(),gp()})),_p=o((()=>{bc(),Sre(),rle(),cle(),Fl(),lle(),ule(),jc(),Xae(),dle(),qce(),fle(),mle(),Vu(),Hle(),Rue(),Xl(),Ou(),zue(),ple(),Bue(),qfe(),Qfe(),el(),jpe(),zd(),Xd(),du(),Su(),Npe()})),vp,yp=o((()=>{dc(),h(),_p(),vp=p(e=>{let{securityLevel:t}=Z(),n=$c(`body`);return t===`sandbox`&&(n=$c(($c(`#i${e}`).node()?.contentDocument??document).body)),n.select(`#${e}`)},`selectSvgElement`)})),bp,xp,Sp,Cp,wp,Tp,Ep,Dp,Op=o((()=>{dc(),h(),bp=p(e=>{let{handDrawnSeed:t}=Z();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},`solidStateFill`),xp=p(e=>Array.isArray(e)?e:e?e.split(`;`).map(e=>e.trim()).filter(Boolean):[],`normalizeStyleList`),Sp=p(e=>{let t=Cp([...e.cssCompiledStyles||[],...e.cssStyles||[],...xp(e.labelStyle)]);return{stylesMap:t,stylesArray:[...t]}},`compileStyles`),Cp=p(e=>{let t=new Map;return e.forEach(e=>{let[n,r]=e.split(`:`);t.set(n.trim(),r?.trim())}),t},`styles2Map`),wp=p(e=>e===`color`||e===`font-size`||e===`font-family`||e===`font-weight`||e===`font-style`||e===`text-decoration`||e===`text-align`||e===`text-transform`||e===`line-height`||e===`letter-spacing`||e===`word-spacing`||e===`text-shadow`||e===`text-overflow`||e===`white-space`||e===`word-wrap`||e===`word-break`||e===`overflow-wrap`||e===`hyphens`,`isLabelStyle`),Tp=p(e=>{let{stylesArray:t}=Sp(e),n=[],r=[],i=[],a=[];return t.forEach(e=>{let t=e[0];wp(t)?n.push(e.join(`:`)+` !important`):(r.push(e.join(`:`)+` !important`),t.includes(`stroke`)&&i.push(e.join(`:`)+` !important`),t===`fill`&&a.push(e.join(`:`)+` !important`))}),{labelStyles:n.join(`;`),nodeStyles:r.join(`;`),stylesArray:t,borderStyles:i,backgroundStyles:a}},`styles2String`),Ep=p((e,t)=>{let{themeVariables:n,handDrawnSeed:r}=Z(),{nodeBorder:i,mainBkg:a}=n,{stylesMap:o}=Sp(e);return Object.assign({roughness:.7,fill:o.get(`fill`)||a,fillStyle:`hachure`,fillWeight:4,hachureGap:5.2,stroke:o.get(`stroke`)||i,seed:r,strokeWidth:o.get(`stroke-width`)?.replace(`px`,``)||1.3,fillLineDash:[0,0],strokeLineDash:Dp(o.get(`stroke-dasharray`))},t)},`userNodeOverrides`),Dp=p(e=>{if(!e)return[0,0];let t=e.trim().split(/\s+/).map(Number);if(t.length===1){let e=isNaN(t[0])?0:t[0];return[e,e]}return[isNaN(t[0])?0:t[0],isNaN(t[1])?0:t[1]]},`getStrokeDashArray`)})),kp,Ap,jp,Mp,Np=o((()=>{kp=Object.freeze({left:0,top:0,width:16,height:16}),Ap=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),jp=Object.freeze({...kp,...Ap}),Mp=Object.freeze({...jp,body:``,hidden:!1})})),Pp,Fp,Ppe=o((()=>{Np(),Pp=Object.freeze({width:null,height:null}),Fp=Object.freeze({...Pp,...Ap})})),Ip,Lp,Fpe=o((()=>{Ip=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!Lp(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!Lp(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!Lp(e,n)?null:e}return null},Lp=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1}));function Ipe(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}var Lpe=o((()=>{}));function Rpe(e,t){let n=Ipe(e,t);for(let r in Mp)r in Ap?r in e&&!(r in n)&&(n[r]=Ap[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}var zpe=o((()=>{Np(),Lpe()}));function Bpe(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return(t||Object.keys(n).concat(Object.keys(r))).forEach(a),i}var Vpe=o((()=>{}));function Hpe(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=Rpe(r[e]||i[e],a)}return o(t),n.forEach(o),Rpe(e,a)}function Upe(e,t){if(e.icons[t])return Hpe(e,t,[]);let n=Bpe(e,[t])[t];return n?Hpe(e,t,n):null}var Wpe=o((()=>{zpe(),Vpe()}));function Gpe(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(Kpe);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=qpe.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}var Kpe,qpe,Jpe=o((()=>{Kpe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,qpe=/^-?[0-9.]*[0-9]+[0-9.]*$/g}));function Ype(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function Xpe(e,t){return e?`<defs>`+e+`</defs>`+t:t}function Zpe(e,t,n){let r=Ype(e);return Xpe(r.defs,t+r.content+n)}var Qpe=o((()=>{}));function $pe(e,t){let n={...jp,...e},r={...Fp,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`)}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=Zpe(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,l=i.width,u=i.height,d,f;o===null?(f=s===null?`1em`:s===`auto`?u:s,d=Gpe(f,l/u)):(d=o===`auto`?l:o,f=s===null?Gpe(d,u/l):s===`auto`?u:s);let p={},m=(e,t)=>{eme(t)||(p[e]=t.toString())};m(`width`,d),m(`height`,f);let h=[i.left,i.top,l,u];return p.viewBox=h.join(` `),{attributes:p,viewBox:h,body:a}}var eme,tme=o((()=>{Np(),Ppe(),Jpe(),Qpe(),eme=e=>e===`unset`||e===`undefined`||e===`none`}));function nme(e){e=e.replace(/[0-9]+$/,``)||`a`;let t=Rp.get(e)||0;return Rp.set(e,t+1),t?`${e}${t}`:e}function rme(e){let t=[],n;for(;n=ime.exec(e);)t.push(n[1]);if(!t.length)return e;let r=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(t=>{let n=nme(t),i=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+i+`)([")]|\\.[a-z])`,`g`),`$1`+n+r+`$3`)}),e=e.replace(new RegExp(r,`g`),``),e}var ime,Rp,ame=o((()=>{ime=/\sid="(\S+)"/g,Rp=new Map}));function ome(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}var sme=o((()=>{})),cme=o((()=>{Fpe(),Wpe(),tme(),ame(),sme()})),zp,Bp,Vp,Hp,Up,lme,Wp,Gp=o((()=>{dc(),S(),h(),cme(),zp={body:`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>`,height:80,width:80},Bp=new Map,Vp=new Map,Hp=p(e=>{for(let t of e){if(!t.name)throw Error(`Invalid icon loader. Must have a "name" property with non-empty string value.`);if(y.debug(`Registering icon pack:`,t.name),`loader`in t)Vp.set(t.name,t.loader);else if(`icons`in t)Bp.set(t.name,t.icons);else throw y.error(`Invalid icon loader:`,t),Error(`Invalid icon loader. Must have either "icons" or "loader" property.`)}},`registerIconPacks`),Up=p(async(e,t)=>{let n=Ip(e,!0,t!==void 0);if(!n)throw Error(`Invalid icon name: ${e}`);let r=n.prefix||t;if(!r)throw Error(`Icon name must contain a prefix: ${e}`);let i=Bp.get(r);if(!i){let e=Vp.get(r);if(!e)throw Error(`Icon set not found: ${n.prefix}`);try{i={...await e(),prefix:r},Bp.set(r,i)}catch(e){throw y.error(e),Error(`Failed to load icon set: ${n.prefix}`)}}let a=Upe(i,n.name);if(!a)throw Error(`Icon not found: ${e}`);return a},`getRegisteredIconData`),lme=p(async e=>{try{return await Up(e),!0}catch{return!1}},`isIconAvailable`),Wp=p(async(e,t,n)=>{let r;try{r=await Up(e,t?.fallbackPrefix)}catch(e){y.error(e),r=zp}let i=$pe(r,t),a=ome(rme(i.body),{...i.attributes,...n});return js(a,ms())},`getIconSVG`)})),ume=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BLANK_URL=e.relativeFirstCharacters=e.whitespaceEscapeCharsRegex=e.urlSchemeRegex=e.ctrlCharactersRegex=e.htmlCtrlEntityRegex=e.htmlEntitiesRegex=e.invalidProtocolRegex=void 0,e.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,e.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,e.htmlCtrlEntityRegex=/&(newline|tab);/gi,e.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,e.urlSchemeRegex=/^.+(:|:)/gim,e.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,e.relativeFirstCharacters=[`.`,`/`],e.BLANK_URL=`about:blank`})),Kp=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.sanitizeUrl=o;var t=ume();function n(e){return t.relativeFirstCharacters.indexOf(e[0])>-1}function r(e){return e.replace(t.ctrlCharactersRegex,``).replace(t.htmlEntitiesRegex,function(e,t){return String.fromCharCode(t)})}function i(e){return URL.canParse(e)}function a(e){try{return decodeURIComponent(e)}catch{return e}}function o(e){if(!e)return t.BLANK_URL;var o,s=a(e.trim());do s=r(s).replace(t.htmlCtrlEntityRegex,``).replace(t.ctrlCharactersRegex,``).replace(t.whitespaceEscapeCharsRegex,``).trim(),s=a(s),o=s.match(t.ctrlCharactersRegex)||s.match(t.htmlEntitiesRegex)||s.match(t.htmlCtrlEntityRegex)||s.match(t.whitespaceEscapeCharsRegex);while(o&&o.length>0);var l=s;if(!l)return t.BLANK_URL;if(n(l))return l;var u=l.trimStart(),d=u.match(t.urlSchemeRegex);if(!d)return l;var f=d[0].toLowerCase().trim();if(t.invalidProtocolRegex.test(f))return t.BLANK_URL;var p=u.replace(/\\/g,`/`);if(f===`mailto:`||f.includes(`://`))return p;if(f===`http:`||f===`https:`){if(!i(p))return t.BLANK_URL;var m=new URL(p);return m.protocol=m.protocol.toLowerCase(),m.hostname=m.hostname.toLowerCase(),m.toString()}return p}}));function dme(e){return Array.isArray(e)}var fme=o((()=>{}));function qp(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}var pme=o((()=>{}));function mme(){}var hme=o((()=>{}));function gme(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}var _me=o((()=>{}));function Jp(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Yp=o((()=>{})),Xp,Zp,Qp,$p,em,tm,nm,rm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm,hm,gm,_m,vm=o((()=>{Xp=`[object RegExp]`,Zp=`[object String]`,Qp=`[object Number]`,$p=`[object Boolean]`,em=`[object Arguments]`,tm=`[object Symbol]`,nm=`[object Date]`,rm=`[object Map]`,im=`[object Set]`,am=`[object Array]`,om=`[object ArrayBuffer]`,sm=`[object Object]`,cm=`[object DataView]`,lm=`[object Uint8Array]`,um=`[object Uint8ClampedArray]`,dm=`[object Uint16Array]`,fm=`[object Uint32Array]`,pm=`[object Int8Array]`,mm=`[object Int16Array]`,hm=`[object Int32Array]`,gm=`[object Float32Array]`,_m=`[object Float64Array]`})),ym,vme=o((()=>{ym=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})()}));function bm(e){return ym.Buffer!==void 0&&ym.Buffer.isBuffer(e)}var xm=o((()=>{vme()}));function yme(e){return Number.isSafeInteger(e)&&e>=0}var bme=o((()=>{}));function xme(e){return e!=null&&typeof e!=`function`&&yme(e.length)}var Sme=o((()=>{bme()}));function Cme(e){return e===`__proto__`}var wme=o((()=>{}));function Sm(e){return e==null||typeof e!=`object`&&typeof e!=`function`}var Cm=o((()=>{}));function wm(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}var Tm=o((()=>{}));function Tme(e,t){return Em(e,void 0,e,new Map,t)}function Em(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(Sm(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=Em(e[a],a,n,r,i);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[a,o]of e)t.set(a,Em(o,a,n,r,i));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let a of e)t.add(Em(a,void 0,n,r,i));return t}if(bm(e))return e.subarray();if(wm(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=Em(e[a],a,n,r,i);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),Dm(t,e,n,r,i),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),Dm(t,e,n,r,i),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),Dm(t,e,n,r,i),t}if(e instanceof Error){let t=structuredClone(e);return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,Dm(t,e,n,r,i),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),Dm(t,e,n,r,i),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),Dm(t,e,n,r,i),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),Dm(t,e,n,r,i),t}if(typeof e==`object`&&Eme(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),Dm(t,e,n,r,i),t}return e}function Dm(e,t,n=e,r,i){let a=[...Object.keys(t),...gme(t)];for(let o=0;o<a.length;o++){let s=a[o],l=Object.getOwnPropertyDescriptor(e,s);(l==null||l.writable)&&(e[s]=Em(t[s],s,n,r,i))}}function Eme(e){switch(Jp(e)){case em:case am:case om:case cm:case $p:case nm:case gm:case _m:case pm:case mm:case hm:case rm:case Qp:case sm:case Xp:case im:case Zp:case tm:case lm:case um:case dm:case fm:return!0;default:return!1}}var Dme=o((()=>{Cm(),Tm(),_me(),Yp(),vm(),xm()}));function Ome(e,t){return Tme(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(Jp(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),Dm(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case Qp:case Zp:case $p:{let t=new e.constructor(e?.valueOf());return Dm(t,e),t}case em:{let t={};return Dm(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}var kme=o((()=>{Yp(),vm(),Dme()}));function Ame(e){return Ome(e)}var jme=o((()=>{kme()}));function Om(e){return typeof e==`object`&&!!e&&Jp(e)===`[object Arguments]`}var Mme=o((()=>{Yp()}));function km(e){return typeof e==`object`&&!!e}var Nme=o((()=>{}));function Pme(e){return km(e)&&xme(e)}var Fme=o((()=>{Sme(),Nme()}));function Am(e){return wm(e)}var jm=o((()=>{Tm()}));function Ime(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}var Lme=o((()=>{}));function Mm(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(`Expected a function`);let n=function(...r){let i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);let o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Mm.Cache||Map),n}var Rme=o((()=>{Mm.Cache=Map}));function zme(e){if(Sm(e))return e;let t=Jp(e);if(!Bme(e))return{};if(dme(e)){let t=Array.from(e);return e.length>0&&typeof e[0]==`string`&&Object.hasOwn(e,`index`)&&(t.index=e.index,t.input=e.input),t}if(Am(e)){let t=e,n=t.constructor;return new n(t.buffer,t.byteOffset,t.length)}if(t===`[object ArrayBuffer]`)return new ArrayBuffer(e.byteLength);if(t===`[object DataView]`){let t=e,n=t.buffer,r=t.byteOffset,i=t.byteLength,a=new ArrayBuffer(i),o=new Uint8Array(n,r,i);return new Uint8Array(a).set(o),new DataView(a)}if(t===`[object Boolean]`||t===`[object Number]`||t===`[object String]`){let n=e.constructor,r=new n(e.valueOf());return t===`[object String]`?Hme(r,e):Nm(r,e),r}if(t===`[object Date]`)return new Date(Number(e));if(t===`[object RegExp]`){let t=e,n=new RegExp(t.source,t.flags);return n.lastIndex=t.lastIndex,n}if(t===`[object Symbol]`)return Object(Symbol.prototype.valueOf.call(e));if(t===`[object Map]`){let t=e,n=new Map;return t.forEach((e,t)=>{n.set(t,e)}),n}if(t===`[object Set]`){let t=e,n=new Set;return t.forEach(e=>{n.add(e)}),n}if(t===`[object Arguments]`){let t=e,n={};return Nm(n,t),n.length=t.length,n[Symbol.iterator]=t[Symbol.iterator],n}let n={};return Ume(n,e),Nm(n,e),Vme(n,e),n}function Bme(e){switch(Jp(e)){case em:case am:case om:case cm:case $p:case nm:case gm:case _m:case pm:case mm:case hm:case rm:case Qp:case sm:case Xp:case im:case Zp:case tm:case lm:case um:case dm:case fm:return!0;default:return!1}}function Nm(e,t){for(let n in t)Object.hasOwn(t,n)&&(e[n]=t[n])}function Vme(e,t){let n=Object.getOwnPropertySymbols(t);for(let r=0;r<n.length;r++){let i=n[r];Object.prototype.propertyIsEnumerable.call(t,i)&&(e[i]=t[i])}}function Hme(e,t){let n=t.valueOf().length;for(let r in t)Object.hasOwn(t,r)&&(Number.isNaN(Number(r))||Number(r)>=n)&&(e[r]=t[r])}function Ume(e,t){let n=Object.getPrototypeOf(t);n!==null&&typeof t.constructor==`function`&&Object.setPrototypeOf(e,n)}var Wme=o((()=>{Cm(),Yp(),vm(),fme(),jm()}));function Gme(e){if(Sm(e))return e;if(Array.isArray(e)||wm(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);let t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);let n=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new n(e);if(e instanceof RegExp){let t=new n(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new n(e.buffer.slice(0));if(e instanceof Error){let t;return t=e instanceof AggregateError?new n(e.errors,e.message,{cause:e.cause}):new n(e.message,{cause:e.cause}),t.stack=e.stack,Object.assign(t,e),t}return typeof File<`u`&&e instanceof File?new n([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e==`object`?Object.assign(Object.create(t),e):e}var Kme=o((()=>{Cm(),Tm()}));function qme(e,...t){let n=t.slice(0,-1),r=t[t.length-1],i=e;for(let e=0;e<n.length;e++){let t=n[e];i=Pm(i,t,r,new Map)}return i}function Pm(e,t,n,r){if(Sm(e)&&(e=Object(e)),typeof t!=`object`||!t)return e;if(r.has(t))return Gme(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]=t[e]??void 0}let i=[...Object.keys(t),...gme(t)];for(let a=0;a<i.length;a++){let o=i[a];if(Cme(o))continue;let s=t[o],l=e[o];if(Om(s)&&(s={...s}),Om(l)&&(l={...l}),bm(s)&&(s=Ame(s)),Array.isArray(s)){if(Array.isArray(l)){let e=[],t=Reflect.ownKeys(l);for(let n=0;n<t.length;n++){let r=t[n];e[r]=l[r]}l=e}else if(Pme(l)){let e=[];for(let t=0;t<l.length;t++)e[t]=l[t];l=e}else l=[]}let u=n(l,s,o,e,t,r);u===void 0?Array.isArray(s)||km(l)&&km(s)&&(qp(l)||qp(s)||Am(l)||Am(s))?e[o]=Pm(l,s,n,r):l==null&&qp(s)?e[o]=Pm({},s,n,r):l==null&&Am(s)?e[o]=Ame(s):(l===void 0||s!==void 0)&&(e[o]=s):e[o]=u}return e}var Jme=o((()=>{Cm(),Kme(),_me(),xm(),wme(),pme(),jme(),Mme(),Nme(),Fme(),jm()}));function Yme(e,...t){return qme(e,...t,mme)}var Xme=o((()=>{hme(),Jme()}));function Zme(e){if(e==null)return!0;if(xme(e))return typeof e.splice!=`function`&&typeof e!=`string`&&!bm(e)&&!Am(e)&&!Om(e)?!1:e.length===0;if(typeof e==`object`||typeof e==`function`){if(e instanceof Map||e instanceof Set)return e.size===0;let t=Object.keys(e);return Ime(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}var Qme=o((()=>{xm(),Sme(),Mme(),Lme(),jm()})),Fm=o((()=>{Rme(),Wme(),Xme(),Qme()}));function Im(e,t){return e?ohe[`curve${e.charAt(0).toUpperCase()+e.slice(1)}`]??t:t}function $me(e,t){let n=e.trim();if(n)return t.securityLevel===`loose`?n:(0,ahe.sanitizeUrl)(n)}function Lm(e,t){return!e||!t?0:Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function ehe(e){let t,n=0;return e.forEach(e=>{n+=Lm(e,t),t=e}),Km(e,n/2)}function the(e){return e.length===1?e[0]:ehe(e)}function nhe(e,t,n){let r=structuredClone(n);y.info(`our points`,r),t!==`start_left`&&t!==`start_right`&&r.reverse();let i=Km(r,25+e),a=10+e*.5,o=Math.atan2(r[0].y-i.y,r[0].x-i.x),s={x:0,y:0};return t===`start_left`?(s.x=Math.sin(o+Math.PI)*a+(r[0].x+i.x)/2,s.y=-Math.cos(o+Math.PI)*a+(r[0].y+i.y)/2):t===`end_right`?(s.x=Math.sin(o-Math.PI)*a+(r[0].x+i.x)/2-5,s.y=-Math.cos(o-Math.PI)*a+(r[0].y+i.y)/2-5):t===`end_left`?(s.x=Math.sin(o)*a+(r[0].x+i.x)/2-5,s.y=-Math.cos(o)*a+(r[0].y+i.y)/2-5):(s.x=Math.sin(o)*a+(r[0].x+i.x)/2,s.y=-Math.cos(o)*a+(r[0].y+i.y)/2),s}function Rm(e){let t=``,n=``;for(let r of e)r!==void 0&&(r.startsWith(`color:`)||r.startsWith(`text-align:`)?n=n+r+`;`:t=t+r+`;`);return{style:t,labelStyle:n}}function rhe(e){let t=``;for(let n=0;n<e;n++)t+=`0123456789abcdef`.charAt(Math.floor(Math.random()*16));return t}function zm(e,t){return Zm(e,t).height}function Bm(e,t){return Zm(e,t).width}function Vm(e){return`str`in e}function Hm(e,t){return Yme({},e,t)}function Um(e){return e??null}function ihe(e,t){let n=Math.round(e.x),r=Math.round(e.y),i=t.replace(/(\d+\.\d+)/g,e=>Math.round(parseFloat(e)).toString());return i.includes(n.toString())||i.includes(r.toString())}var ahe,ohe,she,che,Wm,lhe,uhe,dhe,Gm,Km,fhe,qm,Jm,Ym,phe,mhe,Xm,hhe,Zm,ghe,Qm,_he,vhe,$m,eh,yhe,th,nh,rh=o((()=>{dc(),S(),h(),ahe=Kp(),_p(),Fm(),ohe={curveBasis:Of,curveBasisClosed:ype,curveBasisOpen:xpe,curveBumpX:xf,curveBumpY:Sf,curveBundle:Nf,curveCardinalClosed:zf,curveCardinalOpen:Hf,curveCardinal:If,curveCatmullRomClosed:Yf,curveCatmullRomOpen:Zf,curveCatmullRom:Kf,curveLinear:vf,curveLinearClosed:Epe,curveMonotoneX:op,curveMonotoneY:sp,curveNatural:up,curveStep:fp,curveStepAfter:mp,curveStepBefore:pp},she=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,che=p(function(e,t){let n=Wm(e,/(?:init\b)|(?:initialize\b)/),r={};if(Array.isArray(n)){let e=n.map(e=>e.args);rs(e),r=qo(r,[...e])}else r=n.args;if(!r)return;let i=Ts(e,t),a=`config`;return r[a]!==void 0&&(i===`flowchart-v2`&&(i=`flowchart`),r[i]=r[a],delete r[a]),r},`detectInit`),Wm=p(function(e,t=null){try{let n=RegExp(`[%]{2}(?![{]${she.source})(?=[}][%]{2}).*384+`,`ig`);e=e.trim().replace(n,``).replace(/'/gm,`"`),y.debug(`Detecting diagram directive${t===null?``:` type:`+t} based on the text:${e}`);let r,i=[];for(;(r=Ss.exec(e))!==null;)if(r.index===Ss.lastIndex&&Ss.lastIndex++,r&&!t||t&&r[1]?.match(t)||t&&r[2]?.match(t)){let e=r[1]?r[1]:r[2],t=r[3]?r[3].trim():r[4]?JSON.parse(r[4].trim()):null;i.push({type:e,args:t})}return i.length===0?{type:e,args:null}:i.length===1?i[0]:i}catch(n){return y.error(`ERROR: ${n.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},`detectDirective`),lhe=p(function(e){return e.replace(Ss,``)},`removeDirectives`),uhe=p(function(e,t){for(let[n,r]of t.entries())if(r.match(e))return n;return-1},`isSubstringInArray`),p(Im,`interpolateToCurve`),p($me,`formatUrl`),dhe=p((e,...t)=>{let n=e.split(`.`),r=n.length-1,i=n[r],a=window;for(let t=0;t<r;t++)if(a=a[n[t]],!a){y.error(`Function name: ${e} not found in window`);return}a[i](...t)},`runFunc`),p(Lm,`distance`),p(ehe,`traverseEdge`),p(the,`calcLabelPosition`),Gm=p((e,t=2)=>{let n=10**t;return Math.round(e*n)/n},`roundNumber`),Km=p((e,t)=>{let n,r=t;for(let t of e){if(n){let e=Lm(t,n);if(e===0)return n;if(e<r)r-=e;else{let i=r/e;if(i<=0)return n;if(i>=1)return{x:t.x,y:t.y};if(i>0&&i<1)return{x:Gm((1-i)*n.x+i*t.x,5),y:Gm((1-i)*n.y+i*t.y,5)}}}n=t}throw Error(`Could not find a suitable point for the given distance`)},`calculatePoint`),fhe=p((e,t,n)=>{y.info(`our points ${JSON.stringify(t)}`),t[0]!==n&&(t=t.reverse());let r=Km(t,25),i=e?10:5,a=Math.atan2(t[0].y-r.y,t[0].x-r.x),o={x:0,y:0};return o.x=Math.sin(a)*i+(t[0].x+r.x)/2,o.y=-Math.cos(a)*i+(t[0].y+r.y)/2,o},`calcCardinalityPosition`),p(nhe,`calcTerminalLabelPosition`),p(Rm,`getStylesFromArray`),qm=0,Jm=p(()=>(qm++,`id-`+Math.random().toString(36).substr(2,12)+`-`+qm),`generateId`),p(rhe,`makeRandomHex`),Ym=p(e=>rhe(e.length),`random`),phe=p(function(){return{x:0,y:0,fill:void 0,anchor:`start`,style:`#666`,width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:``}},`getTextObj`),mhe=p(function(e,t){let n=t.text.replace(Vs.lineBreakRegex,` `),[,r]=$m(t.fontSize),i=e.append(`text`);i.attr(`x`,t.x),i.attr(`y`,t.y),i.style(`text-anchor`,t.anchor),i.style(`font-family`,t.fontFamily),i.style(`font-size`,r),i.style(`font-weight`,t.fontWeight),i.attr(`fill`,t.fill),t.class!==void 0&&i.attr(`class`,t.class);let a=i.append(`tspan`);return a.attr(`x`,t.x+t.textMargin*2),a.attr(`fill`,t.fill),a.text(n),i},`drawSimpleText`),Xm=Mm((e,t,n)=>{if(!e||(n=Object.assign({fontSize:12,fontWeight:400,fontFamily:`Arial`,joinWith:`<br/>`},n),Vs.lineBreakRegex.test(e)))return e;let r=e.split(` `).filter(Boolean),i=[],a=``;return r.forEach((e,o)=>{let s=Bm(`${e} `,n),l=Bm(a,n);if(s>t){let{hyphenatedStrings:r,remainingWord:o}=hhe(e,t,`-`,n);i.push(a,...r),a=o}else l+s>=t?(i.push(a),a=e):a=[a,e].filter(Boolean).join(` `);o+1===r.length&&i.push(a)}),i.filter(e=>e!==``).join(n.joinWith)},(e,t,n)=>`${e}${t}${n.fontSize}${n.fontWeight}${n.fontFamily}${n.joinWith}`),hhe=Mm((e,t,n=`-`,r)=>{r=Object.assign({fontSize:12,fontWeight:400,fontFamily:`Arial`,margin:0},r);let i=[...e],a=[],o=``;return i.forEach((e,s)=>{let l=`${o}${e}`;if(Bm(l,r)>=t){let e=s+1,t=i.length===e,r=`${l}${n}`;a.push(t?l:r),o=``}else o=l}),{hyphenatedStrings:a,remainingWord:o}},(e,t,n=`-`,r)=>`${e}${t}${n}${r.fontSize}${r.fontWeight}${r.fontFamily}`),p(zm,`calculateTextHeight`),p(Bm,`calculateTextWidth`),Zm=Mm((e,t)=>{let{fontSize:n=12,fontFamily:r=`Arial`,fontWeight:i=400}=t;if(!e)return{width:0,height:0};let[,a]=$m(n),o=[`sans-serif`,r],s=e.split(Vs.lineBreakRegex),l=[],u=$c(`body`);if(!u.remove)return{width:0,height:0,lineHeight:0};let d=u.append(`svg`);for(let e of o){let t=0,n={width:0,height:0,lineHeight:0};for(let r of s){let o=phe();o.text=r||``;let s=mhe(d,o).style(`font-size`,a).style(`font-weight`,i).style(`font-family`,e),l=(s._groups||s)[0][0].getBBox();if(l.width===0&&l.height===0)throw Error(`svg element not in render tree`);n.width=Math.round(Math.max(n.width,l.width)),t=Math.round(l.height),n.height+=t,n.lineHeight=Math.round(Math.max(n.lineHeight,t))}l.push(n)}return d.remove(),l[isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),ghe=class{constructor(e=!1,t){this.count=0,this.count=t?t.length:0,this.next=e?()=>this.count++:()=>Date.now()}static{p(this,`InitIDGenerator`)}},_he=p(function(e){return Qm||=document.createElement(`div`),e=escape(e).replace(/%26/g,`&`).replace(/%23/g,`#`).replace(/%3B/g,`;`),Qm.innerHTML=e,unescape(Qm.textContent)},`entityDecode`),p(Vm,`isDetailedError`),vhe=p((e,t,n,r)=>{if(!r)return;let i=e.node()?.getBBox();i&&e.append(`text`).text(r).attr(`text-anchor`,`middle`).attr(`x`,i.x+i.width/2).attr(`y`,-n).attr(`class`,t)},`insertTitle`),$m=p(e=>{if(typeof e==`number`)return[e,e+`px`];let t=parseInt(e??``,10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+`px`]:[t,e]},`parseFontSize`),p(Hm,`cleanAndMerge`),eh={assignWithDepth:qo,wrapLabel:Xm,calculateTextHeight:zm,calculateTextWidth:Bm,calculateTextDimensions:Zm,cleanAndMerge:Hm,detectInit:che,detectDirective:Wm,isSubstringInArray:uhe,interpolateToCurve:Im,calcLabelPosition:the,calcCardinalityPosition:fhe,calcTerminalLabelPosition:nhe,formatUrl:$me,getStylesFromArray:Rm,generateId:Jm,random:Ym,runFunc:dhe,entityDecode:_he,insertTitle:vhe,isLabelCoordinateInPath:ihe,parseFontSize:$m,InitIDGenerator:ghe},yhe=p(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(e){return e.substring(0,e.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(e){return e.substring(0,e.length-1)}),t=t.replace(/#\w+;/g,function(e){let t=e.substring(1,e.length-1);return/^\+?\d+$/.test(t)?`fl°°`+t+`¶ß`:`fl°`+t+`¶ß`}),t},`encodeEntities`),th=p(function(e){return e.replace(/fl°°/g,`&#`).replace(/fl°/g,`&`).replace(/¶ß/g,`;`)},`decodeEntities`),nh=p((e,t,{counter:n=0,prefix:r,suffix:i},a)=>a||`${r?`${r}_`:``}${e}_${t}_${n}${i?`_${i}`:``}`,`getEdgeId`),p(Um,`handleUndefinedAttr`),p(ihe,`isLabelCoordinateInPath`)})),bhe=s(((e,t)=>{(function(e){"use strict";var n=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.msRequestAnimationFrame||function(e){return setTimeout(e,16)};function r(){var t=this;t.reads=[],t.writes=[],t.raf=n.bind(e)}r.prototype={constructor:r,runTasks:function(e){for(var t;t=e.shift();)t()},measure:function(e,t){var n=t?e.bind(t):e;return this.reads.push(n),i(this),n},mutate:function(e,t){var n=t?e.bind(t):e;return this.writes.push(n),i(this),n},clear:function(e){return o(this.reads,e)||o(this.writes,e)},extend:function(e){if(typeof e!=`object`)throw Error(`expected object`);var t=Object.create(this);return s(t,e),t.fastdom=this,t.initialize&&t.initialize(),t},catch:null};function i(e){e.scheduled||(e.scheduled=!0,e.raf(a.bind(null,e)))}function a(e){var t=e.writes,n=e.reads,r;try{n.length,e.runTasks(n),t.length,e.runTasks(t)}catch(e){r=e}if(e.scheduled=!1,(n.length||t.length)&&i(e),r){if(r.message,e.catch)e.catch(r);else throw r}}function o(e,t){var n=e.indexOf(t);return!!~n&&!!e.splice(n,1)}function s(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}var l=e.fastdom=e.fastdom||new r;typeof define==`function`?define(function(){return l}):typeof t==`object`&&(t.exports=l)})(typeof window<`u`?window:e===void 0?globalThis:e)})),xhe=s(((e,t)=>{(function(){var e={initialize:function(){this._tasks=new Map},mutate:function(e,t){return n(this,`mutate`,e,t)},measure:function(e,t){return n(this,`measure`,e,t)},clear:function(e){var t=this._tasks,n=t.get(e);this.fastdom.clear(n),t.delete(e)}};function n(e,t,n,r){var i=e._tasks,a=e.fastdom,o,s=new Promise(function(e,l){o=a[t](function(){i.delete(s);try{e(r?n.call(r):n())}catch(e){l(e)}},r)});return i.set(s,o),s}(typeof define)[0]==`f`?define(function(){return e}):(typeof t)[0]==`o`?t.exports=e:window.fastdomPromised=e})()}));function ih(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function She(e){lh=e}function ah(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(dh.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}function oh(e,t){if(t){if(dh.escapeTest.test(e))return e.replace(dh.escapeReplace,Rh)}else if(dh.escapeTestNoEncode.test(e))return e.replace(dh.escapeReplaceNoEncode,Rh);return e}function Che(e){try{e=encodeURI(e).replace(dh.percentDecode,`%`)}catch{return null}return e}function whe(e,t){let n=e.replace(dh.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(dh.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(dh.slashPipe,`|`);return n}function sh(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function The(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Ehe(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let l={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,l}function Dhe(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`385+`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`386+`)}function ch(e,t){return Gh.parse(e,t)}var lh,uh,Ohe,dh,khe,Ahe,jhe,fh,Mhe,ph,mh,hh,Nhe,gh,Phe,_h,Fhe,Ihe,vh,yh,Lhe,bh,xh,Sh,Rhe,zhe,Bhe,Vhe,Ch,Hhe,wh,Th,Eh,Uhe,Dh,Whe,Ghe,Khe,Oh,qhe,Jhe,kh,Yhe,Xhe,Zhe,Qhe,$he,ege,tge,Ah,nge,jh,Mh,rge,Nh,Ph,ige,Fh,age,Ih,Lh,oge,Rh,zh,Bh,Vh,Hh,Uh,Wh,sge,Gh,cge=o((()=>{lh=ih(),uh={exec:()=>null},Ohe=(()=>{try{return!0}catch{return!1}})(),dh={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`)},khe=/^(?:[ \t]*(?:\n|$))+/,Ahe=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,jhe=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,fh=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Mhe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ph=/(?:[*+-]|\d{1,9}[.)])/,mh=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,hh=ah(mh).replace(/bull/g,ph).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Nhe=ah(mh).replace(/bull/g,ph).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),gh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Phe=/^[^\n]+/,_h=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Fhe=ah(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,_h).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ihe=ah(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ph).getRegex(),vh=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,yh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Lhe=ah(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,yh).replace(`tag`,vh).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),bh=ah(gh).replace(`hr`,fh).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,vh).getRegex(),xh={blockquote:ah(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,bh).getRegex(),code:Ahe,def:Fhe,fences:jhe,heading:Mhe,hr:fh,html:Lhe,lheading:hh,list:Ihe,newline:khe,paragraph:bh,table:uh,text:Phe},Sh=ah(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,fh).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,vh).getRegex(),Rhe={...xh,lheading:Nhe,table:Sh,paragraph:ah(gh).replace(`hr`,fh).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Sh).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,vh).getRegex()},zhe={...xh,html:ah(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,yh).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:uh,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ah(gh).replace(`hr`,fh).replace(`heading`,` *#{1,6} *[^387+]`).replace(`lheading`,hh).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Bhe=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Vhe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ch=/^( {2,}|\\)\n(?!\s*$)/,Hhe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,wh=/[\p{P}\p{S}]/u,Th=/[\s\p{P}\p{S}]/u,Eh=/[^\s\p{P}\p{S}]/u,Uhe=ah(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,Th).getRegex(),Dh=/(?!~)[\p{P}\p{S}]/u,Whe=/(?!~)[\s\p{P}\p{S}]/u,Ghe=/(?:[^\s\p{P}\p{S}]|~)/u,Khe=ah(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Ohe?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Oh=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,qhe=ah(Oh,`u`).replace(/punct/g,wh).getRegex(),Jhe=ah(Oh,`u`).replace(/punct/g,Dh).getRegex(),kh=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Yhe=ah(kh,`gu`).replace(/notPunctSpace/g,Eh).replace(/punctSpace/g,Th).replace(/punct/g,wh).getRegex(),Xhe=ah(kh,`gu`).replace(/notPunctSpace/g,Ghe).replace(/punctSpace/g,Whe).replace(/punct/g,Dh).getRegex(),Zhe=ah(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,Eh).replace(/punctSpace/g,Th).replace(/punct/g,wh).getRegex(),Qhe=ah(/\\(punct)/,`gu`).replace(/punct/g,wh).getRegex(),$he=ah(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ege=ah(yh).replace(`(?:-->|$)`,`-->`).getRegex(),tge=ah(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,ege).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ah=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,nge=ah(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace(`label`,Ah).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),jh=ah(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Ah).replace(`ref`,_h).getRegex(),Mh=ah(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,_h).getRegex(),rge=ah(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,jh).replace(`nolink`,Mh).getRegex(),Nh=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ph={_backpedal:uh,anyPunctuation:Qhe,autolink:$he,blockSkip:Khe,br:Ch,code:Vhe,del:uh,emStrongLDelim:qhe,emStrongRDelimAst:Yhe,emStrongRDelimUnd:Zhe,escape:Bhe,link:nge,nolink:Mh,punctuation:Uhe,reflink:jh,reflinkSearch:rge,tag:tge,text:Hhe,url:uh},ige={...Ph,link:ah(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Ah).getRegex(),reflink:ah(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Ah).getRegex()},Fh={...Ph,emStrongRDelimAst:Xhe,emStrongLDelim:Jhe,url:ah(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,Nh).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ah(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,Nh).getRegex()},age={...Fh,br:ah(Ch).replace(`{2,}`,`*`).getRegex(),text:ah(Fh.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Ih={normal:xh,gfm:Rhe,pedantic:zhe},Lh={normal:Ph,gfm:Fh,breaks:age,pedantic:ige},oge={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},Rh=e=>oge[e],zh=class{options;rules;lexer;constructor(e){this.options=e||lh}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:sh(e,`388+`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Dhe(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=sh(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:sh(t[0],`389+`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=sh(t[0],`390+`).split(`391+`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`392+`),l=s.replace(this.rules.other.blockquoteSetextReplace,`393+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}394+${s}`:s,r=r?`${r}395+${l}`:l;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,i,!0),this.lexer.state.top=u,e.length===0)break;let d=i.at(-1);if(d?.type===`code`)break;if(d?.type===`blockquote`){let t=d,a=t.raw+`396+`+e.join(`397+`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if(d?.type===`list`){let t=d,a=t.raw+`398+`+e.join(`399+`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-d.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`400+`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let l=t[2].split(`401+`,1)[0].replace(this.rules.other.listReplaceTabs,e=>` `.repeat(3*e.length)),u=e.split(`402+`,1)[0],d=!l.trim(),f=0;if(this.options.pedantic?(f=2,s=l.trimStart()):d?f=t[1].length+1:(f=t[2].search(this.rules.other.nonSpaceChar),f=f>4?1:f,s=l.slice(f),f+=t[1].length),d&&this.rules.other.blankLine.test(u)&&(r+=u+`403+`,e=e.substring(u.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(f),n=this.rules.other.hrRegex(f),i=this.rules.other.fencesBeginRegex(f),a=this.rules.other.headingBeginRegex(f),o=this.rules.other.htmlBeginRegex(f);for(;e;){let p=e.split(`404+`,1)[0],m;if(u=p,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting,` `),m=u):m=u.replace(this.rules.other.tabCharGlobal,` `),i.test(u)||a.test(u)||o.test(u)||t.test(u)||n.test(u))break;if(m.search(this.rules.other.nonSpaceChar)>=f||!u.trim())s+=`405+`+m.slice(f);else{if(d||l.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(l)||a.test(l)||n.test(l))break;s+=`406+`+u}!d&&!u.trim()&&(d=!0),r+=p+`407+`,e=e.substring(p.length+1),l=m.slice(f)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0));let p=null,m;this.options.gfm&&(p=this.rules.other.listIsTask.exec(s),p&&(m=p[0]!==`[ ] `,s=s.replace(this.rules.other.listReplaceTask,``))),i.items.push({type:`list_item`,raw:r,task:!!p,checked:m,loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=whe(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`408+`):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(whe(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`409+`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=sh(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=The(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Ehe(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Ehe(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,l=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);(r=l.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,l=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=l.slice(1,-1);return{type:`em`,raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}let u=l.slice(2,-2);return{type:`strong`,raw:l,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:`del`,raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},Bh=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||lh,this.options.tokenizer=this.options.tokenizer||new zh,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:dh,block:Ih.normal,inline:Lh.normal};this.options.pedantic?(t.block=Ih.pedantic,t.inline=Lh.pedantic):this.options.gfm&&(t.block=Ih.gfm,t.inline=this.options.breaks?Lh.breaks:Lh.gfm),this.tokenizer.rules=t}static get rules(){return{block:Ih,inline:Lh}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(dh.carriageReturn,`410+`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(dh.tabCharGlobal,` `).replace(dh.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`411+`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`412+`)?``:`413+`)+r.raw,n.text+=`414+`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`415+`)?``:`416+`)+r.raw,n.text+=`417+`+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(`418+`)?``:`419+`)+r.raw,a.text+=`420+`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`421+`)?``:`422+`)+r.raw,n.text+=`423+`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},Vh=class{options;parser;constructor(e){this.options=e||lh}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(dh.notSpaceStart)?.[0],i=e.replace(dh.endingNewline,``)+`424+`;return r?`<pre><code class="language-`+oh(r)+`">`+(n?i:oh(i,!0))+`</code></pre>425+`:`<pre><code>`+(n?i:oh(i,!0))+`</code></pre>426+`}blockquote({tokens:e}){return`<blockquote>427+${this.parser.parse(e)}</blockquote>428+`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>429+`}hr(e){return`<hr>430+`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>431+`+r+`</`+i+`>432+`}listitem(e){let t=``;if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type===`paragraph`?(e.tokens[0].text=n+` `+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type===`text`&&(e.tokens[0].tokens[0].text=n+` `+oh(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:`text`,raw:n+` `,text:n+` `,escaped:!0}):t+=n+` `}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>433+`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox">`}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>434+`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>435+<thead>436+`+t+`</thead>437+`+r+`</table>438+`}tablerow({text:e}){return`<tr>439+${e}</tr>440+`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>441+`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${oh(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Che(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+oh(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Che(e);if(i===null)return oh(n);e=i;let a=`<img src="${e}" alt="${n}"`;return t&&(a+=` title="${oh(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:oh(e.text)}},Hh=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}},Uh=class e{options;renderer;textRenderer;constructor(e){this.options=e||lh,this.options.renderer=this.options.renderer||new Vh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Hh}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(t!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){n+=t||``;continue}}let a=i;switch(a.type){case`space`:n+=this.renderer.space(a);continue;case`hr`:n+=this.renderer.hr(a);continue;case`heading`:n+=this.renderer.heading(a);continue;case`code`:n+=this.renderer.code(a);continue;case`table`:n+=this.renderer.table(a);continue;case`blockquote`:n+=this.renderer.blockquote(a);continue;case`list`:n+=this.renderer.list(a);continue;case`html`:n+=this.renderer.html(a);continue;case`def`:n+=this.renderer.def(a);continue;case`paragraph`:n+=this.renderer.paragraph(a);continue;case`text`:{let i=a,o=this.renderer.text(i);for(;r+1<e.length&&e[r+1].type===`text`;)i=e[++r],o+=`442+`+this.renderer.text(i);n+=t?this.renderer.paragraph({type:`paragraph`,raw:o,text:o,tokens:[{type:`text`,raw:o,text:o,escaped:!0}]}):o;continue}default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}parseInline(e,t=this.renderer){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Wh=class{options;block;constructor(e){this.options=e||lh}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Bh.lex:Bh.lexInline}provideParser(){return this.block?Uh.parse:Uh.parseInline}},sge=class{defaults=ih();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Uh;Renderer=Vh;TextRenderer=Hh;Lexer=Bh;Tokenizer=zh;Hooks=Wh;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Vh(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new zh(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Wh;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=Wh.passThroughHooks.has(n)?e=>{if(this.defaults.async&&Wh.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Bh.lex(e,t??this.defaults)}parser(e,t){return Uh.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?Bh.lex:Bh.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?Uh.parse:Uh.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?Bh.lex:Bh.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?Uh.parse:Uh.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`443+Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+oh(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},Gh=new sge,ch.options=ch.setOptions=function(e){return Gh.setOptions(e),ch.defaults=Gh.defaults,She(ch.defaults),ch},ch.getDefaults=ih,ch.defaults=lh,ch.use=function(...e){return Gh.use(...e),ch.defaults=Gh.defaults,She(ch.defaults),ch},ch.walkTokens=function(e,t){return Gh.walkTokens(e,t)},ch.parseInline=Gh.parseInline,ch.Parser=Uh,ch.parser=Uh.parse,ch.Renderer=Vh,ch.TextRenderer=Hh,ch.Lexer=Bh,ch.lexer=Bh.lex,ch.Tokenizer=zh,ch.Hooks=Wh,ch.parse=ch,ch.options,ch.setOptions,ch.use,ch.walkTokens,ch.parseInline,Uh.parse,Bh.lex}));function lge(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Array.from(typeof e==`string`?[e]:e);r[r.length-1]=r[r.length-1].replace(/\r?\n([\t ]*)$/,``);var i=r.reduce(function(e,t){var n=t.match(/\n([\t ]+|(?!\s).)/g);return n?e.concat(n.map(function(e){return e.match(/[\t ]/g)?.length??0})):e},[]);if(i.length){var a=RegExp(`444+[ ]{${Math.min.apply(Math,i)}}`,`g`);r=r.map(function(e){return e.replace(a,`445+`)})}r[0]=r[0].replace(/^\r?\n/,``);var o=r[0];return t.forEach(function(e,t){var n=o.match(/(?:^|\n)( *)$/),i=n?n[1]:``,a=e;typeof e==`string`&&e.includes(`446+`)&&(a=String(e).split(`447+`).map(function(e,t){return t===0?e:`${i}${e}`}).join(`448+`)),o+=a+r[t+1]}),o}var uge=o((()=>{}));function dge(e,{markdownAutoWrap:t}){return lge(e.replace(/<br\/>/g,`449+`).replace(/\n{2,}/g,`450+`))}function fge(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(e=>e.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(e=>({content:e,type:`normal`}))??[])}function pge(e,t={}){let n=dge(e,t),r=ch.lexer(n),i=[[]],a=0;function o(e,t=`normal`){e.type===`text`?e.text.split(`451+`).forEach((e,n)=>{n!==0&&(a++,i.push([])),e.split(` `).forEach(e=>{e=e.replace(/'/g,`'`),e&&i[a].push({content:e,type:t})})}):e.type===`strong`||e.type===`em`?e.tokens.forEach(t=>{o(t,e.type)}):e.type===`html`&&i[a].push({content:e.text,type:`normal`})}return p(o,`processNode`),r.forEach(e=>{e.type===`paragraph`?e.tokens?.forEach(e=>{o(e)}):e.type===`html`?i[a].push({content:e.text,type:`normal`}):i[a].push({content:e.raw,type:`normal`})}),i}function mge(e){return e?`<p>${e.replace(/\\n|\n/g,`<br />`)}</p>`:``}function hge(e,{markdownAutoWrap:t}={}){let n=ch.lexer(e);function r(e){return e.type===`text`?t===!1?e.text.replace(/\n */g,`<br/>`).replace(/ /g,` `):e.text.replace(/\n */g,`<br/>`):e.type===`strong`?`<strong>${e.tokens?.map(r).join(``)}</strong>`:e.type===`em`?`<em>${e.tokens?.map(r).join(``)}</em>`:e.type===`paragraph`?`<p>${e.tokens?.map(r).join(``)}</p>`:e.type===`space`?``:e.type===`html`?`${e.text}`:e.type===`escape`?e.text:(y.warn(`Unsupported markdown: ${e.type}`),e.raw)}return p(r,`output`),n.map(r).join(``)}function gge(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(e=>e.segment):[...e]}function _ge(e,t){return Kh(e,[],gge(t.content),t.type)}function Kh(e,t,n,r){if(n.length===0)return[{content:t.join(``),type:r},{content:``,type:r}];let[i,...a]=n,o=[...t,i];return e([{content:o.join(``),type:r}])?Kh(e,o,a,r):(t.length===0&&i&&(t.push(i),n.shift()),[{content:t.join(``),type:r},{content:n.join(``),type:r}])}function vge(e,t){if(e.some(({content:e})=>e.includes(`452+`)))throw Error(`splitLineToFitWidth does not support newlines in the line`);return qh(e,t)}function qh(e,t,n=[],r=[]){if(e.length===0)return r.length>0&&n.push(r),n.length>0?n:[];let i=``;e[0].content===` `&&(i=` `,e.shift());let a=e.shift()??{content:` `,type:`normal`},o=[...r];if(i!==``&&o.push({content:i,type:`normal`}),o.push(a),t(o))return qh(e,t,n,o);if(r.length>0)n.push(r),e.unshift(a);else if(a.content){let[r,i]=_ge(t,a);n.push([r]),i.content&&e.unshift(i)}return qh(e,t,n)}function Jh(e,t){t&&e.attr(`style`,t)}async function yge(e,t,n,r,i=!1,a=ms()){let o=e.append(`foreignObject`);o.attr(`width`,`${Math.min(10*n,ng)}px`),o.attr(`height`,`${Math.min(10*n,ng)}px`);let s=o.append(`xhtml:div`),l=Rs(t.label)?await Bs(t.label.replace(Vs.lineBreakRegex,`453+`),a):js(t.label,a),u=t.isNode?`nodeLabel`:`edgeLabel`,d=s.append(`span`);return d.html(l),Jh(d,t.labelStyle),d.attr(`class`,`${u} ${r}`),Jh(s,t.labelStyle),s.style(`display`,`table-cell`),s.style(`white-space`,`nowrap`),s.style(`line-height`,`1.5`),n!==1/0&&(s.style(`max-width`,n+`px`),s.style(`text-align`,`center`)),s.attr(`xmlns`,`http://www.w3.org/1999/xhtml`),i&&s.attr(`class`,`labelBkg`),(await tg.measure(()=>s.node().getBoundingClientRect())).width===n&&(s.style(`display`,`table`),s.style(`white-space`,`break-spaces`),s.style(`width`,n+`px`)),o.node()}function Yh(e,t,n,r=!1){let i=e.append(`tspan`).attr(`class`,`text-outer-tspan`).attr(`x`,0).attr(`y`,t*n-.1+`em`).attr(`dy`,n+`em`);return r&&i.attr(`text-anchor`,`middle`),i}function bge(e,t,n){let r=e.append(`text`),i=Yh(r,1,t);Zh(i,n);let a=i.node().getComputedTextLength();return r.remove(),a}function xge(e,t,n){let r=e.append(`text`),i=Yh(r,1,t);Zh(i,[{content:n,type:`normal`}]);let a=i.node()?.getBoundingClientRect();return a&&r.remove(),a}function Sge(e,t,n,r=!1,i=!1){let a=1.1,o=t.append(`g`),s=o.insert(`rect`).attr(`class`,`background`).attr(`style`,`stroke: none`),l=o.append(`text`).attr(`y`,`-10.1`);i&&l.attr(`text-anchor`,`middle`);let u=0;for(let t of n){let n=p(t=>bge(o,a,t)<=e,`checkWidth`),r=n(t)?[t]:vge(t,n);for(let e of r)Zh(Yh(l,u,a,i),e),u++}if(r){let e=l.node().getBBox();return s.attr(`x`,e.x-2).attr(`y`,e.y-2).attr(`width`,e.width+4).attr(`height`,e.height+4),o.node()}return l.node()}function Xh(e){return e.replace(/&(amp|lt|gt);/g,(e,t)=>{switch(t){case`amp`:return`&`;case`lt`:return`<`;case`gt`:return`>`;default:return e}})}function Zh(e,t){e.text(``),t.forEach((t,n)=>{let r=e.append(`tspan`).attr(`font-style`,t.type===`em`?`italic`:`normal`).attr(`class`,`text-inner-tspan`).attr(`font-weight`,t.type===`strong`?`bold`:`normal`);n===0?r.text(Xh(t.content)):r.text(` `+Xh(t.content))})}async function Cge(e,t={}){let n=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(e,r,i)=>(n.push((async()=>{let n=`${r}:${i}`;return await lme(n)?await Wp(n,void 0,{class:`label-icon`}):`<i class='${js(e,t).replace(`:`,` `)}'></i>`})()),e));let r=await Promise.all(n);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>r.shift()??``)}var wge,Tge,Qh,$h,eg,Ege,Dge,Oge,tg,ng,rg,ig=o((()=>{Gp(),rh(),dc(),S(),h(),wge=d(bhe(),1),Tge=d(xhe(),1),_p(),cge(),uge(),Qh=typeof performance<`u`&&typeof performance.now==`function`,$h=p(()=>Qh?performance.now():0,`now`),eg=`🧜 `,Ege=`Mermaid render`,Dge=`Mermaid`,Oge={parse:`tertiary`,prepare:`secondary`,measure:`primary`,layout:`primary-dark`,layoutCore:`error`,draw:`primary-light`,paint:`secondary-dark`,serialize:`tertiary-dark`,render:`primary-light`},class{constructor(){this.enabled=!1,this.autoPrint=!0,this.records=[],this.maxRecords=200,this.roots=[],this.stack=[],this.buckets={}}static{p(this,`Profiler`)}enable(){return this.enabled=!0,this}disable(){return this.enabled=!1,this}start(e){this.enabled&&(this.roots=[],this.stack=[],this.buckets={},this.begin(e))}tickSync(e,t){if(!this.enabled)return t();let n=$h();try{return t()}finally{this.buckets[e]=(this.buckets[e]??0)+($h()-n)}}async tick(e,t){if(!this.enabled)return t();let n=$h();try{return await t()}finally{this.buckets[e]=(this.buckets[e]??0)+($h()-n)}}stop(){if(!this.enabled)return;for(;this.stack.length>0;)this.end();let e=this.roots.at(-1),t=this.runLabel??e?.name;return e&&(this.records.push({label:t??e.name,tree:e,buckets:{...this.buckets}}),this.records.length>this.maxRecords&&this.records.splice(0,this.records.length-this.maxRecords),this.autoPrint&&this.printSummary(e,t)),this.runLabel=void 0,e}begin(e){if(!this.enabled)return;let t={name:e,start:$h(),duration:-1,children:[]},n=this.stack.at(-1);if(n?n.children.push(t):this.roots.push(t),this.stack.push(t),Qh&&typeof performance.mark==`function`)try{performance.mark(`${eg}${e} \u25B6`)}catch{}}end(){if(!this.enabled)return;let e=this.stack.pop();if(!e)return;let t=$h();if(e.duration=t-e.start,Qh&&typeof performance.measure==`function`)try{performance.measure(`${eg}${e.name}`,{start:e.start,end:t,detail:{devtools:{dataType:`track-entry`,track:Ege,trackGroup:Dge,color:Oge[e.name]??`primary`,tooltipText:`${e.name} \u2014 ${e.duration.toFixed(1)} ms`}}})}catch{}}async span(e,t){if(!this.enabled)return t();this.begin(e);try{return await t()}finally{this.end()}}report(){return this.records.at(-1)?.tree??this.roots.at(-1)}clear(){this.records.length=0,this.roots=[],this.stack=[],this.runLabel=void 0}reset(){this.roots=[],this.stack=[]}printSummary(e=this.report(),t){if(!e)return;let n=e.duration,r=t&&t!==e.name?`${e.name} [${t}]`:e.name,i=[`ms % phase`],a=p((e,t)=>{let r=` `.repeat(t),o=e.duration.toFixed(1).padStart(8),s=n>0?`${(e.duration/n*100).toFixed(0).padStart(3)}%`:` -`;i.push(`${o} ${s} ${r}${e.name}`);for(let n of e.children)a(n,t+1);if(e.children.length>0){let t=e.children.reduce((e,t)=>e+t.duration,0),n=e.duration-t;if(n>.5){let e=n.toFixed(1).padStart(8);i.push(`${e} ${r} (self)`)}}},`walk`);a(e,0);let o=Object.keys(this.buckets);if(o.length>0){i.push(`—— buckets (summed) ——`);for(let e of o)i.push(`${this.buckets[e].toFixed(1).padStart(8)} ${e}`)}console.log(`${eg}mermaid render profile \xB7 ${r}454+${i.join(`455+`)}`)}},globalThis.injected??={includeLargeFeatures:!0,profiling:!1,version:`0.0.0`},tg=wge.default.extend({raf(e){typeof queueMicrotask==`function`?queueMicrotask(e):setTimeout(e,0)}}).extend(Tge.default),p(dge,`preprocessMarkdown`),p(fge,`nonMarkdownToLines`),p(pge,`markdownToLines`),p(mge,`nonMarkdownToHTML`),p(hge,`markdownToHTML`),p(gge,`splitTextToChars`),p(_ge,`splitWordToFitWidth`),p(Kh,`splitWordToFitWidthRecursion`),p(vge,`splitLineToFitWidth`),p(qh,`splitLineToFitWidthRecursion`),p(Jh,`applyStyle`),ng=16384,p(yge,`addHtmlSpan`),p(Yh,`createTspan`),p(bge,`computeWidthOfText`),p(xge,`computeDimensionOfText`),p(Sge,`createFormattedText`),p(Xh,`decodeHTMLEntities`),p(Zh,`updateTextContentAndStyles`),p(Cge,`replaceIconSubstring`),rg=p(async(e,t=``,{style:n=``,isTitle:r=!1,classes:i=``,useHtmlLabels:a=!0,markdown:o=!0,isNode:s=!0,width:l=200,addSvgBackground:u=!1}={},d)=>{if(y.debug(`XYZ createText`,t,n,r,i,a,s,`addSvgBackground: `,u),a){let r=o?hge(t,d):mge(t),a=await Cge(th(r),d),f=t.replace(/\\\\/g,`\\`);return await yge(e,{isNode:s,label:Rs(t)?f:a,labelStyle:n.replace(`fill:`,`color:`)},l,i,u,d)}{let i=th(t.replace(/<br\s*\/?>/g,`<br/>`)),a=Sge(l,e,o?pge(i.replace(`<br>`,`<br/>`),d):fge(i),t?u:!1,!s);if(s){/stroke:/.exec(n)&&(n=n.replace(`stroke:`,`lineColor:`));let e=n.replace(/stroke:[^;]+;?/g,``).replace(/stroke-width:[^;]+;?/g,``).replace(/fill:[^;]+;?/g,``).replace(/color:/g,`fill:`);$c(a).attr(`style`,e)}else{let e=n.replace(/stroke:[^;]+;?/g,``).replace(/stroke-width:[^;]+;?/g,``).replace(/fill:[^;]+;?/g,``).replace(/background:/g,`fill:`);$c(a).select(`rect`).attr(`style`,e.replace(/background:/g,`fill:`));let t=n.replace(/stroke:[^;]+;?/g,``).replace(/stroke-width:[^;]+;?/g,``).replace(/fill:[^;]+;?/g,``).replace(/color:/g,`fill:`);$c(a).select(`text`).attr(`style`,t)}return r?$c(a).selectAll(`tspan.text-outer-tspan`).classed(`title-row`,!0):$c(a).selectAll(`tspan.text-outer-tspan`).classed(`row`,!0),a}},`createText`)}));function ag(e,t,n){if(e&&e.length){let[r,i]=t,a=Math.PI/180*n,o=Math.cos(a),s=Math.sin(a);for(let t of e){let[e,n]=t;t[0]=(e-r)*o-(n-i)*s+r,t[1]=(e-r)*s+(n-i)*o+i}}}function kge(e,t){return e[0]===t[0]&&e[1]===t[1]}function Age(e,t,n,r=1){let i=n,a=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]==`number`?[e]:e,s=[0,0];if(i)for(let e of o)ag(e,s,i);let l=function(e,t,n){let r=[];for(let t of e){let e=[...t];kge(e[0],e[e.length-1])||e.push([e[0][0],e[0][1]]),e.length>2&&r.push(e)}let i=[];t=Math.max(t,.1);let a=[];for(let e of r)for(let t=0;t<e.length-1;t++){let n=e[t],r=e[t+1];if(n[1]!==r[1]){let e=Math.min(n[1],r[1]);a.push({ymin:e,ymax:Math.max(n[1],r[1]),x:e===n[1]?n[0]:r[0],islope:(r[0]-n[0])/(r[1]-n[1])})}}if(a.sort(((e,t)=>e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax))),!a.length)return i;let o=[],s=a[0].ymin,l=0;for(;o.length||a.length;){if(a.length){let e=-1;for(let t=0;t<a.length&&!(a[t].ymin>s);t++)e=t;a.splice(0,e+1).forEach((e=>{o.push({s,edge:e})}))}if(o=o.filter((e=>!(e.edge.ymax<=s))),o.sort(((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x))),(n!==1||l%t==0)&&o.length>1)for(let e=0;e<o.length;e+=2){let t=e+1;if(t>=o.length)break;let n=o[e].edge,r=o[t].edge;i.push([[Math.round(n.x),s],[Math.round(r.x),s]])}s+=n,o.forEach((e=>{e.edge.x=e.edge.x+n*e.edge.islope})),l++}return i}(o,a,r);if(i){for(let e of o)ag(e,s,-i);(function(e,t,n){let r=[];e.forEach((e=>r.push(...e))),ag(r,t,n)})(l,s,-i)}return l}function og(e,t){let n=t.hachureAngle+90,r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.round(Math.max(r,.1));let i=1;return t.roughness>=1&&(t.randomizer?.next()||Math.random())>.7&&(i=r),Age(e,r,n,i||1)}function sg(e){let t=e[0],n=e[1];return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}function cg(e,t){return e.type===t}function lg(e){let t=[],n=function(e){let t=[];for(;e!==``;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:e_e,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:kg,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length)}return t[t.length]={type:Ag,text:``},t}(e),r=`BOD`,i=0,a=n[i];for(;!cg(a,Ag);){let o=0,s=[];if(r===`BOD`){if(a.text!==`M`&&a.text!==`m`)return lg(`M0,0`+e);i++,o=jg[a.text],r=a.text}else cg(a,kg)?o=jg[r]:(i++,o=jg[a.text],r=a.text);if(!(i+o<n.length))throw Error(`Path data ended short`);for(let e=i;e<i+o;e++){let t=n[e];if(!cg(t,kg))throw Error(`Param not a number: `+r+`,`+t.text);s[s.length]=+t.text}if(typeof jg[r]!=`number`)throw Error(`Bad segment: `+r);{let e={key:r,data:s};t.push(e),i+=o,a=n[i],r===`M`&&(r=`L`),r===`m`&&(r=`l`)}}return t}function jge(e){let t=0,n=0,r=0,i=0,a=[];for(let{key:o,data:s}of e)switch(o){case`M`:a.push({key:`M`,data:[...s]}),[t,n]=s,[r,i]=s;break;case`m`:t+=s[0],n+=s[1],a.push({key:`M`,data:[t,n]}),r=t,i=n;break;case`L`:a.push({key:`L`,data:[...s]}),[t,n]=s;break;case`l`:t+=s[0],n+=s[1],a.push({key:`L`,data:[t,n]});break;case`C`:a.push({key:`C`,data:[...s]}),t=s[4],n=s[5];break;case`c`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`C`,data:e}),t=e[4],n=e[5];break}case`Q`:a.push({key:`Q`,data:[...s]}),t=s[2],n=s[3];break;case`q`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`Q`,data:e}),t=e[2],n=e[3];break}case`A`:a.push({key:`A`,data:[...s]}),t=s[5],n=s[6];break;case`a`:t+=s[5],n+=s[6],a.push({key:`A`,data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case`H`:a.push({key:`H`,data:[...s]}),t=s[0];break;case`h`:t+=s[0],a.push({key:`H`,data:[t]});break;case`V`:a.push({key:`V`,data:[...s]}),n=s[0];break;case`v`:n+=s[0],a.push({key:`V`,data:[n]});break;case`S`:a.push({key:`S`,data:[...s]}),t=s[2],n=s[3];break;case`s`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`S`,data:e}),t=e[2],n=e[3];break}case`T`:a.push({key:`T`,data:[...s]}),t=s[0],n=s[1];break;case`t`:t+=s[0],n+=s[1],a.push({key:`T`,data:[t,n]});break;case`Z`:case`z`:a.push({key:`Z`,data:[]}),t=r,n=i}return a}function Mge(e){let t=[],n=``,r=0,i=0,a=0,o=0,s=0,l=0;for(let{key:u,data:d}of e){switch(u){case`M`:t.push({key:`M`,data:[...d]}),[r,i]=d,[a,o]=d;break;case`C`:t.push({key:`C`,data:[...d]}),r=d[4],i=d[5],s=d[2],l=d[3];break;case`L`:t.push({key:`L`,data:[...d]}),[r,i]=d;break;case`H`:r=d[0],t.push({key:`L`,data:[r,i]});break;case`V`:i=d[0],t.push({key:`L`,data:[r,i]});break;case`S`:{let e=0,a=0;n===`C`||n===`S`?(e=r+(r-s),a=i+(i-l)):(e=r,a=i),t.push({key:`C`,data:[e,a,...d]}),s=d[0],l=d[1],r=d[2],i=d[3];break}case`T`:{let[e,a]=d,o=0,u=0;n===`Q`||n===`T`?(o=r+(r-s),u=i+(i-l)):(o=r,u=i);let f=r+2*(o-r)/3,p=i+2*(u-i)/3,m=e+2*(o-e)/3,h=a+2*(u-a)/3;t.push({key:`C`,data:[f,p,m,h,e,a]}),s=o,l=u,r=e,i=a;break}case`Q`:{let[e,n,a,o]=d,u=r+2*(e-r)/3,f=i+2*(n-i)/3,p=a+2*(e-a)/3,m=o+2*(n-o)/3;t.push({key:`C`,data:[u,f,p,m,a,o]}),s=e,l=n,r=a,i=o;break}case`A`:{let e=Math.abs(d[0]),n=Math.abs(d[1]),a=d[2],o=d[3],s=d[4],l=d[5],u=d[6];e===0||n===0?(t.push({key:`C`,data:[r,i,l,u,l,u]}),r=l,i=u):(r!==l||i!==u)&&(Nge(r,i,l,u,e,n,a,o,s).forEach((function(e){t.push({key:`C`,data:e})})),r=l,i=u);break}case`Z`:t.push({key:`Z`,data:[]}),r=a,i=o}n=u}return t}function ug(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function Nge(e,t,n,r,i,a,o,s,l,u){let d=(f=o,Math.PI*f/180);var f;let p=[],m=0,h=0,g=0,_=0;if(u)[m,h,g,_]=u;else{[e,t]=ug(e,t,-d),[n,r]=ug(n,r,-d);let o=(e-n)/2,u=(t-r)/2,f=o*o/(i*i)+u*u/(a*a);f>1&&(f=Math.sqrt(f),i*=f,a*=f);let p=i*i,v=a*a,y=p*v-p*u*u-v*o*o,b=p*u*u+v*o*o,x=(s===l?-1:1)*Math.sqrt(Math.abs(y/b));g=x*i*u/a+(e+n)/2,_=x*-a*o/i+(t+r)/2,m=Math.asin(parseFloat(((t-_)/a).toFixed(9))),h=Math.asin(parseFloat(((r-_)/a).toFixed(9))),e<g&&(m=Math.PI-m),n<g&&(h=Math.PI-h),m<0&&(m=2*Math.PI+m),h<0&&(h=2*Math.PI+h),l&&m>h&&(m-=2*Math.PI),!l&&h>m&&(h-=2*Math.PI)}let v=h-m;if(Math.abs(v)>120*Math.PI/180){let e=h,t=n,s=r;h=l&&h>m?m+120*Math.PI/180*1:m+120*Math.PI/180*-1,p=Nge(n=g+i*Math.cos(h),r=_+a*Math.sin(h),t,s,i,a,o,0,l,[h,e,g,_])}v=h-m;let y=Math.cos(m),b=Math.sin(m),x=Math.cos(h),S=Math.sin(h),C=Math.tan(v/4),w=4/3*i*C,T=4/3*a*C,E=[e,t],D=[e+w*b,t-T*y],O=[n+w*S,r-T*x],k=[n,r];if(D[0]=2*E[0]-D[0],D[1]=2*E[1]-D[1],u)return[D,O,k].concat(p);{p=[D,O,k].concat(p);let e=[];for(let t=0;t<p.length;t+=3){let n=ug(p[t][0],p[t][1],d),r=ug(p[t+1][0],p[t+1][1],d),i=ug(p[t+2][0],p[t+2][1],d);e.push([n[0],n[1],r[0],r[1],i[0],i[1]])}return e}}function Pge(e,t,n,r,i){return{type:`path`,ops:_g(e,t,n,r,i)}}function dg(e,t,n){let r=(e||[]).length;if(r>2){let i=[];for(let t=0;t<r-1;t++)i.push(..._g(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&i.push(..._g(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:`path`,ops:i}}return r===2?Pge(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:`path`,ops:[]}}function Fge(e,t,n,r,i){return function(e,t){return dg(e,!0,t)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],i)}function Ige(e,t){if(e.length){let n=typeof e[0][0]==`number`?[e]:e,r=yg(n[0],1*(1+.2*t.roughness),t),i=t.disableMultiStroke?[]:yg(n[0],1.5*(1+.22*t.roughness),Bge(t));for(let e=1;e<n.length;e++){let a=n[e];if(a.length){let e=yg(a,1*(1+.2*t.roughness),t),n=t.disableMultiStroke?[]:yg(a,1.5*(1+.22*t.roughness),Bge(t));for(let t of e)t.op!==`move`&&r.push(t);for(let e of n)e.op!==`move`&&i.push(e)}}return{type:`path`,ops:r.concat(i)}}return{type:`path`,ops:[]}}function Lge(e,t,n){let r=Math.sqrt(2*Math.PI*Math.sqrt(((e/2)**2+(t/2)**2)/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),a=2*Math.PI/i,o=Math.abs(e/2),s=Math.abs(t/2),l=1-n.curveFitting;return o+=gg(o*l,n),s+=gg(s*l,n),{increment:a,rx:o,ry:s}}function fg(e,t,n,r){let[i,a]=Hge(r.increment,e,t,r.rx,r.ry,1,r.increment*hg(.1,hg(.4,1,n),n),n),o=bg(i,null,n);if(!n.disableMultiStroke&&n.roughness!==0){let[i]=Hge(r.increment,e,t,r.rx,r.ry,1.5,0,n),a=bg(i,null,n);o=o.concat(a)}return{estimatedPoints:a,opset:{type:`path`,ops:o}}}function Rge(e,t,n,r,i,a,o,s,l){let u=e,d=t,f=Math.abs(n/2),p=Math.abs(r/2);f+=gg(.01*f,l),p+=gg(.01*p,l);let m=i,h=a;for(;m<0;)m+=2*Math.PI,h+=2*Math.PI;h-m>2*Math.PI&&(m=0,h=2*Math.PI);let g=2*Math.PI/l.curveStepCount,_=Math.min(g/2,(h-m)/2),v=Uge(_,u,d,f,p,m,h,1,l);if(!l.disableMultiStroke){let e=Uge(_,u,d,f,p,m,h,1.5,l);v.push(...e)}return o&&(s?v.push(..._g(u,d,u+f*Math.cos(m),d+p*Math.sin(m),l),..._g(u,d,u+f*Math.cos(h),d+p*Math.sin(h),l)):v.push({op:`lineTo`,data:[u,d]},{op:`lineTo`,data:[u+f*Math.cos(m),d+p*Math.sin(m)]})),{type:`path`,ops:v}}function zge(e,t){let n=Mge(jge(lg(e))),r=[],i=[0,0],a=[0,0];for(let{key:e,data:o}of n)switch(e){case`M`:a=[o[0],o[1]],i=[o[0],o[1]];break;case`L`:r.push(..._g(a[0],a[1],o[0],o[1],t)),a=[o[0],o[1]];break;case`C`:{let[e,n,i,s,l,u]=o;r.push(...Wge(e,n,i,s,l,u,a,t)),a=[l,u];break}case`Z`:r.push(..._g(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]]}return{type:`path`,ops:r}}function pg(e,t){let n=[];for(let r of e)if(r.length){let e=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:`move`,data:[r[0][0]+gg(e,t),r[0][1]+gg(e,t)]});for(let a=1;a<i;a++)n.push({op:`lineTo`,data:[r[a][0]+gg(e,t),r[a][1]+gg(e,t)]})}}return{type:`fillPath`,ops:n}}function mg(e,t){return function(e,t){let n=e.fillStyle||`hachure`;if(!Og[n])switch(n){case`zigzag`:Og[n]||(Og[n]=new Jge(t));break;case`cross-hatch`:Og[n]||(Og[n]=new Yge(t));break;case`dots`:Og[n]||(Og[n]=new Xge(t));break;case`dashed`:Og[n]||(Og[n]=new Zge(t));break;case`zigzag-line`:Og[n]||(Og[n]=new Qge(t));break;default:n=`hachure`,Og[n]||(Og[n]=new Dg(t))}return Og[n]}(t,t_e).fillPolygons(e,t)}function Bge(e){let t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function Vge(e){return e.randomizer||=new $ge(e.seed||0),e.randomizer.next()}function hg(e,t,n,r=1){return n.roughness*r*(Vge(n)*(t-e)+e)}function gg(e,t,n=1){return hg(-e,e,t,n)}function _g(e,t,n,r,i,a=!1){let o=a?i.disableMultiStrokeFill:i.disableMultiStroke,s=vg(e,t,n,r,i,!0,!1);if(o)return s;let l=vg(e,t,n,r,i,!0,!0);return s.concat(l)}function vg(e,t,n,r,i,a,o){let s=(e-n)**2+(t-r)**2,l=Math.sqrt(s),u=1;u=l<200?1:l>500?.4:-.0016668*l+1.233334;let d=i.maxRandomnessOffset||0;d*d*100>s&&(d=l/10);let f=d/2,p=.2+.2*Vge(i),m=i.bowing*i.maxRandomnessOffset*(r-t)/200,h=i.bowing*i.maxRandomnessOffset*(e-n)/200;m=gg(m,i,u),h=gg(h,i,u);let g=[],_=()=>gg(f,i,u),v=()=>gg(d,i,u),y=i.preserveVertices;return a&&(o?g.push({op:`move`,data:[e+(y?0:_()),t+(y?0:_())]}):g.push({op:`move`,data:[e+(y?0:gg(d,i,u)),t+(y?0:gg(d,i,u))]})),o?g.push({op:`bcurveTo`,data:[m+e+(n-e)*p+_(),h+t+(r-t)*p+_(),m+e+2*(n-e)*p+_(),h+t+2*(r-t)*p+_(),n+(y?0:_()),r+(y?0:_())]}):g.push({op:`bcurveTo`,data:[m+e+(n-e)*p+v(),h+t+(r-t)*p+v(),m+e+2*(n-e)*p+v(),h+t+2*(r-t)*p+v(),n+(y?0:v()),r+(y?0:v())]}),g}function yg(e,t,n){if(!e.length)return[];let r=[];r.push([e[0][0]+gg(t,n),e[0][1]+gg(t,n)]),r.push([e[0][0]+gg(t,n),e[0][1]+gg(t,n)]);for(let i=1;i<e.length;i++)r.push([e[i][0]+gg(t,n),e[i][1]+gg(t,n)]),i===e.length-1&&r.push([e[i][0]+gg(t,n),e[i][1]+gg(t,n)]);return bg(r,null,n)}function bg(e,t,n){let r=e.length,i=[];if(r>3){let a=[],o=1-n.curveTightness;i.push({op:`move`,data:[e[1][0],e[1][1]]});for(let t=1;t+2<r;t++){let n=e[t];a[0]=[n[0],n[1]],a[1]=[n[0]+(o*e[t+1][0]-o*e[t-1][0])/6,n[1]+(o*e[t+1][1]-o*e[t-1][1])/6],a[2]=[e[t+1][0]+(o*e[t][0]-o*e[t+2][0])/6,e[t+1][1]+(o*e[t][1]-o*e[t+2][1])/6],a[3]=[e[t+1][0],e[t+1][1]],i.push({op:`bcurveTo`,data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(t&&t.length===2){let e=n.maxRandomnessOffset;i.push({op:`lineTo`,data:[t[0]+gg(e,n),t[1]+gg(e,n)]})}}else r===3?(i.push({op:`move`,data:[e[1][0],e[1][1]]}),i.push({op:`bcurveTo`,data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&i.push(...vg(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return i}function Hge(e,t,n,r,i,a,o,s){let l=[],u=[];if(s.roughness===0){e/=4,u.push([t+r*Math.cos(-e),n+i*Math.sin(-e)]);for(let a=0;a<=2*Math.PI;a+=e){let e=[t+r*Math.cos(a),n+i*Math.sin(a)];l.push(e),u.push(e)}u.push([t+r*Math.cos(0),n+i*Math.sin(0)]),u.push([t+r*Math.cos(e),n+i*Math.sin(e)])}else{let d=gg(.5,s)-Math.PI/2;u.push([gg(a,s)+t+.9*r*Math.cos(d-e),gg(a,s)+n+.9*i*Math.sin(d-e)]);let f=2*Math.PI+d-.01;for(let o=d;o<f;o+=e){let e=[gg(a,s)+t+r*Math.cos(o),gg(a,s)+n+i*Math.sin(o)];l.push(e),u.push(e)}u.push([gg(a,s)+t+r*Math.cos(d+2*Math.PI+.5*o),gg(a,s)+n+i*Math.sin(d+2*Math.PI+.5*o)]),u.push([gg(a,s)+t+.98*r*Math.cos(d+o),gg(a,s)+n+.98*i*Math.sin(d+o)]),u.push([gg(a,s)+t+.9*r*Math.cos(d+.5*o),gg(a,s)+n+.9*i*Math.sin(d+.5*o)])}return[u,l]}function Uge(e,t,n,r,i,a,o,s,l){let u=a+gg(.1,l),d=[];d.push([gg(s,l)+t+.9*r*Math.cos(u-e),gg(s,l)+n+.9*i*Math.sin(u-e)]);for(let a=u;a<=o;a+=e)d.push([gg(s,l)+t+r*Math.cos(a),gg(s,l)+n+i*Math.sin(a)]);return d.push([t+r*Math.cos(o),n+i*Math.sin(o)]),d.push([t+r*Math.cos(o),n+i*Math.sin(o)]),bg(d,null,l)}function Wge(e,t,n,r,i,a,o,s){let l=[],u=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3],d=[0,0],f=s.disableMultiStroke?1:2,p=s.preserveVertices;for(let m=0;m<f;m++)m===0?l.push({op:`move`,data:[o[0],o[1]]}):l.push({op:`move`,data:[o[0]+(p?0:gg(u[0],s)),o[1]+(p?0:gg(u[0],s))]}),d=p?[i,a]:[i+gg(u[m],s),a+gg(u[m],s)],l.push({op:`bcurveTo`,data:[e+gg(u[m],s),t+gg(u[m],s),n+gg(u[m],s),r+gg(u[m],s),d[0],d[1]]});return l}function xg(e){return[...e]}function Gge(e,t=0){let n=e.length;if(n<3)throw Error(`A curve must have at least three points.`);let r=[];if(n===3)r.push(xg(e[0]),xg(e[1]),xg(e[2]),xg(e[2]));else{let n=[];n.push(e[0],e[0]);for(let t=1;t<e.length;t++)n.push(e[t]),t===e.length-1&&n.push(e[t]);let i=[],a=1-t;r.push(xg(n[0]));for(let e=1;e+2<n.length;e++){let t=n[e];i[0]=[t[0],t[1]],i[1]=[t[0]+(a*n[e+1][0]-a*n[e-1][0])/6,t[1]+(a*n[e+1][1]-a*n[e-1][1])/6],i[2]=[n[e+1][0]+(a*n[e][0]-a*n[e+2][0])/6,n[e+1][1]+(a*n[e][1]-a*n[e+2][1])/6],i[3]=[n[e+1][0],n[e+1][1]],r.push(i[1],i[2],i[3])}}return r}function Sg(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2}function Kge(e,t,n){let r=Sg(t,n);if(r===0)return Sg(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),Sg(e,Cg(t,n,i))}function Cg(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function wg(e,t,n,r){let i=r||[];if(function(e,t){let n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3],o=3*r[0]-2*n[0]-a[0];o*=o;let s=3*r[1]-2*n[1]-a[1];s*=s;let l=3*i[0]-2*a[0]-n[0];l*=l;let u=3*i[1]-2*a[1]-n[1];return u*=u,o<l&&(o=l),s<u&&(s=u),o+s}(e,t)<n){let n=e[t+0];i.length?(a=i[i.length-1],o=n,Math.sqrt(Sg(a,o))>1&&i.push(n)):i.push(n),i.push(e[t+3])}else{let r=.5,a=e[t+0],o=e[t+1],s=e[t+2],l=e[t+3],u=Cg(a,o,r),d=Cg(o,s,r),f=Cg(s,l,r),p=Cg(u,d,r),m=Cg(d,f,r),h=Cg(p,m,r);wg([a,u,p,h],0,n,i),wg([h,m,f,l],0,n,i)}var a,o;return i}function qge(e,t){return Tg(e,0,e.length,t)}function Tg(e,t,n,r,i){let a=i||[],o=e[t],s=e[n-1],l=0,u=1;for(let r=t+1;r<n-1;++r){let t=Kge(e[r],o,s);t>l&&(l=t,u=r)}return Math.sqrt(l)>r?(Tg(e,t,u+1,r,a),Tg(e,u,n,r,a)):(a.length||a.push(o),a.push(s)),a}function Eg(e,t=.15,n){let r=[],i=(e.length-1)/3;for(let n=0;n<i;n++)wg(e,3*n,t,r);return n&&n>0?Tg(r,0,r.length,n):r}var Dg,Jge,Yge,Xge,Zge,Qge,Og,$ge,e_e,kg,Ag,jg,t_e,Mg,Ng,n_e,Pg,r_e,Fg,Ig=o((()=>{Dg=class{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){let n=og(e,t);return{type:`fillSketch`,ops:this.renderLines(n,t)}}renderLines(e,t){let n=[];for(let r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}},Jge=class extends Dg{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);let r=og(e,Object.assign({},t,{hachureGap:n})),i=Math.PI/180*t.hachureAngle,a=[],o=.5*n*Math.cos(i),s=.5*n*Math.sin(i);for(let[e,t]of r)sg([e,t])&&a.push([[e[0]-o,e[1]+s],[...t]],[[e[0]+o,e[1]-s],[...t]]);return{type:`fillSketch`,ops:this.renderLines(a,t)}}},Yge=class extends Dg{fillPolygons(e,t){let n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return n.ops=n.ops.concat(i.ops),n}},Xge=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=og(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(n,t)}dotsOnLines(e,t){let n=[],r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);let i=t.fillWeight;i<0&&(i=t.strokeWidth/2);let a=r/4;for(let o of e){let e=sg(o),s=e/r,l=Math.ceil(s)-1,u=e-l*r,d=(o[0][0]+o[1][0])/2-r/4,f=Math.min(o[0][1],o[1][1]);for(let e=0;e<l;e++){let o=f+u+e*r,s=d-a+2*Math.random()*a,l=o-a+2*Math.random()*a,p=this.helper.ellipse(s,l,i,i,t);n.push(...p.ops)}}return{type:`fillSketch`,ops:n}}},Zge=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=og(e,t);return{type:`fillSketch`,ops:this.dashedLine(n,t)}}dashedLine(e,t){let n=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,r=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,i=[];return e.forEach((e=>{let a=sg(e),o=Math.floor(a/(n+r)),s=(a+r-o*(n+r))/2,l=e[0],u=e[1];l[0]>u[0]&&(l=e[1],u=e[0]);let d=Math.atan((u[1]-l[1])/(u[0]-l[0]));for(let e=0;e<o;e++){let a=e*(n+r),o=a+n,u=[l[0]+a*Math.cos(d)+s*Math.cos(d),l[1]+a*Math.sin(d)+s*Math.sin(d)],f=[l[0]+o*Math.cos(d)+s*Math.cos(d),l[1]+o*Math.sin(d)+s*Math.sin(d)];i.push(...this.helper.doubleLineOps(u[0],u[1],f[0],f[1],t))}})),i}},Qge=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?n:t.zigzagOffset,i=og(e,t=Object.assign({},t,{hachureGap:n+r}));return{type:`fillSketch`,ops:this.zigzagLines(i,r,t)}}zigzagLines(e,t,n){let r=[];return e.forEach((e=>{let i=sg(e),a=Math.round(i/(2*t)),o=e[0],s=e[1];o[0]>s[0]&&(o=e[1],s=e[0]);let l=Math.atan((s[1]-o[1])/(s[0]-o[0]));for(let e=0;e<a;e++){let i=2*e*t,a=2*(e+1)*t,s=Math.sqrt(2*t**2),u=[o[0]+i*Math.cos(l),o[1]+i*Math.sin(l)],d=[o[0]+a*Math.cos(l),o[1]+a*Math.sin(l)],f=[u[0]+s*Math.cos(l+Math.PI/4),u[1]+s*Math.sin(l+Math.PI/4)];r.push(...this.helper.doubleLineOps(u[0],u[1],f[0],f[1],n),...this.helper.doubleLineOps(f[0],f[1],d[0],d[1],n))}})),r}},Og={},$ge=class{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}},e_e=0,kg=1,Ag=2,jg={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0},t_e={randOffset:function(e,t){return gg(e,t)},randOffsetWithRange:function(e,t,n){return hg(e,t,n)},ellipse:function(e,t,n,r,i){return fg(e,t,i,Lge(n,r,i)).opset},doubleLineOps:function(e,t,n,r,i){return _g(e,t,n,r,i,!0)}},Mg=`none`,Ng=class{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:`#000`,strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:`hachure`,fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,i){let a=this._o(i);return this._d(`line`,[Pge(e,t,n,r,a)],a)}rectangle(e,t,n,r,i){let a=this._o(i),o=[],s=Fge(e,t,n,r,a);if(a.fill){let i=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];a.fillStyle===`solid`?o.push(pg([i],a)):o.push(mg([i],a))}return a.stroke!==Mg&&o.push(s),this._d(`rectangle`,o,a)}ellipse(e,t,n,r,i){let a=this._o(i),o=[],s=Lge(n,r,a),l=fg(e,t,a,s);if(a.fill){if(a.fillStyle===`solid`){let n=fg(e,t,a,s).opset;n.type=`fillPath`,o.push(n)}else o.push(mg([l.estimatedPoints],a))}return a.stroke!==Mg&&o.push(l.opset),this._d(`ellipse`,o,a)}circle(e,t,n,r){let i=this.ellipse(e,t,n,n,r);return i.shape=`circle`,i}linearPath(e,t){let n=this._o(t);return this._d(`linearPath`,[dg(e,!1,n)],n)}arc(e,t,n,r,i,a,o=!1,s){let l=this._o(s),u=[],d=Rge(e,t,n,r,i,a,o,!0,l);if(o&&l.fill){if(l.fillStyle===`solid`){let o=Object.assign({},l);o.disableMultiStroke=!0;let s=Rge(e,t,n,r,i,a,!0,!1,o);s.type=`fillPath`,u.push(s)}else u.push(function(e,t,n,r,i,a,o){let s=e,l=t,u=Math.abs(n/2),d=Math.abs(r/2);u+=gg(.01*u,o),d+=gg(.01*d,o);let f=i,p=a;for(;f<0;)f+=2*Math.PI,p+=2*Math.PI;p-f>2*Math.PI&&(f=0,p=2*Math.PI);let m=(p-f)/o.curveStepCount,h=[];for(let e=f;e<=p;e+=m)h.push([s+u*Math.cos(e),l+d*Math.sin(e)]);return h.push([s+u*Math.cos(p),l+d*Math.sin(p)]),h.push([s,l]),mg([h],o)}(e,t,n,r,i,a,l))}return l.stroke!==Mg&&u.push(d),this._d(`arc`,u,l)}curve(e,t){let n=this._o(t),r=[],i=Ige(e,n);if(n.fill&&n.fill!==Mg){if(n.fillStyle===`solid`){let t=Ige(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else{let t=[],i=e;if(i.length){let e=typeof i[0][0]==`number`?[i]:i;for(let r of e)r.length<3?t.push(...r):r.length===3?t.push(...Eg(Gge([r[0],r[0],r[1],r[2]]),10,(1+n.roughness)/2)):t.push(...Eg(Gge(r),10,(1+n.roughness)/2))}t.length&&r.push(mg([t],n))}}return n.stroke!==Mg&&r.push(i),this._d(`curve`,r,n)}polygon(e,t){let n=this._o(t),r=[],i=dg(e,!0,n);return n.fill&&(n.fillStyle===`solid`?r.push(pg([e],n)):r.push(mg([e],n))),n.stroke!==Mg&&r.push(i),this._d(`polygon`,r,n)}path(e,t){let n=this._o(t),r=[];if(!e)return this._d(`path`,r,n);e=(e||``).replace(/\n/g,` `).replace(/(-\s)/g,`-`).replace(`/(ss)/g`,` `);let i=n.fill&&n.fill!==`transparent`&&n.fill!==Mg,a=n.stroke!==Mg,o=!!(n.simplification&&n.simplification<1),s=function(e,t,n){let r=Mge(jge(lg(e))),i=[],a=[],o=[0,0],s=[],l=()=>{s.length>=4&&a.push(...Eg(s,t)),s=[]},u=()=>{l(),a.length&&(i.push(a),a=[])};for(let{key:e,data:t}of r)switch(e){case`M`:u(),o=[t[0],t[1]],a.push(o);break;case`L`:l(),a.push([t[0],t[1]]);break;case`C`:if(!s.length){let e=a.length?a[a.length-1]:o;s.push([e[0],e[1]])}s.push([t[0],t[1]]),s.push([t[2],t[3]]),s.push([t[4],t[5]]);break;case`Z`:l(),a.push([o[0],o[1]])}if(u(),!n)return i;let d=[];for(let e of i){let t=qge(e,n);t.length&&d.push(t)}return d}(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),l=zge(e,n);if(i){if(n.fillStyle===`solid`){if(s.length===1){let t=zge(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else r.push(pg(s,n))}else r.push(mg(s,n))}return a&&(o?s.forEach((e=>{r.push(dg(e,!1,n))})):r.push(l)),this._d(`path`,r,n)}opsToPath(e,t){let n=``;for(let r of e.ops){let e=typeof t==`number`&&t>=0?r.data.map((e=>+e.toFixed(t))):r.data;switch(r.op){case`move`:n+=`M${e[0]} ${e[1]} `;break;case`bcurveTo`:n+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case`lineTo`:n+=`L${e[0]} ${e[1]} `}}return n.trim()}toPaths(e){let t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(let e of t){let t=null;switch(e.type){case`path`:t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Mg};break;case`fillPath`:t={d:this.opsToPath(e),stroke:Mg,strokeWidth:0,fill:n.fill||Mg};break;case`fillSketch`:t=this.fillSketch(e,n)}t&&r.push(t)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||Mg,strokeWidth:n,fill:Mg}}_mergedShape(e){return e.filter(((e,t)=>t===0||e.op!==`move`))}},n_e=class{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext(`2d`),this.gen=new Ng(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.ctx,i=e.options.fixedDecimalPlaceDigits;for(let a of t)switch(a.type){case`path`:r.save(),r.strokeStyle=n.stroke===`none`?`transparent`:n.stroke,r.lineWidth=n.strokeWidth,n.strokeLineDash&&r.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(r.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(r,a,i),r.restore();break;case`fillPath`:{r.save(),r.fillStyle=n.fill||``;let t=e.shape===`curve`||e.shape===`polygon`||e.shape===`path`?`evenodd`:`nonzero`;this._drawToContext(r,a,i,t),r.restore();break}case`fillSketch`:this.fillSketch(r,a,n)}}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||``,e.lineWidth=r,this._drawToContext(e,t,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,t,n,r=`nonzero`){e.beginPath();for(let r of t.ops){let t=typeof n==`number`&&n>=0?r.data.map((e=>+e.toFixed(n))):r.data;switch(r.op){case`move`:e.moveTo(t[0],t[1]);break;case`bcurveTo`:e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]);break;case`lineTo`:e.lineTo(t[0],t[1])}}t.type===`fillPath`?e.fill(r):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a),a}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a),a}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a),a}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i),i}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n),n}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n),n}arc(e,t,n,r,i,a,o=!1,s){let l=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(l),l}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n),n}path(e,t){let n=this.gen.path(e,t);return this.draw(n),n}},Pg=`http://www.w3.org/2000/svg`,r_e=class{constructor(e,t){this.svg=e,this.gen=new Ng(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,i=r.createElementNS(Pg,`g`),a=e.options.fixedDecimalPlaceDigits;for(let o of t){let t=null;switch(o.type){case`path`:t=r.createElementNS(Pg,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,n.stroke),t.setAttribute(`stroke-width`,n.strokeWidth+``),t.setAttribute(`fill`,`none`),n.strokeLineDash&&t.setAttribute(`stroke-dasharray`,n.strokeLineDash.join(` `).trim()),n.strokeLineDashOffset&&t.setAttribute(`stroke-dashoffset`,`${n.strokeLineDashOffset}`);break;case`fillPath`:t=r.createElementNS(Pg,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,`none`),t.setAttribute(`stroke-width`,`0`),t.setAttribute(`fill`,n.fill||``),e.shape!==`curve`&&e.shape!==`polygon`||t.setAttribute(`fill-rule`,`evenodd`);break;case`fillSketch`:t=this.fillSketch(r,o,n)}t&&i.appendChild(t)}return i}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);let i=e.createElementNS(Pg,`path`);return i.setAttribute(`d`,this.opsToPath(t,n.fixedDecimalPlaceDigits)),i.setAttribute(`stroke`,n.fill||``),i.setAttribute(`stroke-width`,r+``),i.setAttribute(`fill`,`none`),n.fillLineDash&&i.setAttribute(`stroke-dasharray`,n.fillLineDash.join(` `).trim()),n.fillLineDashOffset&&i.setAttribute(`stroke-dashoffset`,`${n.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a)}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a)}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a)}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i)}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n)}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n)}arc(e,t,n,r,i,a,o=!1,s){let l=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(l)}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n)}path(e,t){let n=this.gen.path(e,t);return this.draw(n)}},Fg={canvas:(e,t)=>new n_e(e,t),svg:(e,t)=>new r_e(e,t),generator:e=>new Ng(e),newSeed:()=>Ng.newSeed()}}));async function Lg(e){let t=e.getElementsByTagName(`img`);if(!t||t.length===0)return;let n=!Rg(e);await Promise.all([...t].map(e=>new Promise(t=>{function r(){if(e.style.display=`flex`,e.style.flexDirection=`column`,n){let t=Z().fontSize?Z().fontSize:window.getComputedStyle(document.body).fontSize,[n=ns.fontSize]=$m(t),r=n*5+`px`;e.style.minWidth=r,e.style.maxWidth=r}else e.style.width=`100%`;t(e)}p(r,`setupImage`),setTimeout(()=>{e.complete&&r()}),e.addEventListener(`error`,r),e.addEventListener(`load`,r)})))}function Rg(e){return e.nodeType===jve?e.textContent?.trim()!==``:e.nodeType!==Ave||e.tagName.toLowerCase()===`img`?!1:[...e.childNodes].some(Rg)}function zg(e){let t=e.map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`);return t.push(`Z`),t.join(` `)}function Bg(e,t,n,r,i,a){let o=[],s=n-e,l=r-t,u=s/a,d=2*Math.PI/u,f=t+l/2;for(let t=0;t<=50;t++){let n=e+t/50*s,r=f+i*Math.sin(d*(n-e));o.push({x:n,y:r})}return o}function Vg(e,t,n,r,i,a){let o=[],s=i*Math.PI/180,l=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*l,a=e+n*Math.cos(r),u=t+n*Math.sin(r);o.push({x:-a,y:-u})}return o}function Hg(e){let t=Array.from(e.childNodes).filter(e=>e.tagName===`path`),n=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),r=t.map(e=>e.getAttribute(`d`)).filter(e=>e!==null).join(` `);n.setAttribute(`d`,r);let i=t.find(e=>e.getAttribute(`fill`)!==`none`),a=t.find(e=>e.getAttribute(`stroke`)!==`none`),o=p((e,t)=>e?.getAttribute(t)??void 0,`getAttr`);if(i){let e={fill:o(i,`fill`),"fill-opacity":o(i,`fill-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&n.setAttribute(e,t)})}if(a){let e={stroke:o(a,`stroke`),"stroke-width":o(a,`stroke-width`)??`1`,"stroke-opacity":o(a,`stroke-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&n.setAttribute(e,t)})}let s=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);return s.appendChild(n),s}function i_e(e,t){return e.intersect(t)}function a_e(e,t,n,r){var i=e.x,a=e.y,o=i-r.x,s=a-r.y,l=Math.sqrt(t*t*s*s+n*n*o*o),u=Math.abs(t*n*o/l);r.x<i&&(u=-u);var d=Math.abs(t*n*s/l);return r.y<a&&(d=-d),{x:i+u,y:a+d}}function o_e(e,t,n){return u_(e,t,t,n)}function s_e(e,t,n,r){{let i=t.y-e.y,a=e.x-t.x,o=t.x*e.y-e.x*t.y,s=i*n.x+a*n.y+o,l=i*r.x+a*r.y+o,u=1e-6;if(s!==0&&l!==0&&Ug(s,l))return;let d=r.y-n.y,f=n.x-r.x,p=r.x*n.y-n.x*r.y,m=d*e.x+f*e.y+p,h=d*t.x+f*t.y+p;if(Math.abs(m)<u&&Math.abs(h)<u&&Ug(m,h))return;let g=i*f-d*a;if(g===0)return;let _=Math.abs(g/2),v=a*p-f*o,y=v<0?(v-_)/g:(v+_)/g;return v=d*o-i*p,{x:y,y:v<0?(v-_)/g:(v+_)/g}}}function Ug(e,t){return e*t>0}function c_e(e,t,n){let r=e.x,i=e.y,a=[],o=1/0,s=1/0;typeof t.forEach==`function`?t.forEach(function(e){o=Math.min(o,e.x),s=Math.min(s,e.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let l=r-e.width/2-o,u=i-e.height/2-s;for(let r=0;r<t.length;r++){let i=t[r],o=t[r<t.length-1?r+1:0],s=Ive(e,n,{x:l+i.x,y:u+i.y},{x:l+o.x,y:u+o.y});s&&a.push(s)}return a.length?(a.length>1&&a.sort(function(e,t){let r=e.x-n.x,i=e.y-n.y,a=Math.sqrt(r*r+i*i),o=t.x-n.x,s=t.y-n.y,l=Math.sqrt(o*o+s*s);return a<l?-1:a===l?0:1}),a[0]):e}function l_e(e,t){let{labelStyles:n}=Tp(t);t.labelStyle=n;let r=o_(t),i=r;r||(i=`anchor`);let a=e.insert(`g`).attr(`class`,i).attr(`id`,t.domId||t.id),{cssStyles:o}=t,s=Fg.svg(a),l=Ep(t,{fill:`black`,stroke:`none`,fillStyle:`solid`});t.look!==`handDrawn`&&(l.roughness=0);let u=s.circle(0,0,2,l),d=a.insert(()=>u,`:first-child`);return d.attr(`class`,`anchor`).attr(`style`,Um(o)),a_(t,d),t.intersect=function(e){return y.info(`Circle intersect`,t,1,e),d_.circle(t,1,e)},a}function Wg(e,t,n,r,i,a,o){let s=(e+n)/2,l=(t+r)/2,u=Math.atan2(r-t,n-e),d=(n-e)/2,f=(r-t)/2,p=d/i,m=f/a,h=Math.sqrt(p**2+m**2);if(h>1)throw Error(`The given radii are too small to create an arc between the points.`);let g=Math.sqrt(1-h**2),_=s+g*a*Math.sin(u)*(o?-1:1),v=l-g*i*Math.cos(u)*(o?-1:1),y=Math.atan2((t-v)/a,(e-_)/i),b=Math.atan2((r-v)/a,(n-_)/i)-y;o&&b<0&&(b+=2*Math.PI),!o&&b>0&&(b-=2*Math.PI);let x=[];for(let e=0;e<20;e++){let t=y+e/19*b,n=_+i*Math.cos(t),r=v+a*Math.sin(t);x.push({x:n,y:r})}return x}function u_e(e,t,n){let[r,i]=[t,n].sort((e,t)=>t-e);return i*(1-Math.sqrt(1-(e/r/2)**2))}async function d_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=p(e=>e+o,`calcTotalHeight`),l=p(e=>{let t=e/2;return[t/(2.5+e/50),t]},`calcEllipseRadius`),{shapeSvg:u,bbox:d}=await r_(e,t,o_(t)),f=s(t?.height?t?.height:d.height),[m,h]=l(f),g=u_e(f,m,h),_=(t?.width?t?.width:d.width)+a*2+g-g,v=f,{cssStyles:y}=t,b=[{x:_/2,y:-v/2},{x:-_/2,y:-v/2},...Wg(-_/2,-v/2,-_/2,v/2,m,h,!1),{x:_/2,y:v/2},...Wg(_/2,v/2,_/2,-v/2,m,h,!0)],x=Fg.svg(u),S=Ep(t,{});t.look!==`handDrawn`&&(S.roughness=0,S.fillStyle=`solid`);let C=zg(b),w=x.path(C,S),T=u.insert(()=>w,`:first-child`);return T.attr(`class`,`basic label-container outer-path`),y&&t.look!==`handDrawn`&&T.selectAll(`path`).attr(`style`,y),r&&t.look!==`handDrawn`&&T.selectAll(`path`).attr(`style`,r),T.attr(`transform`,`translate(${m/2}, 0)`),a_(t,T),t.intersect=function(e){return d_.polygon(t,b,e)},u}async function f_e(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=Tp(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await r_(e,t,o_(t)),l=n?.nodeBorder??n?.lineColor??`currentColor`,u=t.padding??12,d=Math.max(o.width+u*2,t.width??0,80),f=Math.max(Math.min(d*.08,12),5),m=Math.max(o.height+u*2+f,t.height??0),h=-m/2+f,g=m/2,_=d*.72,v=[`M${-d/2},${h}`,`L${-_/2},${g}`,`A${_/2},${f} 0 0 0 ${_/2},${g}`,`L${d/2},${h}`,`A${d/2},${f} 0 0 0 ${-d/2},${h}`,`Z`].join(` `),{cssStyles:y}=t,b=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=Fg.svg(a).path(v,Ep(t,{}));b.node()?.appendChild(e),y&&b.attr(`style`,y)}else b.append(`path`).attr(`d`,v).attr(`style`,i);b.append(`ellipse`).attr(`cx`,0).attr(`cy`,h).attr(`rx`,d/2).attr(`ry`,f).attr(`style`,`fill:none;stroke:${l};stroke-width:1px`),a_(t,b);let x=h+(g-h)/2;s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${x-o.height/2-(o.y-(o.top??0))})`);let S=p((e,t,n)=>Array.from({length:13},(r,i)=>{let a=Math.PI-i*Math.PI/12;return{x:e*Math.cos(a),y:t+n*f*Math.sin(a)}}),`arc`),C=[...S(d/2,h,-1),...S(_/2,g,1).reverse()];return t.intersect=function(e){return d_.polygon(t,C,e)},a}async function p_e(e,t){let{themeVariables:n}=Z(),r=n.clusterBkg,i=n.clusterBorder,{nodeStyles:a}=Tp(t),{shapeSvg:o,bbox:s}=await r_(e,t,o_(t)),l=t.padding??8,u=s.height,d=Math.max(s.width+l*2,Lve,t?.width??0),f=Math.max(u+p_+f_+l*2,t?.height??0),p=-d/2,m=-f/2,h=-(p_+f_)/2,g=o.select(`.label`);g&&(t.useHtmlLabels??bs(Z())?g.attr(`transform`,`translate(${-s.width/2}, ${-s.height/2+h})`):g.attr(`transform`,`translate(0, ${-s.height/2+h})`));let _;if(t.look===`handDrawn`){let e=Fg.svg(o),n=Ep(t,{fill:r,stroke:i,fillStyle:`solid`}),a=e.path(c_(p,m,d,f,m_),n);_=o.insert(()=>a,`:first-child`),_.attr(`class`,`basic label-container collapsed-group`).attr(`style`,Um(t.cssStyles))}else _=o.insert(`rect`,`:first-child`),_.attr(`class`,`basic label-container collapsed-group`).attr(`style`,a).attr(`rx`,m_).attr(`ry`,m_).attr(`x`,p).attr(`y`,m).attr(`width`,d).attr(`height`,f).attr(`fill`,r).attr(`stroke`,i);let v=m+l+u+p_;o.append(`line`).attr(`class`,`collapsed-separator`).attr(`x1`,p+8).attr(`y1`,v).attr(`x2`,p+d-8).attr(`y2`,v).attr(`stroke`,i).attr(`stroke-dasharray`,`3, 3`);let y=v+f_/2;for(let e=-1;e<=1;e++)o.append(`circle`).attr(`class`,`collapsed-indicator`).attr(`cx`,e*10).attr(`cy`,y).attr(`r`,2.5).attr(`fill`,i);return a_(t,_),t.calcIntersect=function(e,t){return d_.rect(e,t)},t.intersect=function(e){return d_.rect(t,e)},o}function Gg(e,t,n,r){return e.insert(`polygon`,`:first-child`).attr(`points`,r.map(function(e){return e.x+`,`+e.y}).join(` `)).attr(`class`,`label-container`).attr(`transform`,`translate(`+-t/2+`,`+n/2+`)`)}async function m_e(e,t){let n=t,{shapeSvg:r,bbox:i}=await r_(e,n,o_(n)),a=n.padding??0,o=i.height+2*a,s=o/2,l=i.width+2*s+a,u=n.width??0,d=n.positioned&&(n.widthInColumns??1)>1&&u>l?u:l,f=Vve(n.directions??[],i,n,d),p=Gg(r,d,o,f);return p.attr(`style`,n.style??null),a_(n,p),n.intersect=function(e){return d_.polygon(n,f,e)},r}async function h_e(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=Tp(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await r_(e,t,o_(t)),l=n?.nodeBorder??n?.lineColor??`currentColor`,u=t.padding??12,d=Math.max(o.width+u*2,t.width??0,90),f=Math.max(o.height+u*2+18,t.height??0),p=-f/2,{cssStyles:m}=t,h=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=Fg.svg(a).path(c_(-d/2,p,d,f,12),Ep(t,{}));h.node()?.appendChild(e),m&&h.attr(`style`,m)}else h.append(`rect`).attr(`x`,-d/2).attr(`y`,p).attr(`width`,d).attr(`height`,f).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);h.append(`line`).attr(`x1`,-d/2).attr(`y1`,p+18).attr(`x2`,d/2).attr(`y2`,p+18).attr(`style`,`stroke:${l};stroke-width:1px`);for(let e=0;e<3;e++)h.append(`circle`).attr(`cx`,-d/2+12+e*9).attr(`cy`,p+9).attr(`r`,2.5).attr(`style`,`fill:${l};stroke:none`);h.append(`rect`).attr(`class`,`browser-address-bar`).attr(`x`,-d/2+44).attr(`y`,p+4).attr(`width`,Math.max(d-56,10)).attr(`height`,10).attr(`rx`,3).attr(`ry`,3).attr(`style`,`fill:none;stroke:${l};stroke-width:1px;opacity:0.6`),a_(t,h);let g=p+18+(f-18)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${g-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return d_.rect(t,e)},a}async function g_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?28:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:l}=await r_(e,t,o_(t)),u=(t?.width??l.width)+(t.look===`neo`?a*2:a+__),d=(t?.height??l.height)+(t.look===`neo`?o*2:o),f=u,p=-d,m=[{x:0+__,y:p},{x:f,y:p},{x:f,y:0},{x:0,y:0},{x:0,y:p+__},{x:0+__,y:p}],h,{cssStyles:g}=t;if(t.look===`handDrawn`){let e=Fg.svg(s),n=Ep(t,{}),r=zg(m),i=e.path(r,n);h=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${d/2})`),g&&h.attr(`style`,g)}else h=Gg(s,u,d,m);return r&&h.attr(`style`,r),a_(t,h),t.intersect=function(e){return d_.polygon(t,m,e)},s}function __e(e,t){let{nodeStyles:n}=Tp(t);t.label=``;let r=e.insert(`g`).attr(`class`,o_(t)).attr(`id`,t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=Fg.svg(r),l=Ep(t,{});t.look!==`handDrawn`&&(l.roughness=0,l.fillStyle=`solid`);let u=zg(o),d=s.path(u,l),f=r.insert(()=>d,`:first-child`);return i&&t.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,i),n&&t.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,n),t.width=28,t.height=28,t.intersect=function(e){return d_.polygon(t,o,e)},r}async function Kg(e,t,n){let{labelStyles:r,nodeStyles:i}=Tp(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s}=await r_(e,t,o_(t)),l=n?.padding??s,u=t.look===`neo`?o.width/2+32:o.width/2+l,d,{cssStyles:f}=t;if(t.look===`handDrawn`){let e=Fg.svg(a),n=Ep(t,{}),r=e.circle(0,0,u*2,n);d=a.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,Um(f))}else d=a.insert(`circle`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,i).attr(`r`,u).attr(`cx`,0).attr(`cy`,0);return a_(t,d),t.calcIntersect=function(e,t){let n=e.width/2;return d_.circle(e,n,t)},t.intersect=function(e){return y.info(`Circle intersect`,t,u,e),d_.circle(t,u,e)},a}async function v_e(e,t){let n=t,{shapeSvg:r,bbox:i,halfPadding:a}=await r_(e,n,[`node`,n.cssClasses,n.class].filter(Boolean).join(` `)),o=r.insert(`rect`,`:first-child`),s=n.padding??0,l=n.positioned?n.width??0:i.width+s,u=n.positioned?n.height??0:i.height+s,d=n.positioned?-l/2:-i.width/2-a,f=n.positioned?-u/2:-i.height/2-a;return o.attr(`class`,`basic cluster composite label-container`).attr(`style`,n.style??null).attr(`rx`,n.rx??null).attr(`ry`,n.ry??null).attr(`x`,d).attr(`y`,f).attr(`width`,l).attr(`height`,u),a_(n,o),n.intersect=function(e){return d_.rect(n,e)},r}async function y_e(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=Tp(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await r_(e,t,o_(t)),l=n?.nodeBorder??n?.lineColor??`currentColor`,u=t.padding??12,d=Math.max(o.width+u*2,t.width??0,90),f=Math.max(o.height+u*2+20,t.height??0),p=-f/2,{cssStyles:m}=t,h=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=Fg.svg(a).path(c_(-d/2,p,d,f,12),Ep(t,{}));h.node()?.appendChild(e),m&&h.attr(`style`,m)}else h.append(`rect`).attr(`x`,-d/2).attr(`y`,p).attr(`width`,d).attr(`height`,f).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);h.append(`text`).attr(`x`,-d/2+12).attr(`y`,p+16).attr(`class`,`console-glyph`).attr(`style`,`font-family:monospace;font-weight:bold;font-size:14px;fill:${l}`).text(`>_`),a_(t,h);let g=p+20+(f-20)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${g-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return d_.rect(t,e)},a}function b_e(e){let t=Math.cos(Math.PI/4),n=Math.sin(Math.PI/4),r=e*2,i={x:r/2*t,y:r/2*n},a={x:-(r/2)*t,y:r/2*n},o={x:-(r/2)*t,y:-(r/2)*n},s={x:r/2*t,y:-(r/2)*n};return`M ${a.x},${a.y} L ${s.x},${s.y}456+ M ${i.x},${i.y} L ${o.x},${o.y}`}function x_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n,t.label=``;let i=e.insert(`g`).attr(`class`,o_(t)).attr(`id`,t.domId??t.id),a=Math.max(30,t?.width??0),{cssStyles:o}=t,s=Fg.svg(i),l=Ep(t,{});t.look!==`handDrawn`&&(l.roughness=0,l.fillStyle=`solid`);let u=s.circle(0,0,a*2,l),d=b_e(a),f=s.path(d,l),p=i.insert(()=>u,`:first-child`);return p.insert(()=>f),p.attr(`class`,`outer-path`),o&&t.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,o),r&&t.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,r),a_(t,p),t.intersect=function(e){return y.info(`crossedCircle intersect`,t,{radius:a,point:e}),d_.circle(t,a,e)},i}function qg(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,l=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*l,a=e+n*Math.cos(r),u=t+n*Math.sin(r);o.push({x:-a,y:-u})}return o}async function S_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await r_(e,t,o_(t)),s=t.look===`neo`?18:t.padding??0,l=t.look===`neo`?12:t.padding??0,u=a.width+s,d=a.height+l,f=Math.max(5,d*.1),{cssStyles:p}=t,m=[...qg(u/2,-d/2,f,30,-90,0),{x:-u/2-f,y:f},...qg(u/2+f*2,-f,f,20,-180,-270),...qg(u/2+f*2,f,f,20,-90,-180),{x:-u/2-f,y:-d/2},...qg(u/2,d/2,f,20,0,90)],h=[{x:u/2,y:-d/2-f},{x:-u/2,y:-d/2-f},...qg(u/2,-d/2,f,20,-90,0),{x:-u/2-f,y:-f},...qg(u/2+u*.1,-f,f,20,-180,-270),...qg(u/2+u*.1,f,f,20,-90,-180),{x:-u/2-f,y:d/2},...qg(u/2,d/2,f,20,0,90),{x:-u/2,y:d/2+f},{x:u/2,y:d/2+f}],g=Fg.svg(i),_=Ep(t,{fill:`none`});t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let v=zg(m).replace(`Z`,``),y=g.path(v,_),b=zg(h),x=g.path(b,{..._}),S=i.insert(`g`,`:first-child`);return S.insert(()=>x,`:first-child`).attr(`stroke-opacity`,0),S.insert(()=>y,`:first-child`),S.attr(`class`,`text`),p&&t.look!==`handDrawn`&&S.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&S.selectAll(`path`).attr(`style`,r),S.attr(`transform`,`translate(${f}, 0)`),o.attr(`transform`,`translate(${-u/2+f-(a.x-(a.left??0))},${-d/2+(t.padding??0)/2-(a.y-(a.top??0))})`),a_(t,S),t.intersect=function(e){return d_.polygon(t,h,e)},i}function Jg(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,l=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*l,a=e+n*Math.cos(r),u=t+n*Math.sin(r);o.push({x:a,y:u})}return o}async function C_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await r_(e,t,o_(t)),s=t.look===`neo`?18:t.padding??0,l=t.look===`neo`?12:t.padding??0,u=a.width+(t.look===`neo`?s*2:s),d=a.height+(t.look===`neo`?l*2:l),f=Math.max(5,d*.1),{cssStyles:p}=t,m=[...Jg(u/2,-d/2,f,20,-90,0),{x:u/2+f,y:-f},...Jg(u/2+f*2,-f,f,20,-180,-270),...Jg(u/2+f*2,f,f,20,-90,-180),{x:u/2+f,y:d/2},...Jg(u/2,d/2,f,20,0,90)],h=[{x:-u/2,y:-d/2-f},{x:u/2,y:-d/2-f},...Jg(u/2,-d/2,f,20,-90,0),{x:u/2+f,y:-f},...Jg(u/2+f*2,-f,f,20,-180,-270),...Jg(u/2+f*2,f,f,20,-90,-180),{x:u/2+f,y:d/2},...Jg(u/2,d/2,f,20,0,90),{x:u/2,y:d/2+f},{x:-u/2,y:d/2+f}],g=Fg.svg(i),_=Ep(t,{fill:`none`});t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let v=zg(m).replace(`Z`,``),y=g.path(v,_),b=zg(h),x=g.path(b,{..._}),S=i.insert(`g`,`:first-child`);return S.insert(()=>x,`:first-child`).attr(`stroke-opacity`,0),S.insert(()=>y,`:first-child`),S.attr(`class`,`text`),p&&t.look!==`handDrawn`&&S.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&S.selectAll(`path`).attr(`style`,r),S.attr(`transform`,`translate(${-f}, 0)`),o.attr(`transform`,`translate(${-u/2+(t.padding??0)/2-(a.x-(a.left??0))},${-d/2+(t.padding??0)/2-(a.y-(a.top??0))})`),a_(t,S),t.intersect=function(e){return d_.polygon(t,h,e)},i}function Yg(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,l=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*l,a=e+n*Math.cos(r),u=t+n*Math.sin(r);o.push({x:-a,y:-u})}return o}async function w_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await r_(e,t,o_(t)),s=t.look===`neo`?18:t.padding??0,l=t.look===`neo`?12:t.padding??0,u=a.width+(t.look===`neo`?s*2:s),d=a.height+(t.look===`neo`?l*2:l),f=Math.max(5,d*.1),{cssStyles:p}=t,m=[...Yg(u/2,-d/2,f,30,-90,0),{x:-u/2-f,y:f},...Yg(u/2+f*2,-f,f,20,-180,-270),...Yg(u/2+f*2,f,f,20,-90,-180),{x:-u/2-f,y:-d/2},...Yg(u/2,d/2,f,20,0,90)],h=[...Yg(-u/2+f+f/2,-d/2,f,20,-90,-180),{x:u/2-f/2,y:f},...Yg(-u/2-f/2,-f,f,20,0,90),...Yg(-u/2-f/2,f,f,20,-90,0),{x:u/2-f/2,y:-f},...Yg(-u/2+f+f/2,d/2,f,30,-180,-270)],g=[{x:u/2,y:-d/2-f},{x:-u/2,y:-d/2-f},...Yg(u/2,-d/2,f,20,-90,0),{x:-u/2-f,y:-f},...Yg(u/2+f*2,-f,f,20,-180,-270),...Yg(u/2+f*2,f,f,20,-90,-180),{x:-u/2-f,y:d/2},...Yg(u/2,d/2,f,20,0,90),{x:-u/2,y:d/2+f},{x:u/2-f-f/2,y:d/2+f},...Yg(-u/2+f+f/2,-d/2,f,20,-90,-180),{x:u/2-f/2,y:f},...Yg(-u/2-f/2,-f,f,20,0,90),...Yg(-u/2-f/2,f,f,20,-90,0),{x:u/2-f/2,y:-f},...Yg(-u/2+f+f/2,d/2,f,30,-180,-270)],_=Fg.svg(i),v=Ep(t,{fill:`none`});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=zg(m).replace(`Z`,``),b=_.path(y,v),x=zg(h).replace(`Z`,``),S=_.path(x,v),C=zg(g),w=_.path(C,{...v}),T=i.insert(`g`,`:first-child`);return T.insert(()=>w,`:first-child`).attr(`stroke-opacity`,0),T.insert(()=>b,`:first-child`),T.insert(()=>S,`:first-child`),T.attr(`class`,`text`),p&&t.look!==`handDrawn`&&T.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&T.selectAll(`path`).attr(`style`,r),T.attr(`transform`,`translate(${f-f/4}, 0)`),o.attr(`transform`,`translate(${-u/2+(t.padding??0)/2-(a.x-(a.left??0))},${-d/2+(t.padding??0)/2-(a.y-(a.top??0))})`),a_(t,T),t.intersect=function(e){return d_.polygon(t,g,e)},i}async function T_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:l}=await r_(e,t,o_(t)),u=Math.max(20,(l.width+a*2)*1.25,t?.width??0),d=Math.max(5,l.height+o*2,t?.height??0),f=d/2,{cssStyles:p}=t,m=Fg.svg(s),h=Ep(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=u,_=d,v=g-f,y=_/4,b=[{x:v,y:0},{x:y,y:0},{x:0,y:_/2},{x:y,y:_},{x:v,y:_},...Vg(-v,-_/2,f,50,270,90)],x=zg(b),S=m.path(x,h),C=s.insert(()=>S,`:first-child`);return C.attr(`class`,`basic label-container outer-path`),p&&t.look!==`handDrawn`&&C.selectChildren(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&C.selectChildren(`path`).attr(`style`,r),C.attr(`transform`,`translate(${-u/2}, ${-d/2})`),a_(t,C),t.intersect=function(e){return d_.polygon(t,b,e)},s}async function E_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await r_(e,t,o_(t)),s=t.padding??20,l=Math.max(a.width+s*2,t.width??0,100),u=Math.min(Math.max(l*.23,16),56),d=u*.27,f=Math.max(a.height+s*2,t.height?t.height-(2*u-d):0),p=Math.min(l*.177,f*.45),m=f+2*u-d,h=-m/2,g=h+2*u-d,_=i.insert(`g`,`:first-child`).attr(`class`,`basic label-container`),{cssStyles:v}=t;if(t.look===`handDrawn`){let e=Fg.svg(i),n=Ep(t,{}),r=e.path(c_(-l/2,g,l,f,p),n),a=e.circle(0,h+u,u*2,n);_.insert(()=>a,`:first-child`),_.insert(()=>r,`:first-child`),v&&_.attr(`style`,v)}else _.append(`rect`).attr(`x`,-l/2).attr(`y`,g).attr(`width`,l).attr(`height`,f).attr(`rx`,p).attr(`ry`,p).attr(`style`,r),_.append(`circle`).attr(`cx`,0).attr(`cy`,h+u).attr(`r`,u).attr(`style`,r);a_(t,_);let y=g+f/2;o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${y-a.height/2-(a.y-(a.top??0))})`);let b=h+u,x=Math.asin(Math.min(1,(g-b)/u))*180/Math.PI,S=[...Vg(0,-b,u,24,180+x,-x),...Vg(-(-l/2+p),-(g+p),p,12,90,0),...Vg(-(-l/2+p),-(m/2-p),p,12,360,270),...Vg(-(l/2-p),-(m/2-p),p,12,270,180),...Vg(-(l/2-p),-(g+p),p,12,180,90)];return t.intersect=function(e){return d_.polygon(t,S,e)},i}async function D_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?24:i,o=t.look===`neo`?24:i,s=t.width??0;if(t.width&&(t.width-=o,t.width<y_&&(t.width=y_)),t.height){let e=s/2/(2.5+s/50);t.height=t.height-a-e*3,t.height<v_&&(t.height=v_)}let{shapeSvg:l,bbox:u,label:d}=await r_(e,t,o_(t)),f=Math.max(t.width??0,u.width)+o,p=f/2,m=p/(2.5+f/50),h=Math.max(t.height??0,u.height)+a+m,g,{cssStyles:_}=t;if(t.look===`handDrawn`){let e=Fg.svg(l),n=Uve(0,0,f,h,p,m),r=Wve(0,m,f,h,p,m),i=Ep(t,{}),a=e.path(n,i),o=e.path(r,Ep(t,{fill:`none`}));g=l.insert(()=>o,`:first-child`),g=l.insert(()=>a,`:first-child`),g.attr(`class`,`basic label-container`),_&&g.attr(`style`,_)}else{let e=Hve(0,0,f,h,p,m);g=l.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,Um(_)).attr(`style`,r)}return g.attr(`label-offset-y`,m),g.attr(`transform`,`translate(${-f/2}, ${-(h/2+m)})`),a_(t,g),d.attr(`transform`,`translate(${-(u.width/2)-(u.x-(u.left??0))}, ${-(u.height/2)+(t.padding??0)/1.5-(u.y-(u.top??0))})`),t.intersect=function(e){let n=d_.rect(t,e),r=n.x-(t.x??0);if(p!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-m)){let i=m*m*(1-r*r/(p*p));i>0&&(i=Math.sqrt(i)),i=m-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},l}async function Xg(e,t,n){let{labelStyles:r,nodeStyles:i}=Tp(t);t.labelStyle=r;let{shapeSvg:a,bbox:o}=await r_(e,t,o_(t)),s=Math.max(o.width+n.labelPaddingX*2,t?.width||0),l=Math.max(o.height+n.labelPaddingY*2,t?.height||0),u=-s/2,d=-l/2,f,{rx:p,ry:m}=t,{cssStyles:h}=t;if(n?.rx&&n.ry&&(p=n.rx,m=n.ry),t.look===`handDrawn`){let e=Fg.svg(a),n=Ep(t,{}),r=p||m?e.path(c_(u,d,s,l,p||0),n):e.rectangle(u,d,s,l,n);f=a.insert(()=>r,`:first-child`),f.attr(`class`,`basic label-container`).attr(`style`,Um(h))}else f=a.insert(`rect`,`:first-child`),f.attr(`class`,`basic label-container`).attr(`style`,i).attr(`rx`,Um(p)).attr(`ry`,Um(m)).attr(`x`,u).attr(`y`,d).attr(`width`,s).attr(`height`,l);return a_(t,f,t.look===`handDrawn`?void 0:{width:s,height:l}),t.calcIntersect=function(e,t){return d_.rect(e,t)},t.intersect=function(e){return d_.rect(t,e)},a}async function O_e(e,t){let{cssClasses:n,labelPaddingX:r,labelPaddingY:i,padding:a,width:o,height:s}=t,l=await Xg(e,t,{rx:0,ry:0,classes:n??``,labelPaddingX:r??(a??0)*2,labelPaddingY:i??a??0});if(t.look===`handDrawn`){let e=Fg.svg(l),n=Ep(t,{}),r=l.select(`.basic.label-container > path:nth-child(2)`),i=r.node();if(!i)return l;let a=null;if(i instanceof SVGGraphicsElement)a=i.getBBox();else return l;return l.insert(()=>e.line(a.x,a.y,a.x+a.width,a.y,n),`.basic.label-container g.label`),l.insert(()=>e.line(a.x,a.y+a.height,a.x+a.width,a.y+a.height,n),`.basic.label-container g.label`),r.remove(),l}let u=l.select(`.basic.label-container`),d=(Number(u.attr(`width`))||o)??0,f=(Number(u.attr(`height`))||s)??0;return d>0&&f>0&&u.attr(`stroke-dasharray`,`${d} ${f}`),l}async function k_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?16:t.padding??0,{shapeSvg:o,bbox:s,label:l}=await r_(e,t,o_(t)),u=s.width+i,d=s.height+a,f=d*.2,p=-u/2,m=-d/2-f/2,{cssStyles:h}=t,g=Fg.svg(o),_=Ep(t,{});t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let v=[{x:p,y:m+f},{x:-p,y:m+f},{x:-p,y:-m},{x:p,y:-m},{x:p,y:m},{x:-p,y:m},{x:-p,y:m+f}],y=g.polygon(v.map(e=>[e.x,e.y]),_),b=o.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),h&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,r),l.attr(`transform`,`translate(${p+(t.padding??0)/2-(s.x-(s.left??0))}, ${m+f+(t.padding??0)/2-(s.y-(s.top??0))})`),a_(t,b),t.intersect=function(e){return d_.rect(t,e)},o}async function A_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t),i=t.look===`neo`?12:5;t.labelStyle=n;let a=t.padding??0,o=t.look===`neo`?16:a,{shapeSvg:s,bbox:l}=await r_(e,t,o_(t)),u=(t?.width?t?.width/2:l.width/2)+(o??0),d=u-i,f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=Fg.svg(s),n=Ep(t,{roughness:.2,strokeWidth:2.5}),r=Ep(t,{roughness:.2,strokeWidth:1.5}),i=e.circle(0,0,u*2,n),a=e.circle(0,0,d*2,r);f=s.insert(`g`,`:first-child`),f.attr(`class`,Um(t.cssClasses)).attr(`style`,Um(p)),f.node()?.appendChild(i),f.node()?.appendChild(a)}else{f=s.insert(`g`,`:first-child`);let e=f.insert(`circle`,`:first-child`),t=f.insert(`circle`);f.attr(`class`,`basic label-container`).attr(`style`,r),e.attr(`class`,`outer-circle`).attr(`style`,r).attr(`r`,u).attr(`cx`,0).attr(`cy`,0),t.attr(`class`,`inner-circle`).attr(`style`,r).attr(`r`,d).attr(`cx`,0).attr(`cy`,0)}return a_(t,f),t.intersect=function(e){return y.info(`DoubleCircle intersect`,t,u,e),d_.circle(t,u,e)},s}function j_e(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=Tp(t);t.label=``,t.labelStyle=r;let a=e.insert(`g`).attr(`class`,o_(t)).attr(`id`,t.domId??t.id),{cssStyles:o}=t,s=Fg.svg(a),{nodeBorder:l}=n,u=Ep(t,{fillStyle:`solid`});t.look!==`handDrawn`&&(u.roughness=0);let d=s.circle(0,0,14,u),f=a.insert(()=>d,`:first-child`);return f.selectAll(`path`).attr(`style`,`fill: ${l} !important;`),o&&o.length>0&&t.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,o),i&&t.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,i),a_(t,f),t.intersect=function(e){return y.info(`filledCircle intersect`,t,{radius:7,point:e}),d_.circle(t,7,e)},a}async function M_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?i*2:i;(t.width||t.height)&&(t.height=t?.height??0,t.height<b_&&(t.height=b_),t.width=(t?.width??0)-a-a/2,t.width<x_&&(t.width=x_));let{shapeSvg:o,bbox:s,label:l}=await r_(e,t,o_(t)),u=(t?.width?t?.width:s.width)+(a??0),d=t?.height?t?.height:u+s.height,f=d,p=[{x:0,y:-d},{x:f,y:-d},{x:f/2,y:0}],{cssStyles:m}=t,h=Fg.svg(o),g=Ep(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=zg(p),v=h.path(_,g),b=o.insert(()=>v,`:first-child`).attr(`transform`,`translate(${-d/2}, ${d/2})`).attr(`class`,`outer-path`);return m&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,r),t.width=u,t.height=d,a_(t,b),l.attr(`transform`,`translate(${-s.width/2-(s.x-(s.left??0))}, ${-d/2+(t.padding??0)/2+(s.y-(s.top??0))})`),t.intersect=function(e){return y.info(`Triangle intersect`,t,p,e),d_.polygon(t,p,e)},o}async function N_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await r_(e,t,o_(t)),s=t.padding??12,l=Math.max(a.width+s*2,t.width??0,90),u=a.height+s*2,d=Math.max(Math.min(u*.16,14),8),f=Math.max(u+d,t.height??0),p=f-d,m=Math.max(l*.38,28),h=-f/2,g=[{x:-l/2,y:h},{x:-l/2+m,y:h},{x:-l/2+m,y:h+d},{x:l/2,y:h+d},{x:l/2,y:f/2},{x:-l/2,y:f/2}],_=[`M${g[0].x},${g[0].y}`,...g.slice(1).map(e=>`L${e.x},${e.y}`),`Z`].join(` `),{cssStyles:v}=t,y;if(t.look===`handDrawn`){let e=Fg.svg(i).path(_,Ep(t,{}));y=i.insert(()=>e,`:first-child`).attr(`class`,`basic label-container`),v&&y.attr(`style`,v)}else y=i.insert(`path`,`:first-child`).attr(`d`,_).attr(`class`,`basic label-container`).attr(`style`,r);t.look===`handDrawn`?a_(t,y):a_(t,y,{width:l,height:f});let b=h+d+p/2;return o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${b-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(e){return d_.polygon(t,g,e)},i}function P_e(e,t,{dir:n,config:{state:r,themeVariables:i}}){let{nodeStyles:a}=Tp(t);t.label=``;let o=e.insert(`g`).attr(`class`,o_(t)).attr(`id`,t.domId??t.id),{cssStyles:s}=t,l=Math.max(70,t?.width??0),u=Math.max(10,t?.height??0);n===`LR`&&(l=Math.max(10,t?.width??0),u=Math.max(70,t?.height??0));let d=-1*l/2,f=-1*u/2,p=Fg.svg(o),m=Ep(t,{stroke:i.lineColor,fill:i.lineColor});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=p.rectangle(d,f,l,u,m),g=o.insert(()=>h,`:first-child`);s&&t.look!==`handDrawn`&&g.selectAll(`path`).attr(`style`,s),a&&t.look!==`handDrawn`&&g.selectAll(`path`).attr(`style`,a),a_(t,g);let _=r?.padding??0;return t.width&&t.height&&(t.width+=_/2||0,t.height+=_/2||0),t.intersect=function(e){return d_.rect(t,e)},o}async function F_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10),t.width=(t?.width??0)-i*2,t.width<15&&(t.width=15));let{shapeSvg:o,bbox:s}=await r_(e,t,o_(t)),l=(t?.width?t?.width:Math.max(15,s.width))+i*2,u=(t?.height?t?.height:Math.max(10,s.height))+a*2,d=u/2,{cssStyles:f}=t,p=Fg.svg(o),m=Ep(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:-l/2,y:-u/2},{x:l/2-d,y:-u/2},...Vg(-l/2+d,0,d,50,90,270),{x:l/2-d,y:u/2},{x:-l/2,y:u/2}],g=zg(h),_=p.path(g,m),v=o.insert(()=>_,`:first-child`);return v.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&v.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&v.selectChildren(`path`).attr(`style`,r),a_(t,v),t.intersect=function(e){return y.info(`Pill intersect`,t,{radius:d,point:e}),d_.polygon(t,h,e)},o}async function I_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t),i=t.look===`neo`?3.5:4;t.labelStyle=n;let a=t.padding??0,o=t.look===`neo`?70:a,s=t.look===`neo`?32:a;if(t.width||t.height){let e=(t.height??0)/i;t.width=(t?.width??0)-2*e-s,t.height=(t.height??0)-o}let{shapeSvg:l,bbox:u}=await r_(e,t,o_(t)),d=(t?.height?t?.height:u.height)+o,f=d/i,p=(t?.width?t?.width:u.width)+2*f+s,m=[{x:f,y:0},{x:p-f,y:0},{x:p,y:-d/2},{x:p-f,y:-d},{x:f,y:-d},{x:0,y:-d/2}],h,{cssStyles:g}=t;if(t.look===`handDrawn`){let e=Fg.svg(l),n=Ep(t,{}),r=Gve(0,0,p,d,f),i=e.path(r,n);h=l.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-p/2}, ${d/2})`),g&&h.attr(`style`,g)}else h=Gg(l,p,d,m);return r&&h.attr(`style`,r),t.width=p,t.height=d,a_(t,h),t.intersect=function(e){return d_.polygon(t,m,e)},l}async function L_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.label=``,t.labelStyle=n;let{shapeSvg:i}=await r_(e,t,o_(t)),a=Math.max(30,t?.width??0),o=Math.max(30,t?.height??0),{cssStyles:s}=t,l=Fg.svg(i),u=Ep(t,{});t.look!==`handDrawn`&&(u.roughness=0,u.fillStyle=`solid`);let d=[{x:0,y:0},{x:a,y:0},{x:0,y:o},{x:a,y:o}],f=zg(d),p=l.path(f,u),m=i.insert(()=>p,`:first-child`);return m.attr(`class`,`basic label-container outer-path`),s&&t.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,s),r&&t.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,r),m.attr(`transform`,`translate(${-a/2}, ${-o/2})`),a_(t,m),t.intersect=function(e){return y.info(`Pill intersect`,t,{points:d}),d_.polygon(t,d,e)},i}async function R_e(e,t,{config:{themeVariables:n,flowchart:r}}){let{labelStyles:i}=Tp(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),l=r?.wrappingWidth;t.width=Math.max(s,l??0);let{shapeSvg:u,bbox:d,label:f}=await r_(e,t,`icon-shape default`),p=t.pos===`t`,m=s,h=s,{nodeBorder:g}=n,{stylesMap:_}=Sp(t),v=-h/2,b=-m/2,x=t.label?8:0,S=Fg.svg(u),C=Ep(t,{stroke:`none`,fill:`none`});t.look!==`handDrawn`&&(C.roughness=0,C.fillStyle=`solid`);let w=S.rectangle(v,b,h,m,C),T=Math.max(h,d.width),E=m+d.height+x,D=S.rectangle(-T/2,-E/2,T,E,{...C,fill:`transparent`,stroke:`none`}),O=u.insert(()=>w,`:first-child`),k=u.insert(()=>D);if(t.icon){let e=u.append(`g`);e.html(`<g>${await Wp(t.icon,{height:s,width:s,fallbackPrefix:``})}</g>`);let n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr(`transform`,`translate(${-r/2-a},${p?d.height/2+x/2-i/2-o:-d.height/2-x/2-i/2-o})`),e.attr(`style`,`color: ${_.get(`stroke`)??g};`)}return f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${p?-E/2:E/2-d.height})`),O.attr(`transform`,`translate(0,${p?d.height/2+x/2:-d.height/2-x/2})`),a_(t,k),t.intersect=function(e){if(y.info(`iconSquare intersect`,t,e),!t.label)return d_.rect(t,e);let n=t.x??0,r=t.y??0,i=t.height??0,a=[];return a=p?[{x:n-d.width/2,y:r-i/2},{x:n+d.width/2,y:r-i/2},{x:n+d.width/2,y:r-i/2+d.height+x},{x:n+h/2,y:r-i/2+d.height+x},{x:n+h/2,y:r+i/2},{x:n-h/2,y:r+i/2},{x:n-h/2,y:r-i/2+d.height+x},{x:n-d.width/2,y:r-i/2+d.height+x}]:[{x:n-h/2,y:r-i/2},{x:n+h/2,y:r-i/2},{x:n+h/2,y:r-i/2+m},{x:n+d.width/2,y:r-i/2+m},{x:n+d.width/2/2,y:r+i/2},{x:n-d.width/2,y:r+i/2},{x:n-d.width/2,y:r-i/2+m},{x:n-h/2,y:r-i/2+m}],d_.polygon(t,a,e)},u}async function z_e(e,t,{config:{themeVariables:n,flowchart:r}}){let{labelStyles:i}=Tp(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),l=r?.wrappingWidth;t.width=Math.max(s,l??0);let{shapeSvg:u,bbox:d,label:f}=await r_(e,t,`icon-shape default`),p=t.label?8:0,m=t.pos===`t`,{nodeBorder:h,mainBkg:g}=n,{stylesMap:_}=Sp(t),v=Fg.svg(u),b=Ep(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`),b.stroke=_.get(`fill`)??g;let x=u.append(`g`);t.icon&&x.html(`<g>${await Wp(t.icon,{height:s,width:s,fallbackPrefix:``})}</g>`);let S=x.node().getBBox(),C=S.width,w=S.height,T=S.x,E=S.y,D=Math.max(C,w)*Math.SQRT2+40,O=v.circle(0,0,D,b),k=Math.max(D,d.width),A=D+d.height+p,j=v.rectangle(-k/2,-A/2,k,A,{...b,fill:`transparent`,stroke:`none`}),M=u.insert(()=>O,`:first-child`),N=u.insert(()=>j);return x.attr(`transform`,`translate(${-C/2-T},${m?d.height/2+p/2-w/2-E:-d.height/2-p/2-w/2-E})`),x.attr(`style`,`color: ${_.get(`stroke`)??h};`),f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-A/2:A/2-d.height})`),M.attr(`transform`,`translate(0,${m?d.height/2+p/2:-d.height/2-p/2})`),a_(t,N),t.intersect=function(e){return y.info(`iconSquare intersect`,t,e),d_.rect(t,e)},u}async function B_e(e,t,{config:{themeVariables:n,flowchart:r}}){let{labelStyles:i}=Tp(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),l=r?.wrappingWidth;t.width=Math.max(s,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await r_(e,t,`icon-shape default`),m=t.pos===`t`,h=s+f*2,g=s+f*2,{nodeBorder:_,mainBkg:v}=n,{stylesMap:b}=Sp(t),x=-g/2,S=-h/2,C=t.label?8:0,w=Fg.svg(u),T=Ep(t,{});t.look!==`handDrawn`&&(T.roughness=0,T.fillStyle=`solid`),T.stroke=b.get(`fill`)??v;let E=w.path(c_(x,S,g,h,5),T),D=Math.max(g,d.width),O=h+d.height+C,k=w.rectangle(-D/2,-O/2,D,O,{...T,fill:`transparent`,stroke:`none`}),A=u.insert(()=>E,`:first-child`).attr(`class`,`icon-shape2`),j=u.insert(()=>k);if(t.icon){let e=u.append(`g`);e.html(`<g>${await Wp(t.icon,{height:s,width:s,fallbackPrefix:``})}</g>`);let n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+C/2-i/2-o:-d.height/2-C/2-i/2-o})`),e.attr(`style`,`color: ${b.get(`stroke`)??_};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-O/2:O/2-d.height})`),A.attr(`transform`,`translate(0,${m?d.height/2+C/2:-d.height/2-C/2})`),a_(t,j),t.intersect=function(e){if(y.info(`iconSquare intersect`,t,e),!t.label)return d_.rect(t,e);let n=t.x??0,r=t.y??0,i=t.height??0,a=[];return a=m?[{x:n-d.width/2,y:r-i/2},{x:n+d.width/2,y:r-i/2},{x:n+d.width/2,y:r-i/2+d.height+C},{x:n+g/2,y:r-i/2+d.height+C},{x:n+g/2,y:r+i/2},{x:n-g/2,y:r+i/2},{x:n-g/2,y:r-i/2+d.height+C},{x:n-d.width/2,y:r-i/2+d.height+C}]:[{x:n-g/2,y:r-i/2},{x:n+g/2,y:r-i/2},{x:n+g/2,y:r-i/2+h},{x:n+d.width/2,y:r-i/2+h},{x:n+d.width/2/2,y:r+i/2},{x:n-d.width/2,y:r+i/2},{x:n-d.width/2,y:r-i/2+h},{x:n-g/2,y:r-i/2+h}],d_.polygon(t,a,e)},u}async function V_e(e,t,{config:{themeVariables:n,flowchart:r}}){let{labelStyles:i}=Tp(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),l=r?.wrappingWidth;t.width=Math.max(s,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await r_(e,t,`icon-shape default`),m=t.pos===`t`,h=s+f*2,g=s+f*2,{nodeBorder:_,mainBkg:v}=n,{stylesMap:b}=Sp(t),x=-g/2,S=-h/2,C=t.label?8:0,w=Fg.svg(u),T=Ep(t,{});t.look!==`handDrawn`&&(T.roughness=0,T.fillStyle=`solid`),T.stroke=b.get(`fill`)??v;let E=w.path(c_(x,S,g,h,.1),T),D=Math.max(g,d.width),O=h+d.height+C,k=w.rectangle(-D/2,-O/2,D,O,{...T,fill:`transparent`,stroke:`none`}),A=u.insert(()=>E,`:first-child`),j=u.insert(()=>k);if(t.icon){let e=u.append(`g`);e.html(`<g>${await Wp(t.icon,{height:s,width:s,fallbackPrefix:``})}</g>`);let n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+C/2-i/2-o:-d.height/2-C/2-i/2-o})`),e.attr(`style`,`color: ${b.get(`stroke`)??_};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-O/2:O/2-d.height})`),A.attr(`transform`,`translate(0,${m?d.height/2+C/2:-d.height/2-C/2})`),a_(t,j),t.intersect=function(e){if(y.info(`iconSquare intersect`,t,e),!t.label)return d_.rect(t,e);let n=t.x??0,r=t.y??0,i=t.height??0,a=[];return a=m?[{x:n-d.width/2,y:r-i/2},{x:n+d.width/2,y:r-i/2},{x:n+d.width/2,y:r-i/2+d.height+C},{x:n+g/2,y:r-i/2+d.height+C},{x:n+g/2,y:r+i/2},{x:n-g/2,y:r+i/2},{x:n-g/2,y:r-i/2+d.height+C},{x:n-d.width/2,y:r-i/2+d.height+C}]:[{x:n-g/2,y:r-i/2},{x:n+g/2,y:r-i/2},{x:n+g/2,y:r-i/2+h},{x:n+d.width/2,y:r-i/2+h},{x:n+d.width/2/2,y:r+i/2},{x:n-d.width/2,y:r+i/2},{x:n-d.width/2,y:r-i/2+h},{x:n-g/2,y:r-i/2+h}],d_.polygon(t,a,e)},u}async function H_e(e,t,{config:{flowchart:n}}){let r=new Image;r.src=t?.img??``,await r.decode();let i=Number(r.naturalWidth.toString().replace(`px`,``)),a=Number(r.naturalHeight.toString().replace(`px`,``));t.imageAspectRatio=i/a;let{labelStyles:o}=Tp(t);t.labelStyle=o;let s=n?.wrappingWidth;t.defaultWidth=n?.wrappingWidth;let l=Math.max(t.label?s??0:0,t?.assetWidth??i),u=t.constraint===`on`&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,d=t.constraint===`on`?u/t.imageAspectRatio:t?.assetHeight??a;t.width=Math.max(u,s??0);let{shapeSvg:f,bbox:p,label:m}=await r_(e,t,`image-shape default`),h=t.pos===`t`,g=-u/2,_=-d/2,v=t.label?8:0,b=Fg.svg(f),x=Ep(t,{});t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let S=b.rectangle(g,_,u,d,x),C=Math.max(u,p.width),w=d+p.height+v,T=b.rectangle(-C/2,-w/2,C,w,{...x,fill:`none`,stroke:`none`}),E=f.insert(()=>S,`:first-child`),D=f.insert(()=>T);if(t.img){let e=f.append(`image`);e.attr(`href`,t.img),e.attr(`width`,u),e.attr(`height`,d),e.attr(`preserveAspectRatio`,`none`),e.attr(`transform`,`translate(${-u/2},${h?w/2-d:-w/2})`)}return m.attr(`transform`,`translate(${-p.width/2-(p.x-(p.left??0))},${h?-d/2-p.height/2-v/2:d/2-p.height/2+v/2})`),E.attr(`transform`,`translate(0,${h?p.height/2+v/2:-p.height/2-v/2})`),a_(t,D),t.intersect=function(e){if(y.info(`iconSquare intersect`,t,e),!t.label)return d_.rect(t,e);let n=t.x??0,r=t.y??0,i=t.height??0,a=[];return a=h?[{x:n-p.width/2,y:r-i/2},{x:n+p.width/2,y:r-i/2},{x:n+p.width/2,y:r-i/2+p.height+v},{x:n+u/2,y:r-i/2+p.height+v},{x:n+u/2,y:r+i/2},{x:n-u/2,y:r+i/2},{x:n-u/2,y:r-i/2+p.height+v},{x:n-p.width/2,y:r-i/2+p.height+v}]:[{x:n-u/2,y:r-i/2},{x:n+u/2,y:r-i/2},{x:n+u/2,y:r-i/2+d},{x:n+p.width/2,y:r-i/2+d},{x:n+p.width/2/2,y:r+i/2},{x:n-p.width/2,y:r+i/2},{x:n-p.width/2,y:r-i/2+d},{x:n-u/2,y:r-i/2+d}],d_.polygon(t,a,e)},f}async function U_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:l}=await r_(e,t,o_(t)),u=Math.max(l.height+a*2,t.height??0),d=Math.max(l.width+o*2,(t.width??0)-u),f=[{x:0,y:0},{x:d,y:0},{x:d+3*u/6,y:-u},{x:-3*u/6,y:-u}],p,{cssStyles:m}=t;if(t.look===`handDrawn`){let e=Fg.svg(s),n=Ep(t,{}),r=zg(f),i=e.path(r,n);p=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-d/2}, ${u/2})`),m&&p.attr(`style`,m)}else p=Gg(s,d,u,f);return r&&p.attr(`style`,r),t.width=d,t.height=u,a_(t,p),t.intersect=function(e){return d_.polygon(t,f,e)},s}async function W_e(e,t){let{shapeSvg:n,bbox:r,label:i}=await r_(e,t,`label`),a=n.insert(`rect`,`:first-child`);return a.attr(`width`,.1).attr(`height`,.1),n.attr(`class`,`label edgeLabel`),i.attr(`transform`,`translate(${-(r.width/2)-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),a_(t,a),t.intersect=function(e){return d_.rect(t,e)},n}async function G_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:l}=await r_(e,t,o_(t)),u=Math.max(l.height+a,t.height??0),d=Math.max(l.width+o,(t.width??0)-u),f=[{x:0,y:0},{x:d+3*u/6,y:0},{x:d,y:-u},{x:-(3*u)/6,y:-u}],p,{cssStyles:m}=t;if(t.look===`handDrawn`){let e=Fg.svg(s),n=Ep(t,{}),r=zg(f),i=e.path(r,n);p=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-d/2}, ${u/2})`),m&&p.attr(`style`,m)}else p=Gg(s,d,u,f);return r&&p.attr(`style`,r),t.width=d,t.height=u,a_(t,p),t.intersect=function(e){return d_.polygon(t,f,e)},s}async function K_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:l}=await r_(e,t,o_(t)),u=Math.max(l.height+a,t.height??0),d=Math.max(l.width+o,(t.width??0)-u),f=[{x:-3*u/6,y:0},{x:d,y:0},{x:d+3*u/6,y:-u},{x:0,y:-u}],p,{cssStyles:m}=t;if(t.look===`handDrawn`){let e=Fg.svg(s),n=Ep(t,{}),r=zg(f),i=e.path(r,n);p=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-d/2}, ${u/2})`),m&&p.attr(`style`,m)}else p=Gg(s,d,u,f);return r&&p.attr(`style`,r),t.width=d,t.height=u,a_(t,p),t.intersect=function(e){return d_.polygon(t,f,e)},s}function q_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.label=``,t.labelStyle=n;let i=e.insert(`g`).attr(`class`,o_(t)).attr(`id`,t.domId??t.id),{cssStyles:a}=t,o=Math.max(35,t?.width??0),s=Math.max(35,t?.height??0),l=[{x:o,y:0},{x:0,y:s+7/2},{x:o-14,y:s+7/2},{x:0,y:2*s},{x:o,y:s-7/2},{x:14,y:s-7/2}],u=Fg.svg(i),d=Ep(t,{});t.look!==`handDrawn`&&(d.roughness=0,d.fillStyle=`solid`);let f=zg(l),p=u.path(f,d),m=i.insert(()=>p,`:first-child`);return m.attr(`class`,`outer-path`),a&&t.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,a),r&&t.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,r),m.attr(`transform`,`translate(-${o/2},${-s})`),a_(t,m),t.intersect=function(e){return y.info(`lightningBolt intersect`,t,e),d_.polygon(t,l,e)},i}async function J_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?24:i;if(t.width||t.height){let e=t.width??0;t.width=(t.width??0)-a,t.width<C_&&(t.width=C_);let n=e/2/(2.5+e/50);t.height=(t.height??0)-o-n*3,t.height<S_&&(t.height=S_)}let{shapeSvg:s,bbox:l,label:u}=await r_(e,t,o_(t)),d=(t?.width?t?.width:l.width)+a*2,f=d/2,p=f/(2.5+d/50),m=(t?.height?t?.height:l.height)+p+o*2,h=m*.1,g,{cssStyles:_}=t;if(t.look===`handDrawn`){let e=Fg.svg(s),n=qve(0,0,d,m,f,p,h),r=Jve(0,p,d,m,f,p),i=Ep(t,{}),a=e.path(n,i),o=e.path(r,i);s.insert(()=>o,`:first-child`).attr(`class`,`line`),g=s.insert(()=>a,`:first-child`),g.attr(`class`,`basic label-container`),_&&g.attr(`style`,_)}else{let e=Kve(0,0,d,m,f,p,h);g=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,Um(_)).attr(`style`,r)}return g.attr(`label-offset-y`,p),g.attr(`transform`,`translate(${-d/2}, ${-(m/2+p)})`),a_(t,g),u.attr(`transform`,`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+p-(l.y-(l.top??0))})`),t.intersect=function(e){let n=d_.rect(t,e),r=n.x-(t.x??0);if(f!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-p)){let i=p*p*(1-r*r/(f*f));i>0&&(i=Math.sqrt(i)),i=p-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},s}async function Y_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=(t.width??0)*10/11-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:s,bbox:l,label:u}=await r_(e,t,o_(t)),d=(t?.width?t?.width:l.width)+(a??0)*2,f=(t?.height?t?.height:l.height)+(o??0)*2,p=t.look===`neo`?f/4:f/8,m=f+p,{cssStyles:h}=t,g=Fg.svg(s),_=Ep(t,{});t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let v=[{x:-d/2-d/2*.1,y:-m/2},{x:-d/2-d/2*.1,y:m/2},...Bg(-d/2-d/2*.1,m/2,d/2+d/2*.1,m/2,p,.8),{x:d/2+d/2*.1,y:-m/2},{x:-d/2-d/2*.1,y:-m/2},{x:-d/2,y:-m/2},{x:-d/2,y:m/2*1.1},{x:-d/2,y:-m/2}],y=g.polygon(v.map(e=>[e.x,e.y]),_),b=s.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),h&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,r),b.attr(`transform`,`translate(0,${-p/2})`),u.attr(`transform`,`translate(${-d/2+(t.padding??0)+d/2*.1/2-(l.x-(l.left??0))},${-f/2+(t.padding??0)-p/2-(l.y-(l.top??0))})`),a_(t,b),t.intersect=function(e){return d_.polygon(t,v,e)},s}async function X_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=t.look===`neo`?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-2*s,10),t.height=Math.max((t?.height??0)-o*2-2*s,10));let{shapeSvg:l,bbox:u,label:d}=await r_(e,t,o_(t)),f=(t?.width?t?.width:u.width)+a*2+2*s,p=(t?.height?t?.height:u.height)+o*2+2*s,m=f-2*s,h=p-2*s,g=-m/2,_=-h/2,{cssStyles:v}=t,y=Fg.svg(l),b=Ep(t,{}),x=[{x:g-s,y:_+s},{x:g-s,y:_+h+s},{x:g+m-s,y:_+h+s},{x:g+m-s,y:_+h},{x:g+m,y:_+h},{x:g+m,y:_+h-s},{x:g+m+s,y:_+h-s},{x:g+m+s,y:_-s},{x:g+s,y:_-s},{x:g+s,y:_},{x:g,y:_},{x:g,y:_+s}],S=[{x:g,y:_+s},{x:g+m-s,y:_+s},{x:g+m-s,y:_+h},{x:g+m,y:_+h},{x:g+m,y:_},{x:g,y:_}];t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let C=zg(x),w=y.path(C,b),T=zg(S),E=y.path(T,b);t.look!==`handDrawn`&&(w=Hg(w),E=Hg(E));let D=l.insert(`g`,`:first-child`);return D.insert(()=>w),D.insert(()=>E),D.attr(`class`,`basic label-container outer-path`),v&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,v),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),d.attr(`transform`,`translate(${-(u.width/2)-s-(u.x-(u.left??0))}, ${-(u.height/2)+s-(u.y-(u.top??0))})`),a_(t,D),t.intersect=function(e){return d_.polygon(t,x,e)},l}async function Z_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await r_(e,t,o_(t)),s=t.padding??0,l=t.look===`neo`?16:s,u=t.look===`neo`?12:s,d=!0;(t.width||t.height)&&(d=!1,t.width=(t?.width??0)-l*2,t.height=(t?.height??0)-u*3);let f=Math.max(a.width,t?.width??0)+l*2,p=Math.max(a.height,t?.height??0)+u*3,m=t.look===`neo`?p/4:p/8,h=p+(d?m/2:-m/2),g=-f/2,_=-h/2,{cssStyles:v}=t,y=Bg(g-10,_+h+10,g+f-10,_+h+10,m,.8),b=y?.[y.length-1],x=[{x:g-10,y:_+10},{x:g-10,y:_+h+10},...y,{x:g+f-10,y:b.y-10},{x:g+f,y:b.y-10},{x:g+f,y:b.y-20},{x:g+f+10,y:b.y-20},{x:g+f+10,y:_-10},{x:g+10,y:_-10},{x:g+10,y:_},{x:g,y:_},{x:g,y:_+10}],S=[{x:g,y:_+10},{x:g+f-10,y:_+10},{x:g+f-10,y:b.y-10},{x:g+f,y:b.y-10},{x:g+f,y:_},{x:g,y:_}],C=Fg.svg(i),w=Ep(t,{});t.look!==`handDrawn`&&(w.roughness=0,w.fillStyle=`solid`);let T=zg(x),E=C.path(T,w),D=zg(S),O=C.path(D,w),k=i.insert(()=>E,`:first-child`);return k.insert(()=>O),k.attr(`class`,`basic label-container outer-path`),v&&t.look!==`handDrawn`&&k.selectAll(`path`).attr(`style`,v),r&&t.look!==`handDrawn`&&k.selectAll(`path`).attr(`style`,r),k.attr(`transform`,`translate(0,${-m/2})`),o.attr(`transform`,`translate(${-(a.width/2)-10-(a.x-(a.left??0))}, ${-(a.height/2)+10-m/2-(a.y-(a.top??0))})`),a_(t,k),t.intersect=function(e){return d_.polygon(t,x,e)},i}async function Q_e(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=Tp(t);t.labelStyle=r,t.useHtmlLabels||bs(ms())||(t.centerLabel=!0);let{shapeSvg:a,bbox:o,label:s}=await r_(e,t,o_(t)),l=Math.max(o.width+(t.padding??0)*2,t?.width??0),u=Math.max(o.height+(t.padding??0)*2,t?.height??0),d=-l/2,f=-u/2,{cssStyles:p}=t,m=Fg.svg(a),h=Ep(t,{fill:n.noteBkgColor,stroke:n.noteBorderColor});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=m.rectangle(d,f,l,u,h),_=a.insert(()=>g,`:first-child`);return _.attr(`class`,`basic label-container outer-path`),s.attr(`class`,`label noteLabel`),p&&t.look!==`handDrawn`&&_.selectAll(`path`).attr(`style`,p),i&&t.look!==`handDrawn`&&_.selectAll(`path`).attr(`style`,i),s.attr(`transform`,`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),a_(t,_),t.intersect=function(e){return d_.rect(t,e)},a}async function $_e(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await r_(e,t,o_(t)),o=a.width+(t.padding??0)+(a.height+(t.padding??0)),s=.5,l=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}],u,{cssStyles:d}=t;if(t.look===`handDrawn`){let e=Fg.svg(i),n=Ep(t,{}),r=Yve(0,0,o),a=e.path(r,n);u=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-o/2+s}, ${o/2})`),d&&u.attr(`style`,d)}else u=Gg(i,o,o,l),u.attr(`transform`,`translate(${-o/2+s}, ${o/2})`);return r&&u.attr(`style`,r),a_(t,u),t.calcIntersect=function(e,t){let n=e.width,r=[{x:n/2,y:0},{x:n,y:-n/2},{x:n/2,y:-n},{x:0,y:-n/2}],i=d_.polygon(e,r,t);return{x:i.x-.5,y:i.y-.5}},t.intersect=function(e){return this.calcIntersect(t,e)},i}async function eve(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?21:i??0,o=t.look===`neo`?12:i??0,{shapeSvg:s,bbox:l,label:u}=await r_(e,t,o_(t)),d=l.width+(t.look===`neo`?a*2:a),f=Math.max(l.height+(t.look===`neo`?o*2:o),t.height??0),p=f/4,m=-Math.max(d,(t.width??0)-p)/2,h=-f/2,g=h/2,_=[{x:m+g,y:h},{x:m,y:0},{x:m+g,y:-h},{x:-m,y:-h},{x:-m,y:h}],{cssStyles:v}=t,y=Fg.svg(s),b=Ep(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=zg(_),S=y.path(x,b),C=s.insert(()=>S,`:first-child`);return C.attr(`class`,`basic label-container outer-path`),v&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,v),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),C.attr(`transform`,`translate(${-g/2},0)`),u.attr(`transform`,`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),a_(t,C),t.intersect=function(e){return d_.polygon(t,_,e)},s}async function tve(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i;i=t.cssClasses?`node `+t.cssClasses:`node default`;let a=e.insert(`g`).attr(`class`,i).attr(`id`,t.domId||t.id),o=a.insert(`g`),s=a.insert(`g`).attr(`class`,`label`).attr(`style`,r),l=t.description,u=t.label,d=await l_(s,u,t.labelStyle,!0,!0),f={width:0,height:0};if(bs(Z())){let e=d.children[0],t=$c(d);f=e.getBoundingClientRect(),t.attr(`width`,f.width),t.attr(`height`,f.height)}y.info(`Text 2`,l);let p=l||[],m=d.getBBox(),h=await l_(s,Array.isArray(p)?p.join(`<br/>`):p,t.labelStyle,!0,!0),g=h.children[0],_=$c(h);f=g.getBoundingClientRect(),_.attr(`width`,f.width),_.attr(`height`,f.height);let v=(t.padding||0)/2;$c(h).attr(`transform`,`translate( `+(f.width>m.width?0:(m.width-f.width)/2)+`, `+(m.height+v+5)+`)`),$c(d).attr(`transform`,`translate( `+(f.width<m.width?0:-(m.width-f.width)/2)+`, 0)`),f=s.node().getBBox(),s.attr(`transform`,`translate(`+-f.width/2+`, `+(-f.height/2-v+3)+`)`);let b=f.width+(t.padding||0),x=f.height+(t.padding||0),S=-f.width/2-v,C=-f.height/2-v,w,T;if(t.look===`handDrawn`){let e=Fg.svg(a),n=Ep(t,{}),r=e.path(c_(S,C,b,x,t.rx||0),n),i=e.line(-f.width/2-v,-f.height/2-v+m.height+v,f.width/2+v,-f.height/2-v+m.height+v,n);T=a.insert(()=>(y.debug(`Rough node insert CXC`,r),i),`:first-child`),w=a.insert(()=>(y.debug(`Rough node insert CXC`,r),r),`:first-child`)}else w=o.insert(`rect`,`:first-child`),T=o.insert(`line`),w.attr(`class`,`outer title-state`).attr(`style`,r).attr(`x`,-f.width/2-v).attr(`y`,-f.height/2-v).attr(`width`,f.width+(t.padding||0)).attr(`height`,f.height+(t.padding||0)),T.attr(`class`,`divider`).attr(`x1`,-f.width/2-v).attr(`x2`,f.width/2+v).attr(`y1`,-f.height/2-v+m.height+v).attr(`y2`,-f.height/2-v+m.height+v);return a_(t,w),t.intersect=function(e){return d_.rect(t,e)},a}async function nve(e,t,{config:{themeVariables:n}}){let r=n?.radius??5;return Xg(e,t,{rx:r,ry:r,classes:``,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1})}async function rve(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0,{shapeSvg:o,bbox:s,label:l}=await r_(e,t,o_(t)),u=(t?.width??s.width)+i*2+(t.look===`neo`?w_:w_*2),d=(t?.height??s.height)+a*2,f=u-w_,p=d,m=w_-u/2,h=-d/2,{cssStyles:g}=t,_=Fg.svg(o),v=Ep(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:m,y:h},{x:m+f,y:h},{x:m+f,y:h+p},{x:m-w_,y:h+p},{x:m-w_,y:h},{x:m,y:h},{x:m,y:h+p}],b=_.polygon(y.map(e=>[e.x,e.y]),v),x=o.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`).attr(`style`,Um(g)),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),g&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),l.attr(`transform`,`translate(${w_/2-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),a_(t,x),t.intersect=function(e){return d_.rect(t,e)},o}async function ive(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2,10),t.height=Math.max((t?.height??0)/1.5-o*2,10));let{shapeSvg:s,bbox:l,label:u}=await r_(e,t,o_(t)),d=(t?.width?t?.width:l.width)+a*2,f=((t?.height?t?.height:l.height)+o*2)*1.5,p=d,m=f/1.5,h=-p/2,g=-m/2,{cssStyles:_}=t,v=Fg.svg(s),y=Ep(t,{});t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let b=[{x:h,y:g},{x:h,y:g+m},{x:h+p,y:g+m},{x:h+p,y:g-m/2}],x=zg(b),S=v.path(x,y),C=s.insert(()=>S,`:first-child`);return C.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&C.selectChildren(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&C.selectChildren(`path`).attr(`style`,r),C.attr(`transform`,`translate(0, ${m/4})`),u.attr(`transform`,`translate(${-p/2+(t.padding??0)-(l.x-(l.left??0))}, ${-m/4+(t.padding??0)-(l.y-(l.top??0))})`),a_(t,C),t.intersect=function(e){return d_.polygon(t,b,e)},s}async function ave(e,t){let n=t.padding??0,r=t.look===`neo`?16:n*2,i=t.look===`neo`?12:n;return Xg(e,t,{rx:0,ry:0,classes:``,labelPaddingX:t.labelPaddingX??r,labelPaddingY:i})}async function ove(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?20:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:l}=await r_(e,t,o_(t)),u=l.height+(t.look===`neo`?o*2:o),d=l.width+u/4+(t.look===`neo`?a*2:a),f=u/2,{cssStyles:p}=t,m=Fg.svg(s),h=Ep(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=[{x:-d/2+f,y:-u/2},{x:d/2-f,y:-u/2},...Vg(-d/2+f,0,f,50,90,270),{x:d/2-f,y:u/2},...Vg(d/2-f,0,f,50,270,450)],_=zg(g),v=m.path(_,h),y=s.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container outer-path`),p&&t.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,r),a_(t,y),t.intersect=function(e){return d_.polygon(t,g,e)},s}async function sve(e,t){return Xg(e,t,{rx:t.look===`neo`?3:5,ry:t.look===`neo`?3:5,classes:`flowchart-node`})}function cve(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=Tp(t);t.labelStyle=r;let{cssStyles:a}=t,{lineColor:o,stateBorder:s,nodeBorder:l,nodeShadow:u}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let d=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId??t.id),f=Fg.svg(d),p=Ep(t,{});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=f.circle(0,0,t.width,{...p,stroke:o,strokeWidth:2}),h=s??l,g=(t.width??0)*5/14,_=f.circle(0,0,g,{...p,fill:h,stroke:h,strokeWidth:2,fillStyle:`solid`}),v=d.insert(()=>m,`:first-child`);if(v.insert(()=>_),t.look!==`handDrawn`&&v.attr(`class`,`outer-path`),a&&v.selectAll(`path`).attr(`style`,a),i&&v.selectAll(`path`).attr(`style`,i),t.width<25&&u&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;v.attr(`style`,`filter:url(#${n})`)}return a_(t,v),t.intersect=function(e){return d_.circle(t,(t.width??0)/2,e)},d}function lve(e,t,{config:{themeVariables:n}}){let{lineColor:r,nodeShadow:i}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let a=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId||t.id),o;if(t.look===`handDrawn`){let e=Fg.svg(a).circle(0,0,t.width,bp(r));o=a.insert(()=>e),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14)}else o=a.insert(`circle`,`:first-child`),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14);if(t.width<25&&i&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;o.attr(`style`,`filter:url(#${n})`)}return a_(t,o),t.intersect=function(e){return d_.circle(t,(t.width??7)/2,e)},a}async function uve(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t?.padding??8,a=t.look===`neo`?28:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:l}=await r_(e,t,o_(t)),u=Math.max(l.width+2*T_+a,t.width??0),d=Math.max(l.height+o,t.height??0),f=u-2*T_,p=d,m=-u/2,h=-d/2,g=[{x:0,y:0},{x:f,y:0},{x:f,y:-p},{x:0,y:-p},{x:0,y:0},{x:-8,y:0},{x:f+8,y:0},{x:f+8,y:-p},{x:-8,y:-p},{x:-8,y:0}];if(t.look===`handDrawn`){let e=Fg.svg(s),n=Ep(t,{}),r=e.rectangle(m,h,f+16,p,n),i=e.line(m+T_,h,m+T_,h+p,n),a=e.line(m+T_+f,h,m+T_+f,h+p,n);s.insert(()=>i,`:first-child`),s.insert(()=>a,`:first-child`);let o=s.insert(()=>r,`:first-child`),{cssStyles:l}=t;o.attr(`class`,`basic label-container`).attr(`style`,Um(l)),a_(t,o)}else{let e=Gg(s,f,p,g);r&&e.attr(`style`,r),a_(t,e)}return t.intersect=function(e){return d_.polygon(t,g,e)},s}async function dve(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-o*2,10),t.width=Math.max((t?.width??0)-a*2-E_*(t.height+o*2),10));let{shapeSvg:s,bbox:l}=await r_(e,t,o_(t)),u=(t?.height?t?.height:l.height)+o*2,d=E_*u,f=E_*u,p=(t?.width?t?.width:l.width)+a*2+d-d,m=u,h=-p/2,g=-m/2,{cssStyles:_}=t,v=Fg.svg(s),y=Ep(t,{}),b=[{x:h-d/2,y:g},{x:h+p+d/2,y:g},{x:h+p+d/2,y:g+m},{x:h-d/2,y:g+m}],x=[{x:h+p-d/2,y:g+m},{x:h+p+d/2,y:g+m},{x:h+p+d/2,y:g+m-f}];t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let S=zg(b),C=v.path(S,y),w=zg(x),T=v.path(w,{...y,fillStyle:`solid`}),E=s.insert(()=>T,`:first-child`);return E.insert(()=>C,`:first-child`),E.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,r),a_(t,E),t.intersect=function(e){return d_.polygon(t,b,e)},s}async function fve(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await r_(e,t,o_(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),l=Math.max(a.height+(t.padding??0)*2,t?.height??0),u=l/8,d=.2*s,f=.2*l,p=l+u,{cssStyles:m}=t,h=Fg.svg(i),g=Ep(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=[{x:-s/2-s/2*.1,y:p/2},...Bg(-s/2-s/2*.1,p/2,s/2+s/2*.1,p/2,u,.8),{x:s/2+s/2*.1,y:-p/2},{x:-s/2-s/2*.1,y:-p/2}],v=-s/2+s/2*.1,y=-p/2-f*.4,b=[{x:v+s-d,y:(y+l)*1.3},{x:v+s,y:y+l-f},{x:v+s,y:(y+l)*.9},...Bg(v+s,(y+l)*1.25,v+s-d,(y+l)*1.3,-l*.02,.5)],x=zg(_),S=h.path(x,g),C=zg(b),w=h.path(C,{...g,fillStyle:`solid`}),T=i.insert(()=>w,`:first-child`);return T.insert(()=>S,`:first-child`),T.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&T.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&T.selectAll(`path`).attr(`style`,r),T.attr(`transform`,`translate(0,${-u/2})`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-l/2+(t.padding??0)-u/2-(a.y-(a.top??0))})`),a_(t,T),t.intersect=function(e){return d_.polygon(t,_,e)},i}async function pve(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await r_(e,t,o_(t)),o=Math.max(a.width+(t.padding??0),t?.width||0),s=Math.max(a.height+(t.padding??0),t?.height||0),l=-o/2,u=-s/2,d=i.insert(`rect`,`:first-child`);return d.attr(`class`,`text`).attr(`style`,r).attr(`rx`,0).attr(`ry`,0).attr(`x`,l).attr(`y`,u).attr(`width`,o).attr(`height`,s),a_(t,d),t.intersect=function(e){return d_.rect(t,e)},i}async function mve(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?12:i/2,o=t.height??0;if(t.height&&(t.height-=a,t.height<D_&&(t.height=D_)),t.width){let e=o/2/(2.5+o/50);t.width=t.width-a-e*3,t.width<O_&&(t.width=O_)}let{shapeSvg:s,bbox:l,label:u}=await r_(e,t,o_(t)),d=Math.max(t.height??0,l.height)+a,f=d/2,p=f/(2.5+d/50),m=Math.max(t.width??0,l.width)+p+a,{cssStyles:h}=t,g;if(t.look===`handDrawn`){let e=Fg.svg(s),n=Zve(0,0,m,d,p,f),r=Qve(0,0,m,d,p,f),i=e.path(n,Ep(t,{})),a=e.path(r,Ep(t,{fill:`none`}));g=s.insert(()=>a,`:first-child`),g=s.insert(()=>i,`:first-child`),g.attr(`class`,`basic label-container`),h&&g.attr(`style`,h)}else{let e=Xve(0,0,m,d,p,f);g=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container`).attr(`style`,Um(h)).attr(`style`,r),g.attr(`class`,`basic label-container outer-path`),h&&g.selectAll(`path`).attr(`style`,h),r&&g.selectAll(`path`).attr(`style`,r)}return g.attr(`label-offset-x`,p),g.attr(`transform`,`translate(${-m/2}, ${d/2} )`),u.attr(`transform`,`translate(${-(l.width/2)-p-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),a_(t,g),t.intersect=function(e){let n=d_.rect(t,e),r=n.y-(t.y??0);if(f!=0&&(Math.abs(r)<(t.height??0)/2||Math.abs(r)==(t.height??0)/2&&Math.abs(n.x-(t.x??0))>(t.width??0)/2-p)){let i=p*p*(1-r*r/(f*f));i!=0&&(i=Math.sqrt(Math.abs(i))),i=p-i,e.x-(t.x??0)>0&&(i=-i),n.x+=i}return n},s}async function hve(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.padding??0,a=(t.look,i),o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:l}=await r_(e,t,o_(t)),u=Math.max(l.height+a,t.height??0),d=Math.max(l.width+o,(t.width??0)-u),f=[{x:-3*u/6,y:0},{x:d+3*u/6,y:0},{x:d,y:-u},{x:0,y:-u}],p,{cssStyles:m}=t;if(t.look===`handDrawn`){let e=Fg.svg(s),n=Ep(t,{}),r=zg(f),i=e.path(r,n);p=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-d/2}, ${u/2})`),m&&p.attr(`style`,m)}else p=Gg(s,d,u,f);return r&&p.attr(`style`,r),t.width=d,t.height=u,a_(t,p),t.intersect=function(e){return d_.polygon(t,f,e)},s}async function gve(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=(t.height??0)-o*2,t.height<5&&(t.height=5),t.width=(t.width??0)-a*2,t.width<15&&(t.width=15));let{shapeSvg:s,bbox:l}=await r_(e,t,o_(t)),u=(t?.width?t?.width:l.width)+a*2,d=(t?.height?t?.height:l.height)+o*2,{cssStyles:f}=t,p=Fg.svg(s),m=Ep(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:-u/2*.8,y:-d/2},{x:u/2*.8,y:-d/2},{x:u/2,y:-d/2*.6},{x:u/2,y:d/2},{x:-u/2,y:d/2},{x:-u/2,y:-d/2*.6}],g=zg(h),_=p.path(g,m),v=s.insert(()=>_,`:first-child`);return v.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&v.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&v.selectChildren(`path`).attr(`style`,r),a_(t,v),t.intersect=function(e){return d_.polygon(t,h,e)},s}async function _ve(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?i*2:i;(t.width||t.height)&&(t.width=((t?.width??0)-a)/2,t.width<A_&&(t.width=A_),t.height=t?.height??0,t.height<k_&&(t.height=k_));let{shapeSvg:o,bbox:s,label:l}=await r_(e,t,o_(t)),u=os(Z().flowchart?.htmlLabels),d=(t?.width?t?.width:s.width)+a,f=t?.height?t?.height:d+s.height,p=f,m=[{x:0,y:0},{x:p,y:0},{x:p/2,y:-f}],{cssStyles:h}=t,g=Fg.svg(o),_=Ep(t,{});t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let v=zg(m),b=g.path(v,_),x=o.insert(()=>b,`:first-child`).attr(`transform`,`translate(${-f/2}, ${f/2})`).attr(`class`,`outer-path`);return h&&t.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,r),t.width=d,t.height=f,a_(t,x),l.attr(`transform`,`translate(${-s.width/2-(s.x-(s.left??0))}, ${f/2-(s.height+(t.padding??0)/(u?2:1)-(s.y-(s.top??0)))})`),t.intersect=function(e){return y.info(`Triangle intersect`,t,m,e),d_.polygon(t,m,e)},o}async function vve(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=!0;(t.width||t.height)&&(s=!1,t.width=(t?.width??0)-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:l,bbox:u,label:d}=await r_(e,t,o_(t)),f=(t?.width?t?.width:u.width)+(a??0)*2,p=(t?.height?t?.height:u.height)+(o??0)*2,m=t.look===`neo`?p/4:p/8,h=p+(s?m:-m),{cssStyles:g}=t,_=14-f,v=_>0?_/2:0,y=Fg.svg(l),b=Ep(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=[{x:-f/2-v,y:h/2},...Bg(-f/2-v,h/2,f/2+v,h/2,m,.8),{x:f/2+v,y:-h/2},{x:-f/2-v,y:-h/2}],S=zg(x),C=y.path(S,b),w=l.insert(()=>C,`:first-child`);return w.attr(`class`,`basic label-container outer-path`),g&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,g),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),w.attr(`transform`,`translate(0,${-m/2})`),d.attr(`transform`,`translate(${-f/2+(t.padding??0)-(u.x-(u.left??0))},${-p/2+(t.padding??0)-m-(u.y-(u.top??0))})`),a_(t,w),t.intersect=function(e){return d_.polygon(t,x,e)},l}async function yve(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?20:i;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);let e=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-o-20/9*e),t.width-=a*2}let{shapeSvg:s,bbox:l}=await r_(e,t,o_(t)),u=(t?.width?t?.width:l.width)+a*2,d=(t?.height?t?.height:l.height)+o,f=d/8,p=d+f*2,{cssStyles:m}=t,h=Fg.svg(s),g=Ep(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=[{x:-u/2,y:p/2},...Bg(-u/2,p/2,u/2,p/2,f,1),{x:u/2,y:-p/2},...Bg(u/2,-p/2,-u/2,-p/2,f,-1)],v=zg(_),y=h.path(v,g),b=s.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container`),m&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,r),a_(t,b),t.intersect=function(e){return d_.polygon(t,_,e)},s}async function bve(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-i*2-j_,10),t.height=Math.max((t?.height??0)-a*2-j_,10));let{shapeSvg:o,bbox:s,label:l}=await r_(e,t,o_(t)),u=(t?.width?t?.width:s.width)+i*2+j_,d=(t?.height?t?.height:s.height)+a*2+j_,f=u-j_,p=d-j_,m=-f/2,h=-p/2,{cssStyles:g}=t,_=Fg.svg(o),v=Ep(t,{}),y=[{x:m-j_,y:h-j_},{x:m-j_,y:h+p},{x:m+f,y:h+p},{x:m+f,y:h-j_}],b=`M${m-j_},${h-j_} L${m+f},${h-j_} L${m+f},${h+p} L${m-j_},${h+p} L${m-j_},${h-j_}457+ M${m-j_},${h} L${m+f},${h}458+ M${m},${h-j_} L${m},${h+p}`;t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let x=_.path(b,v),S=o.insert(()=>x,`:first-child`);return S.attr(`transform`,`translate(${j_/2}, ${j_/2})`),S.attr(`class`,`basic label-container outer-path`),g&&t.look!==`handDrawn`&&S.selectAll(`path`).attr(`style`,g),r&&t.look!==`handDrawn`&&S.selectAll(`path`).attr(`style`,r),l.attr(`transform`,`translate(${-(s.width/2)+j_/2-(s.x-(s.left??0))}, ${-(s.height/2)+j_/2-(s.y-(s.top??0))})`),a_(t,S),t.intersect=function(e){return d_.polygon(t,y,e)},o}async function Zg(e,t){let n=t;n.alias&&(t.label=n.alias);let{theme:r,themeVariables:i}=ms(),{rowEven:a,rowOdd:o,nodeBorder:s,borderColorArray:l}=i;if(t.look===`handDrawn`){let{themeVariables:n}=ms(),{background:r}=n;await Zg(e,{...t,id:t.id+`-background`,domId:(t.domId||t.id)+`-background`,look:`default`,cssStyles:[`stroke: none`,`fill: ${r}`]})}let u=ms();t.useHtmlLabels=u.htmlLabels;let d=u.er?.diagramPadding??10,f=u.er?.entityPadding??6,{cssStyles:p}=t,{labelStyles:m,nodeStyles:h}=Tp(t);if(n.attributes.length===0&&t.label){let i={rx:0,ry:0,labelPaddingX:d,labelPaddingY:d*1.5,classes:``};Bm(t.label,u)+i.labelPaddingX*2<u.er.minEntityWidth&&(t.width=u.er.minEntityWidth);let a=await Xg(e,t,i);if(r!=null&&M_.has(r)){let e=n.colorIndex??0;a.attr(`data-color-id`,`color-${e%l.length}`)}if(!os(u.htmlLabels)){let e=a.select(`text`),t=e.node()?.getBBox();e.attr(`transform`,`translate(${-t.width/2}, 0)`)}return a}u.htmlLabels||(d*=1.25,f*=1.25);let g=o_(t);g||=`node default`;let _=e.insert(`g`).attr(`class`,g).attr(`id`,t.domId||t.id),v=await Qg(_,t.label??``,u,0,0,[`name`],m);v.height+=f;let y=0,b=[],x=[],S=0,C=0,w=0,T=0,E=!0,D=!0;for(let e of n.attributes){let t=await Qg(_,e.type,u,0,y,[`attribute-type`],m);S=Math.max(S,t.width+d);let n=await Qg(_,e.name,u,0,y,[`attribute-name`],m);C=Math.max(C,n.width+d);let r=await Qg(_,e.keys.join(),u,0,y,[`attribute-keys`],m);w=Math.max(w,r.width+d);let i=await Qg(_,e.comment,u,0,y,[`attribute-comment`],m);T=Math.max(T,i.width+d);let a=Math.max(t.height,n.height,r.height,i.height)+f;x.push({yOffset:y,rowHeight:a}),y+=a}let O=4;w<=d&&(E=!1,w=0,O--),T<=d&&(D=!1,T=0,O--);let k=_.node().getBBox();if(v.width+d*2-(S+C+w+T)>0){let e=v.width+d*2-(S+C+w+T);S+=e/O,C+=e/O,w>0&&(w+=e/O),T>0&&(T+=e/O)}let A=S+C+w+T,j=Fg.svg(_),M=Ep(t,{});t.look!==`handDrawn`&&(M.roughness=0,M.fillStyle=`solid`);let N=0;x.length>0&&(N=x.reduce((e,t)=>e+(t?.rowHeight??0),0));let P=Math.max(k.width+d*2,t?.width||0,A),F=Math.max((N??0)+v.height,t?.height||0),I=-P/2,L=-F/2;if(_.selectAll(`g:not(:first-child)`).each((e,t,n)=>{let r=$c(n[t]),i=r.attr(`transform`),a=0,o=0;if(i){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(i);e&&(a=parseFloat(e[1]),o=parseFloat(e[2]),r.attr(`class`).includes(`attribute-name`)?a+=S:r.attr(`class`).includes(`attribute-keys`)?a+=S+C:r.attr(`class`).includes(`attribute-comment`)&&(a+=S+C+w))}r.attr(`transform`,`translate(${I+d/2+a}, ${o+L+v.height+f/2})`)}),_.select(`.name`).attr(`transform`,`translate(`+-v.width/2+`, `+(L+f/2)+`)`),r!=null&&M_.has(r)){let e=n.colorIndex??0;_.attr(`data-color-id`,`color-${e%l.length}`)}let R=j.rectangle(I,L,P,F,M),ee=_.insert(()=>R,`:first-child`).attr(`class`,`outer-path`).attr(`style`,p.join(``));b.push(0);for(let[e,t]of x.entries()){let n=(e+1)%2==0&&t.yOffset!==0,r=j.rectangle(I,v.height+L+t?.yOffset,P,t?.rowHeight,{...M,fill:n?a:o,stroke:s});_.insert(()=>r,`g.label`).attr(`style`,p.join(``)).attr(`class`,`row-rect-${n?`even`:`odd`}`)}let z=1e-4,B=$g(I,v.height+L,P+I,v.height+L,z),te=j.polygon(B.map(e=>[e.x,e.y]),M);if(_.insert(()=>te).attr(`class`,`divider`),B=$g(S+I,v.height+L,S+I,F+L,z),te=j.polygon(B.map(e=>[e.x,e.y]),M),_.insert(()=>te).attr(`class`,`divider`),E){let e=S+C+I;B=$g(e,v.height+L,e,F+L,z),te=j.polygon(B.map(e=>[e.x,e.y]),M),_.insert(()=>te).attr(`class`,`divider`)}if(D){let e=S+C+w+I;B=$g(e,v.height+L,e,F+L,z),te=j.polygon(B.map(e=>[e.x,e.y]),M),_.insert(()=>te).attr(`class`,`divider`)}for(let e of b){let t=v.height+L+e;B=$g(I,t,P+I,t,z),te=j.polygon(B.map(e=>[e.x,e.y]),M),_.insert(()=>te).attr(`class`,`divider`)}if(a_(t,ee),h&&t.look!==`handDrawn`){if(r!=null&&$ve.has(r))_.selectAll(`path`).attr(`style`,h);else{let e=h.split(`;`)?.filter(e=>e.includes(`stroke`))?.map(e=>`${e}`).join(`; `);_.selectAll(`path`).attr(`style`,e??``),_.selectAll(`.row-rect-even path`).attr(`style`,h)}}return t.intersect=function(e){return d_.rect(t,e)},_}async function Qg(e,t,n,r=0,i=0,a=[],o=``){let s=e.insert(`g`).attr(`class`,`label ${a.join(` `)}`).attr(`transform`,`translate(${r}, ${i})`).attr(`style`,o);t!==Ps(t)&&(t=Ps(t),t=t.replaceAll(`<`,`<`).replaceAll(`>`,`>`));let l=s.node().appendChild(await rg(s,t,{width:Bm(t,n)+100,style:o,useHtmlLabels:n.htmlLabels},n));if(t.includes(`<`)||t.includes(`>`)){let e=l.children[0];for(e.textContent=e.textContent.replaceAll(`<`,`<`).replaceAll(`>`,`>`);e.childNodes[0];)e=e.childNodes[0],e.textContent=e.textContent.replaceAll(`<`,`<`).replaceAll(`>`,`>`)}let u=l.getBBox();if(os(n.htmlLabels)){let e=l.children[0];e.style.textAlign=`start`;let t=$c(l);u=e.getBoundingClientRect(),t.attr(`width`,u.width),t.attr(`height`,u.height)}return u}function $g(e,t,n,r,i){return e===n?[{x:e-i/2,y:t},{x:e+i/2,y:t},{x:n+i/2,y:r},{x:n-i/2,y:r}]:[{x:e,y:t-i/2},{x:e,y:t+i/2},{x:n,y:r+i/2},{x:n,y:r-i/2}]}async function xve(e,t,n,r,i=n.class.padding??12){let a=r?0:3,o=e.insert(`g`).attr(`class`,o_(t)).attr(`id`,t.domId||t.id),s=null,l=null,u=null,d=null,f=0,p=0,m=0;if(s=o.insert(`g`).attr(`class`,`annotation-group text`),t.annotations.length>0){let e=t.annotations[0];await e_(s,{text:`\xAB${e}\xBB`},0),f=s.node().getBBox().height}l=o.insert(`g`).attr(`class`,`label-group text`),await e_(l,t,0,[`font-weight: bolder`]);let h=l.node().getBBox();p=h.height,u=o.insert(`g`).attr(`class`,`members-group text`);let g=0;for(let e of t.members){let t=await e_(u,e,g,[e.parseClassifier()]);g+=t+a}m=u.node().getBBox().height,m<=0&&(m=i/2),d=o.insert(`g`).attr(`class`,`methods-group text`);let _=0;for(let e of t.methods){let t=await e_(d,e,_,[e.parseClassifier()]);_+=t+a}let v=o.node().getBBox();if(s!==null){let e=s.node().getBBox();s.attr(`transform`,`translate(${-e.width/2})`)}return l.attr(`transform`,`translate(${-h.width/2}, ${f})`),v=o.node().getBBox(),u.attr(`transform`,`translate(0, ${f+p+i*2})`),v=o.node().getBBox(),d.attr(`transform`,`translate(0, ${f+p+(m?m+i*4:i*2)})`),v=o.node().getBBox(),{shapeSvg:o,bbox:v}}async function e_(e,t,n,r=[]){let i=e.insert(`g`).attr(`class`,`label`).attr(`style`,r.join(`; `)),a=ms(),o=`useHtmlLabels`in t?t.useHtmlLabels:os(a.htmlLabels)??!0,s=``;s=`text`in t?t.text:t.label,!o&&s.startsWith(`\\`)&&(s=s.substring(1)),Rs(s)&&(o=!0);let l=await rg(i,oc(th(s)),{width:Bm(s,a)+50,classes:`markdown-node-label`,useHtmlLabels:o},a),u,d=1;if(o){let e=l.children[0],t=$c(l);d=e.innerHTML.split(`<br>`).length,e.innerHTML.includes(`</math>`)&&(d+=e.innerHTML.split(`<mrow>`).length-1),await Lg(e),u=e.getBoundingClientRect(),t.attr(`width`,u.width),t.attr(`height`,u.height)}else{r.includes(`font-weight: bolder`)&&$c(l).selectAll(`tspan`).attr(`font-weight`,``),d=l.children.length;let e=l.children[0];(l.textContent===``||l.textContent.includes(`>`))&&(e.textContent=s[0]+s.substring(1).replaceAll(`>`,`>`).replaceAll(`<`,`<`).trim(),s[1]===` `&&(e.textContent=e.textContent[0]+` `+e.textContent.substring(1))),e.textContent===`undefined`&&(e.textContent=``),u=l.getBBox()}return i.attr(`transform`,`translate(0,`+(-u.height/(2*d)+n)+`)`),u.height}async function Sve(e,t){let n=Z(),{themeVariables:r}=n,{useGradient:i}=r,a=n.class.padding??12,o=a,s=t.useHtmlLabels??os(n.htmlLabels)??!0,l=t;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];let{shapeSvg:u,bbox:d}=await xve(e,t,n,s,o),{labelStyles:f,nodeStyles:p}=Tp(t);t.labelStyle=f,t.cssStyles=l.styles||``;let m=l.styles?.join(`;`)||p||``;t.cssStyles||=m.replaceAll(`!important`,``).split(`;`);let h=l.members.length===0&&l.methods.length===0&&!n.class?.hideEmptyMembersBox,g=Fg.svg(u),_=Ep(t,{});t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let v=Math.max(t.width??0,d.width),y=Math.max(t.height??0,d.height),b=(t.height??0)>d.height;l.members.length===0&&l.methods.length===0?y+=o:l.members.length>0&&l.methods.length===0&&(y+=o*2);let x=-v/2,S=-y/2,C=h?a*2:l.members.length===0&&l.methods.length===0?-a:0;b&&(C=a*2);let w=g.rectangle(x-a,S-a-(h?a:l.members.length===0&&l.methods.length===0?-a/2:0),v+2*a,y+2*a+C,_),T=u.insert(()=>w,`:first-child`);T.attr(`class`,`basic label-container outer-path`);let E=T.node().getBBox(),D=u.select(`.annotation-group`).node().getBBox().height-(h?a/2:0)||0,O=u.select(`.label-group`).node().getBBox().height-(h?a/2:0)||0,k=u.select(`.members-group`).node().getBBox().height-(h?a/2:0)||0,A=(D+O+S+a-(S-a-(h?a:l.members.length===0&&l.methods.length===0?-a/2:0)))/2;if(u.selectAll(`.text`).each((e,t,r)=>{let i=$c(r[t]),d=i.attr(`transform`),f=0;if(d){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(d);e&&(f=parseFloat(e[2]))}let p=f+S+a-(h?a:l.members.length===0&&l.methods.length===0?-a/2:0);if(i.attr(`class`).includes(`methods-group`)){let e=Math.max(k,o/2);p=b?Math.max(A,D+O+e+S+o*2+a)+o*2:D+O+e+S+o*4+a}l.members.length===0&&l.methods.length===0&&n.class?.hideEmptyMembersBox&&(p=l.annotations.length>0?f-o:f),s||(p-=4);let m=x;(i.attr(`class`).includes(`label-group`)||i.attr(`class`).includes(`annotation-group`))&&(m=-i.node()?.getBBox().width/2||0,u.selectAll(`text`).each(function(e,t,n){window.getComputedStyle(n[t]).textAnchor===`middle`&&(m=0)})),i.attr(`transform`,`translate(${m}, ${p})`)}),l.members.length>0||l.methods.length>0||h){let e=D+O+S+a,n=g.line(E.x,e,E.x+E.width,e+.001,_);u.insert(()=>n).attr(`class`,`divider${t.look===`neo`&&!i?` neo-line`:``}`).attr(`style`,m)}if(h||l.members.length>0||l.methods.length>0){let e=D+O+k+S+o*2+a,n=g.line(E.x,b?Math.max(A,e):e,E.x+E.width,(b?Math.max(A,e):e)+.001,_);u.insert(()=>n).attr(`class`,`divider${t.look===`neo`&&!i?` neo-line`:``}`).attr(`style`,m)}if(l.look!==`handDrawn`&&u.selectAll(`path`).attr(`style`,m),T.select(`:nth-child(2)`).attr(`style`,m),u.selectAll(`.divider`).select(`path`).attr(`style`,m),t.labelStyle?u.selectAll(`span`).attr(`style`,t.labelStyle):u.selectAll(`span`).attr(`style`,m),!s){let e=RegExp(/color\s*:\s*([^;]*)/),t=e.exec(m);if(t){let e=t[0].replace(`color`,`fill`);u.selectAll(`tspan`).attr(`style`,e)}else if(f){let t=e.exec(f);if(t){let e=t[0].replace(`color`,`fill`);u.selectAll(`tspan`).attr(`style`,e)}}}return a_(t,T),t.intersect=function(e){return d_.rect(t,e)},u}async function Cve(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let i=t,a=t,o=`verifyMethod`in t,s=o_(t),l=Z(),{themeVariables:u}=l,{borderColorArray:d,requirementEdgeLabelBackground:f}=u,p=l.layout===`elk`?`start`:`center`,m=e.insert(`g`).attr(`class`,s).attr(`id`,t.domId??t.id),h;h=o?await t_(m,`<<${i.type}>>`,0,t.labelStyle):await t_(m,`<<Element>>`,0,t.labelStyle);let g=h,_=await t_(m,i.name,g,t.labelStyle+`; font-weight: bold;`);if(g+=_+20,o){let e=await t_(m,`${i.requirementId?`ID: ${i.requirementId}`:``}`,g,t.labelStyle,p);g+=e;let n=await t_(m,`${i.text?`Text: ${i.text}`:``}`,g,t.labelStyle,p);g+=n;let r=await t_(m,`${i.risk?`Risk: ${i.risk}`:``}`,g,t.labelStyle,p);g+=r,await t_(m,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:``}`,g,t.labelStyle,p)}else{let e=await t_(m,`${a.type?`Type: ${a.type}`:``}`,g,t.labelStyle,p);g+=e,await t_(m,`${a.docRef?`Doc Ref: ${a.docRef}`:``}`,g,t.labelStyle,p)}let v=(m.node()?.getBBox().width??200)+20,y=(m.node()?.getBBox().height??200)+20,b=-v/2,x=-y/2,S=Fg.svg(m),C=Ep(t,{});t.look!==`handDrawn`&&(C.roughness=0,C.fillStyle=`solid`);let w=S.rectangle(b,x,v,y,C),T=m.insert(()=>w,`:first-child`);if(T.attr(`class`,`basic label-container outer-path`).attr(`style`,r),d?.length){let e=t.colorIndex??0;m.attr(`data-color-id`,`color-${e%d.length}`)}if(m.selectAll(`.label`).each((e,t,n)=>{let r=$c(n[t]),i=r.attr(`transform`),a=0,o=0;if(i){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(i);e&&(a=parseFloat(e[1]),o=parseFloat(e[2]))}let s=o-y/2,l=b+10;(t===0||t===1)&&(l=a),r.attr(`transform`,`translate(${l}, ${s+20})`)}),g>h+_+20){let e=x+h+_+20,n;if(t.look===`neo`){let t=.001,r=[[b,e],[b+v,e],[b+v,e+t],[b,e+t]];n=S.polygon(r,C)}else n=S.line(b,e,b+v,e,C);m.insert(()=>n).attr(`class`,`divider`)}return a_(t,T),t.intersect=function(e){return d_.rect(t,e)},r&&t.look!==`handDrawn`&&(f||d?.length)&&m.selectAll(`path`).attr(`style`,r),m}async function t_(e,t,n,r=``,i=`center`){if(t===``)return 0;let a=e.insert(`g`).attr(`class`,`label`).attr(`style`,r),o=Z(),s=o.htmlLabels??!0,l=await rg(a,oc(th(t)),{width:Bm(t,o)+50,classes:`markdown-node-label`,useHtmlLabels:s,style:r},o),u;if(s){let e=l.children[0],t=$c(l);i===`start`&&$c(e).style(`text-align`,`left`),u=e.getBoundingClientRect(),t.attr(`width`,u.width),t.attr(`height`,u.height)}else{let e=l.children[0];for(let t of e.children)r&&t.setAttribute(`style`,r);if(i===`start`){e.setAttribute(`text-anchor`,`start`);for(let t of e.children)t.setAttribute(`text-anchor`,`start`)}u=l.getBBox(),u.height+=6}return a.attr(`transform`,`translate(${-u.width/2},${-u.height/2+n})`),u.height}async function wve(e,t,{config:n}){let{labelStyles:r,nodeStyles:i}=Tp(t);t.labelStyle=r||``;let a=t.width;t.width=(t.width??200)-10;let{shapeSvg:o,bbox:s,label:l}=await r_(e,t,o_(t)),u=t.padding||10,d=``,f;`ticket`in t&&t.ticket&&n?.kanban?.ticketBaseUrl&&(d=n?.kanban?.ticketBaseUrl.replace(`#TICKET#`,t.ticket),f=o.insert(`svg:a`,`:first-child`).attr(`class`,`kanban-ticket-link`).attr(`xlink:href`,d).attr(`target`,`_blank`));let p={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||``,width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},m,h;f?{label:m,bbox:h}=await i_(f,`ticket`in t&&t.ticket||``,p):{label:m,bbox:h}=await i_(o,`ticket`in t&&t.ticket||``,p);let{label:g,bbox:_}=await i_(o,`assigned`in t&&t.assigned||``,p);t.width=a;let v=t?.width||0,y=Math.max(h.height,_.height)/2,b=Math.max(s.height+20,t?.height||0)+y,x=-v/2,S=-b/2;l.attr(`transform`,`translate(`+(u-v/2)+`, `+(-y-s.height/2)+`)`),m.attr(`transform`,`translate(`+(u-v/2)+`, `+(-y+s.height/2)+`)`),g.attr(`transform`,`translate(`+(u+v/2-_.width-20)+`, `+(-y+s.height/2)+`)`);let C,{rx:w,ry:T}=t,{cssStyles:E}=t;if(t.look===`handDrawn`){let e=Fg.svg(o),n=Ep(t,{}),r=w||T?e.path(c_(x,S,v,b,w||0),n):e.rectangle(x,S,v,b,n);C=o.insert(()=>r,`:first-child`),C.attr(`class`,`basic label-container`).attr(`style`,E||null)}else{C=o.insert(`rect`,`:first-child`),C.attr(`class`,`basic label-container __APA__`).attr(`style`,i).attr(`rx`,w??5).attr(`ry`,T??5).attr(`x`,x).attr(`y`,S).attr(`width`,v).attr(`height`,b);let e=`priority`in t&&t.priority;if(e){let t=o.append(`line`),n=x+2,r=S+Math.floor((w??0)/2),i=S+b-Math.floor((w??0)/2);t.attr(`x1`,n).attr(`y1`,r).attr(`x2`,n).attr(`y2`,i).attr(`stroke-width`,`4`).attr(`stroke`,eye(e))}}return a_(t,C),t.height=b,t.intersect=function(e){return d_.rect(t,e)},o}async function Tve(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await r_(e,t,o_(t)),l=a.width+10*o,u=a.height+8*o,d=.15*l,{cssStyles:f}=t,p=a.width+20,m=a.height+20,h=Math.max(l,p),g=Math.max(u,m);s.attr(`transform`,`translate(${-a.width/2}, ${-a.height/2})`);let _,v=`M0 0 459+ a${d},${d} 1 0,0 ${h*.25},${-1*g*.1}460+ a${d},${d} 1 0,0 ${h*.25},0461+ a${d},${d} 1 0,0 ${h*.25},0462+ a${d},${d} 1 0,0 ${h*.25},${g*.1}463+464+ a${d},${d} 1 0,0 ${h*.15},${g*.33}465+ a${d*.8},${d*.8} 1 0,0 0,${g*.34}466+ a${d},${d} 1 0,0 ${-1*h*.15},${g*.33}467+468+ a${d},${d} 1 0,0 ${-1*h*.25},${g*.15}469+ a${d},${d} 1 0,0 ${-1*h*.25},0470+ a${d},${d} 1 0,0 ${-1*h*.25},0471+ a${d},${d} 1 0,0 ${-1*h*.25},${-1*g*.15}472+473+ a${d},${d} 1 0,0 ${-1*h*.1},${-1*g*.33}474+ a${d*.8},${d*.8} 1 0,0 0,${-1*g*.34}475+ a${d},${d} 1 0,0 ${h*.1},${-1*g*.33}476+ H0 V0 Z`;if(t.look===`handDrawn`){let e=Fg.svg(i),n=Ep(t,{}),r=e.path(v,n);_=i.insert(()=>r,`:first-child`),_.attr(`class`,`basic label-container`).attr(`style`,Um(f))}else _=i.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,r).attr(`d`,v);return _.attr(`transform`,`translate(${-h/2}, ${-g/2})`),a_(t,_),t.calcIntersect=function(e,t){return d_.rect(e,t)},t.intersect=function(e){return y.info(`Bang intersect`,t,e),d_.rect(t,e)},i}async function Eve(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await r_(e,t,o_(t)),l=a.width+2*o,u=a.height+2*o,d=.15*l,f=.25*l,p=.35*l,m=.2*l,{cssStyles:h}=t,g,_=`M0 0 477+ a${d},${d} 0 0,1 ${l*.25},${-1*l*.1}478+ a${p},${p} 1 0,1 ${l*.4},${-1*l*.1}479+ a${f},${f} 1 0,1 ${l*.35},${l*.2}480+481+ a${d},${d} 1 0,1 ${l*.15},${u*.35}482+ a${m},${m} 1 0,1 ${-1*l*.15},${u*.65}483+484+ a${f},${d} 1 0,1 ${-1*l*.25},${l*.15}485+ a${p},${p} 1 0,1 ${-1*l*.5},0486+ a${d},${d} 1 0,1 ${-1*l*.25},${-1*l*.15}487+488+ a${d},${d} 1 0,1 ${-1*l*.1},${-1*u*.35}489+ a${m},${m} 1 0,1 ${l*.1},${-1*u*.65}490+ H0 V0 Z`;if(t.look===`handDrawn`){let e=Fg.svg(i),n=Ep(t,{}),r=e.path(_,n);g=i.insert(()=>r,`:first-child`),g.attr(`class`,`basic label-container`).attr(`style`,Um(h))}else g=i.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,r).attr(`d`,_);return s.attr(`transform`,`translate(${-a.width/2}, ${-a.height/2})`),g.attr(`transform`,`translate(${-l/2}, ${-u/2})`),a_(t,g),t.calcIntersect=function(e,t){return d_.rect(e,t)},t.intersect=function(e){return y.info(`Cloud intersect`,t,e),d_.rect(t,e)},i}async function Dve(e,t){let{labelStyles:n,nodeStyles:r}=Tp(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await r_(e,t,o_(t)),l=a.width+8*o,u=a.height+2*o,d=t.look===`neo`?`491+ M${-l/2} ${u/2-5}492+ v${-u+10}493+ q0,-5 5,-5494+ h${l-10}495+ q5,0 5,5496+ v${u-5}497+ H${-l/2}498+ Z499+ `:`500+ M${-l/2} ${u/2-5}501+ v${-u+10}502+ q0,-5 5,-5503+ h${l-10}504+ q5,0 5,5505+ v${u-10}506+ q0,5 -5,5507+ h${-(l-10)}508+ q-5,0 -5,-5509+ Z510+ `;if(!t.domId)throw Error(`defaultMindmapNode: node "${t.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`);let f=i.append(`path`).attr(`id`,t.domId).attr(`class`,`node-bkg node-`+t.type).attr(`style`,r).attr(`d`,d);return i.append(`line`).attr(`class`,`node-line-`).attr(`x1`,-l/2).attr(`y1`,u/2).attr(`x2`,l/2).attr(`y2`,u/2),s.attr(`transform`,`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>s.node()),a_(t,f),t.calcIntersect=function(e,t){return d_.rect(e,t)},t.intersect=function(e){return d_.rect(t,e)},i}async function Ove(e,t){return Kg(e,t,{padding:t.padding??0})}function kve(e){return e in N_}var Ave,jve,n_,Mve,Nve,r_,i_,a_,o_,s_,c_,l_,Pve,u_,Fve,Ive,d_,f_,p_,Lve,m_,Rve,h_,zve,Bve,g_,Vve,__,Hve,Uve,Wve,v_,y_,b_,x_,Gve,Kve,qve,Jve,S_,C_,Yve,w_,T_,E_,Xve,Zve,Qve,D_,O_,k_,A_,j_,M_,$ve,eye,tye,N_,P_=o((()=>{Op(),ig(),Gp(),rh(),dc(),S(),h(),_p(),Ig(),Ave=1,jve=3,p(Lg,`configureLabelImages`),p(Rg,`hasTextBesidesImages`),n_=3,Mve=32,Nve=p(async(e,t,n)=>{let r=Z(),i=e.insert(`g`).attr(`class`,n??`node default`).attr(`id`,t.domId||t.id),a=i.insert(`g`).attr(`class`,`label`).attr(`style`,Um(t.labelStyle)),o=[{text:typeof t.label==`string`?t.label:t.label?.[0]??``,cssClass:`c4-name`},{text:t.stereotype,cssClass:`c4-type`},...(t.description??[]).map(e=>({text:e,cssClass:`c4-descr`}))].filter(e=>e.text),s=t.width?Math.max(t.width-2*(t.padding??0),Mve):Z().flowchart?.wrappingWidth??200,l=r.wrap?s:1/0,u=await Promise.all(o.map(async e=>{let n=a.append(`g`).attr(`class`,e.cssClass),i=await rg(n,js(th(e.text??``),r),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:l,style:t.labelStyle},r);return $c(i).selectAll(`tspan.text-outer-tspan`).attr(`text-anchor`,`middle`),$c(i).selectAll(`tspan.text-inner-tspan`).attr(`font-weight`,null).attr(`font-style`,null),{el:n,box:n.node().getBBox()}})),d=Math.max(...u.map(({box:e})=>e.width),0),f=0;for(let{el:e,box:t}of u)e.attr(`transform`,`translate(${d/2-t.x-t.width/2}, ${f-t.y})`),f+=t.height+n_;let p=u.length>0?f-n_:0;return a.insert(`rect`,`:first-child`),a.attr(`transform`,`translate(${-d/2}, ${-p/2})`),{shapeSvg:i,bbox:a.node().getBBox(),halfPadding:(t.padding??0)/2,label:a}},`c4LabelHelper`),r_=p(async(e,t,n)=>{if(t.stereotype!==void 0)return Nve(e,t,n);let r,i=t.useHtmlLabels||os(Z()?.htmlLabels);r=n||`node default`;let a=e.insert(`g`).attr(`class`,r).attr(`id`,t.domId||t.id),o=a.insert(`g`).attr(`class`,`label`).attr(`style`,Um(t.labelStyle)),s;s=t.label===void 0?``:typeof t.label==`string`?t.label:t.label[0];let l=!!t.icon||!!t.img,u=t.labelType===`markdown`,d=await rg(o,js(th(s),Z()),{useHtmlLabels:i,width:t.width||t.wrappingWidth||Z().flowchart?.wrappingWidth,classes:u?`markdown-node-label`:``,style:t.labelStyle,addSvgBackground:l,markdown:u},Z()),f=(t?.padding??0)/2,p;if(i){let e=d.children[0],t=$c(d);await Lg(e),p=await tg.measure(()=>e.getBoundingClientRect()),t.attr(`width`,p.width),t.attr(`height`,p.height)}else p=await tg.measure(()=>d.getBBox());return i?o.attr(`transform`,`translate(`+-p.width/2+`, `+-p.height/2+`)`):o.attr(`transform`,`translate(0, `+-p.height/2+`)`),t.centerLabel&&o.attr(`transform`,`translate(`+-p.width/2+`, `+-p.height/2+`)`),o.insert(`rect`,`:first-child`),{shapeSvg:a,bbox:p,halfPadding:f,label:o}},`labelHelper`),i_=p(async(e,t,n)=>{let r=n.useHtmlLabels??bs(Z()),i=e.insert(`g`).attr(`class`,`label`).attr(`style`,n.labelStyle||``),a=await rg(i,js(th(t),Z()),{useHtmlLabels:r,width:n.width||Z()?.flowchart?.wrappingWidth,style:n.labelStyle,addSvgBackground:!!n.icon||!!n.img}),o=n.padding/2,s;if(bs(Z())){let e=a.children[0],t=$c(a);s=await tg.measure(()=>e.getBoundingClientRect()),t.attr(`width`,s.width),t.attr(`height`,s.height)}else s=await tg.measure(()=>a.getBBox());return r?i.attr(`transform`,`translate(`+-s.width/2+`, `+-s.height/2+`)`):i.attr(`transform`,`translate(0, `+-s.height/2+`)`),n.centerLabel&&i.attr(`transform`,`translate(`+-s.width/2+`, `+-s.height/2+`)`),i.insert(`rect`,`:first-child`),{shapeSvg:e,bbox:s,halfPadding:o,label:i}},`insertLabel`),a_=p((e,t,n)=>{if(n){e.width=n.width,e.height=n.height;return}let r=t.node().getBBox();e.width=r.width,e.height=r.height},`updateNodeBounds`),o_=p((e,t)=>(e.look===`handDrawn`?`rough-node`:`node`)+` `+e.cssClasses+` `+(t||``),`getNodeClasses`),p(zg,`createPathFromPoints`),p(Bg,`generateFullSineWavePoints`),p(Vg,`generateCirclePoints`),p(Hg,`mergePaths`),s_=p((e,t)=>{var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2,l,u;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),l=a===0?0:s*i/a,u=s):(i<0&&(o=-o),l=o,u=i===0?0:o*a/i),{x:n+l,y:r+u}},`intersectRect`),c_=p((e,t,n,r,i)=>[`M`,e+i,t,`H`,e+n-i,`A`,i,i,0,0,1,e+n,t+i,`V`,t+r-i,`A`,i,i,0,0,1,e+n-i,t+r,`H`,e+i,`A`,i,i,0,0,1,e,t+r-i,`V`,t+i,`A`,i,i,0,0,1,e+i,t,`Z`].join(` `),`createRoundedRectPathD`),l_=p(async(e,t,n,r=!1,i=!1)=>{let a=t||``;typeof a==`object`&&(a=a[0]);let o=Z(),s=bs(o);return await rg(e,a,{style:n,isTitle:r,useHtmlLabels:s,markdown:!1,isNode:i,width:1/0},o)},`createLabel`),p(i_e,`intersectNode`),Pve=i_e,p(a_e,`intersectEllipse`),u_=a_e,p(o_e,`intersectCircle`),Fve=o_e,p(s_e,`intersectLine`),p(Ug,`sameSign`),Ive=s_e,p(c_e,`intersectPolygon`),d_={node:Pve,circle:Fve,ellipse:u_,polygon:c_e,rect:s_},p(l_e,`anchor`),p(Wg,`generateArcPoints`),p(u_e,`calculateArcSagitta`),p(d_e,`bowTieRect`),p(f_e,`bucket`),f_=20,p_=8,Lve=80,m_=8,p(p_e,`collapsedGroup`),p(Gg,`insertPolygonShape`),Rve=[`right`,`left`,`up`,`down`],h_=`point`,zve=p(e=>{let t=new Set;for(let n of e)switch(n){case`x`:t.add(`right`),t.add(`left`);break;case`y`:t.add(`up`),t.add(`down`);break;default:t.add(n)}return t},`expandAndDeduplicateDirections`),Bve=p(e=>Rve.filter(t=>e.has(t)).join(`|`)||h_,`getDirectionKey`),g_={"right|left|up|down":p(({height:e,midpoint:t,padding:n,width:r})=>[{x:0,y:0},{x:t,y:0},{x:r/2,y:2*n},{x:r-t,y:0},{x:r,y:0},{x:r,y:-e/3},{x:r+2*n,y:-e/2},{x:r,y:-2*e/3},{x:r,y:-e},{x:r-t,y:-e},{x:r/2,y:-e-2*n},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*n,y:-e/2},{x:0,y:-e/3}],`right|left|up|down`),"right|left|up":p(({height:e,midpoint:t,width:n})=>[{x:t,y:0},{x:n-t,y:0},{x:n,y:-e/2},{x:n-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],`right|left|up`),"right|left|down":p(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:t,y:-e},{x:n-t,y:-e},{x:n,y:0}],`right|left|down`),"right|up|down":p(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:n,y:-e+t},{x:0,y:-e}],`right|up|down`),"left|up|down":p(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:n,y:-e}],`left|up|down`),"right|left":p(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`right|left`),"up|down":p(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`up|down`),"right|up":p(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:0,y:-e}],`right|up`),"right|down":p(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],`right|down`),"left|up":p(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:n,y:-e}],`left|up`),"left|down":p(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],`left|down`),right:p(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e+n}],`right`),left:p(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`left`),up:p(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n}],`up`),down:p(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`down`),[h_]:()=>[{x:0,y:0}]},Vve=p((e,t,n,r)=>{let i=zve(e),a=(n.padding??0)/2,o=t.height+4*a,s=o/2,l=r??t.width+2*s+2*a;return(g_[Bve(i)]??g_[h_])({height:o,midpoint:s,padding:a,width:l})},`getArrowPoints`),p(m_e,`block_arrow`),p(h_e,`browser`),__=12,p(g_e,`card`),p(__e,`choice`),p(Kg,`circle`),p(v_e,`composite`),p(y_e,`consoleWindow`),p(b_e,`createLine`),p(x_e,`crossedCircle`),p(qg,`generateCirclePoints`),p(S_e,`curlyBraceLeft`),p(Jg,`generateCirclePoints`),p(C_e,`curlyBraceRight`),p(Yg,`generateCirclePoints`),p(w_e,`curlyBraces`),p(T_e,`curvedTrapezoid`),p(E_e,`person`),Hve=p((e,t,n,r,i,a)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createCylinderPathD`),Uve=p((e,t,n,r,i,a)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createOuterCylinderPathD`),Wve=p((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),v_=8,y_=8,p(D_e,`cylinder`),p(Xg,`drawRect`),p(O_e,`datastore`),p(k_e,`dividedRectangle`),p(A_e,`doublecircle`),p(j_e,`filledCircle`),b_=10,x_=10,p(M_e,`flippedTriangle`),p(N_e,`folder`),p(P_e,`forkJoin`),p(F_e,`halfRoundedRectangle`),Gve=p((e,t,n,r,i)=>[`M${e+i},${t}`,`L${e+n-i},${t}`,`L${e+n},${t-r/2}`,`L${e+n-i},${t-r}`,`L${e+i},${t-r}`,`L${e},${t-r/2}`,`Z`].join(` `),`createHexagonPathD`),p(I_e,`hexagon`),p(L_e,`hourglass`),p(R_e,`icon`),p(z_e,`iconCircle`),p(B_e,`iconRounded`),p(V_e,`iconSquare`),p(H_e,`imageSquare`),p(U_e,`inv_trapezoid`),p(W_e,`labelRect`),p(G_e,`lean_left`),p(K_e,`lean_right`),p(q_e,`lightningBolt`),Kve=p((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createCylinderPathD`),qve=p((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createOuterCylinderPathD`),Jve=p((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),S_=10,C_=10,p(J_e,`linedCylinder`),p(Y_e,`linedWaveEdgedRect`),p(X_e,`multiRect`),p(Z_e,`multiWaveEdgedRectangle`),p(Q_e,`note`),Yve=p((e,t,n)=>[`M${e+n/2},${t}`,`L${e+n},${t-n/2}`,`L${e+n/2},${t-n}`,`L${e},${t-n/2}`,`Z`].join(` `),`createDecisionBoxPathD`),p($_e,`question`),p(eve,`rect_left_inv_arrow`),p(tve,`rectWithTitle`),p(nve,`roundedRect`),w_=8,p(rve,`shadedProcess`),p(ive,`slopedRect`),p(ave,`squareRect`),p(ove,`stadium`),p(sve,`state`),p(cve,`stateEnd`),p(lve,`stateStart`),T_=8,p(uve,`subroutine`),E_=.2,p(dve,`taggedRect`),p(fve,`taggedWaveEdgedRectangle`),p(pve,`text`),Xve=p((e,t,n,r,i,a)=>`M${e},${t}511+ a${i},${a} 0,0,1 0,${-r}512+ l${n},0513+ a${i},${a} 0,0,1 0,${r}514+ M${n},${-r}515+ a${i},${a} 0,0,0 0,${r}516+ l${-n},0`,`createCylinderPathD`),Zve=p((e,t,n,r,i,a)=>[`M${e},${t}`,`M${e+n},${t}`,`a${i},${a} 0,0,0 0,${-r}`,`l${-n},0`,`a${i},${a} 0,0,0 0,${r}`,`l${n},0`].join(` `),`createOuterCylinderPathD`),Qve=p((e,t,n,r,i,a)=>[`M${e+n/2},${-r/2}`,`a${i},${a} 0,0,0 0,${r}`].join(` `),`createInnerCylinderPathD`),D_=5,O_=10,p(mve,`tiltedCylinder`),p(hve,`trapezoid`),p(gve,`trapezoidalPentagon`),k_=10,A_=10,p(_ve,`triangle`),p(vve,`waveEdgedRectangle`),p(yve,`waveRectangle`),j_=10,p(bve,`windowPane`),M_=new Set([`redux-color`,`redux-dark-color`]),$ve=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]),p(Zg,`erBox`),p(Qg,`addText`),p($g,`lineToPolygon`),p(xve,`textHelper`),p(e_,`addText`),p(Sve,`classBox`),p(Cve,`requirementBox`),p(t_,`addText`),eye=p(e=>{switch(e){case`Very High`:return`red`;case`High`:return`orange`;case`Medium`:return null;case`Low`:return`blue`;case`Very Low`:return`lightblue`}},`colorFromPriority`),p(wve,`kanbanItem`),p(Tve,`bang`),p(Eve,`cloud`),p(Dve,`defaultMindmapNode`),p(Ove,`mindmapCircle`),tye=[{semanticName:`Process`,name:`Rectangle`,shortName:`rect`,description:`Standard process shape`,aliases:[`proc`,`process`,`rectangle`],internalAliases:[`squareRect`],handler:ave},{semanticName:`Event`,name:`Rounded Rectangle`,shortName:`rounded`,description:`Represents an event`,aliases:[`event`],internalAliases:[`roundedRect`],handler:nve},{semanticName:`Terminal Point`,name:`Stadium`,shortName:`stadium`,description:`Terminal point`,aliases:[`terminal`,`pill`],handler:ove},{semanticName:`Subprocess`,name:`Framed Rectangle`,shortName:`fr-rect`,description:`Subprocess`,aliases:[`subprocess`,`subproc`,`framed-rectangle`,`subroutine`],handler:uve},{semanticName:`Database`,name:`Cylinder`,shortName:`cyl`,description:`Database storage`,aliases:[`db`,`database`,`cylinder`],handler:D_e},{semanticName:`Data Store`,name:`Data Store`,shortName:`datastore`,description:`Data flow diagram data store`,aliases:[`data-store`],handler:O_e},{semanticName:`Folder`,name:`Folder`,shortName:`folder`,description:`Folder or directory`,aliases:[`directory`],handler:N_e},{semanticName:`Bucket`,name:`Bucket`,shortName:`bucket`,description:`Object storage bucket`,handler:f_e},{semanticName:`Console`,name:`Console (terminal window)`,shortName:`console`,description:`Terminal or console window`,handler:y_e},{semanticName:`Browser`,name:`Browser`,shortName:`browser`,description:`Browser window`,handler:h_e},{semanticName:`Person`,name:`Person`,shortName:`person`,description:`Person (circular head above a rounded body)`,handler:E_e},{semanticName:`Start`,name:`Circle`,shortName:`circle`,description:`Starting point`,aliases:[`circ`],handler:Kg},{semanticName:`Bang`,name:`Bang`,shortName:`bang`,description:`Bang`,aliases:[`bang`],handler:Tve},{semanticName:`Cloud`,name:`Cloud`,shortName:`cloud`,description:`cloud`,aliases:[`cloud`],handler:Eve},{semanticName:`Decision`,name:`Diamond`,shortName:`diam`,description:`Decision-making step`,aliases:[`decision`,`diamond`,`question`],handler:$_e},{semanticName:`Prepare Conditional`,name:`Hexagon`,shortName:`hex`,description:`Preparation or condition step`,aliases:[`hexagon`,`prepare`],handler:I_e},{semanticName:`Data Input/Output`,name:`Lean Right`,shortName:`lean-r`,description:`Represents input or output`,aliases:[`lean-right`,`in-out`],internalAliases:[`lean_right`],handler:K_e},{semanticName:`Data Input/Output`,name:`Lean Left`,shortName:`lean-l`,description:`Represents output or input`,aliases:[`lean-left`,`out-in`],internalAliases:[`lean_left`],handler:G_e},{semanticName:`Priority Action`,name:`Trapezoid Base Bottom`,shortName:`trap-b`,description:`Priority action`,aliases:[`priority`,`trapezoid-bottom`,`trapezoid`],handler:hve},{semanticName:`Manual Operation`,name:`Trapezoid Base Top`,shortName:`trap-t`,description:`Represents a manual task`,aliases:[`manual`,`trapezoid-top`,`inv-trapezoid`],internalAliases:[`inv_trapezoid`],handler:U_e},{semanticName:`Stop`,name:`Double Circle`,shortName:`dbl-circ`,description:`Represents a stop point`,aliases:[`double-circle`],internalAliases:[`doublecircle`],handler:A_e},{semanticName:`Text Block`,name:`Text Block`,shortName:`text`,description:`Text block`,handler:pve},{semanticName:`Card`,name:`Notched Rectangle`,shortName:`notch-rect`,description:`Represents a card`,aliases:[`card`,`notched-rectangle`],handler:g_e},{semanticName:`Lined/Shaded Process`,name:`Lined Rectangle`,shortName:`lin-rect`,description:`Lined process shape`,aliases:[`lined-rectangle`,`lined-process`,`lin-proc`,`shaded-process`],handler:rve},{semanticName:`Start`,name:`Small Circle`,shortName:`sm-circ`,description:`Small starting point`,aliases:[`start`,`small-circle`],internalAliases:[`stateStart`],handler:lve},{semanticName:`Stop`,name:`Framed Circle`,shortName:`fr-circ`,description:`Stop point`,aliases:[`stop`,`framed-circle`],internalAliases:[`stateEnd`],handler:cve},{semanticName:`Fork/Join`,name:`Filled Rectangle`,shortName:`fork`,description:`Fork or join in process flow`,aliases:[`join`],internalAliases:[`forkJoin`],handler:P_e},{semanticName:`Collate`,name:`Hourglass`,shortName:`hourglass`,description:`Represents a collate operation`,aliases:[`hourglass`,`collate`],handler:L_e},{semanticName:`Comment`,name:`Curly Brace`,shortName:`brace`,description:`Adds a comment`,aliases:[`comment`,`brace-l`],handler:S_e},{semanticName:`Comment Right`,name:`Curly Brace`,shortName:`brace-r`,description:`Adds a comment`,handler:C_e},{semanticName:`Comment with braces on both sides`,name:`Curly Braces`,shortName:`braces`,description:`Adds a comment`,handler:w_e},{semanticName:`Com Link`,name:`Lightning Bolt`,shortName:`bolt`,description:`Communication link`,aliases:[`com-link`,`lightning-bolt`],handler:q_e},{semanticName:`Document`,name:`Document`,shortName:`doc`,description:`Represents a document`,aliases:[`doc`,`document`],handler:vve},{semanticName:`Delay`,name:`Half-Rounded Rectangle`,shortName:`delay`,description:`Represents a delay`,aliases:[`half-rounded-rectangle`],handler:F_e},{semanticName:`Direct Access Storage`,name:`Horizontal Cylinder`,shortName:`h-cyl`,description:`Direct access storage`,aliases:[`das`,`horizontal-cylinder`],handler:mve},{semanticName:`Disk Storage`,name:`Lined Cylinder`,shortName:`lin-cyl`,description:`Disk storage`,aliases:[`disk`,`lined-cylinder`],handler:J_e},{semanticName:`Display`,name:`Curved Trapezoid`,shortName:`curv-trap`,description:`Represents a display`,aliases:[`curved-trapezoid`,`display`],handler:T_e},{semanticName:`Divided Process`,name:`Divided Rectangle`,shortName:`div-rect`,description:`Divided process shape`,aliases:[`div-proc`,`divided-rectangle`,`divided-process`],handler:k_e},{semanticName:`Extract`,name:`Triangle`,shortName:`tri`,description:`Extraction process`,aliases:[`extract`,`triangle`],handler:_ve},{semanticName:`Internal Storage`,name:`Window Pane`,shortName:`win-pane`,description:`Internal storage`,aliases:[`internal-storage`,`window-pane`],handler:bve},{semanticName:`Junction`,name:`Filled Circle`,shortName:`f-circ`,description:`Junction point`,aliases:[`junction`,`filled-circle`],handler:j_e},{semanticName:`Loop Limit`,name:`Trapezoidal Pentagon`,shortName:`notch-pent`,description:`Loop limit step`,aliases:[`loop-limit`,`notched-pentagon`],handler:gve},{semanticName:`Manual File`,name:`Flipped Triangle`,shortName:`flip-tri`,description:`Manual file operation`,aliases:[`manual-file`,`flipped-triangle`],handler:M_e},{semanticName:`Manual Input`,name:`Sloped Rectangle`,shortName:`sl-rect`,description:`Manual input step`,aliases:[`manual-input`,`sloped-rectangle`],handler:ive},{semanticName:`Multi-Document`,name:`Stacked Document`,shortName:`docs`,description:`Multiple documents`,aliases:[`documents`,`st-doc`,`stacked-document`],handler:Z_e},{semanticName:`Multi-Process`,name:`Stacked Rectangle`,shortName:`st-rect`,description:`Multiple processes`,aliases:[`procs`,`processes`,`stacked-rectangle`],handler:X_e},{semanticName:`Stored Data`,name:`Bow Tie Rectangle`,shortName:`bow-rect`,description:`Stored data`,aliases:[`stored-data`,`bow-tie-rectangle`],handler:d_e},{semanticName:`Summary`,name:`Crossed Circle`,shortName:`cross-circ`,description:`Summary`,aliases:[`summary`,`crossed-circle`],handler:x_e},{semanticName:`Tagged Document`,name:`Tagged Document`,shortName:`tag-doc`,description:`Tagged document`,aliases:[`tag-doc`,`tagged-document`],handler:fve},{semanticName:`Tagged Process`,name:`Tagged Rectangle`,shortName:`tag-rect`,description:`Tagged process`,aliases:[`tagged-rectangle`,`tag-proc`,`tagged-process`],handler:dve},{semanticName:`Paper Tape`,name:`Flag`,shortName:`flag`,description:`Paper tape`,aliases:[`paper-tape`],handler:yve},{semanticName:`Odd`,name:`Odd`,shortName:`odd`,description:`Odd shape`,internalAliases:[`rect_left_inv_arrow`],handler:eve},{semanticName:`Lined Document`,name:`Lined Document`,shortName:`lin-doc`,description:`Lined document`,aliases:[`lined-document`],handler:Y_e}],N_=p(()=>{let e=[...Object.entries({state:sve,choice:__e,note:Q_e,composite:v_e,rectWithTitle:tve,labelRect:W_e,block_arrow:m_e,collapsedGroup:p_e,iconSquare:V_e,iconCircle:z_e,icon:R_e,iconRounded:B_e,imageSquare:H_e,anchor:l_e,kanbanItem:wve,mindmapCircle:Ove,defaultMindmapNode:Dve,classBox:Sve,erBox:Zg,requirementBox:Cve}),...tye.flatMap(e=>[e.shortName,...`aliases`in e?e.aliases:[],...`internalAliases`in e?e.internalAliases:[]].map(t=>[t,e.handler]))];return Object.fromEntries(e)},`generateShapeMap`)(),p(kve,`isValidShape`)}));async function F_(e,t,n){let r,i;t.shape===`rect`&&(t.shape=t.rx&&t.ry?`roundedRect`:`squareRect`);let a=t.shape?N_[t.shape]:void 0;if(!a)throw Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let o;n.config.securityLevel===`sandbox`?o=`_top`:t.linkTarget&&(o=t.linkTarget||`_blank`),r=e.insert(`svg:a`).attr(`xlink:href`,t.link).attr(`target`,o??null),i=await a(r,t,n)}else i=await a(e,t,n),r=i;return r.attr(`data-look`,Um(t.look)),t.tooltip&&i.attr(`title`,t.tooltip),L_.set(t.id,r),t.haveCallback&&r.attr(`class`,r.attr(`class`)+` clickable`),r}var I_,L_,nye,rye,R_,z_=o((()=>{P_(),rh(),S(),h(),I_=p(({flowchart:e})=>{let t=e?.subGraphTitleMargin?.top??0,n=e?.subGraphTitleMargin?.bottom??0;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:n,subGraphTitleTotalMargin:t+n}},`getSubGraphTitleMargins`),L_=new Map,p(F_,`insertNode`),nye=p((e,t)=>{L_.set(t.id,e)},`setNodeElem`),rye=p(()=>{L_.clear()},`clear`),R_=p(e=>{let t=L_.get(e.id);y.trace(`Transforming node`,e.diff,e,`translate(`+(e.x-e.width/2-5)+`, `+e.width/2+`)`);let n=e.diff||0;return e.clusterNode?t.attr(`transform`,`translate(`+(e.x+n-e.width/2)+`, `+(e.y-e.height/2-8)+`)`):t.attr(`transform`,`translate(`+e.x+`, `+e.y+`)`),n},`positionNode`)})),iye,B_,aye,V_,H_,oye,U_=o((()=>{z_(),P_(),Op(),ig(),dc(),S(),h(),_p(),Ig(),iye=p(async(e,t)=>{let n=Z(),{themeVariables:r,handDrawnSeed:i}=n,{clusterBkg:a,clusterBorder:o}=r,s=o,{labelStyles:l,nodeStyles:u,borderStyles:d,backgroundStyles:f}=Tp(t),p=e.insert(`g`).attr(`class`,`cluster swimlane `+(t.cssClasses||``)).attr(`id`,t.id).attr(`data-id`,t.id).attr(`data-et`,`cluster`).attr(`data-look`,t.look),m=os(n.flowchart.htmlLabels),h=t.direction===`LR`,g=p.insert(`g`).attr(`class`,`cluster-label swimlane-label`),_=await rg(g,t.label,{style:t.labelStyle,useHtmlLabels:m,isNode:!0,width:t.width}),v=_.getBBox();if(m){let e=_.children[0],t=$c(_);v=e.getBoundingClientRect(),t.attr(`width`,v.width),t.attr(`height`,v.height)}let b=t.padding??0,x=t.width<=v.width+b?v.width+b:t.width;t.diff=t.width<=v.width+b?(x-t.width)/2-b:-b;let S=t.height,C=t.y-S/2,w=t.y+S/2,T=t.x-x/2,E=t.swimlaneContentTop===void 0?C+S/3:t.swimlaneContentTop,D=h?4:0,O=v.height+2*D,k,A;if(h){let e=Math.max(O,v.height+2*D),n=T+e,r=Math.max(0,x-e);if(t.look===`handDrawn`){let o=Fg.svg(p),l=Ep(t,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),u=Ep(t,{roughness:.7,fill:`none`,stroke:s,seed:i}),m=o.rectangle(T,C,e,S,l);k=p.insert(()=>m,`:first-child`);let h=o.rectangle(n,C,r,S,u);A=p.insert(()=>h,`:first-child`),k.select(`path:nth-child(2)`).attr(`style`,d.join(`;`)),k.select(`path`).attr(`style`,f.join(`;`).replace(`fill`,`stroke`))}else k=p.insert(`rect`,`:first-child`),A=p.insert(`rect`,`:first-child`),k.attr(`class`,`swimlane-title`).attr(`style`,u).attr(`x`,T).attr(`y`,C).attr(`width`,e).attr(`height`,S).attr(`fill`,a).attr(`stroke`,s),A.attr(`class`,`swimlane-body`).attr(`style`,u).attr(`x`,n).attr(`y`,C).attr(`width`,r).attr(`height`,S).attr(`fill`,`none`).attr(`stroke`,s);let o=T+e/2,l=t.y;g.attr(`transform`,`translate(${o}, ${l}) rotate(-90) translate(${-v.width/2}, ${-v.height/2})`)}else{let e=Math.max(0,E-C),n=Math.min(O,e),r=C+n,o=Math.max(0,w-r),l=t.x-x/2;if(t.look===`handDrawn`){let e=Fg.svg(p),u=Ep(t,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),m=Ep(t,{roughness:.7,fill:`none`,stroke:s,seed:i}),h=e.rectangle(l,C,x,n,u);k=p.insert(()=>h,`:first-child`);let g=e.rectangle(l,r,x,o,m);A=p.insert(()=>g,`:first-child`),k.select(`path:nth-child(2)`).attr(`style`,d.join(`;`)),k.select(`path`).attr(`style`,f.join(`;`).replace(`fill`,`stroke`))}else k=p.insert(`rect`,`:first-child`),A=p.insert(`rect`,`:first-child`),k.attr(`class`,`swimlane-title`).attr(`style`,u).attr(`x`,l).attr(`y`,C).attr(`width`,x).attr(`height`,n).attr(`fill`,a).attr(`stroke`,s),A.attr(`class`,`swimlane-body`).attr(`style`,u).attr(`x`,l).attr(`y`,r).attr(`width`,x).attr(`height`,o).attr(`fill`,`none`).attr(`stroke`,s);let m=t.x-v.width/2,h=C+(n-v.height)/2;g.attr(`transform`,`translate(${m}, ${h})`)}if(y.trace(`Swimlane data `,t,JSON.stringify(t)),l){let e=g.select(`span`);e&&e.attr(`style`,l)}return t.offsetX=0,t.width=x,t.height=S,t.offsetY=v.height-b/2,t.intersect=function(e){return s_(t,e)},{cluster:p,labelBBox:v}},`swimlane`),B_=p(async(e,t)=>{y.info(`Creating subgraph rect for `,t.id,t);let n=Z(),{themeVariables:r,handDrawnSeed:i}=n,{clusterBkg:a,clusterBorder:o}=r,{labelStyles:s,nodeStyles:l,borderStyles:u,backgroundStyles:d}=Tp(t),f=e.insert(`g`).attr(`class`,`cluster `+t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look),p=bs(n),m=f.insert(`g`).attr(`class`,`cluster-label `),h;h=t.labelType===`markdown`?await rg(m,t.label,{style:t.labelStyle,useHtmlLabels:p,isNode:!0,width:t.width}):await l_(m,t.label,t.labelStyle||``,!1,!0);let g=h.getBBox();if(bs(n)){let e=h.children[0],t=$c(h);g=e.getBoundingClientRect(),t.attr(`width`,g.width),t.attr(`height`,g.height)}let _=t.width<=g.width+t.padding?g.width+t.padding:t.width;t.diff=t.width<=g.width+t.padding?(_-t.width)/2-t.padding:-t.padding;let v=t.height,b=t.x-_/2,x=t.y-v/2;y.trace(`Data `,t,JSON.stringify(t));let S;if(t.look===`handDrawn`){let e=Fg.svg(f),n=Ep(t,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),r=e.path(c_(b,x,_,v,0),n);S=f.insert(()=>(y.debug(`Rough node insert CXC`,r),r),`:first-child`),S.select(`path:nth-child(2)`).attr(`style`,u.join(`;`)),S.select(`path`).attr(`style`,d.join(`;`).replace(`fill`,`stroke`))}else S=f.insert(`rect`,`:first-child`),S.attr(`style`,l).attr(`rx`,t.rx).attr(`ry`,t.ry).attr(`x`,b).attr(`y`,x).attr(`width`,_).attr(`height`,v);let{subGraphTitleTopMargin:C}=I_(n);if(m.attr(`transform`,`translate(${t.x-g.width/2}, ${t.y-t.height/2+C})`),s){let e=m.select(`span`);e&&e.attr(`style`,s)}let w=S.node().getBBox();return t.offsetX=0,t.width=w.width,t.height=w.height,t.offsetY=g.height-t.padding/2,t.intersect=function(e){return s_(t,e)},{cluster:f,labelBBox:g}},`rect`),aye={rect:B_,squareRect:B_,roundedWithTitle:p(async(e,t)=>{let n=Z(),{themeVariables:r,handDrawnSeed:i}=n,{altBackground:a,compositeBackground:o,compositeTitleBackground:s,nodeBorder:l}=r,u=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-id`,t.id).attr(`data-look`,t.look),d=u.insert(`g`,`:first-child`),f=u.insert(`g`).attr(`class`,`cluster-label`),p=u.append(`rect`),m=await l_(f,t.label,t.labelStyle,void 0,!0),h=m.getBBox();if(bs(n)){let e=m.children[0],t=$c(m);h=e.getBoundingClientRect(),t.attr(`width`,h.width),t.attr(`height`,h.height)}let g=0*t.padding,_=g/2,v=(t.width<=h.width+t.padding?h.width+t.padding:t.width)+g;t.diff=t.width<=h.width+t.padding?(v-t.width)/2-t.padding:-t.padding;let y=t.height+g,b=t.height+g-h.height-6,x=t.x-v/2,S=t.y-y/2;t.width=v;let C=t.y-t.height/2-_+h.height+2,w;if(t.look===`handDrawn`){let e=t.cssClasses.includes(`statediagram-cluster-alt`),n=Fg.svg(u),r=t.rx||t.ry?n.path(c_(x,S,v,y,10),{roughness:.7,fill:s,fillStyle:`solid`,stroke:l,seed:i}):n.rectangle(x,S,v,y,{seed:i});w=u.insert(()=>r,`:first-child`);let d=n.rectangle(x,C,v,b,{fill:e?a:o,fillStyle:e?`hachure`:`solid`,stroke:l,seed:i});w=u.insert(()=>r,`:first-child`),p=u.insert(()=>d)}else w=d.insert(`rect`,`:first-child`),w.attr(`class`,`outer`).attr(`x`,x).attr(`y`,S).attr(`width`,v).attr(`height`,y).attr(`data-look`,t.look),p.attr(`class`,`inner`).attr(`x`,x).attr(`y`,C).attr(`width`,v).attr(`height`,b);return f.attr(`transform`,`translate(${t.x-h.width/2}, ${S+1-(bs(n)?0:3)})`),t.height=w.node().getBBox().height,t.offsetX=0,t.offsetY=h.height-t.padding/2,t.labelBBox=h,t.intersect=function(e){return s_(t,e)},{cluster:u,labelBBox:h}},`roundedWithTitle`),noteGroup:p((e,t)=>{let n=e.insert(`g`).attr(`class`,`note-cluster`).attr(`id`,t.domId),r=n.insert(`rect`,`:first-child`),i=0*t.padding,a=i/2;r.attr(`rx`,t.rx).attr(`ry`,t.ry).attr(`x`,t.x-t.width/2-a).attr(`y`,t.y-t.height/2-a).attr(`width`,t.width+i).attr(`height`,t.height+i).attr(`fill`,`none`);let o=r.node().getBBox();return t.width=o.width,t.height=o.height,t.intersect=function(e){return s_(t,e)},{cluster:n,labelBBox:{width:0,height:0}}},`noteGroup`),divider:p((e,t)=>{let{themeVariables:n,handDrawnSeed:r}=Z(),{nodeBorder:i}=n,a=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look),o=a.insert(`g`,`:first-child`),s=0*t.padding,l=t.width+s;t.diff=-t.padding;let u=t.height+s,d=t.x-l/2,f=t.y-u/2;t.width=l;let p;if(t.look===`handDrawn`){let e=Fg.svg(a).rectangle(d,f,l,u,{fill:`lightgrey`,roughness:.5,strokeLineDash:[5],stroke:i,seed:r});p=a.insert(()=>e,`:first-child`)}else{p=o.insert(`rect`,`:first-child`);let e=`outer`;e=(t.look,`divider`),p.attr(`class`,e).attr(`x`,d).attr(`y`,f).attr(`width`,l).attr(`height`,u).attr(`data-look`,t.look)}return t.height=p.node().getBBox().height,t.offsetX=0,t.offsetY=0,t.intersect=function(e){return s_(t,e)},{cluster:a,labelBBox:{}}},`divider`),kanbanSection:p(async(e,t)=>{y.info(`Creating subgraph rect for `,t.id,t);let n=Z(),{themeVariables:r,handDrawnSeed:i}=n,{clusterBkg:a,clusterBorder:o}=r,{labelStyles:s,nodeStyles:l,borderStyles:u,backgroundStyles:d}=Tp(t),f=e.insert(`g`).attr(`class`,`cluster `+t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look),p=bs(n),m=f.insert(`g`).attr(`class`,`cluster-label `),h=await rg(m,t.label,{style:t.labelStyle,useHtmlLabels:p,isNode:!0,width:t.width}),g=h.getBBox();if(bs(n)){let e=h.children[0],t=$c(h);g=e.getBoundingClientRect(),t.attr(`width`,g.width),t.attr(`height`,g.height)}let _=t.width<=g.width+t.padding?g.width+t.padding:t.width;t.diff=t.width<=g.width+t.padding?(_-t.width)/2-t.padding:-t.padding;let v=t.height,b=t.x-_/2,x=t.y-v/2;y.trace(`Data `,t,JSON.stringify(t));let S;if(t.look===`handDrawn`){let e=Fg.svg(f),n=Ep(t,{roughness:.7,fill:a,stroke:o,fillWeight:4,seed:i}),r=e.path(c_(b,x,_,v,t.rx),n);S=f.insert(()=>(y.debug(`Rough node insert CXC`,r),r),`:first-child`),S.select(`path:nth-child(2)`).attr(`style`,u.join(`;`)),S.select(`path`).attr(`style`,d.join(`;`).replace(`fill`,`stroke`))}else S=f.insert(`rect`,`:first-child`),S.attr(`style`,l).attr(`rx`,t.rx).attr(`ry`,t.ry).attr(`x`,b).attr(`y`,x).attr(`width`,_).attr(`height`,v);let{subGraphTitleTopMargin:C}=I_(n);if(m.attr(`transform`,`translate(${t.x-g.width/2}, ${t.y-t.height/2+C})`),s){let e=m.select(`span`);e&&e.attr(`style`,s)}let w=S.node().getBBox();return t.offsetX=0,t.width=w.width,t.height=w.height,t.offsetY=g.height-t.padding/2,t.intersect=function(e){return s_(t,e)},{cluster:f,labelBBox:g}},`kanbanSection`),swimlane:iye},V_=new Map,H_=p(async(e,t)=>{let n=await aye[t.shape||`rect`](e,t);return V_.set(t.id,n),n},`insertCluster`),oye=p(()=>{V_=new Map},`clear`)}));function W_(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=X_(e),t=X_(t);let[n,r]=[e.x,e.y],[i,a]=[t.x,t.y],o=i-n,s=a-r;return{angle:Math.atan(s/o),deltaX:o,deltaY:s}}function G_(e,t){bs(Z())&&e&&(e.style.width=t.length*9+`px`,e.style.height=`12px`)}function sye(e){let t=[],n=[];for(let r=1;r<e.length-1;r++){let i=e[r-1],a=e[r],o=e[r+1];(i.x===a.x&&a.y===o.y&&Math.abs(a.x-o.x)>5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===o.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-o.y)>5)&&(t.push(a),n.push(r))}return{cornerPoints:t,cornerPointPositions:n}}function cye(e,t){if(e.length<2)return``;let n=``,r=e.length,i=1e-5;for(let a=0;a<r;a++){let o=e[a],s=e[a-1],l=e[a+1];if(a===0)n+=`M${o.x},${o.y}`;else if(a===r-1)n+=`L${o.x},${o.y}`;else{let e=o.x-s.x,r=o.y-s.y,a=l.x-o.x,u=l.y-o.y,d=Math.hypot(e,r),f=Math.hypot(a,u);if(d<i||f<i){n+=`L${o.x},${o.y}`;continue}let p=e/d,m=r/d,h=a/f,g=u/f,_=p*h+m*g,v=Math.acos(Math.max(-1,Math.min(1,_)));if(v<i||Math.abs(Math.PI-v)<i){n+=`L${o.x},${o.y}`;continue}let y=Math.min(t/Math.sin(v/2),d/2,f/2),b=o.x-p*y,x=o.y-m*y,S=o.x+h*y,C=o.y+g*y;n+=`L${b},${x}`,n+=`Q${o.x},${o.y} ${S},${C}`}}return n}function K_(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};let n=t.x-e.x,r=t.y-e.y;return{angle:Math.atan2(r,n),deltaX:n,deltaY:r}}function lye(e,t){let n=e.map(e=>({...e}));if(e.length>=2&&J_[t.arrowTypeStart]){let r=J_[t.arrowTypeStart],i=e[0],a=e[1],{angle:o}=K_(i,a),s=r*Math.cos(o),l=r*Math.sin(o);n[0].x=i.x+s,n[0].y=i.y+l}let r=e.length;if(r>=2&&J_[t.arrowTypeEnd]){let i=J_[t.arrowTypeEnd],a=e[r-1],o=e[r-2],{angle:s}=K_(o,a),l=i*Math.cos(s),u=i*Math.sin(s);n[r-1].x=a.x-l,n[r-1].y=a.y-u}return n}var q_,J_,Y_,X_,uye,dye,fye,pye,Z_,mye,Q_,$_,hye,ev,tv,nv,rv,gye,_ye,vye,iv,av,yye,bye,ov,xye,Sye,sv,cv=o((()=>{z_(),P_(),Op(),ig(),rh(),dc(),S(),h(),_p(),Ig(),q_=p((e,t)=>{if(t)return`translate(`+-e.width/2+`, `+-e.height/2+`)`;let n=e.x??0,r=e.y??0;return`translate(`+-(n+e.width/2)+`, `+-(r+e.height/2)+`)`},`computeLabelTransform`),J_={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},Y_={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5},p(W_,`calculateDeltaAndAngle`),X_=p(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,`pointTransformer`),uye=p(e=>({x:p(function(t,n,r){let i=0,a=X_(r[0]).x<X_(r[r.length-1]).x?`left`:`right`;if(n===0&&Object.hasOwn(J_,e.arrowTypeStart)){let{angle:t,deltaX:n}=W_(r[0],r[1]);i=J_[e.arrowTypeStart]*Math.cos(t)*(n>=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(J_,e.arrowTypeEnd)){let{angle:t,deltaX:n}=W_(r[r.length-1],r[r.length-2]);i=J_[e.arrowTypeEnd]*Math.cos(t)*(n>=0?1:-1)}let o=Math.abs(X_(t).x-X_(r[r.length-1]).x),s=Math.abs(X_(t).y-X_(r[r.length-1]).y),l=Math.abs(X_(t).x-X_(r[0]).x),u=Math.abs(X_(t).y-X_(r[0]).y),d=J_[e.arrowTypeStart],f=J_[e.arrowTypeEnd];if(o<f&&o>0&&s<f){let e=f+1-o;e*=a===`right`?-1:1,i-=e}if(l<d&&l>0&&u<d){let e=d+1-l;e*=a===`right`?-1:1,i+=e}return X_(t).x+i},`x`),y:p(function(t,n,r){let i=0,a=X_(r[0]).y<X_(r[r.length-1]).y?`down`:`up`;if(n===0&&Object.hasOwn(J_,e.arrowTypeStart)){let{angle:t,deltaY:n}=W_(r[0],r[1]);i=J_[e.arrowTypeStart]*Math.abs(Math.sin(t))*(n>=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(J_,e.arrowTypeEnd)){let{angle:t,deltaY:n}=W_(r[r.length-1],r[r.length-2]);i=J_[e.arrowTypeEnd]*Math.abs(Math.sin(t))*(n>=0?1:-1)}let o=Math.abs(X_(t).y-X_(r[r.length-1]).y),s=Math.abs(X_(t).x-X_(r[r.length-1]).x),l=Math.abs(X_(t).y-X_(r[0]).y),u=Math.abs(X_(t).x-X_(r[0]).x),d=J_[e.arrowTypeStart],f=J_[e.arrowTypeEnd];if(o<f&&o>0&&s<f){let e=f+1-o;e*=a===`up`?-1:1,i-=e}if(l<d&&l>0&&u<d){let e=d+1-l;e*=a===`up`?-1:1,i+=e}return X_(t).y+i},`y`)}),`getLineFunctionsWithOffset`),dye=p((e,t,n,r,i,a=!1,o)=>{t.arrowTypeStart&&Z_(e,`start`,t.arrowTypeStart,n,r,i,a,o),t.arrowTypeEnd&&Z_(e,`end`,t.arrowTypeEnd,n,r,i,a,o)},`addEdgeMarkers`),fye={arrow_cross:{type:`cross`,fill:!1},arrow_point:{type:`point`,fill:!0},arrow_barb:{type:`barb`,fill:!0},arrow_barb_neo:{type:`barb`,fill:!0},arrow_circle:{type:`circle`,fill:!1},aggregation:{type:`aggregation`,fill:!1},extension:{type:`extension`,fill:!1},composition:{type:`composition`,fill:!0},dependency:{type:`dependency`,fill:!0},lollipop:{type:`lollipop`,fill:!1},only_one:{type:`onlyOne`,fill:!1},zero_or_one:{type:`zeroOrOne`,fill:!1},one_or_more:{type:`oneOrMore`,fill:!1},zero_or_more:{type:`zeroOrMore`,fill:!1},requirement_arrow:{type:`requirement_arrow`,fill:!1},requirement_contains:{type:`requirement_contains`,fill:!1}},pye=[`cross`,`point`,`circle`,`lollipop`,`aggregation`,`extension`,`composition`,`dependency`,`barb`],Z_=p((e,t,n,r,i,a,o=!1,s)=>{if(!n||n===`none`)return;let l=fye[n],u=l&&pye.includes(l.type);if(!l){y.warn(`Unknown arrow type: ${n}`);return}let d=`${i}_${a}-${l.type}${t===`start`?`Start`:`End`}${o&&u?`-margin`:``}`;if(s&&s.trim()!==``){let n=`${d}_${s.replace(/[^\dA-Za-z]/g,`_`)}`;if(!document.getElementById(n)){let e=document.getElementById(d);if(e){let t=e.cloneNode(!0);t.id=n,t.querySelectorAll(`path, circle, line`).forEach(e=>{e.setAttribute(`stroke`,s),l.fill&&e.setAttribute(`fill`,s)}),e.parentNode?.appendChild(t)}}e.attr(`marker-${t}`,`url(${r}#${n})`)}else e.attr(`marker-${t}`,`url(${r}#${d})`)},`addEdgeMarker`),mye=p(e=>typeof e==`string`?e:Z()?.flowchart?.curve,`resolveEdgeCurveType`),Q_=new Map,$_=new Map,hye=p(()=>{Q_.clear(),$_.clear()},`clear`),ev=p(e=>!!(e.label||e.startLabelLeft||e.startLabelRight||e.endLabelLeft||e.endLabelRight),`hasEdgeLabel`),tv=p(e=>e?typeof e==`string`?e:e.reduce((e,t)=>e+`;`+t,``):``,`getLabelStyles`),nv=p(async(e,t)=>{let n=Z(),r=bs(n),{labelStyles:i}=Tp(t);t.labelStyle=i;let a=e.insert(`g`).attr(`class`,`edgeLabel`),o=a.insert(`g`).attr(`class`,`label`).attr(`data-id`,t.id),s=t.labelType===`markdown`,l=await rg(e,t.label,{style:tv(t.labelStyle),useHtmlLabels:r,addSvgBackground:!0,isNode:!1,markdown:s,width:void 0},n);o.node().appendChild(l),y.info(`abc82`,t,t.labelType);let u,d;if(r){let e=l.children[0],t=$c(l);u=await tg.measure(()=>e.getBoundingClientRect()),d=u,t.attr(`width`,u.width),t.attr(`height`,u.height)}else{let e=$c(l).select(`text`).node();await tg.measure(()=>{u=l.getBBox(),d=e&&typeof e.getBBox==`function`?e.getBBox():u})}o.attr(`transform`,q_(d,r)),Q_.set(t.id,a),t.width=u.width,t.height=u.height;let f;if(t.startLabelLeft){let n=e.insert(`g`).attr(`class`,`edgeTerminals`),i=n.insert(`g`).attr(`class`,`inner`),a=await l_(i,t.startLabelLeft,tv(t.labelStyle)||``,!1,!1);f=a;let o=a.getBBox();if(r){let e=a.children[0],t=$c(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}i.attr(`transform`,q_(o,r)),$_.get(t.id)||$_.set(t.id,{}),$_.get(t.id).startLeft=n,G_(f,t.startLabelLeft)}if(t.startLabelRight){let n=e.insert(`g`).attr(`class`,`edgeTerminals`),i=n.insert(`g`).attr(`class`,`inner`),a=await l_(i,t.startLabelRight,tv(t.labelStyle)||``,!1,!1);f=a;let o=a.getBBox();if(r){let e=a.children[0],t=$c(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}i.attr(`transform`,q_(o,r)),$_.get(t.id)||$_.set(t.id,{}),$_.get(t.id).startRight=n,G_(f,t.startLabelRight)}if(t.endLabelLeft){let n=e.insert(`g`).attr(`class`,`edgeTerminals`),i=n.insert(`g`).attr(`class`,`inner`),a=await l_(n,t.endLabelLeft,tv(t.labelStyle)||``,!1,!1);f=a;let o=a.getBBox();if(r){let e=a.children[0],t=$c(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}i.attr(`transform`,q_(o,r)),$_.get(t.id)||$_.set(t.id,{}),$_.get(t.id).endLeft=n,G_(f,t.endLabelLeft)}if(t.endLabelRight){let n=e.insert(`g`).attr(`class`,`edgeTerminals`),i=n.insert(`g`).attr(`class`,`inner`),a=await l_(n,t.endLabelRight,tv(t.labelStyle)||``,!1,!1);f=a;let o=a.getBBox();if(r){let e=a.children[0],t=$c(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}i.attr(`transform`,q_(o,r)),$_.get(t.id)||$_.set(t.id,{}),$_.get(t.id).endRight=n,G_(f,t.endLabelRight)}return l},`insertEdgeLabel`),p(G_,`setTerminalWidth`),rv=p((e,t)=>{y.debug(`Moving label abc88 `,e.id,e.label,Q_.get(e.id),t);let n=t.updatedPath?t.updatedPath:t.originalPath,r=Z(),{subGraphTitleTotalMargin:i}=I_(r);if(e.label){let r=Q_.get(e.id),a=e.x,o=e.y;if(n){let r=eh.calcLabelPosition(n);y.debug(`Moving label `+e.label+` from (`,a,`,`,o,`) to (`,r.x,`,`,r.y,`) abc88`),t.updatedPath&&(a=r.x,o=r.y)}r.attr(`transform`,`translate(${a}, ${o+i/2})`)}if(e.startLabelLeft){let t=$_.get(e.id).startLeft,r=e.x,i=e.y;if(n){let t=eh.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_left`,n);r=t.x,i=t.y}t.attr(`transform`,`translate(${r}, ${i})`)}if(e.startLabelRight){let t=$_.get(e.id).startRight,r=e.x,i=e.y;if(n){let t=eh.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_right`,n);r=t.x,i=t.y}t.attr(`transform`,`translate(${r}, ${i})`)}if(e.endLabelLeft){let t=$_.get(e.id).endLeft,r=e.x,i=e.y;if(n){let t=eh.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_left`,n);r=t.x,i=t.y}t.attr(`transform`,`translate(${r}, ${i})`)}if(e.endLabelRight){let t=$_.get(e.id).endRight,r=e.x,i=e.y;if(n){let t=eh.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_right`,n);r=t.x,i=t.y}t.attr(`transform`,`translate(${r}, ${i})`)}},`positionEdgeLabel`),gye=p((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith(`-to-label`)||!Array.isArray(t)||t.length!==2)return t;let[n,r]=t,i=Math.abs(r.x-n.x),a=Math.abs(r.y-n.y);return i<.001||a<.001?t:a>=i?[n,{x:n.x,y:r.y},r]:[n,{x:r.x,y:n.y},r]},`orthogonalizeToLabelClippedPoints`),_ye=p((e,t)=>{let n=e.x,r=e.y,i=Math.abs(t.x-n),a=Math.abs(t.y-r),o=e.width/2,s=e.height/2;return i>=o||a>=s},`outsideNode`),vye=p((e,t,n)=>{y.debug(`intersection calc abc89:517+ outsidePoint: ${JSON.stringify(t)}518+ insidePoint : ${JSON.stringify(n)}519+ node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);let r=e.x,i=e.y,a=Math.abs(r-n.x),o=e.width/2,s=n.x<t.x?o-a:o+a,l=e.height/2,u=Math.abs(t.y-n.y),d=Math.abs(t.x-n.x);if(Math.abs(i-t.y)*o>Math.abs(r-t.x)*l){let e=n.y<t.y?t.y-l-i:i-l-t.y;s=d*e/u;let r={x:n.x<t.x?n.x+s:n.x-d+s,y:n.y<t.y?n.y+u-e:n.y-u+e};return s===0&&(r.x=t.x,r.y=t.y),d===0&&(r.x=t.x),u===0&&(r.y=t.y),y.debug(`abc89 top/bottom calc, Q ${u}, q ${e}, R ${d}, r ${s}`,r),r}{s=n.x<t.x?t.x-o-r:r-o-t.x;let e=u*s/d,i=n.x<t.x?n.x+d-s:n.x-d+s,a=n.y<t.y?n.y+e:n.y-e;return y.debug(`sides calc abc89, Q ${u}, q ${e}, R ${d}, r ${s}`,{_x:i,_y:a}),s===0&&(i=t.x,a=t.y),d===0&&(i=t.x),u===0&&(a=t.y),{x:i,y:a}}},`intersection`),iv=p((e,t)=>{y.warn(`abc88 cutPathAtIntersect`,e,t);let n=[],r=e[0],i=!1;return e.forEach(e=>{if(y.info(`abc88 checking point`,e,t),!_ye(t,e)&&!i){let a=vye(t,r,e);y.debug(`abc88 inside`,e,r,a),y.debug(`abc88 intersection`,a,t);let o=!1;n.forEach(e=>{o||=e.x===a.x&&e.y===a.y}),n.some(e=>e.x===a.x&&e.y===a.y)?y.warn(`abc88 no intersect`,a,n):n.push(a),i=!0}else y.warn(`abc88 outside`,e,r),r=e,i||n.push(e)}),y.debug(`returning points`,n),n},`cutPathAtIntersect`),p(sye,`extractCornerPoints`),av=p(function(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=n/Math.sqrt(r*r+i*i);return{x:t.x-a*r,y:t.y-a*i}},`findAdjacentPoint`),yye=p(function(e){let{cornerPointPositions:t}=sye(e),n=[];for(let r=0;r<e.length;r++)if(t.includes(r)){let t=e[r-1],i=e[r+1],a=e[r],o=av(t,a,5),s=av(i,a,5),l=s.x-o.x,u=s.y-o.y;n.push(o);let d=Math.sqrt(2)*2,f={x:a.x,y:a.y};Math.abs(i.x-t.x)>10&&Math.abs(i.y-t.y)>=10?(y.debug(`Corner point fixing`,Math.abs(i.x-t.x),Math.abs(i.y-t.y)),f=a.x===o.x?{x:l<0?o.x-5+d:o.x+5-d,y:u<0?o.y-d:o.y+d}:{x:l<0?o.x-d:o.x+d,y:u<0?o.y-5+d:o.y+5-d}):y.debug(`Corner point skipping fixing`,Math.abs(i.x-t.x),Math.abs(i.y-t.y)),n.push(f,s)}else n.push(e[r]);return n},`fixCorners`),bye=p((e,t,n)=>{let r=e-t-n,i=Math.floor(r/4);return`0 ${t} ${Array(Number.isFinite(i)?Math.max(0,i):0).fill(`2 2`).join(` `)} ${n}`},`generateDashArray`),ov=p(function(e,t,n,r,i,a,o,s=!1){if(!o)throw Error(`insertEdge: missing diagramId for edge "${t.id}" \u2014 edge IDs require a diagram prefix for uniqueness`);let{handDrawnSeed:l,layout:u}=Z(),d=t.points,f=!1,p=i;var m=a;let h=[];for(let e in t.cssCompiledStyles)wp(e)||h.push(t.cssCompiledStyles[e]);if(u===`swimlane`){if(m.intersect&&p.intersect&&Array.isArray(d)&&d.length>=2){if(d.length===2)d=[p.intersect(d[0]),m.intersect(d[1])];else{let e=d.slice(1,-1),t=e[0],n=e[e.length-1],r=.5,i=Math.abs(d[d.length-1].x-n.x)<r&&Math.abs(d[d.length-1].y-n.y)<r,a=p.intersect(t),o=i?n:m.intersect(n),s=Math.abs(o.x-n.x)<r&&Math.abs(o.y-n.y)<r,l=Math.abs(a.x-t.x)<r&&Math.abs(a.y-t.y)<r?[]:[a],u=s?[]:[o];d=[...l,...e,...u]}}d=gye(t,d)}else m.intersect&&p.intersect&&!s&&(d=d.slice(1,t.points.length-1),d.unshift(p.intersect(d[0])),d.push(m.intersect(d[d.length-1])));let g=btoa(JSON.stringify(d));t.toCluster&&(y.info(`to cluster abc88`,n.get(t.toCluster)),d=iv(t.points,n.get(t.toCluster).node),f=!0),t.fromCluster&&(y.debug(`from cluster abc88`,n.get(t.fromCluster),JSON.stringify(d,null,2)),d=iv(d.reverse(),n.get(t.fromCluster).node).reverse(),f=!0);let _=d.filter(e=>!Number.isNaN(e.y)),v=mye(t.curve);v!==`rounded`&&(_=yye(_));let b=vf;switch(v){case`linear`:b=vf;break;case`basis`:b=Of;break;case`cardinal`:b=If;break;case`bumpX`:b=xf;break;case`bumpY`:b=Sf;break;case`catmullRom`:b=Kf;break;case`monotoneX`:b=op;break;case`monotoneY`:b=sp;break;case`natural`:b=up;break;case`step`:b=fp;break;case`stepAfter`:b=mp;break;case`stepBefore`:b=pp;break;case`rounded`:b=vf;break;default:b=Of}let{x,y:S}=uye(t),C=bf().x(x).y(S).curve(b),w;switch(t.thickness){case`normal`:w=`edge-thickness-normal`;break;case`thick`:w=`edge-thickness-thick`;break;case`invisible`:w=`edge-thickness-invisible`;break;default:w=`edge-thickness-normal`}switch(t.pattern){case`solid`:w+=` edge-pattern-solid`;break;case`dotted`:w+=` edge-pattern-dotted`;break;case`dashed`:w+=` edge-pattern-dashed`;break;default:w+=` edge-pattern-solid`}let T,E=v===`rounded`?cye(lye(_,t),5):C(_),D=Array.isArray(t.style)?t.style:[t.style],O=D.find(e=>e?.startsWith(`stroke:`)),k=``;t.animate&&(k=`edge-animation-fast`),t.animation&&(k=`edge-animation-`+t.animation);let A=!1;if(t.look===`handDrawn`){let n=Fg.svg(e);Object.assign([],_);let r=n.path(E,{roughness:.3,seed:l});w+=` transition`,T=$c(r).select(`path`).attr(`id`,`${o}-${t.id}`).attr(`class`,` `+w+(t.classes?` `+t.classes:``)+(k?` `+k:``)).attr(`style`,D?D.reduce((e,t)=>e+`;`+t,``):``);let i=T.attr(`d`);T.attr(`d`,i),e.node().appendChild(T.node())}else{let n=h.join(`;`),r=D?D.reduce((e,t)=>e+t+`;`,``):``,i=(n?n+`;`+r+`;`:r)+`;`+(D?D.reduce((e,t)=>e+`;`+t,``):``);T=e.append(`path`).attr(`d`,E).attr(`id`,`${o}-${t.id}`).attr(`class`,` `+w+(t.classes?` `+t.classes:``)+(k?` `+k:``)).attr(`style`,i),O=i.match(/stroke:([^;]+)/)?.[1],A=t.animate===!0||!!t.animation||n.includes(`animation`);let a=T.node(),s=typeof a.getTotalLength==`function`?a.getTotalLength():0,l=Y_[t.arrowTypeStart]||0,u=Y_[t.arrowTypeEnd]||0;if(t.look===`neo`&&!A){let e=`stroke-dasharray: ${t.pattern===`dotted`||t.pattern===`dashed`?bye(s,l,u):`0 ${l} ${s-l-u} ${u}`}; stroke-dashoffset: 0;`;T.attr(`style`,e+T.attr(`style`))}}T.attr(`data-edge`,!0),T.attr(`data-et`,`edge`),T.attr(`data-id`,t.id),T.attr(`data-points`,g),T.attr(`data-look`,Um(t.look)),t.showPoints&&_.forEach(t=>{e.append(`circle`).style(`stroke`,`red`).style(`fill`,`red`).attr(`r`,1).attr(`cx`,t.x).attr(`cy`,t.y)});let j=``;(Z().flowchart.arrowMarkerAbsolute||Z().state.arrowMarkerAbsolute)&&(j=window.location.protocol+`//`+window.location.host+window.location.pathname+window.location.search,j=j.replace(/\(/g,`\\(`).replace(/\)/g,`\\)`)),y.info(`arrowTypeStart`,t.arrowTypeStart),y.info(`arrowTypeEnd`,t.arrowTypeEnd);let M=!A&&t?.look===`neo`;dye(T,t,j,o,r,M,O);let N=Math.floor(d.length/2),P=d[N];eh.isLabelCoordinateInPath(P,T.attr(`d`))||(f=!0);let F={};return f&&(F.updatedPath=d),F.originalPath=t.points,F},`insertEdge`),p(cye,`generateRoundedPath`),p(K_,`calculateDeltaAndAngle`),p(lye,`applyMarkerOffsetsToPoints`),xye=p((e,t,n,r)=>{t.forEach(t=>{Sye[t](e,n,r)})},`insertMarkers`),Sye={extension:p((e,t,n)=>{y.trace(`Making markers for `,n),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-extensionStart`).attr(`class`,`marker extension `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 1,7 L18,13 V 1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-extensionEnd`).attr(`class`,`marker extension `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 V 13 L18,7 Z`),e.append(`marker`).attr(`id`,n+`_`+t+`-extensionStart-margin`).attr(`class`,`marker extension `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`viewBox`,`0 0 20 14`).append(`polygon`).attr(`points`,`10,7 18,13 18,1`).style(`stroke-width`,2).style(`stroke-dasharray`,`0`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-extensionEnd-margin`).attr(`class`,`marker extension `+t).attr(`refX`,9).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`viewBox`,`0 0 20 14`).append(`polygon`).attr(`points`,`10,1 10,13 18,7`).style(`stroke-width`,2).style(`stroke-dasharray`,`0`)},`extension`),composition:p((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionStart`).attr(`class`,`marker composition `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionEnd`).attr(`class`,`marker composition `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionStart-margin`).attr(`class`,`marker composition `+t).attr(`refX`,15).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`viewBox`,`0 0 15 15`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionEnd-margin`).attr(`class`,`marker composition `+t).attr(`refX`,3.5).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`)},`composition`),aggregation:p((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationStart`).attr(`class`,`marker aggregation `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationEnd`).attr(`class`,`marker aggregation `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationStart-margin`).attr(`class`,`marker aggregation `+t).attr(`refX`,15).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,2).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationEnd-margin`).attr(`class`,`marker aggregation `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,2).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`)},`aggregation`),dependency:p((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyStart`).attr(`class`,`marker dependency `+t).attr(`refX`,6).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 5,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyEnd`).attr(`class`,`marker dependency `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyStart-margin`).attr(`class`,`marker dependency `+t).attr(`refX`,4).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 5,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyEnd-margin`).attr(`class`,`marker dependency `+t).attr(`refX`,16).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`)},`dependency`),lollipop:p((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopStart`).attr(`class`,`marker lollipop `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopEnd`).attr(`class`,`marker lollipop `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopStart-margin`).attr(`class`,`marker lollipop `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6).attr(`stroke-width`,2),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopEnd-margin`).attr(`class`,`marker lollipop `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6).attr(`stroke-width`,2)},`lollipop`),point:p((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-pointEnd`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,5).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,8).attr(`markerHeight`,8).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointStart`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,4.5).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,8).attr(`markerHeight`,8).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 5 L 10 10 L 10 0 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointEnd-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 11.5 14`).attr(`refX`,11.5).attr(`refY`,7).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,10.5).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 11.5 7 L 0 14 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointStart-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 11.5 14`).attr(`refX`,1).attr(`refY`,7).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11.5).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`polygon`).attr(`points`,`0,7 11.5,14 11.5,0`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`)},`point`),circle:p((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-circleEnd`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,11).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleStart`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,-1).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleEnd-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refY`,5).attr(`refX`,12.25).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,14).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleStart-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,-2).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,14).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`)},`circle`),cross:p((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-crossEnd`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 11 11`).attr(`refX`,12).attr(`refY`,5.2).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 l 9,9 M 10,1 l -9,9`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-crossStart`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 11 11`).attr(`refX`,-1).attr(`refY`,5.2).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 l 9,9 M 10,1 l -9,9`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-crossEnd-margin`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 15 15`).attr(`refX`,17.7).attr(`refY`,7.5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 L 14,14 M 1,14 L 14,1`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2.5),e.append(`marker`).attr(`id`,n+`_`+t+`-crossStart-margin`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 15 15`).attr(`refX`,-3.5).attr(`refY`,7.5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 L 14,14 M 1,14 L 14,1`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2.5).style(`stroke-dasharray`,`1,0`)},`cross`),barb:p((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`barb`),barbNeo:p((e,t,n)=>{let{themeVariables:r}=ms(),{transitionColor:i}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`strokeWidth`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L11,14 L13,7 L11,0 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd-margin`).attr(`refX`,17).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L11,14 L13,7 L11,0 Z`).attr(`fill`,`${i}`)},`barbNeo`),only_one:p((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneStart`).attr(`class`,`marker onlyOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).append(`path`).attr(`d`,`M9,0 L9,18 M15,0 L15,18`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneEnd`).attr(`class`,`marker onlyOne `+t).attr(`refX`,18).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,0 L3,18 M9,0 L9,18`)},`only_one`),zero_or_one:p((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneStart`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`);r.append(`circle`).attr(`fill`,`white`).attr(`cx`,21).attr(`cy`,9).attr(`r`,6),r.append(`path`).attr(`d`,`M9,0 L9,18`);let i=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneEnd`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,30).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`);i.append(`circle`).attr(`fill`,`white`).attr(`cx`,9).attr(`cy`,9).attr(`r`,6),i.append(`path`).attr(`d`,`M21,0 L21,18`)},`zero_or_one`),one_or_more:p((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreStart`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).append(`path`).attr(`d`,`M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreEnd`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,27).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18`)},`one_or_more`),zero_or_more:p((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreStart`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`);r.append(`circle`).attr(`fill`,`white`).attr(`cx`,48).attr(`cy`,18).attr(`r`,6),r.append(`path`).attr(`d`,`M0,18 Q18,0 36,18 Q18,36 0,18`);let i=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreEnd`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,39).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`);i.append(`circle`).attr(`fill`,`white`).attr(`cx`,9).attr(`cy`,18).attr(`r`,6),i.append(`path`).attr(`d`,`M21,18 Q39,0 57,18 Q39,36 21,18`)},`zero_or_more`),only_one_neo:p((e,t,n)=>{let{themeVariables:r}=ms(),{strokeWidth:i}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneStart`).attr(`class`,`marker onlyOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M9,0 L9,18 M15,0 L15,18`).attr(`stroke-width`,`${i}`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneEnd`).attr(`class`,`marker onlyOne `+t).attr(`refX`,18).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M3,0 L3,18 M9,0 L9,18`).attr(`stroke-width`,`${i}`)},`only_one_neo`),zero_or_one_neo:p((e,t,n)=>{let{themeVariables:r}=ms(),{strokeWidth:i,mainBkg:a}=r,o=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneStart`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`);o.append(`circle`).attr(`fill`,a??`white`).attr(`cx`,21).attr(`cy`,9).attr(`stroke-width`,`${i}`).attr(`r`,6),o.append(`path`).attr(`d`,`M9,0 L9,18`).attr(`stroke-width`,`${i}`);let s=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneEnd`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,30).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`);s.append(`circle`).attr(`fill`,a??`white`).attr(`cx`,9).attr(`cy`,9).attr(`stroke-width`,`${i}`).attr(`r`,6),s.append(`path`).attr(`d`,`M21,0 L21,18`).attr(`stroke-width`,`${i}`)},`zero_or_one_neo`),one_or_more_neo:p((e,t,n)=>{let{themeVariables:r}=ms(),{strokeWidth:i}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreStart`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27`).attr(`stroke-width`,`${i}`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreEnd`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,27).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18`).attr(`stroke-width`,`${i}`)},`one_or_more_neo`),zero_or_more_neo:p((e,t,n)=>{let{themeVariables:r}=ms(),{strokeWidth:i,mainBkg:a}=r,o=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreStart`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`);o.append(`circle`).attr(`fill`,a??`white`).attr(`cx`,45.5).attr(`cy`,18).attr(`r`,6).attr(`stroke-width`,`${i}`),o.append(`path`).attr(`d`,`M0,18 Q18,0 36,18 Q18,36 0,18`).attr(`stroke-width`,`${i}`);let s=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreEnd`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,39).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`);s.append(`circle`).attr(`fill`,a??`white`).attr(`cx`,11).attr(`cy`,18).attr(`r`,6).attr(`stroke-width`,`${i}`),s.append(`path`).attr(`d`,`M21,18 Q39,0 57,18 Q39,36 21,18`).attr(`stroke-width`,`${i}`)},`zero_or_more_neo`),requirement_arrow:p((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_arrowEnd`).attr(`refX`,20).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).append(`path`).attr(`d`,`M0,0520+ L20,10521+ M20,10522+ L0,20`)},`requirement_arrow`),requirement_contains:p((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_containsStart`).attr(`refX`,0).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).append(`g`);r.append(`circle`).attr(`cx`,10).attr(`cy`,10).attr(`r`,9).attr(`fill`,`none`),r.append(`line`).attr(`x1`,1).attr(`x2`,19).attr(`y1`,10).attr(`y2`,10),r.append(`line`).attr(`y1`,1).attr(`y2`,19).attr(`x1`,10).attr(`x2`,10)},`requirement_contains`),requirement_arrow_neo:p((e,t,n)=>{let{themeVariables:r}=ms(),{strokeWidth:i}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_arrowEnd`).attr(`refX`,20).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`stroke-width`,`${i}`).attr(`viewBox`,`0 0 25 20`).append(`path`).attr(`d`,`M0,0523+ L20,10524+ M20,10525+ L0,20`).attr(`stroke-linejoin`,`miter`)},`requirement_arrow_neo`),requirement_contains_neo:p((e,t,n)=>{let{themeVariables:r}=ms(),{strokeWidth:i}=r,a=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_containsStart`).attr(`refX`,0).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`g`);a.append(`circle`).attr(`cx`,10).attr(`cy`,10).attr(`r`,9).attr(`fill`,`none`),a.append(`line`).attr(`x1`,1).attr(`x2`,19).attr(`y1`,10).attr(`y2`,10),a.append(`line`).attr(`y1`,1).attr(`y2`,19).attr(`x1`,10).attr(`x2`,10),a.selectAll(`*`).attr(`stroke-width`,`${i}`)},`requirement_contains_neo`)},sv=xye})),lv,Cye=o((()=>{lv=typeof global==`object`&&global&&global.Object===Object&&global})),wye,uv,dv=o((()=>{Cye(),wye=typeof self==`object`&&self&&self.Object===Object&&self,uv=lv||wye||Function(`return this`)()})),fv,pv=o((()=>{dv(),fv=uv.Symbol}));function Tye(e){var t=Eye.call(e,hv),n=e[hv];try{e[hv]=void 0;var r=!0}catch{}var i=Dye.call(e);return r&&(t?e[hv]=n:delete e[hv]),i}var mv,Eye,Dye,hv,Oye=o((()=>{pv(),mv=Object.prototype,Eye=mv.hasOwnProperty,Dye=mv.toString,hv=fv?fv.toStringTag:void 0}));function kye(e){return Aye.call(e)}var Aye,jye=o((()=>{Aye=Object.prototype.toString}));function gv(e){return e==null?e===void 0?Nye:Mye:_v&&_v in Object(e)?Tye(e):kye(e)}var Mye,Nye,_v,vv=o((()=>{pv(),Oye(),jye(),Mye=`[object Null]`,Nye=`[object Undefined]`,_v=fv?fv.toStringTag:void 0}));function yv(e){return typeof e==`object`&&!!e}var bv=o((()=>{}));function xv(e){return typeof e==`symbol`||yv(e)&&gv(e)==Pye}var Pye,Sv=o((()=>{vv(),bv(),Pye=`[object Symbol]`}));function Cv(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var wv=o((()=>{})),Tv,Ev=o((()=>{Tv=Array.isArray}));function Fye(e){if(typeof e==`string`)return e;if(Tv(e))return Cv(e,Fye)+``;if(xv(e))return Ov?Ov.call(e):``;var t=e+``;return t==`0`&&1/e==-Iye?`-0`:t}var Iye,Dv,Ov,Lye=o((()=>{pv(),wv(),Ev(),Sv(),Iye=1/0,Dv=fv?fv.prototype:void 0,Ov=Dv?Dv.toString:void 0}));function Rye(e){for(var t=e.length;t--&&zye.test(e.charAt(t)););return t}var zye,Bye=o((()=>{zye=/\s/}));function Vye(e){return e&&e.slice(0,Rye(e)+1).replace(Hye,``)}var Hye,Uye=o((()=>{Bye(),Hye=/^\s+/}));function kv(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var Av=o((()=>{}));function Wye(e){if(typeof e==`number`)return e;if(xv(e))return jv;if(kv(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=kv(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=Vye(e);var n=Kye.test(e);return n||qye.test(e)?Jye(e.slice(2),n?2:8):Gye.test(e)?jv:+e}var jv,Gye,Kye,qye,Jye,Yye=o((()=>{Uye(),Av(),Sv(),jv=NaN,Gye=/^[-+]0x[0-9a-f]+$/i,Kye=/^0b[01]+$/i,qye=/^0o[0-7]+$/i,Jye=parseInt}));function Mv(e){return e?(e=Wye(e),e===Nv||e===-Nv?(e<0?-1:1)*Xye:e===e?e:0):e===0?e:0}var Nv,Xye,Pv=o((()=>{Yye(),Nv=1/0,Xye=17976931348623157e292}));function Zye(e){var t=Mv(e),n=t%1;return t===t?n?t-n:t:0}var Qye=o((()=>{Pv()}));function Fv(e){return e}var Iv=o((()=>{}));function Lv(e){if(!kv(e))return!1;var t=gv(e);return t==ebe||t==tbe||t==$ye||t==nbe}var $ye,ebe,tbe,nbe,Rv=o((()=>{vv(),Av(),$ye=`[object AsyncFunction]`,ebe=`[object Function]`,tbe=`[object GeneratorFunction]`,nbe=`[object Proxy]`})),zv,rbe=o((()=>{dv(),zv=uv[`__core-js_shared__`]}));function ibe(e){return!!Bv&&Bv in e}var Bv,abe=o((()=>{rbe(),Bv=function(){var e=/[^.]+$/.exec(zv&&zv.keys&&zv.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}()}));function Vv(e){if(e!=null){try{return obe.call(e)}catch{}try{return e+``}catch{}}return``}var obe,sbe=o((()=>{obe=Function.prototype.toString}));function cbe(e){return!kv(e)||ibe(e)?!1:(Lv(e)?hbe:ube).test(Vv(e))}var lbe,ube,dbe,fbe,pbe,mbe,hbe,gbe=o((()=>{Rv(),abe(),Av(),sbe(),lbe=/[\\^$.*+?()[\]{}|]/g,ube=/^\[object .+?Constructor\]$/,dbe=Function.prototype,fbe=Object.prototype,pbe=dbe.toString,mbe=fbe.hasOwnProperty,hbe=RegExp(`^`+pbe.call(mbe).replace(lbe,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`)}));function _be(e,t){return e?.[t]}var vbe=o((()=>{}));function Hv(e,t){var n=_be(e,t);return cbe(n)?n:void 0}var Uv=o((()=>{gbe(),vbe()})),Wv,ybe=o((()=>{Uv(),dv(),Wv=Hv(uv,`WeakMap`)})),Gv,bbe,xbe=o((()=>{Av(),Gv=Object.create,bbe=function(){function e(){}return function(t){if(!kv(t))return{};if(Gv)return Gv(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}()}));function Sbe(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Cbe=o((()=>{}));function wbe(){}var Tbe=o((()=>{}));function Ebe(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}var Kv=o((()=>{}));function Dbe(e){var t=0,n=0;return function(){var r=Abe(),i=kbe-(r-n);if(n=r,i>0){if(++t>=Obe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Obe,kbe,Abe,jbe=o((()=>{Obe=800,kbe=16,Abe=Date.now}));function qv(e){return function(){return e}}var Mbe=o((()=>{})),Jv,Nbe=o((()=>{Uv(),Jv=function(){try{var e=Hv(Object,`defineProperty`);return e({},``,{}),e}catch{}}()})),Pbe,Fbe=o((()=>{Mbe(),Nbe(),Iv(),Pbe=Jv?function(e,t){return Jv(e,`toString`,{configurable:!0,enumerable:!1,value:qv(t),writable:!0})}:Fv})),Yv,Xv=o((()=>{Fbe(),jbe(),Yv=Dbe(Pbe)}));function Ibe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var Zv=o((()=>{}));function Lbe(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}var Qv=o((()=>{}));function Rbe(e){return e!==e}var zbe=o((()=>{}));function Bbe(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var Vbe=o((()=>{}));function Hbe(e,t,n){return t===t?Bbe(e,t,n):Lbe(e,Rbe,n)}var Ube=o((()=>{Qv(),zbe(),Vbe()}));function Wbe(e,t){return!!(e!=null&&e.length)&&Hbe(e,t,0)>-1}var Gbe=o((()=>{Ube()}));function $v(e,t){var n=typeof e;return t??=Kbe,!!t&&(n==`number`||n!=`symbol`&&qbe.test(e))&&e>-1&&e%1==0&&e<t}var Kbe,qbe,ey=o((()=>{Kbe=9007199254740991,qbe=/^(?:0|[1-9]\d*)$/}));function ty(e,t,n){t==`__proto__`&&Jv?Jv(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var ny=o((()=>{Nbe()}));function ry(e,t){return e===t||e!==e&&t!==t}var iy=o((()=>{}));function ay(e,t,n){var r=e[t];(!(Jbe.call(e,t)&&ry(r,n))||n===void 0&&!(t in e))&&ty(e,t,n)}var Jbe,oy=o((()=>{ny(),iy(),Jbe=Object.prototype.hasOwnProperty}));function sy(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],l=r?r(n[s],e[s],s,n,e):void 0;l===void 0&&(l=e[s]),i?ty(n,s,l):ay(n,s,l)}return n}var cy=o((()=>{oy(),ny()}));function Ybe(e,t,n){return t=ly(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=ly(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),Sbe(e,this,s)}}var ly,Xbe=o((()=>{Cbe(),ly=Math.max}));function uy(e,t){return Yv(Ybe(e,t,Fv),e+``)}var dy=o((()=>{Iv(),Xbe(),Xv()}));function fy(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=Zbe}var Zbe,py=o((()=>{Zbe=9007199254740991}));function my(e){return e!=null&&fy(e.length)&&!Lv(e)}var hy=o((()=>{Rv(),py()}));function gy(e,t,n){if(!kv(n))return!1;var r=typeof t;return(r==`number`?my(n)&&$v(t,n.length):r==`string`&&t in n)?ry(n[t],e):!1}var _y=o((()=>{iy(),hy(),ey(),Av()}));function Qbe(e){return uy(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&gy(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var $be=o((()=>{dy(),_y()}));function vy(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||exe)}var exe,yy=o((()=>{exe=Object.prototype}));function txe(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var nxe=o((()=>{}));function rxe(e){return yv(e)&&gv(e)==ixe}var ixe,axe=o((()=>{vv(),bv(),ixe=`[object Arguments]`})),by,oxe,sxe,xy,Sy=o((()=>{axe(),bv(),by=Object.prototype,oxe=by.hasOwnProperty,sxe=by.propertyIsEnumerable,xy=rxe(function(){return arguments}())?rxe:function(e){return yv(e)&&oxe.call(e,`callee`)&&!sxe.call(e,`callee`)}}));function cxe(){return!1}var lxe=o((()=>{})),Cy,wy,Ty,Ey,Dy=o((()=>{dv(),lxe(),Cy=typeof exports==`object`&&exports&&!exports.nodeType&&exports,wy=Cy&&typeof module==`object`&&module&&!module.nodeType&&module,Ty=wy&&wy.exports===Cy?uv.Buffer:void 0,Ey=(Ty?Ty.isBuffer:void 0)||cxe}));function uxe(e){return yv(e)&&fy(e.length)&&!!Oy[gv(e)]}var dxe,fxe,pxe,mxe,hxe,gxe,_xe,vxe,yxe,bxe,xxe,Sxe,Cxe,wxe,Txe,Exe,Dxe,Oxe,kxe,Axe,jxe,Mxe,Nxe,Pxe,Oy,Fxe=o((()=>{vv(),py(),bv(),dxe=`[object Arguments]`,fxe=`[object Array]`,pxe=`[object Boolean]`,mxe=`[object Date]`,hxe=`[object Error]`,gxe=`[object Function]`,_xe=`[object Map]`,vxe=`[object Number]`,yxe=`[object Object]`,bxe=`[object RegExp]`,xxe=`[object Set]`,Sxe=`[object String]`,Cxe=`[object WeakMap]`,wxe=`[object ArrayBuffer]`,Txe=`[object DataView]`,Exe=`[object Float32Array]`,Dxe=`[object Float64Array]`,Oxe=`[object Int8Array]`,kxe=`[object Int16Array]`,Axe=`[object Int32Array]`,jxe=`[object Uint8Array]`,Mxe=`[object Uint8ClampedArray]`,Nxe=`[object Uint16Array]`,Pxe=`[object Uint32Array]`,Oy={},Oy[Exe]=Oy[Dxe]=Oy[Oxe]=Oy[kxe]=Oy[Axe]=Oy[jxe]=Oy[Mxe]=Oy[Nxe]=Oy[Pxe]=!0,Oy[dxe]=Oy[fxe]=Oy[wxe]=Oy[pxe]=Oy[Txe]=Oy[mxe]=Oy[hxe]=Oy[gxe]=Oy[_xe]=Oy[vxe]=Oy[yxe]=Oy[bxe]=Oy[xxe]=Oy[Sxe]=Oy[Cxe]=!1}));function ky(e){return function(t){return e(t)}}var Ay=o((()=>{})),jy,My,Ny,Py,Fy=o((()=>{Cye(),jy=typeof exports==`object`&&exports&&!exports.nodeType&&exports,My=jy&&typeof module==`object`&&module&&!module.nodeType&&module,Ny=My&&My.exports===jy&&lv.process,Py=function(){try{return My&&My.require&&My.require(`util`).types||Ny&&Ny.binding&&Ny.binding(`util`)}catch{}}()})),Iy,Ly,Ry=o((()=>{Fxe(),Ay(),Fy(),Iy=Py&&Py.isTypedArray,Ly=Iy?ky(Iy):uxe}));function Ixe(e,t){var n=Tv(e),r=!n&&xy(e),i=!n&&!r&&Ey(e),a=!n&&!r&&!i&&Ly(e),o=n||r||i||a,s=o?txe(e.length,String):[],l=s.length;for(var u in e)(t||Lxe.call(e,u))&&!(o&&(u==`length`||i&&(u==`offset`||u==`parent`)||a&&(u==`buffer`||u==`byteLength`||u==`byteOffset`)||$v(u,l)))&&s.push(u);return s}var Lxe,Rxe=o((()=>{nxe(),Sy(),Ev(),Dy(),ey(),Ry(),Lxe=Object.prototype.hasOwnProperty}));function zxe(e,t){return function(n){return e(t(n))}}var Bxe=o((()=>{})),Vxe,Hxe=o((()=>{Bxe(),Vxe=zxe(Object.keys,Object)}));function Uxe(e){if(!vy(e))return Vxe(e);var t=[];for(var n in Object(e))Wxe.call(e,n)&&n!=`constructor`&&t.push(n);return t}var Wxe,zy=o((()=>{yy(),Hxe(),Wxe=Object.prototype.hasOwnProperty}));function By(e){return my(e)?Ixe(e):Uxe(e)}var Vy=o((()=>{Rxe(),zy(),hy()}));function Gxe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Kxe=o((()=>{}));function qxe(e){if(!kv(e))return Gxe(e);var t=vy(e),n=[];for(var r in e)r==`constructor`&&(t||!Jxe.call(e,r))||n.push(r);return n}var Jxe,Yxe=o((()=>{Av(),yy(),Kxe(),Jxe=Object.prototype.hasOwnProperty}));function Hy(e){return my(e)?Ixe(e,!0):qxe(e)}var Uy=o((()=>{Rxe(),Yxe(),hy()}));function Wy(e,t){if(Tv(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||xv(e)?!0:Zxe.test(e)||!Xxe.test(e)||t!=null&&e in Object(t)}var Xxe,Zxe,Gy=o((()=>{Ev(),Sv(),Xxe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Zxe=/^\w*$/})),Ky,qy=o((()=>{Uv(),Ky=Hv(Object,`create`)}));function Qxe(){this.__data__=Ky?Ky(null):{},this.size=0}var $xe=o((()=>{qy()}));function eSe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var tSe=o((()=>{}));function nSe(e){var t=this.__data__;if(Ky){var n=t[e];return n===rSe?void 0:n}return iSe.call(t,e)?t[e]:void 0}var rSe,iSe,aSe=o((()=>{qy(),rSe=`__lodash_hash_undefined__`,iSe=Object.prototype.hasOwnProperty}));function oSe(e){var t=this.__data__;return Ky?t[e]!==void 0:sSe.call(t,e)}var sSe,cSe=o((()=>{qy(),sSe=Object.prototype.hasOwnProperty}));function lSe(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=Ky&&t===void 0?uSe:t,this}var uSe,dSe=o((()=>{qy(),uSe=`__lodash_hash_undefined__`}));function Jy(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var fSe=o((()=>{$xe(),tSe(),aSe(),cSe(),dSe(),Jy.prototype.clear=Qxe,Jy.prototype.delete=eSe,Jy.prototype.get=nSe,Jy.prototype.has=oSe,Jy.prototype.set=lSe}));function pSe(){this.__data__=[],this.size=0}var mSe=o((()=>{}));function Yy(e,t){for(var n=e.length;n--;)if(ry(e[n][0],t))return n;return-1}var Xy=o((()=>{iy()}));function hSe(e){var t=this.__data__,n=Yy(t,e);return n<0?!1:(n==t.length-1?t.pop():gSe.call(t,n,1),--this.size,!0)}var gSe,_Se=o((()=>{Xy(),gSe=Array.prototype.splice}));function vSe(e){var t=this.__data__,n=Yy(t,e);return n<0?void 0:t[n][1]}var ySe=o((()=>{Xy()}));function bSe(e){return Yy(this.__data__,e)>-1}var xSe=o((()=>{Xy()}));function SSe(e,t){var n=this.__data__,r=Yy(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var CSe=o((()=>{Xy()}));function Zy(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var Qy=o((()=>{mSe(),_Se(),ySe(),xSe(),CSe(),Zy.prototype.clear=pSe,Zy.prototype.delete=hSe,Zy.prototype.get=vSe,Zy.prototype.has=bSe,Zy.prototype.set=SSe})),$y,eb=o((()=>{Uv(),dv(),$y=Hv(uv,`Map`)}));function wSe(){this.size=0,this.__data__={hash:new Jy,map:new($y||Zy),string:new Jy}}var TSe=o((()=>{fSe(),Qy(),eb()}));function ESe(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}var DSe=o((()=>{}));function tb(e,t){var n=e.__data__;return ESe(t)?n[typeof t==`string`?`string`:`hash`]:n.map}var nb=o((()=>{DSe()}));function OSe(e){var t=tb(this,e).delete(e);return this.size-=+!!t,t}var kSe=o((()=>{nb()}));function ASe(e){return tb(this,e).get(e)}var jSe=o((()=>{nb()}));function MSe(e){return tb(this,e).has(e)}var NSe=o((()=>{nb()}));function PSe(e,t){var n=tb(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var FSe=o((()=>{nb()}));function rb(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var ib=o((()=>{TSe(),kSe(),jSe(),NSe(),FSe(),rb.prototype.clear=wSe,rb.prototype.delete=OSe,rb.prototype.get=ASe,rb.prototype.has=MSe,rb.prototype.set=PSe}));function ab(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(ISe);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(ab.Cache||rb),n}var ISe,LSe=o((()=>{ib(),ISe=`Expected a function`,ab.Cache=rb}));function RSe(e){var t=ab(e,function(e){return n.size===zSe&&n.clear(),e}),n=t.cache;return t}var zSe,BSe=o((()=>{LSe(),zSe=500})),VSe,HSe,USe,WSe=o((()=>{BSe(),VSe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,HSe=/\\(\\)?/g,USe=RSe(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(VSe,function(e,n,r,i){t.push(r?i.replace(HSe,`$1`):n||e)}),t})}));function GSe(e){return e==null?``:Fye(e)}var ob=o((()=>{Lye()}));function sb(e,t){return Tv(e)?e:Wy(e,t)?[e]:USe(GSe(e))}var cb=o((()=>{Ev(),Gy(),WSe(),ob()}));function lb(e){if(typeof e==`string`||xv(e))return e;var t=e+``;return t==`0`&&1/e==-KSe?`-0`:t}var KSe,ub=o((()=>{Sv(),KSe=1/0}));function db(e,t){t=sb(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[lb(t[n++])];return n&&n==r?e:void 0}var fb=o((()=>{cb(),ub()}));function qSe(e,t,n){var r=e==null?void 0:db(e,t);return r===void 0?n:r}var JSe=o((()=>{fb()}));function pb(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var mb=o((()=>{}));function YSe(e){return Tv(e)||xy(e)||!!(hb&&e&&e[hb])}var hb,XSe=o((()=>{pv(),Sy(),Ev(),hb=fv?fv.isConcatSpreadable:void 0}));function gb(e,t,n,r,i){var a=-1,o=e.length;for(n||=YSe,i||=[];++a<o;){var s=e[a];t>0&&n(s)?t>1?gb(s,t-1,n,r,i):pb(i,s):r||(i[i.length]=s)}return i}var _b=o((()=>{mb(),XSe()}));function vb(e){return e!=null&&e.length?gb(e,1):[]}var ZSe=o((()=>{_b()}));function QSe(e){return Yv(Ybe(e,void 0,vb),e+``)}var $Se=o((()=>{ZSe(),Xbe(),Xv()})),yb,bb=o((()=>{Bxe(),yb=zxe(Object.getPrototypeOf,Object)}));function eCe(e){if(!yv(e)||gv(e)!=tCe)return!1;var t=yb(e);if(t===null)return!0;var n=iCe.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&xb.call(n)==aCe}var tCe,nCe,rCe,xb,iCe,aCe,oCe=o((()=>{vv(),bb(),bv(),tCe=`[object Object]`,nCe=Function.prototype,rCe=Object.prototype,xb=nCe.toString,iCe=rCe.hasOwnProperty,aCe=xb.call(Object)})),sCe=o((()=>{}));function cCe(e,t,n,r){var i=-1,a=e==null?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}var lCe=o((()=>{}));function uCe(){this.__data__=new Zy,this.size=0}var dCe=o((()=>{Qy()}));function fCe(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var pCe=o((()=>{}));function mCe(e){return this.__data__.get(e)}var hCe=o((()=>{}));function gCe(e){return this.__data__.has(e)}var _Ce=o((()=>{}));function vCe(e,t){var n=this.__data__;if(n instanceof Zy){var r=n.__data__;if(!$y||r.length<yCe-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new rb(r)}return n.set(e,t),this.size=n.size,this}var yCe,bCe=o((()=>{Qy(),eb(),ib(),yCe=200}));function Sb(e){var t=this.__data__=new Zy(e);this.size=t.size}var Cb=o((()=>{Qy(),dCe(),pCe(),hCe(),_Ce(),bCe(),Sb.prototype.clear=uCe,Sb.prototype.delete=fCe,Sb.prototype.get=mCe,Sb.prototype.has=gCe,Sb.prototype.set=vCe}));function xCe(e,t){return e&&sy(t,By(t),e)}var SCe=o((()=>{cy(),Vy()}));function CCe(e,t){return e&&sy(t,Hy(t),e)}var wCe=o((()=>{cy(),Uy()}));function TCe(e,t){if(t)return e.slice();var n=e.length,r=Db?Db(n):new e.constructor(n);return e.copy(r),r}var wb,Tb,Eb,Db,ECe=o((()=>{dv(),wb=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Tb=wb&&typeof module==`object`&&module&&!module.nodeType&&module,Eb=Tb&&Tb.exports===wb?uv.Buffer:void 0,Db=Eb?Eb.allocUnsafe:void 0}));function DCe(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}var Ob=o((()=>{}));function OCe(){return[]}var kb=o((()=>{})),kCe,Ab,jb,Mb=o((()=>{Ob(),kb(),kCe=Object.prototype.propertyIsEnumerable,Ab=Object.getOwnPropertySymbols,jb=Ab?function(e){return e==null?[]:(e=Object(e),DCe(Ab(e),function(t){return kCe.call(e,t)}))}:OCe}));function ACe(e,t){return sy(e,jb(e),t)}var jCe=o((()=>{cy(),Mb()})),Nb,MCe=o((()=>{mb(),bb(),Mb(),kb(),Nb=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)pb(t,jb(e)),e=yb(e);return t}:OCe}));function NCe(e,t){return sy(e,Nb(e),t)}var PCe=o((()=>{cy(),MCe()}));function FCe(e,t,n){var r=t(e);return Tv(e)?r:pb(r,n(e))}var ICe=o((()=>{mb(),Ev()}));function Pb(e){return FCe(e,By,jb)}var LCe=o((()=>{ICe(),Mb(),Vy()}));function RCe(e){return FCe(e,Hy,Nb)}var zCe=o((()=>{ICe(),MCe(),Uy()})),Fb,BCe=o((()=>{Uv(),dv(),Fb=Hv(uv,`DataView`)})),Ib,VCe=o((()=>{Uv(),dv(),Ib=Hv(uv,`Promise`)})),Lb,HCe=o((()=>{Uv(),dv(),Lb=Hv(uv,`Set`)})),Rb,UCe,zb,Bb,Vb,Hb,WCe,GCe,KCe,qCe,JCe,Ub,Wb,Gb=o((()=>{BCe(),eb(),VCe(),HCe(),ybe(),vv(),sbe(),Rb=`[object Map]`,UCe=`[object Object]`,zb=`[object Promise]`,Bb=`[object Set]`,Vb=`[object WeakMap]`,Hb=`[object DataView]`,WCe=Vv(Fb),GCe=Vv($y),KCe=Vv(Ib),qCe=Vv(Lb),JCe=Vv(Wv),Ub=gv,(Fb&&Ub(new Fb(new ArrayBuffer(1)))!=Hb||$y&&Ub(new $y)!=Rb||Ib&&Ub(Ib.resolve())!=zb||Lb&&Ub(new Lb)!=Bb||Wv&&Ub(new Wv)!=Vb)&&(Ub=function(e){var t=gv(e),n=t==UCe?e.constructor:void 0,r=n?Vv(n):``;if(r)switch(r){case WCe:return Hb;case GCe:return Rb;case KCe:return zb;case qCe:return Bb;case JCe:return Vb}return t}),Wb=Ub}));function YCe(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&XCe.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}var XCe,ZCe=o((()=>{XCe=Object.prototype.hasOwnProperty})),Kb,QCe=o((()=>{dv(),Kb=uv.Uint8Array}));function qb(e){var t=new e.constructor(e.byteLength);return new Kb(t).set(new Kb(e)),t}var Jb=o((()=>{QCe()}));function $Ce(e,t){var n=t?qb(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var ewe=o((()=>{Jb()}));function twe(e){var t=new e.constructor(e.source,nwe.exec(e));return t.lastIndex=e.lastIndex,t}var nwe,rwe=o((()=>{nwe=/\w*$/}));function iwe(e){return Xb?Object(Xb.call(e)):{}}var Yb,Xb,awe=o((()=>{pv(),Yb=fv?fv.prototype:void 0,Xb=Yb?Yb.valueOf:void 0}));function owe(e,t){var n=t?qb(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var swe=o((()=>{Jb()}));function cwe(e,t,n){var r=e.constructor;switch(t){case _we:return qb(e);case lwe:case uwe:return new r(+e);case vwe:return $Ce(e,n);case ywe:case bwe:case xwe:case Swe:case Cwe:case wwe:case Twe:case Ewe:case Dwe:return owe(e,n);case dwe:return new r;case fwe:case hwe:return new r(e);case pwe:return twe(e);case mwe:return new r;case gwe:return iwe(e)}}var lwe,uwe,dwe,fwe,pwe,mwe,hwe,gwe,_we,vwe,ywe,bwe,xwe,Swe,Cwe,wwe,Twe,Ewe,Dwe,Owe=o((()=>{Jb(),ewe(),rwe(),awe(),swe(),lwe=`[object Boolean]`,uwe=`[object Date]`,dwe=`[object Map]`,fwe=`[object Number]`,pwe=`[object RegExp]`,mwe=`[object Set]`,hwe=`[object String]`,gwe=`[object Symbol]`,_we=`[object ArrayBuffer]`,vwe=`[object DataView]`,ywe=`[object Float32Array]`,bwe=`[object Float64Array]`,xwe=`[object Int8Array]`,Swe=`[object Int16Array]`,Cwe=`[object Int32Array]`,wwe=`[object Uint8Array]`,Twe=`[object Uint8ClampedArray]`,Ewe=`[object Uint16Array]`,Dwe=`[object Uint32Array]`}));function kwe(e){return typeof e.constructor==`function`&&!vy(e)?bbe(yb(e)):{}}var Awe=o((()=>{xbe(),bb(),yy()}));function jwe(e){return yv(e)&&Wb(e)==Mwe}var Mwe,Nwe=o((()=>{Gb(),bv(),Mwe=`[object Map]`})),Zb,Pwe,Fwe=o((()=>{Nwe(),Ay(),Fy(),Zb=Py&&Py.isMap,Pwe=Zb?ky(Zb):jwe}));function Iwe(e){return yv(e)&&Wb(e)==Lwe}var Lwe,Rwe=o((()=>{Gb(),bv(),Lwe=`[object Set]`})),Qb,zwe,Bwe=o((()=>{Rwe(),Ay(),Fy(),Qb=Py&&Py.isSet,zwe=Qb?ky(Qb):Iwe}));function $b(e,t,n,r,i,a){var o,s=t&Vwe,l=t&Hwe,u=t&Uwe;if(n&&(o=i?n(e,r,i,a):n(e)),o!==void 0)return o;if(!kv(e))return e;var d=Tv(e);if(d){if(o=YCe(e),!s)return Ebe(e,o)}else{var f=Wb(e),p=f==tx||f==Jwe;if(Ey(e))return TCe(e,s);if(f==nx||f==ex||p&&!i){if(o=l||p?{}:kwe(e),!s)return l?NCe(e,CCe(o,e)):ACe(e,xCe(o,e))}else{if(!rx[f])return i?e:{};o=cwe(e,f,s)}}a||=new Sb;var m=a.get(e);if(m)return m;a.set(e,o),zwe(e)?e.forEach(function(r){o.add($b(r,t,n,r,e,a))}):Pwe(e)&&e.forEach(function(r,i){o.set(i,$b(r,t,n,i,e,a))});var h=d?void 0:(u?l?RCe:Pb:l?Hy:By)(e);return Ibe(h||e,function(r,i){h&&(i=r,r=e[i]),ay(o,i,$b(r,t,n,i,e,a))}),o}var Vwe,Hwe,Uwe,ex,Wwe,Gwe,Kwe,qwe,tx,Jwe,Ywe,Xwe,nx,Zwe,Qwe,$we,eTe,tTe,nTe,rTe,iTe,aTe,oTe,sTe,cTe,lTe,uTe,dTe,fTe,rx,pTe=o((()=>{Cb(),Zv(),oy(),SCe(),wCe(),ECe(),Kv(),jCe(),PCe(),LCe(),zCe(),Gb(),ZCe(),Owe(),Awe(),Ev(),Dy(),Fwe(),Av(),Bwe(),Vy(),Uy(),Vwe=1,Hwe=2,Uwe=4,ex=`[object Arguments]`,Wwe=`[object Array]`,Gwe=`[object Boolean]`,Kwe=`[object Date]`,qwe=`[object Error]`,tx=`[object Function]`,Jwe=`[object GeneratorFunction]`,Ywe=`[object Map]`,Xwe=`[object Number]`,nx=`[object Object]`,Zwe=`[object RegExp]`,Qwe=`[object Set]`,$we=`[object String]`,eTe=`[object Symbol]`,tTe=`[object WeakMap]`,nTe=`[object ArrayBuffer]`,rTe=`[object DataView]`,iTe=`[object Float32Array]`,aTe=`[object Float64Array]`,oTe=`[object Int8Array]`,sTe=`[object Int16Array]`,cTe=`[object Int32Array]`,lTe=`[object Uint8Array]`,uTe=`[object Uint8ClampedArray]`,dTe=`[object Uint16Array]`,fTe=`[object Uint32Array]`,rx={},rx[ex]=rx[Wwe]=rx[nTe]=rx[rTe]=rx[Gwe]=rx[Kwe]=rx[iTe]=rx[aTe]=rx[oTe]=rx[sTe]=rx[cTe]=rx[Ywe]=rx[Xwe]=rx[nx]=rx[Zwe]=rx[Qwe]=rx[$we]=rx[eTe]=rx[lTe]=rx[uTe]=rx[dTe]=rx[fTe]=!0,rx[qwe]=rx[tx]=rx[tTe]=!1}));function mTe(e){return $b(e,hTe|gTe)}var hTe,gTe,_Te=o((()=>{pTe(),hTe=1,gTe=4}));function vTe(e){return this.__data__.set(e,yTe),this}var yTe,bTe=o((()=>{yTe=`__lodash_hash_undefined__`}));function xTe(e){return this.__data__.has(e)}var STe=o((()=>{}));function ix(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new rb;++t<n;)this.add(e[t])}var ax=o((()=>{ib(),bTe(),STe(),ix.prototype.add=ix.prototype.push=vTe,ix.prototype.has=xTe}));function CTe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var wTe=o((()=>{}));function TTe(e,t){return e.has(t)}var ox=o((()=>{}));function ETe(e,t,n,r,i,a){var o=n&DTe,s=e.length,l=t.length;if(s!=l&&!(o&&l>s))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var f=-1,p=!0,m=n&OTe?new ix:void 0;for(a.set(e,t),a.set(t,e);++f<s;){var h=e[f],g=t[f];if(r)var _=o?r(g,h,f,t,e,a):r(h,g,f,e,t,a);if(_!==void 0){if(_)continue;p=!1;break}if(m){if(!CTe(t,function(e,t){if(!TTe(m,t)&&(h===e||i(h,e,n,r,a)))return m.push(t)})){p=!1;break}}else if(!(h===g||i(h,g,n,r,a))){p=!1;break}}return a.delete(e),a.delete(t),p}var DTe,OTe,kTe=o((()=>{ax(),wTe(),ox(),DTe=1,OTe=2}));function ATe(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}var jTe=o((()=>{}));function sx(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var cx=o((()=>{}));function MTe(e,t,n,r,i,a,o){switch(n){case GTe:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case WTe:return!(e.byteLength!=t.byteLength||!a(new Kb(e),new Kb(t)));case FTe:case ITe:case zTe:return ry(+e,+t);case LTe:return e.name==t.name&&e.message==t.message;case BTe:case HTe:return e==t+``;case RTe:var s=ATe;case VTe:var l=r&NTe;if(s||=sx,e.size!=t.size&&!l)return!1;var u=o.get(e);if(u)return u==t;r|=PTe,o.set(e,t);var d=ETe(s(e),s(t),r,i,a,o);return o.delete(e),d;case UTe:if(ux)return ux.call(e)==ux.call(t)}return!1}var NTe,PTe,FTe,ITe,LTe,RTe,zTe,BTe,VTe,HTe,UTe,WTe,GTe,lx,ux,KTe=o((()=>{pv(),QCe(),iy(),kTe(),jTe(),cx(),NTe=1,PTe=2,FTe=`[object Boolean]`,ITe=`[object Date]`,LTe=`[object Error]`,RTe=`[object Map]`,zTe=`[object Number]`,BTe=`[object RegExp]`,VTe=`[object Set]`,HTe=`[object String]`,UTe=`[object Symbol]`,WTe=`[object ArrayBuffer]`,GTe=`[object DataView]`,lx=fv?fv.prototype:void 0,ux=lx?lx.valueOf:void 0}));function qTe(e,t,n,r,i,a){var o=n&JTe,s=Pb(e),l=s.length;if(l!=Pb(t).length&&!o)return!1;for(var u=l;u--;){var d=s[u];if(!(o?d in t:YTe.call(t,d)))return!1}var f=a.get(e),p=a.get(t);if(f&&p)return f==t&&p==e;var m=!0;a.set(e,t),a.set(t,e);for(var h=o;++u<l;){d=s[u];var g=e[d],_=t[d];if(r)var v=o?r(_,g,d,t,e,a):r(g,_,d,e,t,a);if(!(v===void 0?g===_||i(g,_,n,r,a):v)){m=!1;break}h||=d==`constructor`}if(m&&!h){var y=e.constructor,b=t.constructor;y!=b&&`constructor`in e&&`constructor`in t&&!(typeof y==`function`&&y instanceof y&&typeof b==`function`&&b instanceof b)&&(m=!1)}return a.delete(e),a.delete(t),m}var JTe,YTe,XTe=o((()=>{LCe(),JTe=1,YTe=Object.prototype.hasOwnProperty}));function ZTe(e,t,n,r,i,a){var o=Tv(e),s=Tv(t),l=o?fx:Wb(e),u=s?fx:Wb(t);l=l==dx?px:l,u=u==dx?px:u;var d=l==px,f=u==px,p=l==u;if(p&&Ey(e)){if(!Ey(t))return!1;o=!0,d=!1}if(p&&!d)return a||=new Sb,o||Ly(e)?ETe(e,t,n,r,i,a):MTe(e,t,l,n,r,i,a);if(!(n&QTe)){var m=d&&mx.call(e,`__wrapped__`),h=f&&mx.call(t,`__wrapped__`);if(m||h){var g=m?e.value():e,_=h?t.value():t;return a||=new Sb,i(g,_,n,r,a)}}return p?(a||=new Sb,qTe(e,t,n,r,i,a)):!1}var QTe,dx,fx,px,mx,$Te=o((()=>{Cb(),kTe(),KTe(),XTe(),Gb(),Ev(),Dy(),Ry(),QTe=1,dx=`[object Arguments]`,fx=`[object Array]`,px=`[object Object]`,mx=Object.prototype.hasOwnProperty}));function hx(e,t,n,r,i){return e===t?!0:e==null||t==null||!yv(e)&&!yv(t)?e!==e&&t!==t:ZTe(e,t,n,r,hx,i)}var gx=o((()=>{$Te(),bv()}));function eEe(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var l=s[0],u=e[l],d=s[1];if(o&&s[2]){if(u===void 0&&!(l in e))return!1}else{var f=new Sb;if(r)var p=r(u,d,l,e,t,f);if(!(p===void 0?hx(d,u,tEe|nEe,r,f):p))return!1}}return!0}var tEe,nEe,rEe=o((()=>{Cb(),gx(),tEe=1,nEe=2}));function iEe(e){return e===e&&!kv(e)}var aEe=o((()=>{Av()}));function oEe(e){for(var t=By(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,iEe(i)]}return t}var sEe=o((()=>{aEe(),Vy()}));function cEe(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}}var lEe=o((()=>{}));function uEe(e){var t=oEe(e);return t.length==1&&t[0][2]?cEe(t[0][0],t[0][1]):function(n){return n===e||eEe(n,e,t)}}var dEe=o((()=>{rEe(),sEe(),lEe()}));function fEe(e,t){return e!=null&&t in Object(e)}var pEe=o((()=>{}));function mEe(e,t,n){t=sb(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=lb(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&fy(i)&&$v(o,i)&&(Tv(e)||xy(e)))}var hEe=o((()=>{cb(),Sy(),Ev(),ey(),py(),ub()}));function gEe(e,t){return e!=null&&mEe(e,t,fEe)}var _x=o((()=>{pEe(),hEe()}));function _Ee(e,t){return Wy(e)&&iEe(t)?cEe(lb(e),t):function(n){var r=qSe(n,e);return r===void 0&&r===t?gEe(n,e):hx(t,r,vEe|yEe)}}var vEe,yEe,bEe=o((()=>{gx(),JSe(),_x(),Gy(),aEe(),lEe(),ub(),vEe=1,yEe=2}));function xEe(e){return function(t){return t?.[e]}}var vx=o((()=>{}));function SEe(e){return function(t){return db(t,e)}}var CEe=o((()=>{fb()}));function wEe(e){return Wy(e)?xEe(lb(e)):SEe(e)}var TEe=o((()=>{vx(),CEe(),Gy(),ub()}));function yx(e){return typeof e==`function`?e:e==null?Fv:typeof e==`object`?Tv(e)?_Ee(e[0],e[1]):uEe(e):wEe(e)}var bx=o((()=>{dEe(),bEe(),Iv(),Ev(),TEe()}));function EEe(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var l=o[e?s:++i];if(n(a[l],l,a)===!1)break}return t}}var DEe=o((()=>{})),xx,Sx=o((()=>{DEe(),xx=EEe()}));function Cx(e,t){return e&&xx(e,t,By)}var wx=o((()=>{Sx(),Vy()}));function OEe(e,t){return function(n,r){if(n==null)return n;if(!my(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var kEe=o((()=>{hy()})),Tx,Ex=o((()=>{wx(),kEe(),Tx=OEe(Cx)})),Dx,AEe=o((()=>{dv(),Dx=function(){return uv.Date.now()}})),Ox,jEe,MEe,NEe=o((()=>{dy(),iy(),_y(),Uy(),Ox=Object.prototype,jEe=Ox.hasOwnProperty,MEe=uy(function(e,t){e=Object(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&gy(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],o=Hy(a),s=-1,l=o.length;++s<l;){var u=o[s],d=e[u];(d===void 0||ry(d,Ox[u])&&!jEe.call(e,u))&&(e[u]=a[u])}return e})}));function kx(e,t,n){(n!==void 0&&!ry(e[t],n)||n===void 0&&!(t in e))&&ty(e,t,n)}var PEe=o((()=>{ny(),iy()}));function FEe(e){return yv(e)&&my(e)}var Ax=o((()=>{hy(),bv()}));function jx(e,t){if((t!==`constructor`||typeof e[t]!=`function`)&&t!=`__proto__`)return e[t]}var IEe=o((()=>{}));function LEe(e){return sy(e,Hy(e))}var REe=o((()=>{cy(),Uy()}));function zEe(e,t,n,r,i,a,o){var s=jx(e,n),l=jx(t,n),u=o.get(l);if(u){kx(e,n,u);return}var d=a?a(s,l,n+``,e,t,o):void 0,f=d===void 0;if(f){var p=Tv(l),m=!p&&Ey(l),h=!p&&!m&&Ly(l);d=l,p||m||h?Tv(s)?d=s:FEe(s)?d=Ebe(s):m?(f=!1,d=TCe(l,!0)):h?(f=!1,d=owe(l,!0)):d=[]:eCe(l)||xy(l)?(d=s,xy(s)?d=LEe(s):(!kv(s)||Lv(s))&&(d=kwe(l))):f=!1}f&&(o.set(l,d),i(d,l,r,a,o),o.delete(l)),kx(e,n,d)}var BEe=o((()=>{PEe(),ECe(),swe(),Kv(),Awe(),Sy(),Ev(),Ax(),Dy(),Rv(),Av(),oCe(),Ry(),IEe(),REe()}));function VEe(e,t,n,r,i){e!==t&&xx(t,function(a,o){if(i||=new Sb,kv(a))zEe(e,t,o,n,VEe,r,i);else{var s=r?r(jx(e,o),a,o+``,e,t,i):void 0;s===void 0&&(s=a),kx(e,o,s)}},Hy)}var HEe=o((()=>{Cb(),PEe(),Sx(),BEe(),Av(),Uy(),IEe()}));function UEe(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var WEe=o((()=>{}));function Mx(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var GEe=o((()=>{}));function Nx(e){return typeof e==`function`?e:Fv}var Px=o((()=>{Iv()}));function Fx(e,t){return(Tv(e)?Ibe:Tx)(e,Nx(t))}var KEe=o((()=>{Zv(),Ex(),Px(),Ev()})),qEe=o((()=>{KEe()}));function JEe(e,t){var n=[];return Tx(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}var YEe=o((()=>{Ex()}));function Ix(e,t){return(Tv(e)?DCe:JEe)(e,yx(t,3))}var XEe=o((()=>{Ob(),YEe(),bx(),Ev()}));function ZEe(e){return function(t,n,r){var i=Object(t);if(!my(t)){var a=yx(n,3);t=By(t),n=function(e){return a(i[e],e,i)}}var o=e(t,n,r);return o>-1?i[a?t[o]:o]:void 0}}var QEe=o((()=>{bx(),hy(),Vy()}));function $Ee(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:Zye(n);return i<0&&(i=eDe(r+i,0)),Lbe(e,yx(t,3),i)}var eDe,tDe=o((()=>{Qv(),bx(),Qye(),eDe=Math.max})),Lx,nDe=o((()=>{QEe(),tDe(),Lx=ZEe($Ee)}));function rDe(e,t){var n=-1,r=my(e)?Array(e.length):[];return Tx(e,function(e,i,a){r[++n]=t(e,i,a)}),r}var iDe=o((()=>{Ex(),hy()}));function Rx(e,t){return(Tv(e)?Cv:rDe)(e,yx(t,3))}var aDe=o((()=>{wv(),bx(),iDe(),Ev()}));function oDe(e,t){return e==null?e:xx(e,Nx(t),Hy)}var sDe=o((()=>{Sx(),Px(),Uy()}));function cDe(e,t){return e&&Cx(e,Nx(t))}var lDe=o((()=>{wx(),Px()}));function uDe(e,t){return e>t}var dDe=o((()=>{}));function fDe(e,t){return e!=null&&pDe.call(e,t)}var pDe,mDe=o((()=>{pDe=Object.prototype.hasOwnProperty}));function hDe(e,t){return e!=null&&mEe(e,t,fDe)}var gDe=o((()=>{mDe(),hEe()})),_De=o((()=>{vv(),Ev(),bv()}));function vDe(e,t){return Cv(t,function(t){return e[t]})}var yDe=o((()=>{wv()}));function zx(e){return e==null?[]:vDe(e,By(e))}var bDe=o((()=>{yDe(),Vy()}));function xDe(e){if(e==null)return!0;if(my(e)&&(Tv(e)||typeof e==`string`||typeof e.splice==`function`||Ey(e)||Ly(e)||xy(e)))return!e.length;var t=Wb(e);if(t==SDe||t==CDe)return!e.size;if(vy(e))return!Uxe(e).length;for(var n in e)if(wDe.call(e,n))return!1;return!0}var SDe,CDe,wDe,TDe=o((()=>{zy(),Gb(),Sy(),Ev(),hy(),Dy(),yy(),Ry(),SDe=`[object Map]`,CDe=`[object Set]`,wDe=Object.prototype.hasOwnProperty}));function Bx(e){return e===void 0}var EDe=o((()=>{}));function DDe(e,t){return e<t}var Vx=o((()=>{}));function Hx(e,t){var n={};return t=yx(t,3),Cx(e,function(e,r,i){ty(n,r,t(e,r,i))}),n}var ODe=o((()=>{ny(),wx(),bx()}));function Ux(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],o=t(a);if(o!=null&&(s===void 0?o===o&&!xv(o):n(o,s)))var s=o,l=a}return l}var Wx=o((()=>{Sv()}));function Gx(e){return e&&e.length?Ux(e,Fv,uDe):void 0}var kDe=o((()=>{Wx(),dDe(),Iv()})),Kx,ADe=o((()=>{HEe(),$be(),Kx=Qbe(function(e,t,n){VEe(e,t,n)})}));function qx(e){return e&&e.length?Ux(e,Fv,DDe):void 0}var jDe=o((()=>{Wx(),Vx(),Iv()}));function Jx(e,t){return e&&e.length?Ux(e,yx(t,2),DDe):void 0}var MDe=o((()=>{Wx(),bx(),Vx()}));function NDe(e,t,n,r){if(!kv(e))return e;t=sb(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i<a;){var l=lb(t[i]),u=n;if(l===`__proto__`||l===`constructor`||l===`prototype`)return e;if(i!=o){var d=s[l];u=r?r(d,l,s):void 0,u===void 0&&(u=kv(d)?d:$v(t[i+1])?[]:{})}ay(s,l,u),s=s[l]}return e}var PDe=o((()=>{oy(),cb(),ey(),Av(),ub()}));function FDe(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=db(e,o);n(s,o)&&NDe(a,sb(o,e),s)}return a}var IDe=o((()=>{fb(),PDe(),cb()}));function LDe(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var RDe=o((()=>{}));function zDe(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=xv(e),o=t!==void 0,s=t===null,l=t===t,u=xv(t);if(!s&&!u&&!a&&e>t||a&&o&&l&&!s&&!u||r&&o&&l||!n&&l||!i)return 1;if(!r&&!a&&!u&&e<t||u&&n&&i&&!r&&!a||s&&n&&i||!o&&i||!l)return-1}return 0}var BDe=o((()=>{Sv()}));function VDe(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var l=zDe(i[r],a[r]);if(l)return r>=s?l:l*(n[r]==`desc`?-1:1)}return e.index-t.index}var HDe=o((()=>{BDe()}));function UDe(e,t,n){t=t.length?Cv(t,function(e){return Tv(e)?function(t){return db(t,e.length===1?e[0]:e)}:e}):[Fv];var r=-1;return t=Cv(t,ky(yx)),LDe(rDe(e,function(e,n,i){return{criteria:Cv(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return VDe(e,t,n)})}var WDe=o((()=>{wv(),fb(),bx(),iDe(),RDe(),Ay(),HDe(),Iv(),Ev()})),GDe=o((()=>{vx()})),Yx,KDe,qDe,JDe,Xx,Zx,YDe,Qx,$x,eS,XDe,tS,nS,ZDe,QDe,$De,eOe=o((()=>{Yx=`\\ud800-\\udfff`,KDe=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,qDe=`\\ufe0e\\ufe0f`,JDe=`[`+Yx+`]`,Xx=`[`+KDe+`]`,Zx=`\\ud83c[\\udffb-\\udfff]`,YDe=`(?:`+Xx+`|`+Zx+`)`,Qx=`[^`+Yx+`]`,$x=`(?:\\ud83c[\\udde6-\\uddff]){2}`,eS=`[\\ud800-\\udbff][\\udc00-\\udfff]`,XDe=`\\u200d`,tS=YDe+`?`,nS=`[`+qDe+`]?`,ZDe=`(?:`+XDe+`(?:`+[Qx,$x,eS].join(`|`)+`)`+nS+tS+`)*`,QDe=nS+tS+ZDe,$De=`(?:`+[Qx+Xx+`?`,Xx,$x,eS,JDe].join(`|`)+`)`,RegExp(Zx+`(?=`+Zx+`)|`+$De+QDe,`g`)})),tOe=o((()=>{GDe(),sCe(),eOe()}));function nOe(e,t){return FDe(e,t,function(t,n){return gEe(e,n)})}var rOe=o((()=>{IDe(),_x()})),rS,iOe=o((()=>{rOe(),$Se(),rS=QSe(function(e,t){return e==null?{}:nOe(e,t)})}));function aOe(e,t,n,r){for(var i=-1,a=sOe(oOe((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}var oOe,sOe,cOe=o((()=>{oOe=Math.ceil,sOe=Math.max}));function lOe(e){return function(t,n,r){return r&&typeof r!=`number`&&gy(t,n,r)&&(n=r=void 0),t=Mv(t),n===void 0?(n=t,t=0):n=Mv(n),r=r===void 0?t<n?1:-1:Mv(r),aOe(t,n,r,e)}}var uOe=o((()=>{cOe(),_y(),Pv()})),iS,dOe=o((()=>{uOe(),iS=lOe()}));function fOe(e,t,n,r,i){return i(e,function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)}),n}var pOe=o((()=>{}));function aS(e,t,n){var r=Tv(e)?cCe:fOe,i=arguments.length<3;return r(e,yx(t,4),n,i,Tx)}var mOe=o((()=>{lCe(),Ex(),bx(),pOe(),Ev()})),hOe=o((()=>{zy(),Gb(),hy(),_De(),tOe()})),oS,gOe=o((()=>{_b(),WDe(),dy(),_y(),oS=uy(function(e,t){if(e==null)return[];var n=t.length;return n>1&&gy(e,t[0],t[1])?t=[]:n>2&&gy(t[0],t[1],t[2])&&(t=[t[0]]),UDe(e,gb(t,1),[])})})),_Oe,vOe=o((()=>{HCe(),Tbe(),cx(),_Oe=Lb&&1/sx(new Lb([,-0]))[1]==1/0?function(e){return new Lb(e)}:wbe}));function yOe(e,t,n){var r=-1,i=Wbe,a=e.length,o=!0,s=[],l=s;if(n)o=!1,i=UEe;else if(a>=bOe){var u=t?null:_Oe(e);if(u)return sx(u);o=!1,i=TTe,l=new ix}else l=t?[]:s;outer:for(;++r<a;){var d=e[r],f=t?t(d):d;if(d=n||d!==0?d:0,o&&f===f){for(var p=l.length;p--;)if(l[p]===f)continue outer;t&&l.push(f),s.push(d)}else i(l,f,n)||(l!==s&&l.push(f),s.push(d))}return s}var bOe,xOe=o((()=>{ax(),Gbe(),WEe(),ox(),vOe(),cx(),bOe=200})),SOe,COe=o((()=>{_b(),dy(),xOe(),Ax(),SOe=uy(function(e){return yOe(gb(e,1,FEe,!0))})}));function sS(e){var t=++wOe;return GSe(e)+t}var wOe,TOe=o((()=>{ob(),wOe=0}));function EOe(e,t,n){for(var r=-1,i=e.length,a=t.length,o={};++r<i;){var s=r<a?t[r]:void 0;n(o,e[r],s)}return o}var DOe=o((()=>{}));function OOe(e,t){return EOe(e||[],t||[],ay)}var kOe=o((()=>{oy(),DOe()})),cS=o((()=>{Sv(),Lye(),Qye(),Iv(),ybe(),xbe(),Av(),dv(),Cbe(),Tbe(),Ev(),bv(),Kv(),jbe(),Xv(),Zv(),Gbe(),ey(),oy(),cy(),$be(),hy(),yy(),Vy(),Uy(),JSe(),$Se(),dy(),vv(),oCe(),ny(),ub(),ob(),sCe(),lCe(),Yye(),_y(),pTe(),_Te(),mb(),_b(),wv(),bx(),Mbe(),Ex(),SCe(),AEe(),NEe(),HEe(),ax(),WEe(),Ay(),ox(),Ax(),GEe(),qEe(),DEe(),kEe(),Px(),Gb(),jTe(),iy(),XEe(),nDe(),tDe(),wx(),QEe(),Qv(),aDe(),ZSe(),KEe(),sDe(),lDe(),Ob(),Rv(),dDe(),gDe(),_x(),Pv(),Ube(),_De(),bDe(),cb(),fb(),Sy(),Fy(),Dy(),TDe(),gx(),py(),Fwe(),rEe(),sEe(),gbe(),rbe(),lxe(),Bwe(),Ry(),EDe(),zbe(),Vx(),ODe(),dEe(),bEe(),kDe(),Wx(),LSe(),ADe(),jDe(),MDe(),pv(),cx(),zCe(),IDe(),WDe(),wTe(),tOe(),iOe(),TEe(),BDe(),dOe(),uOe(),mOe(),pOe(),YEe(),PDe(),hOe(),gOe(),kb(),yDe(),nxe(),WSe(),REe(),bb(),Uye(),Bye(),COe(),xOe(),TOe(),vx(),kOe(),DOe()}));function AOe(e,t){e[t]?e[t]++:e[t]=1}function jOe(e,t){--e[t]||delete e[t]}function lS(e,t,n,r){var i=``+t,a=``+n;if(!e&&i>a){var o=i;i=a,a=o}return i+fS+a+fS+(Bx(r)?NOe:r)}function MOe(e,t,n,r){var i=``+t,a=``+n;if(!e&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};return r&&(s.name=r),s}function uS(e,t){return lS(e,t.v,t.w,t.name)}var NOe,dS,fS,pS,POe=o((()=>{cS(),NOe=`\0`,dS=`\0`,fS=``,pS=class{constructor(e={}){this._isDirected=!Object.prototype.hasOwnProperty.call(e,`directed`)||e.directed,this._isMultigraph=Object.prototype.hasOwnProperty.call(e,`multigraph`)?e.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(e,`compound`)?e.compound:!1,this._label=void 0,this._defaultNodeLabelFn=qv(void 0),this._defaultEdgeLabelFn=qv(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[dS]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return Lv(e)||(e=qv(e)),this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return By(this._nodes)}sources(){var e=this;return Ix(this.nodes(),function(t){return xDe(e._in[t])})}sinks(){var e=this;return Ix(this.nodes(),function(t){return xDe(e._out[t])})}setNodes(e,t){var n=arguments,r=this;return Fx(e,function(e){n.length>1?r.setNode(e,t):r.setNode(e)}),this}setNode(e,t){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=dS,this._children[e]={},this._children[dS][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],Fx(this.children(e),e=>{this.setParent(e)}),delete this._children[e]),Fx(By(this._in[e]),t),delete this._in[e],delete this._preds[e],Fx(By(this._out[e]),t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(Bx(t))t=dS;else{t+=``;for(var n=t;!Bx(n);n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if(t!==dS)return t}}children(e){if(Bx(e)&&(e=dS),this._isCompound){var t=this._children[e];if(t)return By(t)}else if(e===dS)return this.nodes();else if(this.hasNode(e))return[]}predecessors(e){var t=this._preds[e];if(t)return By(t)}successors(e){var t=this._sucs[e];if(t)return By(t)}neighbors(e){var t=this.predecessors(e);if(t)return SOe(t,this.successors(e))}isLeaf(e){return(this.isDirected()?this.successors(e):this.neighbors(e)).length===0}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;Fx(this._nodes,function(n,r){e(r)&&t.setNode(r,n)}),Fx(this._edgeObjs,function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});var r={};function i(e){var a=n.parent(e);return a===void 0||t.hasNode(a)?(r[e]=a,a):a in r?r[a]:i(a)}return this._isCompound&&Fx(t.nodes(),function(e){t.setParent(e,i(e))}),t}setDefaultEdgeLabel(e){return Lv(e)||(e=qv(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return zx(this._edgeObjs)}setPath(e,t){var n=this,r=arguments;return aS(e,function(e,i){return r.length>1?n.setEdge(e,i,t):n.setEdge(e,i),i}),this}setEdge(){var e,t,n,r,i=!1,a=arguments[0];typeof a==`object`&&a&&`v`in a?(e=a.v,t=a.w,n=a.name,arguments.length===2&&(r=arguments[1],i=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),e=``+e,t=``+t,Bx(n)||(n=``+n);var o=lS(this._isDirected,e,t,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return i&&(this._edgeLabels[o]=r),this;if(!Bx(n)&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(e),this.setNode(t),this._edgeLabels[o]=i?r:this._defaultEdgeLabelFn(e,t,n);var s=MOe(this._isDirected,e,t,n);return e=s.v,t=s.w,Object.freeze(s),this._edgeObjs[o]=s,AOe(this._preds[t],e),AOe(this._sucs[e],t),this._in[t][o]=s,this._out[e][o]=s,this._edgeCount++,this}edge(e,t,n){var r=arguments.length===1?uS(this._isDirected,arguments[0]):lS(this._isDirected,e,t,n);return this._edgeLabels[r]}hasEdge(e,t,n){var r=arguments.length===1?uS(this._isDirected,arguments[0]):lS(this._isDirected,e,t,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,r)}removeEdge(e,t,n){var r=arguments.length===1?uS(this._isDirected,arguments[0]):lS(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],jOe(this._preds[t],e),jOe(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this}inEdges(e,t){var n=this._in[e];if(n){var r=zx(n);return t?Ix(r,function(e){return e.v===t}):r}}outEdges(e,t){var n=this._out[e];if(n){var r=zx(n);return t?Ix(r,function(e){return e.w===t}):r}}nodeEdges(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},pS.prototype._nodeCount=0,pS.prototype._edgeCount=0})),mS=o((()=>{POe()})),FOe=l({captureNodeSizes:()=>zOe,shouldCaptureSizes:()=>IOe});function hS(){if(!(typeof globalThis>`u`))return globalThis}function IOe(){return!!hS()?.mermaidCaptureSizes}function LOe(){return typeof location>`u`?`browser-dev`:`${location.pathname}${location.search}`}function ROe(e,t){let n=hS();if(!n)return;let r=t.node(),i=((r&&`ownerSVGElement`in r?r.ownerSVGElement:null)??r)?.id??`(unknown)`;n.mermaidCapturedSizes??=[];let a={svgId:i,sizes:e};n.mermaidCapturedSizes.push(a),n.mermaidLastCapturedSizes=a}function zOe(e,t){let n=[];for(let e of t.nodes)e.isGroup||n.push({id:e.id,width:e.width??0,height:e.height??0});n.length!==0&&ROe({metadata:{captureVersion:BOe,capturedAt:new Date().toISOString(),capturedFrom:LOe()},nodes:n},e)}var BOe,VOe=o((()=>{h(),BOe=1,p(hS,`getCaptureGlobal`),p(IOe,`shouldCaptureSizes`),p(LOe,`capturedFromLocation`),p(ROe,`emitCapturedSizes`),p(zOe,`captureNodeSizes`)}));function gS(e,{edgePathsClass:t=`edges edgePath`}={}){let n=e.insert(`g`).attr(`class`,`root`);return{clusters:n.insert(`g`).attr(`class`,`clusters`),edgePaths:n.insert(`g`).attr(`class`,t),edgeLabels:n.insert(`g`).attr(`class`,`edgeLabels`),nodes:n.insert(`g`).attr(`class`,`nodes`),rootGroups:n}}async function HOe(e,t){if(t.label){let{shapeSvg:n,bbox:r}=await r_(e,t);t.labelBBox={width:r.width,height:r.height},n.remove()}else t.labelBBox={width:0,height:0}}async function _S(e,t,n){let r=await F_(e,t,n),i=r.node()?.getBBox()??{width:0,height:0};return t.width=i.width,t.height=i.height,r}async function UOe(e,t){let n=new pS({multigraph:!0,compound:!0}),r=[...t.edges],i=Z(),a=gS(e),{edgeLabels:o,nodes:s}=a,l=new Map,u=e.node()!=null;await Promise.all(t.nodes.map(async e=>{if(e.isGroup)u&&await HOe(s,e),n.setNode(e.id,{...e});else{if(u){let t=await _S(s,e,{config:i,dir:e.dir});l.set(e.id,t)}n.setNode(e.id,{...e})}}));for(let e of r)u&&ev(e)&&await nv(o,e),n.setEdge(e.start,e.end,{...e},e.id),t.edges.some(t=>t.id===e.id)||t.edges.push(e);if(globalThis.mermaidCaptureSizes){let{captureNodeSizes:n}=await Promise.resolve().then(()=>(VOe(),FOe));n(e,t)}return{graph:n,groups:a,nodeElements:l}}function vS({prepareLayout:e,measureLayout:t,runLayoutCore:n,paintLayout:r,afterPaint:i,paintOptions:a}){let o=t??GOe;return p(async function(t,s,l,u){let d=s.select(`g`);sv(d,t.markers,t.type,t.diagramId),WOe();let f={element:d,helpers:l,options:u};f.preparedLayout=await e?.(t,f);let p=await o(t,f),m=await n(t,f),h={...f,measure:p};r?await r(t,h,m):await KOe(t,h,a),await i?.(t,h,m)},`render`)}function WOe(){rye(),hye(),oye(),eke()}async function GOe(e,{element:t}){return await UOe(t,e)}async function KOe(e,t,n={}){let{measure:r}=t,{groups:i}=r;for(let r of n.getNodes?.(e,t)??e.nodes)n.skipNode?.(r,t)||await qOe(i,r,t,n);let a=YOe(e.nodes);for(let r of e.edges)XOe(r,n)||await ZOe(i,r,a,e,n,t)}async function qOe(e,t,n,r){t.clusterNode?R_(t):JOe(t,n,r)?await H_(e.clusters,t):R_(t)}function JOe(e,t,n){return e.isGroup===!0&&(n.isCluster?.(e,t)??!0)}function YOe(e){let t=new Map;for(let n of e)n?.id&&t.set(n.id,n);return t}function XOe(e,t){return e.isLayoutOnly||!!t.skipEdge?.(e)}async function ZOe(e,t,n,r,i,a){let o=ov(e.edgePaths,{...t},i.clusterDb??new Map,r.type,yS(t.start,t,n,a,i),yS(t.end,t,n,a,i),r.diagramId,QOe(t,i));ev(t)&&(Q_.has(t.id)||await nv(e.edgeLabels,t),$Oe(t,o))}function yS(e,t,n,r,i){return i.getEdgeNode?.(e,t,r)??(e?n.get(e)??{}:{})}function QOe(e,t){return typeof t.skipIntersect==`function`?t.skipIntersect(e):t.skipIntersect??!1}function $Oe(e,t){let n=t?.updatedPath??t?.originalPath,r=ms(),{subGraphTitleTotalMargin:i}=I_({flowchart:r.flowchart??{}});if(e.label){let r=Q_.get(e.id),a=e.x,o=e.y;if(n){let r=eh.calcLabelPosition(n);y.debug(`Moving label `+e.label+` from (`,a,`,`,o,`) to (`,r.x,`,`,r.y,`) abc88`),t?.updatedPath&&(a=r.x,o=r.y)}r.attr(`transform`,`translate(${a}, ${o+i/2})`)}if(e?.startLabelLeft){let t=$_.get(e.id).startLeft,r=e?.x,i=e?.y;if(n){let t=eh.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_left`,n);r=t.x,i=t.y}t.attr(`transform`,`translate(${r}, ${i})`)}if(e.startLabelRight){let t=$_.get(e.id).startRight,r=e.x,i=e.y;if(n){let t=eh.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_right`,n);r=t.x,i=t.y}t.attr(`transform`,`translate(${r}, ${i})`)}if(e.endLabelLeft){let t=$_.get(e.id).endLeft,r=e.x,i=e.y;if(n){let t=eh.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_left`,n);r=t.x,i=t.y}t.attr(`transform`,`translate(${r}, ${i})`)}if(e.endLabelRight){let t=$_.get(e.id).endRight,r=e.x,i=e.y;if(n){let t=eh.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_right`,n);r=t.x,i=t.y}t.attr(`transform`,`translate(${r}, ${i})`)}}var bS,xS,SS,eke,CS,tke,wS,TS,nke,ES,DS,rke,OS,kS,AS,jS,ike,MS=o((()=>{U_(),cv(),z_(),P_(),rh(),dc(),S(),h(),mS(),p(gS,`createLayoutElementGroups`),p(HOe,`measureGroupLabel`),p(_S,`insertMeasuredNode`),p(UOe,`createGraphWithElements`),bS=new Map,xS=new Map,SS=new Map,eke=p(()=>{xS.clear(),SS.clear(),bS.clear()},`clear`),CS=p((e,t)=>{let n=xS.get(t)||[];return y.trace(`In isDescendant`,t,` `,e,` = `,n.includes(e)),n.includes(e)},`isDescendant`),tke=p((e,t)=>{let n=xS.get(t)||[];return y.info(`Descendants of `,t,` is `,n),y.info(`Edge is `,e),e.v===t||e.w===t?!1:n?n.includes(e.v)||CS(e.v,t)||CS(e.w,t)||n.includes(e.w):(y.debug(`Tilt, `,t,`,not in descendants`),!1)},`edgeInCluster`),wS=p((e,t,n,r)=>{y.debug(`Copying children of `,e,`root`,r,`data`,t.node(e),r);let i=t.children(e)||[];e!==r&&i.push(e),y.debug(`Copying (nodes) clusterId`,e,`nodes`,i),i.forEach(i=>{if(t.children(i).length>0)wS(i,t,n,r);else{let a=t.node(i);y.info(`cp `,i,` to `,r,` with parent `,e),n.setNode(i,a),r!==t.parent(i)&&(y.debug(`Setting parent`,i,t.parent(i)),n.setParent(i,t.parent(i))),e!==r&&i!==e?(y.debug(`Setting parent`,i,e),n.setParent(i,e)):(y.info(`In copy `,e,`root`,r,`data`,t.node(e),r),y.debug(`Not Setting parent for node=`,i,`cluster!==rootId`,e!==r,`node!==clusterId`,i!==e));let o=t.edges(i);y.debug(`Copying Edges`,o),o.forEach(i=>{y.info(`Edge`,i);let a=t.edge(i.v,i.w,i.name);y.info(`Edge data`,a,r);try{tke(i,r)?(y.info(`Copying as `,i.v,i.w,a,i.name),n.setEdge(i.v,i.w,a,i.name),y.info(`newGraph edges `,n.edges(),n.edge(n.edges()[0]))):y.info(`Skipping copy of edge `,i.v,`-->`,i.w,` rootId: `,r,` clusterId:`,e)}catch(e){y.error(e)}})}y.debug(`Removing node`,i),t.removeNode(i)})},`copy`),TS=p((e,t)=>{let n=t.children(e),r=[...n];for(let i of n)SS.set(i,e),r=[...r,...TS(i,t)];return r},`extractDescendants`),nke=p((e,t,n)=>{let r=e.edges().filter(e=>e.v===t||e.w===t),i=e.edges().filter(e=>e.v===n||e.w===n),a=r.map(e=>({v:e.v===t?n:e.v,w:e.w===t?t:e.w})),o=i.map(e=>({v:e.v,w:e.w}));return a.filter(e=>o.some(t=>e.v===t.v&&e.w===t.w))},`findCommonEdges`),ES=p((e,t,n)=>{let r=t.children(e);if(y.trace(`Searching children of id `,e,r),r.length<1)return e;let i;for(let e of r){let r=ES(e,t,n),a=nke(t,n,r);if(r){if(a.length>0)i=r;else return r}}return i},`findNonClusterChild`),DS=p(e=>!bS.has(e)||!bS.get(e).externalConnections?e:bS.has(e)?bS.get(e).id:e,`getAnchorId`),rke=p((e,t)=>{if(!e||t>10){y.debug(`Opting out, no graph `);return}y.debug(`Opting in, graph `),e.nodes().forEach(function(t){e.children(t).length>0&&(y.debug(`Cluster identified`,t,` Replacement id in edges: `,ES(t,e,t)),xS.set(t,TS(t,e)),bS.set(t,{id:ES(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){let n=e.children(t),r=e.edges();n.length>0?(y.debug(`Cluster identified`,t,xS),r.forEach(e=>{CS(e.v,t)^CS(e.w,t)&&(y.debug(`Edge: `,e,` leaves cluster `,t),y.debug(`Descendants of XXX `,t,`: `,xS.get(t)),bS.get(t).externalConnections=!0)})):y.debug(`Not a cluster `,t,xS)});for(let t of bS.keys()){let n=bS.get(t).id,r=e.parent(n);r!==t&&bS.has(r)&&!bS.get(r).externalConnections&&(bS.get(t).id=r);let i=e.edges().some(e=>e.v===t);if(n&&bS.get(t)?.externalConnections&&i&&jS(e,n,t)){let r=ike(e,t,e.parent(n));r&&(bS.get(t).id=r)}}e.edges().forEach(function(t){let n=e.edge(t);y.debug(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(t)),y.debug(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(e.edge(t)));let r=t.v,i=t.w;if(y.debug(`Fix XXX`,bS,`ids:`,t.v,t.w,`Translating: `,bS.get(t.v),` --- `,bS.get(t.w)),bS.get(t.v)||bS.get(t.w)){if(y.debug(`Fixing and trying - removing XXX`,t.v,t.w,t.name),r=DS(t.v),i=DS(t.w),e.removeEdge(t.v,t.w,t.name),r!==t.v){let i=e.parent(r);bS.get(i).externalConnections=!0,n.fromCluster=t.v}if(i!==t.w){let r=e.parent(i);bS.get(r).externalConnections=!0,n.toCluster=t.w}y.debug(`Fix Replacing with XXX`,r,i,t.name),e.setEdge(r,i,n,t.name)}}),OS(e,0),y.trace(bS)},`adjustClustersAndEdges`),OS=p((e,t)=>{if(t>10){y.error(`Bailing out`);return}let n=e.nodes(),r=!1;for(let t of n){let n=e.children(t);r||=n.length>0}if(!r){y.debug(`Done, no node has children`,e.nodes());return}y.debug(`Nodes = `,n,t);for(let r of n)if(y.debug(`Extracting node`,r,bS,bS.has(r)&&!bS.get(r).externalConnections,!e.parent(r),e.node(r),e.children(`D`),` Depth `,t),!bS.has(r))y.debug(`Not a cluster`,r,t);else if(!bS.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){y.debug(`Cluster without external connections, without a parent and with children`,r,t);let n=e.graph().rankdir===`TB`?`LR`:`TB`;bS.get(r)?.clusterData?.dir&&(n=bS.get(r).clusterData.dir,y.debug(`Fixing dir`,bS.get(r).clusterData.dir,n));let i=new pS({multigraph:!0,compound:!0}).setGraph({rankdir:n,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});wS(r,e,i,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:bS.get(r).clusterData,label:bS.get(r).label,graph:i})}else y.debug(`Cluster ** `,r,` **not meeting the criteria !externalConnections:`,!bS.get(r).externalConnections,` no parent: `,!e.parent(r),` children `,e.children(r)&&e.children(r).length>0,e.children(`D`),t),y.debug(bS);n=e.nodes(),y.debug(`New list of nodes`,n);for(let r of n){let n=e.node(r);y.debug(` Now next level`,r,n),n?.clusterNode&&OS(n.graph,t+1)}},`extractor`),kS=p((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(t=>{let r=kS(e,e.children(t));n=[...n,...r]}),n},`sorter`),AS=p(e=>kS(e,e.children()),`sortNodesByHierarchy`),jS=p((e,t,n)=>{let r=e.parent(t);for(;r&&r!==n;){let t=bS.get(r);if(t&&!t.externalConnections)return!0;r=e.parent(r)}return!1},`isNodeInExtractableCluster`),ike=p((e,t,n)=>{let r=e.children(t)??[];for(let i of r){if(i===n||CS(i,n))continue;let r=ES(i,e,t);if(r&&!jS(e,r,t))return r}return null},`findSafeAnchorNode`),p(vS,`createCommonLayoutRenderer`),p(WOe,`clearLayoutRenderState`),p(GOe,`defaultMeasureLayout`),p(KOe,`paintLayoutData`),p(qOe,`paintLayoutNode`),p(JOe,`shouldPaintAsCluster`),p(YOe,`buildNodeLookup`),p(XOe,`shouldSkipPaintEdge`),p(ZOe,`paintLayoutEdge`),p(yS,`getRenderedNode`),p(QOe,`shouldSkipIntersect`),p($Oe,`positionRenderedEdgeLabel`)}));function ake(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function NS(){if(uke)return nC;uke=1;function e(e){return e==null}p(e,`isNothing`);function t(e){return typeof e==`object`&&!!e}p(t,`isObject`);function n(t){return Array.isArray(t)?t:e(t)?[]:[t]}p(n,`toArray`);function r(e,t){if(t){let n=Object.keys(t);for(let r=0,i=n.length;r<i;r+=1){let i=n[r];e[i]=t[i]}}return e}p(r,`extend`);function i(e,t){let n=``;for(let r=0;r<t;r+=1)n+=e;return n}p(i,`repeat`);function a(e){return e===0&&1/e==-1/0}return p(a,`isNegativeZero`),nC.isNothing=e,nC.isObject=t,nC.toArray=n,nC.repeat=i,nC.isNegativeZero=a,nC.extend=r,nC}function PS(){if(dke)return rC;dke=1;function e(e,t){let n=``,r=e.reason||`(unknown reason)`;return e.mark?(e.mark.name&&(n+=`in "`+e.mark.name+`" `),n+=`(`+(e.mark.line+1)+`:`+(e.mark.column+1)+`)`,!t&&e.mark.snippet&&(n+=`526+527+`+e.mark.snippet),r+` `+n):r}p(e,`formatError`);function t(t,n){Error.call(this),this.name=`YAMLException`,this.reason=t,this.mark=n,this.message=e(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack||``}return p(t,`YAMLException2`),t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=p(function(t){return this.name+`: `+e(this,t)},`toString`),rC=t,rC}function oke(){if(fke)return iC;fke=1;let e=NS();function t(e,t,n,r,i){let a=``,o=``,s=Math.floor(i/2)-1;return r-t>s&&(a=` ... `,t=r-s+a.length),n-r>s&&(o=` ...`,n=r+s-o.length),{str:a+e.slice(t,n).replace(/\t/g,`→`)+o,pos:r-t+a.length}}p(t,`getLine`);function n(t,n){return e.repeat(` `,n-t.length)+t}p(n,`padStart`);function r(r,i){if(i=Object.create(i||null),!r.buffer)return null;i.maxLength||(i.maxLength=79),typeof i.indent!=`number`&&(i.indent=1),typeof i.linesBefore!=`number`&&(i.linesBefore=3),typeof i.linesAfter!=`number`&&(i.linesAfter=2);let a=/\r?\n|\r|\0/g,o=[0],s=[],l,u=-1;for(;l=a.exec(r.buffer);)s.push(l.index),o.push(l.index+l[0].length),r.position<=l.index&&u<0&&(u=o.length-2);u<0&&(u=o.length-1);let d=``,f=Math.min(r.line+i.linesAfter,s.length).toString().length,p=i.maxLength-(i.indent+f+3);for(let a=1;a<=i.linesBefore&&!(u-a<0);a++){let l=t(r.buffer,o[u-a],s[u-a],r.position-(o[u]-o[u-a]),p);d=e.repeat(` `,i.indent)+n((r.line-a+1).toString(),f)+` | `+l.str+`528+`+d}let m=t(r.buffer,o[u],s[u],r.position,p);d+=e.repeat(` `,i.indent)+n((r.line+1).toString(),f)+` | `+m.str+`529+`,d+=e.repeat(`-`,i.indent+f+3+m.pos)+`^530+`;for(let a=1;a<=i.linesAfter&&!(u+a>=s.length);a++){let l=t(r.buffer,o[u+a],s[u+a],r.position-(o[u]-o[u+a]),p);d+=e.repeat(` `,i.indent)+n((r.line+a+1).toString(),f)+` | `+l.str+`531+`}return d.replace(/\n$/,``)}return p(r,`makeSnippet`),iC=r,iC}function FS(){if(pke)return aC;pke=1;let e=PS(),t=[`kind`,`multi`,`resolve`,`construct`,`instanceOf`,`predicate`,`represent`,`representName`,`defaultStyle`,`styleAliases`],n=[`scalar`,`sequence`,`mapping`];function r(e){let t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}p(r,`compileStyleAliases`);function i(i,a){if(a||={},Object.keys(a).forEach(function(n){if(t.indexOf(n)===-1)throw new e(`Unknown option "`+n+`" is met in definition of "`+i+`" YAML type.`)}),this.options=a,this.tag=i,this.kind=a.kind||null,this.resolve=a.resolve||function(){return!0},this.construct=a.construct||function(e){return e},this.instanceOf=a.instanceOf||null,this.predicate=a.predicate||null,this.represent=a.represent||null,this.representName=a.representName||null,this.defaultStyle=a.defaultStyle||null,this.multi=a.multi||!1,this.styleAliases=r(a.styleAliases||null),n.indexOf(this.kind)===-1)throw new e(`Unknown kind "`+this.kind+`" is specified for "`+i+`" YAML type.`)}return p(i,`Type2`),aC=i,aC}function IS(){if(mke)return oC;mke=1;let e=PS(),t=FS();function n(e,t){let n=[];return e[t].forEach(function(e){let t=n.length;n.forEach(function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)}),n[t]=e}),n}p(n,`compileList`);function r(){let e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function t(t){t.multi?(e.multi[t.kind].push(t),e.multi.fallback.push(t)):e[t.kind][t.tag]=e.fallback[t.tag]=t}p(t,`collectType`);for(let e=0,n=arguments.length;e<n;e+=1)arguments[e].forEach(t);return e}p(r,`compileMap`);function i(e){return this.extend(e)}return p(i,`Schema2`),i.prototype.extend=p(function(a){let o=[],s=[];if(a instanceof t)s.push(a);else if(Array.isArray(a))s=s.concat(a);else if(a&&(Array.isArray(a.implicit)||Array.isArray(a.explicit)))a.implicit&&(o=o.concat(a.implicit)),a.explicit&&(s=s.concat(a.explicit));else throw new e(`Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })`);o.forEach(function(n){if(!(n instanceof t))throw new e(`Specified list of YAML types (or a single Type object) contains a non-Type object.`);if(n.loadKind&&n.loadKind!==`scalar`)throw new e(`There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.`);if(n.multi)throw new e(`There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.`)}),s.forEach(function(n){if(!(n instanceof t))throw new e(`Specified list of YAML types (or a single Type object) contains a non-Type object.`)});let l=Object.create(i.prototype);return l.implicit=(this.implicit||[]).concat(o),l.explicit=(this.explicit||[]).concat(s),l.compiledImplicit=n(l,`implicit`),l.compiledExplicit=n(l,`explicit`),l.compiledTypeMap=r(l.compiledImplicit,l.compiledExplicit),l},`extend`),oC=i,oC}function LS(){return hke?sC:(hke=1,sC=new(FS())(`tag:yaml.org,2002:str`,{kind:`scalar`,construct:p(function(e){return e===null?``:e},`construct`)}),sC)}function RS(){return gke?cC:(gke=1,cC=new(FS())(`tag:yaml.org,2002:seq`,{kind:`sequence`,construct:p(function(e){return e===null?[]:e},`construct`)}),cC)}function zS(){return _ke?lC:(_ke=1,lC=new(FS())(`tag:yaml.org,2002:map`,{kind:`mapping`,construct:p(function(e){return e===null?{}:e},`construct`)}),lC)}function BS(){return vke?uC:(vke=1,uC=new(IS())({explicit:[LS(),RS(),zS()]}),uC)}function VS(){if(yke)return dC;yke=1;let e=FS();function t(e){if(e===null)return!0;let t=e.length;return t===1&&e===`~`||t===4&&(e===`null`||e===`Null`||e===`NULL`)}p(t,`resolveYamlNull`);function n(){return null}p(n,`constructYamlNull`);function r(e){return e===null}return p(r,`isNull`),dC=new e(`tag:yaml.org,2002:null`,{kind:`scalar`,resolve:t,construct:n,predicate:r,represent:{canonical:p(function(){return`~`},`canonical`),lowercase:p(function(){return`null`},`lowercase`),uppercase:p(function(){return`NULL`},`uppercase`),camelcase:p(function(){return`Null`},`camelcase`),empty:p(function(){return``},`empty`)},defaultStyle:`lowercase`}),dC}function HS(){if(bke)return fC;bke=1;let e=FS();function t(e){if(e===null)return!1;let t=e.length;return t===4&&(e===`true`||e===`True`||e===`TRUE`)||t===5&&(e===`false`||e===`False`||e===`FALSE`)}p(t,`resolveYamlBoolean`);function n(e){return e===`true`||e===`True`||e===`TRUE`}p(n,`constructYamlBoolean`);function r(e){return Object.prototype.toString.call(e)===`[object Boolean]`}return p(r,`isBoolean`),fC=new e(`tag:yaml.org,2002:bool`,{kind:`scalar`,resolve:t,construct:n,predicate:r,represent:{lowercase:p(function(e){return e?`true`:`false`},`lowercase`),uppercase:p(function(e){return e?`TRUE`:`FALSE`},`uppercase`),camelcase:p(function(e){return e?`True`:`False`},`camelcase`)},defaultStyle:`lowercase`}),fC}function US(){if(xke)return pC;xke=1;let e=NS(),t=FS();function n(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}p(n,`isHexCode`);function r(e){return e>=48&&e<=55}p(r,`isOctCode`);function i(e){return e>=48&&e<=57}p(i,`isDecCode`);function a(e){if(e===null)return!1;let t=e.length,a=0,s=!1;if(!t)return!1;let l=e[a];if((l===`-`||l===`+`)&&(l=e[++a]),l===`0`){if(a+1===t)return!0;if(l=e[++a],l===`b`){for(a++;a<t;a++){if(l=e[a],l!==`0`&&l!==`1`)return!1;s=!0}return s&&isFinite(o(e))}if(l===`x`){for(a++;a<t;a++){if(!n(e.charCodeAt(a)))return!1;s=!0}return s&&isFinite(o(e))}if(l===`o`){for(a++;a<t;a++){if(!r(e.charCodeAt(a)))return!1;s=!0}return s&&isFinite(o(e))}}for(;a<t;a++){if(!i(e.charCodeAt(a)))return!1;s=!0}return s?isFinite(o(e)):!1}p(a,`resolveYamlInteger`);function o(e){let t=e,n=1,r=t[0];if((r===`-`||r===`+`)&&(r===`-`&&(n=-1),t=t.slice(1),r=t[0]),t===`0`)return 0;if(r===`0`){if(t[1]===`b`)return n*parseInt(t.slice(2),2);if(t[1]===`x`)return n*parseInt(t.slice(2),16);if(t[1]===`o`)return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}p(o,`parseYamlInteger`);function s(e){return o(e)}p(s,`constructYamlInteger`);function l(t){return Object.prototype.toString.call(t)===`[object Number]`&&t%1==0&&!e.isNegativeZero(t)}return p(l,`isInteger`),pC=new t(`tag:yaml.org,2002:int`,{kind:`scalar`,resolve:a,construct:s,predicate:l,represent:{binary:p(function(e){return e>=0?`0b`+e.toString(2):`-0b`+e.toString(2).slice(1)},`binary`),octal:p(function(e){return e>=0?`0o`+e.toString(8):`-0o`+e.toString(8).slice(1)},`octal`),decimal:p(function(e){return e.toString(10)},`decimal`),hexadecimal:p(function(e){return e>=0?`0x`+e.toString(16).toUpperCase():`-0x`+e.toString(16).toUpperCase().slice(1)},`hexadecimal`)},defaultStyle:`decimal`,styleAliases:{binary:[2,`bin`],octal:[8,`oct`],decimal:[10,`dec`],hexadecimal:[16,`hex`]}}),pC}function WS(){if(Ske)return mC;Ske=1;let e=NS(),t=FS(),n=RegExp(`^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`),r=RegExp(`^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function i(e){return e===null||!n.test(e)?!1:isFinite(parseFloat(e,10))?!0:r.test(e)}p(i,`resolveYamlFloat`);function a(e){let t=e.toLowerCase(),n=t[0]===`-`?-1:1;return`+-`.indexOf(t[0])>=0&&(t=t.slice(1)),t===`.inf`?n===1?1/0:-1/0:t===`.nan`?NaN:n*parseFloat(t,10)}p(a,`constructYamlFloat`);let o=/^[-+]?[0-9]+e/;function s(t,n){if(isNaN(t))switch(n){case`lowercase`:return`.nan`;case`uppercase`:return`.NAN`;case`camelcase`:return`.NaN`}else if(t===1/0)switch(n){case`lowercase`:return`.inf`;case`uppercase`:return`.INF`;case`camelcase`:return`.Inf`}else if(t===-1/0)switch(n){case`lowercase`:return`-.inf`;case`uppercase`:return`-.INF`;case`camelcase`:return`-.Inf`}else if(e.isNegativeZero(t))return`-0.0`;let r=t.toString(10);return o.test(r)?r.replace(`e`,`.e`):r}p(s,`representYamlFloat`);function l(t){return Object.prototype.toString.call(t)===`[object Number]`&&(t%1!=0||e.isNegativeZero(t))}return p(l,`isFloat`),mC=new t(`tag:yaml.org,2002:float`,{kind:`scalar`,resolve:i,construct:a,predicate:l,represent:s,defaultStyle:`lowercase`}),mC}function GS(){return Cke?hC:(Cke=1,hC=BS().extend({implicit:[VS(),HS(),US(),WS()]}),hC)}function KS(){return wke?gC:(wke=1,gC=GS(),gC)}function qS(){if(Tke)return _C;Tke=1;let e=FS(),t=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$`),n=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$`);function r(e){return e===null?!1:t.exec(e)!==null||n.exec(e)!==null}p(r,`resolveYamlTimestamp`);function i(e){let r=0,i=null,a=t.exec(e);if(a===null&&(a=n.exec(e)),a===null)throw Error(`Date resolve error`);let o=+a[1],s=a[2]-1,l=+a[3];if(!a[4])return new Date(Date.UTC(o,s,l));let u=+a[4],d=+a[5],f=+a[6];if(a[7]){for(r=a[7].slice(0,3);r.length<3;)r+=`0`;r=+r}if(a[9]){let e=+a[10],t=+(a[11]||0);i=(e*60+t)*6e4,a[9]===`-`&&(i=-i)}let p=new Date(Date.UTC(o,s,l,u,d,f,r));return i&&p.setTime(p.getTime()-i),p}p(i,`constructYamlTimestamp`);function a(e){return e.toISOString()}return p(a,`representYamlTimestamp`),_C=new e(`tag:yaml.org,2002:timestamp`,{kind:`scalar`,resolve:r,construct:i,instanceOf:Date,represent:a}),_C}function JS(){if(Eke)return vC;Eke=1;let e=FS();function t(e){return e===`<<`||e===null}return p(t,`resolveYamlMerge`),vC=new e(`tag:yaml.org,2002:merge`,{kind:`scalar`,resolve:t}),vC}function YS(){if(Dke)return yC;Dke=1;let e=FS();function t(e){if(e===null)return!1;let t=0,n=e.length;for(let r=0;r<n;r++){let n=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=532+\r`.indexOf(e.charAt(r));if(!(n>64)){if(n<0)return!1;t+=6}}return t%8==0}p(t,`resolveYamlBinary`);function n(e){let t=e.replace(/[\r\n=]/g,``),n=t.length,r=0,i=[];for(let e=0;e<n;e++)e%4==0&&e&&(i.push(r>>16&255),i.push(r>>8&255),i.push(r&255)),r=r<<6|`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=533+\r`.indexOf(t.charAt(e));let a=n%4*6;return a===0?(i.push(r>>16&255),i.push(r>>8&255),i.push(r&255)):a===18?(i.push(r>>10&255),i.push(r>>2&255)):a===12&&i.push(r>>4&255),new Uint8Array(i)}p(n,`constructYamlBinary`);function r(e){let t=``,n=0,r=e.length,i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=534+\r`;for(let a=0;a<r;a++)a%3==0&&a&&(t+=i[n>>18&63],t+=i[n>>12&63],t+=i[n>>6&63],t+=i[n&63]),n=(n<<8)+e[a];let a=r%3;return a===0?(t+=i[n>>18&63],t+=i[n>>12&63],t+=i[n>>6&63],t+=i[n&63]):a===2?(t+=i[n>>10&63],t+=i[n>>4&63],t+=i[n<<2&63],t+=i[64]):a===1&&(t+=i[n>>2&63],t+=i[n<<4&63],t+=i[64],t+=i[64]),t}p(r,`representYamlBinary`);function i(e){return Object.prototype.toString.call(e)===`[object Uint8Array]`}return p(i,`isBinary`),yC=new e(`tag:yaml.org,2002:binary`,{kind:`scalar`,resolve:t,construct:n,predicate:i,represent:r}),yC}function XS(){if(Oke)return bC;Oke=1;let e=FS(),t=Object.prototype.hasOwnProperty,n=Object.prototype.toString;function r(e){if(e===null)return!0;let r=[],i=e;for(let e=0,a=i.length;e<a;e+=1){let a=i[e],o=!1;if(n.call(a)!==`[object Object]`)return!1;let s;for(s in a)if(t.call(a,s)){if(!o)o=!0;else return!1}if(!o)return!1;if(r.indexOf(s)===-1)r.push(s);else return!1}return!0}p(r,`resolveYamlOmap`);function i(e){return e===null?[]:e}return p(i,`constructYamlOmap`),bC=new e(`tag:yaml.org,2002:omap`,{kind:`sequence`,resolve:r,construct:i}),bC}function ZS(){if(kke)return xC;kke=1;let e=FS(),t=Object.prototype.toString;function n(e){if(e===null)return!0;let n=e,r=Array(n.length);for(let e=0,i=n.length;e<i;e+=1){let i=n[e];if(t.call(i)!==`[object Object]`)return!1;let a=Object.keys(i);if(a.length!==1)return!1;r[e]=[a[0],i[a[0]]]}return!0}p(n,`resolveYamlPairs`);function r(e){if(e===null)return[];let t=e,n=Array(t.length);for(let e=0,r=t.length;e<r;e+=1){let r=t[e],i=Object.keys(r);n[e]=[i[0],r[i[0]]]}return n}return p(r,`constructYamlPairs`),xC=new e(`tag:yaml.org,2002:pairs`,{kind:`sequence`,resolve:n,construct:r}),xC}function QS(){if(Ake)return SC;Ake=1;let e=FS(),t=Object.prototype.hasOwnProperty;function n(e){if(e===null)return!0;let n=e;for(let e in n)if(t.call(n,e)&&n[e]!==null)return!1;return!0}p(n,`resolveYamlSet`);function r(e){return e===null?{}:e}return p(r,`constructYamlSet`),SC=new e(`tag:yaml.org,2002:set`,{kind:`mapping`,resolve:n,construct:r}),SC}function $S(){return jke?CC:(jke=1,CC=KS().extend({implicit:[qS(),JS()],explicit:[YS(),XS(),ZS(),QS()]}),CC)}function ske(){if(Mke)return tC;Mke=1;let e=NS(),t=PS(),n=oke(),r=$S(),i=Object.prototype.hasOwnProperty,a=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,o=/[\x85\u2028\u2029]/,s=/[,\[\]{}]/,l=/^(?:!|!!|![0-9A-Za-z-]+!)$/,u=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function d(e){return Object.prototype.toString.call(e)}p(d,`_class`);function f(e){return e===10||e===13}p(f,`isEol`);function m(e){return e===9||e===32}p(m,`isWhiteSpace`);function h(e){return e===9||e===32||e===10||e===13}p(h,`isWsOrEol`);function g(e){return e===44||e===91||e===93||e===123||e===125}p(g,`isFlowIndicator`);function _(e){if(e>=48&&e<=57)return e-48;let t=e|32;return t>=97&&t<=102?t-97+10:-1}p(_,`fromHexCode`);function v(e){return e===120?2:e===117?4:e===85?8:0}p(v,`escapedHexLen`);function y(e){return e>=48&&e<=57?e-48:-1}p(y,`fromDecimalCode`);function b(e){switch(e){case 48:return`\0`;case 97:return`\x07`;case 98:return`\b`;case 116:return` `;case 9:return` `;case 110:return`535+`;case 118:return`\v`;case 102:return`\f`;case 114:return`\r`;case 101:return`\x1B`;case 32:return` `;case 34:return`"`;case 47:return`/`;case 92:return`\\`;case 78:return`
`;case 95:return`\xA0`;case 76:return`\u2028`;case 80:return`\u2029`;default:return``}}p(b,`simpleEscapeSequence`);function x(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}p(x,`charFromCodepoint`);function S(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}p(S,`setProperty`);let C=Array(256),w=Array(256);for(let e=0;e<256;e++)C[e]=+!!b(e),w[e]=b(e);function T(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||r,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.maxDepth=typeof t.maxDepth==`number`?t.maxDepth:100,this.maxTotalMergeKeys=typeof t.maxTotalMergeKeys==`number`?t.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}p(T,`State`);function E(e,r){let i={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return i.snippet=n(i),new t(r,i)}p(E,`generateError`);function D(e,t){throw E(e,t)}p(D,`throwError`);function O(e,t){e.onWarning&&e.onWarning.call(null,E(e,t))}p(O,`throwWarning`);function k(e,t,n){let r=e.anchorMapTransactions;if(r.length!==0){let n=r[r.length-1];i.call(n,t)||(n[t]={existed:i.call(e.anchorMap,t),value:e.anchorMap[t]})}e.anchorMap[t]=n}p(k,`storeAnchor`);function A(e){e.anchorMapTransactions.push(Object.create(null))}p(A,`beginAnchorTransaction`);function j(e){let t=e.anchorMapTransactions.pop(),n=e.anchorMapTransactions;if(n.length===0)return;let r=n[n.length-1],a=Object.keys(t);for(let e=0,n=a.length;e<n;e+=1){let n=a[e];i.call(r,n)||(r[n]=t[n])}}p(j,`commitAnchorTransaction`);function M(e){let t=e.anchorMapTransactions.pop(),n=Object.keys(t);for(let r=n.length-1;r>=0;--r){let i=t[n[r]];i.existed?e.anchorMap[n[r]]=i.value:delete e.anchorMap[n[r]]}}p(M,`rollbackAnchorTransaction`);function N(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,tag:e.tag,anchor:e.anchor,kind:e.kind,result:e.result}}p(N,`snapshotState`);function P(e,t){e.position=t.position,e.line=t.line,e.lineStart=t.lineStart,e.lineIndent=t.lineIndent,e.firstTabInLine=t.firstTabInLine,e.tag=t.tag,e.anchor=t.anchor,e.kind=t.kind,e.result=t.result}p(P,`restoreState`);let F={YAML:p(function(e,t,n){e.version!==null&&D(e,`duplication of %YAML directive`),n.length!==1&&D(e,`YAML directive accepts exactly one argument`);let r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]);r===null&&D(e,`ill-formed argument of the YAML directive`);let i=parseInt(r[1],10),a=parseInt(r[2],10);i!==1&&D(e,`unacceptable YAML version of the document`),e.version=n[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&O(e,`unsupported YAML version of the document`)},`handleYamlDirective`),TAG:p(function(e,t,n){let r;n.length!==2&&D(e,`TAG directive accepts exactly two arguments`);let a=n[0];r=n[1],l.test(a)||D(e,`ill-formed tag handle (first argument) of the TAG directive`),i.call(e.tagMap,a)&&D(e,`there is a previously declared suffix for "`+a+`" tag handle`),u.test(r)||D(e,`ill-formed tag prefix (second argument) of the TAG directive`);try{r=decodeURIComponent(r)}catch{D(e,`tag prefix is malformed: `+r)}e.tagMap[a]=r},`handleTagDirective`)};function I(e,t,n,r){if(t<n){let i=e.input.slice(t,n);if(r)for(let t=0,n=i.length;t<n;t+=1){let n=i.charCodeAt(t);n===9||n>=32&&n<=1114111||D(e,`expected valid JSON character`)}else a.test(i)&&D(e,`the stream contains non-printable characters`);e.result+=i}}p(I,`captureSegment`);function L(t,n,r,a){e.isObject(r)||D(t,`cannot merge mappings; the provided source object is unacceptable`);let o=Object.keys(r);for(let e=0,s=o.length;e<s;e+=1){let s=o[e];t.maxTotalMergeKeys!==-1&&++t.totalMergeKeys>t.maxTotalMergeKeys&&D(t,`merge keys exceeded maxTotalMergeKeys (`+t.maxTotalMergeKeys+`)`),i.call(n,s)||(S(n,s,r[s]),a[s]=!0)}}p(L,`mergeMappings`);function R(e,t,n,r,a,o,s,l,u){if(Array.isArray(a)){a=Array.prototype.slice.call(a);for(let t=0,n=a.length;t<n;t+=1)Array.isArray(a[t])&&D(e,`nested arrays are not supported inside keys`),typeof a==`object`&&d(a[t])===`[object Object]`&&(a[t]=`[object Object]`)}if(typeof a==`object`&&d(a)===`[object Object]`&&(a=`[object Object]`),a=String(a),t===null&&(t={}),r===`tag:yaml.org,2002:merge`){if(Array.isArray(o))for(let r=0,i=o.length;r<i;r+=1)L(e,t,o[r],n);else L(e,t,o,n)}else!e.json&&!i.call(n,a)&&i.call(t,a)&&(e.line=s||e.line,e.lineStart=l||e.lineStart,e.position=u||e.position,D(e,`duplicated mapping key`)),S(t,a,o),delete n[a];return t}p(R,`storeMappingPair`);function ee(e){let t=e.input.charCodeAt(e.position);t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):D(e,`a line break is expected`),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}p(ee,`readLineBreak`);function z(e,t,n){let r=0,i=e.input.charCodeAt(e.position);for(;i!==0;){for(;m(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(f(i))for(ee(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&O(e,`deficient indentation`),r}p(z,`skipSeparationSpace`);function B(e){let t=e.position,n=e.input.charCodeAt(t);return!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||h(n)))}p(B,`testDocumentSeparator`);function te(t,n){n===1?t.result+=` `:n>1&&(t.result+=e.repeat(`536+`,n-1))}p(te,`writeFoldedLines`);function ne(e,t,n){let r,i,a,o,s,l,u=e.kind,d=e.result,p=e.input.charCodeAt(e.position);if(h(p)||g(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96)return!1;if(p===63||p===45){let t=e.input.charCodeAt(e.position+1);if(h(t)||n&&g(t))return!1}for(e.kind=`scalar`,e.result=``,r=i=e.position,a=!1;p!==0;){if(p===58){let t=e.input.charCodeAt(e.position+1);if(h(t)||n&&g(t))break}else if(p===35){if(h(e.input.charCodeAt(e.position-1)))break}else if(e.position===e.lineStart&&B(e)||n&&g(p))break;else if(f(p)){if(o=e.line,s=e.lineStart,l=e.lineIndent,z(e,!1,-1),e.lineIndent>=t){a=!0,p=e.input.charCodeAt(e.position);continue}e.position=i,e.line=o,e.lineStart=s,e.lineIndent=l;break}a&&=(I(e,r,i,!1),te(e,e.line-o),r=i=e.position,!1),m(p)||(i=e.position+1),p=e.input.charCodeAt(++e.position)}return I(e,r,i,!1),e.result?!0:(e.kind=u,e.result=d,!1)}p(ne,`readPlainScalar`);function re(e,t){let n,r,i=e.input.charCodeAt(e.position);if(i!==39)return!1;for(e.kind=`scalar`,e.result=``,e.position++,n=r=e.position;(i=e.input.charCodeAt(e.position))!==0;)if(i===39){if(I(e,n,e.position,!0),i=e.input.charCodeAt(++e.position),i===39)n=e.position,e.position++,r=e.position;else return!0}else f(i)?(I(e,n,r,!0),te(e,z(e,!1,t)),n=r=e.position):e.position===e.lineStart&&B(e)?D(e,`unexpected end of the document within a single quoted scalar`):(e.position++,m(i)||(r=e.position));D(e,`unexpected end of the stream within a single quoted scalar`)}p(re,`readSingleQuotedScalar`);function ie(e,t){let n,r,i,a=e.input.charCodeAt(e.position);if(a!==34)return!1;for(e.kind=`scalar`,e.result=``,e.position++,n=r=e.position;(a=e.input.charCodeAt(e.position))!==0;)if(a===34)return I(e,n,e.position,!0),e.position++,!0;else if(a===92){if(I(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),f(a))z(e,!1,t);else if(a<256&&C[a])e.result+=w[a],e.position++;else if((i=v(a))>0){let t=i,n=0;for(;t>0;t--)a=e.input.charCodeAt(++e.position),(i=_(a))>=0?n=(n<<4)+i:D(e,`expected hexadecimal character`);e.result+=x(n),e.position++}else D(e,`unknown escape sequence`);n=r=e.position}else f(a)?(I(e,n,r,!0),te(e,z(e,!1,t)),n=r=e.position):e.position===e.lineStart&&B(e)?D(e,`unexpected end of the document within a double quoted scalar`):(e.position++,m(a)||(r=e.position));D(e,`unexpected end of the stream within a double quoted scalar`)}p(ie,`readDoubleQuotedScalar`);function ae(e,t){let n=!0,r,i,a,o=e.tag,s,l=e.anchor,u,d,f,p,m=Object.create(null),g,_,v,y=e.input.charCodeAt(e.position);if(y===91)u=93,p=!1,s=[];else if(y===123)u=125,p=!0,s={};else return!1;for(e.anchor!==null&&k(e,e.anchor,s),y=e.input.charCodeAt(++e.position);y!==0;){if(z(e,!0,t),y=e.input.charCodeAt(e.position),y===u)return e.position++,e.tag=o,e.anchor=l,e.kind=p?`mapping`:`sequence`,e.result=s,!0;n?y===44&&D(e,`expected the node content, but found ','`):D(e,`missed comma between flow collection entries`),_=g=v=null,d=f=!1,y===63&&h(e.input.charCodeAt(e.position+1))&&(d=f=!0,e.position++,z(e,!0,t)),r=e.line,i=e.lineStart,a=e.position,pe(e,t,1,!1,!0),_=e.tag,g=e.result,z(e,!0,t),y=e.input.charCodeAt(e.position),(f||e.line===r)&&y===58&&(d=!0,y=e.input.charCodeAt(++e.position),z(e,!0,t),pe(e,t,1,!1,!0),v=e.result),p?R(e,s,m,_,g,v,r,i,a):d?s.push(R(e,null,m,_,g,v,r,i,a)):s.push(g),z(e,!0,t),y=e.input.charCodeAt(e.position),y===44?(n=!0,y=e.input.charCodeAt(++e.position)):n=!1}D(e,`unexpected end of the stream within a flow collection`)}p(ae,`readFlowCollection`);function oe(t,n){let r,i=1,a=!1,o=!1,s=n,l=0,u=!1,d,p=t.input.charCodeAt(t.position);if(p===124)r=!1;else if(p===62)r=!0;else return!1;for(t.kind=`scalar`,t.result=``;p!==0;)if(p=t.input.charCodeAt(++t.position),p===43||p===45)i===1?i=p===43?3:2:D(t,`repeat of a chomping mode identifier`);else if((d=y(p))>=0)d===0?D(t,`bad explicit indentation width of a block scalar; it cannot be less than one`):o?D(t,`repeat of an indentation width identifier`):(s=n+d-1,o=!0);else break;if(m(p)){do p=t.input.charCodeAt(++t.position);while(m(p));if(p===35)do p=t.input.charCodeAt(++t.position);while(!f(p)&&p!==0)}for(;p!==0;){for(ee(t),t.lineIndent=0,p=t.input.charCodeAt(t.position);(!o||t.lineIndent<s)&&p===32;)t.lineIndent++,p=t.input.charCodeAt(++t.position);if(!o&&t.lineIndent>s&&(s=t.lineIndent),f(p)){l++;continue}if(!o&&s===0&&D(t,`missing indentation for block scalar`),t.lineIndent<s){i===3?t.result+=e.repeat(`537+`,a?1+l:l):i===1&&a&&(t.result+=`538+`);break}r?m(p)?(u=!0,t.result+=e.repeat(`539+`,a?1+l:l)):u?(u=!1,t.result+=e.repeat(`540+`,l+1)):l===0?a&&(t.result+=` `):t.result+=e.repeat(`541+`,l):t.result+=e.repeat(`542+`,a?1+l:l),a=!0,o=!0,l=0;let n=t.position;for(;!f(p)&&p!==0;)p=t.input.charCodeAt(++t.position);I(t,n,t.position,!1)}return!0}p(oe,`readBlockScalar`);function se(e,t){let n=e.tag,r=e.anchor,i=[],a=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&k(e,e.anchor,i);let o=e.input.charCodeAt(e.position);for(;o!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,D(e,`tab characters must not be used in indentation`)),!(o!==45||!h(e.input.charCodeAt(e.position+1))));){if(a=!0,e.position++,z(e,!0,-1)&&e.lineIndent<=t){i.push(null),o=e.input.charCodeAt(e.position);continue}let n=e.line;if(pe(e,t,3,!1,!0),i.push(e.result),z(e,!0,-1),o=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&o!==0)D(e,`bad indentation of a sequence entry`);else if(e.lineIndent<t)break}return a?(e.tag=n,e.anchor=r,e.kind=`sequence`,e.result=i,!0):!1}p(se,`readBlockSequence`);function ce(e,t,n){let r,i,a,o,s=e.tag,l=e.anchor,u={},d=Object.create(null),f=null,p=null,g=null,_=!1,v=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&k(e,e.anchor,u);let y=e.input.charCodeAt(e.position);for(;y!==0;){!_&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,D(e,`tab characters must not be used in indentation`));let b=e.input.charCodeAt(e.position+1),x=e.line;if((y===63||y===58)&&h(b))y===63?(_&&(R(e,u,d,f,p,null,i,a,o),f=p=g=null),v=!0,_=!0,r=!0):_?(_=!1,r=!0):D(e,`incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line`),e.position+=1,y=b;else{if(i=e.line,a=e.lineStart,o=e.position,!pe(e,n,2,!1,!0))break;if(e.line===x){for(y=e.input.charCodeAt(e.position);m(y);)y=e.input.charCodeAt(++e.position);if(y===58)y=e.input.charCodeAt(++e.position),h(y)||D(e,`a whitespace character is expected after the key-value separator within a block mapping`),_&&(R(e,u,d,f,p,null,i,a,o),f=p=g=null),v=!0,_=!1,r=!1,f=e.tag,p=e.result;else if(v)D(e,`can not read an implicit mapping pair; a colon is missed`);else return e.tag=s,e.anchor=l,!0}else if(v)D(e,`can not read a block mapping entry; a multiline key may not be an implicit key`);else return e.tag=s,e.anchor=l,!0}if((e.line===x||e.lineIndent>t)&&(_&&(i=e.line,a=e.lineStart,o=e.position),pe(e,t,4,!0,r)&&(_?p=e.result:g=e.result),_||(R(e,u,d,f,p,g,i,a,o),f=p=g=null),z(e,!0,-1),y=e.input.charCodeAt(e.position)),(e.line===x||e.lineIndent>t)&&y!==0)D(e,`bad indentation of a mapping entry`);else if(e.lineIndent<t)break}return _&&R(e,u,d,f,p,null,i,a,o),v&&(e.tag=s,e.anchor=l,e.kind=`mapping`,e.result=u),v}p(ce,`readBlockMapping`);function le(e){let t=!1,n=!1,r,a,o=e.input.charCodeAt(e.position);if(o!==33)return!1;e.tag!==null&&D(e,`duplication of a tag property`),o=e.input.charCodeAt(++e.position),o===60?(t=!0,o=e.input.charCodeAt(++e.position)):o===33?(n=!0,r=`!!`,o=e.input.charCodeAt(++e.position)):r=`!`;let d=e.position;if(t){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(a=e.input.slice(d,e.position),o=e.input.charCodeAt(++e.position)):D(e,`unexpected end of the stream within a verbatim tag`)}else{for(;o!==0&&!h(o);)o===33&&(n?D(e,`tag suffix cannot contain exclamation marks`):(r=e.input.slice(d-1,e.position+1),l.test(r)||D(e,`named tag handle cannot contain such characters`),n=!0,d=e.position+1)),o=e.input.charCodeAt(++e.position);a=e.input.slice(d,e.position),s.test(a)&&D(e,`tag suffix cannot contain flow indicator characters`)}a&&!u.test(a)&&D(e,`tag name cannot contain such characters: `+a);try{a=decodeURIComponent(a)}catch{D(e,`tag name is malformed: `+a)}return t?e.tag=a:i.call(e.tagMap,r)?e.tag=e.tagMap[r]+a:r===`!`?e.tag=`!`+a:r===`!!`?e.tag=`tag:yaml.org,2002:`+a:D(e,`undeclared tag handle "`+r+`"`),!0}p(le,`readTagProperty`);function ue(e){let t=e.input.charCodeAt(e.position);if(t!==38)return!1;e.anchor!==null&&D(e,`duplication of an anchor property`),t=e.input.charCodeAt(++e.position);let n=e.position;for(;t!==0&&!h(t)&&!g(t);)t=e.input.charCodeAt(++e.position);return e.position===n&&D(e,`name of an anchor node must contain at least one character`),e.anchor=e.input.slice(n,e.position),!0}p(ue,`readAnchorProperty`);function de(e){let t=e.input.charCodeAt(e.position);if(t!==42)return!1;t=e.input.charCodeAt(++e.position);let n=e.position;for(;t!==0&&!h(t)&&!g(t);)t=e.input.charCodeAt(++e.position);e.position===n&&D(e,`name of an alias node must contain at least one character`);let r=e.input.slice(n,e.position);return i.call(e.anchorMap,r)||D(e,`unidentified alias "`+r+`"`),e.result=e.anchorMap[r],z(e,!0,-1),!0}p(de,`readAlias`);function fe(e,t,n,r){let i=N(e);return A(e),P(e,t),e.tag=null,e.anchor=null,e.kind=null,e.result=null,ce(e,n,r)&&e.kind===`mapping`?(j(e),!0):(M(e),P(e,i),!1)}p(fe,`tryReadBlockMappingFromProperty`);function pe(e,t,n,r,a){let o,s,l=1,u=!1,d=!1,f=null,p,m,h;e.depth>=e.maxDepth&&D(e,`nesting exceeded maxDepth (`+e.maxDepth+`)`),e.depth+=1,e.listener!==null&&e.listener(`open`,e),e.tag=null,e.anchor=null,e.kind=null,e.result=null;let g=o=s=n===4||n===3;if(r&&z(e,!0,-1)&&(u=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;;){let n=e.input.charCodeAt(e.position),r=N(e);if(u&&(n===33&&e.tag!==null||n===38&&e.anchor!==null)||!le(e)&&!ue(e))break;f===null&&(f=r),z(e,!0,-1)?(u=!0,s=g,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):s=!1}if(s&&=u||a,l===1||n===4){if(m=n===1||n===2?t:t+1,h=e.position-e.lineStart,l===1){if(s&&(se(e,h)||ce(e,h,m))||ae(e,m))d=!0;else{let t=e.input.charCodeAt(e.position);f!==null&&g&&!s&&t!==124&&t!==62&&fe(e,f,f.position-f.lineStart,m)||o&&oe(e,m)||re(e,m)||ie(e,m)?d=!0:de(e)?(d=!0,(e.tag!==null||e.anchor!==null)&&D(e,`alias node should not have any properties`)):ne(e,m,n===1)&&(d=!0,e.tag===null&&(e.tag=`?`)),e.anchor!==null&&k(e,e.anchor,e.result)}}else l===0&&(d=s&&se(e,h))}if(e.tag===null)e.anchor!==null&&k(e,e.anchor,e.result);else if(e.tag===`?`){e.result!==null&&e.kind!==`scalar`&&D(e,`unacceptable node kind for !<?> tag; it should be "scalar", not "`+e.kind+`"`);for(let t=0,n=e.implicitTypes.length;t<n;t+=1)if(p=e.implicitTypes[t],p.resolve(e.result)){e.result=p.construct(e.result),e.tag=p.tag,e.anchor!==null&&k(e,e.anchor,e.result);break}}else if(e.tag!==`!`){if(i.call(e.typeMap[e.kind||`fallback`],e.tag))p=e.typeMap[e.kind||`fallback`][e.tag];else{p=null;let t=e.typeMap.multi[e.kind||`fallback`];for(let n=0,r=t.length;n<r;n+=1)if(e.tag.slice(0,t[n].tag.length)===t[n].tag){p=t[n];break}}p||D(e,`unknown tag !<`+e.tag+`>`),e.result!==null&&p.kind!==e.kind&&D(e,`unacceptable node kind for !<`+e.tag+`> tag; it should be "`+p.kind+`", not "`+e.kind+`"`),p.resolve(e.result,e.tag)?(e.result=p.construct(e.result,e.tag),e.anchor!==null&&k(e,e.anchor,e.result)):D(e,`cannot resolve a node with !<`+e.tag+`> explicit tag`)}return e.listener!==null&&e.listener(`close`,e),--e.depth,e.tag!==null||e.anchor!==null||d}p(pe,`composeNode`);function me(e){let t=e.position,n=!1,r;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(r=e.input.charCodeAt(e.position))!==0&&(z(e,!0,-1),r=e.input.charCodeAt(e.position),!(e.lineIndent>0||r!==37));){n=!0,r=e.input.charCodeAt(++e.position);let t=e.position;for(;r!==0&&!h(r);)r=e.input.charCodeAt(++e.position);let a=e.input.slice(t,e.position),o=[];for(a.length<1&&D(e,`directive name must not be less than one character in length`);r!==0;){for(;m(r);)r=e.input.charCodeAt(++e.position);if(r===35){do r=e.input.charCodeAt(++e.position);while(r!==0&&!f(r));break}if(f(r))break;for(t=e.position;r!==0&&!h(r);)r=e.input.charCodeAt(++e.position);o.push(e.input.slice(t,e.position))}r!==0&&ee(e),i.call(F,a)?F[a](e,a,o):O(e,`unknown document directive "`+a+`"`)}if(z(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,z(e,!0,-1)):n&&D(e,`directives end mark is expected`),pe(e,e.lineIndent-1,4,!1,!0),z(e,!0,-1),e.checkLineBreaks&&o.test(e.input.slice(t,e.position))&&O(e,`non-ASCII line breaks are interpreted as content`),e.documents.push(e.result),e.position===e.lineStart&&B(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,z(e,!0,-1));return}e.position<e.length-1&&D(e,`end of the stream or a document separator is expected`)}p(me,`readDocument`);function he(e,t){e=String(e),t||={},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`543+`),e.charCodeAt(0)===65279&&(e=e.slice(1)));let n=new T(e,t),r=e.indexOf(`\0`);for(r!==-1&&(n.position=r,D(n,`null byte is not allowed in input`)),n.input+=`\0`;n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)me(n);return n.documents}p(he,`loadDocuments`);function ge(e,t,n){typeof t==`object`&&t&&n===void 0&&(n=t,t=null);let r=he(e,n);if(typeof t!=`function`)return r;for(let e=0,n=r.length;e<n;e+=1)t(r[e])}p(ge,`loadAll2`);function _e(e,n){let r=he(e,n);if(r.length!==0){if(r.length===1)return r[0];throw new t(`expected a single document in the stream, but found more`)}}return p(_e,`load2`),tC.loadAll=ge,tC.load=_e,tC}function cke(){if(Nke)return wC;Nke=1;let e=NS(),t=PS(),n=$S(),r=Object.prototype.toString,i=Object.prototype.hasOwnProperty,a=65279,o={};o[0]=`\\0`,o[7]=`\\a`,o[8]=`\\b`,o[9]=`\\t`,o[10]=`\\n`,o[11]=`\\v`,o[12]=`\\f`,o[13]=`\\r`,o[27]=`\\e`,o[34]=`\\"`,o[92]=`\\\\`,o[133]=`\\N`,o[160]=`\\_`,o[8232]=`\\L`,o[8233]=`\\P`;let s=[`y`,`Y`,`yes`,`Yes`,`YES`,`on`,`On`,`ON`,`n`,`N`,`no`,`No`,`NO`,`off`,`Off`,`OFF`],l=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function u(e,t){if(t===null)return{};let n={},r=Object.keys(t);for(let a=0,o=r.length;a<o;a+=1){let o=r[a],s=String(t[o]);o.slice(0,2)===`!!`&&(o=`tag:yaml.org,2002:`+o.slice(2));let l=e.compiledTypeMap.fallback[o];l&&i.call(l.styleAliases,s)&&(s=l.styleAliases[s]),n[o]=s}return n}p(u,`compileStyleMap`);function d(n){let r,i,a=n.toString(16).toUpperCase();if(n<=255)r=`x`,i=2;else if(n<=65535)r=`u`,i=4;else if(n<=4294967295)r=`U`,i=8;else throw new t(`code point within a string may not be greater than 0xFFFFFFFF`);return`\\`+r+e.repeat(`0`,i-a.length)+a}p(d,`encodeHex`);function f(t){this.schema=t.schema||n,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=e.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=u(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType===`"`?2:1,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer==`function`?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result=``,this.duplicates=[],this.usedDuplicates=null}p(f,`State`);function m(t,n){let r=e.repeat(` `,n),i=0,a=``,o=t.length;for(;i<o;){let e,n=t.indexOf(`544+`,i);n===-1?(e=t.slice(i),i=o):(e=t.slice(i,n+1),i=n+1),e.length&&e!==`545+`&&(a+=r),a+=e}return a}p(m,`indentString`);function h(t,n){return`546+`+e.repeat(` `,t.indent*n)}p(h,`generateNextLine`);function g(e,t){for(let n=0,r=e.implicitTypes.length;n<r;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}p(g,`testImplicitResolving`);function _(e){return e===32||e===9}p(_,`isWhitespace`);function v(e){return e>=32&&e<=126||e>=161&&e<=55295&&e!==8232&&e!==8233||e>=57344&&e<=65533&&e!==a||e>=65536&&e<=1114111}p(v,`isPrintable`);function y(e){return v(e)&&e!==a&&e!==13&&e!==10}p(y,`isNsCharOrWhitespace`);function b(e,t,n){let r=y(e),i=r&&!_(e);return(n?r:r&&e!==44&&e!==91&&e!==93&&e!==123&&e!==125)&&e!==35&&!(t===58&&!i)||y(t)&&!_(t)&&e===35||t===58&&i}p(b,`isPlainSafe`);function x(e){return v(e)&&e!==a&&!_(e)&&e!==45&&e!==63&&e!==58&&e!==44&&e!==91&&e!==93&&e!==123&&e!==125&&e!==35&&e!==38&&e!==42&&e!==33&&e!==124&&e!==61&&e!==62&&e!==39&&e!==34&&e!==37&&e!==64&&e!==96}p(x,`isPlainSafeFirst`);function S(e){return!_(e)&&e!==58}p(S,`isPlainSafeLast`);function C(e,t){let n=e.charCodeAt(t),r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}p(C,`codePointAt`);function w(e){return/^\n* /.test(e)}p(w,`needIndentIndicator`);function T(e,t,n,r,i,a,o,s){let l,u=0,d=null,f=!1,p=!1,m=r!==-1,h=-1,g=x(C(e,0))&&S(C(e,e.length-1));if(t||o)for(l=0;l<e.length;u>=65536?l+=2:l++){if(u=C(e,l),!v(u))return 5;g&&=b(u,d,s),d=u}else{for(l=0;l<e.length;u>=65536?l+=2:l++){if(u=C(e,l),u===10)f=!0,m&&(p||=l-h-1>r&&e[h+1]!==` `,h=l);else if(!v(u))return 5;g&&=b(u,d,s),d=u}p||=m&&l-h-1>r&&e[h+1]!==` `}return!f&&!p?g&&!o&&!i(e)?1:a===2?5:2:n>9&&w(e)?5:o?a===2?5:2:p?4:3}p(T,`chooseScalarStyle`);function E(e,n,r,i,a){e.dump=(function(){if(n.length===0)return e.quotingType===2?`""`:`''`;if(!e.noCompatMode&&(s.indexOf(n)!==-1||l.test(n)))return e.quotingType===2?`"`+n+`"`:`'`+n+`'`;let o=e.indent*Math.max(1,r),u=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),d=i||e.flowLevel>-1&&r>=e.flowLevel;function f(t){return g(e,t)}switch(p(f,`testAmbiguity`),T(n,d,e.indent,u,f,e.quotingType,e.forceQuotes&&!i,a)){case 1:return n;case 2:return`'`+n.replace(/'/g,`''`)+`'`;case 3:return`|`+D(n,e.indent)+O(m(n,o));case 4:return`>`+D(n,e.indent)+O(m(k(n,u),o));case 5:return`"`+j(n)+`"`;default:throw new t(`impossible error: invalid scalar style`)}})()}p(E,`writeScalar`);function D(e,t){let n=w(e)?String(t):``,r=e[e.length-1]===`547+`;return n+(r&&(e[e.length-2]===`548+`||e===`549+`)?`+`:r?``:`-`)+`550+`}p(D,`blockHeader`);function O(e){return e[e.length-1]===`551+`?e.slice(0,-1):e}p(O,`dropEndingNewline`);function k(e,t){let n=/(\n+)([^\n]*)/g,r=(function(){let r=e.indexOf(`552+`);return r=r===-1?e.length:r,n.lastIndex=r,A(e.slice(0,r),t)})(),i=e[0]===`553+`||e[0]===` `,a,o;for(;o=n.exec(e);){let e=o[1],n=o[2];a=n[0]===` `,r+=e+(!i&&!a&&n!==``?`554+`:``)+A(n,t),i=a}return r}p(k,`foldString`);function A(e,t){if(e===``||e[0]===` `)return e;let n=/ [^ ]/g,r,i=0,a,o=0,s=0,l=``;for(;r=n.exec(e);)s=r.index,s-i>t&&(a=o>i?o:s,l+=`555+`+e.slice(i,a),i=a+1),o=s;return l+=`556+`,e.length-i>t&&o>i?l+=e.slice(i,o)+`557+`+e.slice(o+1):l+=e.slice(i),l.slice(1)}p(A,`foldLine`);function j(e){let t=``,n=0;for(let r=0;r<e.length;n>=65536?r+=2:r++){n=C(e,r);let i=o[n];!i&&v(n)?(t+=e[r],n>=65536&&(t+=e[r+1])):t+=i||d(n)}return t}p(j,`escapeString`);function M(e,t,n){let r=``,i=e.tag;for(let i=0,a=n.length;i<a;i+=1){let a=n[i];e.replacer&&(a=e.replacer.call(n,String(i),a)),(L(e,t,a,!1,!1)||a===void 0&&L(e,t,null,!1,!1))&&(r!==``&&(r+=`,`+(e.condenseFlow?``:` `)),r+=e.dump)}e.tag=i,e.dump=`[`+r+`]`}p(M,`writeFlowSequence`);function N(e,t,n,r){let i=``,a=e.tag;for(let a=0,o=n.length;a<o;a+=1){let o=n[a];e.replacer&&(o=e.replacer.call(n,String(a),o)),(L(e,t+1,o,!0,!0,!1,!0)||o===void 0&&L(e,t+1,null,!0,!0,!1,!0))&&((!r||i!==``)&&(i+=h(e,t)),e.dump&&e.dump.charCodeAt(0)===10?i+=`-`:i+=`- `,i+=e.dump)}e.tag=a,e.dump=i||`[]`}p(N,`writeBlockSequence`);function P(e,t,n){let r=``,i=e.tag,a=Object.keys(n);for(let i=0,o=a.length;i<o;i+=1){let o=``;r!==``&&(o+=`, `),e.condenseFlow&&(o+=`"`);let s=a[i],l=n[s];e.replacer&&(l=e.replacer.call(n,s,l)),L(e,t,s,!1,!1)&&(e.dump.length>1024&&(o+=`? `),o+=e.dump+(e.condenseFlow?`"`:``)+`:`+(e.condenseFlow?``:` `),L(e,t,l,!1,!1)&&(o+=e.dump,r+=o))}e.tag=i,e.dump=`{`+r+`}`}p(P,`writeFlowMapping`);function F(e,n,r,i){let a=``,o=e.tag,s=Object.keys(r);if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys==`function`)s.sort(e.sortKeys);else if(e.sortKeys)throw new t(`sortKeys must be a boolean or a function`);for(let t=0,o=s.length;t<o;t+=1){let o=``;(!i||a!==``)&&(o+=h(e,n));let l=s[t],u=r[l];if(e.replacer&&(u=e.replacer.call(r,l,u)),!L(e,n+1,l,!0,!0,!0))continue;let d=e.tag!==null&&e.tag!==`?`||e.dump&&e.dump.length>1024;d&&(e.dump&&e.dump.charCodeAt(0)===10?o+=`?`:o+=`? `),o+=e.dump,d&&(o+=h(e,n)),L(e,n+1,u,!0,d)&&(e.dump&&e.dump.charCodeAt(0)===10?o+=`:`:o+=`: `,o+=e.dump,a+=o)}e.tag=o,e.dump=a||`{}`}p(F,`writeBlockMapping`);function I(e,n,a){let o=a?e.explicitTypes:e.implicitTypes;for(let s=0,l=o.length;s<l;s+=1){let l=o[s];if((l.instanceOf||l.predicate)&&(!l.instanceOf||typeof n==`object`&&n instanceof l.instanceOf)&&(!l.predicate||l.predicate(n))){if(e.tag=a?l.multi&&l.representName?l.representName(n):l.tag:`?`,l.represent){let a=e.styleMap[l.tag]||l.defaultStyle,o;if(r.call(l.represent)===`[object Function]`)o=l.represent(n,a);else if(i.call(l.represent,a))o=l.represent[a](n,a);else throw new t(`!<`+l.tag+`> tag resolver accepts not "`+a+`" style`);e.dump=o}return!0}}return!1}p(I,`detectType`);function L(e,n,i,a,o,s,l){e.tag=null,e.dump=i,I(e,i,!1)||I(e,i,!0);let u=r.call(e.dump),d=a;a&&=e.flowLevel<0||e.flowLevel>n;let f=u===`[object Object]`||u===`[object Array]`,p,m;if(f&&(p=e.duplicates.indexOf(i),m=p!==-1),(e.tag!==null&&e.tag!==`?`||m||e.indent!==2&&n>0)&&(o=!1),m&&e.usedDuplicates[p])e.dump=`*ref_`+p;else{if(f&&m&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),u===`[object Object]`)a&&Object.keys(e.dump).length!==0?(F(e,n,e.dump,o),m&&(e.dump=`&ref_`+p+e.dump)):(P(e,n,e.dump),m&&(e.dump=`&ref_`+p+` `+e.dump));else if(u===`[object Array]`)a&&e.dump.length!==0?(e.noArrayIndent&&!l&&n>0?N(e,n-1,e.dump,o):N(e,n,e.dump,o),m&&(e.dump=`&ref_`+p+e.dump)):(M(e,n,e.dump),m&&(e.dump=`&ref_`+p+` `+e.dump));else if(u===`[object String]`)e.tag!==`?`&&E(e,e.dump,n,s,d);else if(u===`[object Undefined]`)return!1;else{if(e.skipInvalid)return!1;throw new t(`unacceptable kind of an object to dump `+u)}if(e.tag!==null&&e.tag!==`?`){let t=encodeURI(e.tag[0]===`!`?e.tag.slice(1):e.tag).replace(/!/g,`%21`);t=e.tag[0]===`!`?`!`+t:t.slice(0,18)===`tag:yaml.org,2002:`?`!!`+t.slice(18):`!<`+t+`>`,e.dump=t+` `+e.dump}}return!0}p(L,`writeNode`);function R(e,t){let n=[],r=[];ee(e,n,r);let i=r.length;for(let e=0;e<i;e+=1)t.duplicates.push(n[r[e]]);t.usedDuplicates=Array(i)}p(R,`getDuplicateReferences`);function ee(e,t,n){if(typeof e==`object`&&e){let r=t.indexOf(e);if(r!==-1)n.indexOf(r)===-1&&n.push(r);else if(t.push(e),Array.isArray(e))for(let r=0,i=e.length;r<i;r+=1)ee(e[r],t,n);else{let r=Object.keys(e);for(let i=0,a=r.length;i<a;i+=1)ee(e[r[i]],t,n)}}}p(ee,`inspectNode`);function z(e,t){t||={};let n=new f(t);n.noRefs||R(e,n);let r=e;return n.replacer&&(r=n.replacer.call({"":r},``,r)),L(n,0,r,!0,!0)?n.dump+`558+`:``}return p(z,`dump2`),wC.dump=z,wC}function lke(){if(Pke)return eC;Pke=1;let e=ske(),t=cke();function n(e,t){return function(){throw Error(`Function yaml.`+e+` is removed in js-yaml 4. Use yaml.`+t+` instead, which is now safe by default.`)}}return p(n,`renamed`),eC.Type=FS(),eC.Schema=IS(),eC.FAILSAFE_SCHEMA=BS(),eC.JSON_SCHEMA=GS(),eC.CORE_SCHEMA=KS(),eC.DEFAULT_SCHEMA=$S(),eC.load=e.load,eC.loadAll=e.loadAll,eC.dump=t.dump,eC.YAMLException=PS(),eC.types={binary:YS(),float:WS(),map:zS(),null:VS(),pairs:ZS(),set:QS(),timestamp:qS(),bool:HS(),int:US(),merge:JS(),omap:XS(),seq:RS(),str:LS()},eC.safeLoad=n(`safeLoad`,`load`),eC.safeLoadAll=n(`safeLoadAll`,`loadAll`),eC.safeDump=n(`safeDump`,`dump`),eC}var eC,tC,nC,uke,rC,dke,iC,fke,aC,pke,oC,mke,sC,hke,cC,gke,lC,_ke,uC,vke,dC,yke,fC,bke,pC,xke,mC,Ske,hC,Cke,gC,wke,_C,Tke,vC,Eke,yC,Dke,bC,Oke,xC,kke,SC,Ake,CC,jke,Mke,wC,Nke,Pke,Fke,Ike,Lke,TC,Rke,zke,EC,Bke,Vke,Hke,Uke,Wke,Gke,Kke,DC=o((()=>{h(),p(ake,`getDefaultExportFromCjs`),eC={},tC={},nC={},p(NS,`requireCommon`),p(PS,`requireException`),p(oke,`requireSnippet`),p(FS,`requireType`),p(IS,`requireSchema`),p(LS,`requireStr`),p(RS,`requireSeq`),p(zS,`requireMap`),p(BS,`requireFailsafe`),p(VS,`require_null`),p(HS,`requireBool`),p(US,`requireInt`),p(WS,`requireFloat`),p(GS,`requireJson`),p(KS,`requireCore`),p(qS,`requireTimestamp`),p(JS,`requireMerge`),p(YS,`requireBinary`),p(XS,`requireOmap`),p(ZS,`requirePairs`),p(QS,`requireSet`),p($S,`require_default`),p(ske,`requireLoader`),wC={},p(cke,`requireDumper`),p(lke,`requireJsYaml`),{Type:Fke,Schema:Ike,FAILSAFE_SCHEMA:Lke,JSON_SCHEMA:TC,CORE_SCHEMA:Rke,DEFAULT_SCHEMA:zke,load:EC,loadAll:Bke,dump:Vke,YAMLException:Hke,types:Uke,safeLoad:Wke,safeLoadAll:Gke,safeDump:Kke}=ake(lke())}));function qke(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Jke(e,t){if(e!==`_next`&&e!==`_prev`)return t}var Yke,Xke=o((()=>{Yke=class{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,t=e._prev;if(t!==e)return qke(t),t}enqueue(e){var t=this._sentinel;e._prev&&e._next&&qke(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,Jke)),n=n._prev;return`[`+e.join(`, `)+`]`}}}));function Zke(e,t){if(e.nodeCount()<=1)return[];var n=$ke(e,t||eAe);return vb(Rx(Qke(n.graph,n.buckets,n.zeroIdx),function(t){return e.outEdges(t.v,t.w)}))}function Qke(e,t,n){for(var r=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)OC(e,t,n,o);for(;o=i.dequeue();)OC(e,t,n,o);if(e.nodeCount()){for(var s=t.length-2;s>0;--s)if(o=t[s].dequeue(),o){r=r.concat(OC(e,t,n,o,!0));break}}}return r}function OC(e,t,n,r,i){var a=i?[]:void 0;return Fx(e.inEdges(r.v),function(r){var o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,kC(t,n,s)}),Fx(e.outEdges(r.v),function(r){var i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,kC(t,n,o)}),e.removeNode(r.v),a}function $ke(e,t){var n=new pS,r=0,i=0;Fx(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),Fx(e.edges(),function(e){var a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});var a=iS(i+r+3).map(function(){return new Yke}),o=r+1;return Fx(n.nodes(),function(e){kC(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function kC(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}var eAe,tAe=o((()=>{cS(),mS(),Xke(),eAe=qv(1)}));function nAe(e){Fx(e.graph().acyclicer===`greedy`?Zke(e,t(e)):rAe(e),function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,sS(`rev`))});function t(e){return function(t){return e.edge(t).weight}}}function rAe(e){var t=[],n={},r={};function i(a){Object.prototype.hasOwnProperty.call(r,a)||(r[a]=!0,n[a]=!0,Fx(e.outEdges(a),function(e){Object.prototype.hasOwnProperty.call(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return Fx(e.nodes(),i),t}function iAe(e){Fx(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}var aAe=o((()=>{cS(),tAe()}));function AC(e,t,n,r){var i;do i=sS(r);while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function oAe(e){var t=new pS().setGraph(e.graph());return Fx(e.nodes(),function(n){t.setNode(n,e.node(n))}),Fx(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function sAe(e){var t=new pS({multigraph:e.isMultigraph()}).setGraph(e.graph());return Fx(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),Fx(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t}function cAe(e,t){var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);var l,u;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),l=s*i/a,u=s):(i<0&&(o=-o),l=o,u=o*a/i),{x:n+l,y:r+u}}function jC(e){var t=Rx(iS(fAe(e)+1),function(){return[]});return Fx(e.nodes(),function(n){var r=e.node(n),i=r.rank;Bx(i)||(t[i][r.order]=n)}),t}function lAe(e){var t=qx(Rx(e.nodes(),function(t){return e.node(t).rank}));Fx(e.nodes(),function(n){var r=e.node(n);hDe(r,`rank`)&&(r.rank-=t)})}function uAe(e){var t=qx(Rx(e.nodes(),function(t){return e.node(t).rank})),n=[];Fx(e.nodes(),function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=e.graph().nodeRankFactor;Fx(n,function(t,n){Bx(t)&&n%i!==0?--r:r&&Fx(t,function(t){e.node(t).rank+=r})})}function dAe(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),AC(e,`border`,i,t)}function fAe(e){return Gx(Rx(e.nodes(),function(t){var n=e.node(t).rank;if(!Bx(n))return n}))}function pAe(e,t){var n={lhs:[],rhs:[]};return Fx(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function mAe(e,t){var n=Dx();try{return t()}finally{console.log(e+` time: `+(Dx()-n)+`ms`)}}function hAe(e,t){return t()}var MC=o((()=>{cS(),mS()}));function gAe(e){function t(n){var r=e.children(n),i=e.node(n);if(r.length&&Fx(r,t),Object.prototype.hasOwnProperty.call(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)_Ae(e,`borderLeft`,`_bl`,n,i,a),_Ae(e,`borderRight`,`_br`,n,i,a)}}Fx(e.children(),t)}function _Ae(e,t,n,r,i,a){var o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],l=AC(e,`border`,o,n);i[t][a]=l,e.setParent(l,r),s&&e.setEdge(s,l,{weight:1})}var vAe=o((()=>{cS(),MC()}));function yAe(e){var t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&xAe(e)}function bAe(e){var t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&CAe(e),(t===`lr`||t===`rl`)&&(wAe(e),xAe(e))}function xAe(e){Fx(e.nodes(),function(t){SAe(e.node(t))}),Fx(e.edges(),function(t){SAe(e.edge(t))})}function SAe(e){var t=e.width;e.width=e.height,e.height=t}function CAe(e){Fx(e.nodes(),function(t){NC(e.node(t))}),Fx(e.edges(),function(t){var n=e.edge(t);Fx(n.points,NC),Object.prototype.hasOwnProperty.call(n,`y`)&&NC(n)})}function NC(e){e.y=-e.y}function wAe(e){Fx(e.nodes(),function(t){PC(e.node(t))}),Fx(e.edges(),function(t){var n=e.edge(t);Fx(n.points,PC),Object.prototype.hasOwnProperty.call(n,`x`)&&PC(n)})}function PC(e){var t=e.x;e.x=e.y,e.y=t}var TAe=o((()=>{cS()}));function EAe(e){e.graph().dummyChains=[],Fx(e.edges(),function(t){DAe(e,t)})}function DAe(e,t){var n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),l=s.labelRank;if(a!==r+1){e.removeEdge(t);var u=void 0,d,f;for(f=0,++r;r<a;++f,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},d=AC(e,`edge`,u,`_d`),r===l&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,d,{weight:s.weight},o),f===0&&e.graph().dummyChains.push(d),n=d;e.setEdge(n,i,{weight:s.weight},o)}}function OAe(e){Fx(e.graph().dummyChains,function(t){var n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}var kAe=o((()=>{cS(),MC()}));function FC(e){var t={};function n(r){var i=e.node(r);if(Object.prototype.hasOwnProperty.call(t,r))return i.rank;t[r]=!0;var a=qx(Rx(e.outEdges(r),function(t){return n(t.w)-e.edge(t).minlen}));return(a===1/0||a==null)&&(a=0),i.rank=a}Fx(e.sources(),n)}function IC(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var LC=o((()=>{cS()}));function AAe(e){var t=new pS({directed:!1}),n=e.nodes()[0],r=e.nodeCount();t.setNode(n,{});for(var i,a;jAe(t,e)<r;)i=MAe(t,e),a=t.hasNode(i.v)?IC(e,i):-IC(e,i),NAe(t,e,a);return t}function jAe(e,t){function n(r){Fx(t.nodeEdges(r),function(i){var a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!IC(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return Fx(e.nodes(),n),e.nodeCount()}function MAe(e,t){return Jx(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return IC(t,n)})}function NAe(e,t,n){Fx(e.nodes(),function(e){t.node(e).rank+=n})}var PAe=o((()=>{cS(),mS(),LC()})),FAe=o((()=>{cS()})),IAe=o((()=>{FAe()})),LAe=o((()=>{cS()})),RAe=o((()=>{cS()})),zAe=o((()=>{RAe()}));function BAe(e,t,n){Tv(t)||(t=[t]);var r=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],a={};return Fx(t,function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);VAe(e,t,n===`post`,a,r,i)}),i}function VAe(e,t,n,r,i,a){Object.prototype.hasOwnProperty.call(r,t)||(r[t]=!0,n||a.push(t),Fx(i(t),function(t){VAe(e,t,n,r,i,a)}),n&&a.push(t))}var HAe=o((()=>{cS()}));function UAe(e,t){return BAe(e,t,`post`)}var WAe=o((()=>{HAe()}));function GAe(e,t){return BAe(e,t,`pre`)}var KAe=o((()=>{HAe()})),qAe=o((()=>{POe()})),JAe=o((()=>{FAe(),IAe(),LAe(),zAe(),WAe(),KAe(),qAe(),RAe()}));function RC(e){e=oAe(e),FC(e);var t=AAe(e);BC(t),zC(t,e);for(var n,r;n=QAe(t);)r=$Ae(t,e,n),eje(t,e,n,r)}function zC(e,t){var n=UAe(e,e.nodes());n=n.slice(0,n.length-1),Fx(n,function(n){YAe(e,t,n)})}function YAe(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=XAe(e,t,n)}function XAe(e,t,n){var r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;return a||=(i=!1,t.edge(r,n)),o=a.weight,Fx(t.nodeEdges(n),function(a){var s=a.v===n,l=s?a.w:a.v;if(l!==r){var u=s===i,d=t.edge(a).weight;if(o+=u?d:-d,nje(e,n,l)){var f=e.edge(n,l).cutvalue;o+=u?-f:f}}}),o}function BC(e,t){arguments.length<2&&(t=e.nodes()[0]),ZAe(e,{},1,t)}function ZAe(e,t,n,r,i){var a=n,o=e.node(r);return t[r]=!0,Fx(e.neighbors(r),function(i){Object.prototype.hasOwnProperty.call(t,i)||(n=ZAe(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function QAe(e){return Lx(e.edges(),function(t){return e.edge(t).cutvalue<0})}function $Ae(e,t,n){var r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);var a=e.node(r),o=e.node(i),s=a,l=!1;return a.lim>o.lim&&(s=o,l=!0),Jx(Ix(t.edges(),function(t){return l===rje(e,e.node(t.v),s)&&l!==rje(e,e.node(t.w),s)}),function(e){return IC(t,e)})}function eje(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),BC(e),zC(e,t),tje(e,t)}function tje(e,t){var n=GAe(e,Lx(e.nodes(),function(e){return!t.node(e).parent}));n=n.slice(1),Fx(n,function(n){var r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function nje(e,t,n){return e.hasEdge(t,n)}function rje(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var ije=o((()=>{cS(),JAe(),MC(),PAe(),LC(),RC.initLowLimValues=BC,RC.initCutValues=zC,RC.calcCutValue=XAe,RC.leaveEdge=QAe,RC.enterEdge=$Ae,RC.exchangeEdges=eje}));function aje(e){switch(e.graph().ranker){case`network-simplex`:sje(e);break;case`tight-tree`:oje(e);break;case`longest-path`:cje(e);break;default:sje(e)}}function oje(e){FC(e),AAe(e)}function sje(e){RC(e)}var cje,lje=o((()=>{PAe(),ije(),LC(),cje=FC}));function uje(e){var t=AC(e,`root`,{},`_root`),n=fje(e),r=Gx(zx(n))-1,i=2*r+1;e.graph().nestingRoot=t,Fx(e.edges(),function(t){e.edge(t).minlen*=i});var a=pje(e)+1;Fx(e.children(),function(o){dje(e,t,i,a,r,n,o)}),e.graph().nodeRankFactor=i}function dje(e,t,n,r,i,a,o){var s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}var l=dAe(e,`_bt`),u=dAe(e,`_bb`),d=e.node(o);e.setParent(l,o),d.borderTop=l,e.setParent(u,o),d.borderBottom=u,Fx(s,function(s){dje(e,t,n,r,i,a,s);var d=e.node(s),f=d.borderTop?d.borderTop:s,p=d.borderBottom?d.borderBottom:s,m=d.borderTop?r:2*r,h=f===p?i-a[o]+1:1;e.setEdge(l,f,{weight:m,minlen:h,nestingEdge:!0}),e.setEdge(p,u,{weight:m,minlen:h,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,l,{weight:0,minlen:i+a[o]})}function fje(e){var t={};function n(r,i){var a=e.children(r);a&&a.length&&Fx(a,function(e){n(e,i+1)}),t[r]=i}return Fx(e.children(),function(e){n(e,1)}),t}function pje(e){return aS(e.edges(),function(t,n){return t+e.edge(n).weight},0)}function mje(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,Fx(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}var hje=o((()=>{cS(),MC()}));function gje(e,t,n){var r={},i;Fx(n,function(n){for(var a=e.parent(n),o,s;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}var _je=o((()=>{cS()}));function vje(e,t,n){var r=yje(e),i=new pS({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(t){return e.node(t)});return Fx(e.nodes(),function(a){var o=e.node(a),s=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||r),Fx(e[n](a),function(t){var n=t.v===a?t.w:t.v,r=i.edge(n,a),o=Bx(r)?0:r.weight;i.setEdge(n,a,{weight:e.edge(t).weight+o})}),Object.prototype.hasOwnProperty.call(o,`minRank`)&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function yje(e){for(var t;e.hasNode(t=sS(`_root`)););return t}var bje=o((()=>{cS(),mS()}));function xje(e,t){for(var n=0,r=1;r<t.length;++r)n+=Sje(e,t[r-1],t[r]);return n}function Sje(e,t,n){for(var r=OOe(n,Rx(n,function(e,t){return t})),i=vb(Rx(t,function(t){return oS(Rx(e.outEdges(t),function(t){return{pos:r[t.w],weight:e.edge(t).weight}}),`pos`)})),a=1;a<n.length;)a<<=1;var o=2*a-1;--a;var s=Rx(Array(o),function(){return 0}),l=0;return Fx(i.forEach(function(e){var t=e.pos+a;s[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;l+=e.weight*n})),l}var Cje=o((()=>{cS()}));function wje(e){var t={},n=Ix(e.nodes(),function(t){return!e.children(t).length}),r=Gx(Rx(n,function(t){return e.node(t).rank})),i=Rx(iS(r+1),function(){return[]});function a(n){hDe(t,n)||(t[n]=!0,i[e.node(n).rank].push(n),Fx(e.successors(n),a))}return Fx(oS(n,function(t){return e.node(t).rank}),a),i}var Tje=o((()=>{cS()}));function Eje(e,t){return Rx(t,function(t){var n=e.inEdges(t);if(n.length){var r=aS(n,function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}return{v:t}})}var Dje=o((()=>{cS()}));function Oje(e,t){var n={};return Fx(e,function(e,t){var r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};Bx(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)}),Fx(t.edges(),function(e){var t=n[e.v],r=n[e.w];!Bx(t)&&!Bx(r)&&(r.indegree++,t.out.push(n[e.w]))}),kje(Ix(n,function(e){return!e.indegree}))}function kje(e){var t=[];function n(e){return function(t){t.merged||(Bx(t.barycenter)||Bx(e.barycenter)||t.barycenter>=e.barycenter)&&Aje(e,t)}}function r(t){return function(n){n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){var i=e.pop();t.push(i),Fx(i.in.reverse(),n(i)),Fx(i.out,r(i))}return Rx(Ix(t,function(e){return!e.merged}),function(e){return rS(e,[`vs`,`i`,`barycenter`,`weight`])})}function Aje(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}var jje=o((()=>{cS()}));function Mje(e,t){var n=pAe(e,function(e){return Object.prototype.hasOwnProperty.call(e,`barycenter`)}),r=n.lhs,i=oS(n.rhs,function(e){return-e.i}),a=[],o=0,s=0,l=0;r.sort(Pje(!!t)),l=Nje(a,i,l),Fx(r,function(e){l+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,l=Nje(a,i,l)});var u={vs:vb(a)};return s&&(u.barycenter=o/s,u.weight=s),u}function Nje(e,t,n){for(var r;t.length&&(r=Mx(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Pje(e){return function(t,n){return t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}}var Fje=o((()=>{cS(),MC()}));function Ije(e,t,n,r){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,l={};o&&(i=Ix(i,function(e){return e!==o&&e!==s}));var u=Eje(e,i);Fx(u,function(t){if(e.children(t.v).length){var i=Ije(e,t.v,n,r);l[t.v]=i,Object.prototype.hasOwnProperty.call(i,`barycenter`)&&Rje(t,i)}});var d=Oje(u,n);Lje(d,l);var f=Mje(d,r);if(o&&(f.vs=vb([o,f.vs,s]),e.predecessors(o).length)){var p=e.node(e.predecessors(o)[0]),m=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(f,`barycenter`)||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+p.order+m.order)/(f.weight+2),f.weight+=2}return f}function Lje(e,t){Fx(e,function(e){e.vs=vb(e.vs.map(function(e){return t[e]?t[e].vs:e}))})}function Rje(e,t){Bx(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}var zje=o((()=>{cS(),Dje(),jje(),Fje()}));function Bje(e){var t=fAe(e),n=Vje(e,iS(1,t+1),`inEdges`),r=Vje(e,iS(t-1,-1,-1),`outEdges`),i=wje(e);Uje(e,i);for(var a=1/0,o,s=0,l=0;l<4;++s,++l){Hje(s%2?n:r,s%4>=2),i=jC(e);var u=xje(e,i);u<a&&(l=0,o=mTe(i),a=u)}Uje(e,o)}function Vje(e,t,n){return Rx(t,function(t){return vje(e,t,n)})}function Hje(e,t){var n=new pS;Fx(e,function(e){var r=e.graph().root,i=Ije(e,r,n,t);Fx(i.vs,function(t,n){e.node(t).order=n}),gje(e,n,i.vs)})}function Uje(e,t){Fx(t,function(t){Fx(t,function(t,n){e.node(t).order=n})})}var Wje=o((()=>{cS(),mS(),MC(),_je(),bje(),Cje(),Tje(),zje()}));function Gje(e){var t=qje(e);Fx(e.graph().dummyChains,function(n){for(var r=e.node(n),i=r.edgeObj,a=Kje(e,t,i.v,i.w),o=a.path,s=a.lca,l=0,u=o[l],d=!0;n!==i.w;){if(r=e.node(n),d){for(;(u=o[l])!==s&&e.node(u).maxRank<r.rank;)l++;u===s&&(d=!1)}if(!d){for(;l<o.length-1&&e.node(u=o[l+1]).minRank<=r.rank;)l++;u=o[l]}e.setParent(n,u),n=e.successors(n)[0]}})}function Kje(e,t,n,r){var i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),l=n,u;do l=e.parent(l),i.push(l);while(l&&(t[l].low>o||s>t[l].lim));for(u=l,l=r;(l=e.parent(l))!==u;)a.push(l);return{path:i.concat(a.reverse()),lca:u}}function qje(e){var t={},n=0;function r(i){var a=n;Fx(e.children(i),r),t[i]={low:a,lim:n++}}return Fx(e.children(),r),t}var Jje=o((()=>{cS()}));function Yje(e,t){var n={};function r(t,r){var i=0,a=0,o=t.length,s=Mx(r);return Fx(r,function(t,l){var u=Zje(e,t),d=u?e.node(u).order:o;(u||t===s)&&(Fx(r.slice(a,l+1),function(t){Fx(e.predecessors(t),function(r){var a=e.node(r),o=a.order;(o<i||d<o)&&!(a.dummy&&e.node(t).dummy)&&Qje(n,r,t)})}),a=l+1,i=d)}),r}return aS(t,r),n}function Xje(e,t){var n={};function r(t,r,i,a,o){var s;Fx(iS(r,i),function(r){s=t[r],e.node(s).dummy&&Fx(e.predecessors(s),function(t){var r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&Qje(n,t,s)})})}function i(t,n){var i=-1,a,o=0;return Fx(n,function(s,l){if(e.node(s).dummy===`border`){var u=e.predecessors(s);u.length&&(a=e.node(u[0]).order,r(n,o,l,i,a),o=l,i=a)}r(n,o,n.length,a,t.length)}),n}return aS(t,i),n}function Zje(e,t){if(e.node(t).dummy)return Lx(e.predecessors(t),function(t){return e.node(t).dummy})}function Qje(e,t,n){if(t>n){var r=t;t=n,n=r}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function $je(e,t,n){if(t>n){var r=t;t=n,n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}function eMe(e,t,n,r){var i={},a={},o={};return Fx(t,function(e){Fx(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),Fx(t,function(e){var t=-1;Fx(e,function(e){var s=r(e);if(s.length){s=oS(s,function(e){return o[e]});for(var l=(s.length-1)/2,u=Math.floor(l),d=Math.ceil(l);u<=d;++u){var f=s[u];a[e]===e&&t<o[f]&&!$je(n,e,f)&&(a[f]=e,a[e]=i[e]=i[f],t=o[f])}}})}),{root:i,align:a}}function tMe(e,t,n,r,i){var a={},o=nMe(e,t,n,i),s=i?`borderLeft`:`borderRight`;function l(e,t){for(var n=o.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}function u(e){a[e]=o.inEdges(e).reduce(function(e,t){return Math.max(e,a[t.v]+o.edge(t))},0)}function d(t){var n=o.outEdges(t).reduce(function(e,t){return Math.min(e,a[t.w]-o.edge(t))},1/0),r=e.node(t);n!==1/0&&r.borderType!==s&&(a[t]=Math.max(a[t],n))}return l(u,o.predecessors.bind(o)),l(d,o.successors.bind(o)),Fx(r,function(e){a[e]=a[n[e]]}),a}function nMe(e,t,n,r){var i=new pS,a=e.graph(),o=sMe(a.nodesep,a.edgesep,r);return Fx(t,function(t){var r;Fx(t,function(t){var a=n[t];if(i.setNode(a),r){var s=n[r],l=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),l||0))}r=t})}),i}function rMe(e,t){return Jx(zx(t),function(t){var n=-1/0,r=1/0;return oDe(t,function(t,i){var a=cMe(e,i)/2;n=Math.max(t+a,n),r=Math.min(t-a,r)}),n-r})}function iMe(e,t){var n=zx(t),r=qx(n),i=Gx(n);Fx([`u`,`d`],function(n){Fx([`l`,`r`],function(a){var o=n+a,s=e[o],l;if(s!==t){var u=zx(s);l=a===`l`?r-qx(u):i-Gx(u),l&&(e[o]=Hx(s,function(e){return e+l}))}})})}function aMe(e,t){return Hx(e.ul,function(n,r){if(t)return e[t.toLowerCase()][r];var i=oS(Rx(e,r));return(i[1]+i[2])/2})}function oMe(e){var t=jC(e),n=Kx(Yje(e,t),Xje(e,t)),r={},i;return Fx([`u`,`d`],function(a){i=a===`u`?t:zx(t).reverse(),Fx([`l`,`r`],function(t){t===`r`&&(i=Rx(i,function(e){return zx(e).reverse()}));var o=(a===`u`?e.predecessors:e.successors).bind(e),s=eMe(e,i,n,o),l=tMe(e,i,s.root,s.align,t===`r`);t===`r`&&(l=Hx(l,function(e){return-e})),r[a+t]=l})}),iMe(r,rMe(e,r)),aMe(r,e.graph().align)}function sMe(e,t,n){return function(r,i,a){var o=r.node(i),s=r.node(a),l=0,u;if(l+=o.width/2,Object.prototype.hasOwnProperty.call(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:u=-o.width/2;break;case`r`:u=o.width/2}if(u&&(l+=n?u:-u),u=0,l+=(o.dummy?t:e)/2,l+=(s.dummy?t:e)/2,l+=s.width/2,Object.prototype.hasOwnProperty.call(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:u=s.width/2;break;case`r`:u=-s.width/2}return u&&(l+=n?u:-u),u=0,l}}function cMe(e,t){return e.node(t).width}var lMe=o((()=>{cS(),mS(),MC()}));function uMe(e){e=sAe(e),dMe(e),cDe(oMe(e),function(t,n){e.node(n).x=t})}function dMe(e){var t=jC(e),n=e.graph().ranksep,r=0;Fx(t,function(t){var i=Gx(Rx(t,function(t){return e.node(t).height}));Fx(t,function(t){e.node(t).y=r+i/2}),r+=i+n})}var fMe=o((()=>{cS(),MC(),lMe()}));function pMe(e,t){var n=t&&t.debugTiming?mAe:hAe;n(`layout`,()=>{var t=n(` buildLayoutGraph`,()=>gMe(e));n(` runLayout`,()=>mMe(t,n)),n(` updateInputGraph`,()=>hMe(e,t))})}function mMe(e,t){t(` makeSpaceForEdgeLabels`,()=>_Me(e)),t(` removeSelfEdges`,()=>EMe(e)),t(` acyclic`,()=>nAe(e)),t(` nestingGraph.run`,()=>uje(e)),t(` rank`,()=>aje(sAe(e))),t(` injectEdgeLabelProxies`,()=>vMe(e)),t(` removeEmptyRanks`,()=>uAe(e)),t(` nestingGraph.cleanup`,()=>mje(e)),t(` normalizeRanks`,()=>lAe(e)),t(` assignRankMinMax`,()=>yMe(e)),t(` removeEdgeLabelProxies`,()=>bMe(e)),t(` normalize.run`,()=>EAe(e)),t(` parentDummyChains`,()=>Gje(e)),t(` addBorderSegments`,()=>gAe(e)),t(` order`,()=>Bje(e)),t(` insertSelfEdges`,()=>DMe(e)),t(` adjustCoordinateSystem`,()=>yAe(e)),t(` position`,()=>uMe(e)),t(` positionSelfEdges`,()=>OMe(e)),t(` removeBorderNodes`,()=>TMe(e)),t(` normalize.undo`,()=>OAe(e)),t(` fixupEdgeLabelCoords`,()=>CMe(e)),t(` undoCoordinateSystem`,()=>bAe(e)),t(` translateGraph`,()=>xMe(e)),t(` assignNodeIntersects`,()=>SMe(e)),t(` reversePoints`,()=>wMe(e)),t(` acyclic.undo`,()=>iAe(e))}function hMe(e,t){Fx(e.nodes(),function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))}),Fx(e.edges(),function(n){var r=e.edge(n),i=t.edge(n);r.points=i.points,Object.prototype.hasOwnProperty.call(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}function gMe(e){var t=new pS({multigraph:!0,compound:!0}),n=HC(e.graph());return t.setGraph(Kx({},AMe,VC(n,kMe),rS(n,jMe))),Fx(e.nodes(),function(n){var r=HC(e.node(n));t.setNode(n,MEe(VC(r,MMe),NMe)),t.setParent(n,e.parent(n))}),Fx(e.edges(),function(n){var r=HC(e.edge(n));t.setEdge(n,Kx({},FMe,VC(r,PMe),rS(r,IMe)))}),t}function _Me(e){var t=e.graph();t.ranksep/=2,Fx(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function vMe(e){Fx(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v);AC(e,`edge-proxy`,{rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t},`_ep`)}})}function yMe(e){var t=0;Fx(e.nodes(),function(n){var r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Gx(t,r.maxRank))}),e.graph().maxRank=t}function bMe(e){Fx(e.nodes(),function(t){var n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function xMe(e){var t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function l(e){var a=e.x,o=e.y,s=e.width,l=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-l/2),i=Math.max(i,o+l/2)}Fx(e.nodes(),function(t){l(e.node(t))}),Fx(e.edges(),function(t){var n=e.edge(t);Object.prototype.hasOwnProperty.call(n,`x`)&&l(n)}),t-=o,r-=s,Fx(e.nodes(),function(n){var i=e.node(n);i.x-=t,i.y-=r}),Fx(e.edges(),function(n){var i=e.edge(n);Fx(i.points,function(e){e.x-=t,e.y-=r}),Object.prototype.hasOwnProperty.call(i,`x`)&&(i.x-=t),Object.prototype.hasOwnProperty.call(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function SMe(e){Fx(e.edges(),function(t){var n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(cAe(r,a)),n.points.push(cAe(i,o))})}function CMe(e){Fx(e.edges(),function(t){var n=e.edge(t);if(Object.prototype.hasOwnProperty.call(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function wMe(e){Fx(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}function TMe(e){Fx(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(Mx(n.borderLeft)),o=e.node(Mx(n.borderRight));n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),Fx(e.nodes(),function(t){e.node(t).dummy===`border`&&e.removeNode(t)})}function EMe(e){Fx(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function DMe(e){Fx(jC(e),function(t){var n=0;Fx(t,function(t,r){var i=e.node(t);i.order=r+n,Fx(i.selfEdges,function(t){AC(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function OMe(e){Fx(e.nodes(),function(t){var n=e.node(t);if(n.dummy===`selfedge`){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function VC(e,t){return Hx(rS(e,t),Number)}function HC(e){var t={};return Fx(e,function(e,n){t[n.toLowerCase()]=e}),t}var kMe,AMe,jMe,MMe,NMe,PMe,FMe,IMe,LMe=o((()=>{cS(),mS(),vAe(),TAe(),aAe(),kAe(),lje(),hje(),Wje(),Jje(),fMe(),MC(),kMe=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],AMe={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},jMe=[`acyclicer`,`ranker`,`rankdir`,`align`],MMe=[`width`,`height`],NMe={width:0,height:0},PMe=[`minlen`,`weight`,`width`,`height`,`labeloffset`],FMe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},IMe=[`labelpos`]})),RMe=o((()=>{aAe(),LMe(),kAe(),lje()})),zMe=l({applyDagreLayoutResult:()=>YC,getEdgesToRender:()=>GC,measureDagreLayout:()=>ZC,prepareLayoutForDagre:()=>XC,render:()=>YMe,runDagreLayoutCore:()=>QC}),UC,WC,BMe,VMe,HMe,UMe,WMe,GC,KC,qC,GMe,JC,KMe,YC,qMe,JMe,XC,ZC,QC,YMe,XMe=o((()=>{MS(),U_(),cv(),z_(),P_(),Op(),ig(),Gp(),rh(),dc(),S(),h(),RMe(),mS(),UC=p((e,t,n)=>Math.max(t,Math.min(n,e)),`clamp`),WC=p((e=`TB`)=>{switch(e){case`BT`:return`bottom`;case`LR`:return`right`;case`RL`:return`left`;default:return`top`}},`getDefaultSelfLoopSide`),BMe=p(e=>e===`flowchart`||e===`flowchart-v2`||e===`stateDiagram`||e===`er`||e===`classDiagram`,`shouldMergeSelfLoopSegments`),VMe=[`x`,`y`,`width`,`height`,`labelBBox`,`intersect`,`calcIntersect`,`diff`,`clusterNode`],HMe=p((e,t,n,r,i)=>{let a=[],o=new Set;if(n.forEach(({start:e,end:t})=>{e!==r&&o.add(e),t!==r&&o.add(t)}),o.forEach(t=>{let n=e.node(t);typeof n?.x==`number`&&typeof n?.y==`number`&&a.push(n)}),a.length===0&&n.forEach(({edge:e})=>{(e.points??[]).forEach(e=>{typeof e?.x==`number`&&typeof e?.y==`number`&&a.push(e)})}),a.length===0)return WC(i);let s=a.reduce((e,t)=>({x:e.x+t.x/a.length,y:e.y+t.y/a.length}),{x:0,y:0}),l=s.x-t.x,u=s.y-t.y;return Math.abs(l)>Math.abs(u)?l>0?`right`:`left`:Math.abs(u)>0?u>0?`bottom`:`top`:WC(i)},`getSelfLoopSide`),UMe=p((e,t=`top`,n=0,r=0)=>{let i=e.x,a=e.y-n,o=e.width/2,s=e.height/2,l=Math.max(36,Math.min(100,e.width*.8)),u=UC(Math.max(r,e.width*.35),36,l),d=UC(Math.min(e.width,e.height)*.45,24,48);switch(t){case`bottom`:{let e=a+s;return[{x:i-u/2,y:e},{x:i-u/2,y:e+d},{x:i+u/2,y:e+d},{x:i+u/2,y:e}]}case`right`:{let e=i+o;return[{x:e,y:a-u/2},{x:e+d,y:a-u/2},{x:e+d,y:a+u/2},{x:e,y:a+u/2}]}case`left`:{let e=i-o;return[{x:e,y:a-u/2},{x:e-d,y:a-u/2},{x:e-d,y:a+u/2},{x:e,y:a+u/2}]}default:{let e=a-s;return[{x:i-u/2,y:e},{x:i-u/2,y:e-d},{x:i+u/2,y:e-d},{x:i+u/2,y:e}]}}},`getSelfLoopPoints`),WMe=p((e,t,n=`top`,r=0,i={})=>{let a=e.x,o=e.y-r,s=i.width??0,l=i.height??0;switch(n){case`bottom`:return{x:a,y:Math.max(...t.map(e=>e.y))+l/2+4};case`right`:return{x:Math.max(...t.map(e=>e.x))+s/2+4,y:o};case`left`:return{x:Math.min(...t.map(e=>e.x))-s/2-4,y:o};default:return{x:a,y:Math.min(...t.map(e=>e.y))-l/2-4}}},`getSelfLoopLabelPosition`),GC=p((e,t=0,{mergeSelfLoops:n=!0}={})=>{let r=new Map,i=[],a=e.graph()?.rankdir;return e.edges().forEach(t=>{let a=e.edge(t);if(n&&a.selfLoop){let e=a.selfLoop.id;r.has(e)||r.set(e,[]),r.get(e).push({edge:a,start:t.v,end:t.w})}else i.push({edge:a,start:t.v,end:t.w})}),r.forEach(n=>{if(n.length!==3){n.forEach(e=>i.push(e));return}n.sort((e,t)=>e.edge.selfLoop.order-t.edge.selfLoop.order);let[r,o,s]=n,l=r.edge.originalEdge??o.edge.originalEdge??s.edge.originalEdge??o.edge,u=e.node(l.start);if(!u){n.forEach(e=>i.push(e));return}let d={width:o.edge.width,height:o.edge.height},f=HMe(e,u,n,l.start,a),p=UMe(u,f,t,d.width??0),m=WMe(u,p,f,t,d),h={...o.edge,...l,id:l.id,points:p,start:l.start,end:l.end,x:m.x,y:m.y,width:d.width,height:d.height,labelStyle:o.edge.labelStyle,fromCluster:r.edge.fromCluster??o.edge.fromCluster??s.edge.fromCluster,toCluster:r.edge.toCluster??o.edge.toCluster??s.edge.toCluster};delete h.selfLoop,delete h.originalEdge,i.push({edge:h,start:h.start,end:h.end})}),i},`getEdgesToRender`),KC=p(async({element:e,graph:t,diagramType:n,id:r,parentCluster:i,siteConfig:a})=>{let o=t.graph().rankdir;y.trace(`Dir in recursive render - dir:`,o);let{clusters:s,edgePaths:l,edgeLabels:u,nodes:d,rootGroups:f}=gS(e,{edgePathsClass:`edgePaths`});t.nodes()?y.info(`Recursive render XXX`,t.nodes()):y.info(`No nodes found for`,t),t.edges().length>0&&y.info(`Recursive edges`,t.edge(t.edges()[0]));let m=BMe(n);await Promise.all(t.nodes().map(async function(e){let s=t.node(e);if(i!==void 0){let n=JSON.parse(JSON.stringify(i.clusterData));y.trace(`Setting data for parent cluster XXX559+ Node.id = `,e,`560+ data=`,n.height,`561+Parent cluster`,i.height),t.setNode(i.id,n),t.parent(e)||(y.trace(`Setting parent`,e,i.id),t.setParent(e,i.id,n))}if(y.info(`(Insert) Node XXX`+e+`: `+JSON.stringify(t.node(e))),s?.clusterNode){y.info(`Cluster identified XBX`,e,s.width,t.node(e));let{ranksep:i,nodesep:o}=t.graph();s.graph.setGraph({...s.graph.graph(),ranksep:i+25,nodesep:o});let l=await JMe({element:d,graph:s.graph,diagramType:n,id:r,parentCluster:t.node(e),siteConfig:a}),u=l.elem;a_(s,u),s.diff=l.diff||0,y.info(`New compound node after recursive render XAX`,e,`width`,s.width,`height`,s.height),nye(u,s)}else t.children(e).length>0?(y.trace(`Cluster - the non recursive path XBX`,e,s.id,s,s.width,`Graph:`,t),y.trace(ES(s.id,t)),bS.set(s.id,{id:ES(s.id,t),node:s})):(y.trace(`Node - the non recursive path XAX`,e,d,t.node(e),o),await _S(d,t.node(e),{config:a,dir:o}))})),await p(async()=>{let e=t.edges().map(async function(e){let n=t.edge(e.v,e.w,e.name);if(y.info(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(e)),y.info(`Edge `+e.v+` -> `+e.w+`: `,e,` `,JSON.stringify(t.edge(e))),y.info(`Fix`,bS,`ids:`,e.v,e.w,`Translating: `,bS.get(e.v),bS.get(e.w)),m&&n.selfLoop){if(n.selfLoop.order!==1)return;let e={...n.originalEdge,...n,id:n.selfLoop.id,startLabelLeft:n.originalEdge?.startLabelLeft??n.startLabelLeft,startLabelRight:n.originalEdge?.startLabelRight??n.startLabelRight,endLabelLeft:n.originalEdge?.endLabelLeft??n.endLabelLeft,endLabelRight:n.originalEdge?.endLabelRight??n.endLabelRight};await nv(u,e),n.width=e.width,n.height=e.height,n.labelStyle=e.labelStyle;return}await nv(u,n)});await Promise.all(e)},`processEdges`)();let{subGraphTitleTotalMargin:h}=I_(a);return{elem:f,graph:t,groups:{clusters:s,edgePaths:l,edgeLabels:u,nodes:d,rootGroups:f},diagramType:n,id:r,mergeSelfLoops:m,subGraphTitleTotalMargin:h}},`measureDagreGraph`),qC=p(e=>{y.info(`############################################# XXX`),y.info(`### Layout ### XXX`),y.info(`############################################# XXX`),pMe(e)},`runDagreGraphLayout`),GMe=p((e,t,n)=>{let r=e.node(t);if(!r)return;let i={...r};return r?.clusterNode?i.y=(r.y??0)+n:e.children(t).length>0?i.height=(r.height??0)+n:i.y=(r.y??0)+n/2,i},`normalizeDagreNode`),JC=p((e,t)=>{VMe.forEach(n=>{t[n]!==void 0&&(e[n]=t[n])})},`applyDagreNodeLayout`),KMe=p((e,t,n,r)=>({...e,start:e.start??t,end:e.end??n,points:(e.points??[]).map(e=>({...e,y:typeof e.y==`number`?e.y+r:e.y}))}),`normalizeDagreEdge`),YC=p((e,t)=>{let{graph:n,mergeSelfLoops:r,subGraphTitleTotalMargin:i=0}=t,a=new Map(e.nodes.map(e=>[e.id,e]));AS(n).forEach(e=>{let t=GMe(n,e,i);if(!t)return;JC(n.node(e),t);let r=a.get(e);r&&JC(r,t)});let o=i/2;return e.edges=GC(n,o,{mergeSelfLoops:r}).map(({edge:e,start:t,end:n})=>KMe(e,t,n,o)),e},`applyDagreLayoutResult`),qMe=p(async({elem:e,graph:t,groups:{clusters:n,edgePaths:r},diagramType:i,id:a,mergeSelfLoops:o,subGraphTitleTotalMargin:s})=>{let l=0;await Promise.all(AS(t).map(async function(e){let r=t.node(e);if(y.info(`Position XBX => `+e+`: (`+r.x,`,`+r.y,`) width: `,r.width,` height: `,r.height),r?.clusterNode)r.y+=s,y.info(`A tainted cluster node XBX1`,e,r.id,r.width,r.height,r.x,r.y,t.parent(e)),bS.get(r.id).node=r,R_(r);else if(t.children(e).length>0){y.info(`A pure cluster node XBX1`,e,r.id,r.x,r.y,r.width,r.height,t.parent(e)),r.height+=s,t.node(r.parentId);let i=r?.padding/2||0,a=r?.labelBBox?.height||0,o=a-i||0;y.debug(`OffsetY`,o,`labelHeight`,a,`halfPadding`,i),await H_(n,r),bS.get(r.id).node=r}else{let e=t.node(r.parentId);r.y+=s/2,y.info(`A regular node XBX1 - using the padding`,r.id,`parent`,r.parentId,r.width,r.height,r.x,r.y,`offsetY`,r.offsetY,`parent`,e,e?.offsetY,r),R_(r)}}));let u=s/2;return GC(t,u,{mergeSelfLoops:o}).forEach(function({edge:e,start:n,end:o}){y.info(`Edge `+n+` -> `+o+`: `+JSON.stringify(e),e),e.points.forEach(e=>e.y+=u);let s=t.node(n),l=t.node(o),d=ov(r,e,bS,i,s,l,a);rv(e,d)}),t.nodes().forEach(function(e){let n=t.node(e);y.info(e,n.type,n.diff),n.isGroup&&(l=n.diff)}),y.warn(`Returning from recursive render XAX`,e,l),{elem:e,diff:l}},`paintDagreLayoutCore`),JMe=p(async e=>{let t=await KC(e);return qC(t.graph),await qMe(t)},`renderDagreSubgraph`),XC=p(e=>{let t=new pS({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.nodeSpacing||e.config?.flowchart?.nodeSpacing,ranksep:e.config?.rankSpacing||e.rankSpacing||e.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return e.nodes.forEach(e=>{t.setNode(e.id,{...e}),e.parentId&&t.setParent(e.id,e.parentId)}),y.debug(`Edges:`,e.edges),e.edges.forEach(e=>{if(e.start===e.end){let n=e.start,r=n+`---`+n+`---1`,i=n+`---`+n+`---2`,a=t.node(n);t.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:``,label:``,padding:0,shape:`labelRect`,style:``,width:10,height:10}),t.setParent(r,a.parentId),t.setNode(i,{domId:i,id:i,parentId:a.parentId,labelStyle:``,padding:0,shape:`labelRect`,label:``,style:``,width:10,height:10}),t.setParent(i,a.parentId);let o=structuredClone(e),s=structuredClone(e),l=structuredClone(e),u=structuredClone(e);s.originalEdge=o,s.selfLoop={id:o.id,order:0},l.originalEdge=o,l.selfLoop={id:o.id,order:1},u.originalEdge=o,u.selfLoop={id:o.id,order:2},s.label=``,s.arrowTypeEnd=`none`,s.endLabelLeft=``,s.endLabelRight=``,s.startLabelLeft=``,s.id=n+`-cyclic-special-1`,l.startLabelRight=``,l.startLabelLeft=``,l.endLabelLeft=``,l.endLabelRight=``,l.arrowTypeStart=`none`,l.arrowTypeEnd=`none`,l.id=n+`-cyclic-special-mid`,u.label=``,u.startLabelRight=``,u.startLabelLeft=``,u.arrowTypeStart=`none`,a.isGroup&&(s.fromCluster=n,u.toCluster=n),u.id=n+`-cyclic-special-2`,u.arrowTypeStart=`none`,t.setEdge(n,r,s,n+`-cyclic-special-0`),t.setEdge(r,i,l,n+`-cyclic-special-1`),t.setEdge(i,n,u,n+`-cyclic-special-2`)}else t.setEdge(e.start,e.end,{...e},e.id)}),rke(t),{graph:t}},`prepareLayoutForDagre`),ZC=p(async(e,{element:t,preparedLayout:n})=>{let r=n??XC(e),i=Z(),a=await KC({element:t,graph:r.graph,diagramType:e.type,id:e.diagramId,parentCluster:void 0,siteConfig:i});return r.measuredLayout=a,a},`measureDagreLayout`),QC=p((e,t)=>{let n=t.preparedLayout?.measuredLayout;if(!n)throw Error(`runDagreLayoutCore requires measureDagreLayout to run first`);return qC(n.graph),YC(e,n),n},`runDagreLayoutCore`),YMe=vS({prepareLayout:XC,measureLayout:ZC,runLayoutCore:QC,paintOptions:{clusterDb:bS,getNodes:p((e,{measure:t})=>AS(t.graph).map(e=>t.graph.node(e)).filter(Boolean),`getDagrePaintNodes`),getEdgeNode:p((e,t,{measure:n})=>e?n.graph.node(e):void 0,`getDagreEdgeNode`),skipNode:p((e,{measure:t})=>!t.graph.hasNode(e.id),`skipNode`),isCluster:p((e,{measure:t})=>t.graph.hasNode(e.id)&&(t.graph.children(e.id)??[]).length>0,`isCluster`)}})})),ZMe=l({render:()=>zPe});function $C(e){let t=[];for(let n=0;n<e.length-1;n++)t.push({a:e[n],b:e[n+1]});return t}function QMe(e,t,n,r){let i=t.x-e.x,a=t.y-e.y,o=r.x-n.x,s=r.y-n.y,l=i*s-a*o;if(l===0)return null;let u=n.x-e.x,d=n.y-e.y,f=(u*s-d*o)/l,p=(u*a-d*i)/l;return f<=BT||f>=1-BT||p<=BT||p>=1-BT?null:{point:{x:e.x+f*i,y:e.y+f*a},tA:f,tB:p}}function ew(e){return Math.abs(e.b.x-e.a.x)>=Math.abs(e.b.y-e.a.y)}function $Me(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=$C(r.points);for(let a=n+1;a<e.length;a++){let n=e[a],o=$C(n.points);for(let[e,a]of i.entries())for(let[i,s]of o.entries()){let o=QMe(a.a,a.b,s.a,s.b);if(!o)continue;let l=ew(a);l!==ew(s)&&l?t.push({jumpEdgeId:r.id,otherEdgeId:n.id,segIndex:e,t:o.tA,point:o.point}):t.push({jumpEdgeId:n.id,otherEdgeId:r.id,segIndex:i,t:o.tB,point:o.point})}}}return t}function tw(e){return`${Math.round(e*1e3)/1e3}`}function nw(e){return`${tw(e.x)},${tw(e.y)}`}function eNe(e){let t=e.b.x-e.a.x,n=e.b.y-e.a.y;return Math.abs(t)>=Math.abs(n)?+(t>=0):+(n>=0)}function tNe(e,t){if(e.length<2)return e.map(e=>({...e}));let n=e.map(e=>({...e})),r=t.arrowTypeStart&&J_[t.arrowTypeStart];if(r){let t=e[0],i=e[1],a=Math.atan2(i.y-t.y,i.x-t.x);n[0].x=t.x+r*Math.cos(a),n[0].y=t.y+r*Math.sin(a)}let i=t.arrowTypeEnd&&J_[t.arrowTypeEnd];if(i){let t=e.length,r=e[t-2],a=e[t-1],o=Math.atan2(a.y-r.y,a.x-r.x);n[t-1].x=a.x-i*Math.cos(o),n[t-1].y=a.y-i*Math.sin(o)}return n}function nNe(e,t,n,r,i){let a=e.point.x,o=e.point.y,s={x:a-t*e.r,y:o-n*e.r},l={x:a+t*e.r,y:o+n*e.r},u=[`L${nw(s)}`];return i===`arc`?u.push(`A${tw(e.r)},${tw(e.r)} 0 0 ${r} ${nw(l)}`):u.push(`M${nw(l)}`),u}function rw(e,t,n,r){let i=t.x-e.x,a=t.y-e.y,o=n.x-t.x,s=n.y-t.y,l=Math.hypot(i,a),u=Math.hypot(o,s);if(l<zT||u<zT)return null;let d=i/l,f=a/l,p=o/u,m=s/u,h=d*p+f*m,g=Math.acos(Math.max(-1,Math.min(1,h)));if(g<zT||Math.abs(Math.PI-g)<zT)return null;let _=Math.min(r/Math.sin(g/2),l/2,u/2);return{startX:t.x-d*_,startY:t.y-f*_,endX:t.x+p*_,endY:t.y+m*_,ctrlX:t.x,ctrlY:t.y,cutLen:_}}function rNe(e,t,n){let r=e.points;if(r.length<2)return``;let i=tNe(r,e),a=e.curve===`rounded`,o=$C(i),s=new Map;for(let e of t){let t=o[e.segIndex];if(!t)continue;let r=Math.hypot(t.b.x-t.a.x,t.b.y-t.a.y),i=s.get(e.segIndex)??[];i.push({t:e.t,point:e.point,d:e.t*r,r:n.jumpRadius}),s.set(e.segIndex,i)}let l=[`M${nw(i[0])}`];for(let e=0;e<o.length;e++){let t=o[e],r=Math.hypot(t.b.x-t.a.x,t.b.y-t.a.y),u=r===0?0:(t.b.x-t.a.x)/r,d=r===0?0:(t.b.y-t.a.y)/r,f=eNe(t),p=0;if(a&&e>0){let t=rw(i[e-1],i[e],i[e+1]??i[e],RT);t&&(p=t.cutLen)}let m=r,h=null;a&&e<o.length-1&&(h=rw(i[e],i[e+1],i[e+2]??i[e+1],RT),h&&(m=r-h.cutLen));let g=[...s.get(e)??[]].sort((e,t)=>e.t-t.t);for(let e of g)e.r=Math.min(e.r,e.d-p,m-e.d);for(let e=0;e<g.length-1;e++){let t=g[e+1].d-g[e].d;if(g[e].r+g[e+1].r>t){let n=t/2;g[e].r=Math.min(g[e].r,n),g[e+1].r=Math.min(g[e+1].r,n)}}for(let e of g)e.r<APe||l.push(...nNe(e,u,d,f,n.jumpStyle));a&&h?(l.push(`L${tw(h.startX)},${tw(h.startY)}`),l.push(`Q${tw(h.ctrlX)},${tw(h.ctrlY)} ${tw(h.endX)},${tw(h.endY)}`)):l.push(`L${nw(t.b)}`)}return l.join(` `)}function iNe(e){return/^[\d\s+,.LMelm-]*$/.test(e)}function aNe(e){return!e||e===`linear`||e===`rounded`||e===`step`||e===`stepBefore`||e===`stepAfter`}function oNe(e){if(!e)return null;try{let t=typeof atob==`function`?atob(e):Buffer.from(e,`base64`).toString(),n=JSON.parse(t);if(!Array.isArray(n))return null;let r=[];for(let e of n)e&&typeof e.x==`number`&&typeof e.y==`number`&&r.push({x:e.x,y:e.y});return r.length>=2?r:null}catch{return null}}function sNe(e,t,n){if(!n.enabled)return;let r=e.node();if(!r)return;let i=new Map;for(let e of t)i.set(e.id,e);let a=[],o=new Map;for(let e of t){let t=typeof CSS<`u`&&CSS.escape?CSS.escape(e.id):e.id,n=r.querySelector(`path[data-id="${t}"]`);if(!n)continue;o.set(e.id,n);let i=oNe(n.getAttribute(`data-points`))??e.points;a.push({...e,points:i})}let s=$Me(a);if(s.length===0)return;let l=new Map;for(let e of s){let t=l.get(e.jumpEdgeId)??[];t.push(e),l.set(e.jumpEdgeId,t)}for(let e of a){let t=l.get(e.id);if(!t||t.length===0)continue;let r=i.get(e.id)?.curve;if(r!==void 0&&!aNe(r))continue;let a=o.get(e.id);if(!a||r===void 0&&!iNe(a.getAttribute(`d`)??``))continue;let s=a.getAttribute(`style`)??``,u=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(s),d=u?Number.parseFloat(u[1]):null,f=u?Number.parseFloat(u[2]):null,p=rNe(e,t,n);if(a.setAttribute(`d`,p),d!==null&&f!==null&&typeof a.getTotalLength==`function`){let e=a.getTotalLength(),t=`0 ${d} ${Math.max(0,e-d-f)} ${f}`,n=s.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${t};`).replace(/;\s*;+/g,`;`);a.setAttribute(`style`,n)}}}function cNe(e,{measure:t}){let n=e.config?.swimlane?.lineHops;if(n===!1)return;let r=n===`gap`?`gap`:`arc`,i=e.edges.filter(e=>Array.isArray(e.points)&&e.points.length>=2).map(e=>({id:e.id,points:e.points,curve:e.curve,arrowTypeStart:e.arrowTypeStart,arrowTypeEnd:e.arrowTypeEnd}));sNe(t.groups.edgePaths,i,{enabled:!0,jumpRadius:6,jumpStyle:r})}function iw(e){return Math.max(e.padding??HT,HT)}function lNe(e){let{x:t,y:n,width:r,height:i}=e,a=e.swimlaneContentTop;if(typeof t!=`number`||typeof n!=`number`||typeof r!=`number`||typeof i!=`number`||typeof a!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a)||r<=0||i<=0){delete e.groupTitleRect;return}let o=n-i/2,s=Math.min(a,n+i/2),l=o+Math.min(jPe,Math.max(0,s-o));if(l<=o){delete e.groupTitleRect;return}e.groupTitleRect={left:t-r/2,right:t+r/2,top:o,bottom:l}}function uNe(e){let t=e.direction,n=e.nodes??=[];for(let n of e.nodes??[])n.isGroup&&!n.parentId&&(n.shape=`swimlane`,t&&(n.direction=t));let r=n.filter(e=>!e.isGroup&&!e.parentId);if(r.length===0)return;let i=n.find(e=>e.id===VT);i?i.isGroup&&(i.shape=`swimlane`,t&&(i.direction=t)):(i={id:VT,label:``,isGroup:!0,shape:`swimlane`,padding:20,...t?{direction:t}:{}},n.push(i));for(let e of r)e.parentId=VT}function dNe(e){let t=new Map;for(let n of e.nodes??[])t.set(n.id,n);let n=[];for(let t of e.edges??[]){let e=typeof t.start==`string`?t.start:void 0,r=typeof t.end==`string`?t.end:void 0;!e||!r||t.labelNodeId||n.push({id:t.id,src:e,dst:r,ref:t})}let r=e.nodes??[],i=r.filter(e=>e.isGroup),a=r.filter(e=>!e.isGroup);return{nodes:[...[...i].reverse(),...a].map(e=>e.id),edges:n,layout:e,nodeById:t}}function fNe(e,t,n,r){let{layout:i}=e,a=e.nodeById,o=r?.layerGap??100,s=r?.nodeGap??40,l=0;for(let e of t.layers){let t=0;for(let r of e){let e=a.get(r);if(!e){t++;continue}e.layer=l,e.order=t;let i=n.x[r]??t*s,u=n.y[r]??l*o;e.x=i,e.y=u,t++}l++}let u=i.nodes??[],d=new Map,f=[];for(let e of u){if(!e?.isGroup)continue;e.parentId||f.push(e);let t=u.filter(t=>t.parentId===e.id),r=1/0,i=-1/0,a=1/0,o=-1/0;for(let e of t){let t=e.x??n.x[e.id],s=e.y??n.y[e.id],l=e.width??0,u=e.height??0;t!=null&&s!=null&&(r=Math.min(r,t-l/2),i=Math.max(i,t+l/2),a=Math.min(a,s-u/2),o=Math.max(o,s+u/2))}if(r===1/0||a===1/0)e.x=e.x??0,e.y=e.y??0,e.width=e.width??0,e.height=e.height??0;else{let t=e.padding??20,n=e.parentId?t:2*iw(e),s=t,l=Math.max(0,i-r)+n,u=Math.max(0,o-a)+s,f=(r+i)/2,p=(a+o)/2;e.x=f,e.y=p,e.width=l,e.height=u,d.set(e.id,{minX:r,maxX:i,minY:a,maxY:o})}}if(f.length>0&&d.size>0){let e=1/0,t=-1/0,n=0;for(let r of f){let i=r.padding??20;i>n&&(n=i);let a=d.get(r.id);a&&(e=Math.min(e,a.minY),t=Math.max(t,a.maxY))}if(e!==1/0&&t!==-1/0){let r=Math.max(0,t-e)+2*Math.max(n,36),i=(e+t)/2;for(let t of f)t.y=i,t.height=r,t.swimlaneContentTop=e;let a=[...f].sort((e,t)=>(e.x??0)-(t.x??0)),o=[],s=[],l=[];for(let e of a){let t=d.get(e.id);if(!t)continue;let n=Math.max(0,t.maxX-t.minX)+2*iw(e),r=(t.minX+t.maxX)/2;o.push(e.id),s.push(r),l.push(n)}let u=o.length;if(u>0){let e=new Map;if(u===1)e.set(o[0],l[0]);else{let t=[];for(let e=0;e<u-1;e++)t.push(s[e+1]-s[e]);let n=Array(u);n[0]=0;for(let e=0;e<u-1;e++)n[e+1]=2*t[e]-n[e];let r=0,i=1/0;for(let e=0;e<u;e++){let t=l[e];e%2==0?r=Math.max(r,t-n[e]):i=Math.min(i,n[e]-t)}let a=r;a=r<=i?(r+i)/2:r;for(let t=0;t<u;t++){let r=n[t]+(t%2==0?a:-a),i=Math.max(l[t],r);e.set(o[t],i)}}for(let t of f){let n=e.get(t.id);n!=null&&(t.width=n),lNe(t)}}}}}function pNe(e){let t=[],n=[],r=new Map;for(let t of e.nodes)r.set(t.id,t);for(let i of e.edges){if(!i.label||i.label.length===0||i.isLayoutOnly||i.labelNodeId)continue;let e=i.start?r.get(i.start):void 0,a=i.end?r.get(i.end):void 0;if(!e||!a){y.warn(MPe,`Edge ${i.id} has missing source or target node`);continue}let o=`edge-label-${i.start}-${i.end}-${i.id}`,s=e.parentId===a.parentId?e.parentId:a.parentId,l={id:o,label:i.label,edgeStart:i.start??``,edgeEnd:i.end??``,shape:`labelRect`,width:0,height:0,isEdgeLabel:!0,isDummy:!0,parentId:s,isGroup:!1,labelStyle:Array.isArray(i.labelStyle)?i.labelStyle[0]:i.labelStyle??``,...e.dir?{dir:e.dir}:{}};t.push(l),i.labelNodeId=o,i.label=void 0,i.text=void 0;let u={id:`${i.id}-to-label`,start:i.start,end:o,type:`normal`,isLayoutOnly:!0},d={id:`${i.id}-from-label`,start:o,end:i.end,type:`normal`,isLayoutOnly:!0};n.push(u,d)}let i=[...e.nodes,...t],a=[...e.edges,...n];return{...e,nodes:i,edges:a}}function aw(e){let t=e.x??0,n=e.y??0,r=e.width??0,i=e.height??0;return r>0&&i>0?{cx:t,cy:n,rect:Sw(t,n,r,i)}:void 0}function ow(e){if(e.isGroup)return;let t=aw(e);if(t)return{id:String(e.id??``),cx:t.cx,cy:t.cy,rect:t.rect}}function sw(e,t,n=UT){return Math.abs(e.x-t.x)<n&&Math.abs(e.y-t.y)<n}function cw(e,t,n=UT){return Math.abs(e.x-t.x)<n}function lw(e,t,n=UT){return Math.abs(e.y-t.y)<n}function uw(e,t,n=UT){return lw(e,t,n)&&Math.abs(e.x-t.x)>n}function dw(e,t,n=UT){return cw(e,t,n)&&Math.abs(e.y-t.y)>n}function fw(e,t,n,r){return Math.max(0,Math.min(Math.max(e,t),Math.max(n,r))-Math.max(Math.min(e,t),Math.min(n,r)))}function pw(e,t,n=UT){return e.horizontal&&t.horizontal&&lw(e.a,t.a,n)?fw(e.a.x,e.b.x,t.a.x,t.b.x):e.vertical&&t.vertical&&cw(e.a,t.a,n)?fw(e.a.y,e.b.y,t.a.y,t.b.y):0}function mw(e,t=UT){let n=[];for(let r=0;r<e.length-1;r++){let i=e[r],a=e[r+1],o=uw(i,a,t),s=dw(i,a,t);(o||s)&&n.push({index:r,a:i,b:a,horizontal:o,vertical:s})}return n}function hw(e,t=UT){let n=mw(e,t),r=0;for(let e=1;e<n.length;e++)n[e-1].horizontal!==n[e].horizontal&&r++;return r}function gw(e,t=UT){let n=[];for(let r of e){let e=n.length>0?n[n.length-1]:void 0;(!e||!sw(e,r,t))&&n.push({x:r.x,y:r.y})}return n}function _w(e,t=UT){if(!e||e.length!==4)return;let[n,r,i,a]=e;return uw(n,r,t)&&dw(r,i,t)&&uw(i,a,t)?{kind:`HVH`,p0:n,p1:r,p2:i,p3:a}:dw(n,r,t)&&uw(r,i,t)&&dw(i,a,t)?{kind:`VHV`,p0:n,p1:r,p2:i,p3:a}:void 0}function vw(e,t,n,r=0){let i=Math.min(e.x,t.x),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y),s=Math.max(e.y,t.y);return a>n.left-r&&i<n.right+r&&s>n.top-r&&o<n.bottom+r}function yw(e,t,n=0){return e.x>t.left+n&&e.x<t.right-n&&e.y>t.top+n&&e.y<t.bottom-n}function mNe(e,t){return e.left<=t.left&&e.right>=t.right&&e.top<=t.top&&e.bottom>=t.bottom}function bw(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function xw(e,t){return{left:e.left-t,right:e.right+t,top:e.top-t,bottom:e.bottom+t}}function Sw(e,t,n,r){return{left:e-n/2,right:e+n/2,top:t-r/2,bottom:t+r/2}}function Cw(e){return aw(e)?.rect}function ww(e,t){switch(t){case`top`:return{x:e.cx,y:e.rect.top};case`bottom`:return{x:e.cx,y:e.rect.bottom};case`left`:return{x:e.rect.left,y:e.cy};case`right`:return{x:e.rect.right,y:e.cy}}}function Tw(e,t,n,r,i,a=UT){let o=t===`left`||t===`right`,s=r===`left`||r===`right`;if(o&&s){if(t===`right`&&r===`left`&&e.x<n.x||t===`left`&&r===`right`&&e.x>n.x){if(lw(e,n,a))return[e,n];let t=(e.x+n.x)/2;return[e,{x:t,y:e.y},{x:t,y:n.y},n]}if(t===r){if(lw(e,n,a))return;let r=t===`left`?Math.min(e.x,n.x)-i:Math.max(e.x,n.x)+i;return[e,{x:r,y:e.y},{x:r,y:n.y},n]}return}if(!o&&!s){if(t===r){if(cw(e,n,a))return;let r=t===`top`?Math.min(e.y,n.y)-i:Math.max(e.y,n.y)+i;return[e,{x:e.x,y:r},{x:n.x,y:r},n]}if(!(t===`bottom`&&r===`top`&&e.y<n.y||t===`top`&&r===`bottom`&&e.y>n.y))return;if(cw(e,n,a))return[e,n];let o=(e.y+n.y)/2;return[e,{x:e.x,y:o},{x:n.x,y:o},n]}if(o&&!s){let i=t===`right`&&n.x>e.x||t===`left`&&n.x<e.x,a=r===`top`&&e.y<n.y||r===`bottom`&&e.y>n.y;return i&&a?[e,{x:n.x,y:e.y},n]:void 0}let l=t===`bottom`&&n.y>e.y||t===`top`&&n.y<e.y,u=r===`left`&&e.x<n.x||r===`right`&&e.x>n.x;return l&&u?[e,{x:e.x,y:n.y},n]:void 0}function Ew(e,t,n,r){return t===`left`||t===`right`?[e,{x:r,y:e.y},{x:r,y:n.y},n]:[e,{x:e.x,y:r},{x:n.x,y:r},n]}function Dw(e){let t=new Map,n=[];for(let r of e){if(r.isEdgeLabel)continue;let e=ow(r);e&&(t.set(e.id,e),n.push({id:e.id,rect:e.rect}))}return{nodeInfoById:t,realNodeRects:n}}function Ow(e){let t=[],n=[];for(let r of e){let e=ow(r);if(!e)continue;let i={id:e.id,rect:e.rect};r.isEdgeLabel?n.push(i):t.push(i)}return{realNodeRects:t,labelNodeRects:n}}function hNe(e,{includeEdgeLabels:t=!0}={}){let n=[];for(let r of e){if(r.isGroup||!t&&r.isEdgeLabel)continue;let e=r.x??0,i=r.y??0,a=r.width??0,o=r.height??0;n.push({nodeId:r.id,...Sw(e,i,a,o)})}return n}function kw(e,t,n=UT){let r=e.start,i=e.end;if(!r||!i)return;let a=t.get(r),o=t.get(i);if(!(!a||!o))return{srcId:r,dstId:i,srcInfo:a,dstInfo:o,collinearX:Math.abs(a.cx-o.cx)<n,collinearY:Math.abs(a.cy-o.cy)<n}}function Aw(e,t,n,r=[],i=0){for(let a of n)if(!r.includes(a.id)&&vw(e,t,a.rect,-i))return!0;return!1}function jw(e,t,n,r,i=UT,a=1e-6){let o=lw(e,t,i),s=cw(e,t,i),l=lw(n,r,i),u=cw(n,r,i);if(o&&l||s&&u||!(o||s)||!(l||u))return!1;let d=o?{a:e,b:t}:{a:n,b:r},f=s?{a:e,b:t}:{a:n,b:r},p=d.a.y,m=Math.min(d.a.x,d.b.x),h=Math.max(d.a.x,d.b.x),g=f.a.x,_=Math.min(f.a.y,f.b.y),v=Math.max(f.a.y,f.b.y);if(g<m||g>h||p<_||p>v)return!1;let y=Math.abs(g-d.a.x)<a&&Math.abs(p-d.a.y)<a||Math.abs(g-d.b.x)<a&&Math.abs(p-d.b.y)<a,b=Math.abs(g-f.a.x)<a&&Math.abs(p-f.a.y)<a||Math.abs(g-f.b.x)<a&&Math.abs(p-f.b.y)<a;return!(y&&b)}function gNe(e,t,n,r,i=UT){let a=lw(e,t,i),o=cw(e,t,i),s=lw(n,r,i),l=cw(n,r,i);return o&&l&&cw(e,n,i)?fw(e.y,t.y,n.y,r.y)>i:a&&s&&lw(e,n,i)?fw(e.x,t.x,n.x,r.x)>i:!1}function Mw(e,t,n,r,{epsilon:i=UT,skipDegenerateOther:a=!1}={}){for(let o of n){if(o===r||o.isLayoutOnly)continue;let n=o.points;if(!(!n||n.length<2))for(let r=0;r<n.length-1;r++){let o=n[r],s=n[r+1];if(!(a&&sw(o,s,i))&&(jw(e,t,o,s,i)||gNe(e,t,o,s,i)))return!0}}return!1}function Nw(e,t,n,r,i=UT){let a=lw(e,t,i),o=cw(e,t,i),s=lw(n,r,i),l=cw(n,r,i);if(!(a&&l||o&&s))return!1;let u=a?{a:e,b:t}:{a:n,b:r},d=a?{a:n,b:r}:{a:e,b:t},f=u.a.y,p=Math.min(u.a.x,u.b.x),m=Math.max(u.a.x,u.b.x),h=d.a.x,g=Math.min(d.a.y,d.b.y),_=Math.max(d.a.y,d.b.y);return h>p+i&&h<m-i&&f>g+i&&f<_-i}function Pw(e,t,n){let r=Math.min(t,n),i=Math.max(t,n);return e>r+UT&&e<i-UT}function _Ne(e,t,n){return cw(e,t)&&cw(t,n)?Pw(t.y,e.y,n.y):lw(e,t)&&lw(t,n)?Pw(t.x,e.x,n.x):!1}function vNe(e){let t=!1,n=[];for(let r=0;r<e.length;r++){let i=n[n.length-1],a=e[r],o=r+1<e.length?e[r+1]:void 0;if(i&&o){if(sw(i,o)){r++,t=!0;continue}if(_Ne(i,a,o)){t=!0;continue}}n.push(a)}return{points:n,changed:t}}function Fw(e){let t=[e[0]];for(let n=1;n<e.length;n++){let r=t[t.length-1],i=e[n];if(!cw(r,i)&&!lw(r,i)){let e=t.length>=2?t[t.length-2]:void 0,n=e&&cw(e,r)?{x:r.x,y:i.y}:{x:i.x,y:r.y};t.push(n)}t.push(i)}let n=[];for(let e of t){let t=n[n.length-1];(!t||!sw(t,e))&&n.push(e)}return n}function Iw(e){if(e.length<3)return e;let t=[...e];for(let e=0;e<32;e++){let e=vNe(t);if(t=e.points,!e.changed)break}return t}function Lw(e,t,n){let r=e;if(r.isLayoutOnly||!r.points||r.points.length<n)return;let i=r.start?t.get(r.start):void 0,a=r.end?t.get(r.end):void 0;return{edge:r,points:r.points,srcRect:i?Cw(i):void 0,dstRect:a?Cw(a):void 0}}function yNe(e,t,n){if(lw(e,t,WT))return{x:e.x<n.left?n.left:n.right,y:e.y};if(cw(e,t,WT)){let t=e.y<n.top?n.top:n.bottom;return{x:e.x,y:t}}return{x:Math.min(n.right,Math.max(n.left,e.x)),y:Math.min(n.bottom,Math.max(n.top,e.y))}}function Rw(e,t,n){let r=n?1:-1,i=n?0:e.length-1;for(;i>=0&&i<e.length&&yw(e[i],t,NPe);)i+=r;if(i<0||i>=e.length)return e;let a=i-r;if(a<0||a>=e.length)return e;let o=yNe(e[i],e[a],t);return n?[o,...e.slice(i)]:[...e.slice(0,i+1),o]}function bNe(e,t){for(let n of e){let e=Lw(n,t,2);if(!e)continue;let r=[...e.points];e.srcRect&&(r=Rw(r,e.srcRect,!0)),e.dstRect&&(r=Rw(r,e.dstRect,!1)),r=Iw(Fw(r)),r=qw(r,e.srcRect,e.dstRect),e.edge.points=Iw(Fw(r))}}function zw(e,t,n,r=!1){if(lw(e,t,WT)){if(t.y<n.top-WT||t.y>n.bottom+WT)return t;if(r){if(e.x<n.left-WT)return{x:n.left,y:e.y};if(e.x>n.right+WT)return{x:n.right,y:e.y}}return{x:Math.abs(t.x-n.left)<=Math.abs(t.x-n.right)?n.left:n.right,y:e.y}}if(cw(e,t,WT)){if(t.x<n.left-WT||t.x>n.right+WT)return t;if(r){if(e.y<n.top-WT)return{x:e.x,y:n.top};if(e.y>n.bottom+WT)return{x:e.x,y:n.bottom}}let i=Math.abs(t.y-n.top)<=Math.abs(t.y-n.bottom);return{x:e.x,y:i?n.top:n.bottom}}return t}function Bw(e,t,n){let r=e[t];for(let i=t+n;i>=0&&i<e.length;i+=n){let t=e[i];if(!sw(t,r,WT))return t}return e[t+n]}function Vw(e,t){let n=e+GT,r=t-GT;return n<=r?{lo:n,hi:r}:{lo:(e+t)/2,hi:(e+t)/2}}function Hw(e,t,n){let{lo:r,hi:i}=Vw(t,n);return Math.min(i,Math.max(r,e))}function xNe(e){let t=Math.max(...e.map(e=>e.lo)),n=Math.min(...e.map(e=>e.hi));if(!(t>n))return{lo:t,hi:n}}function Uw(e,t){return t===`left`||t===`right`?Vw(e.top,e.bottom):Vw(e.left,e.right)}function Ww(e,t,n){let r=e.y>=n.top-WT&&e.y<=n.bottom+WT,i=e.x>=n.left-WT&&e.x<=n.right+WT;if(lw(e,t,WT)&&r){if(Math.abs(e.x-n.left)<WT)return`left`;if(Math.abs(e.x-n.right)<WT)return`right`}if(cw(e,t,WT)&&i){if(Math.abs(e.y-n.top)<WT)return`top`;if(Math.abs(e.y-n.bottom)<WT)return`bottom`}}function Gw(e){return e===`left`||e===`right`}function SNe(e,t,n,r,i){let a=[],o=n?Ww(e,t,n):void 0,s=r?Ww(t,e,r):void 0;return n&&o&&Gw(o)===i&&a.push(Uw(n,o)),r&&s&&Gw(s)===i&&a.push(Uw(r,s)),a.length>0?xNe(a):void 0}function Kw(e,t,n,r,i){let a=SNe(e,t,n,r,i);if(!a)return;let o=i?e.y:e.x,s=Math.min(a.hi,Math.max(a.lo,o));if(!(Math.abs(s-o)<WT))return i?[{x:e.x,y:s},{x:t.x,y:s}]:[{x:s,y:e.y},{x:s,y:t.y}]}function qw(e,t,n){if(e.length!==2)return e;let[r,i]=e;return lw(r,i,WT)?Kw(r,i,t,n,!0)??e:cw(r,i,WT)?Kw(r,i,t,n,!1)??e:e}function CNe(e,t,n){return Gw(n)?{x:e.x,y:Hw(e.y,t.top,t.bottom)}:{x:Hw(e.x,t.left,t.right),y:e.y}}function wNe(e,t,n,r,i,a){let o=e.map(e=>({...e}));for(let s=t;s>=0&&s<e.length;s+=n){let t=e[s];if(a&&!lw(t,r,WT)||!a&&!cw(t,r,WT))break;a?o[s].y=i.y:o[s].x=i.x}return o}function Jw(e,t,n){if(e.length<2)return e;let r=n?0:e.length-1,i=n?1:-1,a=e[r],o=Bw(e,r,i);if(!o)return e;let s=Ww(a,o,t);if(!s)return e;let l=Gw(s),u=CNe(a,t,s);return sw(a,u,WT)?e:wNe(e,r,i,a,u,l)}function Yw(e,t,n){let r=Math.min(e.x,t.x)>=n.left-WT&&Math.max(e.x,t.x)<=n.right+WT,i=Math.min(e.y,t.y)>=n.top-WT&&Math.max(e.y,t.y)<=n.bottom+WT;if(Math.abs(e.y-n.top)<WT&&Math.abs(t.y-n.top)<WT&&r)return`top`;if(Math.abs(e.y-n.bottom)<WT&&Math.abs(t.y-n.bottom)<WT&&r)return`bottom`;if(Math.abs(e.x-n.left)<WT&&Math.abs(t.x-n.left)<WT&&i)return`left`;if(Math.abs(e.x-n.right)<WT&&Math.abs(t.x-n.right)<WT&&i)return`right`}function Xw(e,t,n,r){switch(e){case`top`:return cw(t,n,WT)&&n.y<r.top-WT;case`bottom`:return cw(t,n,WT)&&n.y>r.bottom+WT;case`left`:return lw(t,n,WT)&&n.x<r.left-WT;case`right`:return lw(t,n,WT)&&n.x>r.right+WT}}function Zw(e,t,n){if(e.length<3)return e;if(n){let n=Yw(e[0],e[1],t);return n&&Xw(n,e[1],e[2],t)?e.slice(1):e}let r=e.length-1,i=Yw(e[r-1],e[r],t);return i&&Xw(i,e[r-1],e[r-2],t)?e.slice(0,r):e}function TNe(e,t,n){let r=e;if(t){let e=Bw(r,0,1);if(e){let n=zw(e,r[0],t);n!==r[0]&&(r=[n,...r.slice(1)])}r=Zw(r,t,!0)}if(n){let e=r.length-1,t=Bw(r,e,-1);if(t){let i=zw(t,r[e],n,!0);i!==r[e]&&(r=[...r.slice(0,e),i])}r=Zw(r,n,!1)}let i=qw(r,t,n);return i!==r||r.length===2?i:(t&&(r=Jw(r,t,!0)),n&&(r=Jw(r,n,!1)),r)}function Qw(e,t){for(let n of e){let e=Lw(n,t,2);if(!e)continue;let r=TNe(gw(e.points,WT),e.srcRect,e.dstRect);if(r.length<3){e.edge.points=r;continue}let i=[r[0],{...r[0]},...r.slice(1,-1),r[r.length-1],{...r[r.length-1]}];e.edge.points=i}}function $w(e){return new Map(e.map(e=>[e.id,e]))}function ENe(e,t){let n=e.parentId,r=null;for(;n;){let e=t.get(n);if(!e?.isGroup)break;r=e.id,n=e.parentId}return r}function eT(e,t){let n=0,r=e.parentId;for(;r;){let e=t.get(r);if(!e?.isGroup)break;n++,r=e.parentId}return n}function tT(e){let t=1/0,n=-1/0,r=1/0,i=-1/0;for(let a of e){let e=a.x,o=a.y;if(typeof e!=`number`||typeof o!=`number`)continue;let s=a.width??0,l=a.height??0;t=Math.min(t,e-s/2),n=Math.max(n,e+s/2),r=Math.min(r,o-l/2),i=Math.max(i,o+l/2)}return t===1/0||r===1/0?null:{minX:t,maxX:n,minY:r,maxY:i}}function DNe(e,t){let n=e.padding??20;e.x=(t.minX+t.maxX)/2,e.y=(t.minY+t.maxY)/2,e.width=Math.max(0,t.maxX-t.minX)+n,e.height=Math.max(0,t.maxY-t.minY)+n}function ONe(e){let t=$w(e),n=e.filter(e=>e.isGroup&&e.parentId).sort((e,n)=>eT(n,t)-eT(e,t));for(let t of n){let n=tT(e.filter(e=>e.parentId===t.id));n&&DNe(t,n)}}function nT(e,t){let n=e.nodes??[],r=e.edges??[],i=n.filter(e=>!e.isGroup),a=1/0,o=-1/0;for(let e of i){let n=e[t];typeof n==`number`&&(a=Math.min(a,n),o=Math.max(o,n))}if(!Number.isFinite(a)||!Number.isFinite(o))return!1;let s=p(e=>a+o-e,`mirror`);for(let e of n){let n=e[t];typeof n==`number`&&(e[t]=s(n));let r=e.groupTitleRect;r&&(e.groupTitleRect=t===`x`?{...r,left:s(r.right),right:s(r.left)}:{...r,top:s(r.bottom),bottom:s(r.top)})}for(let e of r)for(let n of e.points??[])n[t]=s(n[t]);return!0}function kNe(e){return!(e.nodes??[]).some(e=>!e.isGroup)||nT(e,`y`)}function ANe(e,t=`LR`){let n=e.nodes??[],r=e.edges??[],i=n.filter(e=>!e.isGroup),a=1/0,o=1/0;for(let e of i){let t=e.x??0,n=e.y??0;t<a&&(a=t),n<o&&(o=n)}if(!Number.isFinite(a)||!Number.isFinite(o))return!1;let s=0,l=0;for(let e of i)s+=e.width??0,l+=e.height??0;let u=s/i.length,d=l/i.length,f=d>0?Math.max(1,u/d):1;for(let e of i){let t=e.x??0,n=((e.y??0)-o)*f+36,r=t-a;e.x=n,e.y=r}for(let e of r)if(e.points)for(let t of e.points){let e=t.x,n=(t.y-o)*f+36,r=e-a;t.x=n,t.y=r}ONe(n);let p=n.filter(e=>e.isGroup&&!e.parentId);if(p.length===0)return t===`RL`&&nT(e,`x`),!0;let m=$w(n),h=new Map;for(let e of n){if(e.isGroup)continue;let t=ENe(e,m);if(!t)continue;let n=h.get(t)??[];n.push(e),h.set(t,n)}let g=0;for(let e of p){let t=e.padding??0;t>g&&(g=t)}let _=[],v=1/0,y=-1/0;for(let e of p){let t=tT(h.get(e.id)??[]);t&&(v=Math.min(v,t.minX),y=Math.max(y,t.maxX),_.push({lane:e,contentTop:t.minY,contentBottom:t.maxY,centerY:(t.minY+t.maxY)/2}))}if(v===1/0||y===-1/0)return!0;let b=Math.max(0,y-v)+2*Math.max(g,10),x=36+b,S=(v+y)/2-b/2-36,C=S+x/2,w=Math.max(g,36);_.sort((e,t)=>e.centerY-t.centerY);for(let e=0;e<_.length;e++){let t=_[e],n,r;if(n=e===0?t.contentTop-w:(_[e-1].contentBottom+t.contentTop)/2,e===_.length-1)r=t.contentBottom+w;else{let n=_[e+1];r=(t.contentBottom+n.contentTop)/2}let i=Math.max(0,r-n),a=(n+r)/2;t.lane.x=C,t.lane.y=a,t.lane.width=x,t.lane.height=i,t.lane.swimlaneContentTop=t.contentTop,t.lane.groupTitleRect={left:S,right:S+36,top:n,bottom:r}}return t===`RL`&&nT(e,`x`),!0}function jNe(e,t){let{nodeInfoById:n,realNodeRects:r}=Dw(t);for(let t of e){if(t.isLayoutOnly)continue;let i=t.points;if(!i||i.length<4)continue;let a=_w(gw(i,KT),KT);if(!a)continue;let{p3:o}=a,s=a.kind===`HVH`,l=kw(t,n,KT);if(!l)continue;let{srcId:u,dstId:d,srcInfo:f,dstInfo:p,collinearX:m,collinearY:h}=l;if(m||h)continue;let g,_=f.rect;for(let n of PPe){let i,a,l;if(s){let e=p.cy>f.cy?_.bottom:_.top,t=f.cx+n;if(t<=_.left+KT||t>=_.right-KT)continue;i={x:t,y:e},a={x:t,y:o.y},l={x:o.x,y:o.y}}else{let e=p.cx>f.cx?_.right:_.left,t=f.cy+n;if(t<=_.top+KT||t>=_.bottom-KT)continue;i={x:e,y:t},a={x:o.x,y:t},l={x:o.x,y:o.y}}let m=sw(i,a,KT),h=sw(a,l,KT);if(m&&h||!m&&Aw(i,a,r,[u],1)||!h&&Aw(a,l,r,[d],1))continue;let v=!m&&Mw(i,a,e,t,{epsilon:KT,skipDegenerateOther:!0}),y=!h&&Mw(a,l,e,t,{epsilon:KT,skipDegenerateOther:!0});if(!(v||y)){g=m?[a,l]:h?[i,a]:[i,a,l];break}}g&&(t.points=g)}}function MNe(e,t){let n=.001,{realNodeRects:r,labelNodeRects:i}=Ow(t.values());for(let a of e){if(a.isLayoutOnly)continue;let o=a.points;if(!o||o.length<4)continue;let s=gw(o,n);if(s.length<4)continue;let l=s.length-1,u=s[l],d=s[l-1],f=s[l-2],m=u.x-d.x,h=u.y-d.y,g=Math.hypot(m,h);if(g>=10||g<n)continue;let _=d.x-f.x,v=d.y-f.y;if(Math.hypot(_,v)<n)continue;let y=uw(d,u,n),b=dw(d,u,n),x=uw(f,d,n),S=dw(f,d,n);if(!(y&&S||b&&x))continue;let C=a.end,w=a.start,T=C?t.get(C):void 0;if(!T)continue;let E=T.x??0,D=T.y??0,O=Cw(T);if(!O)continue;let k,A;if(S){let e=v<0;k={x:E,y:f.y},A={x:E,y:e?O.bottom:O.top}}else{let e=_>0;k={x:f.x,y:D},A={x:e?O.right:O.left,y:D}}if(Aw(k,A,r,C?[C]:[],-2)||Aw(k,A,i,[],-2))continue;if(w){let e=t.get(w),n=e?Cw(e):void 0;if(n&&yw(k,n,2))continue}let j=p((e,t)=>`${e.x.toFixed(3)},${e.y.toFixed(3)}|${t.x.toFixed(3)},${t.y.toFixed(3)}`,`ownSegmentKey`),M=new Set;for(let e=0;e<s.length-1;e++)M.add(j(s[e],s[e+1]));let N=p((t,r)=>{for(let i of e){if(i===a||i.isLayoutOnly)continue;let e=i.points;if(!(!e||e.length<2))for(let i=0;i<e.length-1;i++){let a=e[i],o=e[i+1];if(!M.has(j(a,o))&&Nw(t,r,a,o,n))return!0}}return!1},`segmentCrossesOtherEdge`);if(N(k,A))continue;if(l-3>=0){let e=s[l-3],t=[w,C].filter(e=>!!e);if(Aw(e,k,r,t,-2)||N(e,k))continue}let P=[...s.slice(0,l-2),k,A];a.points=P;let F=a.labelNodeId;if(F){let e=t.get(F);if(e){let t=e.width??0,r=e.height??0;if(t>0&&r>0){let i,a,o=-1;for(let e=0;e<P.length-1;e++){let s=P[e],l=P[e+1],u=Math.hypot(l.x-s.x,l.y-s.y),d=lw(s,l,n),f=cw(s,l,n);(d&&u>=t+2||f&&u>=r+2)&&u>o&&(o=u,i=(s.x+l.x)/2,a=(s.y+l.y)/2)}i!==void 0&&a!==void 0&&(e.x=i,e.y=a)}}}}}function NNe(e,t){let n=p((e,t)=>{let n=e.x??0,r=e.y??0,i=t.x-n,a=t.y-r,o=(e.width??0)/2,s=(e.height??0)/2;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),{x:n+(a===0?0:s*i/a),y:r+s}):(i<0&&(o=-o),{x:n+o,y:r+(i===0?0:o*a/i)})},`rectIntersect`),r=p((e,r)=>{let i=gw(e.points??[]);if(i.length<2)return;let a=r?e.start:e.end,o=a?t.get(a):void 0,s=o?Cw(o):void 0;if(!o||!a||!s)return;let l=r?i[0]:i[i.length-1],u=r?i[1]:i[i.length-2],d=n(o,l),f=l;if(ZT(u,d)&&(f=u),cw(d,f,JT))return{edge:e,edgeId:String(e.id??``),nodeId:a,atStart:r,orientation:`V`,coord:d.x,min:Math.min(d.y,f.y),max:Math.max(d.y,f.y),boundary:d,railEnd:f,rect:s};if(lw(d,f,JT))return{edge:e,edgeId:String(e.id??``),nodeId:a,atStart:r,orientation:`H`,coord:d.y,min:Math.min(d.x,f.x),max:Math.max(d.x,f.x),boundary:d,railEnd:f,rect:s}},`terminalLaneFor`),i=p((e,t)=>Math.max(0,Math.min(e.max,t.max)-Math.max(e.min,t.min)),`projectedOverlapLength`),a=p((e,t)=>e.nodeId!==t.nodeId||e.orientation!==t.orientation?!1:e.orientation===`H`?(Math.abs(e.boundary.x-e.rect.left)<1||Math.abs(e.boundary.x-e.rect.right)<1)&&cw(e.boundary,t.boundary,1):(Math.abs(e.boundary.y-e.rect.top)<1||Math.abs(e.boundary.y-e.rect.bottom)<1)&&lw(e.boundary,t.boundary,1),`sameTerminalFace`),o=p((e,t)=>e.nodeId!==t.nodeId||e.orientation!==t.orientation?!1:i(e,t)>=YT&&Math.abs(e.coord-t.coord)<.5,`exactTerminalLaneConflict`),s=p((e,t)=>{if(e.nodeId!==t.nodeId||e.orientation!==t.orientation||e.orientation!==`H`||e.atStart===t.atStart)return!1;let n=i(e,t);if(n<YT)return!1;let r=e.rect.bottom-e.rect.top;return n<r||n>2*r?!1:a(e,t)&&Math.abs(e.coord-t.coord)<16},`nearTerminalLaneConflict`),l=p((e,t)=>{let n=gw(e.edge.points??[]);if(n.length<2)return;let r=e.orientation===`V`?{x:e.boundary.x+t,y:e.boundary.y}:{x:e.boundary.x,y:e.boundary.y+t},i=e.orientation===`V`?{x:e.railEnd.x+t,y:e.railEnd.y}:{x:e.railEnd.x,y:e.railEnd.y+t};if(!p(()=>Math.abs(e.boundary.y-e.rect.top)<1||Math.abs(e.boundary.y-e.rect.bottom)<1?lw(r,e.boundary,JT)&&r.x>=e.rect.left+1&&r.x<=e.rect.right-1:Math.abs(e.boundary.x-e.rect.left)<1||Math.abs(e.boundary.x-e.rect.right)<1?cw(r,e.boundary,JT)&&r.y>=e.rect.top+1&&r.y<=e.rect.bottom-1:!1,`boundaryStaysOnSameFace`)())return;if(e.atStart){let t=n.length>1&&sw(n[1],e.railEnd,JT),a=n.slice(t?2:1),o=a[0];return o&&!ZT(o,i)?void 0:[r,i,...a]}let a=n.length>1&&sw(n[n.length-2],e.railEnd,JT),o=n.slice(0,a?-2:-1),s=o[o.length-1];if(!(s&&!ZT(s,i)))return[...o,i,r]},`shiftedCandidate`),u=p(e=>{let n=e.edge,r=gw(n.points??[]);if(r.length!==2)return!1;let i=n.start,a=n.end,o=i?t.get(i):void 0,s=a?t.get(a):void 0;if(!o||!s)return!1;let l=o.x??0,u=o.y??0,d=s.x??0,f=s.y??0,[p,m]=r;return lw(p,m,JT)&&Math.abs(u-f)<1&&Math.abs(l-d)>1||cw(p,m,JT)&&Math.abs(l-d)<1&&Math.abs(u-f)>1},`laneIsStraightCollinearConnector`),d=[-7,7,-14,14,-21,21];for(let t=0;t<8;t++){let t=e.filter(e=>!e.isLayoutOnly).flatMap(e=>[r(e,!0),r(e,!1)]).filter(e=>!!e),n=!1;for(let e=0;e<t.length&&!n;e++)for(let i=e+1;i<t.length&&!n;i++){let a=t[e],f=t[i];if(a.edge===f.edge||!(o(a,f)||s(a,f)))continue;let p=!o(a,f),m=[a,f].sort((e,t)=>{let n=u(e),r=u(t);return n===r?Number(!t.atStart)-Number(!e.atStart):Number(n)-Number(r)});for(let e of m){for(let i of d){let a=l(e,i);if(!a)continue;let u=r({...e.edge,points:a},e.atStart);if(!(!u||t.some(t=>t.edge!==e.edge&&(o(u,t)||p&&s(u,t))))){e.edge.points=a,n=!0;break}}if(n)break}}if(!n)return}}function PNe(e,t){let{realNodeRects:n,labelNodeRects:r}=Ow(t.values()),i=p((t,i)=>{let a=t.start,o=t.end,s=XT(i);if(s.length!==i.length-1)return!1;let l=[a,o].filter(e=>!!e);for(let e of s)if(Aw(e.a,e.b,n,l,-2)||Aw(e.a,e.b,r,[],-2))return!1;for(let n of e){if(n===t||n.isLayoutOnly)continue;let e=n.points;if(!(!e||e.length<2)){for(let t of s)for(let n of XT(gw(e)))if(pw(t,n,.5)>=YT||Nw(t.a,t.b,n.a,n.b,JT))return!1}}return!0},`candidateIsSafe`),a=p((e,t)=>{if(t+4>=e.length)return;let n=e[t],r=e[t+1],i=e[t+2],a=e[t+3],o=e[t+4],s=uw(n,r)&&dw(r,i)&&uw(i,a)&&dw(a,o)&&cw(n,a,JT)&&cw(n,o,JT)&&cw(r,i,JT)&&(r.x-n.x)*(a.x-i.x)<0,l=dw(n,r)&&uw(r,i)&&dw(i,a)&&uw(a,o)&&lw(n,a,JT)&&lw(n,o,JT)&&lw(r,i,JT)&&(r.y-n.y)*(a.y-i.y)<0;if(s||l)return gw([...e.slice(0,t+1),o,...e.slice(t+5)]);if(t+5>=e.length)return;let u=e[t+5],d=dw(n,r)&&uw(r,i)&&dw(i,a)&&uw(a,o)&&dw(o,u)&&cw(n,o,JT)&&cw(n,u,JT)&&cw(i,a,JT)&&(i.x-r.x)*(o.x-a.x)<0,f=uw(n,r)&&dw(r,i)&&uw(i,a)&&dw(a,o)&&uw(o,u)&&lw(n,o,JT)&&lw(n,u,JT)&&lw(i,a,JT)&&(i.y-r.y)*(o.y-a.y)<0;if(!(!d&&!f))return gw([...e.slice(0,t+1),u,...e.slice(t+6)])},`withoutDogleg`);for(let t=0;t<8;t++){let t=!1;for(let n of e){if(n.isLayoutOnly)continue;let e=gw(n.points??[]);for(let r=0;r<=e.length-5;r++){let o=a(e,r);if(!(!o||!i(n,o))){n.points=o,t=!0;break}}if(t)break}if(!t)return}}function rT(e,t){let{realNodeRects:n,labelNodeRects:r}=Ow(t.values()),i=e.filter(e=>!e.isLayoutOnly),a=p((e,t,n)=>gw(e===t?n??[]:e.points??[]),`pointsFor`),o=p((e,t)=>{let n=0;for(let r=0;r<i.length;r++){let o=XT(a(i[r],e,t));for(let s=r+1;s<i.length;s++){let r=XT(a(i[s],e,t));for(let e of o)for(let t of r)Nw(e.a,e.b,t.a,t.b,JT)&&n++}}return n},`strictCrossingCount`),s=p(e=>{let t=XT(e);if(t.length!==3)return;let n=t[1];if(t[0].horizontal!==n.horizontal&&t[2].horizontal!==n.horizontal)return{index:n.index,horizontal:n.horizontal,vertical:n.vertical,segment:n}},`middleRail`),l=p((e,t)=>{let r=[e.start,e.end].filter(e=>!!e);return n.filter(e=>{if(r.includes(e.id))return!1;let n=e.rect;return t.horizontal?fw(t.a.x,t.b.x,n.left,n.right)>=YT&&t.a.y>=n.top-2&&t.a.y<=n.bottom+2:fw(t.a.y,t.b.y,n.top,n.bottom)>=YT&&t.a.x>=n.left-2&&t.a.x<=n.right+2})},`blockingRectsFor`),u=p((e,t,n)=>{let r=e.map(e=>({...e}));if(t.horizontal)r[t.index].y=n,r[t.index+1].y=n;else if(t.vertical)r[t.index].x=n,r[t.index+1].x=n;else return;let i=Iw(gw(r));return XT(i).length===i.length-1?i:void 0},`candidateByMovingRail`),d=p((e,t,s)=>{let l=[e.start,e.end].filter(e=>!!e),u=XT(t);if(u.length!==t.length-1)return!1;for(let e of u)if(Aw(e.a,e.b,n,l,-2)||Aw(e.a,e.b,r,[],-2))return!1;for(let t of i)if(t!==e){for(let e of u)for(let n of XT(a(t)))if(pw(e,n,.5)>=YT)return!1}return o(e,t)<=s},`candidateIsSafe`);for(let e=0;e<8;e++){let e=o(),t=!1;for(let n of i){let r=a(n),i=s(r);if(!i)continue;let o=l(n,i.segment);if(o.length===0)continue;let f=i.horizontal?[Math.min(...o.map(e=>e.rect.top))-20,Math.max(...o.map(e=>e.rect.bottom))+20]:[Math.min(...o.map(e=>e.rect.left))-20,Math.max(...o.map(e=>e.rect.right))+20];for(let a of f){let o=u(r,i.segment,a);if(!(!o||!d(n,o,e))){n.points=o,t=!0;break}}if(t)break}if(!t)return}}function iT(e,t){let n=p(e=>{let t=e.groupTitleRect;if(!(!t||typeof t.left!=`number`||typeof t.right!=`number`||typeof t.top!=`number`||typeof t.bottom!=`number`||!Number.isFinite(t.left)||!Number.isFinite(t.right)||!Number.isFinite(t.top)||!Number.isFinite(t.bottom)||t.right<=t.left||t.bottom<=t.top))return{left:t.left,right:t.right,top:t.top,bottom:t.bottom}},`validTitleRect`),r=p(e=>{if(!e.isGroup||e.parentId)return;let t=e.direction,r=typeof t==`string`?t.toUpperCase():``;if(r===`LR`||r===`RL`||r===`BT`)return;let i=n(e),a=e.y,o=e.height;if(!i||typeof a!=`number`||typeof o!=`number`||!Number.isFinite(a)||!Number.isFinite(o)||o<=0)return;let s=i.right-i.left,l=i.bottom-i.top;if(!(l<=0||s<l))return{node:e,rect:i}},`topLaneTitleFor`),i=p((e,t)=>{if(!e.horizontal)return!1;let n=e.a.y;return n<=t.top+JT||n>=t.bottom-JT?!1:fw(e.a.x,e.b.x,t.left,t.right)>=YT},`horizontalSegmentIntersectsTitle`),a=[...t.values()].map(r).filter(e=>!!e);if(a.length===0)return;let o=0;for(let t of e){if(t.isLayoutOnly)continue;let e=gw(t.points??[]);for(let t of XT(e))for(let e of a)i(t,e.rect)&&(o=Math.max(o,e.rect.bottom-t.a.y+4))}if(!(o<=JT))for(let e of a){let t=e.node.y,n=e.node.height;typeof t!=`number`||typeof n!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||n<=0||(e.node.y=t-o/2,e.node.height=n+o,e.node.groupTitleRect={...e.rect,top:e.rect.top-o,bottom:e.rect.bottom-o})}}function aT(e,t){let n=p(e=>{let t=e.groupTitleRect;if(!(!t||typeof t.left!=`number`||typeof t.right!=`number`||typeof t.top!=`number`||typeof t.bottom!=`number`||!Number.isFinite(t.left)||!Number.isFinite(t.right)||!Number.isFinite(t.top)||!Number.isFinite(t.bottom)||t.right<=t.left||t.bottom<=t.top))return{left:t.left,right:t.right,top:t.top,bottom:t.bottom}},`validTitleRect`),r=p(e=>{if(!e.isGroup||e.parentId||e.direction!==`LR`)return;let t=n(e),r=e.x,i=e.width;if(!t||typeof r!=`number`||typeof i!=`number`||!Number.isFinite(r)||!Number.isFinite(i)||i<=0)return;let a=t.right-t.left,o=t.bottom-t.top;if(!(a<=0||o<a))return{node:e,rect:t}},`leftLaneTitleFor`),i=p((e,t)=>{if(!e.vertical)return!1;let n=e.a.x;return n<=t.left+JT||n>=t.right-JT?!1:fw(e.a.y,e.b.y,t.top,t.bottom)>=YT},`verticalSegmentIntersectsTitle`),a=p((e,t)=>{if(!e.horizontal)return!1;let n=e.a.y;return n<=t.top+JT||n>=t.bottom-JT?!1:fw(e.a.x,e.b.x,t.left,t.right)>=YT},`horizontalSegmentIntersectsTitle`),o=[...t.values()].map(r).filter(e=>!!e);if(o.length===0)return;let s=0;for(let t of e){if(t.isLayoutOnly)continue;let e=gw(t.points??[]);for(let t of XT(e))for(let e of o)if(i(t,e.rect))s=Math.max(s,e.rect.right-t.a.x+4);else if(a(t,e.rect)){let n=Math.min(t.a.x,t.b.x);s=Math.max(s,e.rect.right-n+4)}}if(!(s<=JT))for(let e of o){let t=e.node.x,n=e.node.width;typeof t!=`number`||typeof n!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||n<=0||(e.node.x=t-s/2,e.node.width=n+s,e.node.groupTitleRect={...e.rect,left:e.rect.left-s,right:e.rect.right-s})}}function FNe(e,t){let{realNodeRects:n}=Ow(t.values()),r=e.filter(e=>!e.isLayoutOnly),i=p((e,t=new Map)=>gw(t.get(e)??e.points??[]),`replacementPointsFor`),a=p((e=new Map)=>{let t=0;for(let n=0;n<r.length;n++){let a=XT(i(r[n],e));for(let o=n+1;o<r.length;o++){let n=XT(i(r[o],e));for(let e of a)for(let r of n)Nw(e.a,e.b,r.a,r.b,JT)&&t++}}return t},`crossingCount`),o=p((e=new Map)=>r.reduce((t,n)=>t+hw(i(n,e)),0),`totalBends`),s=p(e=>{let t=i(e);if(t.length<4)return;let n=t[t.length-2],r=t[t.length-1];if(!(!uw(n,r,JT)&&!dw(n,r,JT)))return{tailStart:n,terminal:r}},`terminalTailFor`),l=p((e,t)=>{let n=i(e);if(n.length<3)return;let r=n[0],a=n[1],o;if(uw(r,a,JT))o={x:a.x,y:t.tailStart.y};else if(dw(r,a,JT))o={x:t.tailStart.x,y:a.y};else return;let s=Iw(gw([r,a,o,t.tailStart,t.terminal]));return XT(s).length===s.length-1?s:void 0},`candidateWithDestinationTail`),u=p((e,t)=>{let r=[e.start,e.end].filter(e=>!!e);for(let e of XT(t))if(Aw(e.a,e.b,n,r,-2))return!0;return!1},`pathHasNodeHit`),d=p((e,t,n)=>{for(let a of r)if(a!==e){for(let e of XT(t))for(let t of XT(i(a,n)))if(pw(e,t,.5)>=YT)return!0}return!1},`pathHasSharedTrack`),f=p((e,t,n)=>!u(e,t)&&!d(e,t,n),`candidateIsSafe`),m=p(()=>{let e=new Map;for(let n of r){let r=n.end;if(!r||!t.has(r)||i(n).length<4)continue;let a=e.get(r)??[];a.push(n),e.set(r,a)}return e},`edgesByDestination`);for(let e=0;e<4;e++){let e=a();if(e===0)return;let t=o(),n,r=e,i=t;for(let t of m().values())for(let u=0;u<t.length;u++)for(let d=u+1;d<t.length;d++){let p=t[u],m=t[d],h=s(p),g=s(m);if(!h||!g)continue;let _=l(p,g),v=l(m,h);if(!_||!v)continue;let y=new Map([[p,_],[m,v]]);if(!f(p,_,y)||!f(m,v,y))continue;let b=a(y),x=o(y);b>=e||b>r||b===r&&x>=i||(n=y,r=b,i=x)}if(!n)return;for(let[e,t]of n)e.points=t}}function INe(e,t){let{realNodeRects:n,labelNodeRects:r}=Ow(t.values()),i=e.filter(e=>!e.isLayoutOnly),a=p((e,t=new Map)=>gw(t.get(e)??e.points??[]),`replacementPointsFor`),o=p((e=new Map)=>{let t=0;for(let n=0;n<i.length;n++){let r=XT(a(i[n],e));for(let o=n+1;o<i.length;o++){let n=XT(a(i[o],e));for(let e of r)for(let r of n)Nw(e.a,e.b,r.a,r.b,JT)&&t++}}return t},`strictCrossingCount`),s=p((e=new Map)=>i.reduce((t,n)=>t+hw(a(n,e)),0),`totalBends`),l=p(e=>{let n=e.start,r=e.end,i=n?t.get(n):void 0,a=r?t.get(r):void 0,o=i?Cw(i):void 0,s=a?Cw(a):void 0;return o&&s?{src:o,dst:s}:void 0},`endpointRectsFor`),u=p((e,t,n)=>{if(n.index<=0||n.index+1>=t.length-1)return;let r=l(e);if(r){if(n.vertical){let i=n.a.x,a=Math.min(r.src.left,r.dst.left),o=Math.max(r.src.right,r.dst.right),s=i<a-JT?`left`:i>o+JT?`right`:void 0;return s?{edge:e,points:t,segmentIndex:n.index,axis:`vertical`,side:s,coord:i,min:Math.min(n.a.y,n.b.y),max:Math.max(n.a.y,n.b.y)}:void 0}if(n.horizontal){let i=n.a.y,a=Math.min(r.src.top,r.dst.top),o=Math.max(r.src.bottom,r.dst.bottom),s=i<a-JT?`top`:i>o+JT?`bottom`:void 0;return s?{edge:e,points:t,segmentIndex:n.index,axis:`horizontal`,side:s,coord:i,min:Math.min(n.a.x,n.b.x),max:Math.max(n.a.x,n.b.x)}:void 0}}},`externalRailForSegment`),d=p(()=>{let e=[];for(let t of i){let n=a(t);for(let r of XT(n)){let i=u(t,n,r);i&&e.push(i)}}return e},`collectExternalRails`),f=p((e,t)=>e.edge!==t.edge&&e.axis===t.axis&&e.side===t.side&&fw(e.min,e.max,t.min,t.max)>=YT,`railsInteract`),m=p(e=>{let t=[],n=new Set;for(let r of e){if(n.has(r))continue;let i=[r],a=[];for(n.add(r);i.length>0;){let t=i.pop();a.push(t);for(let r of e)!n.has(r)&&f(t,r)&&(n.add(r),i.push(r))}a.length>1&&t.push(a)}return t},`connectedComponents`),h=p(e=>{let t=[];for(let n of e)t.some(e=>Math.abs(e-n.coord)<JT)||t.push(n.coord);for(;t.length<e.length;){let n=Math.min(...t),r=Math.max(...t),i=e[0].side;t.push(i===`left`||i===`top`?n-12*(e.length-t.length):r+12*(e.length-t.length))}return t},`uniqueCoordsFor`),g=p(e=>{let t=e.map(e=>e.coord),n=h(e),r=[];if(e.length<=6){let i=Array(n.length).fill(!1),a=[],o=p(()=>{if(a.length===e.length){a.some((e,n)=>Math.abs(e-t[n])>=JT)&&r.push([...a]);return}for(let[e,t]of n.entries())i[e]||(i[e]=!0,a.push(t),o(),a.pop(),i[e]=!1)},`visit`);return o(),r}for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let i=[...t];[i[e],i[n]]=[i[n],i[e]],r.push(i)}return r},`coordinateAssignmentsFor`),_=p((e,t)=>{let n=new Map;for(let[r,i]of e.entries()){let e=t[r],a=n.get(i.edge)??i.points.map(e=>({x:e.x,y:e.y}));i.axis===`vertical`?(a[i.segmentIndex].x=e,a[i.segmentIndex+1].x=e):(a[i.segmentIndex].y=e,a[i.segmentIndex+1].y=e),n.set(i.edge,a)}let r=new Map;for(let[e,t]of n){let n=Iw(gw(t));if(XT(n).length!==n.length-1)return;r.set(e,n)}return r},`replacementsForAssignment`),v=p(e=>{for(let[t,i]of e){let e=[t.start,t.end].filter(e=>!!e);for(let t of XT(i))if(Aw(t.a,t.b,n,e,-2)||Aw(t.a,t.b,r,[],-2))return!1}for(let t=0;t<i.length;t++){let n=i[t],r=e.has(n),o=XT(a(n,e));for(let n=t+1;n<i.length;n++){let t=i[n];if(!r&&!e.has(t))continue;let s=XT(a(t,e));for(let e of o)for(let t of s)if(pw(e,t,.5)>=YT)return!1}}return!0},`candidateIsSafe`);for(let e=0;e<4;e++){let e=o();if(e===0)return;let t,n=e,r=s(),i=1/0;for(let a of m(d()))for(let l of g(a)){let u=_(a,l);if(!u||!v(u))continue;let d=o(u);if(d>=e)continue;let f=s(u),p=a.reduce((e,t,n)=>e+Math.abs(l[n]-t.coord),0);d>n||d===n&&(f>r||f===r&&p>=i)||(t=u,n=d,r=f,i=p)}if(!t)return;for(let[e,n]of t)e.points=n}}function LNe(e,t){let{realNodeRects:n,labelNodeRects:r}=Ow(t.values()),i=e.filter(e=>!e.isLayoutOnly),a=p((e,t,n)=>gw(e===t?n??[]:e.points??[]),`pointsFor`),o=p(e=>XT(e).reduce((e,t)=>{let n=t.a.x-t.b.x,r=t.a.y-t.b.y;return e+Math.hypot(n,r)},0),`pathLength`),s=p((e,t)=>{let n=0;for(let r=0;r<i.length;r++){let o=XT(a(i[r],e,t));for(let s=r+1;s<i.length;s++){let r=XT(a(i[s],e,t));for(let e of o)for(let t of r)Nw(e.a,e.b,t.a,t.b,JT)&&n++}}return n},`strictCrossingCount`),l=p((e,t)=>{if(e.horizontal){let n=e.a.y;return(Math.abs(n-t.top)<1||Math.abs(n-t.bottom)<1)&&fw(e.a.x,e.b.x,t.left,t.right)>=YT}if(e.vertical){let n=e.a.x;return(Math.abs(n-t.left)<1||Math.abs(n-t.right)<1)&&fw(e.a.y,e.b.y,t.top,t.bottom)>=YT}return!1},`segmentRunsAlongRectBorder`),u=p(e=>{let n=[e.start,e.end].filter(e=>!!e),r=[];for(let e of n){let n=t.get(e),i=n?Cw(n):void 0;i&&r.push(i)}return r},`endpointRectsFor`),d=p((e,t)=>{if(t+3>=e.length)return[];let n=e[t],r=e[t+1],i=e[t+2],a=e[t+3],o=uw(n,r,JT)&&dw(r,i,JT)&&uw(i,a,JT),s=dw(n,r,JT)&&uw(r,i,JT)&&dw(i,a,JT);if(!o&&!s||!(o?Math.sign(r.x-n.x)!==Math.sign(a.x-i.x):Math.sign(r.y-n.y)!==Math.sign(a.y-i.y)))return[];let l=cw(n,a,JT)||lw(n,a,JT)?[]:[{x:n.x,y:a.y},{x:a.x,y:n.y}],u=l.length===0?[[...e.slice(0,t+1),...e.slice(t+3)]]:l.map(n=>[...e.slice(0,t+1),n,...e.slice(t+3)]),d=new Set;return u.map(e=>Iw(gw(e))).filter(e=>{if(XT(e).length!==e.length-1||!e.some(e=>sw(e,a,JT)))return!1;let t=e.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return!d.has(t)&&(d.add(t),!0)})},`shortcutCandidatesAt`),f=p((e,t,o)=>{let d=[e.start,e.end].filter(e=>!!e),f=u(e);for(let e of XT(t))if(Aw(e.a,e.b,n,d,-2)||Aw(e.a,e.b,r,[],-2)||f.some(t=>l(e,t)))return!1;for(let n of i)if(n!==e){for(let e of XT(t))for(let t of XT(a(n)))if(pw(e,t,.5)>=YT)return!1}return s(e,t)<=o},`candidateIsSafe`);for(let e=0;e<8;e++){let e=s(),t,n,r=e,l=1/0,u=1/0;for(let p of i){let i=a(p),m=hw(i,JT),h=o(i);for(let a=0;a<=i.length-4;a++)for(let g of d(i,a)){let i=hw(g,JT),a=o(g);if(!(i<m||i===m&&a<h-JT)||!f(p,g,e))continue;let d=s(p,g);d>r||d===r&&(i>l||i===l&&a>=u)||(t=p,n=g,r=d,l=i,u=a)}}if(!t||!n)return;t.points=n}}function RNe(e,t){let n=[];for(let e of t.values()){if(e.isGroup||e.isEdgeLabel)continue;let t=e.x??0,r=e.y??0,i=Cw(e);i&&n.push({id:String(e.id??``),cx:t,cy:r,rect:i})}if(n.length===0)return;let r=new Map(n.map(e=>[e.id,e])),i=n.map(e=>({id:e.id,rect:e.rect})),a=[`top`,`bottom`,`left`,`right`],o={top:Math.min(...n.map(e=>e.rect.top))-20,bottom:Math.max(...n.map(e=>e.rect.bottom))+20,left:Math.min(...n.map(e=>e.rect.left))-20,right:Math.max(...n.map(e=>e.rect.right))+20},s=e.filter(e=>!e.isLayoutOnly),l=new Map(s.map((e,t)=>[e,t])),u=p(e=>{let t=e===`left`||e===`top`?-1:1,n=[];for(let r=0;r<=2;r++)n.push(o[e]+t*20*r);return n},`outwardTracksForSide`),d=p((e,t=new Map)=>gw(t.get(e)??e.points??[]),`replacementPointsFor`),f=p((e,t)=>{let n=0;for(let r of e)for(let e of t)Nw(r.a,r.b,e.a,e.b,JT)&&n++;return n},`crossingCountBetweenSegments`),m=p((e,t)=>f(XT(e),XT(t)),`crossingCountBetweenPaths`),h=p((e=new Map)=>{let t=0,n=[],r=new Set,i=[],a=p(e=>{r.has(e)||(r.add(e),i.push(e))},`addEdge`);for(let r=0;r<s.length;r++){let i=s[r],o=d(i,e);for(let l=r+1;l<s.length;l++){let r=s[l],u=m(o,d(r,e));u>0&&(t+=u,n.push({first:i,second:r,count:u}),a(i),a(r))}}return i.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),{count:t,pairs:n,edgeSet:r,edges:i}},`crossingSnapshot`),g=p((e,t)=>{let n=new Set(t.keys());if(n.size===0)return e.count;let r=0;for(let t of e.pairs)(n.has(t.first)||n.has(t.second))&&(r+=t.count);let i=0;for(let e=0;e<s.length;e++){let r=s[e],a=n.has(r),o=d(r,t);for(let r=e+1;r<s.length;r++){let e=s[r];!a&&!n.has(e)||(i+=m(o,d(e,t)))}}return e.count-r+i},`crossingCountWithReplacements`),_=p(e=>{let t=new Map;for(let n of e.pairs){let e=t.get(n.first)??new Set;e.add(n.second),t.set(n.first,e);let r=t.get(n.second)??new Set;r.add(n.first),t.set(n.second,r)}let n=[],r=new Set;for(let i of e.edges){if(r.has(i))continue;let e=[i],a=[];for(r.add(i);e.length>0;){let n=e.pop();a.push(n);for(let i of t.get(n)??[])r.has(i)||(r.add(i),e.push(i))}a.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),a.length>1&&n.push(a)}return n},`crossingComponents`),v=p(e=>[e.start,e.end].filter(e=>!!e),`endpointIdsFor`),y=p(e=>{let t=[];for(let n of _(e)){let e=new Set(n),r=new Set(n.flatMap(e=>v(e))),i=[...n];for(let t of s)e.has(t)||v(t).some(e=>r.has(e))&&i.push(t);i.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),t.push(i)}return t},`pairSearchGroups`),b=p((e,t,n)=>g(e,new Map([[t,n]])),`crossingCountWithSingleReplacement`),x=p(e=>{let t=new Map;for(let n of e.pairs)t.set(n.first,(t.get(n.first)??0)+n.count),t.set(n.second,(t.get(n.second)??0)+n.count);return t},`currentCrossingsByEdge`),S=p(e=>e.slice(1).reduce((t,n,r)=>{let i=e[r];return t+Math.abs(n.x-i.x)+Math.abs(n.y-i.y)},0),`pathLength`),C=p((e=new Map)=>s.reduce((t,n)=>t+hw(d(n,e)),0),`totalBends`),w=p((e=new Map)=>s.reduce((t,n)=>t+S(d(n,e)),0),`totalLength`),T=p((e,t,n=new Map)=>{let r=XT(t);for(let t of s)if(t!==e){for(let e of r)for(let r of XT(d(t,n)))if(pw(e,r,.5)>=YT)return!0}return!1},`pathHasSegmentConflict`),E=p((e,t)=>{let n=[e.start,e.end].filter(e=>!!e);for(let e of XT(t))if(Aw(e.a,e.b,i,n,-2))return!0;return!1},`pathHitsNode`),D=p((e,t)=>{let n=Iw(gw(t));XT(n).length===n.length-1&&e.push(n)},`pushOrthogonalCandidate`),O=p(e=>e===`left`||e===`right`,`sideIsHorizontal`),k=p((e,t,n)=>{switch(t){case`left`:return Math.min(e.x,n.x)-20;case`right`:return Math.max(e.x,n.x)+20;case`top`:return Math.min(e.y,n.y)-20;case`bottom`:return Math.max(e.y,n.y)+20}},`localTrackForSameSide`),A=p((e,t,n,r)=>{let i=n===`left`||n===`top`?-1:1,a=[k(t,n,r),o[n]];for(let o of a)for(let a=0;a<=2;a++)D(e,Ew(t,n,r,o+i*20*a))},`addSameSideCandidates`),j=p((e,t,n,r,i)=>{for(let a of u(n))for(let n of u(i))D(e,[t,{x:a,y:t.y},{x:a,y:n},{x:r.x,y:n},r])},`addHorizontalToVerticalCandidates`),M=p((e,t,n,r,i)=>{for(let a of u(n))for(let n of u(i))D(e,[t,{x:t.x,y:a},{x:n,y:a},{x:n,y:r.y},r])},`addVerticalToHorizontalCandidates`),N=p((e,t,n,r,i)=>{let a=[...u(`top`),...u(`bottom`)];for(let o of u(n))for(let n of u(i))for(let i of a)D(e,[t,{x:o,y:t.y},{x:o,y:i},{x:n,y:i},{x:n,y:r.y},r])},`addHorizontalPairCandidates`),P=p((e,t,n,r,i)=>{let a=[...u(`left`),...u(`right`)];for(let o of u(n))for(let n of u(i))for(let i of a)D(e,[t,{x:t.x,y:o},{x:i,y:o},{x:i,y:n},{x:r.x,y:n},r])},`addVerticalPairCandidates`),F=p(e=>{let t=new Set;return e.map(e=>gw(e)).filter(e=>{let n=e.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return t.has(n)||e.length<2?!1:(t.add(n),!0)})},`dedupeCandidatePaths`),I=p((e,t,n,r)=>{let i=[],a=Tw(e,t,n,r,20,JT);a&&D(i,a),t===r&&A(i,e,t,n);let o=O(t),s=O(r);return o&&!s?j(i,e,t,n,r):!o&&s?M(i,e,t,n,r):o?N(i,e,t,n,r):P(i,e,t,n,r),F(i)},`buildCandidatesForSides`),L=p((e,t,n,r)=>{let i=[...u(`left`),...u(`right`)],o=[...u(`top`),...u(`bottom`)];for(let s of a){let a=ww(r,s),l=s===`top`||s===`bottom`?u(s):o;for(let r of i){D(e,[t,n,{x:r,y:n.y},{x:r,y:a.y},a]);for(let i of l)D(e,[t,n,{x:r,y:n.y},{x:r,y:i},{x:a.x,y:i},a])}}},`addVerticalDepartureOuterTrackCandidates`),R=p((e,t,n,r)=>{let i=[...u(`left`),...u(`right`)],o=[...u(`top`),...u(`bottom`)];for(let s of a){let a=ww(r,s),l=s===`left`||s===`right`?u(s):i;for(let r of o){D(e,[t,n,{x:n.x,y:r},{x:a.x,y:r},a]);for(let i of l)D(e,[t,n,{x:n.x,y:r},{x:i,y:r},{x:i,y:a.y},a])}}},`addHorizontalDepartureOuterTrackCandidates`),ee=p(e=>{let t=e.start,n=e.end,i=n?r.get(n):void 0;if(!t||!i)return[];let a=gw(e.points??[]);if(a.length<4)return[];let o=a[0],s=a[1],l=[];return dw(o,s,JT)?L(l,o,s,i):uw(o,s,JT)&&R(l,o,s,i),l},`terminalPreservingOuterTrackCandidates`),z=p(e=>{let t=e.start,n=e.end,i=t?r.get(t):void 0,o=n?r.get(n):void 0;if(!i||!o)return[];let s=[];for(let e of a){let t=ww(i,e);for(let n of a)s.push(...I(t,e,ww(o,n),n))}return s.push(...ee(e)),s},`candidatePathsFor`),B=p(()=>new Map(s.map(e=>[e,XT(d(e))])),`currentSegmentsByEdge`),te=p((e,t,n)=>{let r=new Set;for(let i of s){if(i===e)continue;let a=n.get(i)??XT(d(i));t.some(e=>a.some(t=>pw(e,t,.5)>=YT))&&r.add(i)}return r},`sharedTrackConflictsFor`),ne=p((e,t,n,r)=>{let i=new Set;return z(e).map(e=>Iw(gw(e))).filter(t=>{if(E(e,t))return!1;let n=t.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return i.has(n)||t.length<2?!1:(i.add(n),!0)}).map(i=>{let a=XT(i),o=0;for(let t of s)t!==e&&(o+=f(a,n.get(t)??XT(d(t))));return{candidate:i,candidateSegments:a,crossings:t.count-(r.get(e)??0)+o,bends:hw(i,JT),totalBends:hw(i),length:S(i)}}).filter(({crossings:e})=>e<=t.count).sort((e,t)=>e.crossings-t.crossings||e.bends-t.bends||e.length-t.length).slice(0,48).map(t=>({path:t.candidate,segments:t.candidateSegments,sharedTrackConflicts:te(e,t.candidateSegments,n),totalBends:t.totalBends,length:t.length}))},`pairCandidatesFor`),re=p((e,t,n,r,i,a)=>{let o=0;for(let n of e.pairs)(n.first===t||n.second===t||n.first===r||n.second===r)&&(o+=n.count);let l=f(n.segments,i.segments);for(let e of s){if(e===t||e===r)continue;let o=a.get(e)??XT(d(e));l+=f(n.segments,o)+f(i.segments,o)}return e.count-o+l},`pairCrossingCount`),ie=p((e,t)=>{for(let n of e.sharedTrackConflicts)if(n!==t)return!1;return!0},`conflictsOnlyWith`),ae=p((e,t)=>e.segments.some(e=>t.segments.some(t=>pw(e,t,.5)>=YT)),`candidatesShareTrack`),oe=p((e,t,n,r)=>ie(t,n.edge)&&ie(r,e.edge)&&!ae(t,r),`pairCandidatesAreCompatible`),se=p((e,t,n,r,i)=>{let a=re(e.current,t.edge,n,r.edge,i,e.baseSegments);if(!(a>=e.current.count))return{replacements:new Map([[t.edge,n.path],[r.edge,i.path]]),crossings:a,bends:e.currentBends-(e.baseBendsByEdge.get(t.edge)??0)-(e.baseBendsByEdge.get(r.edge)??0)+n.totalBends+i.totalBends,length:e.currentLength-(e.baseLengthByEdge.get(t.edge)??0)-(e.baseLengthByEdge.get(r.edge)??0)+n.length+i.length}},`scorePairReplacement`),ce=p((e,t)=>e.crossings<t.crossings||e.crossings===t.crossings&&(e.bends<t.bends||e.bends===t.bends&&e.length<t.length),`pairScoreIsBetter`),le=p((e,t,n,r)=>{let i=r;for(let r of t.candidates)for(let a of n.candidates){if(!oe(t,r,n,a))continue;let o=se(e,t,r,n,a);o&&ce(o,i)&&(i=o)}return i},`bestScoreForOptionPair`),ue=p(e=>{let t=C(),n=w(),r=B(),i=x(e),a=new Map(s.map(e=>[e,hw(d(e))])),o=new Map(s.map(e=>[e,S(d(e))])),l=new Map,u=y(e);for(let t of u)for(let n of t){if(l.has(n))continue;let t=ne(n,e,r,i);t.length>0&&l.set(n,{edge:n,candidates:t})}let f={replacements:new Map,crossings:e.count,bends:t,length:n},p={current:e,currentBends:t,currentLength:n,baseBendsByEdge:a,baseLengthByEdge:o,baseSegments:r};for(let t of u){let n=new Set(t.filter(t=>e.edgeSet.has(t))),r=t.map(e=>l.get(e)).filter(e=>!!e);for(let e=0;e<r.length;e++){let t=r[e];for(let i=e+1;i<r.length;i++){let e=r[i];!n.has(t.edge)&&!n.has(e.edge)||(f=le(p,t,e,f))}}}return f.replacements.size>0?f.replacements:void 0},`bestPairedReplacement`);for(let e=0;e<4;e++){let e=h(),t=e.count;if(t===0)return;let n,r,i=t,a=1/0;for(let o of e.edges){let s=hw(d(o),JT);for(let l of z(o)){let u=E(o,l),d=!u&&T(o,l),f=b(e,o,l),p=hw(l,JT);u||d||(f<t||f===t&&p<s)&&(f>i||f===i&&p>=a||(n=o,r=l,i=f,a=p))}}if(n&&r){n.points=r;continue}let o=ue(e);if(!o)return;for(let[e,t]of o)e.points=t}}function zNe(e,t){let{nodeInfoById:n,realNodeRects:r}=Dw(t),i=[`top`,`bottom`,`left`,`right`],a={top:Math.min(...r.map(e=>e.rect.top))-20,bottom:Math.max(...r.map(e=>e.rect.bottom))+20,left:Math.min(...r.map(e=>e.rect.left))-20,right:Math.max(...r.map(e=>e.rect.right))+20},o=p((e,t,n,r)=>{let i=[],o=Tw(e,t,n,r,20,QT);return o&&i.push(o),t===r&&i.push(Ew(e,t,n,a[t])),i},`buildOrthogonalPathCandidates`),s=p((e,t)=>{for(let n=0;n<e.length-1;n++){let i=e[n],a=e[n+1];if(Aw(i,a,r,t,1))return!0}return!1},`pathHitsNode`),l=p((t,n,r=!1)=>{let i=0,a=mw(t,QT),o=n.start,s=n.end;for(let t of e){if(t===n||t.isLayoutOnly)continue;let e=t.start,l=t.end;if(!r&&o&&s&&(e===o||e===s||l===o||l===s))continue;let u=t.points;if(!(!u||u.length<2))for(let e of a)for(let t of mw(u,QT)){if(jw(e.a,e.b,t.a,t.b,QT,QT)){i++;continue}pw(e,t,QT)>=FPe&&i++}}return i},`pathConflictCount`),u=p((e,t)=>{let n=Math.abs(e.y-t.rect.top),r=Math.abs(e.y-t.rect.bottom),i=Math.abs(e.x-t.rect.left),a=Math.abs(e.x-t.rect.right),o=`top`,s=n;return r<s&&(o=`bottom`,s=r),i<s&&(o=`left`,s=i),a<s&&(o=`right`,s=a),o},`nearestSideOfRect`),d=new Map,f=p((e,t,n)=>{let r=d.get(e)??[];r.push({side:t,edgeId:n}),d.set(e,r)},`addFaceClaim`);for(let t of e){if(t.isLayoutOnly)continue;let e=t.points??[];if(e.length<1)continue;let r=t.id??``,i=t.start,a=t.end;if(i){let t=n.get(i);t&&f(i,u(e[0],t),r)}if(a){let t=n.get(a);t&&f(a,u(e[e.length-1],t),r)}}let m=p((e,t,n)=>d.get(e)?.some(e=>e.edgeId!==n&&e.side===t)??!1,`faceIsClaimed`);for(let t of e){if(t.isLayoutOnly)continue;let e=t.points;if(!e||e.length<2)continue;let r=hw(e,QT);if(r<4)continue;let a=t.start,p=t.end;if(!a||!p)continue;let h=n.get(a),g=n.get(p);if(!h||!g)continue;let _=t.id??``,v=l(e,t,!0),y=l(e,t),b,x=v,S=r;for(let e of i){if(m(a,e,_))continue;let n=ww(h,e);for(let r of i){if(m(p,r,_))continue;let i=ww(g,r);for(let u of o(n,e,i,r)){if(s(u,[a,p]))continue;let e=hw(u,QT);if(v>0){let n=l(u,t,!0);if(n>x||n===x&&e>=S)continue;x=n,S=e,b=u;continue}l(u,t)>y||e<S&&(S=e,b=u)}}}if(b){t.points=b;let e=d.get(a);e&&d.set(a,e.filter(e=>e.edgeId!==_));let n=d.get(p);n&&d.set(p,n.filter(e=>e.edgeId!==_)),f(a,u(b[0],h),_),f(p,u(b[b.length-1],g),_)}}}function oT(e,t){let n=t?0:e.length-1,r=t?1:-1,i=e[n],a=e[n+r];if(!i||!a)return;let o=a.x-i.x,s=a.y-i.y;if(!(Math.abs(o)+Math.abs(s)<$T)){if(Math.abs(s)<=$T){let e=i.x+Math.sign(o)*eE;return{left:Math.min(i.x,e),right:Math.max(i.x,e),top:i.y-tE,bottom:i.y+tE}}if(Math.abs(o)<=$T){let e=i.y+Math.sign(s)*eE;return{left:i.x-tE,right:i.x+tE,top:Math.min(i.y,e),bottom:Math.max(i.y,e)}}return{left:Math.min(i.x,a.x),right:Math.max(i.x,a.x),top:Math.min(i.y,a.y),bottom:Math.max(i.y,a.y)}}}function BNe(e){return{left:Math.min(e.left,e.right),right:Math.max(e.left,e.right),top:Math.min(e.top,e.bottom),bottom:Math.max(e.top,e.bottom)}}function sT(e,t){let n=gw(t);return[oT(n,!0),oT(n,!1)].some(t=>t&&bw(e,BNe(t)))}function cT(e,t){let n=[];for(let t of e){if(t.isLayoutOnly)continue;let e=t.points;if(!(!e||e.length<2))for(let r=0;r<e.length-1;r++)n.push({edgeId:t.id,p1:e[r],p2:e[r+1]})}let r=[],i=[];for(let e of t.values()){let t=e.isGroup,n=e.parentId;if(t&&!n){let t=Cw(e);t&&i.push({id:e.id,rect:t});continue}if(t||e.isEdgeLabel)continue;let a=Cw(e);a&&r.push({nodeId:e.id,rect:a})}let a=p((e,t)=>{let n=xw(t,3);for(let{nodeId:t,rect:i}of r)if(t!==e&&bw(n,i))return!0;return!1},`labelOverlapsForeignNode`),o=p((e,t)=>{let r=xw(t,3);for(let t of n)if(t.edgeId!==e&&vw(t.p1,t.p2,r))return!0;return!1},`labelOverlapsForeignEdge`),s=p((e,t,n)=>a(e,n)||o(t,n),`labelOverlapsAnything`),l=[],u=p(e=>{for(let{id:t,rect:n}of i)if(mNe(n,e))return t},`findContainingLane`),d=p((e,t)=>l.some(n=>n.labelId!==e&&bw(t,n.rect)),`overlapsPlacedLabel`);for(let n of e){if(n.isLayoutOnly)continue;let e=n.labelNodeId;if(!e)continue;let r=t.get(e);if(!r)continue;let f=n.points;if(!f||f.length<2)continue;let m=r.width??0,h=r.height??0;if(m<=0||h<=0)continue;let g=[];for(let e=0;e<f.length-1;e++){let t=f[e],n=f[e+1],r=Math.abs(t.x-n.x),i=Math.abs(t.y-n.y);r<$T&&i<$T||r>=$T&&i>=$T||g.push({idx:e,length:r+i,orientation:r>=$T?`horizontal`:`vertical`,midX:(t.x+n.x)/2,midY:(t.y+n.y)/2})}if(g.length===0)continue;let _=g.length>=3?g.filter(e=>e.idx>0&&e.idx<g.length-1):g,v=_.length>0?_:g,y=m>=h?`horizontal`:`vertical`,b=p(e=>[...e].sort((e,t)=>{let n=e.orientation===y;if(n!==(t.orientation===y))return n?-1:1;let r=e.length>=(e.orientation===`horizontal`?m:h)+2;return r===t.length>=(t.orientation===`horizontal`?m:h)+2?t.length-e.length:r?-1:1}),`rankSegments`),x=g[0],S=g[g.length-1],C=[.5,.25,.75,.05,.95,.15,.85,.1,.9],w=p((e,t)=>{let n=f[e.idx],r=f[e.idx+1];return{midX:n.x+(r.x-n.x)*t,midY:n.y+(r.y-n.y)*t}},`anchorAtT`),T=p((e,t,n)=>Math.min(n,Math.max(t,e)),`clamp`),E=p((e,t)=>e.midX>=t.left-$T&&e.midX<=t.right+$T&&e.midY>=t.top-$T&&e.midY<=t.bottom+$T,`pointInsideRectInclusive`),D=p(e=>{let t=Sw(e.midX,e.midY,m,h),n=u(t);if(n)return{laneId:n,anchor:e,rect:t};let r=i.find(({rect:t})=>E(e,t));if(!r)return;let a=r.rect.left+m/2+1,o=r.rect.right-m/2-1,s=r.rect.top+h/2+1,l=r.rect.bottom-h/2-1;if(a>o||s>l)return;let d={midX:T(e.midX,a,o),midY:T(e.midY,s,l)},f=Sw(d.midX,d.midY,m,h);return E(e,f)?{laneId:r.id,anchor:d,rect:f}:void 0},`placementForAnchor`),O=p((e,t,n)=>e.orientation===`horizontal`?Math.abs(t.midX-n.x):Math.abs(t.midY-n.y),`distanceAlongSegment`),k=p((e,t)=>{let n=(e.orientation===`horizontal`?m/2:h/2)+12;if(e===x){let r=f[e.idx];if(O(e,t,r)+$T<n)return!1}if(e===S){let r=f[e.idx+1];if(O(e,t,r)+$T<n)return!1}return!0},`labelClearsTerminalEndpoints`),A=p(t=>{let r=b(t);for(let t of r)for(let r of C){let i=w(t,r);if(!k(t,i))continue;let a=D(i);if(a&&!sT(a.rect,f)&&!d(e,a.rect)&&!s(e,n.id,a.rect))return{laneId:a.laneId,anchor:a.anchor}}},`tryPool`),j=p((t,r,i=!1)=>{let s=b(t);for(let t of s){let s={midX:t.midX,midY:t.midY};if(r&&!k(t,s))continue;let l=D(s);if(l&&!sT(l.rect,f)&&!d(e,l.rect)&&!a(e,l.rect)&&(i||!o(n.id,l.rect)))return{laneId:l.laneId,anchor:l.anchor}}},`findLaneContainingFallback`),M=A(v)??(v.length<g.length?A(g):void 0)??j(g,!0)??j(g,!1)??j(g,!1,!0);if(M){r.x=M.anchor.midX,r.y=M.anchor.midY,r.parentId=M.laneId;let t=Sw(M.anchor.midX,M.anchor.midY,m,h),n=l.findIndex(t=>t.labelId===e);n>=0?l[n]={labelId:e,rect:t}:l.push({labelId:e,rect:t})}}}function lT(e,t){return e<t?`${e}::${t}`:`${t}::${e}`}function VNe(e,t){let{nodeInfoById:n,realNodeRects:r}=Dw(t),i=new Map;for(let e of t){let t=e.id;if(!e.isGroup&&e.isEdgeLabel){i.set(t,{w:e.width??0,h:e.height??0});continue}}let a=p((t,n,r,a)=>{let o=lT(n,r),s=0,l=p(e=>{if(!e)return;let t=i.get(e);if(!t)return;let n=a===`x`?t.w/2:t.h/2;n>s&&(s=n)},`consider`);l(t.labelNodeId);for(let n of e){if(n===t||n.isLayoutOnly)continue;let e=n.start,r=n.end;!e||!r||lT(e,r)===o&&l(n.labelNodeId)}return s>0?s+IPe:0},`labelClearanceFor`);for(let t of e){if(t.isLayoutOnly)continue;let i=t.points;if(!_w(i,nE))continue;let o=kw(t,n,nE);if(!o)continue;let{srcId:s,dstId:l,srcInfo:u,dstInfo:d,collinearX:f,collinearY:p}=o;if(f===p)continue;let m,h;if(f){let e=d.cy>u.cy;m={x:u.cx,y:e?u.rect.bottom:u.rect.top},h={x:d.cx,y:e?d.rect.top:d.rect.bottom}}else{let e=d.cx>u.cx;m={x:e?u.rect.right:u.rect.left,y:u.cy},h={x:e?d.rect.left:d.rect.right,y:d.cy}}if(Aw(m,h,r,[s,l],1))continue;let g=a(t,s,l,f?`x`:`y`),_=g>rE?g:rE,v=[0,_,-_];for(let n of v){let i={...m},a={...h};if(f){if(i.x+=n,a.x+=n,i.x<=u.rect.left||i.x>=u.rect.right||a.x<=d.rect.left||a.x>=d.rect.right)continue}else if(i.y+=n,a.y+=n,i.y<=u.rect.top||i.y>=u.rect.bottom||a.y<=d.rect.top||a.y>=d.rect.bottom)continue;if(!Aw(i,a,r,[s,l],1)&&!Mw(i,a,e,t,{epsilon:nE})){t.points=[i,a];break}}}}function uT(e,t){let n=.001,{realNodeRects:r,labelNodeRects:i}=Ow(t.values()),a=p((e,t)=>mw(t,n).map(n=>({...n,edge:e,interior:n.index>=1&&n.index<=t.length-3})),`segmentsFor`),o=p(()=>{let t=[];for(let n of e){if(n.isLayoutOnly)continue;let e=n.points;!e||e.length<2||t.push(...a(n,gw(e)))}return t},`allSegments`),s=p((e,t)=>e.horizontal&&t.horizontal?fw(e.a.x,e.b.x,t.a.x,t.b.x)>=8&&Math.abs(e.a.y-t.a.y)<7:e.vertical&&t.vertical?fw(e.a.y,e.b.y,t.a.y,t.b.y)>=8&&Math.abs(e.a.x-t.a.x)<7:!1,`hasCrowdedParallelTrack`),l=p((t,o)=>{let l=t.start,u=t.end,d=a(t,o);if(d.length!==o.length-1)return!1;let f=[l,u].filter(e=>!!e),p=t.labelNodeId?[t.labelNodeId]:[];for(let e of d)if(Aw(e.a,e.b,r,f,-2)||Aw(e.a,e.b,i,p,-2))return!1;for(let r of e){if(r===t||r.isLayoutOnly)continue;let e=r.points;if(!(!e||e.length<2)){for(let t of d)for(let i of a(r,gw(e)))if(s(t,i)||Nw(t.a,t.b,i.a,i.b,n))return!1}}return!0},`candidateIsSafe`),u=p((e,t)=>{let n=gw(e.edge.points??[]);if(n.length<4||e.index>=n.length-1)return;let r=n.map(e=>({...e}));if(e.horizontal)r[e.index].y+=t,r[e.index+1].y+=t;else if(e.vertical)r[e.index].x+=t,r[e.index+1].x+=t;else return;return a(e.edge,r).length===r.length-1?r:void 0},`shiftedCandidate`),d=p((e,t)=>({x:e.x??(t.left+t.right)/2,y:e.y??(t.top+t.bottom)/2}),`nodeCenter`),f=p(e=>{let n=e.edge,r=gw(n.points??[]);if(r.length!==4||e.index!==1)return;let i=n.start?t.get(n.start):void 0,a=n.end?t.get(n.end):void 0,o=i?Cw(i):void 0,s=a?Cw(a):void 0,l=r.slice(e.index+2);if(!(!i||!a||!o||!s||l.length===0))return{sourceCenter:d(i,o),targetCenter:d(a,s),sourceRect:o,tail:l}},`sourceDetourContextFor`),m=p((e,t,r,i,a,o)=>{let s=i.y>=r.y,l=s?a.bottom:a.top,u=l+(s?20:-20);if(s&&e.b.y<=u+n||!s&&e.b.y>=u-n)return;let d=e.a.x+t;return gw([{x:r.x,y:l},{x:r.x,y:u},{x:d,y:u},{x:d,y:e.b.y},...o],n)},`verticalSourceDetour`),h=p((e,t,r,i,a,o)=>{let s=i.x>=r.x,l=s?a.right:a.left,u=l+(s?20:-20);if(s&&e.b.x<=u+n||!s&&e.b.x>=u-n)return;let d=e.a.y+t;return gw([{x:l,y:r.y},{x:u,y:r.y},{x:u,y:d},{x:e.b.x,y:d},...o],n)},`horizontalSourceDetour`),g=p((e,t)=>{let n=f(e);if(n){if(e.vertical)return m(e,t,n.sourceCenter,n.targetCenter,n.sourceRect,n.tail);if(e.horizontal)return h(e,t,n.sourceCenter,n.targetCenter,n.sourceRect,n.tail)}},`sourceDetourCandidate`),_=[-7,7,-14,14,-21,21];for(let e=0;e<12;e++){let e=o(),t=!1;for(let n=0;n<e.length&&!t;n++)for(let r=n+1;r<e.length&&!t;r++){let i=e[n],a=e[r];if(i.edge===a.edge||!s(i,a))continue;let o=[i,a].filter(e=>e.interior);for(let e of o){for(let n of _){let r=u(e,n);if(r&&l(e.edge,r)){e.edge.points=r,t=!0;break}let i=g(e,n);if(i&&l(e.edge,i)){e.edge.points=i,t=!0;break}}if(t)break}}if(!t)return}}function HNe(e,t,n,r){let i=t.x-e.x,a=t.y-e.y,o=r.x-n.x,s=r.y-n.y,l=i*s-a*o;if(Math.abs(l)<1e-10)return!1;let u=n.x-e.x,d=n.y-e.y,f=(u*s-d*o)/l,p=(u*a-d*i)/l,m=.01;return f>m&&f<.99&&p>m&&p<.99}function UNe(e){let t=e.nodes??[],n=e.edges??[],r=[];if(!n.length||!t.length)return r;let i=hNe(t),a=[];for(let e of n){if(e.isLayoutOnly)continue;let t=e.points;if(!t||t.length<2)continue;let n=e.start,o=e.end,s=e.labelNodeId,l=e.id??`${n}->${o}`;for(let e of i)if(e.nodeId!==n&&e.nodeId!==o&&!(s&&e.nodeId===s)){for(let n=0;n<t.length-1;n++)if(vw(t[n],t[n+1],e,-1)){r.push({type:`edge-node-overlap`,edgeId:l,targetId:e.nodeId,detail:`segment ${n} passes through node "${e.nodeId}"`});break}}for(let e=0;e<t.length-1;e++)a.push({edgeId:l,start:n,end:o,p1:t[e],p2:t[e+1]})}let o=new Set;for(let e=0;e<a.length;e++)for(let t=e+1;t<a.length;t++){let n=a[e],i=a[t];if(n.edgeId!==i.edgeId&&n.start!==i.start&&n.start!==i.end&&n.end!==i.start&&n.end!==i.end&&HNe(n.p1,n.p2,i.p1,i.p2)){let e=n.edgeId<i.edgeId?`${n.edgeId}|${i.edgeId}`:`${i.edgeId}|${n.edgeId}`;o.has(e)||(o.add(e),r.push({type:`edge-edge-crossing`,edgeId:n.edgeId,targetId:i.edgeId,detail:`edges "${n.edgeId}" and "${i.edgeId}" cross`}))}}if(r.length>0){let e=r.filter(e=>e.type===`edge-node-overlap`).length,t=r.filter(e=>e.type===`edge-edge-crossing`).length;y.warn(`[SWIMLANE_VALIDATE] ${r.length} issue(s) detected: ${e} edge-node overlap(s), ${t} edge crossing(s)`);for(let e of r)y.warn(`[SWIMLANE_VALIDATE] ${e.type}: ${e.detail}`)}return r}function WNe(e,t){let n=e.nodes??[],r=e.edges??[],i=n.filter(e=>!e.isGroup);if((t===`LR`||t===`RL`)&&i.length>0&&!ANe(e,t)||t===`BT`&&i.length>0&&!kNe(e))return;for(let e of r){if(e.isLayoutOnly)continue;let t=e.points;!t||t.length<2||(e.points=Iw(Fw(t)))}zNe(r,n),VNe(r,n),jNe(r,n);let a=new Map;for(let e of n)a.set(String(e.id),e);cT(r,a),bNe(r,a),MNe(r,a),uT(r,a),NNe(r,a),PNe(r,a),rT(r,a),FNe(r,a);let o=p(()=>{RNe(r,a),INe(r,a),LNe(r,a),cT(r,a),Qw(r,a),rT(r,a),cT(r,a),Qw(r,a)},`finalizeRenderedEdges`);o(),uT(r,a),o(),iT(r,a),aT(r,a),iT(r,a),aT(r,a)}function dT(e){let t=new Map(e.nodeById),n=new Set,r=[];for(let i of e.edges){if(!t.has(i.src)||!t.has(i.dst))continue;let e=`${i.id}:${i.src}->${i.dst}`;n.has(e)||(n.add(e),r.push(i))}return{nodes:[...t.keys()],edges:r,layout:e.layout,nodeById:t}}function fT(e,t){return e.edges.filter(e=>e.dst===t)}function GNe(e){let t=new Map;for(let n of e.nodes)t.set(n,[]);for(let n of e.edges)t.get(n.src).push(n.dst);return t}function pT(e){let t=GNe(e);for(let e of t.values())e.sort((e,t)=>e.localeCompare(t));return t}function mT(e){let t=new Map;for(let n of e.nodes)t.set(n,0);for(let n of e.edges)t.set(n.dst,(t.get(n.dst)??0)+1);return t}function hT(e){return[...e.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,t)=>e.localeCompare(t))}function gT(e,t=()=>!0){let n=new Map,r=new Map;for(let t of e.nodes)n.set(t,[]),r.set(t,[]);for(let i of e.edges)t(i)&&(r.get(i.src).push(i.dst),n.get(i.dst).push(i.src));return{preds:n,succs:r}}function _T(e,t,n,r){let i=0;for(let t of e.nodes)r?.skipGroups&&e.nodeById.get(t)?.isGroup||(i=Math.max(i,n[t]??0));let a=Array.from({length:i+1},()=>[]);for(let i of t)r?.skipGroups&&e.nodeById.get(i)?.isGroup||a[Math.max(0,n[i]??0)].push(i);return a}function vT(e){let t=mT(e),n=hT(t),r=[],i=pT(e);for(;n.length;){let e=n.shift();r.push(e);for(let r of i.get(e)??[])if(t.set(r,(t.get(r)??0)-1),(t.get(r)??0)===0){let e=0;for(;e<n.length&&n[e]<r;)e++;n.splice(e,0,r)}}return r.length===e.nodes.length?r:null}function yT(e){let t=new Map,n=0;for(let r of e)t.set(r,n),n++;return t}function bT(e){let t=Array(e.length),n=p((r,i)=>{if(i-r<=1)return 0;let a=r+i>>1,o=n(r,a)+n(a,i),s=r,l=a,u=r;for(;s<a||l<i;)l>=i||s<a&&e[s]<=e[l]?t[u++]=e[s++]:(t[u++]=e[l++],o+=a-s);for(let n=r;n<i;n++)e[n]=t[n];return o},`count`);return n(0,e.length)}function KNe(e){let t=dT(e),n=new Map;for(let e of t.nodes)n.set(e,[]);for(let e of t.edges)n.get(e.src).push(e);for(let e of n.values())e.sort((e,t)=>e.dst===t.dst?e.id.localeCompare(t.id):e.dst.localeCompare(t.dst));let r=Object.create(null);for(let e of t.nodes)r[e]=0;let i=[],a=p(e=>{r[e]=1;for(let t of n.get(e)??[]){let e=t.dst;r[e]===0?a(e):r[e]===1&&i.push(t)}r[e]=2},`dfs`),o=[...t.nodes].sort((e,t)=>e.localeCompare(t));for(let e of o)r[e]===0&&a(e);let s=new Set(i.map(e=>`${e.id}:${e.src}->${e.dst}`)),l=t.edges.map(e=>s.has(`${e.id}:${e.src}->${e.dst}`)?{id:e.id,src:e.dst,dst:e.src,weight:e.weight,ref:e.ref}:e);return{acyclic:{nodes:[...t.nodes],edges:l,layout:t.layout,nodeById:new Map(t.nodeById)},reversed:i}}function qNe(e){let t=new Map,n=p(r=>{if(t.has(r))return t.get(r);let i=e.nodeById.get(r);if(!i)return t.set(r,null),null;let a=i.parentId;if(!a)return t.set(r,null),null;let o=n(a)??a;return t.set(r,o),o},`resolve`);for(let t of e.nodes)n(t);return t}function xT(e){let t=qNe(e);return e=>t.get(e)??null}function ST(e){let t=[];for(let n of e.layout.nodes??[])n.isGroup&&!n.parentId&&t.push(n.id);return[...new Set(t)].reverse()}function CT(e,t){let n=ST(e);if(!t||t.length===0)return n;let r=new Set(n),i=new Set,a=[];for(let e of t)!r.has(e)||i.has(e)||(i.add(e),a.push(e));for(let e of n)i.has(e)||a.push(e);return a}function JNe(e,t){let n=dT(e),r=t?.laneOf??(()=>null),i=t?.rankHint,{preds:a}=gT(n);for(let e of a.values())e.sort((e,t)=>e.localeCompare(t));let o=vT(n)??[...n.nodes].sort((e,t)=>e.localeCompare(t)),s=new Map;for(let[e,t]of o.entries())s.set(t,e);let l=new Map,u=new Map;for(let e of n.nodes)u.set(e,[]);for(let e of o){let t=(a.get(e)??[]).filter(e=>l.has(e));if(t.length>0){let n=YNe(e,t,{laneOf:r,rankHint:i,topoIndex:s});l.set(e,n),u.get(n).push(e)}else l.has(e)||l.set(e,null)}for(let e of n.nodes)l.has(e)||l.set(e,null);let d=new Set;for(let e of n.nodes)(l.get(e)??null)===null&&d.add(e);let f=[...d].sort((e,t)=>{let n=s.get(e)??0,r=s.get(t)??0;return n===r?e.localeCompare(t):n-r}),m=XNe(n),h=new Map;for(let[e,t]of m.entries())h.set(e,[...t].sort((e,t)=>e.localeCompare(t)));let g=ZNe(h),_=QNe(h),v=new Map;for(let e of n.nodes)v.set(e,[]);for(let e of _)for(let t of e.nodes){let n=v.get(t);n?n.push(e.id):v.set(t,[e.id])}let y=[],b=[],x=new Set,S=p(e=>{if(!x.has(e)){x.add(e),y.push(e);for(let t of u.get(e)??[])S(t);b.push(e)}},`walk`);for(let e of f)S(e);for(let e of o)S(e);return{parent:l,children:u,roots:f,componentOf:g,blocks:_,nodeBlocks:v,adjacency:h,preorder:y,postorder:b,topologicalOrder:o}}function YNe(e,t,n){let r=n.laneOf(e);return[...t].sort((e,t)=>{let i=n.laneOf(e),a=n.laneOf(t),o=i!=null&&i===r;if(o!==(a!=null&&a===r))return o?-1:1;let s=n.rankHint?.[e],l=n.rankHint?.[t];if(s!=null&&l!=null&&s!==l)return l-s;let u=n.topoIndex.get(e)??0,d=n.topoIndex.get(t)??0;return u===d?e.localeCompare(t):u-d})[0]}function XNe(e){let t=new Map;for(let n of e.nodes)t.set(n,new Set);for(let n of e.edges)t.get(n.src).add(n.dst),t.get(n.dst).add(n.src);return t}function ZNe(e){let t=new Map,n=0;for(let r of e.keys()){if(t.has(r))continue;let i=[r];for(;i.length>0;){let r=i.pop();if(!t.has(r)){t.set(r,n);for(let n of e.get(r)??[])t.has(n)||i.push(n)}}n++}return t}function QNe(e){let t=new Map,n=new Map,r=[],i=[],a=0,o=p((s,l)=>{t.set(s,++a),n.set(s,a);for(let u of e.get(s)??[])u!==l&&(t.has(u)?(t.get(u)??0)<(t.get(s)??0)&&(r.push([s,u]),n.set(s,Math.min(n.get(s)??a,t.get(u)??a))):(r.push([s,u]),o(u,s),n.set(s,Math.min(n.get(s)??a,n.get(u)??a)),(n.get(u)??0)>=(t.get(s)??0)&&i.push($Ne(s,u,r,i.length))))},`visit`);for(let n of e.keys())t.has(n)||o(n,null);return i}function $Ne(e,t,n,r){let i=[],a=new Set;for(;n.length>0;){let r=n.pop();if(i.push(r),a.add(r[0]),a.add(r[1]),r[0]===e&&r[1]===t||r[0]===t&&r[1]===e)break}return{id:r,edges:i,nodes:[...a]}}function ePe(e,t,n){let r=[...e.nodes],i=new Map;for(let[e,t]of r.entries())i.set(t,e);let a=r.length,o=Array(a).fill(-1),s=Array(a).fill(0),l=[],u=new Set;for(let e of r){let t=n.parent.get(e)??null,r=i.get(e);r!=null&&(t??(o[r]=-1,s[r]=0,u.has(e)||(u.add(e),l.push(e))))}for(;l.length>0;){let e=l.shift(),t=i.get(e);if(t==null)continue;let r=n.children.get(e)??[];for(let e of r){if(u.has(e))continue;let n=i.get(e);n!=null&&(o[n]=t,s[n]=s[t]+1,u.add(e),l.push(e))}}for(let e of r){if(u.has(e))continue;let t=i.get(e);t!=null&&(o[t]=-1,s[t]=0,u.add(e))}let d=Math.max(1,Math.ceil(Math.log2(Math.max(1,a)))+1),f=Array.from({length:d},()=>Array(a).fill(-1));for(let e=0;e<a;e++)f[0][e]=o[e];for(let e=1;e<d;e++)for(let t=0;t<a;t++){let n=f[e-1][t];f[e][t]=n===-1?-1:f[e-1][n]}let m=p((e,t)=>{if(e===-1||t===-1)return-1;s[e]<s[t]&&([e,t]=[t,e]);let n=s[e]-s[t];for(let t=0;t<d;t++)if(n>>t&1&&(e=f[t][e],e===-1))return-1;if(e===t)return e;for(let n=d-1;n>=0;n--){let r=f[n][e],i=f[n][t];r!==-1&&i!==-1&&r!==i&&(e=r,t=i)}return f[0][e]},`lcaIndex`),h=Array.from({length:a},()=>new Map);for(let n of e.edges){let e=n.src,r=n.dst,a=t[e],o=t[r];if(a==null||o==null||(a>o&&([e,r]=[r,e],[a,o]=[o,a]),a==null||o==null||a===o))continue;let s=i.get(e),l=i.get(r);if(s==null||l==null)continue;let u=m(s,l);if(u===-1)continue;let d=h[u];for(let e=a;e<o;e++)d.set(e,(d.get(e)??0)+1)}let g=new Map,_=p((e,t)=>{if(t.size!==0)for(let[n,r]of t)e.set(n,(e.get(n)??0)+r)},`mergeInto`),v=new Set,y=p(e=>{let r=i.get(e);v.add(e);let a=r==null?void 0:h[r],o=a?new Map(a):new Map,s=n.children.get(e)??[];for(let n of s){let r=y(n),i=t[e];if(i!=null){let a=g.get(e);a||(a=new Map,g.set(e,a));let o=r.get(i)??0,s=t[n];s!=null&&s>i&&(o+=1),a.set(n,o)}_(o,r)}return o},`dfs`);for(let e of n.roots)v.has(e)||y(e);for(let e of r)v.has(e)||y(e);return g}function tPe(e,t,n){let r=new Map,i=p(e=>{let a=n[e]??0,o=[...t.get(e)??[]];o.sort(wT(n));for(let e of o){i(e);let t=r.get(e);t!=null&&(a=Math.min(a,t))}r.set(e,a)},`annotate`);for(let t of e)i(t);return r}function wT(e){return(t,n)=>{let r=e[t]??0,i=e[n]??0;return r===i?t.localeCompare(n):r-i}}function nPe(e,t,n,r){let i=0;for(let e of t){let t=n[e]??0;t>i&&(i=t)}let a=Array.from({length:i+1},()=>[]),o=new Set,s=p(e=>{if(o.has(e))return;o.add(e);let t=n[e]??0;a[t]||(a[t]=[]),a[t].push(e);for(let t of r(e))s(t)},`emit`);for(let t of e)s(t);for(let e of t)if(!o.has(e)){let t=n[e]??0;a[t]||(a[t]=[]),a[t].push(e),o.add(e)}return a}function rPe(e){let t=[];for(let n of e){let e=new Set,r=[];for(let t of n)e.has(t)||(e.add(t),r.push(t));t.push(r)}return t}function iPe(e,t,n,r){return i=>{let a=e.get(i)??[];if(a.length===0)return[];let o=t[i]??0,s=[],l=[],u=n.get(i);for(let e of a){let t=r.get(e)??o;t>o?s.push({child:e,min:t}):l.push(e)}return s.sort((e,t)=>e.min===t.min?e.child.localeCompare(t.child):e.min-t.min),l.sort((e,t)=>{let n=u?.get(e)??0,i=u?.get(t)??0;if(n!==i)return n-i;let a=r.get(e)??o,s=r.get(t)??o;return a===s?e.localeCompare(t):a-s}),[...s.map(e=>e.child),...l]}}function TT(e,t,n){let r=JNe(e,{rankHint:t,laneOf:n}),{children:i,roots:a}=r;for(let t of e.nodes)i.has(t)||i.set(t,[]);let o=ePe(e,t,r),s=[...a].sort(wT(t)),l=iPe(i,t,o,tPe(s,i,t)),u=nPe(s,e.nodes,t,l);return u=rPe(u),u}function aPe(e,t,n){let r=new Set(e),i=new Set(t),a=yT(t),o=[];for(let e of n)r.has(e.src)&&i.has(e.dst)&&o.push(a.get(e.dst));return bT(o)}function ET(e,t,n){let r=[];for(let e of t){let t=n[e.src],i=n[e.dst];if(t==null||i==null||t===i)continue;let a=e.src,o=e.dst,s=t,l=i;t>i&&(a=e.dst,o=e.src,s=i,l=t);for(let t=s;t<l;t++)r.push({id:`${e.id}@${t}`,src:a,dst:o,ref:e.ref})}let i=0;for(let t=0;t+1<e.length;t++)i+=aPe(e[t],e[t+1],r);return i}function oPe(e,t){let n={...t},{preds:r}=gT(e),i=xT(e),a=ET(TT(e,n,i),e.edges,n),o=iE.MAX_CROSSING_OPTIMIZATION_PASSES;for(let t=0;t<o;t++){let t=!1,o=[...e.nodes].sort((e,t)=>(n[t]??0)-(n[e]??0));for(let s of o){let o=n[s]??0;if(o===0)continue;let l=0;for(let e of r.get(s)??[])l=Math.max(l,(n[e]??0)+1);if(l>=o)continue;let u=o;n[s]=l;let d=ET(TT(e,n,i),e.edges,n);d<a?(a=d,t=!0):n[s]=u}if(!t)break}return n}function sPe(e,t){let n=xT(e),r=[...e.nodes].sort((e,n)=>(t[e]??0)-(t[n]??0)||e.localeCompare(n));for(let i of r){let r=n(i);if(!r)continue;let a=e.edges.filter(e=>e.src===i);if(a.length===0)continue;let o=!1,s=0;for(let e of a){let t=n(e.dst);t==null||t===r?o=!0:s++}if(s===0||o)continue;let l=0,u=!1;for(let t of e.edges){if(t.dst!==i)continue;let e=n(t.src);e&&(e===r?u=!0:l++)}if(l>0||!u)continue;let d=t[i]??0,f=d+s,p=0;for(let n of e.edges)n.dst===i&&(p=Math.max(p,(t[n.src]??0)+1));let m=Math.max(d,p,f);m!==d&&(t[i]=m)}}function cPe(e,t){let n=dT(e),r=vT(n)??[...n.nodes].sort(),i=t?.compactSingleInput??!1,a=xT(n),o=Object.create(null);for(let e of r){let r=fT(n,e),s=t?.ignoreCrossLaneEdges?r.filter(t=>{let n=a(t.src),r=a(e);return!n||!r||n===r}):r;if(s.length===0)o[e]=0;else if(i&&s.length===1){let t=s[0].src;a(t)===a(e)?o[e]=(o[t]??0)+1:o[e]=o[t]??0}else{let t=-1/0;for(let e of s)t=Math.max(t,(o[e.src]??0)+1);o[e]=t===-1/0?0:t}}return(t?.optimizeRanksByCrossings??!1)&&(o=oPe(n,o)),t?.ignoreCrossLaneEdges&&sPe(n,o),{layers:TT(n,o,a),rankOf:o,dummy:new Set}}function lPe(e,t){let n=dT(e),r={...cPe(n,{compactSingleInput:t?.compactSingleInput,ignoreCrossLaneEdges:t?.ignoreCrossLaneEdges,optimizeRanksByCrossings:t?.optimizeRanksByCrossings}).rankOf},i=xT(n),{preds:a,succs:o}=gT(n,e=>{if(t?.ignoreCrossLaneEdges){let t=i(e.src),n=i(e.dst);if(t&&n&&t!==n)return!1}return!0}),s=vT(n)??[...n.nodes],l=[...s].reverse(),u=p((e,t)=>{let n=0;for(let t of a.get(e)??[])n=Math.max(n,(r[t]??0)+1);let i=1/0,s=o.get(e)??[];return s.length>0&&(i=Math.min(...s.map(e=>(r[e]??0)-1))),Number.isFinite(i)||(i=Math.max(n,t)),Math.min(Math.max(t,n),i)},`clampFeasible`),d=iE.GRAVITY_ITERATIONS,f=p(e=>{let t=!1;for(let n of e){let e=a.get(n)??[],i=o.get(n)??[];if(e.length===0&&i.length===0)continue;let s=e.length>0?e.reduce((e,t)=>e+(r[t]??0)+1,0)/e.length:r[n]??0,l=i.length>0?i.reduce((e,t)=>e+(r[t]??0)-1,0)/i.length:r[n]??0,d=Math.round((s+l)/2),f=u(n,d);f!==r[n]&&(r[n]=f,t=!0)}return t},`relaxOrder`);for(let e=0;e<d;e++){let e=f(s),t=f(l);if(!e&&!t)break}for(let e of s){let t=0;for(let n of a.get(e)??[])t=Math.max(t,(r[n]??0)+1);(r[e]??0)<t&&(r[e]=t)}for(let e of l){let t=o.get(e)??[];if(t.length>0){let n=Math.min(...t.map(e=>(r[e]??0)-1));(r[e]??0)>n&&(r[e]=n)}}return{layers:_T(n,s,r),rankOf:r,dummy:new Set}}function uPe(e){let t=mT(e),n=pT(e),r=hT(t),i=[];for(;r.length>0;){let e=[];for(let a of r){i.push(a);for(let r of n.get(a)??[])t.set(r,(t.get(r)??0)-1),(t.get(r)??0)===0&&e.push(r)}r=e.sort((e,t)=>e.localeCompare(t))}return i.length===e.nodes.length?i:null}function dPe(e,t){let n=dT(e),r=t?.direction===`LR`?uPe(n)??[...n.nodes].sort():vT(n)??[...n.nodes].sort(),i=xT(n),a=p(e=>i(e)??e,`laneOf`),o=Object.create(null),s=new Map,l=p((e,n)=>t?.ignoreCrossLaneEdges??!0?+(a(e)===a(n)):1,`edgeWeight`);for(let e of r){if(n.nodeById.get(e)?.isGroup)continue;let t=fT(n,e),r=0;if(t.length>0)for(let n of t){let t=n.src,i=o[t]??0;r=Math.max(r,i+l(t,e))}let i=a(e),u=s.get(i)??0,d=Math.max(r,u);o[e]=d,s.set(i,d+1)}return{layers:_T(n,r,o,{skipGroups:!0}),rankOf:o,dummy:new Set}}function fPe(e,t){let n=dT(t),{rankOf:r}=e,i=e.layers.map(e=>[...e]),a=new Set(e.dummy?[...e.dummy]:[]),o=0,s=new Map(n.nodeById),l=p(e=>{let t=`placeholder-${o++}`,n={id:t,isGroup:!1,isDummy:!0,width:0,height:0};for(s.set(t,n),a.add(t);i.length<=e;)i.push([]);return i[e].push(t),r[t]=e,t},`addDummyAt`),u=[...n.edges].sort((e,t)=>e.id===t.id?e.src===t.src?e.dst.localeCompare(t.dst):e.src.localeCompare(t.src):e.id.localeCompare(t.id)),d=[];for(let e of u){let t=r[e.src]??0,n=r[e.dst]??0;if(n-t<=1){d.push(e);continue}let i=e.src;for(let r=t+1,a=0;r<n;r++,a++){let t=l(r);d.push({id:`${e.id}#${a}`,src:i,dst:t,weight:e.weight,ref:e.ref}),i=t}let a=n-t-2;d.push({id:`${e.id}#${Math.max(a+1,0)}`,src:i,dst:e.dst,weight:e.weight,ref:e.ref})}let f={nodes:[...n.nodes,...[...a].filter(e=>!n.nodes.includes(e))],edges:d,layout:n.layout,nodeById:s};return{layering:{layers:i,rankOf:r,dummy:a},graphWithDummies:f}}function DT(e){let t=e.length;if(t===0)return 1/0;let n=[...e].sort((e,t)=>e-t);return t%2==1?n[(t-1)/2]:.5*(n[t/2-1]+n[t/2])}function OT(e){return e.length===0?1/0:e.reduce((e,t)=>e+t,0)/e.length}function pPe(e,t,n,r){let i=new Map;for(let t of e)i.set(t,[]);for(let e of n)r===`down`?t.has(e.src)&&i.has(e.dst)&&i.get(e.dst).push(t.get(e.src)):t.has(e.dst)&&i.has(e.src)&&i.get(e.src).push(t.get(e.dst));return i}function mPe(e,t,n){let r=n.get(e)??0,i=n.get(t)??0;return r===i?e.localeCompare(t):r-i}function kT(e,t,n){let r=new Set(e),i=new Set(t),a=yT(e),o=yT(t),s=[];for(let e of n)r.has(e.src)&&i.has(e.dst)&&s.push({u:a.get(e.src),v:o.get(e.dst)});return s.sort((e,t)=>e.u===t.u?e.v-t.v:e.u-t.u),bT(s.map(e=>e.v))}function AT(e,t,n){return[...e].sort((e,r)=>{let i=DT(t.get(e)??[]),a=DT(t.get(r)??[]);return i===a?mPe(e,r,n):isFinite(i)?isFinite(a)?i-a:-1:1})}function jT(e,t,n,r,i,a){let o=yT(e),s=yT(t),l=pPe(t,o,n,r);if(!i||!a||a.length===0)return AT(t,l,s);let u=new Map;for(let e of t){let t=i(e),n=u.get(t)??[];n.push(e),u.set(t,n)}let d=[];for(let e of a){let t=u.get(e);if(!t||t.length===0)continue;let n=AT(t,l,s);d.push(...n)}let f=u.get(null);if(f&&f.length>0){let e=AT(f,l,s);for(let t of e){let e=OT(l.get(t)??[]),n=d.length;if(isFinite(e)){for(let[t,r]of d.entries())if(e<OT(l.get(r)??[])){n=t;break}}d.splice(n,0,t)}}return d}function MT(e,t,n,r,i){let a=[...t],o=new Set(e),s=new Set(t),l=r?new Set(r):null,u=n.filter(e=>o.has(e.src)&&s.has(e.dst)),d=l?n.filter(e=>s.has(e.src)&&l.has(e.dst)):void 0,f=p(t=>{let n=kT(e,t,u);return d&&r&&(n+=kT(t,r,d)),n},`crossingScore`),m=i?new Map:null;if(i&&m)for(let e of t)m.set(e,i(e));let h=!0,g=f(a);for(;h;){h=!1;for(let e=0;e+1<a.length;e++){if(m&&m.get(a[e])!==m.get(a[e+1]))continue;let t=g;[a[e],a[e+1]]=[a[e+1],a[e]];let n=f(a);n<t?(g=n,h=!0):[a[e],a[e+1]]=[a[e+1],a[e]]}}return a}function hPe(e,t,n){let r=e.layers.map(e=>[...e]),i=t.edges,a=xT(t),o=CT(t,n?.laneOrder);for(let e=0;e<3;e++){for(let e=1;e<r.length;e++)r[e]=jT(r[e-1],r[e],i,`down`,a,o),r[e]=MT(r[e-1],r[e],i,r[e+1],a);for(let e=r.length-2;e>=0;e--)r[e]=jT(r[e+1],r[e],i,`up`,a,o),r[e]=MT(r[e+1],r[e],i,r[e-1],a)}return{layers:r}}function gPe(e,t,n){let r=n?.layerGap??aE.DEFAULT_LAYER_GAP,i=n?.nodeGap??aE.DEFAULT_NODE_GAP,a=n?.laneGap??i*2,o=n?.direction??`TB`,s=o===`LR`||o===`RL`,l=e.layers,u=Object.create(null),d=Object.create(null),f=p(e=>t.nodeById.get(e),`getNode`),m=p(e=>f(e)?.width??0,`getWidth`),h=p(e=>f(e)?.height??0,`getHeight`),g=xT(t),_=CT(t,n?.laneOrder),v=l.map(e=>e.reduce((e,t)=>Math.max(e,h(t)),0)),y=[];if(s)for(let e=0;e+1<l.length;e++){let t=l[e].reduce((e,t)=>Math.max(e,m(t)),0),n=l[e+1].reduce((e,t)=>Math.max(e,m(t)),0),i=v[e],a=v[e+1],o=i/2+a/2,s=(t+n)/2,u=Math.max(0,s-o-r);y.push(u)}let b=new Set;for(let e of l)for(let t of e)b.add(g(t));let x=b.has(null),S=_.filter(e=>b.has(e)),C=[...x?[null]:[],...S],w=Object.create(null);for(let e of S)w[e]=0;x&&(w.null=0);for(let e of l){let t=Object.create(null),n=[];for(let r of e){let e=g(r);e===null?n.push(r):(t[e]||=[]).push(r)}for(let[e,n]of Object.entries(t)){let t=n.reduce((e,t)=>e+m(t),0)+i*Math.max(0,n.length-1);w[e]=Math.max(w[e]??0,t)}if(x&&n.length){let e=n.reduce((e,t)=>e+m(t),0)+i*Math.max(0,n.length-1);w.null=Math.max(w.null??0,e)}}let T=new Map;{let e=C.map(e=>(e===null?w.null:w[e])??0),t=-(e.reduce((e,t)=>e+t,0)+a*Math.max(0,C.length-1))/2;for(let n=0;n<C.length;n++){let r=C[n],i=e[n]??0,o=t+i/2;T.set(r,o),t+=i,n<C.length-1&&(t+=a)}}let E=0;for(let[e,t]of l.entries()){let n=v[e]??0,a=new Map;for(let e of t){let t=g(e),n=a.get(t)??[];n.push(e),a.set(t,n)}for(let e of C){let t=a.get(e)??[];if(t.length===0)continue;let r=T.get(e);if(t.length===1){let e=t[0];u[e]=r,d[e]=E+n/2}else{let e=t.map(e=>m(e)),a=r-(e.reduce((e,t)=>e+t,0)+i*(t.length-1))/2;for(let[r,o]of t.entries()){let t=e[r];u[o]=a+t/2,d[o]=E+n/2,a+=t+i}}}let o=y[e]??0;E+=n+r+o}let D=new Map;for(let e of t.edges){let t=e.ref.id;D.has(t)||D.set(t,[]),D.get(t).push(e)}for(let[,e]of D){if(e.length===0)continue;let n=e[0].ref,r=n.start,i=n.end;if(r==null||i==null)continue;let a=Math.round(((u[r]??0)+(u[i]??0))/2),o=new Set;for(let t of e)o.add(t.src),o.add(t.dst);for(let e of o)e!==r&&e!==i&&t.nodeById.get(e)?.isDummy&&(u[e]=a)}return{x:u,y:d}}function _Pe(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function vPe(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}function yPe(e,t){let n=[...e],r=vPe(t);for(let e=n.length-1;e>0;e--){let t=Math.floor(r()*(e+1));[n[e],n[t]]=[n[t],n[e]]}return n}function bPe(e,t){let n=0;for(let[r,i]of e.entries())n+=Math.abs(r-(t.get(i)??r));return n}function NT(e,t){let n=new Map;for(let[t,r]of e.entries())n.set(r,t);let r=0;for(let{a:e,b:i,weight:a}of t){let t=n.get(e),o=n.get(i);t!=null&&o!=null&&(r+=a*Math.abs(t-o))}return r}function xPe(e){let t=ST(e);if(t.length<2)return[];let n=new Map(t.map((e,t)=>[e,t])),r=xT(e),i=new Map;for(let t of e.layout.edges??[]){if(t.isLayoutOnly)continue;let a=typeof t.start==`string`?t.start:void 0,o=typeof t.end==`string`?t.end:void 0;if(!a||!o||!e.nodeById.has(a)||!e.nodeById.has(o))continue;let s=r(a),l=r(o);if(!s||!l||s===l)continue;let u=n.get(s),d=n.get(l);if(u==null||d==null)continue;let[f,p]=u<=d?[s,l]:[l,s],m=`${f}\0${p}`,h=i.get(m);h?h.weight++:i.set(m,{a:f,b:p,weight:1})}return[...i.values()]}function PT(e,t,n){let r=[...e],i=NT(r,t),a=!0,o=0,s=Math.max(1,r.length);for(;a&&o<s;){a=!1,o++;for(let e=0;e+1<r.length;e++){[r[e],r[e+1]]=[r[e+1],r[e]];let n=NT(r,t);n<i?(i=n,a=!0):[r[e],r[e+1]]=[r[e+1],r[e]]}}return{order:r,cost:i,sourceDistance:bPe(r,n)}}function SPe(e,t){return e.cost===t.cost?e.sourceDistance<t.sourceDistance:e.cost<t.cost}function CPe(e,t,n){let r=[...t].sort((e,t)=>e.a===t.a?e.b.localeCompare(t.b):e.a.localeCompare(t.a)).map(({a:e,b:t,weight:n})=>`${e}:${t}:${n}`).join(`|`);return _Pe(`${e.join(`|`)}#${r}#${n}`)}function wPe(e,t={}){let n=ST(e);if(n.length<2)return n;let r=xPe(e);if(r.length===0)return n;let i=new Map(n.map((e,t)=>[e,t])),a=PT(n,r,i),o=Math.max(0,t.restarts??oE);for(let e=0;e<o;e++){let t=PT(yPe(n,CPe(n,r,e)),r,i);SPe(t,a)&&(a=t)}return a.order}function TPe(e,t){let n=t?.ignoreCrossLaneEdges??!0,r=t?.optimizeRanksByCrossings??!0,i=dT(e),a=t?.automaticLaneOrdering?wPe(i,{restarts:oE}):void 0,o=KNe(i),s=o.acyclic,{layering:l,graphWithDummies:u}=fPe(n?dPe(s,{compactSingleInput:t?.compactSingleInput??iE.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!0,direction:t?.direction}):lPe(s,{compactSingleInput:t?.compactSingleInput??iE.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!1,optimizeRanksByCrossings:r}),s),d=hPe(l,u,{laneOrder:a}),f=gPe(d,u,{layerGap:t?.layerGap,nodeGap:t?.nodeGap,direction:t?.direction,laneOrder:a});return{acyclic:s,reversed:o.reversed,layering:l,ordered:d,coordinates:f}}function FT(e,t,n){let r=e.x??0,i=e.y??0,a=t.x-r,o=t.y-i,s=Math.abs(a),l=Math.abs(o);return s<sE&&l<sE?n:l>sE&&l*3>=s?o>0?`bottom`:`top`:s>sE?a>0?`right`:`left`:n}function IT(e,t){return Math.abs(e.to-t.from)<sE||Math.abs(e.to-t.to)<sE?e.to:e.from}function LT(e,t){return e.orient===`vertical`?{x:e.coord,y:t}:{x:t,y:e.coord}}function EPe(e,t){let n=e.nodes??[],r=e.edges??[],i=[];for(let e of r)e.isLayoutOnly||i.push({...e,__originalEdge:e});let a=new Map,o=new Map,s=[],l=t===`LR`;for(let e of n)a.set(e.id,e);let u=n.filter(e=>e.isGroup&&!e.parentId);for(let e of u){let t={id:e.id},r=p(e=>{o.set(e.id,t),n.filter(t=>t.parentId===e.id).forEach(r)},`assignLane`);r(e)}let d=n.filter(e=>!e.isGroup&&!e.isEdgeLabel).map(e=>{let t=e.width??10,n=e.height??10,r=e.x??0,i=e.y??0,a=RPe;return{nodeId:e.id,minX:r-t/2-a,maxX:r+t/2+a,minY:i-n/2-a,maxY:i+n/2+a,visualXHalfExtent:l?n/2+a:t/2+a}}),f=p((e,t,n,r)=>{let i=s.find(n=>n.orientation===e&&Math.abs(n.coord-t)<1);return i||(i={id:`pipe-${e}-${t.toFixed(0)}`,orientation:e,coord:t,spanMin:n,spanMax:r,tracks:[]},s.push(i)),i.spanMin=Math.min(i.spanMin,n),i.spanMax=Math.max(i.spanMax,r),i},`getOrAddPipe`),m=p((e,t)=>{let n=e.width??10,r=e.height??10,i=e.x??0,a=e.y??0;switch(t){case`top`:return{x:i,y:a-r/2};case`bottom`:return{x:i,y:a+r/2};case`left`:return{x:i-n/2,y:a};case`right`:return{x:i+n/2,y:a}}},`portForSide`),h=p((e,t,n)=>m(e,FT(e,t,n?`bottom`:`top`)),`getOrthogonalPort`),g=[],_=[],v=new Set,y=1e3,b=p((e,t,n)=>{if(g.length===0)return 0;let r=Math.abs(t.y-n.y)<sE,i=Math.abs(t.x-n.x)<sE;if(!r&&!i)return 0;let a=0;if(r){let r=t.y,i=Math.min(t.x,n.x)-sE,o=Math.max(t.x,n.x)+sE;if(o<=i)return 0;for(let t of g)t.edgeIndex!==e&&t.orientation===`vertical`&&(t.pipe.coord<i||t.pipe.coord>o||t.from-sE<=r&&t.to+sE>=r&&(a+=y))}else if(i){let r=t.x,i=Math.min(t.y,n.y)-sE,o=Math.max(t.y,n.y)+sE;if(o<=i)return 0;for(let t of g)t.edgeIndex!==e&&t.orientation===`horizontal`&&(t.pipe.coord<i||t.pipe.coord>o||t.from-sE<=r&&t.to+sE>=r&&(a+=y))}return a},`crossingPenalty`),x=i.map((e,t)=>{if(!e.start||!e.end)return{idx:t,crossLane:0,dx:0,dy:0};let n=a.get(e.start),r=a.get(e.end),i=o.get(e.start),s=o.get(e.end);return{idx:t,crossLane:i&&s&&i.id!==s.id?1:0,dx:n&&r?Math.abs((r.x??0)-(n.x??0)):0,dy:n&&r?Math.abs((r.y??0)-(n.y??0)):0}}).sort((e,t)=>{if(e.crossLane!==t.crossLane)return t.crossLane-e.crossLane;let n=e.dx+e.dy,r=t.dx+t.dy;return Math.abs(n-r)>1?n-r:e.idx-t.idx}).map(e=>e.idx),S=p((e,t,n,r)=>{let i=Math.min(e.x,t.x),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y),s=Math.max(e.y,t.y);return!!d.find(l=>n&&l.nodeId===n||r&&l.nodeId===r?!1:Math.abs(e.x-t.x)>sE?l.minY<e.y&&l.maxY>e.y&&l.maxX>i&&l.minX<a:l.minX<e.x&&l.maxX>e.x&&l.maxY>o&&l.minY<s)},`isSegmentBlocked`),C=new Map,w=new Map;for(let e of i)!e.start||!e.end||e.start===e.end||(w.set(e.start,(w.get(e.start)??0)+1),w.set(e.end,(w.get(e.end)??0)+1));let T=p((e,t)=>FT(e,t,`bottom`),`determineSide`),E=new Map;for(let[e,t]of i.entries()){if(!t.start||!t.end||t.start===t.end||t.points&&t.points.length>0)continue;let n=a.get(t.start),r=a.get(t.end);if(!n||!r)continue;let i=(r.x??0)-(n.x??0),o=(r.y??0)-(n.y??0);E.set(e,{edgeIdx:e,srcId:t.start,dstId:t.end,srcSide:T(n,{x:r.x??0,y:r.y??0}),dstSide:T(r,{x:n.x??0,y:n.y??0}),absDx:Math.abs(i),absDy:Math.abs(o),dxSign:Math.sign(i),dySign:Math.sign(o)})}let D=p(e=>e.srcSide===`top`||e.srcSide===`bottom`?e.absDx===0?1/0:e.absDy/e.absDx:e.absDy===0?1/0:e.absDx/e.absDy,`preferenceStrength`),O=p(e=>e.srcSide===`top`||e.srcSide===`bottom`?e.dxSign>=0?`right`:`left`:e.dySign>=0?`bottom`:`top`,`secondarySide`),k=new Map;for(let e of E.values()){let t=`${e.srcId}:${e.srcSide}`;k.has(t)||k.set(t,[]),k.get(t).push(e)}let A=new Map,j=p((e,t)=>`${e}:${t}`,`loadKey`);for(let e of E.values())A.set(j(e.srcId,e.srcSide),(A.get(j(e.srcId,e.srcSide))??0)+1),A.set(j(e.dstId,e.dstSide),(A.get(j(e.dstId,e.dstSide))??0)+1);for(let e of k.values())if(!(e.length<2)){e.sort((e,t)=>{let n=D(e),r=D(t);return Math.abs(n-r)>1e-9?r-n:e.edgeIdx-t.edgeIdx});for(let t=1;t<e.length;t++){let n=e[t],r=O(n),i=A.get(j(n.srcId,n.srcSide))??0,a=A.get(j(n.srcId,r))??0;a>=i||(A.set(j(n.srcId,n.srcSide),i-1),A.set(j(n.srcId,r),a+1),n.srcSide=r)}}let M=p(e=>{let t=e?.shape;return t===`question`||t===`diamond`},`isDiamondNode`),N=new Map;for(let e of E.values())N.has(e.dstId)||N.set(e.dstId,new Set),N.get(e.dstId).add(e.dstSide);for(let e of E.values()){if(!M(a.get(e.srcId)))continue;let t=N.get(e.srcId);if(!t?.has(e.srcSide))continue;let n=O(e);if(t.has(n)||(A.get(j(e.srcId,n))??0)>0)continue;let r=A.get(j(e.srcId,e.srcSide))??0;A.set(j(e.srcId,e.srcSide),Math.max(0,r-1)),A.set(j(e.srcId,n),1),e.srcSide=n}for(let e of E.values()){let{edgeIdx:t,srcId:n,dstId:r,srcSide:i,dstSide:o}=e,s=a.get(n),l=a.get(r),u=`${n}:${i}:src`,d=i===`top`||i===`bottom`?l.x??0:l.y??0;C.has(u)||C.set(u,[]),C.get(u).push({edgeIdx:t,oppositeCoord:d});let f=`${r}:${o}:dst`,p=o===`top`||o===`bottom`?s.x??0:s.y??0;C.has(f)||C.set(f,[]),C.get(f).push({edgeIdx:t,oppositeCoord:p})}let P=new Map;for(let[e,t]of C){if(t.length<2)continue;t.sort((e,t)=>e.oppositeCoord-t.oppositeCoord);let n=e.split(`:`),r=n.slice(0,-2).join(`:`),i=n[n.length-2],o=n[n.length-1],s=a.get(r);if(!s)continue;let l=i===`left`||i===`right`?s.height??10:s.width??10,u=s.shape,d=u===`question`||u===`diamond`?l*.3:l,f=Math.min(20,Math.max(8,d/(t.length+1))),p=-(f*(t.length-1))/2;for(let[e,n]of t.entries()){let t=p+e*f,r=`${n.edgeIdx}:${o}`;P.set(r,t)}}let F=p(e=>!!i[e]?.labelNodeId,`edgeHasLabelNode`),I=p((e,t)=>e?(C.get(`${e}:${t}:src`)??[]).some(({edgeIdx:e})=>F(e))||(C.get(`${e}:${t}:dst`)??[]).some(({edgeIdx:e})=>F(e)):!1,`faceHasLabelNode`),L=p((e,t,n)=>t===`top`||t===`bottom`?{x:e.x+n,y:e.y}:{x:e.x,y:e.y+n},`applyPortOffset`),R=p((e,t,n)=>{let r=E.get(e),i={x:n.x??0,y:n.y??0},a={x:t.x??0,y:t.y??0},o=r?.srcSide??T(t,i),s=r?.dstSide??T(n,a),l=r?m(t,r.srcSide):h(t,i,!0),u=r?m(n,r.dstSide):h(n,a,!1),d=P.get(`${e}:src`),f=P.get(`${e}:dst`);return d!==void 0&&(l=L(l,o,d)),f!==void 0&&(u=L(u,s,f)),{pSrcPort:l,pDstPort:u,srcSide:o,dstSide:s}},`portsForEdge`);for(let e of x){let t=i[e];if(_[e]=[],!t.start||!t.end||t.points&&t.points.length>0||t.start===t.end)continue;let n=a.get(t.start),r=a.get(t.end);if(!n||!r)continue;let{pSrcPort:o,pDstPort:u,srcSide:m,dstSide:h}=R(e,n,r),y={...o},x={...u},T=m===`top`||m===`bottom`,E=h===`top`||h===`bottom`;T?y.y=o.y>(n.y??0)?o.y+dE:o.y-dE:y.x=o.x>(n.x??0)?o.x+dE:o.x-dE,E?x.y=u.y>(r.y??0)?u.y+dE:u.y-dE:x.x=u.x>(r.x??0)?u.x+dE:u.x-dE;let D=p((e,t)=>{for(let n of d)if(!t.includes(n.nodeId)&&e.x>n.minX&&e.x<n.maxX&&e.y>n.minY&&e.y<n.maxY)return{inside:!0,obstacle:n};return{inside:!1}},`isPointInObstacle`),O=p((e,t,n,r,i)=>{if(i){let i=e.y>(t.y??0);return{x:(n.x??0)>=e.x?r.maxX+cE:r.minX-cE,y:i?r.maxY+lE:r.minY-lE,leavesPositiveSide:i}}let a=e.x>(t.x??0),o=(n.y??0)>=e.y;return{x:a?r.maxX+cE:r.minX-cE,y:o?r.maxY+lE:r.minY-lE,leavesPositiveSide:a}},`obstacleDetour`),k=[],A=[t.start,t.end],j=D(y,A);if(j.inside&&j.obstacle){let e=j.obstacle;if(T){let t=O(o,n,r,e,!0);y.x=t.x,y.y=t.y;let i=t.leavesPositiveSide?Math.min(e.minY-2,o.y+dE):Math.max(e.maxY+2,o.y-dE);k=[{x:o.x,y:i},{x:t.x,y:i},{x:t.x,y:t.y}]}else{let t=O(o,n,r,e,!1),i=t.leavesPositiveSide?Math.min(e.minX-2,o.x+dE):Math.max(e.maxX+2,o.x-dE);y.x=t.x,y.y=t.y,k=[{x:i,y:o.y},{x:i,y:t.y},{x:t.x,y:t.y}]}}let M=[],N=D(x,A);if(N.inside&&N.obstacle){let e=N.obstacle;if(E){let t=O(u,r,n,e,!0);x.x=t.x,x.y=t.y,M=[{x:t.x,y:t.y},{x:u.x,y:t.y}]}else{let t=O(u,r,n,e,!1);x.x=t.x,x.y=t.y,M=[{x:t.x,y:t.y},{x:t.x,y:u.y}]}}if(k.length===0&&M.length===0){let n=cE,r=Math.abs(y.x-x.x)<n,i=Math.abs(y.y-x.y)<n,a=P.get(`${e}:src`)!==void 0||P.get(`${e}:dst`)!==void 0,s=(C.get(`${t.start??``}:${m}:src`)?.length??0)+(C.get(`${t.start??``}:${m}:dst`)?.length??0),l=(C.get(`${t.end??``}:${h}:src`)?.length??0)+(C.get(`${t.end??``}:${h}:dst`)?.length??0),d=s>1||l>1,f=w.get(t.start??``)??0,p=w.get(t.end??``)??0,_=s>1&&I(t.start,m)||l>1&&I(t.end,h);if((r||i)&&!a&&(!d||d&&!_&&(s<=1||f<=2)&&(l<=1||p<=2))&&!S(o,u,t.start,t.end)){t.points=[{...o},{...y},{...x},{...u}],v.add(e);let n=i?`horizontal`:`vertical`,r=i?o.y:o.x,a=i?Math.min(o.x,u.x):Math.min(o.y,u.y),s=i?Math.max(o.x,u.x):Math.max(o.y,u.y),l={id:`fast-path-${n}-${r.toFixed(0)}-${e}`,orientation:n,coord:r,spanMin:a,spanMax:s,tracks:[]};g.push({edgeIndex:e,segmentIndex:0,orientation:n,pipe:l,trackIndex:0,from:a,to:s});continue}}y.x=f(`vertical`,y.x,y.y,y.y).coord,x.x=f(`vertical`,x.x,x.y,x.y).coord;let F=Math.min(y.x,x.x)-50,L=Math.max(y.x,x.x)+50,ee=Math.min(y.y,x.y)-50,z=Math.max(y.y,x.y)+50;for(let e of d){let t=Math.min(y.x,x.x),n=Math.max(y.x,x.x),r=Math.min(y.y,x.y),i=Math.max(y.y,x.y);e.minX<n&&e.maxX>t&&e.minY<i&&e.maxY>r&&(F=Math.min(F,e.minX-uE),L=Math.max(L,e.maxX+uE),ee=Math.min(ee,e.minY-uE),z=Math.max(z,e.maxY+uE))}for(let e of d){if(e.maxX<F||e.minX>L||e.maxY<ee||e.minY>z)continue;let t=cE;f(`horizontal`,e.minY-t,F,L),f(`horizontal`,e.maxY+t,F,L);let n=lE;f(`vertical`,e.minX-n,ee,z),f(`vertical`,e.maxX+n,ee,z)}f(`horizontal`,y.y,F,L),f(`horizontal`,x.y,F,L);let B=s.filter(e=>e.orientation===`horizontal`&&e.coord>=ee&&e.coord<=z),te=s.filter(e=>e.orientation===`vertical`&&e.coord>=F&&e.coord<=L),ne=p((e,t)=>`${e.toFixed(1)},${t.toFixed(1)}`,`getKey`),re=ne(y.x,y.y),ie=ne(x.x,x.y),ae=new Map,oe=new Map,se=new Map,ce=new Set,le=[];ae.set(re,0),se.set(re,`n`),le.push({key:re,f:Math.hypot(x.x-y.x,x.y-y.y),pt:y}),ce.add(re);let ue=[],de=p((e,n)=>S(e,n,t.start,t.end),`checkSegmentBlocked`),fe={x:x.x,y:y.y},pe=de(y,fe),me=de(fe,x),he=pe||me,ge={x:y.x,y:x.y},_e=de(y,ge),ve=de(ge,x);if(he?_e||ve||(ue=Math.abs(y.x-x.x)<sE?[y,x]:[y,ge,x]):ue=Math.abs(y.y-x.y)<sE||Math.abs(y.x-x.x)<sE?[y,x]:[y,fe,x],ue.length===0)for(;le.length>0;){le.sort((e,t)=>e.f-t.f);let n=le.shift();if(ce.delete(n.key),n.key===ie){let e=ie,t=x;for(ue=[t];oe.has(e);){let n=oe.get(e);ue.unshift(n),t=n,e=ne(n.x,n.y)}break}let r=n.pt.x,i=n.pt.y,a=te.sort((e,t)=>e.coord-t.coord),o=a.findIndex(e=>Math.abs(e.coord-r)<1),s=B.sort((e,t)=>e.coord-t.coord),l=s.findIndex(e=>Math.abs(e.coord-i)<1),u=[];o>0&&u.push({x:a[o-1].coord,y:i}),o>=0&&o<a.length-1&&u.push({x:a[o+1].coord,y:i}),l>0&&u.push({x:r,y:s[l-1].coord}),l>=0&&l<s.length-1&&u.push({x:r,y:s[l+1].coord});for(let a of u){let o=Math.min(r,a.x),s=Math.max(r,a.x),l=Math.min(i,a.y),u=Math.max(i,a.y);if(d.some(e=>e.nodeId===t.start||e.nodeId===t.end?!1:o===s?e.minX<r&&e.maxX>r&&e.maxY>l&&e.minY<u:e.minY<i&&e.maxY>i&&e.maxX>o&&e.minX<s))continue;let f=ne(a.x,a.y),p=Math.abs(a.x-r)+Math.abs(a.y-i),m=b(e,n.pt,a),h=0,g=x.x-y.x,_=x.y-y.y,v=a.x-r,S=a.y-i;(_>10&&S<-5||_<-10&&S>5)&&(h=Math.abs(S)*100),(g>10&&v<-5||g<-10&&v>5)&&(h+=Math.abs(v)*50);let C=0,w=se.get(n.key)??`n`,T=Math.abs(v)>sE?`h`:`v`;w!==`n`&&w!==T&&(C=50);let E=p+m+h+C,D=(ae.get(n.key)??1/0)+E,O=Math.abs(x.x-a.x)+Math.abs(x.y-a.y);if(D<(ae.get(f)??1/0)){if(oe.set(f,n.pt),ae.set(f,D),se.set(f,T),!ce.has(f))le.push({key:f,f:D+O,pt:a}),ce.add(f);else{let e=le.findIndex(e=>e.key===f);e!==-1&&(le[e].f=D+O)}}}}if(ue.length===0&&(ue=[y,{x:y.x,y:x.y},x]),ue.length>4){let e=ue[0],t=ue[ue.length-1],n=Math.min(e.x,t.x),r=Math.max(e.x,t.x),i=Math.min(e.y,t.y),a=Math.max(e.y,t.y);for(let e of ue)n=Math.min(n,e.x),r=Math.max(r,e.x),i=Math.min(i,e.y),a=Math.max(a,e.y);let o=r>Math.max(e.x,t.x),s=n<Math.min(e.x,t.x);if(l){let i=lE;if(o){let n=Math.max(e.x,t.x),a=Math.min(e.y,t.y),o=Math.max(e.y,t.y),s=d.filter(e=>e.minX<n&&e.maxX>n&&e.minY<o&&e.maxY>a);if(s.length>0){let n=Math.max(e.x,t.x);for(let e of s){let t=(e.minX+e.maxX)/2;if(e.visualXHalfExtent===void 0||isNaN(e.visualXHalfExtent))continue;let r=t+e.visualXHalfExtent+i;n=Math.max(n,r)}isNaN(n)||(r=n)}}if(s){let r=d.filter(n=>n.minX<Math.min(e.x,t.x)+i&&n.minY<Math.max(e.y,t.y)&&n.maxY>Math.min(e.y,t.y));if(r.length>0){let a=Math.min(e.x,t.x);for(let e of r){let t=(e.minX+e.maxX)/2-e.visualXHalfExtent-i;a=Math.min(a,t)}n=a}}}let u=p(n=>{let r=t.y>e.y,i=d.filter(n=>{let r=Math.min(e.x,t.x)<n.maxX&&Math.max(e.x,t.x)>n.minX,i=Math.min(e.y,t.y)<n.maxY&&Math.max(e.y,t.y)>n.minY;return r&&i}),a=i;if(l&&i.length>0){let e=i.filter(e=>e.minX<n&&e.maxX>n);e.length>0&&(a=e)}if(a.length===0)return t.y;let o=cE;if(r){let e=Math.max(...a.map(e=>e.maxY))+o;if(e<t.y-sE)return e}else{let e=Math.min(...a.map(e=>e.minY))-o;if(e>t.y+sE)return e}return t.y},`findBestReturnY`),f=p(n=>{let r=u(n),i={x:n,y:e.y},a={x:n,y:r},o={x:t.x,y:r},s=de(e,i),l=de(i,a),d=de(a,o),f=r!==t.y&&de(o,t);return!s&&!l&&!d&&!f?Math.abs(r-t.y)<sE?[e,i,a,t]:[e,i,a,o,t]:null},`trySimplifyWithDetourX`),m=o&&!s?f(r):s&&!o?f(n):null;m&&(ue=m)}let ye=[o,...k,...ue,...M.reverse(),u];if(ye.length>=3){let e=ye[ye.length-1],t=ye[ye.length-2],n=ye[ye.length-3],r=Math.abs(n.y-t.y)<sE&&Math.abs(t.y-e.y)<sE,i=Math.abs(n.x-t.x)<sE&&Math.abs(t.x-e.x)<sE;if(r){let r=Math.sign(t.x-n.x),i=Math.sign(e.x-n.x);r!==0&&r===i&&Math.abs(t.x-n.x)>Math.abs(e.x-n.x)&&ye.splice(-2,1)}else if(i){let r=Math.sign(t.y-n.y),i=Math.sign(e.y-n.y);r!==0&&r===i&&Math.abs(t.y-n.y)>Math.abs(e.y-n.y)&&ye.splice(-2,1)}}let be=[ye[0]];for(let e=1;e<ye.length-1;e++){if(e===1){be.push(ye[e]);continue}let t=be[be.length-1],n=ye[e],r=ye[e+1];if(Math.abs(t.y-n.y)<sE&&Math.abs(n.y-r.y)<sE){if(n.x>t.x!=r.x>n.x){be.push(n);continue}continue}if(Math.abs(t.x-n.x)<sE&&Math.abs(n.x-r.x)<sE){if(n.y>t.y!=r.y>n.y){be.push(n);continue}continue}be.push(n)}be.push(ye[ye.length-1]);for(let t=0;t<be.length-1;t++){let n=be[t],r=be[t+1],i=Math.abs(n.x-r.x)<sE?`vertical`:`horizontal`,a=i===`vertical`?n.x:n.y,o=i===`vertical`?Math.min(n.y,r.y):Math.min(n.x,r.x),s=i===`vertical`?Math.max(n.y,r.y):Math.max(n.x,r.x),l=f(i,a,o,s),u={edgeIndex:e,segmentIndex:t,orientation:i,pipe:l,trackIndex:0,from:o,to:s};g.push(u),_[e].push(g.length-1),l.tracks[0]||(l.tracks[0]={index:0,coord:l.coord,segments:[]}),l.tracks[0].segments.push({edgeIndex:e,segmentIndex:t,from:o,to:s})}}let ee=p((e,t)=>e.from<t.to&&t.from<e.to,`segmentsOverlap`),z=p((e,t,n,r)=>{let i=!r.segments.some(n=>(n.edgeIndex!==t.edgeIndex||n.segmentIndex!==t.segmentIndex)&&ee(n,e)),a=!n.segments.some(n=>(n.edgeIndex!==e.edgeIndex||n.segmentIndex!==e.segmentIndex)&&ee(n,t));return i&&a?(e.trackIndex=r.index,t.trackIndex=n.index,n.segments=[...n.segments.filter(t=>t.edgeIndex!==e.edgeIndex||t.segmentIndex!==e.segmentIndex),{edgeIndex:t.edgeIndex,segmentIndex:t.segmentIndex,from:t.from,to:t.to}],r.segments=[...r.segments.filter(e=>e.edgeIndex!==t.edgeIndex||e.segmentIndex!==t.segmentIndex),{edgeIndex:e.edgeIndex,segmentIndex:e.segmentIndex,from:e.from,to:e.to}],!0):!1},`trySwapSegmentsAcrossTracks`),B=p(e=>{let t=e.tracks.length;return e.tracks[t]={index:t,coord:e.coord,segments:[]},t},`createNewTrack`),te=p((e,t)=>{let n=e.pipe.tracks[e.trackIndex];n.segments=n.segments.filter(t=>t.edgeIndex!==e.edgeIndex||t.segmentIndex!==e.segmentIndex),e.trackIndex=t,e.pipe.tracks[t].segments.push({edgeIndex:e.edgeIndex,segmentIndex:e.segmentIndex,from:e.from,to:e.to})},`moveSegmentToTrack`),ne=p((e,t)=>{let n=_[e.edgeIndex];for(let r of n){let n=g[r];n.pipe===e.pipe&&te(n,t)}},`moveSegmentChainToTrack`),re=p(e=>{let t=_[e.edgeIndex],n=t.indexOf(g.indexOf(e)),r=[];return n>0&&r.push(g[t[n-1]]),n<t.length-1&&r.push(g[t[n+1]]),r},`getAdjacentSegmentsAlongEdge`),ie=p((e,t)=>{if(e.orientation===t.orientation)return!1;let n=e.orientation===`horizontal`?e:t,r=e.orientation===`horizontal`?t:e;return r.pipe.coord>n.from&&r.pipe.coord<n.to&&n.pipe.coord>r.from&&n.pipe.coord<r.to},`haveAnyCrossing`),ae=p((e,t)=>{for(let n of e.tracks)if(!n.segments.some(e=>(e.edgeIndex!==t.edgeIndex||e.segmentIndex!==t.segmentIndex)&&ee(e,t)))return n.index;return-1},`findAvailableTrack`),oe=p((e,t)=>{if(e.trackIndex===t.trackIndex)return ee(e,t);let n=re(e),r=re(t);return n.some(e=>r.some(t=>ie(e,t)))},`segmentsConflict`),se=p((e,t,n)=>{if(z(e,t,e.pipe.tracks[e.trackIndex],t.pipe.tracks[t.trackIndex]))return;let r=ae(e.pipe,t);n(t,r===-1?B(e.pipe):r)},`resolveTrackConflict`),ce=p(e=>{let t=0;for(let n=0;n<e.length;n++)for(let r=n+1;r<e.length;r++){let i=e[n],a=e[r];i.pipe===a.pipe&&oe(i,a)&&(t++,se(i,a,ne))}return t},`resolveHandleConflicts`),le=new Map,ue=p(e=>{if(le.has(e))return le.get(e);let t=_[e];if(t.length===0){let t={dest:0,deviation:0,base:0,delta:0};return le.set(e,t),t}let n=g[t[0]].pipe.coord,r=n;for(let e=1;e<t.length;e++){let i=g[t[e]];if(i.orientation===`horizontal`){let e=i.from,t=i.to;r=Math.abs(e-n)>Math.abs(t-n)?e:t;break}}let i=Math.abs(r-n),a={dest:r,deviation:i,base:n,delta:r-n};return le.set(e,a),a},`getDestInfo`),de=p(()=>{let e=0,t=new Map;for(let[e,n]of i.entries())_[e].length!==0&&n.start&&(t.has(n.start)||t.set(n.start,[]),t.get(n.start).push(e));let n=p(e=>{let t=i[e];if(!t.start||!t.end)return 0;let n=a.get(t.start),r=a.get(t.end);if(!n||!r)return 0;let o=(r.x??0)-(n.x??0),s=(r.y??0)-(n.y??0);return Math.abs(o)+Math.abs(s)},`getEdgeDistance`);for(let r of t.values()){r.sort((e,t)=>{let r=ue(e),i=ue(t);if(Math.abs(r.deviation-i.deviation)>1)return r.deviation-i.deviation;if(Math.abs(r.dest-i.dest)>1)return r.dest-i.dest;let a=n(e),o=n(t);if(Math.abs(a-o)>1)return o-a;let s=_[e].length,l=_[t].length;if(s!==l)return s-l;if(s===1){let n=_[e][0],r=_[t][0];if(g[n]&&g[r]){let e=g[n],t=g[r],i=Math.abs(e.to-e.from),a=Math.abs(t.to-t.from);if(Math.abs(i-a)>1)return i-a}}return 0});let t=r.map(e=>g[_[e][0]]);e+=ce(t)}return e},`fixSourceHandleCrossings`),fe=p(()=>{let e=0,t=new Map;for(let[e,n]of i.entries())_[e].length!==0&&n.end&&(t.has(n.end)||t.set(n.end,[]),t.get(n.end).push(e));for(let n of t.values()){n.sort((e,t)=>{let n=p(e=>{let t=_[e];if(t.length<2)return 0;let n=g[t[t.length-2]];return Math.abs(n.to-n.from)},`getDist`),r=n(e),i=n(t);return Math.abs(r-i)>.1?r-i:e-t});let t=n.map(e=>g[_[e][_[e].length-1]]);e+=ce(t)}return e},`fixTargetHandleCrossings`),pe=p(()=>{let e=0;for(let t of s){let n=[];for(let e of t.tracks)for(let t of e.segments){let e=_[t.edgeIndex].find(e=>g[e].segmentIndex===t.segmentIndex);e!==void 0&&n.push(g[e])}n.sort((e,t)=>e.edgeIndex-t.edgeIndex||e.segmentIndex-t.segmentIndex);for(let t=0;t<n.length;t++)for(let r=t+1;r<n.length;r++){let i=n[t],a=n[r];oe(i,a)&&(e++,se(i,a,te))}}return e},`fixPipeCrossings`),me=0;for(;me<10;){let e=0;if(e+=de(),e+=fe(),e+=pe(),e===0)break;me++}let he=new Map;for(let e of s){let t=[];e.tracks.forEach(e=>{e.segments.forEach(n=>{t.push({edgeIndex:n.edgeIndex,segmentIndex:n.segmentIndex,trackIndex:e.index,from:n.from,to:n.to})})}),t.sort((e,t)=>e.from-t.from);let n=[];if(t.length>0){let e=[t[0]],r=t[0].to;for(let i=1;i<t.length;i++){let a=t[i];a.from<r?(e.push(a),r=Math.max(r,a.to)):(n.push(e),e=[a],r=a.to)}n.push(e)}for(let t of n){let n=new Set;t.forEach(e=>n.add(e.trackIndex));let r=new Map;t.forEach(e=>{let t=ue(e.edgeIndex);r.set(e.trackIndex,(r.get(e.trackIndex)??0)+t.delta)});let i=[...n].filter(e=>(r.get(e)??0)<-1),a=[...n].filter(e=>(r.get(e)??0)>1),o=[...n].filter(e=>Math.abs(r.get(e)??0)<=1);i.sort((e,t)=>(r.get(t)??0)-(r.get(e)??0)),a.sort((e,t)=>(r.get(e)??0)-(r.get(t)??0));let s=p((n,r)=>{t.filter(e=>e.trackIndex===n).forEach(t=>{let n=v.has(t.edgeIndex)?e.coord:r;he.set(`${t.edgeIndex}-${t.segmentIndex}`,n)})},`assignCoord`),l=0;for(let t of i)l++,s(t,e.coord-l*fE);if(o.length===0&&n.size>0){let e=[...n].sort((e,t)=>Math.abs(r.get(e)??0)-Math.abs(r.get(t)??0))[0],t=i.indexOf(e);t!==-1&&i.splice(t,1);let s=a.indexOf(e);s!==-1&&a.splice(s,1),o.push(e)}let u=0;for(let t of o){if(u===0)s(t,e.coord);else{let n=u%2==1?1:-1,r=Math.ceil(u/2);s(t,e.coord+n*r*fE*.5)}u++}let d=0;for(let t of a)d++,s(t,e.coord+d*fE)}}for(let[e,t]of i.entries()){let n=_[e]??[];if(n.length===0)continue;let r=[],{pSrcPort:i,pDstPort:o}=R(e,a.get(t.start),a.get(t.end)),s=n.map(e=>{let t=g[e],n=he.get(`${t.edgeIndex}-${t.segmentIndex}`)??t.pipe.coord;return{orient:t.orientation,coord:n,from:t.from,to:t.to}});r.push(i);for(let e=0;e<s.length;e++){let t=s[e],n=r[r.length-1],i=t.orient===`vertical`?n.y:n.x,a=t.orient===`vertical`?n.x:n.y,o=s[e+1],l=e<s.length-1;if(Math.abs(a-t.coord)>sE&&r.push(LT(t,i)),l&&o.orient===t.orient){if(Math.abs(t.coord-o.coord)>sE){let e=t.orient===`vertical`?(i+o.from)/2:IT(t,o);r.push(LT(t,e),LT(o,e))}else(e===0||e===s.length-2)&&r.push(LT(t,IT(t,o)))}else if(l)r.push(LT(t,o.coord));else{let e=Math.abs(t.from-i)<Math.abs(t.to-i)?t.to:t.from;r.push(LT(t,e))}}let l=r[r.length-1];(Math.abs(l.x-o.x)>sE||Math.abs(l.y-o.y)>sE)&&r.push(o);let u=[];r.length>0&&u.push(r[0]);for(let e=1;e<r.length;e++){let t=r[e],n=u[u.length-1];(Math.abs(t.x-n.x)>sE||Math.abs(t.y-n.y)>sE)&&u.push(t)}t.points=u}for(let e of i){let t=e.__originalEdge;t&&e.points&&(t.points=e.points)}e.edges=(e.edges??[]).filter(e=>!e.isLayoutOnly);let ge=p((e,t)=>{let n=t.x??0,r=t.y??0,i=t.width??0,a=t.height??0;if(i<=0||a<=0)return e;let o=n-i/2,s=n+i/2,l=r-a/2,u=r+a/2;if(e.x<o||e.x>s||e.y<l||e.y>u)return e;let d=e.x-o,f=s-e.x,p=e.y-l,m=u-e.y,h=Math.min(d,f,p,m);return h===d?{x:o,y:e.y}:h===f?{x:s,y:e.y}:h===p?{x:e.x,y:l}:{x:e.x,y:u}},`nodeBoundaryClamp`);for(let t of e.edges){let e=t.points;if(!e||e.length<2)continue;let n=t.start,r=t.end,i=n?a.get(n):void 0,o=r?a.get(r):void 0;i&&(e[0]=ge(e[0],i)),o&&(e[e.length-1]=ge(e[e.length-1],o))}return e}function DPe(e){return e.direction??`TB`}function OPe(e){let t=dNe(e),n=e.config.flowchart?.nodeSpacing??40,r=e.config.flowchart?.rankSpacing??100,i=e.config.swimlane?.ignoreCrossLaneEdges??!0,a=e.config.swimlane?.optimizeRanksByCrossings??!0,o=e.config.swimlane?.automaticLaneOrdering??!1,s=DPe(e),{ordered:l,coordinates:u}=TPe(t,{nodeGap:n,layerGap:r,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:o,direction:s});fNe(t,l,u,{nodeGap:n,layerGap:r});for(let t of e.edges??[])delete t.points;EPe(e,s);for(let t of e.edges??[])(!t.curve||t.curve===`basis`)&&(t.curve=`rounded`);return WNe(e,s),UNe(e),s}function kPe(e){uNe(e);let t=pNe(e);e.nodes=t.nodes,e.edges=t.edges}var RT,zT,BT,APe,VT,jPe,HT,MPe,UT,WT,NPe,GT,KT,qT,PPe,JT,YT,XT,ZT,QT,FPe,$T,eE,tE,nE,rE,IPe,LPe,iE,aE,oE,sE,RPe,cE,lE,uE,dE,fE,zPe,BPe=o((()=>{MS(),U_(),cv(),z_(),P_(),Op(),ig(),Gp(),rh(),dc(),S(),h(),RT=5,zT=1e-5,BT=1e-6,p($C,`buildSegmentList`),p(QMe,`segmentIntersection`),p(ew,`isHorizontalSeg`),p($Me,`findEdgeIntersections`),p(tw,`fmt`),p(nw,`pointToString`),p(eNe,`getArcSweepFlag`),APe=.001,p(tNe,`applyMarkerOffsets`),p(nNe,`emitJump`),p(rw,`computeRoundedCorner`),p(rNe,`rewriteEdgePath`),p(iNe,`isStraightPath`),p(aNe,`curveSupportsLineHops`),p(oNe,`decodeDataPoints`),p(sNe,`applyLineJumpsToSvg`),p(cNe,`applySwimlaneLineJumps`),VT=`__swimlane_default__`,jPe=21,HT=20,p(iw,`topLaneHorizontalPadding`),p(lNe,`assignTopLaneTitleRect`),p(uNe,`prepareLayoutForSwimlanes`),p(dNe,`toGraphView`),p(fNe,`writeBackToLayoutData`),MPe=`[EdgeLabelNodes]`,p(pNe,`createEdgeLabelNodes`),UT=.001,p(aw,`measuredNodeRect`),p(ow,`nodeBoundsInfoFor`),p(sw,`samePoint`),p(cw,`sameX`),p(lw,`sameY`),p(uw,`isHorizontalSegment`),p(dw,`isVerticalSegment`),p(fw,`overlapLength`),p(pw,`sameAxisSegmentOverlapLength`),p(mw,`orthogonalSegmentsForPoints`),p(hw,`countOrthogonalBends`),p(gw,`dedupeConsecutivePoints`),p(_w,`classifyThreeSegmentRoute`),p(vw,`segmentBoundsOverlapRect`),p(yw,`pointInsideRect`),p(mNe,`rectContainsRect`),p(bw,`rectsOverlap`),p(xw,`inflateRect`),p(Sw,`rectFromCenterSize`),p(Cw,`rectOfNodeBounds`),p(ww,`portForRectSide`),p(Tw,`buildOrthogonalPortPath`),p(Ew,`buildSameSideTrackPath`),p(Dw,`collectRealNodeBounds`),p(Ow,`collectNodeRectEntries`),p(hNe,`collectLayoutNodeRects`),p(kw,`getNodePairGeometry`),p(Aw,`segmentHitsAnyRect`),p(jw,`orthogonalSegmentsCross`),p(gNe,`sameAxisSegmentsOverlap`),p(Mw,`segmentConflictsWithAnyEdge`),p(Nw,`orthogonalSegmentsStrictlyCross`),p(Pw,`strictlyBetween`),p(_Ne,`isCollinearIntermediate`),p(vNe,`simplifyPolylineOnce`),p(Fw,`orthogonalizePolyline`),p(Iw,`simplifyPolyline`),WT=.001,NPe=.5,GT=4,p(Lw,`endpointContextFor`),p(yNe,`segmentEnterPoint`),p(Rw,`clipEndpoint`),p(bNe,`clipEdgeEndpointsToNodeBoundaries`),p(zw,`snapEndpointToBoundary`),p(Bw,`firstDistinctAdjacent`),p(Vw,`cornerClearanceRange`),p(Hw,`clampToCornerClearance`),p(xNe,`intersectRanges`),p(Uw,`clearanceRangeForSide`),p(Ww,`terminalSideForSegment`),p(Gw,`isHorizontalSide`),p(SNe,`straightClearanceRange`),p(Kw,`clearStraightEndpointCornerAxis`),p(qw,`clearStraightEndpointCornerConnections`),p(CNe,`cornerClearedEndpoint`),p(wNe,`moveCollinearEndpointRun`),p(Jw,`clearEndpointCornerConnection`),p(Yw,`borderSideForSegment`),p(Xw,`leavesOutward`),p(Zw,`collapseOwnBorderStub`),p(TNe,`snapAndCollapseEndpoints`),p(Qw,`prepareEdgeEndpointsForRenderer`),p($w,`buildNodeMap`),p(ENe,`resolveTopLevelGroupId`),p(eT,`groupDepth`),p(tT,`boundsForChildren`),p(DNe,`applyGroupBounds`),p(ONe,`recomputeNestedGroupBounds`),p(nT,`mirrorAxis`),p(kNe,`applyBtDirectionTransform`),p(ANe,`applyLrDirectionTransform`),KT=1e-6,qT=8,PPe=[0,qT,-qT,2*qT,-2*qT],p(jNe,`portSwapToLShape`),p(MNe,`collapseShortTerminalStub`),JT=.001,YT=8,XT=mw,ZT=p((e,t)=>cw(e,t,JT)||lw(e,t,JT),`orthogonallyAligned`),p(NNe,`separateSharedRenderedTerminalLanes`),p(PNe,`collapseRedundantRectangularDoglegs`),p(rT,`liftObstacleHuggingSameSideRails`),p(iT,`liftTopLaneTitleBandsAboveRails`),p(aT,`shiftLeftLaneTitleBandsLeftOfRails`),p(FNe,`swapDestinationTerminalTailsToReduceCrossings`),p(INe,`reassignCrossingExternalRailChannels`),p(LNe,`shortcutRedundantOrthogonalJogs`),p(RNe,`resolveRenderedOrthogonalCrossings`),QT=.001,FPe=8,p(zNe,`simplifyDetouredEdges`),$T=.001,eE=10,tE=7,p(oT,`markerClearanceRectFor`),p(BNe,`normalizeRect`),p(sT,`labelOverlapsOwnMarker`),p(cT,`anchorLabelsToPolyline`),nE=1e-6,rE=4,IPe=3,p(lT,`pairKey`),p(VNe,`straightenCollinearSiblingDetours`),p(uT,`nudgeSharedInteriorSubpaths`),p(HNe,`segmentsIntersect`),p(UNe,`validateSwimlanesLayout`),p(WNe,`postProcessSwimlaneLayout`),p(dT,`normalizeGraph`),p(fT,`incoming`),p(GNe,`buildSuccessorMap`),p(pT,`buildSortedSuccessorMap`),p(mT,`buildInDegreeMap`),p(hT,`sortedZeroInDegreeNodes`),p(gT,`buildPredecessorSuccessorMaps`),p(_T,`buildLayersFromRanks`),p(vT,`topoSortIfAcyclic`),p(yT,`buildLayerIndex`),p(bT,`countInversions`),p(KNe,`removeCycles_DFS`),p(qNe,`buildTopLaneMap`),p(xT,`createTopLaneResolver`),p(ST,`buildTopLaneOrder`),p(CT,`resolveTopLaneOrder`),LPe={EPSILON:1e-6},iE={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},aE={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40},p(JNe,`buildDrivingTree`),p(YNe,`chooseParent`),p(XNe,`buildAdjacency`),p(ZNe,`assignComponents`),p(QNe,`computeBlocks`),p($Ne,`popBlock`),p(ePe,`computeSubtreeCrossCounts`),p(tPe,`annotateMinimumLayers`),p(wT,`compareByRankThenId`),p(nPe,`emitNodesInTreeOrder`),p(rPe,`deduplicateLayers`),p(iPe,`createChildOrderer`),p(TT,`buildMultitreeLayerOrder`),p(aPe,`countCrossingsBetweenAdjacent`),p(ET,`totalCrossings`),p(oPe,`optimizeRanksByCrossings`),p(sPe,`adjustCrossLaneSources`),p(cPe,`assignLayers_LongestPath`),p(lPe,`assignLayers_Gravity`),p(uPe,`topoSortByGenerationIfAcyclic`),p(dPe,`assignLayers_LaneAwareCompact`),p(fPe,`makeProperLayering`),p(DT,`median`),p(OT,`barycenter`),p(pPe,`neighborPositionsFor`),p(mPe,`currentOrderTieBreak`),p(kT,`countCrossingsBetweenAdjacent`),p(AT,`sortByHeuristic`),p(jT,`reorderLayer`),p(MT,`transposeImprove`),p(hPe,`orderLayers`),p(gPe,`assignCoordinates`),oE=8,p(_Pe,`hashString`),p(vPe,`mulberry32`),p(yPe,`deterministicShuffle`),p(bPe,`sourceDistance`),p(NT,`laneArrangementCost`),p(xPe,`buildWeightedLaneEdges`),p(PT,`greedySwitch`),p(SPe,`isBetterCandidate`),p(CPe,`seedForRestart`),p(wPe,`optimizeTopLaneOrder`),p(TPe,`sugiyamaLayout`),sE=LPe.EPSILON,RPe=8,cE=15,lE=15,uE=25,dE=20,fE=10,p(FT,`chooseOrthogonalSide`),p(IT,`sharedLineEndpointCoord`),p(LT,`pointOnLine`),p(EPe,`routeEdgesOrthogonal`),p(DPe,`getSwimlaneDirection`),p(OPe,`runSwimlaneLayoutCore`),p(kPe,`prepareSwimlaneLayout`),zPe=vS({prepareLayout:kPe,runLayoutCore:OPe,afterPaint:cNe})}));function pE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function VPe(e){if(Array.isArray(e))return e}function HPe(e){if(Array.isArray(e))return pE(e)}function mE(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function UPe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,yE(r.key),r)}}function hE(e,t,n){return t&&UPe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function gE(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=xE(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.562+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function WPe(e,t,n){return(t=yE(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GPe(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function KPe(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}function qPe(){throw TypeError(`Invalid attempt to destructure non-iterable instance.563+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JPe(){throw TypeError(`Invalid attempt to spread non-iterable instance.564+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _E(e,t){return VPe(e)||KPe(e,t)||xE(e,t)||qPe()}function vE(e){return HPe(e)||GPe(e)||xE(e)||JPe()}function YPe(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}function yE(e){var t=YPe(e,`string`);return typeof t==`symbol`?t:t+``}function bE(e){"@babel/helpers - typeof";return bE=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},bE(e)}function xE(e,t){if(e){if(typeof e==`string`)return pE(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pE(e,t):void 0}}function SE(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function CE(){if(UO)return HO;UO=1;function e(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}return HO=e,HO}function XPe(){return GO?WO:(GO=1,WO=typeof VO==`object`&&VO&&VO.Object===Object&&VO,WO)}function wE(){if(qO)return KO;qO=1;var e=XPe(),t=typeof self==`object`&&self&&self.Object===Object&&self;return KO=e||t||Function(`return this`)(),KO}function ZPe(){if(YO)return JO;YO=1;var e=wE();return JO=function(){return e.Date.now()},JO}function QPe(){if(ZO)return XO;ZO=1;var e=/\s/;function t(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}return XO=t,XO}function $Pe(){if($O)return QO;$O=1;var e=QPe(),t=/^\s+/;function n(n){return n&&n.slice(0,e(n)+1).replace(t,``)}return QO=n,QO}function TE(){return tk?ek:(tk=1,ek=wE().Symbol,ek)}function eFe(){if(rk)return nk;rk=1;var e=TE(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function a(e){var t=n.call(e,i),a=e[i];try{e[i]=void 0;var o=!0}catch{}var s=r.call(e);return o&&(t?e[i]=a:delete e[i]),s}return nk=a,nk}function tFe(){if(ak)return ik;ak=1;var e=Object.prototype.toString;function t(t){return e.call(t)}return ik=t,ik}function EE(){if(sk)return ok;sk=1;var e=TE(),t=eFe(),n=tFe(),r=`[object Null]`,i=`[object Undefined]`,a=e?e.toStringTag:void 0;function o(e){return e==null?e===void 0?i:r:a&&a in Object(e)?t(e):n(e)}return ok=o,ok}function nFe(){if(lk)return ck;lk=1;function e(e){return typeof e==`object`&&!!e}return ck=e,ck}function DE(){if(dk)return uk;dk=1;var e=EE(),t=nFe(),n=`[object Symbol]`;function r(r){return typeof r==`symbol`||t(r)&&e(r)==n}return uk=r,uk}function rFe(){if(pk)return fk;pk=1;var e=$Pe(),t=CE(),n=DE(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function l(l){if(typeof l==`number`)return l;if(n(l))return r;if(t(l)){var u=typeof l.valueOf==`function`?l.valueOf():l;l=t(u)?u+``:u}if(typeof l!=`string`)return l===0?l:+l;l=e(l);var d=a.test(l);return d||o.test(l)?s(l.slice(2),d?2:8):i.test(l)?r:+l}return fk=l,fk}function iFe(){if(hk)return mk;hk=1;var e=CE(),t=ZPe(),n=rFe(),r=`Expected a function`,i=Math.max,a=Math.min;function o(o,s,l){var u,d,f,p,m,h,g=0,_=!1,v=!1,y=!0;if(typeof o!=`function`)throw TypeError(r);s=n(s)||0,e(l)&&(_=!!l.leading,v=`maxWait`in l,f=v?i(n(l.maxWait)||0,s):f,y=`trailing`in l?!!l.trailing:y);function b(e){var t=u,n=d;return u=d=void 0,g=e,p=o.apply(n,t),p}function x(e){return g=e,m=setTimeout(w,s),_?b(e):p}function S(e){var t=e-h,n=e-g,r=s-t;return v?a(r,f-n):r}function C(e){var t=e-h,n=e-g;return h===void 0||t>=s||t<0||v&&n>=f}function w(){var e=t();if(C(e))return T(e);m=setTimeout(w,S(e))}function T(e){return m=void 0,y&&u?b(e):(u=d=void 0,p)}function E(){m!==void 0&&clearTimeout(m),g=0,u=h=d=m=void 0}function D(){return m===void 0?p:T(t())}function O(){var e=t(),n=C(e);if(u=arguments,d=this,h=e,n){if(m===void 0)return x(h);if(v)return clearTimeout(m),m=setTimeout(w,s),b(h)}return m===void 0&&(m=setTimeout(w,s)),p}return O.cancel=E,O.flush=D,O}return mk=o,mk}function aFe(e,t,n,r,i){var a=i*Math.PI/180;return{x:Math.cos(a)*(e-n)-Math.sin(a)*(t-r)+n,y:Math.sin(a)*(e-n)+Math.cos(a)*(t-r)+r}}function oFe(e,t,n){if(n===0)return e;var r=(t.x1+t.x2)/2,i=(t.y1+t.y2)/2,a=t.w/t.h,o=1/a,s=aFe(e.x,e.y,r,i,n),l=Fk(s.x,s.y,r,i,a,o);return{x:l.x,y:l.y}}function sFe(){return FIe?fA.exports:(FIe=1,(function(e,t){(function(){var t,n,r=Math.floor,i,a,o,s,l,u,d=Math.min,f,p,m,h,g;n=function(e,t){return e<t?-1:+(e>t)},u=function(e,t,i,a,o){var s;if(i??=0,o??=n,i<0)throw Error(`lo must be non-negative`);for(a??=e.length;i<a;)s=r((i+a)/2),o(t,e[s])<0?a=s:i=s+1;return[].splice.apply(e,[i,i-i].concat(t)),t},o=function(e,t,r){return r??=n,e.push(t),h(e,0,e.length-1,r)},a=function(e,t){var r,i;return t??=n,r=e.pop(),e.length?(i=e[0],e[0]=r,g(e,0,t)):i=r,i},l=function(e,t,r){var i;return r??=n,i=e[0],e[0]=t,g(e,0,r),i},s=function(e,t,r){var i;return r??=n,e.length&&r(e[0],t)<0&&(i=[e[0],t],t=i[0],e[0]=i[1],g(e,0,r)),t},i=function(e,t){var i,a,o,s,l,u;for(t??=n,s=(function(){u=[];for(var t=0,n=r(e.length/2);0<=n?t<n:t>n;0<=n?t++:t--)u.push(t);return u}).apply(this).reverse(),l=[],a=0,o=s.length;a<o;a++)i=s[a],l.push(g(e,i,t));return l},m=function(e,t,r){var i;if(r??=n,i=e.indexOf(t),i!==-1)return h(e,0,i,r),g(e,i,r)},f=function(e,t,r){var a,o,l,u,d;if(r??=n,o=e.slice(0,t),!o.length)return o;for(i(o,r),d=e.slice(t),l=0,u=d.length;l<u;l++)a=d[l],s(o,a,r);return o.sort(r).reverse()},p=function(e,t,r){var o,s,l,f,p,m,h,g,_;if(r??=n,t*10<=e.length){if(l=e.slice(0,t).sort(r),!l.length)return l;for(s=l[l.length-1],h=e.slice(t),f=0,m=h.length;f<m;f++)o=h[f],r(o,s)<0&&(u(l,o,0,null,r),l.pop(),s=l[l.length-1]);return l}for(i(e,r),_=[],p=0,g=d(t,e.length);0<=g?p<g:p>g;0<=g?++p:--p)_.push(a(e,r));return _},h=function(e,t,r,i){var a,o,s;for(i??=n,a=e[r];r>t;){if(s=r-1>>1,o=e[s],i(a,o)<0){e[r]=o,r=s;continue}break}return e[r]=a},g=function(e,t,r){var i,a,o,s,l;for(r??=n,a=e.length,l=t,o=e[t],i=2*t+1;i<a;)s=i+1,s<a&&!(r(e[i],e[s])<0)&&(i=s),e[t]=e[i],t=i,i=2*t+1;return e[t]=o,h(e,l,t,r)},t=(function(){e.push=o,e.pop=a,e.replace=l,e.pushpop=s,e.heapify=i,e.updateItem=m,e.nlargest=f,e.nsmallest=p;function e(e){this.cmp=e??n,this.nodes=[]}return e.prototype.push=function(e){return o(this.nodes,e,this.cmp)},e.prototype.pop=function(){return a(this.nodes,this.cmp)},e.prototype.peek=function(){return this.nodes[0]},e.prototype.contains=function(e){return this.nodes.indexOf(e)!==-1},e.prototype.replace=function(e){return l(this.nodes,e,this.cmp)},e.prototype.pushpop=function(e){return s(this.nodes,e,this.cmp)},e.prototype.heapify=function(){return i(this.nodes,this.cmp)},e.prototype.updateItem=function(e){return m(this.nodes,e,this.cmp)},e.prototype.clear=function(){return this.nodes=[]},e.prototype.empty=function(){return this.nodes.length===0},e.prototype.size=function(){return this.nodes.length},e.prototype.clone=function(){var t=new e;return t.nodes=this.nodes.slice(0),t},e.prototype.toArray=function(){return this.nodes.slice(0)},e.prototype.insert=e.prototype.push,e.prototype.top=e.prototype.peek,e.prototype.front=e.prototype.peek,e.prototype.has=e.prototype.contains,e.prototype.copy=e.prototype.clone,e})(),(function(t,n){return e.exports=n()})(this,function(){return t})}).call(pA)})(fA),fA.exports)}function cFe(){return IIe?mA:(IIe=1,mA=sFe(),mA)}function lFe(e,t){if(e.length<3)throw Error(`Need at least 3 vertices`);var n=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},r=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},i=function(e,t){return{x:e.x*t,y:e.y*t}},a=function(e,t){return e.x*t.y-e.y*t.x},o=function(e){var t=sLe(e.x,e.y);return t===0?{x:0,y:0}:{x:e.x/t,y:e.y/t}},s=function(e){for(var t=0,n=0;n<e.length;n++){var r=e[n],i=e[(n+1)%e.length];t+=r.x*i.y-i.x*r.y}return t/2},l=function(e,t,o,s){var l=r(t,e),u=r(s,o),d=a(l,u);return Math.abs(d)<1e-9?n(e,i(l,.5)):n(e,i(l,a(r(o,e),u)/d))},u=e.map(function(e){return{x:e.x,y:e.y}});s(u)<0&&u.reverse();for(var d=u.length,f=[],p=0;p<d;p++){var m=u[p],h=u[(p+1)%d],g=r(h,m),_=o({x:g.y,y:-g.x});f.push(_)}for(var v=f.map(function(e,r){return{p1:n(u[r],i(e,t)),p2:n(u[(r+1)%d],i(e,t))}}),y=[],b=0;b<d;b++){var x=v[(b-1+d)%d],S=v[b],C=l(x.p1,x.p2,S.p1,S.p2);y.push(C)}return y}function uFe(e,t,n,r,i,a){var o=lFe(gLe(e,t,n,r,i),a),s=kA();return o.forEach(function(e){return AA(s,e.x,e.y)}),s}function OE(e,t){function n(e){for(var t=[],n=0;n<e.length;n++){var r=e[n],i=e[(n+1)%e.length],a={x:i.x-r.x,y:i.y-r.y},o={x:-a.y,y:a.x},s=Math.sqrt(o.x*o.x+o.y*o.y);t.push({x:o.x/s,y:o.y/s})}return t}function r(e,t){var n=1/0,r=-1/0,i=gE(e),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=o.x*t.x+o.y*t.y;n=Math.min(n,s),r=Math.max(r,s)}}catch(e){i.e(e)}finally{i.f()}return{min:n,max:r}}function i(e,t){return!(e.max<t.min||t.max<e.min)}var a=gE([].concat(vE(n(e)),vE(n(t)))),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;if(!i(r(e,s),r(t,s)))return!1}}catch(e){a.e(e)}finally{a.f()}return!0}function kE(e,t,n,r,i,a){var o=$D(e)?e:pj[e]||pj.euclidean;return t===0&&$D(e)?o(i,a):o(t,n,r,i,a)}function AE(){return lRe?Wj:(lRe=1,Wj=Array.isArray,Wj)}function dFe(){if(uRe)return Gj;uRe=1;var e=AE(),t=DE(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(i,a){if(e(i))return!1;var o=typeof i;return o==`number`||o==`symbol`||o==`boolean`||i==null||t(i)?!0:r.test(i)||!n.test(i)||a!=null&&i in Object(a)}return Gj=i,Gj}function fFe(){if(dRe)return Kj;dRe=1;var e=EE(),t=CE(),n=`[object AsyncFunction]`,r=`[object Function]`,i=`[object GeneratorFunction]`,a=`[object Proxy]`;function o(o){if(!t(o))return!1;var s=e(o);return s==r||s==i||s==n||s==a}return Kj=o,Kj}function pFe(){return fRe?qj:(fRe=1,qj=wE()[`__core-js_shared__`],qj)}function mFe(){if(pRe)return Jj;pRe=1;var e=pFe(),t=function(){var t=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||``);return t?`Symbol(src)_1.`+t:``}();function n(e){return!!t&&t in e}return Jj=n,Jj}function hFe(){if(mRe)return Yj;mRe=1;var e=Function.prototype.toString;function t(t){if(t!=null){try{return e.call(t)}catch{}try{return t+``}catch{}}return``}return Yj=t,Yj}function gFe(){if(hRe)return Xj;hRe=1;var e=fFe(),t=mFe(),n=CE(),r=hFe(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,l=o.toString,u=s.hasOwnProperty,d=RegExp(`^`+l.call(u).replace(i,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function f(i){return!n(i)||t(i)?!1:(e(i)?d:a).test(r(i))}return Xj=f,Xj}function _Fe(){if(gRe)return Zj;gRe=1;function e(e,t){return e?.[t]}return Zj=e,Zj}function jE(){if(_Re)return Qj;_Re=1;var e=gFe(),t=_Fe();function n(n,r){var i=t(n,r);return e(i)?i:void 0}return Qj=n,Qj}function ME(){return vRe?$j:(vRe=1,$j=jE()(Object,`create`),$j)}function vFe(){if(yRe)return eM;yRe=1;var e=ME();function t(){this.__data__=e?e(null):{},this.size=0}return eM=t,eM}function yFe(){if(bRe)return tM;bRe=1;function e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}return tM=e,tM}function bFe(){if(xRe)return nM;xRe=1;var e=ME(),t=`__lodash_hash_undefined__`,n=Object.prototype.hasOwnProperty;function r(r){var i=this.__data__;if(e){var a=i[r];return a===t?void 0:a}return n.call(i,r)?i[r]:void 0}return nM=r,nM}function xFe(){if(SRe)return rM;SRe=1;var e=ME(),t=Object.prototype.hasOwnProperty;function n(n){var r=this.__data__;return e?r[n]!==void 0:t.call(r,n)}return rM=n,rM}function SFe(){if(CRe)return iM;CRe=1;var e=ME(),t=`__lodash_hash_undefined__`;function n(n,r){var i=this.__data__;return this.size+=+!this.has(n),i[n]=e&&r===void 0?t:r,this}return iM=n,iM}function CFe(){if(wRe)return aM;wRe=1;var e=vFe(),t=yFe(),n=bFe(),r=xFe(),i=SFe();function a(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,aM=a,aM}function wFe(){if(TRe)return oM;TRe=1;function e(){this.__data__=[],this.size=0}return oM=e,oM}function NE(){if(ERe)return sM;ERe=1;function e(e,t){return e===t||e!==e&&t!==t}return sM=e,sM}function PE(){if(DRe)return cM;DRe=1;var e=NE();function t(t,n){for(var r=t.length;r--;)if(e(t[r][0],n))return r;return-1}return cM=t,cM}function TFe(){if(ORe)return lM;ORe=1;var e=PE(),t=Array.prototype.splice;function n(n){var r=this.__data__,i=e(r,n);return i<0?!1:(i==r.length-1?r.pop():t.call(r,i,1),--this.size,!0)}return lM=n,lM}function EFe(){if(kRe)return uM;kRe=1;var e=PE();function t(t){var n=this.__data__,r=e(n,t);return r<0?void 0:n[r][1]}return uM=t,uM}function DFe(){if(ARe)return dM;ARe=1;var e=PE();function t(t){return e(this.__data__,t)>-1}return dM=t,dM}function OFe(){if(jRe)return fM;jRe=1;var e=PE();function t(t,n){var r=this.__data__,i=e(r,t);return i<0?(++this.size,r.push([t,n])):r[i][1]=n,this}return fM=t,fM}function kFe(){if(MRe)return pM;MRe=1;var e=wFe(),t=TFe(),n=EFe(),r=DFe(),i=OFe();function a(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,pM=a,pM}function AFe(){return NRe?mM:(NRe=1,mM=jE()(wE(),`Map`),mM)}function jFe(){if(PRe)return hM;PRe=1;var e=CFe(),t=kFe(),n=AFe();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return hM=r,hM}function MFe(){if(FRe)return gM;FRe=1;function e(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}return gM=e,gM}function FE(){if(IRe)return _M;IRe=1;var e=MFe();function t(t,n){var r=t.__data__;return e(n)?r[typeof n==`string`?`string`:`hash`]:r.map}return _M=t,_M}function NFe(){if(LRe)return vM;LRe=1;var e=FE();function t(t){var n=e(this,t).delete(t);return this.size-=+!!n,n}return vM=t,vM}function PFe(){if(RRe)return yM;RRe=1;var e=FE();function t(t){return e(this,t).get(t)}return yM=t,yM}function FFe(){if(zRe)return bM;zRe=1;var e=FE();function t(t){return e(this,t).has(t)}return bM=t,bM}function IFe(){if(BRe)return xM;BRe=1;var e=FE();function t(t,n){var r=e(this,t),i=r.size;return r.set(t,n),this.size+=r.size==i?0:1,this}return xM=t,xM}function LFe(){if(VRe)return SM;VRe=1;var e=jFe(),t=NFe(),n=PFe(),r=FFe(),i=IFe();function a(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,SM=a,SM}function RFe(){if(HRe)return CM;HRe=1;var e=LFe(),t=`Expected a function`;function n(r,i){if(typeof r!=`function`||i!=null&&typeof i!=`function`)throw TypeError(t);var a=function(){var e=arguments,t=i?i.apply(this,e):e[0],n=a.cache;if(n.has(t))return n.get(t);var o=r.apply(this,e);return a.cache=n.set(t,o)||n,o};return a.cache=new(n.Cache||e),a}return n.Cache=e,CM=n,CM}function zFe(){if(URe)return wM;URe=1;var e=RFe(),t=500;function n(n){var r=e(n,function(e){return i.size===t&&i.clear(),e}),i=r.cache;return r}return wM=n,wM}function IE(){if(WRe)return TM;WRe=1;var e=zFe(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g;return TM=e(function(e){var r=[];return e.charCodeAt(0)===46&&r.push(``),e.replace(t,function(e,t,i,a){r.push(i?a.replace(n,`$1`):t||e)}),r}),TM}function LE(){if(GRe)return EM;GRe=1;function e(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}return EM=e,EM}function BFe(){if(KRe)return DM;KRe=1;var e=TE(),t=LE(),n=AE(),r=DE(),i=e?e.prototype:void 0,a=i?i.toString:void 0;function o(e){if(typeof e==`string`)return e;if(n(e))return t(e,o)+``;if(r(e))return a?a.call(e):``;var i=e+``;return i==`0`&&1/e==-1/0?`-0`:i}return DM=o,DM}function RE(){if(qRe)return OM;qRe=1;var e=BFe();function t(t){return t==null?``:e(t)}return OM=t,OM}function zE(){if(JRe)return kM;JRe=1;var e=AE(),t=dFe(),n=IE(),r=RE();function i(i,a){return e(i)?i:t(i,a)?[i]:n(r(i))}return kM=i,kM}function BE(){if(YRe)return AM;YRe=1;var e=DE();function t(t){if(typeof t==`string`||e(t))return t;var n=t+``;return n==`0`&&1/t==-1/0?`-0`:n}return AM=t,AM}function VFe(){if(XRe)return jM;XRe=1;var e=zE(),t=BE();function n(n,r){r=e(r,n);for(var i=0,a=r.length;n!=null&&i<a;)n=n[t(r[i++])];return i&&i==a?n:void 0}return jM=n,jM}function HFe(){if(ZRe)return MM;ZRe=1;var e=VFe();function t(t,n,r){var i=t==null?void 0:e(t,n);return i===void 0?r:i}return MM=t,MM}function UFe(){if($Re)return NM;$Re=1;var e=jE();return NM=function(){try{var t=e(Object,`defineProperty`);return t({},``,{}),t}catch{}}(),NM}function WFe(){if(eze)return PM;eze=1;var e=UFe();function t(t,n,r){n==`__proto__`&&e?e(t,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[n]=r}return PM=t,PM}function GFe(){if(tze)return FM;tze=1;var e=WFe(),t=NE(),n=Object.prototype.hasOwnProperty;function r(r,i,a){var o=r[i];(!(n.call(r,i)&&t(o,a))||a===void 0&&!(i in r))&&e(r,i,a)}return FM=r,FM}function KFe(){if(nze)return IM;nze=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(n,r){var i=typeof n;return r??=e,!!r&&(i==`number`||i!=`symbol`&&t.test(n))&&n>-1&&n%1==0&&n<r}return IM=n,IM}function qFe(){if(rze)return LM;rze=1;var e=GFe(),t=zE(),n=KFe(),r=CE(),i=BE();function a(a,o,s,l){if(!r(a))return a;o=t(o,a);for(var u=-1,d=o.length,f=d-1,p=a;p!=null&&++u<d;){var m=i(o[u]),h=s;if(m===`__proto__`||m===`constructor`||m===`prototype`)return a;if(u!=f){var g=p[m];h=l?l(g,m,p):void 0,h===void 0&&(h=r(g)?g:n(o[u+1])?[]:{})}e(p,m,h),p=p[m]}return a}return LM=a,LM}function JFe(){if(ize)return RM;ize=1;var e=qFe();function t(t,n,r){return t==null?t:e(t,n,r)}return RM=t,RM}function YFe(){if(oze)return zM;oze=1;function e(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}return zM=e,zM}function XFe(){if(sze)return BM;sze=1;var e=LE(),t=YFe(),n=AE(),r=DE(),i=IE(),a=BE(),o=RE();function s(s){return n(s)?e(s,a):r(s)?[s]:t(i(o(s)))}return BM=s,BM}function VE(e,t,n,r){for(var i=[],a=new cA,o=e.cy().hasCompoundNodes(),s=0;s<e.length;s++){var l=e[s];n?i.push(l):o&&r(i,a,l)}for(;i.length>0;){var u=i.shift();t(u),a.add(u.id()),o&&r(i,a,u)}return e}function HE(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i<r.length;i++){var a=r[i];t.has(a.id())||e.push(a)}}function UE(e,t,n){if(n.isChild()){var r=n._private.parent;t.has(r.id())||e.push(r)}}function ZFe(e,t,n){UE(e,t,n),HE(e,t,n)}function WE(e){return function(t){var n=this;if(t===void 0&&(t=!0),n.length!==0&&n.isNode()&&!n.removed()){for(var r=0,i=n[0],a=i._private.edges,o=0;o<a.length;o++){var s=a[o];!t&&s.isLoop()||(r+=e(i,s))}return r}}}function GE(e,t){return function(n){for(var r,i=this.nodes(),a=0;a<i.length;a++){var o=i[a][e](n);o!==void 0&&(r===void 0||t(o,r))&&(r=o)}return r}}function KE(){return!1}function qE(){return!0}function JE(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Lze,t=arguments.length>1?arguments[1]:void 0,n=0;n<FN.length;n++){var r=FN[n];this[r]=e[r]||PN[r]}this.context=t||this.context,this.listeners=[],this.emitting=0}function YE(e,t,n){var r=n._private,i=r.styleCache=r.styleCache||[],a;return(a=i[e])??(a=i[e]=t(n)),a}function XE(e,t){return e=Mk(e),function(n){return YE(e,t,n)}}function ZE(e,t){e=Mk(e);var n=function(e){return t.call(e)};return function(){var t=this[0];if(t)return YE(e,n,t)}}function QE(e,t){var n=e._private.data.parent?e.parents():null;if(n)for(var r=0;r<n.length;r++){var i=n[r];if(!t(i))return!1}return!0}function $E(e){var t=e.ok,n=e.edgeOkViaNode||e.ok,r=e.parentOk||e.ok;return function(){var e=this.cy();if(!e.styleEnabled())return!0;var i=this[0],a=e.hasCompoundNodes();if(i){var o=i._private;if(!t(i))return!1;if(i.isNode())return!a||QE(i,r);var s=o.source,l=o.target;return n(s)&&(!a||QE(s,n))&&(s===l||n(l)&&(!a||QE(l,n)))}}}function eD(e){return function(){var t=arguments,n=[];if(t.length===2){var r=t[0],i=t[1];this.on(e.event,r,i)}else if(t.length===1&&$D(t[0])){var a=t[0];this.on(e.event,a)}else if(t.length===0||t.length===1&&eO(t[0])){for(var o=t.length===1?t[0]:null,s=0;s<this.length;s++){var l=this[s],u=!e.ableField||l._private[e.ableField],d=l._private[e.field]!=e.value;if(e.overrideAble){var f=e.overrideAble(l);if(f!==void 0&&(u=f,!f))return this}u&&(l._private[e.field]=e.value,d&&n.push(l))}var p=this.spawn(n);p.updateStyle(),p.emit(e.event),o&&p.emit(o)}return this}}function tD(e){JN[e.field]=function(){var t=this[0];if(t){if(e.overrideField){var n=e.overrideField(t);if(n!==void 0)return n}return t._private[e.field]}},JN[e.on]=eD({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),JN[e.off]=eD({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}function nD(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r]._private[e.attr];i&&n.push(i)}return this.spawn(n,!0).filter(t)}}function rD(e){return function(t){var n=[],r=this._private.cy,i=e||{};QD(t)&&(t=r.$(t));for(var a=0;a<t.length;a++)for(var o=t[a]._private.edges,s=0;s<o.length;s++){var l=o[s],u=l._private.data,d=this.hasElementWithId(u.source)&&t.hasElementWithId(u.target),f=t.hasElementWithId(u.source)&&this.hasElementWithId(u.target);(d||f)&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!d||i.thisIsTgt&&!f)||n.push(l))}return this.spawn(n,!0)}}function iD(e){return e=MO({},{codirected:!1},e),function(t){for(var n=[],r=this.edges(),i=e,a=0;a<r.length;a++)for(var o=r[a]._private,s=o.source,l=s._private.data.id,u=o.data.target,d=s._private.edges,f=0;f<d.length;f++){var p=d[f],m=p._private.data,h=m.target,g=m.source,_=h===u&&g===l,v=l===h&&u===g;(i.codirected&&_||!i.codirected&&(_||v))&&n.push(p)}return this.spawn(n,!0).filter(t)}}function QFe(e,t,n,r){var i=11,a=1/(i-1),o=typeof Float32Array<`u`;if(arguments.length!==4)return!1;for(var s=0;s<4;++s)if(typeof arguments[s]!=`number`||isNaN(arguments[s])||!isFinite(arguments[s]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var l=o?new Float32Array(i):Array(i);function u(e,t){return 1-3*t+3*e}function d(e,t){return 3*t-6*e}function f(e){return 3*e}function p(e,t,n){return((u(t,n)*e+d(t,n))*e+f(t))*e}function m(e,t,n){return 3*u(t,n)*e*e+2*d(t,n)*e+f(t)}function h(t,r){for(var i=0;i<4;++i){var a=m(r,e,n);if(a===0)return r;var o=p(r,e,n)-t;r-=o/a}return r}function g(){for(var t=0;t<i;++t)l[t]=p(t*a,e,n)}function _(t,r,i){var a,o,s=0;do o=r+(i-r)/2,a=p(o,e,n)-t,a>0?i=o:r=o;while(Math.abs(a)>1e-7&&++s<10);return o}function v(t){for(var r=0,o=1,s=i-1;o!==s&&l[o]<=t;++o)r+=a;--o;var u=(t-l[o])/(l[o+1]-l[o]),d=r+u*a,f=m(d,e,n);return f>=.001?h(t,d):f===0?d:_(t,r,r+a)}var y=!1;function b(){y=!0,(e!==t||n!==r)&&g()}var x=function(i){return y||b(),e===t&&n===r?i:i===0?0:i===1?1:p(v(i),t,r)};x.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var S=`generateBezier(`+[e,t,n,r]+`)`;return x.toString=function(){return S},x}function aD(e,t,n,r,i){if(r===1||t===n)return n;var a=i(t,n,r);return e==null?a:((e.roundValue||e.color)&&(a=Math.round(a)),e.min!==void 0&&(a=Math.max(a,e.min)),e.max!==void 0&&(a=Math.min(a,e.max)),a)}function oD(e,t){return e.pfValue!=null||e.value!=null?e.pfValue!=null&&(t==null||t.type.units!==`%`)?e.pfValue:e.value:e}function sD(e,t,n,r,i){var a=i==null?null:i.type;n<0?n=0:n>1&&(n=1);var o=oD(e,i),s=oD(t,i);if(rO(o)&&rO(s))return aD(a,o,s,n,r);if(eO(o)&&eO(s)){for(var l=[],u=0;u<s.length;u++){var d=o[u],f=s[u];if(d!=null&&f!=null){var p=aD(a,d,f,n,r);l.push(p)}else l.push(f)}return l}}function $Fe(e,t,n,r){var i=!r,a=e._private,o=t._private,s=o.easing,l=o.startTime,u=(r?e:e.cy()).style();if(!o.easingImpl){if(s==null)o.easingImpl=nP.linear;else{var d=QD(s)?u.parse(`transition-timing-function`,s).value:s,f,p;QD(d)?(f=d,p=[]):(f=d[1],p=d.slice(2).map(function(e){return+e})),p.length>0?(f===`spring`&&p.push(o.duration),o.easingImpl=nP[f].apply(null,p)):o.easingImpl=nP[f]}}var m=o.easingImpl,h=o.duration===0?1:(n-l)/o.duration;if(o.applying&&(h=o.progress),h<0?h=0:h>1&&(h=1),o.delay==null){var g=o.startPosition,_=o.position;if(_&&i&&!e.locked()){var v={};cD(g.x,_.x)&&(v.x=sD(g.x,_.x,h,m)),cD(g.y,_.y)&&(v.y=sD(g.y,_.y,h,m)),e.position(v)}var y=o.startPan,b=o.pan,x=a.pan,S=b!=null&&r;S&&(cD(y.x,b.x)&&(x.x=sD(y.x,b.x,h,m)),cD(y.y,b.y)&&(x.y=sD(y.y,b.y,h,m)),e.emit(`pan`));var C=o.startZoom,w=o.zoom,T=w!=null&&r;T&&(cD(C,w)&&(a.zoom=OA(a.minZoom,sD(C,w,h,m),a.maxZoom)),e.emit(`zoom`)),(S||T)&&e.emit(`viewport`);var E=o.style;if(E&&E.length>0&&i){for(var D=0;D<E.length;D++){var O=E[D],k=O.name,A=O,j=o.startStyle[k],M=u.properties[j.name],N=sD(j,A,h,m,M);u.overrideBypass(e,k,N)}e.emit(`style`)}}return o.progress=h,h}function cD(e,t){return e==null||t==null?!1:rO(e)&&rO(t)?!0:!!(e&&t)}function eIe(e,t,n,r){var i=t._private;i.started=!0,i.startTime=n-i.progress*i.duration}function lD(e,t){var n=t._private.aniEles,r=[];function i(t,n){var i=t._private,a=i.animation.current,o=i.animation.queue,s=!1;if(a.length===0){var l=o.shift();l&&a.push(l)}for(var u=function(e){for(var t=e.length-1;t>=0;t--){var n=e[t];n()}e.splice(0,e.length)},d=a.length-1;d>=0;d--){var f=a[d],p=f._private;if(p.stopped){a.splice(d,1),p.hooked=!1,p.playing=!1,p.started=!1,u(p.frames);continue}!p.playing&&!p.applying||(p.playing&&p.applying&&(p.applying=!1),p.started||eIe(t,f,e),$Fe(t,f,e,n),p.applying&&=!1,u(p.frames),p.step!=null&&p.step(e),f.completed()&&(a.splice(d,1),p.hooked=!1,p.playing=!1,p.started=!1,u(p.completes)),s=!0)}return!n&&a.length===0&&o.length===0&&r.push(t),s}for(var a=!1,o=0;o<n.length;o++){var s=n[o],l=i(s);a||=l}var u=i(t,!0);(a||u)&&(n.length>0?t.notify(`draw`,n):t.notify(`draw`)),n.unmerge(r),t.emit(`step`)}function uD(e){this.options=MO({},Zze,Qze,e)}function dD(e){this.options=MO({},$ze,e)}function fD(e){this.options=MO({},eBe,e)}function pD(e){this.options=MO({},nBe,e),this.options.layout=this;var t=this.options.eles.nodes(),n=this.options.eles.edges().filter(function(e){var n=e.source().data(`id`),r=e.target().data(`id`),i=t.some(function(e){return e.data(`id`)===n}),a=t.some(function(e){return e.data(`id`)===r});return!i||!a});this.options.eles=this.options.eles.not(n)}function mD(e){this.options=MO({},_Be,e)}function hD(e){this.options=MO({},vBe,e)}function gD(e){this.options=MO({},yBe,e)}function _D(e){this.options=MO({},bBe,e)}function vD(e){this.options=e,this.notifications=0}function yD(e,t){t.radius===0?e.lineTo(t.cx,t.cy):e.arc(t.cx,t.cy,t.radius,t.startAngle,t.endAngle,t.counterClockwise)}function bD(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return r===0||t.radius===0?{cx:t.x,cy:t.y,radius:0,startX:t.x,startY:t.y,stopX:t.x,stopY:t.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(OBe(e,t,n,r,i),{cx:LP,cy:RP,radius:GP,startX:wBe,startY:TBe,stopX:YP,stopY:XP,startAngle:zP.ang+Math.PI/2*VP,endAngle:BP.ang-Math.PI/2*VP,counterClockwise:HP})}function xD(e){var t=[];if(e!=null){for(var n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];t.push({x:r,y:i})}return t}}function tIe(e,t,n){for(var r=function(e,t,n,r){return EA(e,t,n,r)},i=t._private.rstyle.bezierPts,a=0;a<e.bezierProjPcts.length;a++){var o=e.bezierProjPcts[a];i.push({x:r(n[0],n[2],n[4],o),y:r(n[1],n[3],n[5],o)})}}function nIe(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.lineTo(r.x,r.y)}}function rIe(e,t,n){for(var r,i=0;i<t.length;i++){var a=t[i];i===0&&(r=a),e.lineTo(a.x,a.y)}e.quadraticCurveTo(n.x,n.y,r.x,r.y)}function SD(e,t,n){e.beginPath&&e.beginPath();for(var r=t,i=0;i<r.length;i++){var a=r[i];e.lineTo(a.x,a.y)}var o=n,s=n[0];e.moveTo(s.x,s.y);for(var i=1;i<o.length;i++){var a=o[i];e.lineTo(a.x,a.y)}e.closePath&&e.closePath()}function iIe(e,t,n,r,i){e.beginPath&&e.beginPath(),e.arc(n,r,i,0,Math.PI*2,!1);var a=t,o=a[0];e.moveTo(o.x,o.y);for(var s=0;s<a.length;s++){var l=a[s];e.lineTo(l.x,l.y)}e.closePath&&e.closePath()}function aIe(e,t,n,r){e.arc(t,n,r,0,Math.PI*2,!1)}function oIe(e,t,n,r,i){var a=Math.min(r,i)/2,o=t+r/2,s=n+i/2;e.beginPath(),e.arc(o,s,a,0,Math.PI*2),e.closePath()}function CD(e,t,n,r,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,o=Math.min(a,r/2,i/2);e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath()}function wD(e,t,n){var r=e.createShader(t);if(e.shaderSource(r,n),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))throw Error(e.getShaderInfoLog(r));return r}function sIe(e,t,n){var r=wD(e,e.VERTEX_SHADER,t),i=wD(e,e.FRAGMENT_SHADER,n),a=e.createProgram();if(e.attachShader(a,r),e.attachShader(a,i),e.linkProgram(a),!e.getProgramParameter(a,e.LINK_STATUS))throw Error(`Could not initialize shaders`);return a}function cIe(e,t,n){n===void 0&&(n=t);var r=e.makeOffscreenCanvas(t,n),i=r.context=r.getContext(`2d`);return r.clear=function(){return i.clearRect(0,0,r.width,r.height)},r.clear(),r}function TD(e){var t=e.pixelRatio,n=e.cy.zoom(),r=e.cy.pan();return{zoom:n*t,pan:{x:r.x*t,y:r.y*t}}}function lIe(e){var t=e.pixelRatio;return e.cy.zoom()*t}function uIe(e,t,n,r,i){var a=r*n+t.x,o=i*n+t.y;return o=Math.round(e.canvasHeight-o),[a,o]}function dIe(e,t){return t.picking?!0:e.pstyle(`background-fill`).value!==`solid`||e.pstyle(`background-image`).strValue!==`none`?!1:e.pstyle(`border-width`).value===0||e.pstyle(`border-opacity`).value===0||e.pstyle(`border-style`).value===`solid`}function fIe(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ED(e,t,n){var r=e[0]/255,i=e[1]/255,a=e[2]/255,o=t,s=n||[,,,,];return s[0]=r*o,s[1]=i*o,s[2]=a*o,s[3]=o,s}function DD(e,t){var n=t||[,,,,];return n[0]=(e>>0&255)/255,n[1]=(e>>8&255)/255,n[2]=(e>>16&255)/255,n[3]=(e>>24&255)/255,n}function pIe(e){return e[0]+(e[1]<<8)+(e[2]<<16)+(e[3]<<24)}function mIe(e,t){var n=e.createTexture();return n.buffer=function(t){e.bindTexture(e.TEXTURE_2D,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_NEAREST),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t),e.generateMipmap(e.TEXTURE_2D),e.bindTexture(e.TEXTURE_2D,null)},n.deleteTexture=function(){e.deleteTexture(n)},n}function OD(e,t){switch(t){case`float`:return[1,e.FLOAT,4];case`vec2`:return[2,e.FLOAT,4];case`vec3`:return[3,e.FLOAT,4];case`vec4`:return[4,e.FLOAT,4];case`int`:return[1,e.INT,4];case`ivec2`:return[2,e.INT,4]}}function kD(e,t,n){switch(t){case e.FLOAT:return new Float32Array(n);case e.INT:return new Int32Array(n)}}function hIe(e,t,n,r,i,a){switch(t){case e.FLOAT:return new Float32Array(n.buffer,a*r,i);case e.INT:return new Int32Array(n.buffer,a*r,i)}}function gIe(e,t,n,r){var i=_E(OD(e,t),2),a=i[0],o=i[1],s=kD(e,o,r),l=e.createBuffer();return e.bindBuffer(e.ARRAY_BUFFER,l),e.bufferData(e.ARRAY_BUFFER,s,e.STATIC_DRAW),o===e.FLOAT?e.vertexAttribPointer(n,a,o,!1,0,0):o===e.INT&&e.vertexAttribIPointer(n,a,o,0,0),e.enableVertexAttribArray(n),e.bindBuffer(e.ARRAY_BUFFER,null),l}function AD(e,t,n,r){var i=_E(OD(e,n),3),a=i[0],o=i[1],s=i[2],l=kD(e,o,t*a),u=a*s,d=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,d),e.bufferData(e.ARRAY_BUFFER,t*u,e.DYNAMIC_DRAW),e.enableVertexAttribArray(r),o===e.FLOAT?e.vertexAttribPointer(r,a,o,!1,u,0):o===e.INT&&e.vertexAttribIPointer(r,a,o,u,0),e.vertexAttribDivisor(r,1),e.bindBuffer(e.ARRAY_BUFFER,null);for(var f=Array(t),p=0;p<t;p++)f[p]=hIe(e,o,l,u,a,p);return d.dataArray=l,d.stride=u,d.size=a,d.getView=function(e){return f[e]},d.setPoint=function(e,t,n){var r=f[e];r[0]=t,r[1]=n},d.bufferSubData=function(t){e.bindBuffer(e.ARRAY_BUFFER,d),t?e.bufferSubData(e.ARRAY_BUFFER,0,l,0,t*a):e.bufferSubData(e.ARRAY_BUFFER,0,l)},d}function _Ie(e,t,n){for(var r=9,i=new Float32Array(t*r),a=Array(t),o=0;o<t;o++){var s=o*r*4;a[o]=new Float32Array(i.buffer,s,r)}var l=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,l),e.bufferData(e.ARRAY_BUFFER,i.byteLength,e.DYNAMIC_DRAW);for(var u=0;u<3;u++){var d=n+u;e.enableVertexAttribArray(d),e.vertexAttribPointer(d,3,e.FLOAT,!1,36,u*12),e.vertexAttribDivisor(d,1)}return e.bindBuffer(e.ARRAY_BUFFER,null),l.getMatrixView=function(e){return a[e]},l.setData=function(e,t){a[t].set(e,0)},l.bufferSubData=function(){e.bindBuffer(e.ARRAY_BUFFER,l),e.bufferSubData(e.ARRAY_BUFFER,0,i)},l}function vIe(e){var t=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,t);var n=e.createTexture();return e.bindTexture(e.TEXTURE_2D,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0),e.bindFramebuffer(e.FRAMEBUFFER,null),t.setFramebufferAttachmentSizes=function(t,r){e.bindTexture(e.TEXTURE_2D,n),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,r,0,e.RGBA,e.UNSIGNED_BYTE,null)},t}function jD(){var e=new KF(9);return KF!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function MD(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function yIe(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],d=t[7],f=t[8],p=n[0],m=n[1],h=n[2],g=n[3],_=n[4],v=n[5],y=n[6],b=n[7],x=n[8];return e[0]=p*r+m*o+h*u,e[1]=p*i+m*s+h*d,e[2]=p*a+m*l+h*f,e[3]=g*r+_*o+v*u,e[4]=g*i+_*s+v*d,e[5]=g*a+_*l+v*f,e[6]=y*r+b*o+x*u,e[7]=y*i+b*s+x*d,e[8]=y*a+b*l+x*f,e}function ND(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],d=t[7],f=t[8],p=n[0],m=n[1];return e[0]=r,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=p*r+m*o+u,e[7]=p*i+m*s+d,e[8]=p*a+m*l+f,e}function PD(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],d=t[7],f=t[8],p=Math.sin(n),m=Math.cos(n);return e[0]=m*r+p*o,e[1]=m*i+p*s,e[2]=m*a+p*l,e[3]=m*o-p*r,e[4]=m*s-p*i,e[5]=m*l-p*a,e[6]=u,e[7]=d,e[8]=f,e}function FD(e,t,n){var r=n[0],i=n[1];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function bIe(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}function xIe(e,t){return e.intersection?e.intersection(t):new Set(vE(e).filter(function(e){return t.has(e)}))}function SIe(e){var t=e.cy.container();return LO(t&&t.style&&t.style.backgroundColor||`white`)}function ID(e,t){var n=e._private.rscratch;return rA(n,`labelWrapCachedLines`,t)||[]}function CIe(e){var t=e.render;e.render=function(n){n||={};var r=e.cy;e.webgl&&(r.zoom()>wF?(wIe(e),t.call(e,n)):(TIe(e),zD(e,n,qF.SCREEN)))};var n=e.matchCanvasSize;e.matchCanvasSize=function(t){n.call(e,t),e.pickingFrameBuffer.setFramebufferAttachmentSizes(e.canvasWidth,e.canvasHeight),e.pickingFrameBuffer.needsDraw=!0},e.findNearestElements=function(t,n,r,i){return jIe(e,t,n)};var r=e.invalidateCachedZSortedEles;e.invalidateCachedZSortedEles=function(){r.call(e),e.pickingFrameBuffer.needsDraw=!0};var i=e.notify;e.notify=function(t,n){i.call(e,t,n),t===`viewport`||t===`bounds`?e.pickingFrameBuffer.needsDraw=!0:t===`background`&&e.drawing.invalidate(n,{type:`node-body`})}}function wIe(e){var t=e.data.contexts[e.WEBGL];t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT)}function TIe(e){var t=function(t){t.save(),t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,e.canvasWidth,e.canvasHeight),t.restore()};t(e.data.contexts[e.NODE]),t(e.data.contexts[e.DRAG])}function EIe(e){var t=e.canvasWidth,n=e.canvasHeight,r=TD(e),i=r.pan,a=r.zoom,o=jD();ND(o,o,[i.x,i.y]),FD(o,o,[a,a]);var s=jD();bIe(s,t,n);var l=jD();return yIe(l,s,o),l}function LD(e,t){var n=e.canvasWidth,r=e.canvasHeight,i=TD(e),a=i.pan,o=i.zoom;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,n,r),t.translate(a.x,a.y),t.scale(o,o)}function DIe(e,t){e.drawSelectionRectangle(t,function(t){return LD(e,t)})}function OIe(e){var t=e.data.contexts[e.NODE];t.save(),LD(e,t),t.strokeStyle=`rgba(0, 0, 0, 0.3)`,t.beginPath(),t.moveTo(-1e3,0),t.lineTo(1e3,0),t.stroke(),t.beginPath(),t.moveTo(0,-1e3),t.lineTo(0,1e3),t.stroke(),t.restore()}function kIe(e){var t=function(t,n,r){for(var i=t.atlasManager.getAtlasCollection(n),a=e.data.contexts[e.NODE],o=i.atlases,s=0;s<o.length;s++){var l=o[s].canvas;if(l){var u=l.width,d=l.height,f=u*s,p=l.height*r,m=.4;a.save(),a.scale(m,m),a.drawImage(l,f,p),a.strokeStyle=`black`,a.rect(f,p,u,d),a.stroke(),a.restore()}}},n=0;t(e.drawing,`node`,n++),t(e.drawing,`label`,n++)}function AIe(e,t,n,r,i){var a,o,s,l,u=TD(e),d=u.pan,f=u.zoom,p=_E(uIe(e,d,f,t,n),2),m=p[0],h=p[1],g=6;if(a=m-g/2,o=h-g/2,s=g,l=g,s===0||l===0)return[];var _=e.data.contexts[e.WEBGL];_.bindFramebuffer(_.FRAMEBUFFER,e.pickingFrameBuffer),e.pickingFrameBuffer.needsDraw&&(_.viewport(0,0,_.canvas.width,_.canvas.height),zD(e,null,qF.PICKING),e.pickingFrameBuffer.needsDraw=!1);var v=s*l,y=new Uint8Array(v*4);_.readPixels(a,o,s,l,_.RGBA,_.UNSIGNED_BYTE,y),_.bindFramebuffer(_.FRAMEBUFFER,null);for(var b=new Set,x=0;x<v;x++){var S=pIe(y.slice(x*4,x*4+4))-1;S>=0&&b.add(S)}return b}function jIe(e,t,n){var r=AIe(e,t,n),i=e.getCachedZSortedEles(),a,o,s=gE(r),l;try{for(s.s();!(l=s.n()).done;){var u=i[l.value];if(!a&&u.isNode()&&(a=u),!o&&u.isEdge()&&(o=u),a&&o)break}}catch(e){s.e(e)}finally{s.f()}return[a,o].filter(Boolean)}function RD(e,t,n){var r=e.drawing;t+=1,n.isNode()?(r.drawNode(n,t,`node-underlay`),r.drawNode(n,t,`node-body`),r.drawTexture(n,t,`label`),r.drawNode(n,t,`node-overlay`)):(r.drawEdgeLine(n,t),r.drawEdgeArrow(n,t,`source`),r.drawEdgeArrow(n,t,`target`),r.drawTexture(n,t,`label`),r.drawTexture(n,t,`edge-source-label`),r.drawTexture(n,t,`edge-target-label`))}function zD(e,t,n){var r;e.webglDebug&&(r=performance.now());var i=e.drawing,a=0;if(n.screen&&e.data.canvasNeedsRedraw[e.SELECT_BOX]&&DIe(e,t),e.data.canvasNeedsRedraw[e.NODE]||n.picking){var o=e.data.contexts[e.WEBGL];n.screen?(o.clearColor(0,0,0,0),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA)):o.disable(o.BLEND),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.viewport(0,0,o.canvas.width,o.canvas.height);var s=EIe(e),l=e.getCachedZSortedEles();if(a=l.length,i.startFrame(s,n),n.screen){for(var u=0;u<l.nondrag.length;u++)RD(e,u,l.nondrag[u]);for(var d=0;d<l.drag.length;d++)RD(e,d,l.drag[d])}else if(n.picking)for(var f=0;f<l.length;f++)RD(e,f,l[f]);i.endFrame(),n.screen&&e.webglDebugShowAtlases&&(OIe(e),kIe(e)),e.data.canvasNeedsRedraw[e.NODE]=!1,e.data.canvasNeedsRedraw[e.DRAG]=!1}if(e.webglDebug){var p=performance.now(),m=Math.ceil(p-r),h=i.getDebugInfo(),g=[`${a} elements`,`${h.totalInstances} instances`,`${h.batchCount} batches`,`${h.totalAtlases} atlases`,`${h.wrappedCount} wrapped textures`,`${h.simpleCount} simple shapes`].join(`, `);console.log(`WebGL (${n.name}) - frame time ${m}ms`),console.log(`Totals:`),console.log(` ${g}`),console.log(`Texture Atlases Used:`);var _=h.atlasInfo,v=gE(_),y;try{for(v.s();!(y=v.n()).done;){var b=y.value;console.log(` ${b.type}: ${b.keyCount} keys, ${b.atlasCount} atlases`)}}catch(e){v.e(e)}finally{v.f()}console.log(``)}e.data.gc&&(console.log(`Garbage Collect!`),e.data.gc=!1,i.gc())}function MIe(e,t){for(var n=atob(e),r=new ArrayBuffer(n.length),i=new Uint8Array(r),a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return new Blob([r],{type:t})}function BD(e){var t=e.indexOf(`,`);return e.substr(t+1)}function VD(e,t,n){var r=function(){return t.toDataURL(n,e.quality)};switch(e.output){case`blob-promise`:return new Vj(function(r,i){try{t.toBlob(function(e){e==null?i(Error("`canvas.toBlob()` sent a null value in its callback")):r(e)},n,e.quality)}catch(e){i(e)}});case`blob`:return MIe(BD(r()),n);case`base64`:return BD(r());default:return r()}}function HD(e){var t=this,n=t.cy.window().document;e.webgl&&(hI.CANVAS_LAYERS=t.CANVAS_LAYERS=4,console.log(`webgl rendering enabled`)),t.data={canvases:Array(hI.CANVAS_LAYERS),contexts:Array(hI.CANVAS_LAYERS),canvasNeedsRedraw:Array(hI.CANVAS_LAYERS),bufferCanvases:Array(hI.BUFFER_COUNT),bufferContexts:Array(hI.CANVAS_LAYERS)};var r=`-webkit-tap-highlight-color`,i=`rgba(0,0,0,0)`;t.data.canvasContainer=n.createElement(`div`);var a=t.data.canvasContainer.style;t.data.canvasContainer.style[r]=i,a.position=`relative`,a.zIndex=`0`,a.overflow=`hidden`;var o=e.cy.container();o.appendChild(t.data.canvasContainer),o.style[r]=i;var s={"-webkit-user-select":`none`,"-moz-user-select":`-moz-none`,"user-select":`none`,"-webkit-tap-highlight-color":`rgba(0,0,0,0)`,"outline-style":`none`};gO()&&(s[`-ms-touch-action`]=`none`,s[`touch-action`]=`none`);for(var l=0;l<hI.CANVAS_LAYERS;l++){var u=t.data.canvases[l]=n.createElement(`canvas`),d=hI.CANVAS_TYPES[l];t.data.contexts[l]=u.getContext(d),t.data.contexts[l]||Wk(`Could not create canvas of type `+d),Object.keys(s).forEach(function(e){u.style[e]=s[e]}),u.style.position=`absolute`,u.setAttribute(`data-id`,`layer`+l),u.style.zIndex=String(hI.CANVAS_LAYERS-l),t.data.canvasContainer.appendChild(u),t.data.canvasNeedsRedraw[l]=!1}t.data.topCanvas=t.data.canvases[0],t.data.canvases[hI.NODE].setAttribute(`data-id`,`layer`+hI.NODE+`-node`),t.data.canvases[hI.SELECT_BOX].setAttribute(`data-id`,`layer`+hI.SELECT_BOX+`-selectbox`),t.data.canvases[hI.DRAG].setAttribute(`data-id`,`layer`+hI.DRAG+`-drag`),t.data.canvases[hI.WEBGL]&&t.data.canvases[hI.WEBGL].setAttribute(`data-id`,`layer`+hI.WEBGL+`-webgl`);for(var l=0;l<hI.BUFFER_COUNT;l++)t.data.bufferCanvases[l]=n.createElement(`canvas`),t.data.bufferContexts[l]=t.data.bufferCanvases[l].getContext(`2d`),t.data.bufferCanvases[l].style.position=`absolute`,t.data.bufferCanvases[l].setAttribute(`data-id`,`buffer`+l),t.data.bufferCanvases[l].style.zIndex=String(-l-1),t.data.bufferCanvases[l].style.visibility=`hidden`;t.pathsEnabled=!0;var f=kA(),p=function(e){return{x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2}},m=function(e){return{x:-e.w/2,y:-e.h/2}},h=function(e){var t=e[0]._private;return t.oldBackgroundTimestamp!==t.backgroundTimestamp},g=function(e){return e[0]._private.nodeKey},_=function(e){return e[0]._private.labelStyleKey},v=function(e){return e[0]._private.sourceLabelStyleKey},y=function(e){return e[0]._private.targetLabelStyleKey},b=function(e,n,r,i,a){return t.drawElement(e,n,r,!1,!1,a)},x=function(e,n,r,i,a){return t.drawElementText(e,n,r,i,`main`,a)},S=function(e,n,r,i,a){return t.drawElementText(e,n,r,i,`source`,a)},C=function(e,n,r,i,a){return t.drawElementText(e,n,r,i,`target`,a)},w=function(e){return e.boundingBox(),e[0]._private.bodyBounds},T=function(e){return e.boundingBox(),e[0]._private.labelBounds.main||f},E=function(e){return e.boundingBox(),e[0]._private.labelBounds.source||f},D=function(e){return e.boundingBox(),e[0]._private.labelBounds.target||f},O=function(e,t){return t},k=function(e){return p(w(e))},A=function(e,t,n){var r=e?e+`-`:``;return{x:t.x+n.pstyle(r+`text-margin-x`).pfValue,y:t.y+n.pstyle(r+`text-margin-y`).pfValue}},j=function(e,t,n){var r=e[0]._private.rscratch;return{x:r[t],y:r[n]}},M=function(e){return A(``,j(e,`labelX`,`labelY`),e)},N=function(e){return A(`source`,j(e,`sourceLabelX`,`sourceLabelY`),e)},P=function(e){return A(`target`,j(e,`targetLabelX`,`targetLabelY`),e)},F=function(e){return m(w(e))},I=function(e){return m(E(e))},L=function(e){return m(D(e))},R=function(e){var t=T(e),n=m(T(e));if(e.isNode()){switch(uN(e.pstyle(`text-halign`).value)){case`left`:n.x=-t.w-(t.leftPad||0);break;case`right`:n.x=-(t.rightPad||0)}switch(dN(e.pstyle(`text-valign`).value)){case`top`:n.y=-t.h-(t.topPad||0);break;case`bottom`:n.y=-(t.botPad||0)}}return n},ee=t.data.eleTxrCache=new EF(t,{getKey:g,doesEleInvalidateKey:h,drawElement:b,getBoundingBox:w,getRotationPoint:k,getRotationOffset:F,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),z=t.data.lblTxrCache=new EF(t,{getKey:_,drawElement:x,getBoundingBox:T,getRotationPoint:M,getRotationOffset:R,isVisible:O}),B=t.data.slbTxrCache=new EF(t,{getKey:v,drawElement:S,getBoundingBox:E,getRotationPoint:N,getRotationOffset:I,isVisible:O}),te=t.data.tlbTxrCache=new EF(t,{getKey:y,drawElement:C,getBoundingBox:D,getRotationPoint:P,getRotationOffset:L,isVisible:O}),ne=t.data.lyrTxrCache=new MF(t);t.onUpdateEleCalcs(function(e,t){ee.invalidateElements(t),z.invalidateElements(t),B.invalidateElements(t),te.invalidateElements(t),ne.invalidateElements(t);for(var n=0;n<t.length;n++){var r=t[n]._private;r.oldBackgroundTimestamp=r.backgroundTimestamp}});var re=function(e){for(var t=0;t<e.length;t++)ne.enqueueElementRefinement(e[t].ele)};ee.onDequeue(re),z.onDequeue(re),B.onDequeue(re),te.onDequeue(re),e.webgl&&t.initWebgl(e,{getStyleKey:g,getLabelKey:_,getSourceLabelKey:v,getTargetLabelKey:y,drawElement:b,drawLabel:x,drawSourceLabel:S,drawTargetLabel:C,getElementBox:w,getLabelBox:T,getSourceLabelBox:E,getTargetLabelBox:D,getElementRotationPoint:k,getElementRotationOffset:F,getLabelRotationPoint:M,getSourceLabelRotationPoint:N,getTargetLabelRotationPoint:P,getLabelRotationOffset:R,getSourceLabelRotationOffset:I,getTargetLabelRotationOffset:L})}function UD(e,t,n){var r=n,i=function(n){Kk("Can not register `"+t+"` for `"+e+"` since `"+n+"` already exists in the prototype and can not be overridden")};if(e===`core`){if(SP.prototype[t])return i(t);SP.prototype[t]=n}else if(e===`collection`){if($N.prototype[t])return i(t);$N.prototype[t]=n}else if(e===`layout`){for(var a=function(e){this.options=e,n.call(this,e),tO(this._private)||(this._private={}),this._private.cy=e.cy,this._private.listeners=[],this.createEmitter()},o=a.prototype=Object.create(n.prototype),s=[],l=0;l<s.length;l++){var u=s[l];o[u]=o[u]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var d=n.prototype.stop;o.stop=function(){var e=this.options;if(e&&e.animate){var t=this.animations;if(t)for(var n=0;n<t.length;n++)t[n].stop()}return d?d.call(this):this.emit(`layoutstop`),this},o.destroy||=function(){return this},o.cy=function(){return this._private.cy};var f=function(e){return e._private.cy},p={addEventFields:function(e,t){t.layout=e,t.cy=f(e),t.target=e},bubble:function(){return!0},parent:function(e){return f(e)}};MO(o,{createEmitter:function(){return this._private.emitter=new JE(p,this),this},emitter:function(){return this._private.emitter},on:function(e,t){return this.emitter().on(e,t),this},one:function(e,t){return this.emitter().one(e,t),this},once:function(e,t){return this.emitter().one(e,t),this},removeListener:function(e,t){return this.emitter().removeListener(e,t),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(e,t){return this.emitter().emit(e,t),this}}),VM.eventAliasesOn(o),r=a}else if(e===`renderer`&&t!==`null`&&t!==`base`){var m=WD(`renderer`,`base`),h=m.prototype,g=n,_=n.prototype,v=function(){m.apply(this,arguments),g.apply(this,arguments)},y=v.prototype;for(var b in h){var x=h[b];if(_[b]!=null)return i(b);y[b]=x}for(var S in _)y[S]=_[S];h.clientFunctions.forEach(function(e){y[e]=y[e]||function(){Wk("Renderer does not implement `renderer."+e+"()` on its prototype")}}),r=v}else if(e===`__proto__`||e===`constructor`||e===`prototype`)return Wk(e+` is an illegal type to be registered, possibly lead to prototype pollutions`);return zO({map:gI,keys:[e,t],value:r})}function WD(e,t){return BO({map:gI,keys:[e,t]})}function NIe(e,t,n,r,i){return zO({map:_I,keys:[e,t,n,r],value:i})}function PIe(e,t,n,r){return BO({map:_I,keys:[e,t,n,r]})}var GD,KD,qD,JD,YD,XD,ZD,QD,$D,eO,tO,nO,rO,iO,aO,oO,sO,cO,lO,uO,dO,fO,pO,mO,hO,gO,_O,vO,yO,bO,xO,SO,CO,wO,TO,EO,DO,OO,kO,AO,jO,MO,NO,PO,FO,IO,LO,RO,zO,BO,VO,HO,UO,WO,GO,KO,qO,JO,YO,XO,ZO,QO,$O,ek,tk,nk,rk,ik,ak,ok,sk,ck,lk,uk,dk,fk,pk,mk,hk,gk,_k,vk,yk,bk,xk,Sk,Ck,wk,Tk,Ek,Dk,Ok,kk,Ak,jk,Mk,Nk,Pk,Fk,Ik,Lk,Rk,zk,Bk,Vk,Hk,Uk,Wk,Gk,Kk,qk,Jk,Yk,Xk,Zk,Qk,$k,eA,tA,nA,rA,iA,aA,oA,sA,cA,lA,uA,dA,fA,pA,FIe,mA,IIe,hA,LIe,RIe,zIe,BIe,VIe,HIe,UIe,WIe,GIe,KIe,qIe,gA,JIe,YIe,_A,vA,yA,XIe,ZIe,QIe,$Ie,bA,eLe,tLe,xA,SA,CA,wA,TA,nLe,EA,DA,rLe,OA,kA,iLe,aLe,oLe,AA,jA,MA,NA,PA,FA,IA,LA,sLe,RA,cLe,lLe,uLe,dLe,fLe,pLe,zA,BA,mLe,VA,HA,hLe,UA,WA,GA,KA,gLe,qA,_Le,JA,YA,XA,ZA,QA,$A,ej,vLe,tj,yLe,bLe,nj,rj,ij,aj,xLe,oj,SLe,CLe,wLe,TLe,sj,ELe,DLe,OLe,kLe,ALe,jLe,MLe,cj,NLe,PLe,lj,uj,dj,FLe,ILe,fj,pj,LLe,mj,hj,gj,_j,vj,RLe,zLe,BLe,yj,bj,VLe,HLe,ULe,WLe,GLe,xj,KLe,qLe,JLe,YLe,Sj,Cj,wj,Tj,Ej,XLe,ZLe,QLe,$Le,eRe,tRe,Dj,nRe,Oj,rRe,iRe,aRe,kj,oRe,Aj,sRe,jj,Mj,Nj,Pj,Fj,Ij,Lj,Rj,zj,Bj,Vj,Hj,Uj,cRe,Wj,lRe,Gj,uRe,Kj,dRe,qj,fRe,Jj,pRe,Yj,mRe,Xj,hRe,Zj,gRe,Qj,_Re,$j,vRe,eM,yRe,tM,bRe,nM,xRe,rM,SRe,iM,CRe,aM,wRe,oM,TRe,sM,ERe,cM,DRe,lM,ORe,uM,kRe,dM,ARe,fM,jRe,pM,MRe,mM,NRe,hM,PRe,gM,FRe,_M,IRe,vM,LRe,yM,RRe,bM,zRe,xM,BRe,SM,VRe,CM,HRe,wM,URe,TM,WRe,EM,GRe,DM,KRe,OM,qRe,kM,JRe,AM,YRe,jM,XRe,MM,ZRe,QRe,NM,$Re,PM,eze,FM,tze,IM,nze,LM,rze,RM,ize,aze,zM,oze,BM,sze,cze,lze,uze,VM,dze,HM,UM,WM,GM,KM,fze,pze,mze,qM,JM,YM,hze,gze,_ze,XM,vze,yze,ZM,bze,QM,$M,xze,eN,tN,nN,rN,iN,aN,Sze,Cze,oN,sN,wze,cN,lN,Tze,uN,dN,Eze,fN,pN,mN,hN,gN,_N,vN,yN,bN,xN,Dze,Oze,SN,CN,wN,TN,EN,DN,kze,ON,kN,AN,Aze,jze,Mze,Nze,jN,Pze,Fze,MN,NN,Ize,PN,FN,Lze,IN,LN,RN,Rze,zze,zN,BN,VN,HN,Bze,UN,WN,Vze,GN,KN,qN,JN,YN,XN,ZN,QN,$N,eP,Hze,Uze,tP,nP,Wze,Gze,rP,iP,aP,oP,Kze,qze,sP,cP,lP,uP,Jze,dP,fP,pP,mP,hP,gP,_P,vP,yP,Yze,Xze,bP,xP,SP,CP,Zze,Qze,wP,TP,$ze,eBe,tBe,nBe,rBe,iBe,EP,aBe,oBe,DP,sBe,cBe,lBe,OP,uBe,dBe,kP,fBe,pBe,mBe,hBe,gBe,AP,jP,_Be,vBe,yBe,bBe,xBe,MP,NP,PP,FP,IP,LP,RP,zP,BP,SBe,CBe,VP,HP,UP,WP,GP,KP,qP,JP,wBe,TBe,YP,XP,EBe,ZP,DBe,OBe,QP,kBe,$P,eF,tF,nF,rF,iF,ABe,aF,oF,jBe,sF,cF,lF,uF,dF,MBe,NBe,fF,pF,mF,hF,gF,_F,vF,yF,PBe,bF,xF,SF,CF,wF,FBe,IBe,LBe,RBe,zBe,BBe,VBe,HBe,UBe,WBe,GBe,KBe,qBe,TF,JBe,EF,DF,YBe,OF,kF,XBe,ZBe,QBe,$Be,eVe,tVe,nVe,rVe,AF,iVe,jF,aVe,MF,NF,PF,oVe,FF,sVe,IF,cVe,lVe,uVe,dVe,fVe,LF,RF,zF,BF,VF,HF,UF,WF,pVe,GF,KF,mVe,hVe,gVe,_Ve,vVe,yVe,bVe,xVe,qF,JF,YF,XF,ZF,QF,$F,eI,tI,nI,SVe,rI,iI,aI,oI,sI,cI,lI,uI,dI,fI,pI,mI,CVe,hI,wVe,TVe,gI,_I,vI,yI,bI,EVe,xI,DVe=o((()=>{for(GD=typeof window>`u`?null:window,KD=GD?GD.navigator:null,GD&&GD.document,qD=bE(``),JD=bE({}),YD=bE(function(){}),XD=typeof HTMLElement>`u`?`undefined`:bE(HTMLElement),ZD=function(e){return e&&e.instanceString&&$D(e.instanceString)?e.instanceString():null},QD=function(e){return e!=null&&bE(e)==qD},$D=function(e){return e!=null&&bE(e)===YD},eO=function(e){return!oO(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},tO=function(e){return e!=null&&bE(e)===JD&&!eO(e)&&e.constructor===Object},nO=function(e){return e!=null&&bE(e)===JD},rO=function(e){return e!=null&&bE(e)===bE(1)&&!isNaN(e)},iO=function(e){return rO(e)&&Math.floor(e)===e},aO=function(e){if(XD!==`undefined`)return e!=null&&e instanceof HTMLElement},oO=function(e){return sO(e)||cO(e)},sO=function(e){return ZD(e)===`collection`&&e._private.single},cO=function(e){return ZD(e)===`collection`&&!e._private.single},lO=function(e){return ZD(e)===`core`},uO=function(e){return ZD(e)===`stylesheet`},dO=function(e){return ZD(e)===`event`},fO=function(e){return e==null||!!(e===``||e.match(/^\s+$/))},pO=function(e){return typeof HTMLElement>`u`?!1:e instanceof HTMLElement},mO=function(e){return tO(e)&&rO(e.x1)&&rO(e.x2)&&rO(e.y1)&&rO(e.y2)},hO=function(e){return nO(e)&&$D(e.then)},gO=function(){return KD&&KD.userAgent.match(/msie|trident|edge/i)},_O=function(e,t){t||=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return`undefined`;for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);return e.join(`$`)};var n=function(){var r=this,i=arguments,a,o=t.apply(r,i),s=n.cache;return(a=s[o])||(a=s[o]=e.apply(r,i)),a};return n.cache={},n},vO=_O(function(e){return e.replace(/([A-Z])/g,function(e){return`-`+e.toLowerCase()})}),yO=_O(function(e){return e.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),bO=_O(function(e,t){return e+t[0].toUpperCase()+t.substring(1)},function(e,t){return e+`$`+t}),xO=function(e){return fO(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},SO=function(e,t){return e.slice(-1*t.length)===t},CO=`(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))`,wO=`rgb[a]?\\((`+CO+`[%]?)\\s*,\\s*(`+CO+`[%]?)\\s*,\\s*(`+CO+`[%]?)(?:\\s*,\\s*(`+CO+`))?\\)`,TO=`rgb[a]?\\((?:`+CO+`[%]?)\\s*,\\s*(?:`+CO+`[%]?)\\s*,\\s*(?:`+CO+`[%]?)(?:\\s*,\\s*(?:`+CO+`))?\\)`,EO=`hsl[a]?\\((`+CO+`)\\s*,\\s*(`+CO+`[%])\\s*,\\s*(`+CO+`[%])(?:\\s*,\\s*(`+CO+`))?\\)`,DO=`hsl[a]?\\((?:`+CO+`)\\s*,\\s*(?:`+CO+`[%])\\s*,\\s*(?:`+CO+`[%])(?:\\s*,\\s*(?:`+CO+`))?\\)`,OO=`\\#[0-9a-fA-F]{3}`,kO=`\\#[0-9a-fA-F]{6}`,AO=function(e,t){return e<t?-1:+(e>t)},jO=function(e,t){return-1*AO(e,t)},MO=Object.assign==null?function(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];if(r!=null)for(var i=Object.keys(r),a=0;a<i.length;a++){var o=i[a];e[o]=r[o]}}return e}:Object.assign.bind(Object),NO=function(e){if(!(e.length!==4&&e.length!==7||e[0]!==`#`)){var t=e.length===4,n,r,i,a=16;return t?(n=parseInt(e[1]+e[1],a),r=parseInt(e[2]+e[2],a),i=parseInt(e[3]+e[3],a)):(n=parseInt(e[1]+e[2],a),r=parseInt(e[3]+e[4],a),i=parseInt(e[5]+e[6],a)),[n,r,i]}},PO=function(e){var t,n,r,i,a,o,s,l;function u(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var d=RegExp(`^`+EO+`$`).exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,r=parseFloat(d[2]),r<0||r>100||(r/=100,i=parseFloat(d[3]),i<0||i>100)||(i/=100,a=d[4],a!==void 0&&(a=parseFloat(a),a<0||a>1)))return;if(r===0)o=s=l=Math.round(i*255);else{var f=i<.5?i*(1+r):i+r-i*r,p=2*i-f;o=Math.round(255*u(p,f,n+1/3)),s=Math.round(255*u(p,f,n)),l=Math.round(255*u(p,f,n-1/3))}t=[o,s,l,a]}return t},FO=function(e){var t,n=RegExp(`^`+wO+`$`).exec(e);if(n){t=[];for(var r=[],i=1;i<=3;i++){var a=n[i];if(a[a.length-1]===`%`&&(r[i]=!0),a=parseFloat(a),r[i]&&(a=a/100*255),a<0||a>255)return;t.push(Math.floor(a))}var o=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(o&&!s)return;var l=n[4];if(l!==void 0){if(l=parseFloat(l),l<0||l>1)return;t.push(l)}}return t},IO=function(e){return RO[e.toLowerCase()]},LO=function(e){return(eO(e)?e:null)||IO(e)||NO(e)||FO(e)||PO(e)},RO={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},zO=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var a=n[i];if(tO(a))throw Error(`Tried to set map with object key`);i<n.length-1?(t[a]??(t[a]={}),t=t[a]):t[a]=e.value}},BO=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var a=n[i];if(tO(a))throw Error(`Tried to get map with object key`);if(t=t[a],t==null)return t}return t},VO=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{},gk=SE(iFe()),_k=GD?GD.performance:null,vk=_k&&_k.now?function(){return _k.now()}:function(){return Date.now()},yk=function(){if(GD){if(GD.requestAnimationFrame)return function(e){GD.requestAnimationFrame(e)};if(GD.mozRequestAnimationFrame)return function(e){GD.mozRequestAnimationFrame(e)};if(GD.webkitRequestAnimationFrame)return function(e){GD.webkitRequestAnimationFrame(e)};if(GD.msRequestAnimationFrame)return function(e){GD.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout(function(){e(vk())},1e3/60)}}(),bk=function(e){return yk(e)},xk=vk,Sk=9261,Ck=65599,wk=5381,Tk=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Sk,n;n=e.next(),!n.done;)t=t*Ck+n.value|0;return t},Ek=function(e){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:Sk)*Ck+e|0},Dk=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:wk;return(t<<5)+t+e|0},Ok=function(e,t){return e*2097152+t},kk=function(e){return e[0]*2097152+e[1]},Ak=function(e,t){return[Ek(e[0],t[0]),Dk(e[1],t[1])]},jk=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return Tk({next:function(){return r<i?n.value=e[r++]:n.done=!0,n}},t)},Mk=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return Tk({next:function(){return r<i?n.value=e.charCodeAt(r++):n.done=!0,n}},t)},Nk=function(){return Pk(arguments)},Pk=function(e){for(var t,n=0;n<e.length;n++){var r=e[n];t=n===0?Mk(r):Mk(r,t)}return t},Fk=function(e,t,n,r,i,a){return{x:(e-n)*i+n,y:(t-r)*a+r}},Ik=!0,Lk=console.warn!=null,Rk=console.trace!=null,zk=2**53-1||9007199254740991,Bk=function(){return!0},Vk=function(){return!1},Hk=function(){return 0},Uk=function(){},Wk=function(e){throw Error(e)},Gk=function(e){if(e!==void 0)Ik=!!e;else return Ik},Kk=function(e){Gk()&&(Lk?console.warn(e):(console.log(e),Rk&&console.trace()))},qk=function(e){return MO({},e)},Jk=function(e){return e==null?e:eO(e)?e.slice():tO(e)?qk(e):e},Yk=function(e){return e.slice()},Xk=function(e,t){for(t=e=``;e++<36;t+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):`-`);return t},Zk={},Qk=function(){return Zk},$k=function(e){var t=Object.keys(e);return function(n){for(var r={},i=0;i<t.length;i++){var a=t[i],o=n?.[a];r[a]=o===void 0?e[a]:o}return r}},eA=function(e,t,n){for(var r=e.length-1;r>=0;r--)e[r]===t&&e.splice(r,1)},tA=function(e){e.splice(0,e.length)},nA=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.push(r)}},rA=function(e,t,n){return n&&(t=bO(n,t)),e[t]},iA=function(e,t,n,r){n&&(t=bO(n,t)),e[t]=r},aA=typeof Map<`u`?Map:function(){function e(){mE(this,e),this._obj={}}return hE(e,[{key:`set`,value:function(e,t){return this._obj[e]=t,this}},{key:`delete`,value:function(e){return this._obj[e]=void 0,this}},{key:`clear`,value:function(){this._obj={}}},{key:`has`,value:function(e){return this._obj[e]!==void 0}},{key:`get`,value:function(e){return this._obj[e]}}])}(),oA=`undefined`,sA=function(){function e(t){if(mE(this,e),this._obj=Object.create(null),this.size=0,t!=null)for(var n=t.instanceString!=null&&t.instanceString()===this.instanceString()?t.toArray():t,r=0;r<n.length;r++)this.add(n[r])}return hE(e,[{key:`instanceString`,value:function(){return`set`}},{key:`add`,value:function(e){var t=this._obj;t[e]!==1&&(t[e]=1,this.size++)}},{key:`delete`,value:function(e){var t=this._obj;t[e]===1&&(t[e]=0,this.size--)}},{key:`clear`,value:function(){this._obj=Object.create(null)}},{key:`has`,value:function(e){return this._obj[e]===1}},{key:`toArray`,value:function(){var e=this;return Object.keys(this._obj).filter(function(t){return e.has(t)})}},{key:`forEach`,value:function(e,t){return this.toArray().forEach(e,t)}}])}(),cA=(typeof Set>`u`?`undefined`:bE(Set))===oA?sA:Set,lA=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||t===void 0||!lO(e)){Wk(`An element must have a core reference and parameters set`);return}var r=t.group;if(r??=t.data&&t.data.source!=null&&t.data.target!=null?`edges`:`nodes`,r!==`nodes`&&r!==`edges`){Wk("An element must be of type `nodes` or `edges`; you specified `"+r+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:t.selectable===void 0||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:t.grabbable===void 0||!!t.grabbable,pannable:t.pannable===void 0?r===`edges`:!!t.pannable,active:!1,classes:new cA,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x??(i.position.x=0),i.position.y??(i.position.y=0),t.renderedPosition){var a=t.renderedPosition,o=e.pan(),s=e.zoom();i.position={x:(a.x-o.x)/s,y:(a.y-o.y)/s}}var l=[];eO(t.classes)?l=t.classes:QD(t.classes)&&(l=t.classes.split(/\s+/));for(var u=0,d=l.length;u<d;u++){var f=l[u];!f||f===``||i.classes.add(f)}this.createEmitter(),(n===void 0||n)&&this.restore();var p=t.style||t.css;p&&(Kk("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(p))},uA=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,r){var i;tO(t)&&!oO(t)&&(i=t,t=i.roots||i.root,n=i.visit,r=i.directed),r=arguments.length===2&&!$D(n)?n:r,n=$D(n)?n:function(){};for(var a=this._private.cy,o=t=QD(t)?this.filter(t):t,s=[],l=[],u={},d={},f={},p=0,m,h=this.byGroup(),g=h.nodes,_=h.edges,v=0;v<o.length;v++){var y=o[v],b=y.id();y.isNode()&&(s.unshift(y),e.bfs&&(f[b]=!0,l.push(y)),d[b]=0)}for(var x=function(){var t=e.bfs?s.shift():s.pop(),i=t.id();if(e.dfs){if(f[i])return 0;f[i]=!0,l.push(t)}var a=d[i],o=u[i],h=o==null?null:o.source(),v=o==null?null:o.target(),y=o==null?void 0:t.same(h)?v[0]:h[0],b=n(t,o,y,p++,a);if(b===!0)return m=t,1;if(b===!1)return 1;for(var x=t.connectedEdges().filter(function(e){return(!r||e.source().same(t))&&_.has(e)}),S=0;S<x.length;S++){var C=x[S],w=C.connectedNodes().filter(function(e){return!e.same(t)&&g.has(e)}),T=w.id();w.length!==0&&!f[T]&&(w=w[0],s.push(w),e.bfs&&(f[T]=!0,l.push(w)),u[T]=C,d[T]=d[i]+1)}},S;s.length!==0&&(S=x(),S===0||S!==1););for(var C=a.collection(),w=0;w<l.length;w++){var T=l[w],E=u[T.id()];E!=null&&C.push(E),C.push(T)}return{path:a.collection(C),found:a.collection(m)}}},dA={breadthFirstSearch:uA({bfs:!0}),depthFirstSearch:uA({dfs:!0})},dA.bfs=dA.breadthFirstSearch,dA.dfs=dA.depthFirstSearch,fA={exports:{}},pA=fA.exports,hA=SE(cFe()),LIe=$k({root:null,weight:function(e){return 1},directed:!1}),RIe={dijkstra:function(e){if(!tO(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=LIe(e),r=n.root,i=n.weight,a=n.directed,o=this,s=i,l=QD(r)?this.filter(r)[0]:r[0],u={},d={},f={},p=this.byGroup(),m=p.nodes,h=p.edges;h.unmergeBy(function(e){return e.isLoop()});for(var g=function(e){return u[e.id()]},_=function(e,t){u[e.id()]=t,v.updateItem(e)},v=new hA(function(e,t){return g(e)-g(t)}),y=0;y<m.length;y++){var b=m[y];u[b.id()]=b.same(l)?0:1/0,v.push(b)}for(var x=function(e,t){for(var n=(a?e.edgesTo(t):e.edgesWith(t)).intersect(h),r=1/0,i,o=0;o<n.length;o++){var l=n[o],u=s(l);(u<r||!i)&&(r=u,i=l)}return{edge:i,dist:r}};v.size()>0;){var S=v.pop(),C=g(S),w=S.id();if(f[w]=C,C!==1/0)for(var T=S.neighborhood().intersect(m),E=0;E<T.length;E++){var D=T[E],O=D.id(),k=x(S,D),A=C+k.dist;A<g(D)&&(_(D,A),d[O]={node:S,edge:k.edge})}}return{distanceTo:function(e){return f[(QD(e)?m.filter(e)[0]:e[0]).id()]},pathTo:function(e){var t=QD(e)?m.filter(e)[0]:e[0],n=[],r=t,i=r.id();if(t.length>0)for(n.unshift(t);d[i];){var a=d[i];n.unshift(a.edge),n.unshift(a.node),r=a.node,i=r.id()}return o.spawn(n)}}}},zIe={kruskal:function(e){e||=function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,a=Array(i),o=n,s=function(e){for(var t=0;t<a.length;t++)if(a[t].has(e))return t},l=0;l<i;l++)a[l]=this.spawn(n[l]);for(var u=r.sort(function(t,n){return e(t)-e(n)}),d=0;d<u.length;d++){var f=u[d],p=f.source()[0],m=f.target()[0],h=s(p),g=s(m),_=a[h],v=a[g];h!==g&&(o.merge(f),_.merge(v),a.splice(g,1))}return o}},BIe=$k({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),VIe={aStar:function(e){var t=this.cy(),n=BIe(e),r=n.root,i=n.goal,a=n.heuristic,o=n.directed,s=n.weight;r=t.collection(r)[0],i=t.collection(i)[0];var l=r.id(),u=i.id(),d={},f={},p={},m=new hA(function(e,t){return f[e.id()]-f[t.id()]}),h=new cA,g={},_={},v=function(e,t){m.push(e),h.add(t)},y,b,x=function(){y=m.pop(),b=y.id(),h.delete(b)},S=function(e){return h.has(e)};v(r,l),d[l]=0,f[l]=a(r);for(var C=0;m.size()>0;){if(x(),C++,b===u){for(var w=[],T=i,E=u,D=_[E];w.unshift(T),D!=null&&w.unshift(D),T=g[E],T!=null;)E=T.id(),D=_[E];return{found:!0,distance:d[b],path:this.spawn(w),steps:C}}p[b]=!0;for(var O=y._private.edges,k=0;k<O.length;k++){var A=O[k];if(this.hasElementWithId(A.id())&&!(o&&A.data(`source`)!==b)){var j=A.source(),M=A.target(),N=j.id()===b?M:j,P=N.id();if(this.hasElementWithId(P)&&!p[P]){var F=d[b]+s(A);if(!S(P)){d[P]=F,f[P]=F+a(N),v(N,P),g[P]=y,_[P]=A;continue}F<d[P]&&(d[P]=F,f[P]=F+a(N),m.updateItem(N),g[P]=y,_[P]=A)}}}}return{found:!1,distance:void 0,path:void 0,steps:C}}},HIe=$k({weight:function(e){return 1},directed:!1}),UIe={floydWarshall:function(e){for(var t=this.cy(),n=HIe(e),r=n.weight,i=n.directed,a=r,o=this.byGroup(),s=o.nodes,l=o.edges,u=s.length,d=u*u,f=function(e){return s.indexOf(e)},p=function(e){return s[e]},m=Array(d),h=0;h<d;h++){var g=h%u;(h-g)/u===g?m[h]=0:m[h]=1/0}for(var _=Array(d),v=Array(d),y=0;y<l.length;y++){var b=l[y],x=b.source()[0],S=b.target()[0];if(x!==S){var C=f(x),w=f(S),T=C*u+w,E=a(b);if(m[T]>E&&(m[T]=E,_[T]=w,v[T]=b),!i){var D=w*u+C;!i&&m[D]>E&&(m[D]=E,_[D]=C,v[D]=b)}}}for(var O=0;O<u;O++)for(var k=0;k<u;k++)for(var A=k*u+O,j=0;j<u;j++){var M=k*u+j,N=O*u+j;m[A]+m[N]<m[M]&&(m[M]=m[A]+m[N],_[M]=_[A])}var P=function(e){return(QD(e)?t.filter(e):e)[0]},F=function(e){return f(P(e))};return{distance:function(e,t){var n=F(e),r=F(t);return m[n*u+r]},path:function(e,n){var r=F(e),i=F(n),a=p(r);if(r===i)return a.collection();if(_[r*u+i]==null)return t.collection();var o=t.collection(),s=r,l;for(o.merge(a);r!==i;)s=r,r=_[r*u+i],l=v[s*u+r],o.merge(l),o.merge(p(r));return o}}}},WIe=$k({weight:function(e){return 1},directed:!1,root:null}),GIe={bellmanFord:function(e){var t=this,n=WIe(e),r=n.weight,i=n.directed,a=n.root,o=r,s=this,l=this.cy(),u=this.byGroup(),d=u.edges,f=u.nodes,p=f.length,m=new aA,h=!1,g=[];a=l.collection(a)[0],d.unmergeBy(function(e){return e.isLoop()});for(var _=d.length,v=function(e){var t=m.get(e.id());return t||(t={},m.set(e.id(),t)),t},y=function(e){return(QD(e)?l.$(e):e)[0]},b=function(e){return v(y(e)).dist},x=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:a,r=y(e),i=[],o=r;;){if(o==null)return t.spawn();var l=v(o),u=l.edge,d=l.pred;if(i.unshift(o[0]),o.same(n)&&i.length>0)break;u!=null&&i.unshift(u),o=d}return s.spawn(i)},S=0;S<p;S++){var C=f[S],w=v(C);w.dist=C.same(a)?0:1/0,w.pred=null,w.edge=null}for(var T=!1,E=function(e,t,n,r,i,a){var o=r.dist+a;o<i.dist&&!n.same(r.edge)&&(i.dist=o,i.pred=e,i.edge=n,T=!0)},D=1;D<p;D++){T=!1;for(var O=0;O<_;O++){var k=d[O],A=k.source(),j=k.target(),M=o(k),N=v(A),P=v(j);E(A,j,k,N,P,M),i||E(j,A,k,P,N,M)}if(!T)break}if(T)for(var F=[],I=0;I<_;I++){var L=d[I],R=L.source(),ee=L.target(),z=o(L),B=v(R).dist,te=v(ee).dist;if(B+z<te||!i&&te+z<B){if(h||=(Kk(`Graph contains a negative weight cycle for Bellman-Ford`),!0),e.findNegativeWeightCycles!==!1){var ne=[];B+z<te&&ne.push(R),!i&&te+z<B&&ne.push(ee);for(var re=ne.length,ie=0;ie<re;ie++){var ae=ne[ie],oe=[ae];oe.push(v(ae).edge);for(var se=v(ae).pred;oe.indexOf(se)===-1;)oe.push(se),oe.push(v(se).edge),se=v(se).pred;oe=oe.slice(oe.indexOf(se));for(var ce=oe[0].id(),le=0,ue=2;ue<oe.length;ue+=2)oe[ue].id()<ce&&(ce=oe[ue].id(),le=ue);oe=oe.slice(le).concat(oe.slice(0,le)),oe.push(oe[0]);var de=oe.map(function(e){return e.id()}).join(`,`);F.indexOf(de)===-1&&(g.push(s.spawn(oe)),F.push(de))}}else break}}return{distanceTo:b,pathTo:x,hasNegativeWeightCycle:h,negativeWeightCycles:g}}},KIe=Math.sqrt(2),qIe=function(e,t,n){n.length===0&&Wk(`Karger-Stein must be run on a connected (sub)graph`);for(var r=n[e],i=r[1],a=r[2],o=t[i],s=t[a],l=n,u=l.length-1;u>=0;u--){var d=l[u],f=d[1],p=d[2];(t[f]===o&&t[p]===s||t[f]===s&&t[p]===o)&&l.splice(u,1)}for(var m=0;m<l.length;m++){var h=l[m];h[1]===s?(l[m]=h.slice(),l[m][1]=o):h[2]===s&&(l[m]=h.slice(),l[m][2]=o)}for(var g=0;g<t.length;g++)t[g]===s&&(t[g]=o);return l},gA=function(e,t,n,r){for(;n>r;)t=qIe(Math.floor(Math.random()*t.length),e,t),n--;return t},JIe={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy(function(e){return e.isLoop()});var i=n.length,a=r.length,o=Math.ceil((Math.log(i)/Math.LN2)**2),s=Math.floor(i/KIe);if(i<2){Wk(`At least 2 nodes are required for Karger-Stein algorithm`);return}for(var l=[],u=0;u<a;u++){var d=r[u];l.push([u,n.indexOf(d.source()),n.indexOf(d.target())])}for(var f=1/0,p=[],m=Array(i),h=Array(i),g=Array(i),_=function(e,t){for(var n=0;n<i;n++)t[n]=e[n]},v=0;v<=o;v++){for(var y=0;y<i;y++)h[y]=y;var b=gA(h,l.slice(),i,s),x=b.slice();_(h,g);var S=gA(h,b,s,2),C=gA(g,x,s,2);S.length<=C.length&&S.length<f?(f=S.length,p=S,_(h,m)):C.length<=S.length&&C.length<f&&(f=C.length,p=C,_(g,m))}for(var w=this.spawn(p.map(function(e){return r[e[0]]})),T=this.spawn(),E=this.spawn(),D=m[0],O=0;O<m.length;O++){var k=m[O],A=n[O];k===D?T.merge(A):E.merge(A)}var j=function(t){var n=e.spawn();return t.forEach(function(t){n.merge(t),t.connectedEdges().forEach(function(t){e.contains(t)&&!w.contains(t)&&n.merge(t)})}),n};return{cut:w,components:[j(T),j(E)],partition1:T,partition2:E}}},YIe=function(e){return{x:e.x,y:e.y}},_A=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},vA=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},yA=function(e){return{x:e[0],y:e[1]}},XIe=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,r=1/0,i=t;i<n;i++){var a=e[i];isFinite(a)&&(r=Math.min(a,r))}return r},ZIe=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,r=-1/0,i=t;i<n;i++){var a=e[i];isFinite(a)&&(r=Math.max(a,r))}return r},QIe=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,r=0,i=0,a=t;a<n;a++){var o=e[a];isFinite(o)&&(r+=o,i++)}return r/i},$Ie=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;r?e=e.slice(t,n):(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t));for(var o=0,s=e.length-1;s>=0;s--){var l=e[s];a?isFinite(l)||(e[s]=-1/0,o++):e.splice(s,1)}i&&e.sort(function(e,t){return e-t});var u=e.length,d=Math.floor(u/2);return u%2==0?(e[d-1+o]+e[d+o])/2:e[d+1+o]},bA=function(e,t){return t===0?e:bA(t,e%t)},eLe=function(e){for(var t=e[0],n=0;n<e.length;n++)if(iO(e[n]))n>0&&(t=bA(t,e[n]));else return 0;return t},tLe=function(e){return Math.PI*e/180},xA=function(e,t){return Math.atan2(t,e)-Math.PI/2},SA=Math.log2||function(e){return Math.log(e)/Math.log(2)},CA=function(e){return e>0?1:e<0?-1:0},wA=function(e,t){return Math.sqrt(TA(e,t))},TA=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},nLe=function(e){for(var t=e.length,n=0,r=0;r<t;r++)n+=e[r];for(var i=0;i<t;i++)e[i]=e[i]/n;return e},EA=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},DA=function(e,t,n,r){return{x:EA(e.x,t.x,n.x,r),y:EA(e.y,t.y,n.y,r)}},rLe=function(e,t,n,r){var i={x:t.x-e.x,y:t.y-e.y},a=wA(e,t),o={x:i.x/a,y:i.y/a};return n??=0,r??=n*a,{x:e.x+o.x*r,y:e.y+o.y*r}},OA=function(e,t,n){return Math.max(e,Math.min(n,t))},kA=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},iLe=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},aLe=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},oLe=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},AA=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},jA=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},MA=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,r,i,a;if(t.length===1)n=r=i=a=t[0];else if(t.length===2)n=i=t[0],a=r=t[1];else if(t.length===4){var o=_E(t,4);n=o[0],r=o[1],i=o[2],a=o[3]}return e.x1-=a,e.x2+=r,e.y1-=n,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},NA=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},PA=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2<t.x1||t.x2<e.x1||e.y2<t.y1||t.y2<e.y1||e.y1>t.y2||t.y1>e.y2)},FA=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},IA=function(e,t){return FA(e,t.x,t.y)},LA=function(e,t){return FA(e,t.x1,t.y1)&&FA(e,t.x2,t.y2)},sLe=Math.hypot??function(e,t){return Math.sqrt(e*e+t*t)},RA=function(e,t,n,r,i,a,o){var s=arguments.length>7&&arguments[7]!==void 0?arguments[7]:`auto`,l=s===`auto`?QA(i,a):s,u=i/2,d=a/2;l=Math.min(l,u,d);var f=l!==u,p=l!==d,m;if(f){var h=n-u+l-o,g=r-d-o;if(m=KA(e,t,n,r,h,g,n+u-l+o,g,!1),m.length>0)return m}if(p){var _=n+u+o;if(m=KA(e,t,n,r,_,r-d+l-o,_,r+d-l+o,!1),m.length>0)return m}if(f){var v=n-u+l-o,y=r+d+o;if(m=KA(e,t,n,r,v,y,n+u-l+o,y,!1),m.length>0)return m}if(p){var b=n-u-o;if(m=KA(e,t,n,r,b,r-d+l-o,b,r+d-l+o,!1),m.length>0)return m}var x,S=n-u+l,C=r-d+l;if(x=WA(e,t,n,r,S,C,l+o),x.length>0&&x[0]<=S&&x[1]<=C)return[x[0],x[1]];var w=n+u-l,T=r-d+l;if(x=WA(e,t,n,r,w,T,l+o),x.length>0&&x[0]>=w&&x[1]<=T)return[x[0],x[1]];var E=n+u-l,D=r+d-l;if(x=WA(e,t,n,r,E,D,l+o),x.length>0&&x[0]>=E&&x[1]>=D)return[x[0],x[1]];var O=n-u+l,k=r+d-l;return x=WA(e,t,n,r,O,k,l+o),x.length>0&&x[0]<=O&&x[1]>=k?[x[0],x[1]]:[]},cLe=function(e,t,n,r,i,a,o){var s=o,l=Math.min(n,i),u=Math.max(n,i),d=Math.min(r,a),f=Math.max(r,a);return l-s<=e&&e<=u+s&&d-s<=t&&t<=f+s},lLe=function(e,t,n,r,i,a,o,s,l){var u={x1:Math.min(n,o,i)-l,x2:Math.max(n,o,i)+l,y1:Math.min(r,s,a)-l,y2:Math.max(r,s,a)+l};return!(e<u.x1||e>u.x2||t<u.y1||t>u.y2)},uLe=function(e,t,n,r){n-=r;var i=t*t-4*e*n;if(i<0)return[];var a=Math.sqrt(i),o=2*e;return[(-t+a)/o,(-t-a)/o]},dLe=function(e,t,n,r,i){e===0&&(e=1e-5),t/=e,n/=e,r/=e;var a,o=(3*n-t*t)/9,s=-(27*r)+t*(9*n-t*t*2),l,u,d,f,p;if(s/=54,a=o*o*o+s*s,i[1]=0,f=t/3,a>0){u=s+Math.sqrt(a),u=u<0?-((-u)**(1/3)):u**(1/3),d=s-Math.sqrt(a),d=d<0?-((-d)**(1/3)):d**(1/3),i[0]=-f+u+d,f+=(u+d)/2,i[4]=i[2]=-f,f=Math.sqrt(3)*(-d+u)/2,i[3]=f,i[5]=-f;return}if(i[5]=i[3]=0,a===0){p=s<0?-((-s)**(1/3)):s**(1/3),i[0]=-f+2*p,i[4]=i[2]=-(p+f);return}o=-o,l=o*o*o,l=Math.acos(s/Math.sqrt(l)),p=2*Math.sqrt(o),i[0]=-f+p*Math.cos(l/3),i[2]=-f+p*Math.cos((l+2*Math.PI)/3),i[4]=-f+p*Math.cos((l+4*Math.PI)/3)},fLe=function(e,t,n,r,i,a,o,s){var l=1*n*n-4*n*i+2*n*o+4*i*i-4*i*o+o*o+r*r-4*r*a+2*r*s+4*a*a-4*a*s+s*s,u=9*n*i-3*n*n-3*n*o-6*i*i+3*i*o+9*r*a-3*r*r-3*r*s-6*a*a+3*a*s,d=3*n*n-6*n*i+n*o-n*e+2*i*i+2*i*e-o*e+3*r*r-6*r*a+r*s-r*t+2*a*a+2*a*t-s*t,f=1*n*i-n*n+n*e-i*e+r*a-r*r+r*t-a*t,p=[];dLe(l,u,d,f,p);for(var m=1e-7,h=[],g=0;g<6;g+=2)Math.abs(p[g+1])<m&&p[g]>=0&&p[g]<=1&&h.push(p[g]);h.push(1),h.push(0);for(var _=-1,v,y,b,x=0;x<h.length;x++)v=(1-h[x])**2*n+2*(1-h[x])*h[x]*i+h[x]*h[x]*o,y=(1-h[x])**2*r+2*(1-h[x])*h[x]*a+h[x]*h[x]*s,b=(v-e)**2+(y-t)**2,_>=0?b<_&&(_=b):_=b;return _},pLe=function(e,t,n,r,i,a){var o=[e-n,t-r],s=[i-n,a-r],l=s[0]*s[0]+s[1]*s[1],u=o[0]*o[0]+o[1]*o[1],d=o[0]*s[0]+o[1]*s[1],f=d*d/l;return d<0?u:f>l?(e-i)*(e-i)+(t-a)*(t-a):u-f},zA=function(e,t,n){for(var r,i,a,o,s,l=0,u=0;u<n.length/2;u++)if(r=n[u*2],i=n[u*2+1],u+1<n.length/2?(a=n[(u+1)*2],o=n[(u+1)*2+1]):(a=n[(u+1-n.length/2)*2],o=n[(u+1-n.length/2)*2+1]),r!=e||a!=e){if(r>=e&&e>=a||r<=e&&e<=a)s=(e-r)/(a-r)*(o-i)+i,s>t&&l++;else continue}return l%2!=0},BA=function(e,t,n,r,i,a,o,s,l){var u=Array(n.length),d;s[0]==null?d=s:(d=Math.atan(s[1]/s[0]),s[0]<0?d+=Math.PI/2:d=-d-Math.PI/2);for(var f=Math.cos(-d),p=Math.sin(-d),m=0;m<u.length/2;m++)u[m*2]=a/2*(n[m*2]*f-n[m*2+1]*p),u[m*2+1]=o/2*(n[m*2+1]*f+n[m*2]*p),u[m*2]+=r,u[m*2+1]+=i;var h=l>0?VA(HA(u,-l)):u;return zA(e,t,h)},mLe=function(e,t,n,r,i,a,o,s){for(var l=Array(n.length*2),u=0;u<s.length;u++){var d=s[u];if(l[u*4+0]=d.startX,l[u*4+1]=d.startY,l[u*4+2]=d.stopX,l[u*4+3]=d.stopY,(d.cx-e)**2+(d.cy-t)**2<=d.radius**2)return!0}return zA(e,t,l)},VA=function(e){for(var t=Array(e.length/2),n,r,i,a,o,s,l,u,d=0;d<e.length/4;d++){n=e[d*4],r=e[d*4+1],i=e[d*4+2],a=e[d*4+3],d<e.length/4-1?(o=e[(d+1)*4],s=e[(d+1)*4+1],l=e[(d+1)*4+2],u=e[(d+1)*4+3]):(o=e[0],s=e[1],l=e[2],u=e[3]);var f=KA(n,r,i,a,o,s,l,u,!0);t[d*2]=f[0],t[d*2+1]=f[1]}return t},HA=function(e,t){for(var n=Array(e.length*2),r,i,a,o,s=0;s<e.length/2;s++){r=e[s*2],i=e[s*2+1],s<e.length/2-1?(a=e[(s+1)*2],o=e[(s+1)*2+1]):(a=e[0],o=e[1]);var l=o-i,u=-(a-r),d=Math.sqrt(l*l+u*u),f=l/d,p=u/d;n[s*4]=r+f*t,n[s*4+1]=i+p*t,n[s*4+2]=a+f*t,n[s*4+3]=o+p*t}return n},hLe=function(e,t,n,r,i,a){var o=n-e,s=r-t;o/=i,s/=a;var l=Math.sqrt(o*o+s*s),u=l-1;if(u<0)return[];var d=u/l;return[(n-e)*d+e,(r-t)*d+t]},UA=function(e,t,n,r,i,a,o){return e-=i,t-=a,e/=n/2+o,t/=r/2+o,e*e+t*t<=1},WA=function(e,t,n,r,i,a,o){var s=[n-e,r-t],l=[e-i,t-a],u=s[0]*s[0]+s[1]*s[1],d=2*(l[0]*s[0]+l[1]*s[1]),f=l[0]*l[0]+l[1]*l[1]-o*o,p=d*d-4*u*f;if(p<0)return[];var m=(-d+Math.sqrt(p))/(2*u),h=(-d-Math.sqrt(p))/(2*u),g=Math.min(m,h),_=Math.max(m,h),v=[];if(g>=0&&g<=1&&v.push(g),_>=0&&_<=1&&v.push(_),v.length===0)return[];var y=v[0]*s[0]+e,b=v[0]*s[1]+t;return v.length>1?v[0]==v[1]?[y,b]:[y,b,v[1]*s[0]+e,v[1]*s[1]+t]:[y,b]},GA=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},KA=function(e,t,n,r,i,a,o,s,l){var u=e-i,d=n-e,f=o-i,p=t-a,m=r-t,h=s-a,g=f*p-h*u,_=d*p-m*u,v=h*d-f*m;if(v!==0){var y=g/v,b=_/v,x=.001,S=0-x,C=1+x;return S<=y&&y<=C&&S<=b&&b<=C||l?[e+y*d,t+y*m]:[]}return g===0||_===0?GA(e,n,o)===o?[o,s]:GA(e,n,i)===i?[i,a]:GA(i,o,n)===n?[n,r]:[]:[]},gLe=function(e,t,n,r,i){var a=[],o=r/2,s=i/2,l=t,u=n;a.push({x:l+o*e[0],y:u+s*e[1]});for(var d=1;d<e.length/2;d++)a.push({x:l+o*e[d*2],y:u+s*e[d*2+1]});return a},qA=function(e,t,n,r,i,a,o,s){var l=[],u,d=Array(n.length),f=!0;a??(f=!1);var p;if(f){for(var m=0;m<d.length/2;m++)d[m*2]=n[m*2]*a+r,d[m*2+1]=n[m*2+1]*o+i;p=s>0?VA(HA(d,-s)):d}else p=n;for(var h,g,_,v,y=0;y<p.length/2;y++)h=p[y*2],g=p[y*2+1],y<p.length/2-1?(_=p[(y+1)*2],v=p[(y+1)*2+1]):(_=p[0],v=p[1]),u=KA(e,t,r,i,h,g,_,v),u.length!==0&&l.push(u[0],u[1]);return l},_Le=function(e,t,n,r,i,a,o,s,l){var u=[],d,f=Array(n.length*2);l.forEach(function(n,a){a===0?(f[f.length-2]=n.startX,f[f.length-1]=n.startY):(f[a*4-2]=n.startX,f[a*4-1]=n.startY),f[a*4]=n.stopX,f[a*4+1]=n.stopY,d=WA(e,t,r,i,n.cx,n.cy,n.radius),d.length!==0&&u.push(d[0],d[1])});for(var p=0;p<f.length/4;p++)d=KA(e,t,r,i,f[p*4],f[p*4+1],f[p*4+2],f[p*4+3],!1),d.length!==0&&u.push(d[0],d[1]);if(u.length>2){for(var m=[u[0],u[1]],h=(m[0]-e)**2+(m[1]-t)**2,g=1;g<u.length/2;g++){var _=(u[g*2]-e)**2+(u[g*2+1]-t)**2;_<=h&&(m[0]=u[g*2],m[1]=u[g*2+1],h=_)}return m}return u},JA=function(e,t,n){var r=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(r[0]*r[0]+r[1]*r[1]),a=(i-n)/i;return a<0&&(a=1e-5),[t[0]+a*r[0],t[1]+a*r[1]]},YA=function(e,t){var n=ZA(e,t);return n=XA(n),n},XA=function(e){for(var t,n,r=e.length/2,i=1/0,a=1/0,o=-1/0,s=-1/0,l=0;l<r;l++)t=e[2*l],n=e[2*l+1],i=Math.min(i,t),o=Math.max(o,t),a=Math.min(a,n),s=Math.max(s,n);for(var u=2/(o-i),d=2/(s-a),f=0;f<r;f++)t=e[2*f]=e[2*f]*u,n=e[2*f+1]=e[2*f+1]*d,i=Math.min(i,t),o=Math.max(o,t),a=Math.min(a,n),s=Math.max(s,n);if(a<-1)for(var p=0;p<r;p++)n=e[2*p+1]=e[2*p+1]+(-1-a);return e},ZA=function(e,t){var n=1/e*2*Math.PI,r=e%2==0?Math.PI/2+n/2:Math.PI/2;r+=t;for(var i=Array(e*2),a,o=0;o<e;o++)a=o*n+r,i[2*o]=Math.cos(a),i[2*o+1]=Math.sin(-a);return i},QA=function(e,t){return Math.min(e/4,t/4,8)},$A=function(e,t){return Math.min(e/10,t/10,8)},ej=function(){return 8},vLe=function(e,t,n){return[e-2*t+n,2*(t-e),e]},tj=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},yLe=$k({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),bLe={pageRank:function(e){for(var t=yLe(e),n=t.dampingFactor,r=t.precision,i=t.iterations,a=t.weight,o=this._private.cy,s=this.byGroup(),l=s.nodes,u=s.edges,d=l.length,f=d*d,p=u.length,m=Array(f),h=Array(d),g=(1-n)/d,_=0;_<d;_++){for(var v=0;v<d;v++){var y=_*d+v;m[y]=0}h[_]=0}for(var b=0;b<p;b++){var x=u[b],S=x.data(`source`),C=x.data(`target`);if(S!==C){var w=l.indexOfId(S),T=l.indexOfId(C),E=a(x),D=T*d+w;m[D]+=E,h[w]+=E}}for(var O=1/d+g,k=0;k<d;k++)if(h[k]===0)for(var A=0;A<d;A++){var j=A*d+k;m[j]=O}else for(var M=0;M<d;M++){var N=M*d+k;m[N]=m[N]/h[k]+g}for(var P=Array(d),F=Array(d),I,L=0;L<d;L++)P[L]=1;for(var R=0;R<i;R++){for(var ee=0;ee<d;ee++)F[ee]=0;for(var z=0;z<d;z++)for(var B=0;B<d;B++){var te=z*d+B;F[z]+=m[te]*P[B]}nLe(F),I=P,P=F,F=I;for(var ne=0,re=0;re<d;re++){var ie=I[re]-P[re];ne+=ie*ie}if(ne<r)break}return{rank:function(e){return e=o.collection(e)[0],P[l.indexOf(e)]}}}},nj=$k({root:null,weight:function(e){return 1},directed:!1,alpha:0}),rj={degreeCentralityNormalized:function(e){e=nj(e);var t=this.cy(),n=this.nodes(),r=n.length;if(e.directed){for(var i={},a={},o=0,s=0,l=0;l<r;l++){var u=n[l],d=u.id();e.root=u;var f=this.degreeCentrality(e);o<f.indegree&&(o=f.indegree),s<f.outdegree&&(s=f.outdegree),i[d]=f.indegree,a[d]=f.outdegree}return{indegree:function(e){return o==0?0:(QD(e)&&(e=t.filter(e)),i[e.id()]/o)},outdegree:function(e){return s===0?0:(QD(e)&&(e=t.filter(e)),a[e.id()]/s)}}}for(var p={},m=0,h=0;h<r;h++){var g=n[h];e.root=g;var _=this.degreeCentrality(e);m<_.degree&&(m=_.degree),p[g.id()]=_.degree}return{degree:function(e){return m===0?0:(QD(e)&&(e=t.filter(e)),p[e.id()]/m)}}},degreeCentrality:function(e){e=nj(e);var t=this.cy(),n=this,r=e,i=r.root,a=r.weight,o=r.directed,s=r.alpha;if(i=t.collection(i)[0],o){for(var l=i.connectedEdges(),u=l.filter(function(e){return e.target().same(i)&&n.has(e)}),d=l.filter(function(e){return e.source().same(i)&&n.has(e)}),f=u.length,p=d.length,m=0,h=0,g=0;g<u.length;g++)m+=a(u[g]);for(var _=0;_<d.length;_++)h+=a(d[_]);return{indegree:f**(1-s)*m**+s,outdegree:p**(1-s)*h**+s}}for(var v=i.connectedEdges().intersection(n),y=v.length,b=0,x=0;x<v.length;x++)b+=a(v[x]);return{degree:y**(1-s)*b**+s}}},rj.dc=rj.degreeCentrality,rj.dcn=rj.degreeCentralityNormalised=rj.degreeCentralityNormalized,ij=$k({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),aj={closenessCentralityNormalized:function(e){for(var t=ij(e),n=t.harmonic,r=t.weight,i=t.directed,a=this.cy(),o={},s=0,l=this.nodes(),u=this.floydWarshall({weight:r,directed:i}),d=0;d<l.length;d++){for(var f=0,p=l[d],m=0;m<l.length;m++)if(d!==m){var h=u.distance(p,l[m]);f+=n?1/h:h}n||(f=1/f),s<f&&(s=f),o[p.id()]=f}return{closeness:function(e){return s==0?0:(e=QD(e)?a.filter(e)[0].id():e.id(),o[e]/s)}}},closenessCentrality:function(e){var t=ij(e),n=t.root,r=t.weight,i=t.directed,a=t.harmonic;n=this.filter(n)[0];for(var o=this.dijkstra({root:n,weight:r,directed:i}),s=0,l=this.nodes(),u=0;u<l.length;u++){var d=l[u];if(!d.same(n)){var f=o.distanceTo(d);s+=a?1/f:f}}return a?s:1/s}},aj.cc=aj.closenessCentrality,aj.ccn=aj.closenessCentralityNormalised=aj.closenessCentralityNormalized,xLe=$k({weight:null,directed:!1}),oj={betweennessCentrality:function(e){for(var t=xLe(e),n=t.directed,r=t.weight,i=r!=null,a=this.cy(),o=this.nodes(),s={},l={},u=0,d={set:function(e,t){l[e]=t,t>u&&(u=t)},get:function(e){return l[e]}},f=0;f<o.length;f++){var p=o[f],m=p.id();s[m]=n?p.outgoers().nodes():p.openNeighborhood().nodes(),d.set(m,0)}for(var h=function(){for(var e=o[g].id(),t=[],n={},l={},u={},f=new hA(function(e,t){return u[e]-u[t]}),p=0;p<o.length;p++){var m=o[p].id();n[m]=[],l[m]=0,u[m]=1/0}for(l[e]=1,u[e]=0,f.push(e);!f.empty();){var h=f.pop();if(t.push(h),i)for(var _=0;_<s[h].length;_++){var v=s[h][_],y=a.getElementById(h),b=void 0;b=y.edgesTo(v).length>0?y.edgesTo(v)[0]:v.edgesTo(y)[0];var x=r(b);v=v.id(),u[v]>u[h]+x&&(u[v]=u[h]+x,f.nodes.indexOf(v)<0?f.push(v):f.updateItem(v),l[v]=0,n[v]=[]),u[v]==u[h]+x&&(l[v]=l[v]+l[h],n[v].push(h))}else for(var S=0;S<s[h].length;S++){var C=s[h][S].id();u[C]==1/0&&(f.push(C),u[C]=u[h]+1),u[C]==u[h]+1&&(l[C]=l[C]+l[h],n[C].push(h))}}for(var w={},T=0;T<o.length;T++)w[o[T].id()]=0;for(;t.length>0;){for(var E=t.pop(),D=0;D<n[E].length;D++){var O=n[E][D];w[O]=w[O]+l[O]/l[E]*(1+w[E])}E!=o[g].id()&&d.set(E,d.get(E)+w[E])}},g=0;g<o.length;g++)h();var _={betweenness:function(e){var t=a.collection(e).id();return d.get(t)},betweennessNormalized:function(e){if(u==0)return 0;var t=a.collection(e).id();return d.get(t)/u}};return _.betweennessNormalised=_.betweennessNormalized,_}},oj.bc=oj.betweennessCentrality,SLe=$k({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),CLe=function(e){return SLe(e)},wLe=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r](e);return n},TLe=function(e,t,n){for(var r=0;r<t;r++)e[r*t+r]=n},sj=function(e,t){for(var n,r=0;r<t;r++){n=0;for(var i=0;i<t;i++)n+=e[i*t+r];for(var a=0;a<t;a++)e[a*t+r]=e[a*t+r]/n}},ELe=function(e,t,n){for(var r=Array(n*n),i=0;i<n;i++){for(var a=0;a<n;a++)r[i*n+a]=0;for(var o=0;o<n;o++)for(var s=0;s<n;s++)r[i*n+s]+=e[i*n+o]*t[o*n+s]}return r},DLe=function(e,t,n){for(var r=e.slice(0),i=1;i<n;i++)e=ELe(e,r,t);return e},OLe=function(e,t,n){for(var r=Array(t*t),i=0;i<t*t;i++)r[i]=e[i]**+n;return sj(r,t),r},kLe=function(e,t,n,r){for(var i=0;i<n;i++)if(Math.round(e[i]*10**r)/10**r!=Math.round(t[i]*10**r)/10**r)return!1;return!0},ALe=function(e,t,n,r){for(var i=[],a=0;a<t;a++){for(var o=[],s=0;s<t;s++)Math.round(e[a*t+s]*1e3)/1e3>0&&o.push(n[s]);o.length!==0&&i.push(r.collection(o))}return i},jLe=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},MLe=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&jLe(e[t],e[n])&&e.splice(n,1);return e},cj=function(e){for(var t=this.nodes(),n=this.edges(),r=this.cy(),i=CLe(e),a={},o=0;o<t.length;o++)a[t[o].id()]=o;for(var s=t.length,l=s*s,u=Array(l),d,f=0;f<l;f++)u[f]=0;for(var p=0;p<n.length;p++){var m=n[p],h=a[m.source().id()],g=a[m.target().id()],_=wLe(m,i.attributes);u[h*s+g]+=_,u[g*s+h]+=_}TLe(u,s,i.multFactor),sj(u,s);for(var v=!0,y=0;v&&y<i.maxIterations;)v=!1,d=DLe(u,s,i.expandFactor),u=OLe(d,s,i.inflateFactor),kLe(u,d,l,4)||(v=!0),y++;var b=ALe(u,s,t,r);return b=MLe(b),b},NLe={markovClustering:cj,mcl:cj},PLe=function(e){return e},lj=function(e,t){return Math.abs(t-e)},uj=function(e,t,n){return e+lj(t,n)},dj=function(e,t,n){return e+(n-t)**2},FLe=function(e){return Math.sqrt(e)},ILe=function(e,t,n){return Math.max(e,lj(t,n))},fj=function(e,t,n,r,i){for(var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:PLe,o=r,s,l,u=0;u<e;u++)s=t(u),l=n(u),o=i(o,s,l);return a(o)},pj={euclidean:function(e,t,n){return e>=2?fj(e,t,n,0,dj,FLe):fj(e,t,n,0,uj)},squaredEuclidean:function(e,t,n){return fj(e,t,n,0,dj)},manhattan:function(e,t,n){return fj(e,t,n,0,uj)},max:function(e,t,n){return fj(e,t,n,-1/0,ILe)}},pj[`squared-euclidean`]=pj.squaredEuclidean,pj.squaredeuclidean=pj.squaredEuclidean,LLe=$k({k:2,m:2,sensitivityThreshold:1e-4,distance:`euclidean`,maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),mj=function(e){return LLe(e)},hj=function(e,t,n,r,i){var a=i===`kMedoids`?function(e){return r[e](n)}:function(e){return n[e]},o=function(e){return r[e](t)},s=n,l=t;return kE(e,r.length,a,o,s,l)},gj=function(e,t,n){for(var r=n.length,i=Array(r),a=Array(r),o=Array(t),s=null,l=0;l<r;l++)i[l]=e.min(n[l]).value,a[l]=e.max(n[l]).value;for(var u=0;u<t;u++){s=[];for(var d=0;d<r;d++)s[d]=Math.random()*(a[d]-i[d])+i[d];o[u]=s}return o},_j=function(e,t,n,r,i){for(var a=1/0,o=0,s=0;s<t.length;s++){var l=hj(n,e,t[s],r,i);l<a&&(a=l,o=s)}return o},vj=function(e,t,n){for(var r=[],i=null,a=0;a<t.length;a++)i=t[a],n[i.id()]===e&&r.push(i);return r},RLe=function(e,t,n){return Math.abs(t-e)<=n},zLe=function(e,t,n){for(var r=0;r<e.length;r++)for(var i=0;i<e[r].length;i++)if(Math.abs(e[r][i]-t[r][i])>n)return!1;return!0},BLe=function(e,t,n){for(var r=0;r<n;r++)if(e===t[r])return!0;return!1},yj=function(e,t){var n=Array(t);if(e.length<50)for(var r=0;r<t;r++){for(var i=e[Math.floor(Math.random()*e.length)];BLe(i,n,r);)i=e[Math.floor(Math.random()*e.length)];n[r]=i}else for(var a=0;a<t;a++)n[a]=e[Math.floor(Math.random()*e.length)];return n},bj=function(e,t,n){for(var r=0,i=0;i<t.length;i++)r+=hj(`manhattan`,t[i],e,n,`kMedoids`);return r},VLe=function(e){var t=this.cy(),n=this.nodes(),r=null,i=mj(e),a=Array(i.k),o={},s;i.testMode?typeof i.testCentroids==`number`?(i.testCentroids,s=gj(n,i.k,i.attributes)):s=bE(i.testCentroids)===`object`?i.testCentroids:gj(n,i.k,i.attributes):s=gj(n,i.k,i.attributes);for(var l=!0,u=0;l&&u<i.maxIterations;){for(var d=0;d<n.length;d++)r=n[d],o[r.id()]=_j(r,s,i.distance,i.attributes,`kMeans`);l=!1;for(var f=0;f<i.k;f++){var p=vj(f,n,o);if(p.length!==0){for(var m=i.attributes.length,h=s[f],g=Array(m),_=Array(m),v=0;v<m;v++){_[v]=0;for(var y=0;y<p.length;y++)r=p[y],_[v]+=i.attributes[v](r);g[v]=_[v]/p.length,RLe(g[v],h[v],i.sensitivityThreshold)||(l=!0)}s[f]=g,a[f]=t.collection(p)}}u++}return a},HLe=function(e){var t=this.cy(),n=this.nodes(),r=null,i=mj(e),a=Array(i.k),o,s={},l,u=Array(i.k);i.testMode?typeof i.testCentroids==`number`||(o=bE(i.testCentroids)===`object`?i.testCentroids:yj(n,i.k)):o=yj(n,i.k);for(var d=!0,f=0;d&&f<i.maxIterations;){for(var p=0;p<n.length;p++)r=n[p],s[r.id()]=_j(r,o,i.distance,i.attributes,`kMedoids`);d=!1;for(var m=0;m<o.length;m++){var h=vj(m,n,s);if(h.length!==0){u[m]=bj(o[m],h,i.attributes);for(var g=0;g<h.length;g++)l=bj(h[g],h,i.attributes),l<u[m]&&(u[m]=l,o[m]=h[g],d=!0);a[m]=t.collection(h)}}f++}return a},ULe=function(e,t,n,r,i){for(var a,o,s=0;s<t.length;s++)for(var l=0;l<e.length;l++)r[s][l]=n[s][l]**+i.m;for(var u=0;u<e.length;u++)for(var d=0;d<i.attributes.length;d++){a=0,o=0;for(var f=0;f<t.length;f++)a+=r[f][u]*i.attributes[d](t[f]),o+=r[f][u];e[u][d]=a/o}},WLe=function(e,t,n,r,i){for(var a=0;a<e.length;a++)t[a]=e[a].slice();for(var o,s,l,u=2/(i.m-1),d=0;d<n.length;d++)for(var f=0;f<r.length;f++){o=0;for(var p=0;p<n.length;p++)s=hj(i.distance,r[f],n[d],i.attributes,`cmeans`),l=hj(i.distance,r[f],n[p],i.attributes,`cmeans`),o+=(s/l)**+u;e[f][d]=1/o}},GLe=function(e,t,n,r){for(var i=Array(n.k),a=0;a<i.length;a++)i[a]=[];for(var o,s,l=0;l<t.length;l++){o=-1/0,s=-1;for(var u=0;u<t[0].length;u++)t[l][u]>o&&(o=t[l][u],s=u);i[s].push(e[l])}for(var d=0;d<i.length;d++)i[d]=r.collection(i[d]);return i},xj=function(e){for(var t=this.cy(),n=this.nodes(),r=mj(e),i,a,o,s=Array(n.length),l,u=0;u<n.length;u++)s[u]=Array(r.k);o=Array(n.length);for(var d=0;d<n.length;d++)o[d]=Array(r.k);for(var f=0;f<n.length;f++){for(var p=0,m=0;m<r.k;m++)o[f][m]=Math.random(),p+=o[f][m];for(var h=0;h<r.k;h++)o[f][h]=o[f][h]/p}a=Array(r.k);for(var g=0;g<r.k;g++)a[g]=Array(r.attributes.length);l=Array(n.length);for(var _=0;_<n.length;_++)l[_]=Array(r.k);for(var v=!0,y=0;v&&y<r.maxIterations;)v=!1,ULe(a,n,o,l,r),WLe(o,s,a,n,r),zLe(o,s,r.sensitivityThreshold)||(v=!0),y++;return i=GLe(n,o,r,t),{clusters:i,degreeOfMembership:o}},KLe={kMeans:VLe,kMedoids:HLe,fuzzyCMeans:xj,fcm:xj},qLe=$k({distance:`euclidean`,linkage:`min`,mode:`threshold`,threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),JLe={single:`min`,complete:`max`},YLe=function(e){var t=qLe(e),n=JLe[t.linkage];return n!=null&&(t.linkage=n),t},Sj=function(e,t,n,r,i){for(var a=0,o=1/0,s,l=i.attributes,u=function(e,t){return kE(i.distance,l.length,function(t){return l[t](e)},function(e){return l[e](t)},e,t)},d=0;d<e.length;d++){var f=e[d].key,p=n[f][r[f]];p<o&&(a=f,o=p)}if(i.mode===`threshold`&&o>=i.threshold||i.mode===`dendrogram`&&e.length===1)return!1;var m=t[a],h=t[r[a]],g=i.mode===`dendrogram`?{left:m,right:h,key:m.key}:{value:m.value.concat(h.value),key:m.key};e[m.index]=g,e.splice(h.index,1),t[m.key]=g;for(var _=0;_<e.length;_++){var v=e[_];m.key===v.key?s=1/0:i.linkage===`min`?(s=n[m.key][v.key],n[m.key][v.key]>n[h.key][v.key]&&(s=n[h.key][v.key])):i.linkage===`max`?(s=n[m.key][v.key],n[m.key][v.key]<n[h.key][v.key]&&(s=n[h.key][v.key])):s=i.linkage===`mean`?(n[m.key][v.key]*m.size+n[h.key][v.key]*h.size)/(m.size+h.size):i.mode===`dendrogram`?u(v.value,m.value):u(v.value[0],m.value[0]),n[m.key][v.key]=n[v.key][m.key]=s}for(var y=0;y<e.length;y++){var b=e[y].key;if(r[b]===m.key||r[b]===h.key){for(var x=b,S=0;S<e.length;S++){var C=e[S].key;n[b][C]<n[b][x]&&(x=C)}r[b]=x}e[y].index=y}return m.key=h.key=m.index=h.index=null,!0},Cj=function(e,t,n){e&&(e.value?t.push(e.value):(e.left&&Cj(e.left,t),e.right&&Cj(e.right,t)))},wj=function(e,t){if(!e)return``;if(e.left&&e.right){var n=wj(e.left,t),r=wj(e.right,t),i=t.add({group:`nodes`,data:{id:n+`,`+r}});return t.add({group:`edges`,data:{source:n,target:i.id()}}),t.add({group:`edges`,data:{source:r,target:i.id()}}),i.id()}if(e.value)return e.value.id()},Tj=function(e,t,n){if(!e)return[];var r=[],i=[],a=[];return t===0?(e.left&&Cj(e.left,r),e.right&&Cj(e.right,i),a=r.concat(i),[n.collection(a)]):t===1?e.value?[n.collection(e.value)]:(e.left&&Cj(e.left,r),e.right&&Cj(e.right,i),[n.collection(r),n.collection(i)]):e.value?[n.collection(e.value)]:(e.left&&(r=Tj(e.left,t-1,n)),e.right&&(i=Tj(e.right,t-1,n)),r.concat(i))},Ej=function(e){for(var t=this.cy(),n=this.nodes(),r=YLe(e),i=r.attributes,a=function(e,t){return kE(r.distance,i.length,function(t){return i[t](e)},function(e){return i[e](t)},e,t)},o=[],s=[],l=[],u=[],d=0;d<n.length;d++){var f={value:r.mode===`dendrogram`?n[d]:[n[d]],key:d,index:d};o[d]=f,u[d]=f,s[d]=[],l[d]=0}for(var p=0;p<o.length;p++)for(var m=0;m<=p;m++){var h=void 0;h=r.mode===`dendrogram`?p===m?1/0:a(o[p].value,o[m].value):p===m?1/0:a(o[p].value[0],o[m].value[0]),s[p][m]=h,s[m][p]=h,h<s[p][l[p]]&&(l[p]=m)}for(var g=Sj(o,u,s,l,r);g;)g=Sj(o,u,s,l,r);var _;return r.mode===`dendrogram`?(_=Tj(o[0],r.dendrogramDepth,t),r.addDendrogram&&wj(o[0],t)):(_=Array(o.length),o.forEach(function(e,n){e.key=e.index=null,_[n]=t.collection(e.value)})),_},XLe={hierarchicalClustering:Ej,hca:Ej},ZLe=$k({distance:`euclidean`,preference:`median`,damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),QLe=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||Wk(`Damping must range on [0.5, 1). Got: ${t}`);var r=[`median`,`mean`,`min`,`max`];return r.some(function(e){return e===n})||rO(n)||Wk(`Preference must be one of [${r.map(function(e){return`'${e}'`}).join(`, `)}] or a number. Got: ${n}`),ZLe(e)},$Le=function(e,t,n,r){var i=function(e,t){return r[t](e)};return-kE(e,r.length,function(e){return i(t,e)},function(e){return i(n,e)},t,n)},eRe=function(e,t){var n=null;return n=t===`median`?$Ie(e):t===`mean`?QIe(e):t===`min`?XIe(e):t===`max`?ZIe(e):t,n},tRe=function(e,t,n){for(var r=[],i=0;i<e;i++)t[i*e+i]+n[i*e+i]>0&&r.push(i);return r},Dj=function(e,t,n){for(var r=[],i=0;i<e;i++){for(var a=-1,o=-1/0,s=0;s<n.length;s++){var l=n[s];t[i*e+l]>o&&(a=l,o=t[i*e+l])}a>0&&r.push(a)}for(var u=0;u<n.length;u++)r[n[u]]=n[u];return r},nRe=function(e,t,n){for(var r=Dj(e,t,n),i=0;i<n.length;i++){for(var a=[],o=0;o<r.length;o++)r[o]===n[i]&&a.push(o);for(var s=-1,l=-1/0,u=0;u<a.length;u++){for(var d=0,f=0;f<a.length;f++)d+=t[a[f]*e+a[u]];d>l&&(s=u,l=d)}n[i]=a[s]}return r=Dj(e,t,n),r},Oj=function(e){for(var t=this.cy(),n=this.nodes(),r=QLe(e),i={},a=0;a<n.length;a++)i[n[a].id()]=a;for(var o=n.length,s=o*o,l=Array(s),u,d,f,p=0;p<s;p++)l[p]=-1/0;for(var m=0;m<o;m++)for(var h=0;h<o;h++)m!==h&&(l[m*o+h]=$Le(r.distance,n[m],n[h],r.attributes));u=eRe(l,r.preference);for(var g=0;g<o;g++)l[g*o+g]=u;d=Array(s);for(var _=0;_<s;_++)d[_]=0;f=Array(s);for(var v=0;v<s;v++)f[v]=0;for(var y=Array(o),b=Array(o),x=Array(o),S=0;S<o;S++)y[S]=0,b[S]=0,x[S]=0;for(var C=Array(o*r.minIterations),w=0;w<C.length;w++)C[w]=0;var T;for(T=0;T<r.maxIterations;T++){for(var E=0;E<o;E++){for(var D=-1/0,O=-1/0,k=-1,A=0,j=0;j<o;j++)y[j]=d[E*o+j],A=f[E*o+j]+l[E*o+j],A>=D?(O=D,D=A,k=j):A>O&&(O=A);for(var M=0;M<o;M++)d[E*o+M]=(1-r.damping)*(l[E*o+M]-D)+r.damping*y[M];d[E*o+k]=(1-r.damping)*(l[E*o+k]-O)+r.damping*y[k]}for(var N=0;N<o;N++){for(var P=0,F=0;F<o;F++)y[F]=f[F*o+N],b[F]=Math.max(0,d[F*o+N]),P+=b[F];P-=b[N],b[N]=d[N*o+N],P+=b[N];for(var I=0;I<o;I++)f[I*o+N]=(1-r.damping)*Math.min(0,P-b[I])+r.damping*y[I];f[N*o+N]=(1-r.damping)*(P-b[N])+r.damping*y[N]}for(var L=0,R=0;R<o;R++){var ee=+(f[R*o+R]+d[R*o+R]>0);C[T%r.minIterations*o+R]=ee,L+=ee}if(L>0&&(T>=r.minIterations-1||T==r.maxIterations-1)){for(var z=0,B=0;B<o;B++){x[B]=0;for(var te=0;te<r.minIterations;te++)x[B]+=C[te*o+B];(x[B]===0||x[B]===r.minIterations)&&z++}if(z===o)break}}for(var ne=tRe(o,d,f),re=nRe(o,l,ne),ie={},ae=0;ae<ne.length;ae++)ie[ne[ae]]=[];for(var oe=0;oe<n.length;oe++){var se=re[i[n[oe].id()]];se!=null&&ie[se].push(n[oe])}for(var ce=Array(ne.length),le=0;le<ne.length;le++)ce[le]=t.collection(ie[ne[le]]);return ce},rRe={affinityPropagation:Oj,ap:Oj},iRe=$k({root:void 0,directed:!1}),aRe={hierholzer:function(e){if(!tO(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n=iRe(e),r=n.root,i=n.directed,a=this,o=!1,s,l,u;r&&(u=QD(r)?this.filter(r)[0].id():r[0].id());var d={},f={};i?a.forEach(function(e){var t=e.id();if(e.isNode()){var n=e.indegree(!0),r=e.outdegree(!0),i=n-r,a=r-n;i==1?s?o=!0:s=t:a==1?l?o=!0:l=t:(a>1||i>1)&&(o=!0),d[t]=[],e.outgoers().forEach(function(e){e.isEdge()&&d[t].push(e.id())})}else f[t]=[void 0,e.target().id()]}):a.forEach(function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(s?l?o=!0:l=t:s=t),d[t]=[],e.connectedEdges().forEach(function(e){return d[t].push(e.id())})):f[t]=[e.source().id(),e.target().id()]});var p={found:!1,trail:void 0};if(o)return p;if(l&&s){if(i){if(u&&l!=u)return p;u=l}else if(u&&l!=u&&s!=u)return p;else u||=l}else u||=a[0].id();var m=function(e){for(var t=e,n=[e],r,a,o;d[t].length;)r=d[t].shift(),a=f[r][0],o=f[r][1],t==o?!i&&t!=a&&(d[a]=d[a].filter(function(e){return e!=r}),t=a):(d[o]=d[o].filter(function(e){return e!=r}),t=o),n.unshift(r),n.unshift(t);return n},h=[],g=[];for(g=m(u);g.length!=1;)d[g[0]].length==0?(h.unshift(a.getElementById(g.shift())),h.unshift(a.getElementById(g.shift()))):g=m(g.shift()).concat(g);for(var _ in h.unshift(a.getElementById(g.shift())),d)if(d[_].length)return p;return p.found=!0,p.trail=this.spawn(h,!0),p}},kj=function(){var e=this,t={},n=0,r=0,i=[],a=[],o={},s=function(n,r){for(var o=a.length-1,s=[],l=e.spawn();a[o].x!=n||a[o].y!=r;)s.push(a.pop().edge),o--;s.push(a.pop().edge),s.forEach(function(n){var r=n.connectedNodes().intersection(e);l.merge(n),r.forEach(function(n){var r=n.id(),i=n.connectedEdges().intersection(e);l.merge(n),t[r].cutVertex?l.merge(i.filter(function(e){return e.isLoop()})):l.merge(i)})}),i.push(l)},l=function(u,d,f){u===f&&(r+=1),t[d]={id:n,low:n++,cutVertex:!1};var p=e.getElementById(d).connectedEdges().intersection(e);if(p.size()===0)i.push(e.spawn(e.getElementById(d)));else{var m,h,g,_;p.forEach(function(e){m=e.source().id(),h=e.target().id(),g=m===d?h:m,g!==f&&(_=e.id(),o[_]||(o[_]=!0,a.push({x:d,y:g,edge:e})),g in t?t[d].low=Math.min(t[d].low,t[g].id):(l(u,g,d),t[d].low=Math.min(t[d].low,t[g].low),t[d].id<=t[g].low&&(t[d].cutVertex=!0,s(d,g))))})}};e.forEach(function(e){if(e.isNode()){var n=e.id();n in t||(r=0,l(n,n),t[n].cutVertex=r>1)}});var u=Object.keys(t).filter(function(e){return t[e].cutVertex}).map(function(t){return e.getElementById(t)});return{cut:e.spawn(u),components:i}},oRe={hopcroftTarjanBiconnected:kj,htbc:kj,htb:kj,hopcroftTarjanBiconnectedComponents:kj},Aj=function(){var e=this,t={},n=0,r=[],i=[],a=e.spawn(e),o=function(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach(function(e){var n=e.target().id();n!==s&&(n in t||o(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))}),t[s].index===t[s].low){for(var l=e.spawn();;){var u=i.pop();if(l.merge(e.getElementById(u)),t[u].low=t[s].index,t[u].explored=!0,u===s)break}var d=l.edgesWith(l),f=l.merge(d);r.push(f),a=a.difference(f)}};return e.forEach(function(e){if(e.isNode()){var n=e.id();n in t||o(n)}}),{cut:a,components:r}},sRe={tarjanStronglyConnected:Aj,tsc:Aj,tscc:Aj,tarjanStronglyConnectedComponents:Aj},jj={},[dA,RIe,zIe,VIe,UIe,GIe,JIe,bLe,rj,aj,oj,NLe,KLe,XLe,rRe,aRe,oRe,sRe].forEach(function(e){MO(jj,e)}),Mj=0,Nj=1,Pj=2,Fj=function(e){if(!(this instanceof Fj))return new Fj(e);this.id=`Thenable/1.0.7`,this.state=Mj,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e==`function`&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))},Fj.prototype={fulfill:function(e){return Ij(this,Nj,`fulfillValue`,e)},reject:function(e){return Ij(this,Pj,`rejectReason`,e)},then:function(e,t){var n=this,r=new Fj;return n.onFulfilled.push(zj(e,r,`fulfill`)),n.onRejected.push(zj(t,r,`reject`)),Lj(n),r.proxy}},Ij=function(e,t,n,r){return e.state===Mj&&(e.state=t,e[n]=r,Lj(e)),e},Lj=function(e){e.state===Nj?Rj(e,`onFulfilled`,e.fulfillValue):e.state===Pj&&Rj(e,`onRejected`,e.rejectReason)},Rj=function(e,t,n){if(e[t].length!==0){var r=e[t];e[t]=[];var i=function(){for(var e=0;e<r.length;e++)r[e](n)};typeof setImmediate==`function`?setImmediate(i):setTimeout(i,0)}},zj=function(e,t,n){return function(r){if(typeof e!=`function`)t[n].call(t,r);else{var i;try{i=e(r)}catch(e){t.reject(e);return}Bj(t,i)}}},Bj=function(e,t){if(e===t||e.proxy===t){e.reject(TypeError(`cannot resolve promise with itself`));return}var n;if(bE(t)===`object`&&t!==null||typeof t==`function`)try{n=t.then}catch(t){e.reject(t);return}if(typeof n==`function`){var r=!1;try{n.call(t,function(n){r||(r=!0,n===t?e.reject(TypeError(`circular thenable chain`)):Bj(e,n))},function(t){r||(r=!0,e.reject(t))})}catch(t){r||e.reject(t)}return}e.fulfill(t)},Fj.all=function(e){return new Fj(function(t,n){for(var r=Array(e.length),i=0,a=function(n,a){r[n]=a,i++,i===e.length&&t(r)},o=0;o<e.length;o++)(function(t){var r=e[t];r!=null&&r.then!=null?r.then(function(e){a(t,e)},function(e){n(e)}):a(t,r)})(o)})},Fj.resolve=function(e){return new Fj(function(t,n){t(e)})},Fj.reject=function(e){return new Fj(function(t,n){n(e)})},Vj=typeof Promise<`u`?Promise:Fj,Hj=function(e,t,n){var r=lO(e),i=!r,a=this._private=MO({duration:1e3},t,n);if(a.target=e,a.style=a.style||a.css,a.started=!1,a.playing=!1,a.hooked=!1,a.applying=!1,a.progress=0,a.completes=[],a.frames=[],a.complete&&$D(a.complete)&&a.completes.push(a.complete),i){var o=e.position();a.startPosition=a.startPosition||{x:o.x,y:o.y},a.startStyle=a.startStyle||e.cy().style().getAnimationStartStyle(e,a.style)}if(r){var s=e.pan();a.startPan={x:s.x,y:s.y},a.startZoom=e.zoom()}this.length=1,this[0]=this},Uj=Hj.prototype,MO(Uj,{instanceString:function(){return`animation`},hook:function(){var e=this._private;if(!e.hooked){var t,n=e.target._private.animation;t=e.queue?n.queue:n.current,t.push(this),oO(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var t=this._private;return e===void 0?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,n=t.playing;return e===void 0?t.progress:(n&&this.pause(),t.progress=e,t.started=!1,n&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(t,n){var r=e[t];r!=null&&(e[t]=e[n],e[n]=r)};if(n(`zoom`,`startZoom`),n(`pan`,`startPan`),n(`position`,`startPosition`),e.style)for(var r=0;r<e.style.length;r++){var i=e.style[r],a=i.name,o=e.startStyle[a];e.startStyle[a]=i,e.style[r]=o}return t&&this.play(),this},promise:function(e){var t=this._private,n;switch(e){case`frame`:n=t.frames;break;default:case`complete`:case`completed`:n=t.completes}return new Vj(function(e,t){n.push(function(){e()})})}}),Uj.complete=Uj.completed,Uj.run=Uj.play,Uj.running=Uj.playing,cRe={animated:function(){return function(){var e=this,t=e.length===void 0?[e]:e;if(!(this._private.cy||this).styleEnabled())return!1;var n=t[0];if(n)return n._private.animation.current.length>0}},clearQueue:function(){return function(){var e=this,t=e.length===void 0?[e]:e;if(!(this._private.cy||this).styleEnabled())return this;for(var n=0;n<t.length;n++){var r=t[n];r._private.animation.queue=[]}return this}},delay:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animate({delay:e,duration:e,complete:t}):this}},delayAnimation:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animation({delay:e,duration:e,complete:t}):this}},animation:function(){return function(e,t){var n=this,r=n.length!==void 0,i=r?n:[n],a=this._private.cy||this,o=!r,s=!o;if(!a.styleEnabled())return this;var l=a.style();if(e=MO({},e,t),Object.keys(e).length===0)return new Hj(i[0],e);switch(e.duration===void 0&&(e.duration=400),e.duration){case`slow`:e.duration=600;break;case`fast`:e.duration=200}if(s&&(e.style=l.getPropsList(e.style||e.css),e.css=void 0),s&&e.renderedPosition!=null){var u=e.renderedPosition,d=a.pan(),f=a.zoom();e.position=vA(u,f,d)}if(o&&e.panBy!=null){var p=e.panBy,m=a.pan();e.pan={x:m.x+p.x,y:m.y+p.y}}var h=e.center||e.centre;if(o&&h!=null){var g=a.getCenterPan(h.eles,e.zoom);g!=null&&(e.pan=g)}if(o&&e.fit!=null){var _=e.fit,v=a.getFitViewport(_.eles||_.boundingBox,_.padding);v!=null&&(e.pan=v.pan,e.zoom=v.zoom)}if(o&&tO(e.zoom)){var y=a.getZoomedViewport(e.zoom);y==null?e.zoom=null:(y.zoomed&&(e.zoom=y.zoom),y.panned&&(e.pan=y.pan))}return new Hj(i[0],e)}},animate:function(){return function(e,t){var n=this,r=n.length===void 0?[n]:n;if(!(this._private.cy||this).styleEnabled())return this;t&&(e=MO({},e,t));for(var i=0;i<r.length;i++){var a=r[i],o=a.animated()&&(e.queue===void 0||e.queue);a.animation(e,o?{queue:!0}:void 0).play()}return this}},stop:function(){return function(e,t){var n=this,r=n.length===void 0?[n]:n,i=this._private.cy||this;if(!i.styleEnabled())return this;for(var a=0;a<r.length;a++){for(var o=r[a]._private,s=o.animation.current,l=0;l<s.length;l++){var u=s[l]._private;t&&(u.duration=0)}e&&(o.animation.queue=[]),t||(o.animation.current=[])}return i.notify(`draw`),this}}},QRe=SE(HFe()),aze=SE(JFe()),cze=SE(XFe()),lze={data:function(e){return e=MO({},{field:`data`,bindingEvent:`data`,allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:`data`,settingTriggersEvent:!1,triggerFnName:`trigger`,immutableKeys:{},updateStyle:!1,beforeGet:function(e){},beforeSet:function(e,t){},onSet:function(e){},canSet:function(e){return!0}},e),function(t,n){var r=e,i=this,a=i.length!==void 0,o=a?i:[i],s=a?i[0]:i;if(QD(t)){var l=t.indexOf(`.`)!==-1&&cze(t);if(r.allowGetting&&n===void 0){var u;return s&&(r.beforeGet(s),u=l&&s._private[r.field][t]===void 0?QRe(s._private[r.field],l):s._private[r.field][t]),u}if(r.allowSetting&&n!==void 0&&!r.immutableKeys[t]){var d=WPe({},t,n);r.beforeSet(i,d);for(var f=0,p=o.length;f<p;f++){var m=o[f];r.canSet(m)&&(l&&s._private[r.field][t]===void 0?aze(m._private[r.field],l,n):m._private[r.field][t]=n)}r.updateStyle&&i.updateStyle(),r.onSet(i),r.settingTriggersEvent&&i[r.triggerFnName](r.settingEvent)}}else if(r.allowSetting&&tO(t)){var h=t,g,_,v=Object.keys(h);r.beforeSet(i,h);for(var y=0;y<v.length;y++)if(g=v[y],_=h[g],!r.immutableKeys[g])for(var b=0;b<o.length;b++){var x=o[b];r.canSet(x)&&(x._private[r.field][g]=_)}r.updateStyle&&i.updateStyle(),r.onSet(i),r.settingTriggersEvent&&i[r.triggerFnName](r.settingEvent)}else if(r.allowBinding&&$D(t)){var S=t;i.on(r.bindingEvent,S)}else if(r.allowGetting&&t===void 0){var C;return s&&(r.beforeGet(s),C=s._private[r.field]),C}return i}},removeData:function(e){return e=MO({},{field:`data`,event:`data`,triggerFnName:`trigger`,triggerEvent:!1,immutableKeys:{}},e),function(t){var n=e,r=this,i=r.length===void 0?[r]:r;if(QD(t)){for(var a=t.split(/\s+/),o=a.length,s=0;s<o;s++){var l=a[s];if(!fO(l)&&!n.immutableKeys[l])for(var u=0,d=i.length;u<d;u++)i[u]._private[n.field][l]=void 0}n.triggerEvent&&r[n.triggerFnName](n.event)}else if(t===void 0){for(var f=0,p=i.length;f<p;f++)for(var m=i[f]._private[n.field],h=Object.keys(m),g=0;g<h.length;g++){var _=h[g];n.immutableKeys[_]||(m[_]=void 0)}n.triggerEvent&&r[n.triggerFnName](n.event)}return r}}},uze={eventAliasesOn:function(e){var t=e;t.addListener=t.listen=t.bind=t.on,t.unlisten=t.unbind=t.off=t.removeListener,t.trigger=t.emit,t.pon=t.promiseOn=function(e,t){var n=this,r=Array.prototype.slice.call(arguments,0);return new Vj(function(e,t){var i=r.concat([function(t){n.off.apply(n,a),e(t)}]),a=i.concat([]);n.on.apply(n,i)})}}},VM={},[cRe,lze,uze].forEach(function(e){MO(VM,e)}),dze={animate:VM.animate(),animation:VM.animation(),animated:VM.animated(),clearQueue:VM.clearQueue(),delay:VM.delay(),delayAnimation:VM.delayAnimation(),stop:VM.stop()},HM={classes:function(e){var t=this;if(e===void 0){var n=[];return t[0]._private.classes.forEach(function(e){return n.push(e)}),n}eO(e)||(e=(e||``).match(/\S+/g)||[]);for(var r=[],i=new cA(e),a=0;a<t.length;a++){for(var o=t[a],s=o._private,l=s.classes,u=!1,d=0;d<e.length;d++){var f=e[d];if(!l.has(f)){u=!0;break}}u||=l.size!==e.length,u&&(s.classes=i,r.push(o))}return r.length>0&&this.spawn(r).updateStyle().emit(`class`),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return t!=null&&t._private.classes.has(e)},toggleClass:function(e,t){eO(e)||(e=e.match(/\S+/g)||[]);for(var n=this,r=t===void 0,i=[],a=0,o=n.length;a<o;a++)for(var s=n[a],l=s._private.classes,u=!1,d=0;d<e.length;d++){var f=e[d],p=l.has(f),m=!1;t||r&&!p?(l.add(f),m=!0):(!t||r&&p)&&(l.delete(f),m=!0),!u&&m&&(i.push(s),u=!0)}return i.length>0&&this.spawn(i).updateStyle().emit(`class`),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(t==null)t=250;else if(t===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},t),n}},HM.className=HM.classNames=HM.classes,UM={metaChar:`[\\!\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\\`\\{\\|\\}\\~]`,comparatorOp:`=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=`,boolOp:`\\?|\\!|\\^`,string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:CO,meta:`degree|indegree|outdegree`,separator:`\\s*,\\s*`,descendant:`\\s+`,child:`\\s+>\\s+`,subject:`\\$`,group:`node|edge|\\*`,directedEdge:`\\s+->\\s+`,undirectedEdge:`\\s+<->\\s+`},UM.variable=`(?:[\\w-.]|(?:\\\\`+UM.metaChar+`))+`,UM.className=`(?:[\\w-]|(?:\\\\`+UM.metaChar+`))+`,UM.value=UM.string+`|`+UM.number,UM.id=UM.variable,(function(){var e=UM.comparatorOp.split(`|`),t,n;for(n=0;n<e.length;n++)t=e[n],UM.comparatorOp+=`|@`+t;for(e=UM.comparatorOp.split(`|`),n=0;n<e.length;n++)t=e[n],!(t.indexOf(`!`)>=0)&&t!==`=`&&(UM.comparatorOp+=`|\\!`+t)})(),WM=function(){return{checks:[]}},GM={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},KM=[{selector:`:selected`,matches:function(e){return e.selected()}},{selector:`:unselected`,matches:function(e){return!e.selected()}},{selector:`:selectable`,matches:function(e){return e.selectable()}},{selector:`:unselectable`,matches:function(e){return!e.selectable()}},{selector:`:locked`,matches:function(e){return e.locked()}},{selector:`:unlocked`,matches:function(e){return!e.locked()}},{selector:`:visible`,matches:function(e){return e.visible()}},{selector:`:hidden`,matches:function(e){return!e.visible()}},{selector:`:transparent`,matches:function(e){return e.transparent()}},{selector:`:grabbed`,matches:function(e){return e.grabbed()}},{selector:`:free`,matches:function(e){return!e.grabbed()}},{selector:`:removed`,matches:function(e){return e.removed()}},{selector:`:inside`,matches:function(e){return!e.removed()}},{selector:`:grabbable`,matches:function(e){return e.grabbable()}},{selector:`:ungrabbable`,matches:function(e){return!e.grabbable()}},{selector:`:animated`,matches:function(e){return e.animated()}},{selector:`:unanimated`,matches:function(e){return!e.animated()}},{selector:`:parent`,matches:function(e){return e.isParent()}},{selector:`:childless`,matches:function(e){return e.isChildless()}},{selector:`:child`,matches:function(e){return e.isChild()}},{selector:`:orphan`,matches:function(e){return e.isOrphan()}},{selector:`:nonorphan`,matches:function(e){return e.isChild()}},{selector:`:compound`,matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:`:loop`,matches:function(e){return e.isLoop()}},{selector:`:simple`,matches:function(e){return e.isSimple()}},{selector:`:active`,matches:function(e){return e.active()}},{selector:`:inactive`,matches:function(e){return!e.active()}},{selector:`:backgrounding`,matches:function(e){return e.backgrounding()}},{selector:`:nonbackgrounding`,matches:function(e){return!e.backgrounding()}}].sort(function(e,t){return jO(e.selector,t.selector)}),fze=function(){for(var e={},t,n=0;n<KM.length;n++)t=KM[n],e[t.selector]=t.matches;return e}(),pze=function(e,t){return fze[e](t)},mze=`(`+KM.map(function(e){return e.selector}).join(`|`)+`)`,qM=function(e){return e.replace(RegExp(`\\\\(`+UM.metaChar+`)`,`g`),function(e,t){return t})},JM=function(e,t,n){e[e.length-1]=n},YM=[{name:`group`,query:!0,regex:`(`+UM.group+`)`,populate:function(e,t,n){var r=_E(n,1)[0];t.checks.push({type:GM.GROUP,value:r===`*`?r:r+`s`})}},{name:`state`,query:!0,regex:mze,populate:function(e,t,n){var r=_E(n,1)[0];t.checks.push({type:GM.STATE,value:r})}},{name:`id`,query:!0,regex:`\\#(`+UM.id+`)`,populate:function(e,t,n){var r=_E(n,1)[0];t.checks.push({type:GM.ID,value:qM(r)})}},{name:`className`,query:!0,regex:`\\.(`+UM.className+`)`,populate:function(e,t,n){var r=_E(n,1)[0];t.checks.push({type:GM.CLASS,value:qM(r)})}},{name:`dataExists`,query:!0,regex:`\\[\\s*(`+UM.variable+`)\\s*\\]`,populate:function(e,t,n){var r=_E(n,1)[0];t.checks.push({type:GM.DATA_EXIST,field:qM(r)})}},{name:`dataCompare`,query:!0,regex:`\\[\\s*(`+UM.variable+`)\\s*(`+UM.comparatorOp+`)\\s*(`+UM.value+`)\\s*\\]`,populate:function(e,t,n){var r=_E(n,3),i=r[0],a=r[1],o=r[2];o=RegExp(`^`+UM.string+`$`).exec(o)==null?parseFloat(o):o.substring(1,o.length-1),t.checks.push({type:GM.DATA_COMPARE,field:qM(i),operator:a,value:o})}},{name:`dataBool`,query:!0,regex:`\\[\\s*(`+UM.boolOp+`)\\s*(`+UM.variable+`)\\s*\\]`,populate:function(e,t,n){var r=_E(n,2),i=r[0],a=r[1];t.checks.push({type:GM.DATA_BOOL,field:qM(a),operator:i})}},{name:`metaCompare`,query:!0,regex:`\\[\\[\\s*(`+UM.meta+`)\\s*(`+UM.comparatorOp+`)\\s*(`+UM.number+`)\\s*\\]\\]`,populate:function(e,t,n){var r=_E(n,3),i=r[0],a=r[1],o=r[2];t.checks.push({type:GM.META_COMPARE,field:qM(i),operator:a,value:parseFloat(o)})}},{name:`nextQuery`,separator:!0,regex:UM.separator,populate:function(e,t){var n=e.currentSubject,r=e.edgeCount,i=e.compoundCount,a=e[e.length-1];return n!=null&&(a.subject=n,e.currentSubject=null),a.edgeCount=r,a.compoundCount=i,e.edgeCount=0,e.compoundCount=0,e[e.length++]=WM()}},{name:`directedEdge`,separator:!0,regex:UM.directedEdge,populate:function(e,t){if(e.currentSubject==null){var n=WM(),r=t,i=WM();return n.checks.push({type:GM.DIRECTED_EDGE,source:r,target:i}),JM(e,t,n),e.edgeCount++,i}var a=WM(),o=t,s=WM();return a.checks.push({type:GM.NODE_SOURCE,source:o,target:s}),JM(e,t,a),e.edgeCount++,s}},{name:`undirectedEdge`,separator:!0,regex:UM.undirectedEdge,populate:function(e,t){if(e.currentSubject==null){var n=WM(),r=t,i=WM();return n.checks.push({type:GM.UNDIRECTED_EDGE,nodes:[r,i]}),JM(e,t,n),e.edgeCount++,i}var a=WM(),o=t,s=WM();return a.checks.push({type:GM.NODE_NEIGHBOR,node:o,neighbor:s}),JM(e,t,a),s}},{name:`child`,separator:!0,regex:UM.child,populate:function(e,t){if(e.currentSubject==null){var n=WM(),r=WM(),i=e[e.length-1];return n.checks.push({type:GM.CHILD,parent:i,child:r}),JM(e,t,n),e.compoundCount++,r}if(e.currentSubject===t){var a=WM(),o=e[e.length-1],s=WM(),l=WM(),u=WM(),d=WM();return a.checks.push({type:GM.COMPOUND_SPLIT,left:o,right:s,subject:l}),l.checks=t.checks,t.checks=[{type:GM.TRUE}],d.checks.push({type:GM.TRUE}),s.checks.push({type:GM.PARENT,parent:d,child:u}),JM(e,o,a),e.currentSubject=l,e.compoundCount++,u}var f=WM(),p=WM(),m=[{type:GM.PARENT,parent:f,child:p}];return f.checks=t.checks,t.checks=m,e.compoundCount++,p}},{name:`descendant`,separator:!0,regex:UM.descendant,populate:function(e,t){if(e.currentSubject==null){var n=WM(),r=WM(),i=e[e.length-1];return n.checks.push({type:GM.DESCENDANT,ancestor:i,descendant:r}),JM(e,t,n),e.compoundCount++,r}if(e.currentSubject===t){var a=WM(),o=e[e.length-1],s=WM(),l=WM(),u=WM(),d=WM();return a.checks.push({type:GM.COMPOUND_SPLIT,left:o,right:s,subject:l}),l.checks=t.checks,t.checks=[{type:GM.TRUE}],d.checks.push({type:GM.TRUE}),s.checks.push({type:GM.ANCESTOR,ancestor:d,descendant:u}),JM(e,o,a),e.currentSubject=l,e.compoundCount++,u}var f=WM(),p=WM(),m=[{type:GM.ANCESTOR,ancestor:f,descendant:p}];return f.checks=t.checks,t.checks=m,e.compoundCount++,p}},{name:`subject`,modifier:!0,regex:UM.subject,populate:function(e,t){if(e.currentSubject!=null&&e.currentSubject!==t)return Kk("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var n=e[e.length-1].checks[0],r=n==null?null:n.type;r===GM.DIRECTED_EDGE?n.type=GM.NODE_TARGET:r===GM.UNDIRECTED_EDGE&&(n.type=GM.NODE_NEIGHBOR,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}],YM.forEach(function(e){return e.regexObj=RegExp(`^`+e.regex)}),hze=function(e){for(var t,n,r,i=0;i<YM.length;i++){var a=YM[i],o=a.name,s=e.match(a.regexObj);if(s!=null){n=s,t=a,r=o;var l=s[0];e=e.substring(l.length);break}}return{expr:t,match:n,name:r,remaining:e}},gze=function(e){var t=e.match(/^\s+/);if(t){var n=t[0];e=e.substring(n.length)}return e},_ze={parse:function(e){var t=this,n=t.inputText=e,r=t[0]=WM();for(t.length=1,n=gze(n);;){var i=hze(n);if(i.expr==null)return Kk("The selector `"+e+"`is invalid"),!1;var a=i.match.slice(1),o=i.expr.populate(t,r,a);if(o===!1)return!1;if(o!=null&&(r=o),n=i.remaining,n.match(/^\s*$/))break}var s=t[t.length-1];t.currentSubject!=null&&(s.subject=t.currentSubject),s.edgeCount=t.edgeCount,s.compoundCount=t.compoundCount;for(var l=0;l<t.length;l++){var u=t[l];if(u.compoundCount>0&&u.edgeCount>0)return Kk("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(u.edgeCount>1)return Kk("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;u.edgeCount===1&&Kk("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},toString:function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(e){return e??``},t=function(t){return QD(t)?`"`+t+`"`:e(t)},n=function(e){return` `+e+` `},r=function(r,a){var o=r.type,s=r.value;switch(o){case GM.GROUP:var l=e(s);return l.substring(0,l.length-1);case GM.DATA_COMPARE:var u=r.field,d=r.operator;return`[`+u+n(e(d))+t(s)+`]`;case GM.DATA_BOOL:var f=r.operator,p=r.field;return`[`+e(f)+p+`]`;case GM.DATA_EXIST:return`[`+r.field+`]`;case GM.META_COMPARE:var m=r.operator;return`[[`+r.field+n(e(m))+t(s)+`]]`;case GM.STATE:return s;case GM.ID:return`#`+s;case GM.CLASS:return`.`+s;case GM.PARENT:case GM.CHILD:return i(r.parent,a)+n(`>`)+i(r.child,a);case GM.ANCESTOR:case GM.DESCENDANT:return i(r.ancestor,a)+` `+i(r.descendant,a);case GM.COMPOUND_SPLIT:var h=i(r.left,a),g=i(r.subject,a),_=i(r.right,a);return h+(h.length>0?` `:``)+g+_;case GM.TRUE:return``}},i=function(e,t){return e.checks.reduce(function(n,i,a){return n+(t===e&&a===0?`$`:``)+r(i,t)},``)},a=``,o=0;o<this.length;o++){var s=this[o];a+=i(s,s.subject),this.length>1&&o<this.length-1&&(a+=`, `)}return this.toStringCache=a,a}},XM=function(e,t,n){var r,i=QD(e),a=rO(e),o=QD(n),s,l,u=!1,d=!1,f=!1;switch(t.indexOf(`!`)>=0&&(t=t.replace(`!`,``),d=!0),t.indexOf(`@`)>=0&&(t=t.replace(`@`,``),u=!0),(i||o||u)&&(s=!i&&!a?``:``+e,l=``+n),u&&(e=s=s.toLowerCase(),n=l=l.toLowerCase()),t){case`*=`:r=s.indexOf(l)>=0;break;case`$=`:r=s.indexOf(l,s.length-l.length)>=0;break;case`^=`:r=s.indexOf(l)===0;break;case`=`:r=e===n;break;case`>`:f=!0,r=e>n;break;case`>=`:f=!0,r=e>=n;break;case`<`:f=!0,r=e<n;break;case`<=`:f=!0,r=e<=n;break;default:r=!1}return d&&(e!=null||!f)&&(r=!r),r},vze=function(e,t){switch(t){case`?`:return!!e;case`!`:return!e;case`^`:return e===void 0}},yze=function(e){return e!==void 0},ZM=function(e,t){return e.data(t)},bze=function(e,t){return e[t]()},QM=[],$M=function(e,t){return e.checks.every(function(e){return QM[e.type](e,t)})},QM[GM.GROUP]=function(e,t){var n=e.value;return n===`*`||n===t.group()},QM[GM.STATE]=function(e,t){var n=e.value;return pze(n,t)},QM[GM.ID]=function(e,t){var n=e.value;return t.id()===n},QM[GM.CLASS]=function(e,t){var n=e.value;return t.hasClass(n)},QM[GM.META_COMPARE]=function(e,t){var n=e.field,r=e.operator,i=e.value;return XM(bze(t,n),r,i)},QM[GM.DATA_COMPARE]=function(e,t){var n=e.field,r=e.operator,i=e.value;return XM(ZM(t,n),r,i)},QM[GM.DATA_BOOL]=function(e,t){var n=e.field,r=e.operator;return vze(ZM(t,n),r)},QM[GM.DATA_EXIST]=function(e,t){var n=e.field;return e.operator,yze(ZM(t,n))},QM[GM.UNDIRECTED_EDGE]=function(e,t){var n=e.nodes[0],r=e.nodes[1],i=t.source(),a=t.target();return $M(n,i)&&$M(r,a)||$M(r,i)&&$M(n,a)},QM[GM.NODE_NEIGHBOR]=function(e,t){return $M(e.node,t)&&t.neighborhood().some(function(t){return t.isNode()&&$M(e.neighbor,t)})},QM[GM.DIRECTED_EDGE]=function(e,t){return $M(e.source,t.source())&&$M(e.target,t.target())},QM[GM.NODE_SOURCE]=function(e,t){return $M(e.source,t)&&t.outgoers().some(function(t){return t.isNode()&&$M(e.target,t)})},QM[GM.NODE_TARGET]=function(e,t){return $M(e.target,t)&&t.incomers().some(function(t){return t.isNode()&&$M(e.source,t)})},QM[GM.CHILD]=function(e,t){return $M(e.child,t)&&$M(e.parent,t.parent())},QM[GM.PARENT]=function(e,t){return $M(e.parent,t)&&t.children().some(function(t){return $M(e.child,t)})},QM[GM.DESCENDANT]=function(e,t){return $M(e.descendant,t)&&t.ancestors().some(function(t){return $M(e.ancestor,t)})},QM[GM.ANCESTOR]=function(e,t){return $M(e.ancestor,t)&&t.descendants().some(function(t){return $M(e.descendant,t)})},QM[GM.COMPOUND_SPLIT]=function(e,t){return $M(e.subject,t)&&$M(e.left,t)&&$M(e.right,t)},QM[GM.TRUE]=function(){return!0},QM[GM.COLLECTION]=function(e,t){return e.value.has(t)},QM[GM.FILTER]=function(e,t){var n=e.value;return n(t)},xze={matches:function(e){for(var t=this,n=0;n<t.length;n++){var r=t[n];if($M(r,e))return!0}return!1},filter:function(e){var t=this;if(t.length===1&&t[0].checks.length===1&&t[0].checks[0].type===GM.ID)return e.getElementById(t[0].checks[0].value).collection();var n=function(e){for(var n=0;n<t.length;n++){var r=t[n];if($M(r,e))return!0}return!1};return t.text()??(n=function(){return!0}),e.filter(n)}},eN=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||QD(e)&&e.match(/^\s*$/)||(oO(e)?this.addQuery({checks:[{type:GM.COLLECTION,value:e.collection()}]}):$D(e)?this.addQuery({checks:[{type:GM.FILTER,value:e}]}):QD(e)?this.parse(e)||(this.invalid=!0):Wk(`A selector must be created from a string; found `))},tN=eN.prototype,[_ze,xze].forEach(function(e){return MO(tN,e)}),tN.text=function(){return this.inputText},tN.size=function(){return this.length},tN.eq=function(e){return this[e]},tN.sameText=function(e){return!this.invalid&&!e.invalid&&this.text()===e.text()},tN.addQuery=function(e){this[this.length++]=e},tN.selector=tN.toString,nN={allAre:function(e){var t=new eN(e);return this.every(function(e){return t.matches(e)})},is:function(e){var t=new eN(e);return this.some(function(e){return t.matches(e)})},some:function(e,t){for(var n=0;n<this.length;n++)if(t?e.apply(t,[this[n],n,this]):e(this[n],n,this))return!0;return!1},every:function(e,t){for(var n=0;n<this.length;n++)if(!(t?e.apply(t,[this[n],n,this]):e(this[n],n,this)))return!1;return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var t=this.length;return t===e.length?t===1?this[0]===e[0]:this.every(function(t){return e.hasElementWithId(t.id())}):!1},anySame:function(e){return e=this.cy().collection(e),this.some(function(t){return e.hasElementWithId(t.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var t=this.neighborhood();return e.every(function(e){return t.hasElementWithId(e.id())})},contains:function(e){e=this.cy().collection(e);var t=this;return e.every(function(e){return t.hasElementWithId(e.id())})}},nN.allAreNeighbours=nN.allAreNeighbors,nN.has=nN.contains,nN.equal=nN.equals=nN.same,rN=function(e,t){return function(n,r,i,a){var o=n,s=this,l;if(o==null?l=``:oO(o)&&o.length===1&&(l=o.id()),s.length===1&&l){var u=s[0]._private,d=u.traversalCache=u.traversalCache||{},f=d[t]=d[t]||[],p=Mk(l);return f[p]||(f[p]=e.call(s,n,r,i,a))}return e.call(s,n,r,i,a)}},iN={parent:function(e){var t=[];if(this.length===1){var n=this[0]._private.parent;if(n)return n}for(var r=0;r<this.length;r++){var i=this[r]._private.parent;i&&t.push(i)}return this.spawn(t,!0).filter(e)},parents:function(e){for(var t=[],n=this.parent();n.nonempty();){for(var r=0;r<n.length;r++){var i=n[r];t.push(i)}n=n.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,n=0;n<this.length;n++){var r=this[n].parents();t||=r,t=t.intersect(r)}return t.filter(e)},orphans:function(e){return this.stdFilter(function(e){return e.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(e){return e.isChild()}).filter(e)},children:rN(function(e){for(var t=[],n=0;n<this.length;n++)for(var r=this[n]._private.children,i=0;i<r.length;i++)t.push(r[i]);return this.spawn(t,!0).filter(e)},`children`),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var t=[];function n(e){for(var r=0;r<e.length;r++){var i=e[r];t.push(i),i.children().nonempty()&&n(i.children())}}return n(this.children()),this.spawn(t,!0).filter(e)}},iN.forEachDown=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return VE(this,e,t,HE)},iN.forEachUp=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return VE(this,e,t,UE)},iN.forEachUpAndDown=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return VE(this,e,t,ZFe)},iN.ancestors=iN.parents,aN=Sze={data:VM.data({field:`data`,bindingEvent:`data`,allowBinding:!0,allowSetting:!0,settingEvent:`data`,settingTriggersEvent:!0,triggerFnName:`trigger`,allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:VM.removeData({field:`data`,event:`data`,triggerFnName:`trigger`,triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:VM.data({field:`scratch`,bindingEvent:`scratch`,allowBinding:!0,allowSetting:!0,settingEvent:`scratch`,settingTriggersEvent:!0,triggerFnName:`trigger`,allowGetting:!0,updateStyle:!0}),removeScratch:VM.removeData({field:`scratch`,event:`scratch`,triggerFnName:`trigger`,triggerEvent:!0,updateStyle:!0}),rscratch:VM.data({field:`rscratch`,allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:VM.removeData({field:`rscratch`,triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},aN.attr=aN.data,aN.removeAttr=aN.removeData,Cze=Sze,oN={},MO(oN,{degree:WE(function(e,t){return t.source().same(t.target())?2:1}),indegree:WE(function(e,t){return+!!t.target().same(e)}),outdegree:WE(function(e,t){return+!!t.source().same(e)})}),MO(oN,{minDegree:GE(`degree`,function(e,t){return e<t}),maxDegree:GE(`degree`,function(e,t){return e>t}),minIndegree:GE(`indegree`,function(e,t){return e<t}),maxIndegree:GE(`indegree`,function(e,t){return e>t}),minOutdegree:GE(`outdegree`,function(e,t){return e<t}),maxOutdegree:GE(`outdegree`,function(e,t){return e>t})}),MO(oN,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r<n.length;r++)t+=n[r].degree(e);return t}}),cN=function(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];if(!i.locked()){var a=i._private.position,o={x:t.x==null?0:t.x-a.x,y:t.y==null?0:t.y-a.y};i.isParent()&&(o.x!==0||o.y!==0)&&i.children().shift(o,n),i.dirtyBoundingBoxCache()}}},lN={field:`position`,bindingEvent:`position`,allowBinding:!0,allowSetting:!0,settingEvent:`position`,settingTriggersEvent:!0,triggerFnName:`emitAndNotify`,allowGetting:!0,validKeys:[`x`,`y`],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,t){cN(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}},sN=wze={position:VM.data(lN),silentPosition:VM.data(MO({},lN,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){cN(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(tO(e))t?this.silentPosition(e):this.position(e);else if($D(e)){var n=e,r=this.cy();r.startBatch();for(var i=0;i<this.length;i++){var a=this[i],o=void 0;(o=n(a,i))&&(t?a.silentPosition(o):a.position(o))}r.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,n){var r;if(tO(e)?(r={x:rO(e.x)?e.x:0,y:rO(e.y)?e.y:0},n=t):QD(e)&&rO(t)&&(r={x:0,y:0},r[e]=t),r!=null){var i=this.cy();i.startBatch();for(var a=0;a<this.length;a++){var o=this[a];if(!(i.hasCompoundNodes()&&o.isChild()&&o.ancestors().anySame(this))){var s=o.position(),l={x:s.x+r.x,y:s.y+r.y};n?o.silentPosition(l):o.position(l)}}i.endBatch()}return this},silentShift:function(e,t){return tO(e)?this.shift(e,!0):QD(e)&&rO(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var n=this[0],r=this.cy(),i=r.zoom(),a=r.pan(),o=tO(e)?e:void 0,s=o!==void 0||t!==void 0&&QD(e);if(n&&n.isNode()){if(s)for(var l=0;l<this.length;l++){var u=this[l];t===void 0?o!==void 0&&u.position(vA(o,i,a)):u.position(e,(t-a[e])/i)}else return o=_A(n.position(),i,a),e===void 0?o:o[e]}else if(!s)return;return this},relativePosition:function(e,t){var n=this[0],r=this.cy(),i=tO(e)?e:void 0,a=i!==void 0||t!==void 0&&QD(e),o=r.hasCompoundNodes();if(n&&n.isNode()){if(a)for(var s=0;s<this.length;s++){var l=this[s],u=o?l.parent():null,d=u&&u.length>0,f=d;d&&(u=u[0]);var p=f?u.position():{x:0,y:0};t===void 0?i!==void 0&&l.position({x:i.x+p.x,y:i.y+p.y}):l.position(e,t+p[e])}else{var m=n.position(),h=o?n.parent():null,g=h&&h.length>0,_=g;g&&(h=h[0]);var v=_?h.position():{x:0,y:0};return i={x:m.x-v.x,y:m.y-v.y},e===void 0?i:i[e]}}else if(!a)return;return this}},sN.modelPosition=sN.point=sN.position,sN.modelPositions=sN.points=sN.positions,sN.renderedPoint=sN.renderedPosition,sN.relativePoint=sN.relativePosition,Tze=wze,uN=function(e){switch(e){case`left`:case`right-inside`:return`left`;case`right`:case`left-inside`:return`right`;default:return`center`}},dN=function(e){switch(e){case`top`:case`bottom-inside`:return`top`;case`bottom`:case`top-inside`:return`bottom`;default:return`center`}},Eze=function(e){switch(e){case`left`:return`right`;case`right`:return`left`;case`left-inside`:return`left`;case`right-inside`:return`right`;default:return`center`}},fN=pN={},pN.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),a=t.x1*r+i.x,o=t.x2*r+i.x,s=t.y1*r+i.y,l=t.y2*r+i.y;return{x1:a,x2:o,y1:s,y2:l,w:o-a,h:l-s}},pN.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],t=this.cy();return!t.styleEnabled()||!t.hasCompoundNodes()||this.forEachUp(function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify(`bounds`)}}),this},pN.updateCompoundBounds=function(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes()||!e&&t.batching())return this;function n(e){if(!e.isParent())return;var t=e._private,n=e.children(),r=e.pstyle(`compound-sizing-wrt-labels`).value===`include`,i={width:{val:e.pstyle(`min-width`).pfValue,left:e.pstyle(`min-width-bias-left`),right:e.pstyle(`min-width-bias-right`)},height:{val:e.pstyle(`min-height`).pfValue,top:e.pstyle(`min-height-bias-top`),bottom:e.pstyle(`min-height-bias-bottom`)}},a=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),o=t.position;(a.w===0||a.h===0)&&(a={w:e.pstyle(`width`).pfValue,h:e.pstyle(`height`).pfValue},a.x1=o.x-a.w/2,a.x2=o.x+a.w/2,a.y1=o.y-a.h/2,a.y2=o.y+a.h/2);function s(e,t,n){var r=0,i=0,a=t+n;return e>0&&a>0&&(r=t/a*e,i=n/a*e),{biasDiff:r,biasComplementDiff:i}}function l(e,t,n,r){if(n.units===`%`)switch(r){case`width`:return e>0?n.pfValue*e:0;case`height`:return t>0?n.pfValue*t:0;case`average`:return e>0&&t>0?n.pfValue*(e+t)/2:0;case`min`:return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case`max`:return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}else if(n.units===`px`)return n.pfValue;else return 0}var u=i.width.left.value;i.width.left.units===`px`&&i.width.val>0&&(u=u*100/i.width.val);var d=i.width.right.value;i.width.right.units===`px`&&i.width.val>0&&(d=d*100/i.width.val);var f=i.height.top.value;i.height.top.units===`px`&&i.height.val>0&&(f=f*100/i.height.val);var p=i.height.bottom.value;i.height.bottom.units===`px`&&i.height.val>0&&(p=p*100/i.height.val);var m=s(i.width.val-a.w,u,d),h=m.biasDiff,g=m.biasComplementDiff,_=s(i.height.val-a.h,f,p),v=_.biasDiff,y=_.biasComplementDiff;t.autoPadding=l(a.w,a.h,e.pstyle(`padding`),e.pstyle(`padding-relative-to`).value),t.autoWidth=Math.max(a.w,i.width.val),o.x=(-h+a.x1+a.x2+g)/2,t.autoHeight=Math.max(a.h,i.height.val),o.y=(-v+a.y1+a.y2+y)/2}for(var r=0;r<this.length;r++){var i=this[r],a=i._private;(!a.compoundBoundsClean||e)&&(n(i),t.batching()||(a.compoundBoundsClean=!0))}return this},mN=function(e){return e===1/0||e===-1/0?0:e},hN=function(e,t,n,r,i){r-t!==0&&i-n!==0&&t!=null&&n!=null&&r!=null&&i!=null&&(e.x1=t<e.x1?t:e.x1,e.x2=r>e.x2?r:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},gN=function(e,t){return t==null?e:hN(e,t.x1,t.y1,t.x2,t.y2)},_N=function(e,t,n){return rA(e,t,n)},vN=function(e,t,n){if(!t.cy().headless()){var r=t._private,i=r.rstyle,a=i.arrowWidth/2,o=t.pstyle(n+`-arrow-shape`).value,s,l;if(o!==`none`){n===`source`?(s=i.srcX,l=i.srcY):n===`target`?(s=i.tgtX,l=i.tgtY):(s=i.midX,l=i.midY);var u=r.arrowBounds=r.arrowBounds||{},d=u[n]=u[n]||{};d.x1=s-a,d.y1=l-a,d.x2=s+a,d.y2=l+a,d.w=d.x2-d.x1,d.h=d.y2-d.y1,jA(d,1),hN(e,d.x1,d.y1,d.x2,d.y2)}}},yN=function(e,t,n){if(!t.cy().headless()){var r=n?n+`-`:``,i=t._private,a=i.rstyle;if(t.pstyle(r+`label`).strValue){var o=t.pstyle(`text-halign`),s=t.pstyle(`text-valign`),l=_N(a,`labelWidth`,n),u=_N(a,`labelHeight`,n),d=_N(a,`labelX`,n),f=_N(a,`labelY`,n),p=t.pstyle(r+`text-margin-x`).pfValue,m=t.pstyle(r+`text-margin-y`).pfValue,h=t.isEdge(),g=t.pstyle(r+`text-rotation`),_=t.pstyle(`text-outline-width`).pfValue,v=t.pstyle(`text-border-width`).pfValue/2,y=t.pstyle(`text-background-padding`).pfValue,b=2,x=u,S=l,C=S/2,w=x/2,T,E,D,O;if(h)T=d-C,E=d+C,D=f-w,O=f+w;else{switch(uN(o.value)){case`left`:T=d-S,E=d;break;case`center`:T=d-C,E=d+C;break;case`right`:T=d,E=d+S}switch(dN(s.value)){case`top`:D=f-x,O=f;break;case`center`:D=f-w,O=f+w;break;case`bottom`:D=f,O=f+x}}var k=p-Math.max(_,v)-y-b,A=p+Math.max(_,v)+y+b,j=m-Math.max(_,v)-y-b,M=m+Math.max(_,v)+y+b;T+=k,E+=A,D+=j,O+=M;var N=n||`main`,P=i.labelBounds,F=P[N]=P[N]||{};F.x1=T,F.y1=D,F.x2=E,F.y2=O,F.w=E-T,F.h=O-D,F.leftPad=k,F.rightPad=A,F.topPad=j,F.botPad=M;var I=h&&g.strValue===`autorotate`,L=g.pfValue!=null&&g.pfValue!==0;if(I||L){var R=I?_N(i.rstyle,`labelAngle`,n):g.pfValue,ee=Math.cos(R),z=Math.sin(R),B=(T+E)/2,te=(D+O)/2;if(!h){switch(uN(o.value)){case`left`:B=E;break;case`right`:B=T}switch(dN(s.value)){case`top`:te=O;break;case`bottom`:te=D}}var ne=function(e,t){return e-=B,t-=te,{x:e*ee-t*z+B,y:e*z+t*ee+te}},re=ne(T,D),ie=ne(T,O),ae=ne(E,D),oe=ne(E,O);T=Math.min(re.x,ie.x,ae.x,oe.x),E=Math.max(re.x,ie.x,ae.x,oe.x),D=Math.min(re.y,ie.y,ae.y,oe.y),O=Math.max(re.y,ie.y,ae.y,oe.y)}var se=N+`Rot`,ce=P[se]=P[se]||{};ce.x1=T,ce.y1=D,ce.x2=E,ce.y2=O,ce.w=E-T,ce.h=O-D,hN(e,T,D,E,O),hN(i.labelBounds.all,T,D,E,O)}return e}},bN=function(e,t){if(!t.cy().headless()){var n=t.pstyle(`outline-opacity`).value,r=t.pstyle(`outline-width`).value+t.pstyle(`outline-offset`).value;xN(e,t,n,r,`outside`,r/2)}},xN=function(e,t,n,r,i,a){if(!(n===0||r<=0||i===`inside`)){var o=t.cy().renderer(),s=o.nodeShapes[o.getNodeShape(t)];if(s){var l=t.position(),u=l.x,d=l.y,f=t.width(),p=t.height();s.hasMiterBounds?(i===`center`&&(r/=2),gN(e,s.miterBounds(u,d,f,p,r))):a!=null&&a>0&&MA(e,[a,a,a,a])}}},Dze=function(e,t){if(!t.cy().headless()){var n=t.pstyle(`border-opacity`).value,r=t.pstyle(`border-width`).pfValue,i=t.pstyle(`border-position`).value;xN(e,t,n,r,i)}},Oze=function(e,t){var n=e._private.cy,r=n.styleEnabled(),i=n.headless(),a=kA(),o=e._private,s=e.isNode(),l=e.isEdge(),u,d,f,p,m,h,g=o.rstyle,_=s&&r?e.pstyle(`bounds-expansion`).pfValue:[0],v=function(e){return e.pstyle(`display`).value!==`none`},y=!r||v(e)&&(!l||v(e.source())&&v(e.target()));if(y){var b=0,x=0;r&&t.includeOverlays&&(b=e.pstyle(`overlay-opacity`).value,b!==0&&(x=e.pstyle(`overlay-padding`).value));var S=0,C=0;r&&t.includeUnderlays&&(S=e.pstyle(`underlay-opacity`).value,S!==0&&(C=e.pstyle(`underlay-padding`).value));var w=Math.max(x,C),T=0,E=0;if(r&&(T=e.pstyle(`width`).pfValue,E=T/2),s&&t.includeNodes){var D=e.position();m=D.x,h=D.y;var O=e.outerWidth()/2,k=e.outerHeight()/2;u=m-O,d=m+O,f=h-k,p=h+k,hN(a,u,f,d,p),r&&bN(a,e),r&&t.includeOutlines&&!i&&bN(a,e),r&&Dze(a,e)}else if(l&&t.includeEdges){if(r&&!i){var A=e.pstyle(`curve-style`).strValue;if(u=Math.min(g.srcX,g.midX,g.tgtX),d=Math.max(g.srcX,g.midX,g.tgtX),f=Math.min(g.srcY,g.midY,g.tgtY),p=Math.max(g.srcY,g.midY,g.tgtY),u-=E,d+=E,f-=E,p+=E,hN(a,u,f,d,p),A===`haystack`){var j=g.haystackPts;if(j&&j.length===2){if(u=j[0].x,f=j[0].y,d=j[1].x,p=j[1].y,u>d){var M=u;u=d,d=M}if(f>p){var N=f;f=p,p=N}hN(a,u-E,f-E,d+E,p+E)}}else if(A===`bezier`||A===`unbundled-bezier`||SO(A,`segments`)||SO(A,`taxi`)){var P;switch(A){case`bezier`:case`unbundled-bezier`:P=g.bezierPts;break;case`segments`:case`taxi`:case`round-segments`:case`round-taxi`:P=g.linePts}if(P!=null)for(var F=0;F<P.length;F++){var I=P[F];u=I.x-E,d=I.x+E,f=I.y-E,p=I.y+E,hN(a,u,f,d,p)}}}else{var L=e.source().position(),R=e.target().position();if(u=L.x,d=R.x,f=L.y,p=R.y,u>d){var ee=u;u=d,d=ee}if(f>p){var z=f;f=p,p=z}u-=E,d+=E,f-=E,p+=E,hN(a,u,f,d,p)}}if(r&&t.includeEdges&&l&&(vN(a,e,`mid-source`),vN(a,e,`mid-target`),vN(a,e,`source`),vN(a,e,`target`)),r&&e.pstyle(`ghost`).value===`yes`){var B=e.pstyle(`ghost-offset-x`).pfValue,te=e.pstyle(`ghost-offset-y`).pfValue;hN(a,a.x1+B,a.y1+te,a.x2+B,a.y2+te)}var ne=o.bodyBounds=o.bodyBounds||{};NA(ne,a),MA(ne,_),jA(ne,1),r&&(u=a.x1,d=a.x2,f=a.y1,p=a.y2,hN(a,u-w,f-w,d+w,p+w));var re=o.overlayBounds=o.overlayBounds||{};NA(re,a),MA(re,_),jA(re,1);var ie=o.labelBounds=o.labelBounds||{};ie.all==null?ie.all=kA():aLe(ie.all),r&&t.includeLabels&&(t.includeMainLabels&&yN(a,e,null),l&&(t.includeSourceLabels&&yN(a,e,`source`),t.includeTargetLabels&&yN(a,e,`target`)))}return a.x1=mN(a.x1),a.y1=mN(a.y1),a.x2=mN(a.x2),a.y2=mN(a.y2),a.w=mN(a.x2-a.x1),a.h=mN(a.y2-a.y1),a.w>0&&a.h>0&&y&&(MA(a,_),jA(a,1)),a},SN=function(e){var t=0,n=function(e){return+!!e<<t++},r=0;return r+=n(e.incudeNodes),r+=n(e.includeEdges),r+=n(e.includeLabels),r+=n(e.includeMainLabels),r+=n(e.includeSourceLabels),r+=n(e.includeTargetLabels),r+=n(e.includeOverlays),r+=n(e.includeOutlines),r},CN=function(e){var t=function(e){return Math.round(e)};if(e.isEdge()){var n=e.source().position(),r=e.target().position();return jk([t(n.x),t(n.y),t(r.x),t(r.y)])}var i=e.position();return jk([t(i.x),t(i.y)])},wN=function(e,t){var n=e._private,r,i=e.isEdge(),a=(t==null?EN:SN(t))===EN;if(n.bbCache==null?(r=Oze(e,TN),n.bbCache=r,n.bbCachePosKey=CN(e)):r=n.bbCache,!a){var o=e.isNode();r=kA(),(t.includeNodes&&o||t.includeEdges&&!o)&&(t.includeOverlays?gN(r,n.overlayBounds):gN(r,n.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?gN(r,n.labelBounds.all):(t.includeMainLabels&&gN(r,n.labelBounds.mainRot),t.includeSourceLabels&&gN(r,n.labelBounds.sourceRot),t.includeTargetLabels&&gN(r,n.labelBounds.targetRot))),r.w=r.x2-r.x1,r.h=r.y2-r.y1}return r},TN={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},EN=SN(TN),DN=$k(TN),pN.boundingBox=function(e){var t,n=e===void 0||e.useCache===void 0||e.useCache===!0,r=_O(function(e){var t=e._private;return t.bbCache==null||t.styleDirty||t.bbCachePosKey!==CN(e)},function(e){return e.id()});if(n&&this.length===1&&!r(this[0]))e=e===void 0?TN:DN(e),t=wN(this[0],e);else{t=kA(),e||=TN;var i=DN(e),a=this,o=a.cy().styleEnabled();this.edges().forEach(r),this.nodes().forEach(r),o&&this.recalculateRenderedStyle(n),this.updateCompoundBounds(!n);for(var s=0;s<a.length;s++){var l=a[s];r(l)&&l.dirtyBoundingBoxCache(),gN(t,wN(l,i))}}return t.x1=mN(t.x1),t.y1=mN(t.y1),t.x2=mN(t.x2),t.y2=mN(t.y2),t.w=mN(t.x2-t.x1),t.h=mN(t.y2-t.y1),t},pN.dirtyBoundingBoxCache=function(){for(var e=0;e<this.length;e++){var t=this[e]._private;t.bbCache=null,t.bbCachePosKey=null,t.bodyBounds=null,t.overlayBounds=null,t.labelBounds.all=null,t.labelBounds.source=null,t.labelBounds.target=null,t.labelBounds.main=null,t.labelBounds.sourceRot=null,t.labelBounds.targetRot=null,t.labelBounds.mainRot=null,t.arrowBounds.source=null,t.arrowBounds.target=null,t.arrowBounds[`mid-source`]=null,t.arrowBounds[`mid-target`]=null}return this.emitAndNotify(`bounds`),this},pN.boundingBoxAt=function(e){var t=this.nodes(),n=this.cy(),r=n.hasCompoundNodes(),i=n.collection();if(r&&(i=t.filter(function(e){return e.isParent()}),t=t.not(i)),tO(e)){var a=e;e=function(){return a}}var o=function(t,n){return t._private.bbAtOldPos=e(t,n)},s=function(e){return e._private.bbAtOldPos};n.startBatch(),t.forEach(o).silentPositions(e),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0));var l=iLe(this.boundingBox({useCache:!1}));return t.silentPositions(s),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0)),n.endBatch(),l},fN.boundingbox=fN.bb=fN.boundingBox,fN.renderedBoundingbox=fN.renderedBoundingBox,kze=pN,ON=kN={},AN=function(e){e.uppercaseName=xO(e.name),e.autoName=`auto`+e.uppercaseName,e.labelName=`label`+e.uppercaseName,e.outerName=`outer`+e.uppercaseName,e.uppercaseOuterName=xO(e.outerName),ON[e.name]=function(){var t=this[0],n=t._private,r=n.cy._private.styleEnabled;if(t){if(r){if(t.isParent())return t.updateCompoundBounds(),n[e.autoName]||0;var i=t.pstyle(e.name);switch(i.strValue){case`label`:return t.recalculateRenderedStyle(),n.rstyle[e.labelName]||0;default:return i.pfValue}}else return 1}},ON[`outer`+e.uppercaseName]=function(){var t=this[0],n=t._private.cy._private.styleEnabled;if(t){if(n){var r=t[e.name](),i=t.pstyle(`border-position`).value,a=i===`center`?t.pstyle(`border-width`).pfValue:i===`outside`?2*t.pstyle(`border-width`).pfValue:0,o=2*t.padding();return r+a+o}return 1}},ON[`rendered`+e.uppercaseName]=function(){var t=this[0];if(t)return t[e.name]()*this.cy().zoom()},ON[`rendered`+e.uppercaseOuterName]=function(){var t=this[0];if(t)return t[e.outerName]()*this.cy().zoom()}},AN({name:`width`}),AN({name:`height`}),kN.padding=function(){var e=this[0],t=e._private;return e.isParent()?(e.updateCompoundBounds(),t.autoPadding===void 0?e.pstyle(`padding`).pfValue:t.autoPadding):e.pstyle(`padding`).pfValue},kN.paddedHeight=function(){var e=this[0];return e.height()+2*e.padding()},kN.paddedWidth=function(){var e=this[0];return e.width()+2*e.padding()},Aze=kN,jze=function(e,t){if(e.isEdge()&&e.takesUpSpace())return t(e)},Mze=function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy();return _A(t(e),n.zoom(),n.pan())}},Nze=function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy(),r=n.pan(),i=n.zoom();return t(e).map(function(e){return _A(e,i,r)})}},jN={controlPoints:{get:function(e){return e.renderer().getControlPoints(e)},mult:!0},segmentPoints:{get:function(e){return e.renderer().getSegmentPoints(e)},mult:!0},sourceEndpoint:{get:function(e){return e.renderer().getSourceEndpoint(e)}},targetEndpoint:{get:function(e){return e.renderer().getTargetEndpoint(e)}},midpoint:{get:function(e){return e.renderer().getEdgeMidpoint(e)}}},Pze=function(e){return`rendered`+e[0].toUpperCase()+e.substr(1)},Fze=MO({},Tze,kze,Aze,Object.keys(jN).reduce(function(e,t){var n=jN[t],r=Pze(t);return e[t]=function(){return jze(this,n.get)},e[r]=n.mult?function(){return Nze(this,n.get)}:function(){return Mze(this,n.get)},e},{})),MN=function(e,t){this.recycle(e,t)},MN.prototype={instanceString:function(){return`event`},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=KE,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?qE:KE):e!=null&&e.type?t=e:this.type=e,t!=null&&(this.originalEvent=t.originalEvent,this.type=t.type==null?this.type:t.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,r=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:n.x*r+i.x,y:n.y*r+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=qE;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=qE;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=qE,this.stopPropagation()},isDefaultPrevented:KE,isPropagationStopped:KE,isImmediatePropagationStopped:KE},NN=/^([^.]+)(\.(?:[^.]+))?$/,Ize=`.*`,PN={qualifierCompare:function(e,t){return e===t},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},FN=Object.keys(PN),Lze={},IN=JE.prototype,LN=function(e,t,n,r,i,a,o){$D(r)&&(i=r,r=null),o&&(a=a==null?o:MO({},a,o));for(var s=eO(n)?n:n.split(/\s+/),l=0;l<s.length;l++){var u=s[l];if(!fO(u)){var d=u.match(NN);if(d){var f=d[1];if(t(e,u,f,d[2]?d[2]:null,r,i,a)===!1)break}}}},RN=function(e,t){return e.addEventFields(e.context,t),new MN(t.type,t)},Rze=function(e,t,n){if(dO(n)){t(e,n);return}if(tO(n)){t(e,RN(e,n));return}for(var r=eO(n)?n:n.split(/\s+/),i=0;i<r.length;i++){var a=r[i];if(!fO(a)){var o=a.match(NN);if(o){var s=o[1];t(e,RN(e,{type:s,namespace:o[2]?o[2]:null,target:e.context}))}}}},IN.on=IN.addListener=function(e,t,n,r,i){return LN(this,function(e,t,n,r,i,a,o){$D(a)&&e.listeners.push({event:t,callback:a,type:n,namespace:r,qualifier:i,conf:o})},e,t,n,r,i),this},IN.one=function(e,t,n,r){return this.on(e,t,n,r,{one:!0})},IN.removeListener=IN.off=function(e,t,n,r){var i=this;this.emitting!==0&&(this.listeners=Yk(this.listeners));for(var a=this.listeners,o=function(o){var s=a[o];LN(i,function(t,n,r,i,l,u){if((s.type===r||e===`*`)&&(!i&&s.namespace!==`.*`||s.namespace===i)&&(!l||t.qualifierCompare(s.qualifier,l))&&(!u||s.callback===u))return a.splice(o,1),!1},e,t,n,r)},s=a.length-1;s>=0;s--)o(s);return this},IN.removeAllListeners=function(){return this.removeListener(`*`)},IN.emit=IN.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,eO(t)||(t=[t]),Rze(this,function(e,a){n!=null&&(r=[{event:a.event,type:a.type,namespace:a.namespace,callback:n}],i=r.length);for(var o=function(){var n=r[s];if(n.type===a.type&&(!n.namespace||n.namespace===a.namespace||n.namespace===Ize)&&e.eventMatches(e.context,n,a)){var i=[a];t!=null&&nA(i,t),e.beforeEmit(e.context,n,a),n.conf&&n.conf.one&&(e.listeners=e.listeners.filter(function(e){return e!==n}));var o=e.callbackContext(e.context,n,a),l=n.callback.apply(o,i);e.afterEmit(e.context,n,a),l===!1&&(a.stopPropagation(),a.preventDefault())}},s=0;s<i;s++)o();e.bubble(e.context)&&!a.isPropagationStopped()&&e.parent(e.context).emit(a,t)},e),this.emitting--,this},zze={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return r==null||e!==n.target&&sO(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,n){return t.qualifier==null?e:n.target},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},zN=function(e){return QD(e)?new eN(e):e},BN={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||=new JE(zze,t)}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var r=zN(t),i=0;i<this.length;i++)this[i].emitter().on(e,r,n);return this},removeListener:function(e,t,n){for(var r=zN(t),i=0;i<this.length;i++)this[i].emitter().removeListener(e,r,n);return this},removeAllListeners:function(){for(var e=0;e<this.length;e++)this[e].emitter().removeAllListeners();return this},one:function(e,t,n){for(var r=zN(t),i=0;i<this.length;i++)this[i].emitter().one(e,r,n);return this},once:function(e,t,n){for(var r=zN(t),i=0;i<this.length;i++)this[i].emitter().on(e,r,n,{once:!0,onceCollection:this})},emit:function(e,t){for(var n=0;n<this.length;n++)this[n].emitter().emit(e,t);return this},emitAndNotify:function(e,t){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,t),this}},VM.eventAliasesOn(BN),VN={nodes:function(e){return this.filter(function(e){return e.isNode()}).filter(e)},edges:function(e){return this.filter(function(e){return e.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),n=0;n<this.length;n++){var r=this[n];r.isNode()?e.push(r):t.push(r)}return{nodes:e,edges:t}},filter:function(e,t){if(e===void 0)return this;if(QD(e)||oO(e))return new eN(e).filter(this);if($D(e)){for(var n=this.spawn(),r=this,i=0;i<r.length;i++){var a=r[i];(t?e.apply(t,[a,i,r]):e(a,i,r))&&n.push(a)}return n}return this.spawn()},not:function(e){if(e){QD(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var r=this[n];e.has(r)||t.push(r)}return t}return this},absoluteComplement:function(){return this.cy().mutableElements().not(this)},intersect:function(e){if(QD(e)){var t=e;return this.filter(t)}for(var n=this.spawn(),r=this,i=e,a=this.length<e.length,o=a?r:i,s=a?i:r,l=0;l<o.length;l++){var u=o[l];s.has(u)&&n.push(u)}return n},xor:function(e){var t=this._private.cy;QD(e)&&(e=t.$(e));var n=this.spawn(),r=this,i=e,a=function(e,t){for(var r=0;r<e.length;r++){var i=e[r],a=i._private.data.id;t.hasElementWithId(a)||n.push(i)}};return a(r,i),a(i,r),n},diff:function(e){var t=this._private.cy;QD(e)&&(e=t.$(e));var n=this.spawn(),r=this.spawn(),i=this.spawn(),a=this,o=e,s=function(e,t,n){for(var r=0;r<e.length;r++){var a=e[r],o=a._private.data.id;t.hasElementWithId(o)?i.merge(a):n.push(a)}};return s(a,o,n),s(o,a,r),{left:n,right:r,both:i}},add:function(e){var t=this._private.cy;if(!e)return this;if(QD(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=this.spawnSelf(),i=0;i<e.length;i++){var a=e[i];this.has(a)||r.push(a)}return r},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&QD(e)){var r=e;e=n.mutableElements().filter(r)}for(var i=t.map,a=0;a<e.length;a++){var o=e[a],s=o._private.data.id;if(!i.has(s)){var l=this.length++;this[l]=o,i.set(s,{ele:o,index:l})}}return this},unmergeAt:function(e){var t=this[e].id(),n=this._private.map;this[e]=void 0,n.delete(t);var r=e===this.length-1;if(this.length>1&&!r){var i=this.length-1,a=this[i],o=a._private.data.id;this[i]=void 0,this[e]=a,n.set(o,{ele:a,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&QD(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r<e.length;r++)this.unmergeOne(e[r]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--){var n=this[t];e(n)&&this.unmergeAt(t)}return this},map:function(e,t){for(var n=[],r=this,i=0;i<r.length;i++){var a=r[i],o=t?e.apply(t,[a,i,r]):e(a,i,r);n.push(o)}return n},reduce:function(e,t){for(var n=t,r=this,i=0;i<r.length;i++)n=e(n,r[i],i,r);return n},max:function(e,t){for(var n=-1/0,r,i=this,a=0;a<i.length;a++){var o=i[a],s=t?e.apply(t,[o,a,i]):e(o,a,i);s>n&&(n=s,r=o)}return{value:n,ele:r}},min:function(e,t){for(var n=1/0,r,i=this,a=0;a<i.length;a++){var o=i[a],s=t?e.apply(t,[o,a,i]):e(o,a,i);s<n&&(n=s,r=o)}return{value:n,ele:r}}},HN=VN,HN.u=HN[`|`]=HN[`+`]=HN.union=HN.or=HN.add,HN[`\\`]=HN[`!`]=HN[`-`]=HN.difference=HN.relativeComplement=HN.subtract=HN.not,HN.n=HN[`&`]=HN[`.`]=HN.and=HN.intersection=HN.intersect,HN[`^`]=HN[`(+)`]=HN[`(-)`]=HN.symmetricDifference=HN.symdiff=HN.xor,HN.fnFilter=HN.filterFn=HN.stdFilter=HN.filter,HN.complement=HN.abscomp=HN.absoluteComplement,Bze={isNode:function(){return this.group()===`nodes`},isEdge:function(){return this.group()===`edges`},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},UN=function(e,t){var n=e.cy().hasCompoundNodes();function r(e){var t=e.pstyle(`z-compound-depth`);return t.value===`auto`?n?e.zDepth():0:t.value===`bottom`?-1:t.value===`top`?zk:0}var i=r(e)-r(t);if(i!==0)return i;function a(e){return e.pstyle(`z-index-compare`).value===`auto`?+!!e.isNode():0}var o=a(e)-a(t);if(o!==0)return o;var s=e.pstyle(`z-index`).value-t.pstyle(`z-index`).value;return s===0?e.poolIndex()-t.poolIndex():s},WN={forEach:function(e,t){if($D(e))for(var n=this.length,r=0;r<n;r++){var i=this[r];if((t?e.apply(t,[i,r,this]):e(i,r,this))===!1)break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var n=[],r=this.length;t??=r,e??=0,e<0&&(e=r+e),t<0&&(t=r+t);for(var i=e;i>=0&&i<t&&i<r;i++)n.push(this[i]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!$D(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(UN)},zDepth:function(){var e=this[0];if(e){var t=e._private;if(t.group===`nodes`){var n=t.data.parent?e.parents().size():0;return e.isParent()?n:zk-1}var r=t.source,i=t.target,a=r.zDepth(),o=i.zDepth();return Math.max(a,o,0)}}},WN.each=WN.forEach,(function(){var e=`undefined`;(typeof Symbol>`u`?`undefined`:bE(Symbol))!=e&&bE(Symbol.iterator)!=e&&(WN[Symbol.iterator]=function(){var e=this,t={value:void 0,done:!1},n=0,r=this.length;return WPe({next:function(){return n<r?t.value=e[n++]:(t.value=void 0,t.done=!0),t}},Symbol.iterator,function(){return this})})})(),Vze=$k({nodeDimensionsIncludeLabels:!1}),GN={layoutDimensions:function(e){e=Vze(e);var t;if(!this.takesUpSpace())t={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();t={w:n.w,h:n.h}}else t={w:this.outerWidth(),h:this.outerHeight()};return(t.w===0||t.h===0)&&(t.w=t.h=1),t},layoutPositions:function(e,t,n){var r=this.nodes().filter(function(e){return!e.isParent()}),i=this.cy(),a=t.eles,o=function(e){return e.id()},s=_O(n,o);e.emit({type:`layoutstart`,layout:e}),e.animations=[];var l=function(e,t,n){var r={x:t.x1+t.w/2,y:t.y1+t.h/2},i={x:(n.x-r.x)*e,y:(n.y-r.y)*e};return{x:r.x+i.x,y:r.y+i.y}},u=t.spacingFactor&&t.spacingFactor!==1,d=function(){if(!u)return null;for(var e=kA(),t=0;t<r.length;t++){var n=r[t],i=s(n,t);AA(e,i.x,i.y)}return e}(),f=_O(function(e,n){var r=s(e,n);return u&&(r=l(Math.abs(t.spacingFactor),d,r)),t.transform!=null&&(r=t.transform(e,r)),r},o);if(t.animate){for(var p=0;p<r.length;p++){var m=r[p],h=f(m,p);if(t.animateFilter==null||t.animateFilter(m,p)){var g=m.animation({position:h,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(g)}else m.position(h)}if(t.fit){var _=i.animation({fit:{boundingBox:a.boundingBoxAt(f),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(_)}else if(t.zoom!==void 0&&t.pan!==void 0){var v=i.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(v)}e.animations.forEach(function(e){return e.play()}),e.one(`layoutready`,t.ready),e.emit({type:`layoutready`,layout:e}),Vj.all(e.animations.map(function(e){return e.promise()})).then(function(){e.one(`layoutstop`,t.stop),e.emit({type:`layoutstop`,layout:e})})}else r.positions(f),t.fit&&i.fit(t.eles,t.padding),t.zoom!=null&&i.zoom(t.zoom),t.pan&&i.pan(t.pan),e.one(`layoutready`,t.ready),e.emit({type:`layoutready`,layout:e}),e.one(`layoutstop`,t.stop),e.emit({type:`layoutstop`,layout:e});return this},layout:function(e){return this.cy().makeLayout(MO({},e,{eles:this}))}},GN.createLayout=GN.makeLayout=GN.layout,KN={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),r=t.styleEnabled();return n&&r&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),t=function(e){return e._private.styleCache=null};if(e.hasCompoundNodes()){var n=this.spawnSelf().merge(this.descendants()).merge(this.parents());n.merge(n.connectedEdges()),n.forEach(t)}else this.forEach(function(e){t(e),e.connectedEdges().forEach(t)});return this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching())return t._private.batchStyleEles.merge(this),this;var n=t.hasCompoundNodes(),r=this;e=!!(e||e===void 0),n&&(r=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var i=r;return e?i.emitAndNotify(`style`):i.emit(`style`),r.forEach(function(e){return e._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var t=0;t<this.length;t++){var n=this[t];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],r=n.cy();if(r.styleEnabled()&&n)return n._private.styleDirty&&(n._private.styleDirty=!1,r.style().apply(n)),n._private.style[e]??(t?r.style().getDefaultProperty(e):null)},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return n.pfValue===void 0?n.value:n.pfValue}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];if(n)return t.style().getRenderedStyle(n,e)},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var r=!1,i=n.style();if(tO(e)){var a=e;i.applyBypass(this,a,r),this.emitAndNotify(`style`)}else if(QD(e)){if(t===void 0){var o=this[0];return o?i.getStylePropertyValue(o,e):void 0}i.applyBypass(this,e,t,r),this.emitAndNotify(`style`)}else if(e===void 0){var s=this[0];return s?i.getRawStyle(s):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,r=t.style(),i=this;if(e===void 0)for(var a=0;a<i.length;a++){var o=i[a];r.removeAllBypasses(o,n)}else{e=e.split(/\s+/);for(var s=0;s<i.length;s++){var l=i[s];r.removeBypasses(l,e,n)}}return this.emitAndNotify(`style`),this},show:function(){return this.css(`display`,`element`),this},hide:function(){return this.css(`display`,`none`),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),n=this[0];if(n){var r=n._private,i=n.pstyle(`opacity`).value;if(!t)return i;var a=r.data.parent?n.parents():null;if(a)for(var o=0;o<a.length;o++)i=a[o].pstyle(`opacity`).value*i;return i}},transparent:function(){if(!this.cy().styleEnabled())return!1;var e=this[0],t=e.cy().hasCompoundNodes();if(e)return t?e.effectiveOpacity()===0:e.pstyle(`opacity`).value===0},backgrounding:function(){return this.cy().styleEnabled()?!!this[0]._private.backgrounding:!1}},qN=XE(`eleTakesUpSpace`,function(e){return e.pstyle(`display`).value===`element`&&e.width()!==0&&(!e.isNode()||e.height()!==0)}),KN.takesUpSpace=ZE(`takesUpSpace`,$E({ok:qN})),KN.interactive=ZE(`interactive`,$E({ok:XE(`eleInteractive`,function(e){return e.pstyle(`events`).value===`yes`&&e.pstyle(`visibility`).value===`visible`&&qN(e)}),parentOk:XE(`parentInteractive`,function(e){return e.pstyle(`visibility`).value===`visible`&&qN(e)}),edgeOkViaNode:qN})),KN.noninteractive=function(){var e=this[0];if(e)return!e.interactive()},KN.visible=ZE(`visible`,$E({ok:XE(`eleVisible`,function(e){return e.pstyle(`visibility`).value===`visible`&&e.pstyle(`opacity`).pfValue!==0&&qN(e)}),edgeOkViaNode:qN})),KN.hidden=function(){var e=this[0];if(e)return!e.visible()},KN.isBundledBezier=ZE(`isBundledBezier`,function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle(`curve-style`).value===`bezier`&&this.takesUpSpace():!1}),KN.bypass=KN.css=KN.style,KN.renderedCss=KN.renderedStyle,KN.removeBypass=KN.removeCss=KN.removeStyle,KN.pstyle=KN.parsedStyle,JN={},tD({field:`locked`,overrideField:function(e){return e.cy().autolock()?!0:void 0},on:`lock`,off:`unlock`}),tD({field:`grabbable`,overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:`grabify`,off:`ungrabify`}),tD({field:`selected`,ableField:`selectable`,overrideAble:function(e){return!e.cy().autounselectify()&&void 0},on:`select`,off:`unselect`}),tD({field:`selectable`,overrideField:function(e){return!e.cy().autounselectify()&&void 0},on:`selectify`,off:`unselectify`}),JN.deselect=JN.unselect,JN.grabbed=function(){var e=this[0];if(e)return e._private.grabbed},tD({field:`active`,on:`activate`,off:`unactivate`}),tD({field:`pannable`,on:`panify`,off:`unpanify`}),JN.inactive=function(){var e=this[0];if(e)return!e._private.active},YN={},XN=function(e){return function(t){for(var n=this,r=[],i=0;i<n.length;i++){var a=n[i];if(a.isNode()){for(var o=!1,s=a.connectedEdges(),l=0;l<s.length;l++){var u=s[l],d=u.source(),f=u.target();if(e.noIncomingEdges&&f===a&&d!==a||e.noOutgoingEdges&&d===a&&f!==a){o=!0;break}}o||r.push(a)}}return this.spawn(r,!0).filter(t)}},ZN=function(e){return function(t){for(var n=this,r=[],i=0;i<n.length;i++){var a=n[i];if(a.isNode())for(var o=a.connectedEdges(),s=0;s<o.length;s++){var l=o[s],u=l.source(),d=l.target();e.outgoing&&u===a?(r.push(l),r.push(d)):e.incoming&&d===a&&(r.push(l),r.push(u))}}return this.spawn(r,!0).filter(t)}},QN=function(e){return function(t){for(var n=this,r=[],i={};;){var a=e.outgoing?n.outgoers():n.incomers();if(a.length===0)break;for(var o=!1,s=0;s<a.length;s++){var l=a[s],u=l.id();i[u]||(i[u]=!0,r.push(l),o=!0)}if(!o)break;n=a}return this.spawn(r,!0).filter(t)}},YN.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null},MO(YN,{roots:XN({noIncomingEdges:!0}),leaves:XN({noOutgoingEdges:!0}),outgoers:rN(ZN({outgoing:!0}),`outgoers`),successors:QN({outgoing:!0}),incomers:rN(ZN({incoming:!0}),`incomers`),predecessors:QN({})}),MO(YN,{neighborhood:rN(function(e){for(var t=[],n=this.nodes(),r=0;r<n.length;r++)for(var i=n[r],a=i.connectedEdges(),o=0;o<a.length;o++){var s=a[o],l=s.source(),u=s.target(),d=i===l?u:l;d.length>0&&t.push(d[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)},`neighborhood`),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),YN.neighbourhood=YN.neighborhood,YN.closedNeighbourhood=YN.closedNeighborhood,YN.openNeighbourhood=YN.openNeighborhood,MO(YN,{source:rN(function(e){var t=this[0],n;return t&&(n=t._private.source||t.cy().collection()),n&&e?n.filter(e):n},`source`),target:rN(function(e){var t=this[0],n;return t&&(n=t._private.target||t.cy().collection()),n&&e?n.filter(e):n},`target`),sources:nD({attr:`source`}),targets:nD({attr:`target`})}),MO(YN,{edgesWith:rN(rD(),`edgesWith`),edgesTo:rN(rD({thisIsSrc:!0}),`edgesTo`)}),MO(YN,{connectedEdges:rN(function(e){for(var t=[],n=this,r=0;r<n.length;r++){var i=n[r];if(i.isNode())for(var a=i._private.edges,o=0;o<a.length;o++){var s=a[o];t.push(s)}}return this.spawn(t,!0).filter(e)},`connectedEdges`),connectedNodes:rN(function(e){for(var t=[],n=this,r=0;r<n.length;r++){var i=n[r];i.isEdge()&&(t.push(i.source()[0]),t.push(i.target()[0]))}return this.spawn(t,!0).filter(e)},`connectedNodes`),parallelEdges:rN(iD(),`parallelEdges`),codirectedEdges:rN(iD({codirected:!0}),`codirectedEdges`)}),MO(YN,{components:function(e){var t=this,n=t.cy(),r=n.collection(),i=e==null?t.nodes():e.nodes(),a=[];e!=null&&i.empty()&&(i=e.sources());var o=function(e,t){r.merge(e),i.unmerge(e),t.merge(e)};if(i.empty())return t.spawn();var s=function(){var e=n.collection();a.push(e);var r=i[0];o(r,e),t.bfs({directed:!1,roots:r,visit:function(t){return o(t,e)}}),e.forEach(function(n){n.connectedEdges().forEach(function(n){t.has(n)&&e.has(n.source())&&e.has(n.target())&&e.merge(n)})})};do s();while(i.length>0);return a},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),YN.componentsOf=YN.components,$N=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(e===void 0){Wk(`A collection must have a reference to the core`);return}var i=new aA,a=!1;if(!t)t=[];else if(t.length>0&&tO(t[0])&&!sO(t[0])){a=!0;for(var o=[],s=new cA,l=0,u=t.length;l<u;l++){var d=t[l];d.data??={};var f=d.data;if(f.id==null)f.id=Xk();else if(e.hasElementWithId(f.id)||s.has(f.id))continue;var p=new lA(e,d,!1);o.push(p),s.add(f.id)}t=o}this.length=0;for(var m=0,h=t.length;m<h;m++){var g=t[m][0];if(g!=null){var _=g._private.data.id;(!n||!i.has(_))&&(n&&i.set(_,{index:this.length,ele:g}),this[this.length]=g,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap??this.rebuildMap(),this.lazyMap},set map(e){this.lazyMap=e},rebuildMap:function(){for(var e=this.lazyMap=new aA,t=this.eles,n=0;n<t.length;n++){var r=t[n];e.set(r.id(),{index:n,ele:r})}}},n&&(this._private.map=i),a&&!r&&this.restore()},eP=lA.prototype=$N.prototype=Object.create(Array.prototype),eP.instanceString=function(){return`collection`},eP.spawn=function(e,t){return new $N(this.cy(),e,t)},eP.spawnSelf=function(){return this.spawn(this)},eP.cy=function(){return this._private.cy},eP.renderer=function(){return this._private.cy.renderer()},eP.element=function(){return this[0]},eP.collection=function(){return cO(this)?this:new $N(this._private.cy,[this])},eP.unique=function(){return new $N(this._private.cy,this,!0)},eP.hasElementWithId=function(e){return e=``+e,this._private.map.has(e)},eP.getElementById=function(e){e=``+e;var t=this._private.cy,n=this._private.map.get(e);return n?n.ele:new $N(t)},eP.$id=eP.getElementById,eP.poolIndex=function(){var e=this._private.cy._private.elements,t=this[0]._private.data.id;return e._private.map.get(t).index},eP.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index},eP.indexOfId=function(e){return e=``+e,this._private.map.get(e).index},eP.json=function(e){var t=this.element(),n=this.cy();if(t==null&&e)return this;if(t!=null){var r=t._private;if(tO(e)){if(n.startBatch(),e.data){t.data(e.data);var i=r.data;if(t.isEdge()){var a=!1,o={},s=e.data.source,l=e.data.target;s!=null&&s!=i.source&&(o.source=``+s,a=!0),l!=null&&l!=i.target&&(o.target=``+l,a=!0),a&&(t=t.move(o))}else{var u=(`parent`in e.data),d=e.data.parent;u&&(d!=null||i.parent!=null)&&d!=i.parent&&(d===void 0&&(d=null),d!=null&&(d=``+d),t=t.move({parent:d}))}}e.position&&t.position(e.position);var f=function(n,i,a){var o=e[n];o!=null&&o!==r[n]&&(o?t[i]():t[a]())};return f(`removed`,`remove`,`restore`),f(`selected`,`select`,`unselect`),f(`selectable`,`selectify`,`unselectify`),f(`locked`,`lock`,`unlock`),f(`grabbable`,`grabify`,`ungrabify`),f(`pannable`,`panify`,`unpanify`),e.classes!=null&&t.classes(e.classes),n.endBatch(),this}if(e===void 0){var p={data:Jk(r.data),position:Jk(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:null};p.classes=``;var m=0;return r.classes.forEach(function(e){return p.classes+=m++===0?e:` `+e}),p}}},eP.jsons=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t].json();e.push(n)}return e},eP.clone=function(){for(var e=this.cy(),t=[],n=0;n<this.length;n++){var r=new lA(e,this[n].json(),!1);t.push(r)}return new $N(e,t)},eP.copy=eP.clone,eP.restore=function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,r=n.cy(),i=r._private,a=[],o=[],s,l=0,u=n.length;l<u;l++){var d=n[l];t&&!d.removed()||(d.isNode()?a.push(d):o.push(d))}s=a.concat(o);var f,p=function(){s.splice(f,1),f--};for(f=0;f<s.length;f++){var m=s[f],h=m._private,g=h.data;if(m.clearTraversalCache(),!(!t&&!h.removed)){if(g.id===void 0)g.id=Xk();else if(rO(g.id))g.id=``+g.id;else if(fO(g.id)||!QD(g.id)){Wk("Can not create element with invalid string ID `"+g.id+"`"),p();continue}else if(r.hasElementWithId(g.id)){Wk("Can not create second element with ID `"+g.id+"`"),p();continue}}var _=g.id;if(m.isNode()){var v=h.position;v.x??=0,v.y??=0}if(m.isEdge()){for(var y=m,b=[`source`,`target`],x=b.length,S=!1,C=0;C<x;C++){var w=b[C],T=g[w];rO(T)&&(T=g[w]=``+g[w]),T==null||T===``?(Wk("Can not create edge `"+_+"` with unspecified "+w),S=!0):r.hasElementWithId(T)||(Wk("Can not create edge `"+_+"` with nonexistent "+w+" `"+T+"`"),S=!0)}if(S){p();continue}var E=r.getElementById(g.source),D=r.getElementById(g.target);E.same(D)?E._private.edges.push(y):(E._private.edges.push(y),D._private.edges.push(y)),y._private.source=E,y._private.target=D}h.map=new aA,h.map.set(_,{ele:m,index:0}),h.removed=!1,t&&r.addToPool(m)}for(var O=0;O<a.length;O++){var k=a[O],A=k._private.data;rO(A.parent)&&(A.parent=``+A.parent);var j=A.parent;if(j!=null||k._private.parent){var M=k._private.parent?r.collection().merge(k._private.parent):r.getElementById(j);if(M.empty())A.parent=void 0;else if(M[0].removed())Kk(`Node added with missing parent, reference to parent removed`),A.parent=void 0,k._private.parent=null;else{for(var N=!1,P=M;!P.empty();){if(k.same(P)){N=!0,A.parent=void 0;break}P=P.parent()}N||(M[0]._private.children.push(k),k._private.parent=M[0],i.hasCompoundNodes=!0)}}}if(s.length>0){for(var F=s.length===n.length?n:new $N(r,s),I=0;I<F.length;I++){var L=F[I];L.isNode()||(L.parallelEdges().clearTraversalCache(),L.source().clearTraversalCache(),L.target().clearTraversalCache())}(i.hasCompoundNodes?r.collection().merge(F).merge(F.connectedNodes()).merge(F.parent()):F).dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(e),e?F.emitAndNotify(`add`):t&&F.emit(`add`)}return n},eP.removed=function(){var e=this[0];return e&&e._private.removed},eP.inside=function(){var e=this[0];return e&&!e._private.removed},eP.remove=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,r=[],i={},a=n._private.cy;function o(e){for(var t=e._private.edges,n=0;n<t.length;n++)l(t[n])}function s(e){for(var t=e._private.children,n=0;n<t.length;n++)l(t[n])}function l(e){var n=i[e.id()];t&&e.removed()||n||(i[e.id()]=!0,e.isNode()?(r.push(e),o(e),s(e)):r.unshift(e))}for(var u=0,d=n.length;u<d;u++){var f=n[u];l(f)}function p(e,t){var n=e._private.edges;eA(n,t),e.clearTraversalCache()}function m(e){e.clearTraversalCache()}var h=[];h.ids={};function g(e,t){t=t[0],e=e[0];var n=e._private.children,r=e.id();eA(n,t),t._private.parent=null,h.ids[r]||(h.ids[r]=!0,h.push(e))}n.dirtyCompoundBoundsCache(),t&&a.removeFromPool(r);for(var _=0;_<r.length;_++){var v=r[_];if(v.isEdge()){var y=v.source()[0],b=v.target()[0];p(y,v),p(b,v);for(var x=v.parallelEdges(),S=0;S<x.length;S++){var C=x[S];m(C),C.isBundledBezier()&&C.dirtyBoundingBoxCache()}}else{var w=v.parent();w.length!==0&&g(w,v)}t&&(v._private.removed=!0)}var T=a._private.elements;a._private.hasCompoundNodes=!1;for(var E=0;E<T.length;E++)if(T[E].isParent()){a._private.hasCompoundNodes=!0;break}var D=new $N(this.cy(),r);D.size()>0&&(e?D.emitAndNotify(`remove`):t&&D.emit(`remove`));for(var O=0;O<h.length;O++){var k=h[O];(!t||!k.removed())&&k.updateStyle()}return D},eP.move=function(e){var t=this._private.cy,n=this,r=!1,i=!1,a=function(e){return e==null?e:``+e};if(e.source!==void 0||e.target!==void 0){var o=a(e.source),s=a(e.target),l=o!=null&&t.hasElementWithId(o),u=s!=null&&t.hasElementWithId(s);(l||u)&&(t.batch(function(){n.remove(r,i),n.emitAndNotify(`moveout`);for(var e=0;e<n.length;e++){var t=n[e],a=t._private.data;t.isEdge()&&(l&&(a.source=o),u&&(a.target=s))}n.restore(r,i)}),n.emitAndNotify(`move`))}else if(e.parent!==void 0){var d=a(e.parent);if(d===null||t.hasElementWithId(d)){var f=d===null?void 0:d;t.batch(function(){var e=n.remove(r,i);e.emitAndNotify(`moveout`);for(var t=0;t<n.length;t++){var a=n[t],o=a._private.data;a.isNode()&&(o.parent=f)}e.restore(r,i)}),n.emitAndNotify(`move`)}}return this},[jj,dze,HM,nN,iN,Cze,oN,Fze,BN,VN,Bze,WN,GN,KN,JN,YN].forEach(function(e){MO(eP,e)}),Hze={add:function(e){var t,n=this;if(oO(e)){var r=e;if(r._private.cy===n)t=r.restore();else{for(var i=[],a=0;a<r.length;a++){var o=r[a];i.push(o.json())}t=new $N(n,i)}}else if(eO(e))t=new $N(n,e);else if(tO(e)&&(eO(e.nodes)||eO(e.edges))){for(var s=e,l=[],u=[`nodes`,`edges`],d=0,f=u.length;d<f;d++){var p=u[d],m=s[p];if(eO(m))for(var h=0,g=m.length;h<g;h++){var _=MO({group:p},m[h]);l.push(_)}}t=new $N(n,l)}else t=new lA(n,e).collection();return t},remove:function(e){if(!oO(e)&&QD(e)){var t=e;e=this.$(t)}return e.remove()}},Uze=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},a=t(n,r*.5,i),o=t(n,r*.5,a),s=t(n,r,o),l=1/6*(i.dx+2*(a.dx+o.dx)+s.dx),u=1/6*(i.dv+2*(a.dv+o.dv)+s.dv);return n.x+=l*r,n.v+=u*r,n}return function e(t,r,i){var a={x:-1,v:0,tension:null,friction:null},o=[0],s=0,l=1/1e4,u=16/1e3,d,f,p;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i||=null,a.tension=t,a.friction=r,d=i!==null,d?(s=e(t,r),f=s/i*u):f=u;p=n(p||a,f),o.push(1+p.x),s+=16,Math.abs(p.x)>l&&Math.abs(p.v)>l;);return d?function(e){return o[e*(o.length-1)|0]}:s}}(),tP=function(e,t,n,r){var i=QFe(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},nP={linear:function(e,t,n){return e+(t-e)*n},ease:tP(.25,.1,.25,1),"ease-in":tP(.42,0,1,1),"ease-out":tP(0,0,.58,1),"ease-in-out":tP(.42,0,.58,1),"ease-in-sine":tP(.47,0,.745,.715),"ease-out-sine":tP(.39,.575,.565,1),"ease-in-out-sine":tP(.445,.05,.55,.95),"ease-in-quad":tP(.55,.085,.68,.53),"ease-out-quad":tP(.25,.46,.45,.94),"ease-in-out-quad":tP(.455,.03,.515,.955),"ease-in-cubic":tP(.55,.055,.675,.19),"ease-out-cubic":tP(.215,.61,.355,1),"ease-in-out-cubic":tP(.645,.045,.355,1),"ease-in-quart":tP(.895,.03,.685,.22),"ease-out-quart":tP(.165,.84,.44,1),"ease-in-out-quart":tP(.77,0,.175,1),"ease-in-quint":tP(.755,.05,.855,.06),"ease-out-quint":tP(.23,1,.32,1),"ease-in-out-quint":tP(.86,0,.07,1),"ease-in-expo":tP(.95,.05,.795,.035),"ease-out-expo":tP(.19,1,.22,1),"ease-in-out-expo":tP(1,0,0,1),"ease-in-circ":tP(.6,.04,.98,.335),"ease-out-circ":tP(.075,.82,.165,1),"ease-in-out-circ":tP(.785,.135,.15,.86),spring:function(e,t,n){if(n===0)return nP.linear;var r=Uze(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":tP},Wze={animate:VM.animate(),animation:VM.animation(),animated:VM.animated(),clearQueue:VM.clearQueue(),delay:VM.delay(),delayAnimation:VM.delayAnimation(),stop:VM.stop(),addToAnimationPool:function(e){var t=this;t.styleEnabled()&&t._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function t(){e._private.animationsRunning&&bk(function(n){lD(n,e),t()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(t,n){lD(n,e)},n.beforeRenderPriorities.animations):t()}},Gze={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return r==null||e!==n.target&&sO(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return t.qualifier==null?e:n.target}},rP=function(e){return QD(e)?new eN(e):e},iP={createEmitter:function(){var e=this._private;return e.emitter||=new JE(Gze,this),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,rP(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,rP(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,rP(t),n),this},once:function(e,t,n){return this.emitter().one(e,rP(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}},VM.eventAliasesOn(iP),aP={png:function(e){var t=this._private.renderer;return e||={},t.png(e)},jpg:function(e){var t=this._private.renderer;return e||={},e.bg=e.bg||`#fff`,t.jpg(e)}},aP.jpeg=aP.jpg,oP={layout:function(e){var t=this;if(e==null){Wk(`Layout options must be specified to make a layout`);return}if(e.name==null){Wk("A `name` must be specified to make a layout");return}var n=e.name,r=t.extension(`layout`,n);if(r==null){Wk("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i=QD(e.eles)?t.$(e.eles):e.eles==null?t.$():e.eles;return new r(MO({},e,{cy:t,eles:i}))}},oP.createLayout=oP.makeLayout=oP.layout,Kze={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();t!=null&&r.merge(t);return}if(n.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,t)}},notifications:function(e){var t=this._private;return e===void 0?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount??=0,e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var n=Object.keys(e),r=0;r<n.length;r++){var i=n[r],a=e[i];t.getElementById(i).data(a)}})}},qze=$k({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),sP={renderTo:function(e,t,n,r){return this._private.renderer.renderTo(e,t,n,r),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify(`draw`),this},resize:function(){return this.invalidateSize(),this.emitAndNotify(`resize`),this},initRenderer:function(e){var t=this,n=t.extension(`renderer`,e.name);if(n==null){Wk(`Can not initialise: No such renderer \`${e.name}\` found. Did you forget to import it and \`cytoscape.use()\` it?`);return}e.wheelSensitivity!==void 0&&Kk(`You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.`);var r=qze(e);r.cy=t,t._private.renderer=new n(r),this.notify(`init`)},destroyRenderer:function(){var e=this;e.notify(`destroy`);var t=e.container();if(t)for(t._cyreg=null;t.childNodes.length>0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(e){var t=e._private;t.rscratch={},t.rstyle={},t.animation.current=[],t.animation.queue=[]})},onRender:function(e){return this.on(`render`,e)},offRender:function(e){return this.off(`render`,e)}},sP.invalidateDimensions=sP.resize,cP={collection:function(e,t){return QD(e)?this.$(e):oO(e)?e.collection():eO(e)?(t||={},new $N(this,e,t.unique,t.removed)):new $N(this)},nodes:function(e){var t=this.$(function(e){return e.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(e){return e.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}},cP.elements=cP.filter=cP.$,lP={},uP=`t`,Jze=`f`,lP.apply=function(e){for(var t=this,n=t._private.cy.collection(),r=0;r<e.length;r++){var i=e[r],a=t.getContextMeta(i);if(!a.empty){var o=t.getContextStyle(a),s=t.applyContextStyle(a,o,i);i._private.appliedInitStyle?t.updateTransitions(i,s.diffProps):i._private.appliedInitStyle=!0,t.updateStyleHints(i)&&n.push(i)}}return n},lP.getPropertiesDiff=function(e,t){var n=this,r=n._private.propDiffs=n._private.propDiffs||{},i=e+`-`+t,a=r[i];if(a)return a;for(var o=[],s={},l=0;l<n.length;l++){var u=n[l],d=e[l]===uP,f=t[l]===uP,p=d!==f,m=u.mappedProperties.length>0;if(p||f&&m){var h=void 0;p&&m||p?h=u.properties:m&&(h=u.mappedProperties);for(var g=0;g<h.length;g++){for(var _=h[g],v=_.name,y=!1,b=l+1;b<n.length;b++){var x=n[b];if(t[b]===uP&&(y=x.properties[_.name]!=null,y))break}!s[v]&&!y&&(s[v]=!0,o.push(v))}}}return r[i]=o,o},lP.getContextMeta=function(e){for(var t=this,n=``,r,i=e._private.styleCxtKey||``,a=0;a<t.length;a++){var o=t[a];o.selector&&o.selector.matches(e)?n+=uP:n+=Jze}return r=t.getPropertiesDiff(i,n),e._private.styleCxtKey=n,{key:n,diffPropNames:r,empty:r.length===0}},lP.getContextStyle=function(e){var t=e.key,n=this,r=this._private.contextStyles=this._private.contextStyles||{};if(r[t])return r[t];for(var i={_private:{key:t}},a=0;a<n.length;a++){var o=n[a];if(t[a]===uP)for(var s=0;s<o.properties.length;s++){var l=o.properties[s];i[l.name]=l}}return r[t]=i,i},lP.applyContextStyle=function(e,t,n){for(var r=this,i=e.diffPropNames,a={},o=r.types,s=0;s<i.length;s++){var l=i[s],u=t[l],d=n.pstyle(l);if(!u){if(d)u=d.bypass?{name:l,deleteBypassed:!0}:{name:l,delete:!0};else continue}if(d!==u){if(u.mapped===o.fn&&d!=null&&d.mapping!=null&&d.mapping.value===u.value){var f=d.mapping;if((f.fnValue=u.value(n))===f.prevFnValue)continue}var p=a[l]={prev:d};r.applyParsedProperty(n,u),p.next=n.pstyle(l),p.next&&p.next.bypass&&(p.next=p.next.bypassed)}}return{diffProps:a}},lP.updateStyleHints=function(e){var t=e._private,n=this,r=n.propertyGroupNames,i=n.propertyGroupKeys,a=function(e,t,r){return n.getPropertiesHash(e,t,r)},o=t.styleKey;if(e.removed())return!1;var s=t.group===`nodes`,l=e._private.style;r=Object.keys(l);for(var u=0;u<i.length;u++){var d=i[u];t.styleKeys[d]=[Sk,wk]}for(var f=function(e,n){return t.styleKeys[n][0]=Ek(e,t.styleKeys[n][0])},p=function(e,n){return t.styleKeys[n][1]=Dk(e,t.styleKeys[n][1])},m=function(e,t){f(e,t),p(e,t)},h=function(e,t){for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);f(r,t),p(r,t)}},g=2e9,_=function(e){return-128<e&&e<128&&Math.floor(e)!==e?g-(e*1024|0):e},v=0;v<r.length;v++){var y=r[v],b=l[y];if(b!=null){var x=this.properties[y],S=x.type,C=x.groupKey,w=void 0;x.hashOverride==null?b.pfValue!=null&&(w=b.pfValue):w=x.hashOverride(e,b);var T=x.enums==null?b.value:null,E=w!=null,D=E||T!=null,O=b.units;S.number&&D&&!S.multiple?(m(_(E?w:T),C),!E&&O!=null&&h(O,C)):h(b.strValue,C)}}for(var k=[Sk,wk],A=0;A<i.length;A++){var j=i[A],M=t.styleKeys[j];k[0]=Ek(M[0],k[0]),k[1]=Dk(M[1],k[1])}t.styleKey=Ok(k[0],k[1]);var N=t.styleKeys;t.labelDimsKey=kk(N.labelDimensions);var P=a(e,[`label`],N.labelDimensions);if(t.labelKey=kk(P),t.labelStyleKey=kk(Ak(N.commonLabel,P)),!s){var F=a(e,[`source-label`],N.labelDimensions);t.sourceLabelKey=kk(F),t.sourceLabelStyleKey=kk(Ak(N.commonLabel,F));var I=a(e,[`target-label`],N.labelDimensions);t.targetLabelKey=kk(I),t.targetLabelStyleKey=kk(Ak(N.commonLabel,I))}if(s){var L=t.styleKeys,R=L.nodeBody,ee=L.nodeBorder,z=L.nodeOutline,B=L.backgroundImage,te=L.compound,ne=L.pie,re=L.stripe;t.nodeKey=kk([R,ee,z,B,te,ne,re].filter(function(e){return e!=null}).reduce(Ak,[Sk,wk])),t.hasPie=ne!=null&&ne[0]!==Sk&&ne[1]!==wk,t.hasStripe=re!=null&&re[0]!==Sk&&re[1]!==wk}return o!==t.styleKey},lP.clearStyleHints=function(e){var t=e._private;t.styleCxtKey=``,t.styleKeys={},t.styleKey=null,t.labelKey=null,t.labelStyleKey=null,t.sourceLabelKey=null,t.sourceLabelStyleKey=null,t.targetLabelKey=null,t.targetLabelStyleKey=null,t.nodeKey=null,t.hasPie=null,t.hasStripe=null},lP.applyParsedProperty=function(e,t){var n=this,r=t,i=e._private.style,a,o=n.types,s=n.properties[r.name].type,l=r.bypass,u=i[r.name],d=u&&u.bypass,f=e._private,p=`mapping`,m=function(e){return e==null?null:e.pfValue==null?e.value:e.pfValue},h=function(){var t=m(u),i=m(r);n.checkTriggers(e,r.name,t,i)};if(t.name===`curve-style`&&e.isEdge()&&(t.value!==`bezier`&&e.isLoop()||t.value===`haystack`&&(e.source().isParent()||e.target().isParent()))&&(r=t=this.parse(t.name,`bezier`,l)),r.delete)return i[r.name]=void 0,h(),!0;if(r.deleteBypassed)return u?u.bypass?(u.bypassed=void 0,h(),!0):!1:(h(),!0);if(r.deleteBypass)return u?u.bypass?(i[r.name]=u.bypassed,h(),!0):!1:(h(),!0);var g=function(){Kk("Do not assign mappings to elements without corresponding data (i.e. ele `"+e.id()+"` has no mapping for property `"+r.name+"` with data field `"+r.field+"`); try a `["+r.field+"]` selector to limit scope to elements with `"+r.field+"` defined")};switch(r.mapped){case o.mapData:for(var _=r.field.split(`.`),v=f.data,y=0;y<_.length&&v;y++){var b=_[y];v=v[b]}if(v==null)return g(),!1;var x;if(rO(v)){var S=r.fieldMax-r.fieldMin;x=S===0?0:(v-r.fieldMin)/S}else return Kk("Do not use continuous mappers without specifying numeric data (i.e. `"+r.field+`: `+v+"` for `"+e.id()+"` is non-numeric)"),!1;if(x<0?x=0:x>1&&(x=1),s.color){var C=r.valueMin[0],w=r.valueMax[0],T=r.valueMin[1],E=r.valueMax[1],D=r.valueMin[2],O=r.valueMax[2],k=r.valueMin[3]==null?1:r.valueMin[3],A=r.valueMax[3]==null?1:r.valueMax[3],j=[Math.round(C+(w-C)*x),Math.round(T+(E-T)*x),Math.round(D+(O-D)*x),Math.round(k+(A-k)*x)];a={bypass:r.bypass,name:r.name,value:j,strValue:`rgb(`+j[0]+`, `+j[1]+`, `+j[2]+`)`}}else if(s.number){var M=r.valueMin+(r.valueMax-r.valueMin)*x;a=this.parse(r.name,M,r.bypass,p)}else return!1;if(!a)return g(),!1;a.mapping=r,r=a;break;case o.data:for(var N=r.field.split(`.`),P=f.data,F=0;F<N.length&&P;F++){var I=N[F];P=P[I]}if(P!=null&&(a=this.parse(r.name,P,r.bypass,p)),!a)return g(),!1;a.mapping=r,r=a;break;case o.fn:var L=r.value,R=r.fnValue==null?L(e):r.fnValue;if(r.prevFnValue=R,R==null)return Kk("Custom function mappers may not return null (i.e. `"+r.name+"` for ele `"+e.id()+"` is null)"),!1;if(a=this.parse(r.name,R,r.bypass,p),!a)return Kk("Custom function mappers may not return invalid values for the property type (i.e. `"+r.name+"` for ele `"+e.id()+"` is invalid)"),!1;a.mapping=Jk(r),r=a;break;case void 0:break;default:return!1}return l?(d?r.bypassed=u.bypassed:r.bypassed=u,i[r.name]=r):d?u.bypassed=r:i[r.name]=r,h(),!0},lP.cleanElements=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),!t)r._private.style={};else for(var i=r._private.style,a=Object.keys(i),o=0;o<a.length;o++){var s=a[o],l=i[s];l!=null&&(l.bypass?l.bypassed=null:i[s]=null)}}},lP.update=function(){this._private.cy.mutableElements().updateStyle()},lP.updateTransitions=function(e,t){var n=this,r=e._private,i=e.pstyle(`transition-property`).value,a=e.pstyle(`transition-duration`).pfValue,o=e.pstyle(`transition-delay`).pfValue;if(i.length>0&&a>0){for(var s={},l=!1,u=0;u<i.length;u++){var d=i[u],f=e.pstyle(d),p=t[d];if(p){var m=p.prev,h=p.next==null?f:p.next,g=!1,_=void 0,v=1e-6;m&&(rO(m.pfValue)&&rO(h.pfValue)?(g=h.pfValue-m.pfValue,_=m.pfValue+v*g):rO(m.value)&&rO(h.value)?(g=h.value-m.value,_=m.value+v*g):eO(m.value)&&eO(h.value)&&(g=m.value[0]!==h.value[0]||m.value[1]!==h.value[1]||m.value[2]!==h.value[2],_=m.strValue),g&&(s[d]=h.strValue,this.applyBypass(e,d,_),l=!0))}}if(!l)return;r.transitioning=!0,new Vj(function(t){o>0?e.delayAnimation(o).play().promise().then(t):t()}).then(function(){return e.animation({style:s,duration:a,easing:e.pstyle(`transition-timing-function`).value,queue:!1}).play().promise()}).then(function(){n.removeBypasses(e,i),e.emitAndNotify(`style`),r.transitioning=!1})}else r.transitioning&&=(this.removeBypasses(e,i),e.emitAndNotify(`style`),!1)},lP.checkTrigger=function(e,t,n,r,i,a){var o=this.properties[t],s=i(o);e.removed()||s!=null&&s(n,r,e)&&a(o)},lP.checkZOrderTrigger=function(e,t,n,r){var i=this;this.checkTrigger(e,t,n,r,function(e){return e.triggersZOrder},function(){i._private.cy.notify(`zorder`,e)})},lP.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(e){return e.triggersBounds},function(t){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache()})},lP.checkConnectedEdgesBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(e){return e.triggersBoundsOfConnectedEdges},function(t){e.connectedEdges().forEach(function(e){e.dirtyBoundingBoxCache()})})},lP.checkParallelEdgesBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(e){return e.triggersBoundsOfParallelEdges},function(t){e.parallelEdges().forEach(function(e){e.dirtyBoundingBoxCache()})})},lP.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r),this.checkConnectedEdgesBoundsTrigger(e,t,n,r),this.checkParallelEdgesBoundsTrigger(e,t,n,r)},dP={},dP.applyBypass=function(e,t,n,r){var i=this,a=[],o=!0;if(t===`*`||t===`**`){if(n!==void 0)for(var s=0;s<i.properties.length;s++){var l=i.properties[s].name,u=this.parse(l,n,!0);u&&a.push(u)}}else if(QD(t)){var d=this.parse(t,n,!0);d&&a.push(d)}else if(tO(t)){var f=t;r=n;for(var p=Object.keys(f),m=0;m<p.length;m++){var h=p[m],g=f[h];if(g===void 0&&(g=f[yO(h)]),g!==void 0){var _=this.parse(h,g,!0);_&&a.push(_)}}}else return!1;if(a.length===0)return!1;for(var v=!1,y=0;y<e.length;y++){for(var b=e[y],x={},S=void 0,C=0;C<a.length;C++){var w=a[C];if(r){var T=b.pstyle(w.name);S=x[w.name]={prev:T}}v=this.applyParsedProperty(b,Jk(w))||v,r&&(S.next=b.pstyle(w.name))}v&&this.updateStyleHints(b),r&&this.updateTransitions(b,x,o)}return v},dP.overrideBypass=function(e,t,n){t=vO(t);for(var r=0;r<e.length;r++){var i=e[r],a=i._private.style[t],o=this.properties[t].type,s=o.color,l=o.mutiple,u=a?a.pfValue==null?a.value:a.pfValue:null;!a||!a.bypass?this.applyBypass(i,t,n):(a.value=n,a.pfValue!=null&&(a.pfValue=n),a.strValue=s?`rgb(`+n.join(`,`)+`)`:l?n.join(` `):``+n,this.updateStyleHints(i)),this.checkTriggers(i,t,u,n)}},dP.removeAllBypasses=function(e,t){return this.removeBypasses(e,this.propertyNames,t)},dP.removeBypasses=function(e,t,n){for(var r=!0,i=0;i<e.length;i++){for(var a=e[i],o={},s=0;s<t.length;s++){var l=t[s],u=this.properties[l],d=a.pstyle(u.name);if(!(!d||!d.bypass)){var f=this.parse(l,``,!0),p=o[u.name]={prev:d};this.applyParsedProperty(a,f),p.next=a.pstyle(u.name)}}this.updateStyleHints(a),n&&this.updateTransitions(a,o,r)}},fP={},fP.getEmSizeInPixels=function(){var e=this.containerCss(`font-size`);return e==null?1:parseFloat(e)},fP.containerCss=function(e){var t=this._private.cy,n=t.container(),r=t.window();if(r&&n&&r.getComputedStyle)return r.getComputedStyle(n).getPropertyValue(e)},pP={},pP.getRenderedStyle=function(e,t){return t?this.getStylePropertyValue(e,t,!0):this.getRawStyle(e,!0)},pP.getRawStyle=function(e,t){var n=this;if(e=e[0],e){for(var r={},i=0;i<n.properties.length;i++){var a=n.properties[i],o=n.getStylePropertyValue(e,a.name,t);o!=null&&(r[a.name]=o,r[yO(a.name)]=o)}return r}},pP.getIndexedStyle=function(e,t,n,r){return e.pstyle(t)[n][r]??e.cy().style().getDefaultProperty(t)[n][0]},pP.getStylePropertyValue=function(e,t,n){var r=this;if(e=e[0],e){var i=r.properties[t];i.alias&&(i=i.pointsTo);var a=i.type,o=e.pstyle(i.name);if(o){var s=o.value,l=o.units,u=o.strValue;if(n&&a.number&&s!=null&&rO(s)){var d=e.cy().zoom(),f=function(e){return e*d},p=function(e,t){return f(e)+t},m=eO(s);return(m?l.every(function(e){return e!=null}):l!=null)?m?s.map(function(e,t){return p(e,l[t])}).join(` `):p(s,l):m?s.map(function(e){return QD(e)?e:``+f(e)}).join(` `):``+f(s)}if(u!=null)return u}return null}},pP.getAnimationStartStyle=function(e,t){for(var n={},r=0;r<t.length;r++){var i=t[r].name,a=e.pstyle(i);a!==void 0&&(a=tO(a)?this.parse(i,a.strValue):this.parse(i,a)),a&&(n[i]=a)}return n},pP.getPropsList=function(e){var t=this,n=[],r=e,i=t.properties;if(r)for(var a=Object.keys(r),o=0;o<a.length;o++){var s=a[o],l=r[s],u=i[s]||i[vO(s)],d=this.parse(u.name,l);d&&n.push(d)}return n},pP.getNonDefaultPropertiesHash=function(e,t,n){var r=n.slice(),i,a,o,s,l,u;for(l=0;l<t.length;l++)if(i=t[l],a=e.pstyle(i,!1),a!=null){if(a.pfValue!=null)r[0]=Ek(s,r[0]),r[1]=Dk(s,r[1]);else for(o=a.strValue,u=0;u<o.length;u++)s=o.charCodeAt(u),r[0]=Ek(s,r[0]),r[1]=Dk(s,r[1])}return r},pP.getPropertiesHash=pP.getNonDefaultPropertiesHash,mP={},mP.appendFromJson=function(e){for(var t=this,n=0;n<e.length;n++){var r=e[n],i=r.selector,a=r.style||r.css,o=Object.keys(a);t.selector(i);for(var s=0;s<o.length;s++){var l=o[s],u=a[l];t.css(l,u)}}return t},mP.fromJson=function(e){var t=this;return t.resetToDefault(),t.appendFromJson(e),t},mP.json=function(){for(var e=[],t=this.defaultLength;t<this.length;t++){for(var n=this[t],r=n.selector,i=n.properties,a={},o=0;o<i.length;o++){var s=i[o];a[s.name]=s.strValue}e.push({selector:r?r.toString():`core`,style:a})}return e},hP={},hP.appendFromString=function(e){var t=this,n=this,r=``+e,i,a,o;r=r.replace(/[/][*](\s|.)+?[*][/]/g,``);function s(){r=r.length>i.length?r.substr(i.length):``}function l(){a=a.length>o.length?a.substr(o.length):``}for(;!r.match(/^\s*$/);){var u=r.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!u){Kk(`Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: `+r);break}i=u[0];var d=u[1];if(d!==`core`&&new eN(d).invalid){Kk(`Skipping parsing of block: Invalid selector found in string stylesheet: `+d),s();continue}var f=u[2],p=!1;a=f;for(var m=[];!a.match(/^\s*$/);){var h=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!h){Kk(`Skipping parsing of block: Invalid formatting of style property and value definitions found in:`+f),p=!0;break}o=h[0];var g=h[1],_=h[2];if(!t.properties[g]){Kk(`Skipping property: Invalid property name in: `+o),l();continue}if(!n.parse(g,_)){Kk(`Skipping property: Invalid property definition in: `+o),l();continue}m.push({name:g,val:_}),l()}if(p){s();break}n.selector(d);for(var v=0;v<m.length;v++){var y=m[v];n.css(y.name,y.val)}s()}return n},hP.fromString=function(e){var t=this;return t.resetToDefault(),t.appendFromString(e),t},gP={},(function(){var e=CO,t=TO,n=DO,r=OO,i=kO,a=function(e){return`^`+e+`\\s*\\(\\s*([\\w\\.]+)\\s*\\)$`},o=function(a){var o=e+`|\\w+|`+t+`|`+n+`|`+r+`|`+i;return`^`+a+`\\s*\\(([\\w\\.]+)\\s*\\,\\s*(`+e+`)\\s*\\,\\s*(`+e+`)\\s*,\\s*(`+o+`)\\s*\\,\\s*(`+o+`)\\)$`},s=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,`^(none)$`,`^(.+)$`];gP.types={time:{number:!0,min:0,units:`s|ms`,implicitUnits:`ms`},percent:{number:!0,min:0,max:100,units:`%`,implicitUnits:`%`},percentages:{number:!0,min:0,max:100,units:`%`,implicitUnits:`%`,multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:[`parent`,`origin`]},nodeSize:{number:!0,min:0,enums:[`label`]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:[`horizontal`,`leftward`,`rightward`,`vertical`,`upward`,`downward`,`auto`]},axisDirectionExplicit:{enums:[`leftward`,`rightward`,`upward`,`downward`]},axisDirectionPrimary:{enums:[`horizontal`,`vertical`]},paddingRelativeTo:{enums:[`width`,`height`,`average`,`min`,`max`]},bgWH:{number:!0,min:0,allowPercent:!0,enums:[`auto`],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:[`inner`,`include-padding`],multiple:!0},bgRepeat:{enums:[`repeat`,`repeat-x`,`repeat-y`,`no-repeat`],multiple:!0},bgFit:{enums:[`none`,`contain`,`cover`],multiple:!0},bgCrossOrigin:{enums:[`anonymous`,`use-credentials`,`null`],multiple:!0},bgClip:{enums:[`none`,`node`],multiple:!0},bgContainment:{enums:[`inside`,`over`],multiple:!0},boxSelection:{enums:[`contain`,`overlap`,`none`]},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:[`solid`,`linear-gradient`,`radial-gradient`]},bool:{enums:[`yes`,`no`]},bools:{enums:[`yes`,`no`],multiple:!0},lineStyle:{enums:[`solid`,`dotted`,`dashed`]},lineCap:{enums:[`butt`,`round`,`square`]},linePosition:{enums:[`center`,`inside`,`outside`]},lineJoin:{enums:[`round`,`bevel`,`miter`]},borderStyle:{enums:[`solid`,`dotted`,`dashed`,`double`]},curveStyle:{enums:[`bezier`,`unbundled-bezier`,`haystack`,`segments`,`straight`,`straight-triangle`,`taxi`,`round-segments`,`round-taxi`]},radiusType:{enums:[`arc-radius`,`influence-radius`],multiple:!0},fontFamily:{regex:`^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$`},fontStyle:{enums:[`italic`,`normal`,`oblique`]},fontWeight:{enums:[`normal`,`bold`,`bolder`,`lighter`,`100`,`200`,`300`,`400`,`500`,`600`,`800`,`900`,100,200,300,400,500,600,700,800,900]},textDecoration:{enums:[`none`,`underline`,`overline`,`line-through`]},textTransform:{enums:[`none`,`uppercase`,`lowercase`]},textWrap:{enums:[`none`,`wrap`,`ellipsis`]},textOverflowWrap:{enums:[`whitespace`,`anywhere`]},textBackgroundShape:{enums:[`rectangle`,`roundrectangle`,`round-rectangle`,`circle`]},nodeShape:{enums:`rectangle.roundrectangle.round-rectangle.cutrectangle.cut-rectangle.bottomroundrectangle.bottom-round-rectangle.barrel.ellipse.triangle.round-triangle.square.pentagon.round-pentagon.hexagon.round-hexagon.concavehexagon.concave-hexagon.heptagon.round-heptagon.octagon.round-octagon.tag.round-tag.star.diamond.round-diamond.vee.rhomboid.right-rhomboid.polygon`.split(`.`)},overlayShape:{enums:[`roundrectangle`,`round-rectangle`,`ellipse`]},cornerRadius:{number:!0,min:0,units:`px|em`,implicitUnits:`px`,enums:[`auto`]},compoundIncludeLabels:{enums:[`include`,`exclude`]},arrowShape:{enums:[`tee`,`triangle`,`triangle-tee`,`circle-triangle`,`triangle-cross`,`triangle-backcurve`,`vee`,`square`,`circle`,`diamond`,`chevron`,`none`]},arrowFill:{enums:[`filled`,`hollow`]},arrowWidth:{number:!0,units:`%|px|em`,implicitUnits:`px`,enums:[`match-line`]},display:{enums:[`element`,`none`]},visibility:{enums:[`hidden`,`visible`]},zCompoundDepth:{enums:[`bottom`,`orphan`,`auto`,`top`]},zIndexCompare:{enums:[`auto`,`manual`]},valign:{enums:[`top`,`top-inside`,`center`,`bottom`,`bottom-inside`]},halign:{enums:[`left`,`left-inside`,`center`,`right`,`right-inside`]},justification:{enums:[`left`,`center`,`right`,`auto`]},textMetrics:{enums:[`font`,`glyph`]},text:{string:!0},data:{mapping:!0,regex:a(`data`)},layoutData:{mapping:!0,regex:a(`layoutData`)},scratch:{mapping:!0,regex:a(`scratch`)},mapData:{mapping:!0,regex:o(`mapData`)},mapLayoutData:{mapping:!0,regex:o(`mapLayoutData`)},mapScratch:{mapping:!0,regex:o(`mapScratch`)},fn:{mapping:!0,fn:!0},url:{regexes:s,singleRegexMatchValue:!0},urls:{regexes:s,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:`deg|rad`,implicitUnits:`rad`},textRotation:{number:!0,units:`deg|rad`,implicitUnits:`rad`,enums:[`none`,`autorotate`]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:[`intersection`,`node-position`,`endpoints`]},edgeEndpoint:{number:!0,multiple:!0,units:`%|px|em|deg|rad`,implicitUnits:`px`,enums:[`inside-to-node`,`outside-to-node`,`outside-to-node-or-label`,`outside-to-line`,`outside-to-line-or-label`],singleEnum:!0,validate:function(e,t){switch(e.length){case 2:return t[0]!==`deg`&&t[0]!==`rad`&&t[1]!==`deg`&&t[1]!==`rad`;case 1:return QD(e[0])||t[0]===`deg`||t[0]===`rad`;default:return!1}}},easing:{regexes:[`^(spring)\\s*\\(\\s*(`+e+`)\\s*,\\s*(`+e+`)\\s*\\)$`,`^(cubic-bezier)\\s*\\(\\s*(`+e+`)\\s*,\\s*(`+e+`)\\s*,\\s*(`+e+`)\\s*,\\s*(`+e+`)\\s*\\)$`],enums:`linear.ease.ease-in.ease-out.ease-in-out.ease-in-sine.ease-out-sine.ease-in-out-sine.ease-in-quad.ease-out-quad.ease-in-out-quad.ease-in-cubic.ease-out-cubic.ease-in-out-cubic.ease-in-quart.ease-out-quart.ease-in-out-quart.ease-in-quint.ease-out-quint.ease-in-out-quint.ease-in-expo.ease-out-expo.ease-in-out-expo.ease-in-circ.ease-out-circ.ease-in-out-circ`.split(`.`)},gradientDirection:{enums:[`to-bottom`,`to-top`,`to-left`,`to-right`,`to-bottom-right`,`to-bottom-left`,`to-top-right`,`to-top-left`,`to-right-bottom`,`to-left-bottom`,`to-right-top`,`to-left-top`]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(e){var t=e.length;return t===1||t===2||t===4}}};var l={zeroNonZero:function(e,t){return(e==null||t==null)&&e!==t||e==0&&t!=0||e!=0&&t==0},any:function(e,t){return e!=t},emptyNonEmpty:function(e,t){var n=fO(e),r=fO(t);return n&&!r||!n&&r}},u=gP.types,d=[{name:`label`,type:u.text,triggersBounds:l.any,triggersZOrder:l.emptyNonEmpty},{name:`text-rotation`,type:u.textRotation,triggersBounds:l.any},{name:`text-margin-x`,type:u.bidirectionalSize,triggersBounds:l.any},{name:`text-margin-y`,type:u.bidirectionalSize,triggersBounds:l.any}],f=[{name:`source-label`,type:u.text,triggersBounds:l.any},{name:`source-text-rotation`,type:u.textRotation,triggersBounds:l.any},{name:`source-text-margin-x`,type:u.bidirectionalSize,triggersBounds:l.any},{name:`source-text-margin-y`,type:u.bidirectionalSize,triggersBounds:l.any},{name:`source-text-offset`,type:u.size,triggersBounds:l.any}],p=[{name:`target-label`,type:u.text,triggersBounds:l.any},{name:`target-text-rotation`,type:u.textRotation,triggersBounds:l.any},{name:`target-text-margin-x`,type:u.bidirectionalSize,triggersBounds:l.any},{name:`target-text-margin-y`,type:u.bidirectionalSize,triggersBounds:l.any},{name:`target-text-offset`,type:u.size,triggersBounds:l.any}],m=[{name:`font-family`,type:u.fontFamily,triggersBounds:l.any},{name:`font-style`,type:u.fontStyle,triggersBounds:l.any},{name:`font-weight`,type:u.fontWeight,triggersBounds:l.any},{name:`font-size`,type:u.size,triggersBounds:l.any},{name:`text-transform`,type:u.textTransform,triggersBounds:l.any},{name:`text-wrap`,type:u.textWrap,triggersBounds:l.any},{name:`text-overflow-wrap`,type:u.textOverflowWrap,triggersBounds:l.any},{name:`text-max-width`,type:u.size,triggersBounds:l.any},{name:`text-outline-width`,type:u.size,triggersBounds:l.any},{name:`line-height`,type:u.positiveNumber,triggersBounds:l.any}],h=[{name:`text-valign`,type:u.valign,triggersBounds:l.any},{name:`text-halign`,type:u.halign,triggersBounds:l.any},{name:`color`,type:u.color},{name:`text-outline-color`,type:u.color},{name:`text-outline-opacity`,type:u.zeroOneNumber},{name:`text-background-color`,type:u.color},{name:`text-background-opacity`,type:u.zeroOneNumber},{name:`text-background-padding`,type:u.size,triggersBounds:l.any},{name:`text-border-opacity`,type:u.zeroOneNumber},{name:`text-border-color`,type:u.color},{name:`text-border-width`,type:u.size,triggersBounds:l.any},{name:`text-border-style`,type:u.borderStyle,triggersBounds:l.any},{name:`text-background-shape`,type:u.textBackgroundShape,triggersBounds:l.any},{name:`text-justification`,type:u.justification},{name:`text-metrics`,type:u.textMetrics},{name:`box-select-labels`,type:u.bool,triggersBounds:l.any}],g=[{name:`events`,type:u.bool,triggersZOrder:l.any},{name:`text-events`,type:u.bool,triggersZOrder:l.any},{name:`box-selection`,type:u.boxSelection,triggersZOrder:l.any}],_=[{name:`display`,type:u.display,triggersZOrder:l.any,triggersBounds:l.any,triggersBoundsOfConnectedEdges:l.any,triggersBoundsOfParallelEdges:function(e,t,n){return e!==t&&n.pstyle(`curve-style`).value===`bezier`}},{name:`visibility`,type:u.visibility,triggersZOrder:l.any},{name:`opacity`,type:u.zeroOneNumber,triggersZOrder:l.zeroNonZero},{name:`text-opacity`,type:u.zeroOneNumber},{name:`min-zoomed-font-size`,type:u.size},{name:`z-compound-depth`,type:u.zCompoundDepth,triggersZOrder:l.any},{name:`z-index-compare`,type:u.zIndexCompare,triggersZOrder:l.any},{name:`z-index`,type:u.number,triggersZOrder:l.any}],v=[{name:`overlay-padding`,type:u.size,triggersBounds:l.any},{name:`overlay-color`,type:u.color},{name:`overlay-opacity`,type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:`overlay-shape`,type:u.overlayShape,triggersBounds:l.any},{name:`overlay-corner-radius`,type:u.cornerRadius}],y=[{name:`underlay-padding`,type:u.size,triggersBounds:l.any},{name:`underlay-color`,type:u.color},{name:`underlay-opacity`,type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:`underlay-shape`,type:u.overlayShape,triggersBounds:l.any},{name:`underlay-corner-radius`,type:u.cornerRadius}],b=[{name:`transition-property`,type:u.propList},{name:`transition-duration`,type:u.time},{name:`transition-delay`,type:u.time},{name:`transition-timing-function`,type:u.easing}],x=function(e,t){return t.value===`label`?-e.poolIndex():t.pfValue},S=[{name:`height`,type:u.nodeSize,triggersBounds:l.any,hashOverride:x},{name:`width`,type:u.nodeSize,triggersBounds:l.any,hashOverride:x},{name:`shape`,type:u.nodeShape,triggersBounds:l.any},{name:`shape-polygon-points`,type:u.polygonPointList,triggersBounds:l.any},{name:`corner-radius`,type:u.cornerRadius},{name:`background-color`,type:u.color},{name:`background-fill`,type:u.fill},{name:`background-opacity`,type:u.zeroOneNumber},{name:`background-blacken`,type:u.nOneOneNumber},{name:`background-gradient-stop-colors`,type:u.colors},{name:`background-gradient-stop-positions`,type:u.percentages},{name:`background-gradient-direction`,type:u.gradientDirection},{name:`padding`,type:u.sizeMaybePercent,triggersBounds:l.any},{name:`padding-relative-to`,type:u.paddingRelativeTo,triggersBounds:l.any},{name:`bounds-expansion`,type:u.boundsExpansion,triggersBounds:l.any}],C=[{name:`border-color`,type:u.color},{name:`border-opacity`,type:u.zeroOneNumber},{name:`border-width`,type:u.size,triggersBounds:l.any},{name:`border-style`,type:u.borderStyle},{name:`border-cap`,type:u.lineCap},{name:`border-join`,type:u.lineJoin},{name:`border-dash-pattern`,type:u.numbers},{name:`border-dash-offset`,type:u.number},{name:`border-position`,type:u.linePosition}],w=[{name:`outline-color`,type:u.color},{name:`outline-opacity`,type:u.zeroOneNumber},{name:`outline-width`,type:u.size,triggersBounds:l.any},{name:`outline-style`,type:u.borderStyle},{name:`outline-offset`,type:u.size,triggersBounds:l.any}],T=[{name:`background-image`,type:u.urls},{name:`background-image-crossorigin`,type:u.bgCrossOrigin},{name:`background-image-opacity`,type:u.zeroOneNumbers},{name:`background-image-containment`,type:u.bgContainment},{name:`background-image-smoothing`,type:u.bools},{name:`background-position-x`,type:u.bgPos},{name:`background-position-y`,type:u.bgPos},{name:`background-width-relative-to`,type:u.bgRelativeTo},{name:`background-height-relative-to`,type:u.bgRelativeTo},{name:`background-repeat`,type:u.bgRepeat},{name:`background-fit`,type:u.bgFit},{name:`background-clip`,type:u.bgClip},{name:`background-width`,type:u.bgWH},{name:`background-height`,type:u.bgWH},{name:`background-offset-x`,type:u.bgPos},{name:`background-offset-y`,type:u.bgPos}],E=[{name:`position`,type:u.position,triggersBounds:l.any},{name:`compound-sizing-wrt-labels`,type:u.compoundIncludeLabels,triggersBounds:l.any},{name:`min-width`,type:u.size,triggersBounds:l.any},{name:`min-width-bias-left`,type:u.sizeMaybePercent,triggersBounds:l.any},{name:`min-width-bias-right`,type:u.sizeMaybePercent,triggersBounds:l.any},{name:`min-height`,type:u.size,triggersBounds:l.any},{name:`min-height-bias-top`,type:u.sizeMaybePercent,triggersBounds:l.any},{name:`min-height-bias-bottom`,type:u.sizeMaybePercent,triggersBounds:l.any}],D=[{name:`line-style`,type:u.lineStyle},{name:`line-color`,type:u.color},{name:`line-fill`,type:u.fill},{name:`line-cap`,type:u.lineCap},{name:`line-opacity`,type:u.zeroOneNumber},{name:`line-dash-pattern`,type:u.numbers},{name:`line-dash-offset`,type:u.number},{name:`line-outline-width`,type:u.size},{name:`line-outline-color`,type:u.color},{name:`line-gradient-stop-colors`,type:u.colors},{name:`line-gradient-stop-positions`,type:u.percentages},{name:`curve-style`,type:u.curveStyle,triggersBounds:l.any,triggersBoundsOfParallelEdges:function(e,t){return e===t?!1:e===`bezier`||t===`bezier`}},{name:`haystack-radius`,type:u.zeroOneNumber,triggersBounds:l.any},{name:`source-endpoint`,type:u.edgeEndpoint,triggersBounds:l.any},{name:`target-endpoint`,type:u.edgeEndpoint,triggersBounds:l.any},{name:`control-point-step-size`,type:u.size,triggersBounds:l.any},{name:`control-point-distances`,type:u.bidirectionalSizes,triggersBounds:l.any},{name:`control-point-weights`,type:u.numbers,triggersBounds:l.any},{name:`segment-distances`,type:u.bidirectionalSizes,triggersBounds:l.any},{name:`segment-weights`,type:u.numbers,triggersBounds:l.any},{name:`segment-radii`,type:u.numbers,triggersBounds:l.any},{name:`radius-type`,type:u.radiusType,triggersBounds:l.any},{name:`taxi-turn`,type:u.bidirectionalSizeMaybePercent,triggersBounds:l.any},{name:`taxi-turn-min-distance`,type:u.size,triggersBounds:l.any},{name:`taxi-direction`,type:u.axisDirection,triggersBounds:l.any},{name:`taxi-radius`,type:u.number,triggersBounds:l.any},{name:`edge-distances`,type:u.edgeDistances,triggersBounds:l.any},{name:`arrow-scale`,type:u.positiveNumber,triggersBounds:l.any},{name:`loop-direction`,type:u.angle,triggersBounds:l.any},{name:`loop-sweep`,type:u.angle,triggersBounds:l.any},{name:`source-distance-from-node`,type:u.size,triggersBounds:l.any},{name:`target-distance-from-node`,type:u.size,triggersBounds:l.any}],O=[{name:`ghost`,type:u.bool,triggersBounds:l.any},{name:`ghost-offset-x`,type:u.bidirectionalSize,triggersBounds:l.any},{name:`ghost-offset-y`,type:u.bidirectionalSize,triggersBounds:l.any},{name:`ghost-opacity`,type:u.zeroOneNumber}],k=[{name:`selection-box-color`,type:u.color},{name:`selection-box-opacity`,type:u.zeroOneNumber},{name:`selection-box-border-color`,type:u.color},{name:`selection-box-border-width`,type:u.size},{name:`active-bg-color`,type:u.color},{name:`active-bg-opacity`,type:u.zeroOneNumber},{name:`active-bg-size`,type:u.size},{name:`outside-texture-bg-color`,type:u.color},{name:`outside-texture-bg-opacity`,type:u.zeroOneNumber}],A=[];gP.pieBackgroundN=16,A.push({name:`pie-size`,type:u.sizeMaybePercent}),A.push({name:`pie-hole`,type:u.sizeMaybePercent}),A.push({name:`pie-start-angle`,type:u.angle});for(var j=1;j<=gP.pieBackgroundN;j++)A.push({name:`pie-`+j+`-background-color`,type:u.color}),A.push({name:`pie-`+j+`-background-size`,type:u.percent}),A.push({name:`pie-`+j+`-background-opacity`,type:u.zeroOneNumber});var M=[];gP.stripeBackgroundN=16,M.push({name:`stripe-size`,type:u.sizeMaybePercent}),M.push({name:`stripe-direction`,type:u.axisDirectionPrimary});for(var N=1;N<=gP.stripeBackgroundN;N++)M.push({name:`stripe-`+N+`-background-color`,type:u.color}),M.push({name:`stripe-`+N+`-background-size`,type:u.percent}),M.push({name:`stripe-`+N+`-background-opacity`,type:u.zeroOneNumber});var P=[],F=gP.arrowPrefixes=[`source`,`mid-source`,`target`,`mid-target`];[{name:`arrow-shape`,type:u.arrowShape,triggersBounds:l.any},{name:`arrow-color`,type:u.color},{name:`arrow-fill`,type:u.arrowFill},{name:`arrow-width`,type:u.arrowWidth}].forEach(function(e){F.forEach(function(t){var n=t+`-`+e.name,r=e.type,i=e.triggersBounds;P.push({name:n,type:r,triggersBounds:i})})},{});var I=gP.properties=[].concat(g,b,_,v,y,O,h,m,d,f,p,S,C,w,T,A,M,E,D,P,k),L=gP.propertyGroups={behavior:g,transition:b,visibility:_,overlay:v,underlay:y,ghost:O,commonLabel:h,labelDimensions:m,mainLabel:d,sourceLabel:f,targetLabel:p,nodeBody:S,nodeBorder:C,nodeOutline:w,backgroundImage:T,pie:A,stripe:M,compound:E,edgeLine:D,edgeArrow:P,core:k},R=gP.propertyGroupNames={};(gP.propertyGroupKeys=Object.keys(L)).forEach(function(e){R[e]=L[e].map(function(e){return e.name}),L[e].forEach(function(t){return t.groupKey=e})});var ee=gP.aliases=[{name:`content`,pointsTo:`label`},{name:`control-point-distance`,pointsTo:`control-point-distances`},{name:`control-point-weight`,pointsTo:`control-point-weights`},{name:`segment-distance`,pointsTo:`segment-distances`},{name:`segment-weight`,pointsTo:`segment-weights`},{name:`segment-radius`,pointsTo:`segment-radii`},{name:`edge-text-rotation`,pointsTo:`text-rotation`},{name:`padding-left`,pointsTo:`padding`},{name:`padding-right`,pointsTo:`padding`},{name:`padding-top`,pointsTo:`padding`},{name:`padding-bottom`,pointsTo:`padding`}];gP.propertyNames=I.map(function(e){return e.name});for(var z=0;z<I.length;z++){var B=I[z];I[B.name]=B}for(var te=0;te<ee.length;te++){var ne=ee[te],re=I[ne.pointsTo],ie={name:ne.name,alias:!0,pointsTo:re};I.push(ie),I[ne.name]=ie}})(),gP.getDefaultProperty=function(e){return this.getDefaultProperties()[e]},gP.getDefaultProperties=function(){var e=this._private;if(e.defaultProperties!=null)return e.defaultProperties;for(var t=MO({"selection-box-color":`#ddd`,"selection-box-opacity":.65,"selection-box-border-color":`#aaa`,"selection-box-border-width":1,"active-bg-color":`black`,"active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":`#000`,"outside-texture-bg-opacity":.125,events:`yes`,"text-events":`no`,"text-valign":`top`,"text-halign":`center`,"text-justification":`auto`,"line-height":1,color:`#000`,"box-selection":`contain`,"text-outline-color":`#000`,"text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":`none`,"text-transform":`none`,"text-wrap":`none`,"text-overflow-wrap":`whitespace`,"text-max-width":9999,"text-background-color":`#000`,"text-background-opacity":0,"text-background-shape":`rectangle`,"text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":`solid`,"text-border-color":`#000`,"font-family":`Helvetica Neue, Helvetica, sans-serif`,"font-style":`normal`,"font-weight":`normal`,"font-size":16,"min-zoomed-font-size":0,"text-rotation":`none`,"source-text-rotation":`none`,"target-text-rotation":`none`,visibility:`visible`,display:`element`,opacity:1,"z-compound-depth":`auto`,"z-index-compare":`auto`,"z-index":0,label:``,"text-margin-x":0,"text-margin-y":0,"source-label":``,"source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":``,"target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":`#000`,"overlay-padding":10,"overlay-shape":`round-rectangle`,"overlay-corner-radius":`auto`,"underlay-opacity":0,"underlay-color":`#000`,"underlay-padding":10,"underlay-shape":`round-rectangle`,"underlay-corner-radius":`auto`,"text-metrics":`font`,"transition-property":`none`,"transition-duration":0,"transition-delay":0,"transition-timing-function":`linear`,"box-select-labels":`no`,"background-blacken":0,"background-color":`#999`,"background-fill":`solid`,"background-opacity":1,"background-image":`none`,"background-image-crossorigin":`anonymous`,"background-image-opacity":1,"background-image-containment":`inside`,"background-image-smoothing":`yes`,"background-position-x":`50%`,"background-position-y":`50%`,"background-offset-x":0,"background-offset-y":0,"background-width-relative-to":`include-padding`,"background-height-relative-to":`include-padding`,"background-repeat":`no-repeat`,"background-fit":`none`,"background-clip":`node`,"background-width":`auto`,"background-height":`auto`,"border-color":`#000`,"border-opacity":1,"border-width":0,"border-style":`solid`,"border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":`butt`,"border-join":`miter`,"border-position":`center`,"outline-color":`#999`,"outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":`solid`,height:30,width:30,shape:`ellipse`,"shape-polygon-points":`-1, -1, 1, -1, 1, 1, -1, 1`,"corner-radius":`auto`,"bounds-expansion":0,"background-gradient-direction":`to-bottom`,"background-gradient-stop-colors":`#999`,"background-gradient-stop-positions":`0%`,ghost:`no`,"ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":`width`,position:`origin`,"compound-sizing-wrt-labels":`include`,"min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":`100%`,"pie-hole":0,"pie-start-angle":`0deg`},[{name:`pie-{{i}}-background-color`,value:`black`},{name:`pie-{{i}}-background-size`,value:`0%`},{name:`pie-{{i}}-background-opacity`,value:1}].reduce(function(e,t){for(var n=1;n<=gP.pieBackgroundN;n++){var r=t.name.replace(`{{i}}`,n);e[r]=t.value}return e},{}),{"stripe-size":`100%`,"stripe-direction":`horizontal`},[{name:`stripe-{{i}}-background-color`,value:`black`},{name:`stripe-{{i}}-background-size`,value:`0%`},{name:`stripe-{{i}}-background-opacity`,value:1}].reduce(function(e,t){for(var n=1;n<=gP.stripeBackgroundN;n++){var r=t.name.replace(`{{i}}`,n);e[r]=t.value}return e},{}),{"line-style":`solid`,"line-color":`#999`,"line-fill":`solid`,"line-cap":`butt`,"line-opacity":1,"line-outline-width":0,"line-outline-color":`#000`,"line-gradient-stop-colors":`#999`,"line-gradient-stop-positions":`0%`,"control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":`arc-radius`,"taxi-turn":`50%`,"taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":`auto`,"edge-distances":`intersection`,"curve-style":`haystack`,"haystack-radius":0,"arrow-scale":1,"loop-direction":`-45deg`,"loop-sweep":`-90deg`,"source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":`outside-to-node`,"target-endpoint":`outside-to-node`,"line-dash-pattern":[6,3],"line-dash-offset":0},[{name:`arrow-shape`,value:`none`},{name:`arrow-color`,value:`#999`},{name:`arrow-fill`,value:`filled`},{name:`arrow-width`,value:1}].reduce(function(e,t){return gP.arrowPrefixes.forEach(function(n){var r=n+`-`+t.name;e[r]=t.value}),e},{})),n={},r=0;r<this.properties.length;r++){var i=this.properties[r];if(!i.pointsTo){var a=i.name,o=t[a];n[a]=this.parse(a,o)}}return e.defaultProperties=n,e.defaultProperties},gP.addDefaultStylesheet=function(){this.selector(`:parent`).css({shape:`rectangle`,padding:10,"background-color":`#eee`,"border-color":`#ccc`,"border-width":1}).selector(`edge`).css({width:3}).selector(`:loop`).css({"curve-style":`bezier`}).selector(`edge:compound`).css({"curve-style":`bezier`,"source-endpoint":`outside-to-line`,"target-endpoint":`outside-to-line`}).selector(`:selected`).css({"background-color":`#0169D9`,"line-color":`#0169D9`,"source-arrow-color":`#0169D9`,"target-arrow-color":`#0169D9`,"mid-source-arrow-color":`#0169D9`,"mid-target-arrow-color":`#0169D9`}).selector(`:parent:selected`).css({"background-color":`#CCE1F9`,"border-color":`#aec8e5`}).selector(`:active`).css({"overlay-color":`black`,"overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length},_P={},_P.parse=function(e,t,n,r){var i=this;if($D(t))return i.parseImplWarn(e,t,n,r);var a=r===`mapping`||r===!0||r===!1||r==null?`dontcare`:r,o=n?`t`:`f`,s=Nk(e,``+t,o,a),l=i.propCache=i.propCache||[],u;return(u=l[s])||(u=l[s]=i.parseImplWarn(e,t,n,r)),(n||r===`mapping`)&&(u=Jk(u),u&&(u.value=Jk(u.value))),u},_P.parseImplWarn=function(e,t,n,r){var i=this.parseImpl(e,t,n,r);return!i&&t!=null&&Kk(`The style property \`${e}: ${t}\` is invalid`),i&&(i.name===`width`||i.name===`height`)&&t===`label`&&Kk("The style value of `label` is deprecated for `"+i.name+"`"),i},_P.parseImpl=function(e,t,n,r){var i=this;e=vO(e);var a=i.properties[e],o=t,s=i.types;if(!a||t===void 0)return null;a.alias&&(a=a.pointsTo,e=a.name);var l=QD(t);l&&(t=t.trim());var u=a.type;if(!u)return null;if(n&&(t===``||t===null))return{name:e,value:t,bypass:!0,deleteBypass:!0};if($D(t))return{name:e,value:t,strValue:`fn`,mapped:s.fn,bypass:n};var d,f;if(!(!l||r||t.length<7||t[1]!==`a`)){if(t.length>=7&&t[0]===`d`&&(d=new RegExp(s.data.regex).exec(t))){if(n)return!1;var p=s.data;return{name:e,value:d,strValue:``+t,mapped:p,field:d[1],bypass:n}}if(t.length>=10&&t[0]===`m`&&(f=new RegExp(s.mapData.regex).exec(t))){if(n||u.multiple)return!1;var m=s.mapData;if(!(u.color||u.number))return!1;var h=this.parse(e,f[4]);if(!h||h.mapped)return!1;var g=this.parse(e,f[5]);if(!g||g.mapped)return!1;if(h.pfValue===g.pfValue||h.strValue===g.strValue)return Kk("`"+e+`: `+t+"` is not a valid mapper because the output range is zero; converting to `"+e+`: `+h.strValue+"`"),this.parse(e,h.strValue);if(u.color){var _=h.value,v=g.value;if(_[0]===v[0]&&_[1]===v[1]&&_[2]===v[2]&&(_[3]===v[3]||(_[3]==null||_[3]===1)&&(v[3]==null||v[3]===1)))return!1}return{name:e,value:f,strValue:``+t,mapped:m,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:h.value,valueMax:g.value,bypass:n}}}if(u.multiple&&r!==`multiple`){var y=l?t.split(/\s+/):eO(t)?t:[t];if(u.evenMultiple&&y.length%2!=0)return null;for(var b=[],x=[],S=[],C=``,w=!1,T=0;T<y.length;T++){var E=i.parse(e,y[T],n,`multiple`);w||=QD(E.value),b.push(E.value),S.push(E.pfValue==null?E.value:E.pfValue),x.push(E.units),C+=(T>0?` `:``)+E.strValue}return u.validate&&!u.validate(b,x)?null:u.singleEnum&&w?b.length===1&&QD(b[0])?{name:e,value:b[0],strValue:b[0],bypass:n}:null:{name:e,value:b,pfValue:S,strValue:C,bypass:n,units:x}}var D=function(){for(var r=0;r<u.enums.length;r++)if(u.enums[r]===t)return{name:e,value:t,strValue:``+t,bypass:n};return null};if(u.number){var O,k=`px`;if(u.units&&(O=u.units),u.implicitUnits&&(k=u.implicitUnits),!u.unitless){if(l){var A=`px|em`+(u.allowPercent?`|\\%`:``);O&&(A=O);var j=t.match(`^(`+CO+`)(`+A+`)?$`);j&&(t=j[1],O=j[2]||k)}else(!O||u.implicitUnits)&&(O=k)}if(t=parseFloat(t),isNaN(t)&&u.enums===void 0)return null;if(isNaN(t)&&u.enums!==void 0)return t=o,D();if(u.integer&&!iO(t)||u.min!==void 0&&(t<u.min||u.strictMin&&t===u.min)||u.max!==void 0&&(t>u.max||u.strictMax&&t===u.max))return null;var M={name:e,value:t,strValue:``+t+(O||``),units:O,bypass:n};return M.pfValue=u.unitless||O!==`px`&&O!==`em`||O===`px`||!O?t:this.getEmSizeInPixels()*t,(O===`ms`||O===`s`)&&(M.pfValue=O===`ms`?t:1e3*t),(O===`deg`||O===`rad`)&&(M.pfValue=O===`rad`?t:tLe(t)),O===`%`&&(M.pfValue=t/100),M}if(u.propList){var N=[],P=``+t;if(P!==`none`){for(var F=P.split(/\s*,\s*|\s+/),I=0;I<F.length;I++){var L=F[I].trim();i.properties[L]?N.push(L):Kk("`"+L+"` is not a valid property name")}if(N.length===0)return null}return{name:e,value:N,strValue:N.length===0?`none`:N.join(` `),bypass:n}}if(u.color){var R=LO(t);return R?{name:e,value:R,pfValue:R,strValue:`rgb(`+R[0]+`,`+R[1]+`,`+R[2]+`)`,bypass:n}:null}if(u.regex||u.regexes){if(u.enums){var ee=D();if(ee)return ee}for(var z=u.regexes?u.regexes:[u.regex],B=0;B<z.length;B++){var te=new RegExp(z[B]).exec(t);if(te)return{name:e,value:u.singleRegexMatchValue?te[1]:te,strValue:``+t,bypass:n}}return null}return u.string?{name:e,value:``+t,strValue:``+t,bypass:n}:u.enums?D():null},vP=function(e){if(!(this instanceof vP))return new vP(e);if(!lO(e)){Wk(`A style must have a core reference`);return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},yP=vP.prototype,yP.instanceString=function(){return`style`},yP.clear=function(){for(var e=this._private,t=e.cy.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,e.contextStyles={},e.propDiffs={},this.cleanElements(t,!0),t.forEach(function(e){var t=e[0]._private;t.styleDirty=!0,t.appliedInitStyle=!1}),this},yP.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},yP.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)},yP.selector=function(e){var t=e===`core`?null:new eN(e),n=this.length++;return this[n]={selector:t,properties:[],mappedProperties:[],index:n},this},yP.css=function(){var e=this,t=arguments;if(t.length===1)for(var n=t[0],r=0;r<e.properties.length;r++){var i=e.properties[r],a=n[i.name];a===void 0&&(a=n[yO(i.name)]),a!==void 0&&this.cssRule(i.name,a)}else t.length===2&&this.cssRule(t[0],t[1]);return this},yP.style=yP.css,yP.cssRule=function(e,t){var n=this.parse(e,t);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.name.match(/stripe-(\d+)-background-size/)&&n.value&&(this._private.hasStripe=!0),n.mapped&&this[r].mappedProperties.push(n),this[r].selector||(this._private.coreStyle[n.name]=n)}return this},yP.append=function(e){return uO(e)?e.appendToStyle(this):eO(e)?this.appendFromJson(e):QD(e)&&this.appendFromString(e),this},vP.fromJson=function(e,t){var n=new vP(e);return n.fromJson(t),n},vP.fromString=function(e,t){return new vP(e).fromString(t)},[lP,dP,fP,pP,mP,hP,gP,_P].forEach(function(e){MO(yP,e)}),vP.types=yP.types,vP.properties=yP.properties,vP.propertyGroups=yP.propertyGroups,vP.propertyGroupNames=yP.propertyGroupNames,vP.propertyGroupKeys=yP.propertyGroupKeys,Yze={style:function(e){return e&&this.setStyle(e).update(),this._private.style},setStyle:function(e){var t=this._private;return t.style=uO(e)?e.generateStyle(this):eO(e)?vP.fromJson(this,e):QD(e)?vP.fromString(this,e):vP(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},Xze=`single`,bP={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var t=this._private;if(t.selectionType??=Xze,e!==void 0)(e===`additive`||e===`single`)&&(t.selectionType=e);else return t.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,t=this._private.pan,n,r,i,a,o;switch(e.length){case 0:return t;case 1:if(QD(e[0]))return n=e[0],t[n];if(tO(e[0])){if(!this._private.panningEnabled)return this;i=e[0],a=i.x,o=i.y,rO(a)&&(t.x=a),rO(o)&&(t.y=o),this.emit(`pan viewport`)}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],r=e[1],(n===`x`||n===`y`)&&rO(r)&&(t[n]=r),this.emit(`pan viewport`)}return this.notify(`viewport`),this},panBy:function(e,t){var n=arguments,r=this._private.pan,i,a,o,s,l;if(!this._private.panningEnabled)return this;switch(n.length){case 1:tO(e)&&(o=n[0],s=o.x,l=o.y,rO(s)&&(r.x+=s),rO(l)&&(r.y+=l),this.emit(`pan viewport`));break;case 2:i=e,a=t,(i===`x`||i===`y`)&&rO(a)&&(r[i]+=a),this.emit(`pan viewport`)}return this.notify(`viewport`),this},gc:function(){this.notify(`gc`)},fit:function(e,t){var n=this.getFitViewport(e,t);if(n){var r=this._private;r.zoom=n.zoom,r.pan=n.pan,this.emit(`pan zoom viewport`),this.notify(`viewport`)}return this},getFitViewport:function(e,t){if(rO(e)&&t===void 0&&(t=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(QD(e)){var r=e;e=this.$(r)}else if(mO(e)){var i=e;n={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else oO(e)||(e=this.mutableElements());if(!(oO(e)&&e.empty())){n||=e.boundingBox();var a=this.width(),o=this.height(),s;if(t=rO(t)?t:0,!isNaN(a)&&!isNaN(o)&&a>0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){s=Math.min((a-2*t)/n.w,(o-2*t)/n.h),s=s>this._private.maxZoom?this._private.maxZoom:s,s=s<this._private.minZoom?this._private.minZoom:s;var l={x:(a-s*(n.x1+n.x2))/2,y:(o-s*(n.y1+n.y2))/2};return{zoom:s,pan:l}}}}},zoomRange:function(e,t){var n=this._private;if(t==null){var r=e;e=r.min,t=r.max}return rO(e)&&rO(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):rO(e)&&t===void 0&&e<=n.maxZoom?n.minZoom=e:rO(t)&&e===void 0&&t>=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t=this._private,n=t.pan,r=t.zoom,i,a,o=!1;if(t.zoomingEnabled||(o=!0),rO(e)?a=e:tO(e)&&(a=e.level,e.position==null?e.renderedPosition!=null&&(i=e.renderedPosition):i=_A(e.position,r,n),i!=null&&!t.panningEnabled&&(o=!0)),a=a>t.maxZoom?t.maxZoom:a,a=a<t.minZoom?t.minZoom:a,o||!rO(a)||a===r||i!=null&&(!rO(i.x)||!rO(i.y)))return null;if(i!=null){var s=n,l=r,u=a;return{zoomed:!0,panned:!0,zoom:u,pan:{x:-u/l*(i.x-s.x)+i.x,y:-u/l*(i.y-s.y)+i.y}}}return{zoomed:!0,panned:!1,zoom:a,pan:n}},zoom:function(e){if(e===void 0)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return t==null||!t.zoomed?this:(n.zoom=t.zoom,t.panned&&(n.pan.x=t.pan.x,n.pan.y=t.pan.y),this.emit(`zoom`+(t.panned?` pan`:``)+` viewport`),this.notify(`viewport`),this)},viewport:function(e){var t=this._private,n=!0,r=!0,i=[],a=!1,o=!1;if(!e||(rO(e.zoom)||(n=!1),tO(e.pan)||(r=!1),!n&&!r))return this;if(n){var s=e.zoom;s<t.minZoom||s>t.maxZoom||!t.zoomingEnabled?a=!0:(t.zoom=s,i.push(`zoom`))}if(r&&(!a||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;rO(l.x)&&(t.pan.x=l.x,o=!1),rO(l.y)&&(t.pan.y=l.y,o=!1),o||i.push(`pan`)}return i.length>0&&(i.push(`viewport`),this.emit(i.join(` `)),this.notify(`viewport`)),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit(`pan viewport`),this.notify(`viewport`)),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(QD(e)){var n=e;e=this.mutableElements().filter(n)}else oO(e)||(e=this.mutableElements());if(e.length!==0){var r=e.boundingBox(),i=this.width(),a=this.height();return t=t===void 0?this._private.zoom:t,{x:(i-t*(r.x1+r.x2))/2,y:(a-t*(r.y1+r.y2))/2}}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled||this.viewport({pan:{x:0,y:0},zoom:1}),this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,t=e.container,n=this;return e.sizeCache=e.sizeCache||(t?function(){var e=n.window().getComputedStyle(t),r=function(t){return parseFloat(e.getPropertyValue(t))};return{width:t.clientWidth-r(`padding-left`)-r(`padding-right`),height:t.clientHeight-r(`padding-top`)-r(`padding-bottom`)}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}},bP.centre=bP.center,bP.autolockNodes=bP.autolock,bP.autoungrabifyNodes=bP.autoungrabify,xP={data:VM.data({field:`data`,bindingEvent:`data`,allowBinding:!0,allowSetting:!0,settingEvent:`data`,settingTriggersEvent:!0,triggerFnName:`trigger`,allowGetting:!0,updateStyle:!0}),removeData:VM.removeData({field:`data`,event:`data`,triggerFnName:`trigger`,triggerEvent:!0,updateStyle:!0}),scratch:VM.data({field:`scratch`,bindingEvent:`scratch`,allowBinding:!0,allowSetting:!0,settingEvent:`scratch`,settingTriggersEvent:!0,triggerFnName:`trigger`,allowGetting:!0,updateStyle:!0}),removeScratch:VM.removeData({field:`scratch`,event:`scratch`,triggerFnName:`trigger`,triggerEvent:!0,updateStyle:!0})},xP.attr=xP.data,xP.removeAttr=xP.removeData,SP=function(e){var t=this;e=MO({},e);var n=e.container;n&&!aO(n)&&aO(n[0])&&(n=n[0]);var r=n?n._cyreg:null;r||={},r&&r.cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var a=GD!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=MO({name:a?`grid`:`null`},o.layout),o.renderer=MO({name:a?`canvas`:`null`},o.renderer);var s=function(e,t,n){return t===void 0?n===void 0?e:n:t},l=this._private={container:n,ready:!1,options:o,elements:new $N(this),listeners:[],aniEles:new $N(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,o.zoomingEnabled),userZoomingEnabled:s(!0,o.userZoomingEnabled),panningEnabled:s(!0,o.panningEnabled),userPanningEnabled:s(!0,o.userPanningEnabled),boxSelectionEnabled:s(!0,o.boxSelectionEnabled),autolock:s(!1,o.autolock,o.autolockNodes),autoungrabify:s(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:s(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?a:o.styleEnabled,zoom:rO(o.zoom)?o.zoom:1,pan:{x:tO(o.pan)&&rO(o.pan.x)?o.pan.x:0,y:tO(o.pan)&&rO(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:s(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var u=function(e,t){if(e.some(hO))return Vj.all(e).then(t);t(e)};l.styleEnabled&&t.setStyle([]);var d=MO({},o,o.renderer);t.initRenderer(d);var f=function(e,n,r){t.notifications(!1);var i=t.mutableElements();i.length>0&&i.remove(),e!=null&&(tO(e)||eO(e))&&t.add(e),t.one(`layoutready`,function(e){t.notifications(!0),t.emit(e),t.one(`load`,n),t.emitAndNotify(`load`)}).one(`layoutstop`,function(){t.one(`done`,r),t.emit(`done`)});var a=MO({},t._private.options.layout);a.eles=t.elements(),t.layout(a).run()};u([o.style,o.elements],function(e){var n=e[0],a=e[1];l.styleEnabled&&t.style().append(n),f(a,function(){t.startAnimationLoop(),l.ready=!0,$D(o.ready)&&t.on(`ready`,o.ready);for(var e=0;e<i.length;e++){var n=i[e];t.on(`ready`,n)}r&&(r.readies=[]),t.emit(`ready`)},o.done)})},CP=SP.prototype,MO(CP,{instanceString:function(){return`core`},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit(`ready`,[],e):this.on(`ready`,e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit(`destroy`),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){if(this._private.container==null)return GD;var e=this._private.container.ownerDocument;return e===void 0||e==null?GD:e.defaultView||GD},mount:function(e){if(e!=null){var t=this,n=t._private,r=n.options;return!aO(e)&&aO(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(MO({},r,r.renderer,{name:r.renderer.name===`null`?`canvas`:r.renderer.name})),t.startAnimationLoop(),t.style(r.style),t.emit(`mount`),t}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:`null`}),e.emit(`unmount`),e},options:function(){return Jk(this._private.options)},json:function(e){var t=this,n=t._private,r=t.mutableElements(),i=function(e){return t.getElementById(e.id())};if(tO(e)){if(t.startBatch(),e.elements){var a={},o=function(e,n){for(var r=[],i=[],o=0;o<e.length;o++){var s=e[o];if(!s.data.id){Kk(`cy.json() cannot handle elements without an ID attribute`);continue}var l=``+s.data.id,u=t.getElementById(l);a[l]=!0,u.length===0?(n&&(s.group=n),r.push(s)):i.push({ele:u,json:s})}t.add(r);for(var d=0;d<i.length;d++){var f=i[d],p=f.ele,m=f.json;p.json(m)}};if(eO(e.elements))o(e.elements);else for(var s=[`nodes`,`edges`],l=0;l<s.length;l++){var u=s[l],d=e.elements[u];eO(d)&&o(d,u)}var f=t.collection();r.filter(function(e){return!a[e.id()]}).forEach(function(e){e.isParent()?f.merge(e):e.remove()}),f.forEach(function(e){return e.children().move({parent:null})}),f.forEach(function(e){return i(e).remove()})}e.style&&t.style(e.style),e.zoom!=null&&e.zoom!==n.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&t.pan(e.pan),e.data&&t.data(e.data);for(var p=[`minZoom`,`maxZoom`,`zoomingEnabled`,`userZoomingEnabled`,`panningEnabled`,`userPanningEnabled`,`boxSelectionEnabled`,`autolock`,`autoungrabify`,`autounselectify`,`multiClickDebounceTime`],m=0;m<p.length;m++){var h=p[m];e[h]!=null&&t[h](e[h])}return t.endBatch(),this}var g=!!e,_={};g?_.elements=this.elements().map(function(e){return e.json()}):(_.elements={},r.forEach(function(e){var t=e.group();_.elements[t]||(_.elements[t]=[]),_.elements[t].push(e.json())})),this._private.styleEnabled&&(_.style=t.style().json()),_.data=Jk(t.data());var v=n.options;return _.zoomingEnabled=n.zoomingEnabled,_.userZoomingEnabled=n.userZoomingEnabled,_.zoom=n.zoom,_.minZoom=n.minZoom,_.maxZoom=n.maxZoom,_.panningEnabled=n.panningEnabled,_.userPanningEnabled=n.userPanningEnabled,_.pan=Jk(n.pan),_.boxSelectionEnabled=n.boxSelectionEnabled,_.renderer=Jk(v.renderer),_.hideEdgesOnViewport=v.hideEdgesOnViewport,_.textureOnViewport=v.textureOnViewport,_.wheelSensitivity=v.wheelSensitivity,_.motionBlur=v.motionBlur,_.multiClickDebounceTime=v.multiClickDebounceTime,_}}),CP.$id=CP.getElementById,[Hze,Wze,iP,aP,oP,Kze,sP,cP,Yze,bP,xP].forEach(function(e){MO(CP,e)}),Zze={fit:!0,directed:!1,direction:`downward`,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},Qze={maximal:!1,acyclic:!1},wP=function(e){return e.scratch(`breadthfirst`)},TP=function(e,t){return e.scratch(`breadthfirst`,t)},uD.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=n.nodes().filter(function(e){return e.isChildless()}),i=n,a=e.directed,o=e.acyclic||e.maximal||e.maximalAdjustments>0,s=!!e.boundingBox,l=kA(s?e.boundingBox:structuredClone(t.extent())),u;if(oO(e.roots))u=e.roots;else if(eO(e.roots)){for(var d=[],f=0;f<e.roots.length;f++){var p=e.roots[f],m=t.getElementById(p);d.push(m)}u=t.collection(d)}else if(QD(e.roots))u=t.$(e.roots);else if(a)u=r.roots();else{var h=n.components();u=t.collection();for(var g=function(){var e=h[_],t=e.maxDegree(!1),n=e.filter(function(e){return e.degree(!1)===t});u=u.add(n)},_=0;_<h.length;_++)g()}var v=[],y={},b=function(e,t){v[t]??(v[t]=[]);var n=v[t].length;v[t].push(e),TP(e,{index:n,depth:t})},x=function(e,t){var n=wP(e),r=n.depth,i=n.index;v[r][i]=null,e.isChildless()&&b(e,t)};i.bfs({roots:u,directed:e.directed,visit:function(e,t,n,r,i){var a=e[0],o=a.id();a.isChildless()&&b(a,i),y[o]=!0}});for(var S=[],C=0;C<r.length;C++){var w=r[C];y[w.id()]||S.push(w)}var T=function(e){for(var t=v[e],n=0;n<t.length;n++){var r=t[n];if(r==null){t.splice(n,1),n--;continue}TP(r,{depth:e,index:n})}},E=function(t,r){for(var i=wP(t),a=t.incomers().filter(function(e){return e.isNode()&&n.has(e)}),o=-1,s=t.id(),l=0;l<a.length;l++){var u=a[l],d=wP(u);o=Math.max(o,d.depth)}if(i.depth<=o){if(!e.acyclic&&r[s])return null;var f=o+1;return x(t,f),r[s]=f,!0}return!1};if(a&&o){var D=[],O={},k=function(e){return D.push(e)},A=function(){return D.shift()};for(r.forEach(function(e){return D.push(e)});D.length>0;){var j=A(),M=E(j,O);if(M)j.outgoers().filter(function(e){return e.isNode()&&n.has(e)}).forEach(k);else if(M===null){Kk("Detected double maximal shift for node `"+j.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var N=0;if(e.avoidOverlap)for(var P=0;P<r.length;P++){var F=r[P].layoutDimensions(e),I=F.w,L=F.h;N=Math.max(N,I,L)}var R={},ee=function(e){if(R[e.id()])return R[e.id()];for(var t=wP(e).depth,n=e.neighborhood(),i=0,a=0,o=0;o<n.length;o++){var s=n[o];if(!(s.isEdge()||s.isParent()||!r.has(s))){var l=wP(s);if(l!=null){var u=l.index,d=l.depth;if(u!=null&&d!=null){var f=v[d].length;d<t&&(i+=u/f,a++)}}}}return a=Math.max(1,a),i/=a,a===0&&(i=0),R[e.id()]=i,i},z=function(e,t){var n=ee(e)-ee(t);return n===0?AO(e.id(),t.id()):n};e.depthSort!==void 0&&(z=e.depthSort);for(var B=v.length,te=0;te<B;te++)v[te].sort(z),T(te);for(var ne=[],re=0;re<S.length;re++)ne.push(S[re]);ne.length&&(v.unshift(ne),B=v.length,function(){for(var e=0;e<B;e++)T(e)}());for(var ie=0,ae=0;ae<B;ae++)ie=Math.max(v[ae].length,ie);var oe={x:l.x1+l.w/2,y:l.y1+l.h/2},se=r.reduce(function(t,n){return function(e){return{w:t.w===-1?e.w:(t.w+e.w)/2,h:t.h===-1?e.h:(t.h+e.h)/2}}(n.boundingBox({includeLabels:e.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),ce=Math.max(B===1?0:s?(l.h-e.padding*2-se.h)/(B-1):(l.h-e.padding*2-se.h)/(B+1),N),le=v.reduce(function(e,t){return Math.max(e,t.length)},0),ue=function(t){var n=wP(t),r=n.depth,i=n.index;if(e.circle){var a=Math.min(l.w/2/B,l.h/2/B);a=Math.max(a,N);var o=a*r+a-(B>0&&v[0].length<=3?a/2:0),u=2*Math.PI/v[r].length*i;return r===0&&v[0].length===1&&(o=1),{x:oe.x+o*Math.cos(u),y:oe.y+o*Math.sin(u)}}var d=v[r].length,f=Math.max(d===1?0:s?(l.w-e.padding*2-se.w)/((e.grid?le:d)-1):(l.w-e.padding*2-se.w)/((e.grid?le:d)+1),N);return{x:oe.x+(i+1-(d+1)/2)*f,y:oe.y+(r+1-(B+1)/2)*ce}},de={downward:0,leftward:90,upward:180,rightward:-90};return Object.keys(de).indexOf(e.direction)===-1&&Wk(`Invalid direction '${e.direction}' specified for breadthfirst layout. Valid values are: ${Object.keys(de).join(`, `)}`),n.nodes().layoutPositions(this,e,function(t){return oFe(ue(t),l,de[e.direction])}),this},$ze={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},dD.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=t.counterclockwise===void 0?t.clockwise:!t.counterclockwise,a=r.nodes().not(`:parent`);t.sort&&(a=a.sort(t.sort));for(var o=kA(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},l=(t.sweep===void 0?2*Math.PI-2*Math.PI/a.length:t.sweep)/Math.max(1,a.length-1),u,d=0,f=0;f<a.length;f++){var p=a[f].layoutDimensions(t),m=p.w,h=p.h;d=Math.max(d,m,h)}if(u=rO(t.radius)?t.radius:a.length<=1?0:Math.min(o.h,o.w)/2-d,a.length>1&&t.avoidOverlap){d*=1.75;var g=Math.cos(l)-Math.cos(0),_=Math.sin(l)-Math.sin(0),v=Math.sqrt(d*d/(g*g+_*_));u=Math.max(v,u)}return r.nodes().layoutPositions(this,t,function(e,n){var r=t.startAngle+n*l*(i?1:-1),a=u*Math.cos(r),o=u*Math.sin(r);return{x:s.x+a,y:s.y+o}}),this},eBe={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},fD.prototype.run=function(){for(var e=this.options,t=e,n=t.counterclockwise===void 0?t.clockwise:!t.counterclockwise,r=e.cy,i=t.eles,a=i.nodes().not(`:parent`),o=kA(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},l=[],u=0,d=0;d<a.length;d++){var f=a[d],p=void 0;p=t.concentric(f),l.push({value:p,node:f}),f._private.scratch.concentric=p}a.updateStyle();for(var m=0;m<a.length;m++){var h=a[m].layoutDimensions(t);u=Math.max(u,h.w,h.h)}l.sort(function(e,t){return t.value-e.value});for(var g=t.levelWidth(a),_=[[]],v=_[0],y=0;y<l.length;y++){var b=l[y];v.length>0&&Math.abs(v[0].value-b.value)>=g&&(v=[],_.push(v)),v.push(b)}var x=u+t.minNodeSpacing;if(!t.avoidOverlap){var S=_.length>0&&_[0].length>1,C=(Math.min(o.w,o.h)/2-x)/(_.length+S?1:0);x=Math.min(x,C)}for(var w=0,T=0;T<_.length;T++){var E=_[T],D=E.dTheta=(t.sweep===void 0?2*Math.PI-2*Math.PI/E.length:t.sweep)/Math.max(1,E.length-1);if(E.length>1&&t.avoidOverlap){var O=Math.cos(D)-Math.cos(0),k=Math.sin(D)-Math.sin(0),A=Math.sqrt(x*x/(O*O+k*k));w=Math.max(A,w)}E.r=w,w+=x}if(t.equidistant){for(var j=0,M=0,N=0;N<_.length;N++){var P=_[N].r-M;j=Math.max(j,P)}M=0;for(var F=0;F<_.length;F++){var I=_[F];F===0&&(M=I.r),I.r=M,M+=j}}for(var L={},R=0;R<_.length;R++)for(var ee=_[R],z=ee.dTheta,B=ee.r,te=0;te<ee.length;te++){var ne=ee[te],re=t.startAngle+(n?1:-1)*z*te,ie={x:s.x+B*Math.cos(re),y:s.y+B*Math.sin(re)};L[ne.node.id()]=ie}return i.nodes().layoutPositions(this,t,function(e){return L[e.id()]}),this},nBe={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1},pD.prototype.run=function(){var e=this.options,t=e.cy,n=this;n.stopped=!1,(e.animate===!0||e.animate===!1)&&n.emit({type:`layoutstart`,layout:n}),tBe=!0===e.debug;var r=rBe(t,n,e);tBe&&aBe(r),e.randomize&&oBe(r);var i=xk(),a=function(){sBe(r,t,e),!0===e.fit&&t.fit(e.padding)},o=function(t){return!(n.stopped||t>=e.numIter||(cBe(r,e),r.temperature*=e.coolingFactor,r.temperature<e.minTemp))},s=function(){if(e.animate===!0||e.animate===!1)a(),n.one(`layoutstop`,e.stop),n.emit({type:`layoutstop`,layout:n});else{var t=e.eles.nodes(),i=DP(r,e,t);t.layoutPositions(n,e,i)}},l=0,u=!0;if(e.animate===!0){var d=function(){for(var t=0;u&&t<e.refresh;)u=o(l),l++,t++;u?(xk()-i>=e.animationThreshold&&a(),bk(d)):(jP(r,e),s())};d()}else{for(;u;)u=o(l),l++;jP(r,e),s()}return this},pD.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit(`layoutstop`),this},pD.prototype.destroy=function(){return this.thread&&this.thread.stop(),this},rBe=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),a=kA(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:a.w,clientHeight:a.h,boundingBox:a},s=n.eles.components(),l={},u=0;u<s.length;u++)for(var d=s[u],f=0;f<d.length;f++){var p=d[f];l[p.id()]=u}for(var u=0;u<o.nodeSize;u++){var m=i[u],h=m.layoutDimensions(n),g={};g.isLocked=m.locked(),g.id=m.data(`id`),g.parentId=m.data(`parent`),g.cmptId=l[m.id()],g.children=[],g.positionX=m.position(`x`),g.positionY=m.position(`y`),g.offsetX=0,g.offsetY=0,g.height=h.w,g.width=h.h,g.maxX=g.positionX+g.width/2,g.minX=g.positionX-g.width/2,g.maxY=g.positionY+g.height/2,g.minY=g.positionY-g.height/2,g.padLeft=parseFloat(m.style(`padding`)),g.padRight=parseFloat(m.style(`padding`)),g.padTop=parseFloat(m.style(`padding`)),g.padBottom=parseFloat(m.style(`padding`)),g.nodeRepulsion=$D(n.nodeRepulsion)?n.nodeRepulsion(m):n.nodeRepulsion,o.layoutNodes.push(g),o.idToIndex[g.id]=u}for(var _=[],v=0,y=-1,b=[],u=0;u<o.nodeSize;u++){var m=o.layoutNodes[u],x=m.parentId;x==null?(_[++y]=m.id,b.push(m.id)):o.layoutNodes[o.idToIndex[x]].children.push(m.id)}for(o.graphSet.push(b);v<=y;){var S=_[v++],C=o.idToIndex[S],p=o.layoutNodes[C],w=p.children;if(w.length>0){o.graphSet.push(w);for(var u=0;u<w.length;u++)_[++y]=w[u]}}for(var u=0;u<o.graphSet.length;u++)for(var T=o.graphSet[u],f=0;f<T.length;f++){var E=o.idToIndex[T[f]];o.indexToGraph[E]=u}for(var u=0;u<o.edgeSize;u++){var D=r[u],O={};O.id=D.data(`id`),O.sourceId=D.data(`source`),O.targetId=D.data(`target`);var k=$D(n.idealEdgeLength)?n.idealEdgeLength(D):n.idealEdgeLength,A=$D(n.edgeElasticity)?n.edgeElasticity(D):n.edgeElasticity,j=o.idToIndex[O.sourceId],M=o.idToIndex[O.targetId];if(o.indexToGraph[j]!=o.indexToGraph[M]){for(var N=iBe(O.sourceId,O.targetId,o),P=o.graphSet[N],F=0,g=o.layoutNodes[j];P.indexOf(g.id)===-1;)g=o.layoutNodes[o.idToIndex[g.parentId]],F++;for(g=o.layoutNodes[M];P.indexOf(g.id)===-1;)g=o.layoutNodes[o.idToIndex[g.parentId]],F++;k*=F*n.nestingFactor}O.idealLength=k,O.elasticity=A,o.layoutEdges.push(O)}return o},iBe=function(e,t,n){var r=EP(e,t,0,n);return 2>r.count?0:r.graph},EP=function(e,t,n,r){var i=r.graphSet[n];if(-1<i.indexOf(e)&&-1<i.indexOf(t))return{count:2,graph:n};for(var a=0,o=0;o<i.length;o++){var s=i[o],l=r.idToIndex[s],u=r.layoutNodes[l].children;if(u.length!==0){var d=r.indexToGraph[r.idToIndex[u[0]]],f=EP(e,t,d,r);if(f.count!==0){if(f.count===1){if(a++,a===2)break}else return f}}}return{count:a,graph:n}},oBe=function(e,t){for(var n=e.clientWidth,r=e.clientHeight,i=0;i<e.nodeSize;i++){var a=e.layoutNodes[i];a.children.length===0&&!a.isLocked&&(a.positionX=Math.random()*n,a.positionY=Math.random()*r)}},DP=function(e,t,n){var r=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(n.forEach(function(t){var n=e.layoutNodes[e.idToIndex[t.data(`id`)]];i.x1=Math.min(i.x1,n.positionX),i.x2=Math.max(i.x2,n.positionX),i.y1=Math.min(i.y1,n.positionY),i.y2=Math.max(i.y2,n.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(n,a){var o=e.layoutNodes[e.idToIndex[n.data(`id`)]];if(t.boundingBox){var s=i.w===0?.5:(o.positionX-i.x1)/i.w,l=i.h===0?.5:(o.positionY-i.y1)/i.h;return{x:r.x1+s*r.w,y:r.y1+l*r.h}}return{x:o.positionX,y:o.positionY}}},sBe=function(e,t,n){var r=n.layout,i=n.eles.nodes(),a=DP(e,n,i);i.positions(a),!0!==e.ready&&(e.ready=!0,r.one(`layoutready`,n.ready),r.emit({type:`layoutready`,layout:this}))},cBe=function(e,t,n){lBe(e,t),fBe(e),pBe(e,t),mBe(e),hBe(e)},lBe=function(e,t){for(var n=0;n<e.graphSet.length;n++)for(var r=e.graphSet[n],i=r.length,a=0;a<i;a++)for(var o=e.layoutNodes[e.idToIndex[r[a]]],s=a+1;s<i;s++){var l=e.layoutNodes[e.idToIndex[r[s]]];uBe(o,l,e,t)}},OP=function(e){return-e+2*e*Math.random()},uBe=function(e,t,n,r){if(!(e.cmptId!==t.cmptId&&!n.isCompound)){var i=t.positionX-e.positionX,a=t.positionY-e.positionY,o=1;i===0&&a===0&&(i=OP(o),a=OP(o));var s=dBe(e,t,i,a);if(s>0)var l=r.nodeOverlap*s,u=Math.sqrt(i*i+a*a),d=l*i/u,f=l*a/u;else var p=kP(e,i,a),m=kP(t,-1*i,-1*a),h=m.x-p.x,g=m.y-p.y,_=h*h+g*g,u=Math.sqrt(_),l=(e.nodeRepulsion+t.nodeRepulsion)/_,d=l*h/u,f=l*g/u;e.isLocked||(e.offsetX-=d,e.offsetY-=f),t.isLocked||(t.offsetX+=d,t.offsetY+=f)}},dBe=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else var i=t.maxX-e.minX;if(r>0)var a=e.maxY-t.minY;else var a=t.maxY-e.minY;return i>=0&&a>=0?Math.sqrt(i*i+a*a):0},kP=function(e,t,n){var r=e.positionX,i=e.positionY,a=e.height||1,o=e.width||1,s=n/t,l=a/o,u={};return t===0&&0<n||t===0&&0>n?(u.x=r,u.y=i+a/2,u):0<t&&-1*l<=s&&s<=l?(u.x=r+o/2,u.y=i+o*n/2/t,u):0>t&&-1*l<=s&&s<=l?(u.x=r-o/2,u.y=i-o*n/2/t,u):0<n&&(s<=-1*l||s>=l)?(u.x=r+a*t/2/n,u.y=i+a/2,u):0>n&&(s<=-1*l||s>=l)?(u.x=r-a*t/2/n,u.y=i-a/2,u):u},fBe=function(e,t){for(var n=0;n<e.edgeSize;n++){var r=e.layoutEdges[n],i=e.idToIndex[r.sourceId],a=e.layoutNodes[i],o=e.idToIndex[r.targetId],s=e.layoutNodes[o],l=s.positionX-a.positionX,u=s.positionY-a.positionY;if(l!==0||u!==0){var d=kP(a,l,u),f=kP(s,-1*l,-1*u),p=f.x-d.x,m=f.y-d.y,h=Math.sqrt(p*p+m*m),g=(r.idealLength-h)**2/r.elasticity;if(h!==0)var _=g*p/h,v=g*m/h;else var _=0,v=0;a.isLocked||(a.offsetX+=_,a.offsetY+=v),s.isLocked||(s.offsetX-=_,s.offsetY-=v)}}},pBe=function(e,t){if(t.gravity!==0)for(var n=1,r=0;r<e.graphSet.length;r++){var i=e.graphSet[r],a=i.length;if(r===0)var o=e.clientHeight/2,s=e.clientWidth/2;else var l=e.layoutNodes[e.idToIndex[i[0]]],u=e.layoutNodes[e.idToIndex[l.parentId]],o=u.positionX,s=u.positionY;for(var d=0;d<a;d++){var f=e.layoutNodes[e.idToIndex[i[d]]];if(!f.isLocked){var p=o-f.positionX,m=s-f.positionY,h=Math.sqrt(p*p+m*m);if(h>n){var g=t.gravity*p/h,_=t.gravity*m/h;f.offsetX+=g,f.offsetY+=_}}}}},mBe=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var a=n[r++],o=e.idToIndex[a],s=e.layoutNodes[o],l=s.children;if(0<l.length&&!s.isLocked){for(var u=s.offsetX,d=s.offsetY,f=0;f<l.length;f++){var p=e.layoutNodes[e.idToIndex[l[f]]];p.offsetX+=u,p.offsetY+=d,n[++i]=l[f]}s.offsetX=0,s.offsetY=0}}},hBe=function(e,t){for(var n=0;n<e.nodeSize;n++){var r=e.layoutNodes[n];0<r.children.length&&(r.maxX=void 0,r.minX=void 0,r.maxY=void 0,r.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var r=e.layoutNodes[n];if(!(0<r.children.length||r.isLocked)){var i=gBe(r.offsetX,r.offsetY,e.temperature);r.positionX+=i.x,r.positionY+=i.y,r.offsetX=0,r.offsetY=0,r.minX=r.positionX-r.width,r.maxX=r.positionX+r.width,r.minY=r.positionY-r.height,r.maxY=r.positionY+r.height,AP(r,e)}}for(var n=0;n<e.nodeSize;n++){var r=e.layoutNodes[n];0<r.children.length&&!r.isLocked&&(r.positionX=(r.maxX+r.minX)/2,r.positionY=(r.maxY+r.minY)/2,r.width=r.maxX-r.minX,r.height=r.maxY-r.minY)}},gBe=function(e,t,n){var r=Math.sqrt(e*e+t*t);if(r>n)var i={x:n*e/r,y:n*t/r};else var i={x:e,y:t};return i},AP=function(e,t){var n=e.parentId;if(n!=null){var r=t.layoutNodes[t.idToIndex[n]],i=!1;if((r.maxX==null||e.maxX+r.padRight>r.maxX)&&(r.maxX=e.maxX+r.padRight,i=!0),(r.minX==null||e.minX-r.padLeft<r.minX)&&(r.minX=e.minX-r.padLeft,i=!0),(r.maxY==null||e.maxY+r.padBottom>r.maxY)&&(r.maxY=e.maxY+r.padBottom,i=!0),(r.minY==null||e.minY-r.padTop<r.minY)&&(r.minY=e.minY-r.padTop,i=!0),i)return AP(r,t)}},jP=function(e,t){for(var n=e.layoutNodes,r=[],i=0;i<n.length;i++){var a=n[i],o=a.cmptId;(r[o]=r[o]||[]).push(a)}for(var s=0,i=0;i<r.length;i++){var l=r[i];if(l){l.x1=1/0,l.x2=-1/0,l.y1=1/0,l.y2=-1/0;for(var u=0;u<l.length;u++){var d=l[u];l.x1=Math.min(l.x1,d.positionX-d.width/2),l.x2=Math.max(l.x2,d.positionX+d.width/2),l.y1=Math.min(l.y1,d.positionY-d.height/2),l.y2=Math.max(l.y2,d.positionY+d.height/2)}l.w=l.x2-l.x1,l.h=l.y2-l.y1,s+=l.w*l.h}}r.sort(function(e,t){return t.w*t.h-e.w*e.h});for(var f=0,p=0,m=0,h=0,g=Math.sqrt(s)*e.clientWidth/e.clientHeight,i=0;i<r.length;i++){var l=r[i];if(l){for(var u=0;u<l.length;u++){var d=l[u];d.isLocked||(d.positionX+=f-l.x1,d.positionY+=p-l.y1)}f+=l.w+t.componentSpacing,m+=l.w+t.componentSpacing,h=Math.max(h,l.h),m>g&&(p+=h+t.componentSpacing,f=0,m=0,h=0)}}},_Be={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},mD.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=r.nodes().not(`:parent`);t.sort&&(i=i.sort(t.sort));var a=kA(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(a.h===0||a.w===0)r.nodes().layoutPositions(this,t,function(e){return{x:a.x1,y:a.y1}});else{var o=i.size(),s=Math.sqrt(o*a.h/a.w),l=Math.round(s),u=Math.round(a.w/a.h*s),d=function(e){if(e==null)return Math.min(l,u);Math.min(l,u)==l?l=e:u=e},f=function(e){if(e==null)return Math.max(l,u);Math.max(l,u)==l?l=e:u=e},p=t.rows,m=t.cols==null?t.columns:t.cols;if(p!=null&&m!=null)l=p,u=m;else if(p!=null&&m==null)l=p,u=Math.ceil(o/l);else if(p==null&&m!=null)u=m,l=Math.ceil(o/u);else if(u*l>o){var h=d(),g=f();(h-1)*g>=o?d(h-1):(g-1)*h>=o&&f(g-1)}else for(;u*l<o;){var _=d(),v=f();(v+1)*_>=o?f(v+1):d(_+1)}var y=a.w/u,b=a.h/l;if(t.condense&&(y=0,b=0),t.avoidOverlap)for(var x=0;x<i.length;x++){var S=i[x],C=S._private.position;(C.x==null||C.y==null)&&(C.x=0,C.y=0);var w=S.layoutDimensions(t),T=t.avoidOverlapPadding,E=w.w+T,D=w.h+T;y=Math.max(y,E),b=Math.max(b,D)}for(var O={},k=function(e,t){return!!O[`c-`+e+`-`+t]},A=function(e,t){O[`c-`+e+`-`+t]=!0},j=0,M=0,N=function(){M++,M>=u&&(M=0,j++)},P={},F=0;F<i.length;F++){var I=i[F],L=t.position(I);if(L&&(L.row!==void 0||L.col!==void 0)){var R={row:L.row,col:L.col};if(R.col===void 0)for(R.col=0;k(R.row,R.col);)R.col++;else if(R.row===void 0)for(R.row=0;k(R.row,R.col);)R.row++;P[I.id()]=R,A(R.row,R.col)}}i.layoutPositions(this,t,function(e,t){var n,r;if(e.locked()||e.isParent())return!1;var i=P[e.id()];if(i)n=i.col*y+y/2+a.x1,r=i.row*b+b/2+a.y1;else{for(;k(j,M);)N();n=M*y+y/2+a.x1,r=j*b+b/2+a.y1,A(j,M),N()}return{x:n,y:r}})}return this},vBe={ready:function(){},stop:function(){}},hD.prototype.run=function(){var e=this.options,t=e.eles,n=this;return e.cy,n.emit(`layoutstart`),t.nodes().positions(function(){return{x:0,y:0}}),n.one(`layoutready`,e.ready),n.emit(`layoutready`),n.one(`layoutstop`,e.stop),n.emit(`layoutstop`),this},hD.prototype.stop=function(){return this},yBe={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},gD.prototype.run=function(){var e=this.options,t=e.eles.nodes(),n=$D(e.positions);function r(t){return e.positions==null?YIe(t.position()):n?e.positions(t):e.positions[t._private.data.id]??null}return t.layoutPositions(this,e,function(e,t){var n=r(e);return e.locked()||n==null?!1:n}),this},bBe={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},_D.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=kA(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});return n.nodes().layoutPositions(this,e,function(e,t){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}}),this},xBe=[{name:`breadthfirst`,impl:uD},{name:`circle`,impl:dD},{name:`concentric`,impl:fD},{name:`cose`,impl:pD},{name:`grid`,impl:mD},{name:`null`,impl:hD},{name:`preset`,impl:gD},{name:`random`,impl:_D}],MP=function(){},NP=function(){throw Error(`A headless instance can not render images`)},vD.prototype={recalculateRenderedStyle:MP,notify:function(){this.notifications++},init:MP,isHeadless:function(){return!0},png:NP,jpg:NP},PP={},PP.arrowShapeWidth=.3,PP.registerArrowShapes=function(){var e=this.arrowShapes={},t=this,n=function(e,t,n,r,i,a,o){var s=i.x-n/2-o,l=i.x+n/2+o,u=i.y-n/2-o,d=i.y+n/2+o;return s<=e&&e<=l&&u<=t&&t<=d},r=function(e,t,n,r,i){var a=e*Math.cos(r)-t*Math.sin(r),o=e*Math.sin(r)+t*Math.cos(r),s=a*n,l=o*n;return{x:s+i.x,y:l+i.y}},i=function(e,t,n,i){for(var a=[],o=0;o<e.length;o+=2){var s=e[o],l=e[o+1];a.push(r(s,l,t,n,i))}return a},a=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r.x,r.y)}return t},o=function(e){return e.pstyle(`width`).pfValue*e.pstyle(`arrow-scale`).pfValue*2},s=function(r,s){QD(s)&&(s=e[s]),e[r]=MO({name:r,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(e,t,n,r,o,s){return zA(e,t,a(i(this.points,n+2*s,r,o)))},roughCollide:n,draw:function(e,n,r,a){var o=i(this.points,n,r,a);t.arrowShapeImpl(`polygon`)(e,o)},spacing:function(e){return 0},gap:o},s)};s(`none`,{collide:Vk,roughCollide:Vk,draw:Uk,spacing:Hk,gap:Hk}),s(`triangle`,{points:[-.15,-.3,0,0,.15,-.3]}),s(`arrow`,`triangle`),s(`triangle-backcurve`,{points:e.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(e,n,a,o,s){var l=i(this.points,n,a,o),u=this.controlPoint,d=r(u[0],u[1],n,a,o);t.arrowShapeImpl(this.name)(e,l,d)},gap:function(e){return o(e)*.8}}),s(`triangle-tee`,{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(e,t,n,r,o,s,l){var u=a(i(this.points,n+2*l,r,o)),d=a(i(this.pointsTee,n+2*l,r,o));return zA(e,t,u)||zA(e,t,d)},draw:function(e,n,r,a,o){var s=i(this.points,n,r,a),l=i(this.pointsTee,n,r,a);t.arrowShapeImpl(this.name)(e,s,l)}}),s(`circle-triangle`,{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(e,t,n,r,o,s,l){var u=o,d=(u.x-e)**2+(u.y-t)**2<=((n+2*l)*this.radius)**2;return zA(e,t,a(i(this.points,n+2*l,r,o)))||d},draw:function(e,n,r,a,o){var s=i(this.pointsTr,n,r,a);t.arrowShapeImpl(this.name)(e,s,a.x,a.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle(`width`).pfValue,e.pstyle(`arrow-scale`).value)*this.radius}}),s(`triangle-cross`,{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(e,t){var n=this.baseCrossLinePts.slice(),r=t/e,i=3,a=5;return n[i]=n[i]-r,n[a]=n[a]-r,n},collide:function(e,t,n,r,o,s,l){var u=a(i(this.points,n+2*l,r,o)),d=a(i(this.crossLinePts(n,s),n+2*l,r,o));return zA(e,t,u)||zA(e,t,d)},draw:function(e,n,r,a,o){var s=i(this.points,n,r,a),l=i(this.crossLinePts(n,o),n,r,a);t.arrowShapeImpl(this.name)(e,s,l)}}),s(`vee`,{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(e){return o(e)*.525}}),s(`circle`,{radius:.15,collide:function(e,t,n,r,i,a,o){var s=i;return(s.x-e)**2+(s.y-t)**2<=((n+2*o)*this.radius)**2},draw:function(e,n,r,i,a){t.arrowShapeImpl(this.name)(e,i.x,i.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle(`width`).pfValue,e.pstyle(`arrow-scale`).value)*this.radius}}),s(`tee`,{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(e){return 1},gap:function(e){return 1}}),s(`square`,{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s(`diamond`,{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(e){return e.pstyle(`width`).pfValue*e.pstyle(`arrow-scale`).value}}),s(`chevron`,{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(e){return .95*e.pstyle(`width`).pfValue*e.pstyle(`arrow-scale`).value}})},FP={},FP.projectIntoViewport=function(e,t){var n=this.cy,r=this.findContainerClientCoords(),i=r[0],a=r[1],o=r[4],s=n.pan(),l=n.zoom();return[((e-i)/o-s.x)/l,((t-a)/o-s.y)/l]},FP.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var e=this.container,t=e.getBoundingClientRect(),n=this.cy.window().getComputedStyle(e),r=function(e){return parseFloat(n.getPropertyValue(e))},i={left:r(`padding-left`),right:r(`padding-right`),top:r(`padding-top`),bottom:r(`padding-bottom`)},a={left:r(`border-left-width`),right:r(`border-right-width`),top:r(`border-top-width`),bottom:r(`border-bottom-width`)},o=e.clientWidth,s=e.clientHeight,l=i.left+i.right,u=i.top+i.bottom,d=a.left+a.right,f=t.width/(o+d),p=o-l,m=s-u,h=t.left+i.left+a.left,g=t.top+i.top+a.top;return this.containerBB=[h,g,p,m,f]},FP.invalidateContainerClientCoordsCache=function(){this.containerBB=null},FP.findNearestElement=function(e,t,n,r){return this.findNearestElements(e,t,n,r)[0]},FP.findNearestElements=function(e,t,n,r){var i=this,a=this,o=a.getCachedZSortedEles(),s=[],l=a.cy.zoom(),u=a.cy.hasCompoundNodes(),d=(r?24:8)/l,f=(r?8:2)/l,p=(r?8:2)/l,m=1/0,h,g;n&&(o=o.interactive);function _(e,t){if(e.isNode()){if(g)return;g=e,s.push(e)}if(e.isEdge()&&(t==null||t<m)){if(h){if(h.pstyle(`z-compound-depth`).value===e.pstyle(`z-compound-depth`).value&&h.pstyle(`z-compound-depth`).value===e.pstyle(`z-compound-depth`).value){for(var n=0;n<s.length;n++)if(s[n].isEdge()){s[n]=e,h=e,m=t??m;break}}}else s.push(e),h=e,m=t??m}}function v(n){var r=n.outerWidth()+2*f,o=n.outerHeight()+2*f,s=r/2,l=o/2,u=n.position(),d=n.pstyle(`corner-radius`).value===`auto`?`auto`:n.pstyle(`corner-radius`).pfValue,p=n._private.rscratch;if(u.x-s<=e&&e<=u.x+s&&u.y-l<=t&&t<=u.y+l&&a.nodeShapes[i.getNodeShape(n)].checkPoint(e,t,0,r,o,u.x,u.y,d,p))return _(n,0),!0}function y(n){var r=n._private,o=r.rscratch,l=n.pstyle(`width`).pfValue,f=n.pstyle(`arrow-scale`).value,p=l/2+d,m=p*p,h=p*2,g=r.source,y=r.target,b;if(o.edgeType===`segments`||o.edgeType===`straight`||o.edgeType===`haystack`){for(var x=o.allpts,S=0;S+3<x.length;S+=2)if(cLe(e,t,x[S],x[S+1],x[S+2],x[S+3],h)&&m>(b=pLe(e,t,x[S],x[S+1],x[S+2],x[S+3])))return _(n,b),!0}else if(o.edgeType===`bezier`||o.edgeType===`multibezier`||o.edgeType===`self`||o.edgeType===`compound`){for(var x=o.allpts,S=0;S+5<o.allpts.length;S+=4)if(lLe(e,t,x[S],x[S+1],x[S+2],x[S+3],x[S+4],x[S+5],h)&&m>(b=fLe(e,t,x[S],x[S+1],x[S+2],x[S+3],x[S+4],x[S+5])))return _(n,b),!0}for(var g=g||r.source,y=y||r.target,C=i.getArrowWidth(l,f),w=[{name:`source`,x:o.arrowStartX,y:o.arrowStartY,angle:o.srcArrowAngle},{name:`target`,x:o.arrowEndX,y:o.arrowEndY,angle:o.tgtArrowAngle},{name:`mid-source`,x:o.midX,y:o.midY,angle:o.midsrcArrowAngle},{name:`mid-target`,x:o.midX,y:o.midY,angle:o.midtgtArrowAngle}],S=0;S<w.length;S++){var T=w[S],E=a.arrowShapes[n.pstyle(T.name+`-arrow-shape`).value],D=n.pstyle(`width`).pfValue;if(E.roughCollide(e,t,C,T.angle,{x:T.x,y:T.y},D,d)&&E.collide(e,t,C,T.angle,{x:T.x,y:T.y},D,d))return _(n),!0}u&&s.length>0&&(v(g),v(y))}function b(e,t,n){return rA(e,t,n)}function x(n,r){var i=n._private,a=p,o=r?r+`-`:``;n.boundingBox();var s=i.labelBounds[r||`main`],l=n.pstyle(o+`label`).value;if(!(n.pstyle(`text-events`).strValue!==`yes`||!l)){var u=b(i.rscratch,`labelX`,r),d=b(i.rscratch,`labelY`,r),f=b(i.rscratch,`labelAngle`,r),m=n.pstyle(o+`text-margin-x`).pfValue,h=n.pstyle(o+`text-margin-y`).pfValue,g=s.x1-a-m,v=s.x2+a-m,y=s.y1-a-h,x=s.y2+a-h;if(f){var S=Math.cos(f),C=Math.sin(f),w=function(e,t){return e-=u,t-=d,{x:e*S-t*C+u,y:e*C+t*S+d}},T=w(g,y),E=w(g,x),D=w(v,y),O=w(v,x);if(zA(e,t,[T.x+m,T.y+h,D.x+m,D.y+h,O.x+m,O.y+h,E.x+m,E.y+h]))return _(n),!0}else if(FA(s,e,t))return _(n),!0}}for(var S=o.length-1;S>=0;S--){var C=o[S];C.isNode()?v(C)||x(C):y(C)||x(C)||x(C,`source`)||x(C,`target`)}return s},FP.getAllInBox=function(e,t,n,r){var i=this.getCachedZSortedEles().interactive,a=2/this.cy.zoom(),o=[],s=Math.min(e,n),l=Math.max(e,n),u=Math.min(t,r),d=Math.max(t,r);e=s,n=l,t=u,r=d;var f=kA({x1:e,y1:t,x2:n,y2:r}),p=[{x:f.x1,y:f.y1},{x:f.x2,y:f.y1},{x:f.x2,y:f.y2},{x:f.x1,y:f.y2}],m=[[p[0],p[1]],[p[1],p[2]],[p[2],p[3]],[p[3],p[0]]];function h(e,t,n){return rA(e,t,n)}function g(e,t){var n=e._private,r=a,i=``;e.boundingBox();var o=n.labelBounds.main;if(!o)return null;var s=h(n.rscratch,`labelX`,t),l=h(n.rscratch,`labelY`,t),u=h(n.rscratch,`labelAngle`,t),d=e.pstyle(i+`text-margin-x`).pfValue,f=e.pstyle(i+`text-margin-y`).pfValue,p=o.x1-r-d,m=o.x2+r-d,g=o.y1-r-f,_=o.y2+r-f;if(u){var v=Math.cos(u),y=Math.sin(u),b=function(e,t){return e-=s,t-=l,{x:e*v-t*y+s,y:e*y+t*v+l}};return[b(p,g),b(m,g),b(m,_),b(p,_)]}return[{x:p,y:g},{x:m,y:g},{x:m,y:_},{x:p,y:_}]}function _(e,t,n,r){function i(e,t,n){return(n.y-e.y)*(t.x-e.x)>(t.y-e.y)*(n.x-e.x)}return i(e,n,r)!==i(t,n,r)&&i(e,t,n)!==i(e,t,r)}for(var v=0;v<i.length;v++){var y=i[v];if(y.isNode()){var b=y,x=b.pstyle(`text-events`).strValue===`yes`,S=b.pstyle(`box-selection`).strValue,C=b.pstyle(`box-select-labels`).strValue===`yes`;if(S===`none`)continue;var w=(S===`overlap`||C)&&x,T=b.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:w});if(S===`contain`){var E=!1;if(C&&x){var D=g(b);D&&OE(D,p)&&(o.push(b),E=!0)}!E&&LA(f,T)&&o.push(b)}else if(S===`overlap`&&PA(f,T)){var O=b.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1});if(OE([{x:O.x1,y:O.y1},{x:O.x2,y:O.y1},{x:O.x2,y:O.y2},{x:O.x1,y:O.y2}],p))o.push(b);else{var k=g(b);k&&OE(k,p)&&o.push(b)}}}else{var A=y,j=A._private,M=j.rscratch,N=A.pstyle(`box-selection`).strValue;if(N===`none`)continue;if(N===`contain`){if(M.startX!=null&&M.startY!=null&&!FA(f,M.startX,M.startY)||M.endX!=null&&M.endY!=null&&!FA(f,M.endX,M.endY))continue;if(M.edgeType===`bezier`||M.edgeType===`multibezier`||M.edgeType===`self`||M.edgeType===`compound`||M.edgeType===`segments`||M.edgeType===`haystack`){for(var P=j.rstyle.bezierPts||j.rstyle.linePts||j.rstyle.haystackPts,F=!0,I=0;I<P.length;I++)if(!IA(f,P[I])){F=!1;break}F&&o.push(A)}else M.edgeType===`straight`&&o.push(A)}else if(N===`overlap`){var L=!1;if(M.startX!=null&&M.startY!=null&&M.endX!=null&&M.endY!=null&&(FA(f,M.startX,M.startY)||FA(f,M.endX,M.endY)))o.push(A),L=!0;else if(!L&&M.edgeType===`haystack`){for(var R=j.rstyle.haystackPts,ee=0;ee<R.length;ee++)if(IA(f,R[ee])){o.push(A),L=!0;break}}if(!L){var z=j.rstyle.bezierPts||j.rstyle.linePts||j.rstyle.haystackPts;if((!z||z.length<2)&&M.edgeType===`straight`&&M.startX!=null&&M.startY!=null&&M.endX!=null&&M.endY!=null&&(z=[{x:M.startX,y:M.startY},{x:M.endX,y:M.endY}]),!z||z.length<2)continue;for(var B=0;B<z.length-1;B++){for(var te=z[B],ne=z[B+1],re=0;re<m.length;re++){var ie=_E(m[re],2),ae=ie[0],oe=ie[1];if(_(te,ne,ae,oe)){o.push(A),L=!0;break}}if(L)break}}}}}return o},IP={},IP.calculateArrowAngles=function(e){var t=e._private.rscratch,n=t.edgeType===`haystack`,r=t.edgeType===`bezier`,i=t.edgeType===`multibezier`,a=t.edgeType===`segments`,o=t.edgeType===`compound`,s=t.edgeType===`self`,l,u,d,f,p,m,h,g;if(n?(d=t.haystackPts[0],f=t.haystackPts[1],p=t.haystackPts[2],m=t.haystackPts[3]):(d=t.arrowStartX,f=t.arrowStartY,p=t.arrowEndX,m=t.arrowEndY),h=t.midX,g=t.midY,a)l=d-t.segpts[0],u=f-t.segpts[1];else if(i||o||s||r){var _=t.allpts,v=EA(_[0],_[2],_[4],.1),y=EA(_[1],_[3],_[5],.1);l=d-v,u=f-y}else l=d-h,u=f-g;t.srcArrowAngle=xA(l,u);var h=t.midX,g=t.midY;if(n&&(h=(d+p)/2,g=(f+m)/2),l=p-d,u=m-f,a){var _=t.allpts;if(_.length/2%2==0){var b=_.length/2,x=b-2;l=_[b]-_[x],u=_[b+1]-_[x+1]}else if(t.isRound)l=t.midVector[1],u=-t.midVector[0];else{var b=_.length/2-1,x=b-2;l=_[b]-_[x],u=_[b+1]-_[x+1]}}else if(i||o||s){var _=t.allpts,S=t.ctrlpts,C,w,T,E;if(S.length/2%2==0){var D=_.length/2-1,O=D+2,k=O+2;C=EA(_[D],_[O],_[k],0),w=EA(_[D+1],_[O+1],_[k+1],0),T=EA(_[D],_[O],_[k],1e-4),E=EA(_[D+1],_[O+1],_[k+1],1e-4)}else{var O=_.length/2-1,D=O-2,k=O+2;C=EA(_[D],_[O],_[k],.4999),w=EA(_[D+1],_[O+1],_[k+1],.4999),T=EA(_[D],_[O],_[k],.5),E=EA(_[D+1],_[O+1],_[k+1],.5)}l=T-C,u=E-w}if(t.midtgtArrowAngle=xA(l,u),t.midDispX=l,t.midDispY=u,l*=-1,u*=-1,a){var _=t.allpts;if(_.length/2%2!=0&&!t.isRound){var b=_.length/2-1,A=b+2;l=-(_[A]-_[b]),u=-(_[A+1]-_[b+1])}}if(t.midsrcArrowAngle=xA(l,u),a)l=p-t.segpts[t.segpts.length-2],u=m-t.segpts[t.segpts.length-1];else if(i||o||s||r){var _=t.allpts,j=_.length,v=EA(_[j-6],_[j-4],_[j-2],.9),y=EA(_[j-5],_[j-3],_[j-1],.9);l=p-v,u=m-y}else l=p-h,u=m-g;t.tgtArrowAngle=xA(l,u)},IP.getArrowWidth=IP.getArrowHeight=function(e,t){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[e+`, `+t];return r||(r=Math.max((e*13.37)**.9,29)*t,n[e+`, `+t]=r,r)},zP={},BP={},ZP=function(e,t,n){n.x=t.x-e.x,n.y=t.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)},DBe=function(e,t){t.x=e.x*-1,t.y=e.y*-1,t.nx=e.nx*-1,t.ny=e.ny*-1,t.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},OBe=function(e,t,n,r,i){if(e===EBe?DBe(BP,zP):ZP(t,e,zP),ZP(t,n,BP),SBe=zP.nx*BP.ny-zP.ny*BP.nx,CBe=zP.nx*BP.nx-zP.ny*-BP.ny,UP=Math.asin(Math.max(-1,Math.min(1,SBe))),Math.abs(UP)<1e-6){LP=t.x,RP=t.y,GP=qP=0;return}VP=1,HP=!1,CBe<0?UP<0?UP=Math.PI+UP:(UP=Math.PI-UP,VP=-1,HP=!0):UP>0&&(VP=-1,HP=!0),qP=t.radius===void 0?r:t.radius,WP=UP/2,JP=Math.min(zP.len/2,BP.len/2),i?(KP=Math.abs(Math.cos(WP)*qP/Math.sin(WP)),KP>JP?(KP=JP,GP=Math.abs(KP*Math.sin(WP)/Math.cos(WP))):GP=qP):(KP=Math.min(JP,qP),GP=Math.abs(KP*Math.sin(WP)/Math.cos(WP))),YP=t.x+BP.nx*KP,XP=t.y+BP.ny*KP,LP=YP-BP.ny*GP*VP,RP=XP+BP.nx*GP*VP,wBe=t.x+zP.nx*KP,TBe=t.y+zP.ny*KP,EBe=t},QP=.01,kBe=Math.sqrt(2*QP),$P={},$P.findMidptPtsEtc=function(e,t){var n=t.posPts,r=t.intersectionPts,i=t.vectorNormInverse,a,o=e.pstyle(`source-endpoint`),s=e.pstyle(`target-endpoint`),l=o.units!=null&&s.units!=null,u=function(e,t,n,r){var i=r-t,a=n-e,o=Math.sqrt(a*a+i*i);return{x:-i/o,y:a/o}};switch(e.pstyle(`edge-distances`).value){case`node-position`:a=n;break;case`intersection`:a=r;break;case`endpoints`:if(l){var d=_E(this.manualEndptToPx(e.source()[0],o),2),f=d[0],p=d[1],m=_E(this.manualEndptToPx(e.target()[0],s),2),h=m[0],g=m[1],_={x1:f,y1:p,x2:h,y2:g};i=u(f,p,h,g),a=_}else Kk(`Edge ${e.id()} has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).`),a=r}return{midptPts:a,vectorNormInverse:i}},$P.findHaystackPoints=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n._private,i=r.rscratch;if(!i.haystack){var a=Math.random()*2*Math.PI;i.source={x:Math.cos(a),y:Math.sin(a)},a=Math.random()*2*Math.PI,i.target={x:Math.cos(a),y:Math.sin(a)}}var o=r.source,s=r.target,l=o.position(),u=s.position(),d=o.width(),f=s.width(),p=o.height(),m=s.height(),h=n.pstyle(`haystack-radius`).value/2;i.haystackPts=i.allpts=[i.source.x*d*h+l.x,i.source.y*p*h+l.y,i.target.x*f*h+u.x,i.target.y*m*h+u.y],i.midX=(i.allpts[0]+i.allpts[2])/2,i.midY=(i.allpts[1]+i.allpts[3])/2,i.edgeType=`haystack`,i.haystack=!0,this.storeEdgeProjections(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}},$P.findSegmentsPoints=function(e,t){var n=e._private.rscratch,r=e.pstyle(`segment-weights`),i=e.pstyle(`segment-distances`),a=e.pstyle(`segment-radii`),o=e.pstyle(`radius-type`),s=Math.min(r.pfValue.length,i.pfValue.length),l=a.pfValue[a.pfValue.length-1],u=o.pfValue[o.pfValue.length-1];n.edgeType=`segments`,n.segpts=[],n.radii=[],n.isArcRadius=[];for(var d=0;d<s;d++){var f=r.pfValue[d],p=i.pfValue[d],m=1-f,h=f,g=this.findMidptPtsEtc(e,t),_=g.midptPts,v=g.vectorNormInverse,y={x:_.x1*m+_.x2*h,y:_.y1*m+_.y2*h};n.segpts.push(y.x+v.x*p,y.y+v.y*p),n.radii.push(a.pfValue[d]===void 0?l:a.pfValue[d]),n.isArcRadius.push((o.pfValue[d]===void 0?u:o.pfValue[d])===`arc-radius`)}},$P.findLoopPoints=function(e,t,n,r){var i=e._private.rscratch,a=t.dirCounts,o=t.srcPos,s=e.pstyle(`control-point-distances`),l=s?s.pfValue[0]:void 0,u=e.pstyle(`loop-direction`).pfValue,d=e.pstyle(`loop-sweep`).pfValue,f=e.pstyle(`control-point-step-size`).pfValue;i.edgeType=`self`;var p=n,m=f;r&&(p=0,m=l);var h=u-Math.PI/2,g=h-d/2,_=h+d/2,v=String(u+`_`+d);p=a[v]===void 0?a[v]=0:++a[v],i.ctrlpts=[o.x+Math.cos(g)*1.4*m*(p/3+1),o.y+Math.sin(g)*1.4*m*(p/3+1),o.x+Math.cos(_)*1.4*m*(p/3+1),o.y+Math.sin(_)*1.4*m*(p/3+1)]},$P.findCompoundLoopPoints=function(e,t,n,r){var i=e._private.rscratch;i.edgeType=`compound`;var a=t.srcPos,o=t.tgtPos,s=t.srcW,l=t.srcH,u=t.tgtW,d=t.tgtH,f=e.pstyle(`control-point-step-size`).pfValue,p=e.pstyle(`control-point-distances`),m=p?p.pfValue[0]:void 0,h=n,g=f;r&&(h=0,g=m);var _=50,v={x:a.x-s/2,y:a.y-l/2},y={x:o.x-u/2,y:o.y-d/2},b={x:Math.min(v.x,y.x),y:Math.min(v.y,y.y)},x=.5,S=Math.max(x,Math.log(s*QP)),C=Math.max(x,Math.log(u*QP));i.ctrlpts=[b.x,b.y-(1+_**1.12/100)*g*(h/3+1)*S,b.x-(1+_**1.12/100)*g*(h/3+1)*C,b.y]},$P.findStraightEdgePoints=function(e){e._private.rscratch.edgeType=`straight`},$P.findBezierPoints=function(e,t,n,r,i){var a=e._private.rscratch,o=e.pstyle(`control-point-step-size`).pfValue,s=e.pstyle(`control-point-distances`),l=e.pstyle(`control-point-weights`),u=s&&l?Math.min(s.value.length,l.value.length):1,d=s?s.pfValue[0]:void 0,f=l.value[0],p=r;a.edgeType=p?`multibezier`:`bezier`,a.ctrlpts=[];for(var m=0;m<u;m++){var h=(.5-t.eles.length/2+n)*o*(i?-1:1),g=void 0,_=CA(h);p&&(d=s?s.pfValue[m]:o,f=l.value[m]),g=r?d:d===void 0?void 0:_*d;var v=g===void 0?h:g,y=1-f,b=f,x=this.findMidptPtsEtc(e,t),S=x.midptPts,C=x.vectorNormInverse,w={x:S.x1*y+S.x2*b,y:S.y1*y+S.y2*b};a.ctrlpts.push(w.x+C.x*v,w.y+C.y*v)}},$P.findTaxiPoints=function(e,t){var n=e._private.rscratch;n.edgeType=`segments`;var r=`vertical`,i=`horizontal`,a=`leftward`,o=`rightward`,s=`downward`,l=`upward`,u=`auto`,d=t.posPts,f=t.srcW,p=t.srcH,m=t.tgtW,h=t.tgtH,g=e.pstyle(`edge-distances`).value!==`node-position`,_=e.pstyle(`taxi-direction`).value,v=_,y=e.pstyle(`taxi-turn`),b=y.units===`%`,x=y.pfValue,S=x<0,C=e.pstyle(`taxi-turn-min-distance`).pfValue,w=g?(f+m)/2:0,T=g?(p+h)/2:0,E=d.x2-d.x1,D=d.y2-d.y1,O=function(e,t){return e>0?Math.max(e-t,0):Math.min(e+t,0)},k=O(E,w),A=O(D,T),j=!1;v===u?_=Math.abs(k)>Math.abs(A)?i:r:v===l||v===s?(_=r,j=!0):(v===a||v===o)&&(_=i,j=!0);var M=_===r,N=M?A:k,P=M?D:E,F=CA(P),I=!1;!(j&&(b||S))&&(v===s&&P<0||v===l&&P>0||v===a&&P>0||v===o&&P<0)&&(F*=-1,N=F*Math.abs(N),I=!0);var L=b?(x<0?1+x:x)*N:(x<0?N:0)+x*F,R=function(e){return Math.abs(e)<C||Math.abs(e)>=Math.abs(N)},ee=R(L),z=R(Math.abs(N)-Math.abs(L));if((ee||z)&&!I){if(M){var B=Math.abs(P)<=p/2,te=Math.abs(E)<=m/2;if(B){var ne=(d.x1+d.x2)/2;n.segpts=[ne,d.y1,ne,d.y2]}else if(te){var re=(d.y1+d.y2)/2;n.segpts=[d.x1,re,d.x2,re]}else n.segpts=[d.x1,d.y2]}else{var ie=Math.abs(P)<=f/2,ae=Math.abs(D)<=h/2;if(ie){var oe=(d.y1+d.y2)/2;n.segpts=[d.x1,oe,d.x2,oe]}else if(ae){var se=(d.x1+d.x2)/2;n.segpts=[se,d.y1,se,d.y2]}else n.segpts=[d.x2,d.y1]}}else if(M){var ce=d.y1+L+(g?p/2*F:0);n.segpts=[d.x1,ce,d.x2,ce]}else{var le=d.x1+L+(g?f/2*F:0);n.segpts=[le,d.y1,le,d.y2]}if(n.isRound){var ue=e.pstyle(`taxi-radius`).value,de=e.pstyle(`radius-type`).value[0]===`arc-radius`;n.radii=Array(n.segpts.length/2).fill(ue),n.isArcRadius=Array(n.segpts.length/2).fill(de)}},$P.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if(n.edgeType===`bezier`){var r=t.srcPos,i=t.tgtPos,a=t.srcW,o=t.srcH,s=t.tgtW,l=t.tgtH,u=t.srcShape,d=t.tgtShape,f=t.srcCornerRadius,p=t.tgtCornerRadius,m=t.srcRs,h=t.tgtRs,g=!rO(n.startX)||!rO(n.startY),_=!rO(n.arrowStartX)||!rO(n.arrowStartY),v=!rO(n.endX)||!rO(n.endY),y=!rO(n.arrowEndX)||!rO(n.arrowEndY),b=3*(this.getArrowWidth(e.pstyle(`width`).pfValue,e.pstyle(`arrow-scale`).value)*this.arrowShapeWidth),x=wA({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),S=x<b,C=wA({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),w=C<b,T=!1;if(g||_||S){T=!0;var E={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},D=Math.sqrt(E.x*E.x+E.y*E.y),O={x:E.x/D,y:E.y/D},k=Math.max(a,o),A={x:n.ctrlpts[0]+O.x*2*k,y:n.ctrlpts[1]+O.y*2*k},j=u.intersectLine(r.x,r.y,a,o,A.x,A.y,0,f,m);S?(n.ctrlpts[0]=n.ctrlpts[0]+O.x*(b-x),n.ctrlpts[1]=n.ctrlpts[1]+O.y*(b-x)):(n.ctrlpts[0]=j[0]+O.x*b,n.ctrlpts[1]=j[1]+O.y*b)}if(v||y||w){T=!0;var M={x:n.ctrlpts[0]-i.x,y:n.ctrlpts[1]-i.y},N=Math.sqrt(M.x*M.x+M.y*M.y),P={x:M.x/N,y:M.y/N},F=Math.max(a,o),I={x:n.ctrlpts[0]+P.x*2*F,y:n.ctrlpts[1]+P.y*2*F},L=d.intersectLine(i.x,i.y,s,l,I.x,I.y,0,p,h);w?(n.ctrlpts[0]=n.ctrlpts[0]+P.x*(b-C),n.ctrlpts[1]=n.ctrlpts[1]+P.y*(b-C)):(n.ctrlpts[0]=L[0]+P.x*b,n.ctrlpts[1]=L[1]+P.y*b)}T&&this.findEndpoints(e)}},$P.storeAllpts=function(e){var t=e._private.rscratch;if(t.edgeType===`multibezier`||t.edgeType===`bezier`||t.edgeType===`self`||t.edgeType===`compound`){t.allpts=[],t.allpts.push(t.startX,t.startY);for(var n=0;n+1<t.ctrlpts.length;n+=2)t.allpts.push(t.ctrlpts[n],t.ctrlpts[n+1]),n+3<t.ctrlpts.length&&t.allpts.push((t.ctrlpts[n]+t.ctrlpts[n+2])/2,(t.ctrlpts[n+1]+t.ctrlpts[n+3])/2);t.allpts.push(t.endX,t.endY);var r,i;t.ctrlpts.length/2%2==0?(r=t.allpts.length/2-1,t.midX=t.allpts[r],t.midY=t.allpts[r+1]):(r=t.allpts.length/2-3,i=.5,t.midX=EA(t.allpts[r],t.allpts[r+2],t.allpts[r+4],i),t.midY=EA(t.allpts[r+1],t.allpts[r+3],t.allpts[r+5],i))}else if(t.edgeType===`straight`)t.allpts=[t.startX,t.startY,t.endX,t.endY],t.midX=(t.startX+t.endX+t.arrowStartX+t.arrowEndX)/4,t.midY=(t.startY+t.endY+t.arrowStartY+t.arrowEndY)/4;else if(t.edgeType===`segments`){if(t.allpts=[],t.allpts.push(t.startX,t.startY),t.allpts.push.apply(t.allpts,t.segpts),t.allpts.push(t.endX,t.endY),t.isRound){t.roundCorners=[];for(var a=2;a+3<t.allpts.length;a+=2){var o=t.radii[a/2-1],s=t.isArcRadius[a/2-1];t.roundCorners.push(bD({x:t.allpts[a-2],y:t.allpts[a-1]},{x:t.allpts[a],y:t.allpts[a+1],radius:o},{x:t.allpts[a+2],y:t.allpts[a+3]},o,s))}}if(t.segpts.length%4==0){var l=t.segpts.length/2,u=l-2;t.midX=(t.segpts[u]+t.segpts[l])/2,t.midY=(t.segpts[u+1]+t.segpts[l+1])/2}else{var d=t.segpts.length/2-1;if(!t.isRound)t.midX=t.segpts[d],t.midY=t.segpts[d+1];else{var f={x:t.segpts[d],y:t.segpts[d+1]},p=t.roundCorners[d/2];if(p.radius===0){var m={x:t.segpts[d+2],y:t.segpts[d+3]};t.midX=f.x,t.midY=f.y,t.midVector=[f.y-m.y,m.x-f.x]}else{var h=[f.x-p.cx,f.y-p.cy],g=p.radius/Math.sqrt(h[0]**2+h[1]**2);h=h.map(function(e){return e*g}),t.midX=p.cx+h[0],t.midY=p.cy+h[1],t.midVector=h}}}}},$P.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;t.nodesOverlap||rO(t.startX)&&rO(t.startY)&&rO(t.endX)&&rO(t.endY)?t.loggedErr=!1:t.loggedErr||(t.loggedErr=!0,Kk("Edge `"+e.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))},$P.findEdgeControlPoints=function(e){var t=this;if(!(!e||e.length===0)){for(var n=this,r=n.cy.hasCompoundNodes(),i=new aA,a=function(e,t){return[].concat(vE(e),[+!!t]).join(`-`)},o=[],s=[],l=0;l<e.length;l++){var u=e[l],d=u._private,f=u.pstyle(`curve-style`).value;if(!(u.removed()||!u.takesUpSpace())){if(f===`haystack`){s.push(u);continue}var p=f===`unbundled-bezier`||SO(f,`segments`)||f===`straight`||f===`straight-triangle`||SO(f,`taxi`),m=f===`unbundled-bezier`||f===`bezier`,h=d.source,g=d.target,_=[h.poolIndex(),g.poolIndex()].sort(),v=a(_,p),y=i.get(v);y??(y={eles:[]},o.push({pairId:_,edgeIsUnbundled:p}),i.set(v,y)),y.eles.push(u),p&&(y.hasUnbundled=!0),m&&(y.hasBezier=!0)}}for(var b=function(){var e=o[x],s=e.pairId,l=e.edgeIsUnbundled,u=a(s,l),d=i.get(u),f;if(!d.hasUnbundled){var p=d.eles[0].parallelEdges().filter(function(e){return e.isBundledBezier()});tA(d.eles),p.forEach(function(e){return d.eles.push(e)}),d.eles.sort(function(e,t){return e.poolIndex()-t.poolIndex()})}var m=d.eles[0],h=m.source(),g=m.target();if(h.poolIndex()>g.poolIndex()){var _=h;h=g,g=_}var v=d.srcPos=h.position(),y=d.tgtPos=g.position(),b=d.srcW=h.outerWidth(),S=d.srcH=h.outerHeight(),C=d.tgtW=g.outerWidth(),w=d.tgtH=g.outerHeight(),T=d.srcShape=n.nodeShapes[t.getNodeShape(h)],E=d.tgtShape=n.nodeShapes[t.getNodeShape(g)],D=d.srcCornerRadius=h.pstyle(`corner-radius`).value===`auto`?`auto`:h.pstyle(`corner-radius`).pfValue,O=d.tgtCornerRadius=g.pstyle(`corner-radius`).value===`auto`?`auto`:g.pstyle(`corner-radius`).pfValue,k=d.tgtRs=g._private.rscratch,A=d.srcRs=h._private.rscratch;d.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var j=0;j<d.eles.length;j++){var M=d.eles[j],N=M[0]._private.rscratch,P=M.pstyle(`curve-style`).value,F=P===`unbundled-bezier`||SO(P,`segments`)||SO(P,`taxi`),I=!h.same(M.source());if(!d.calculatedIntersection&&h!==g&&(d.hasBezier||d.hasUnbundled)){d.calculatedIntersection=!0;var L=T.intersectLine(v.x,v.y,b,S,y.x,y.y,0,D,A),R=d.srcIntn=L,ee=E.intersectLine(y.x,y.y,C,w,v.x,v.y,0,O,k),z=d.tgtIntn=ee,B=d.intersectionPts={x1:L[0],x2:ee[0],y1:L[1],y2:ee[1]},te=d.posPts={x1:v.x,x2:y.x,y1:v.y,y2:y.y},ne=ee[1]-L[1],re=ee[0]-L[0],ie=Math.sqrt(re*re+ne*ne);rO(ie)&&ie>=kBe||(ie=Math.sqrt(Math.max(re*re,QP)+Math.max(ne*ne,QP)));var ae=d.vector={x:re,y:ne},oe=d.vectorNorm={x:ae.x/ie,y:ae.y/ie},se={x:-oe.y,y:oe.x};d.nodesOverlap=!rO(ie)||E.checkPoint(L[0],L[1],0,C,w,y.x,y.y,O,k)||T.checkPoint(ee[0],ee[1],0,b,S,v.x,v.y,D,A),d.vectorNormInverse=se,f={nodesOverlap:d.nodesOverlap,dirCounts:d.dirCounts,calculatedIntersection:!0,hasBezier:d.hasBezier,hasUnbundled:d.hasUnbundled,eles:d.eles,srcPos:y,srcRs:k,tgtPos:v,tgtRs:A,srcW:C,srcH:w,tgtW:b,tgtH:S,srcIntn:z,tgtIntn:R,srcShape:E,tgtShape:T,posPts:{x1:te.x2,y1:te.y2,x2:te.x1,y2:te.y1},intersectionPts:{x1:B.x2,y1:B.y2,x2:B.x1,y2:B.y1},vector:{x:-ae.x,y:-ae.y},vectorNorm:{x:-oe.x,y:-oe.y},vectorNormInverse:{x:-se.x,y:-se.y}}}var ce=I?f:d;N.nodesOverlap=ce.nodesOverlap,N.srcIntn=ce.srcIntn,N.tgtIntn=ce.tgtIntn,N.isRound=P.startsWith(`round`),r&&(h.isParent()||h.isChild()||g.isParent()||g.isChild())&&(h.parents().anySame(g)||g.parents().anySame(h)||h.same(g)&&h.isParent())?t.findCompoundLoopPoints(M,ce,j,F):h===g?t.findLoopPoints(M,ce,j,F):P.endsWith(`segments`)?t.findSegmentsPoints(M,ce):P.endsWith(`taxi`)?t.findTaxiPoints(M,ce):P===`straight`||!F&&d.eles.length%2==1&&j===Math.floor(d.eles.length/2)?t.findStraightEdgePoints(M):t.findBezierPoints(M,ce,j,F,I),t.findEndpoints(M),t.tryToCorrectInvalidPoints(M,ce),t.checkForInvalidEdgeWarning(M),t.storeAllpts(M),t.storeEdgeProjections(M),t.calculateArrowAngles(M),t.recalculateEdgeLabelProjections(M),t.calculateLabelAngles(M)}},x=0;x<o.length;x++)b();this.findHaystackPoints(s)}},$P.getSegmentPoints=function(e){var t=e[0]._private.rscratch;if(this.recalculateRenderedStyle(e),t.edgeType===`segments`)return xD(t.segpts)},$P.getControlPoints=function(e){var t=e[0]._private.rscratch;this.recalculateRenderedStyle(e);var n=t.edgeType;if(n===`bezier`||n===`multibezier`||n===`self`||n===`compound`)return xD(t.ctrlpts)},$P.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}},eF={},eF.manualEndptToPx=function(e,t){var n=this,r=e.position(),i=e.outerWidth(),a=e.outerHeight(),o=e._private.rscratch;if(t.value.length===2){var s=[t.pfValue[0],t.pfValue[1]];return t.units[0]===`%`&&(s[0]*=i),t.units[1]===`%`&&(s[1]*=a),s[0]+=r.x,s[1]+=r.y,s}var l=t.pfValue[0];l=-Math.PI/2+l;var u=2*Math.max(i,a),d=[r.x+Math.cos(l)*u,r.y+Math.sin(l)*u];return n.nodeShapes[this.getNodeShape(e)].intersectLine(r.x,r.y,i,a,d[0],d[1],0,e.pstyle(`corner-radius`).value===`auto`?`auto`:e.pstyle(`corner-radius`).pfValue,o)},eF.findEndpoints=function(e){var t,n,r=this,i,a=e.source()[0],o=e.target()[0],s=a.position(),l=o.position(),u=e.pstyle(`target-arrow-shape`).value,d=e.pstyle(`source-arrow-shape`).value,f=e.pstyle(`target-distance-from-node`).pfValue,p=e.pstyle(`source-distance-from-node`).pfValue,m=a._private.rscratch,h=o._private.rscratch,g=e.pstyle(`curve-style`).value,_=e._private.rscratch,v=_.edgeType,y=SO(g,`taxi`),b=v===`self`||v===`compound`,x=v===`bezier`||v===`multibezier`||b,S=v!==`bezier`,C=v===`straight`||v===`segments`,w=v===`segments`,T=x||S||C,E=b||y,D=e.pstyle(`source-endpoint`),O=E?`outside-to-node`:D.value,k=a.pstyle(`corner-radius`).value===`auto`?`auto`:a.pstyle(`corner-radius`).pfValue,A=e.pstyle(`target-endpoint`),j=E?`outside-to-node`:A.value,M=o.pstyle(`corner-radius`).value===`auto`?`auto`:o.pstyle(`corner-radius`).pfValue;_.srcManEndpt=D,_.tgtManEndpt=A;var N,P,F,I,L=((A==null||(t=A.pfValue)==null?void 0:t.length)===2?A.pfValue:null)??[0,0],R=((D==null||(n=D.pfValue)==null?void 0:n.length)===2?D.pfValue:null)??[0,0];if(x){var ee=[_.ctrlpts[0],_.ctrlpts[1]];N=S?[_.ctrlpts[_.ctrlpts.length-2],_.ctrlpts[_.ctrlpts.length-1]]:ee,P=ee}else if(C){var z=w?_.segpts.slice(0,2):[l.x+L[0],l.y+L[1]];N=w?_.segpts.slice(_.segpts.length-2):[s.x+R[0],s.y+R[1]],P=z}if(j===`inside-to-node`)i=[l.x,l.y];else if(A.units)i=this.manualEndptToPx(o,A);else if(j===`outside-to-line`)i=_.tgtIntn;else if(j===`outside-to-node`||j===`outside-to-node-or-label`?F=N:(j===`outside-to-line`||j===`outside-to-line-or-label`)&&(F=[s.x,s.y]),i=r.nodeShapes[this.getNodeShape(o)].intersectLine(l.x,l.y,o.outerWidth(),o.outerHeight(),F[0],F[1],0,M,h),j===`outside-to-node-or-label`||j===`outside-to-line-or-label`){var B=o._private.rscratch,te=B.labelWidth,ne=B.labelHeight,re=B.labelX,ie=B.labelY,ae=te/2,oe=ne/2,se=o.pstyle(`text-valign`).value;se=dN(se),se===`top`?ie-=oe:se===`bottom`&&(ie+=oe);var ce=o.pstyle(`text-halign`).value;ce=uN(ce),ce===`left`?re-=ae:ce===`right`&&(re+=ae);var le=qA(F[0],F[1],[re-ae,ie-oe,re+ae,ie-oe,re+ae,ie+oe,re-ae,ie+oe],l.x,l.y);if(le.length>0){var ue=s,de=TA(ue,yA(i)),fe=TA(ue,yA(le)),pe=de;fe<de&&(i=le,pe=fe),le.length>2&&TA(ue,{x:le[2],y:le[3]})<pe&&(i=[le[2],le[3]])}}var me=JA(i,N,r.arrowShapes[u].spacing(e)+f),he=JA(i,N,r.arrowShapes[u].gap(e)+f);if(_.endX=he[0],_.endY=he[1],_.arrowEndX=me[0],_.arrowEndY=me[1],O===`inside-to-node`)i=[s.x,s.y];else if(D.units)i=this.manualEndptToPx(a,D);else if(O===`outside-to-line`)i=_.srcIntn;else if(O===`outside-to-node`||O===`outside-to-node-or-label`?I=P:(O===`outside-to-line`||O===`outside-to-line-or-label`)&&(I=[l.x,l.y]),i=r.nodeShapes[this.getNodeShape(a)].intersectLine(s.x,s.y,a.outerWidth(),a.outerHeight(),I[0],I[1],0,k,m),O===`outside-to-node-or-label`||O===`outside-to-line-or-label`){var ge=a._private.rscratch,_e=ge.labelWidth,ve=ge.labelHeight,ye=ge.labelX,be=ge.labelY,xe=_e/2,Se=ve/2,V=a.pstyle(`text-valign`).value;V=dN(V),V===`top`?be-=Se:V===`bottom`&&(be+=Se);var Ce=a.pstyle(`text-halign`).value;Ce=uN(Ce),Ce===`left`?ye-=xe:Ce===`right`&&(ye+=xe);var we=qA(I[0],I[1],[ye-xe,be-Se,ye+xe,be-Se,ye+xe,be+Se,ye-xe,be+Se],s.x,s.y);if(we.length>0){var Te=l,Ee=TA(Te,yA(i)),De=TA(Te,yA(we)),H=Ee;De<Ee&&(i=[we[0],we[1]],H=De),we.length>2&&TA(Te,{x:we[2],y:we[3]})<H&&(i=[we[2],we[3]])}}var Oe=JA(i,P,r.arrowShapes[d].spacing(e)+p),ke=JA(i,P,r.arrowShapes[d].gap(e)+p);_.startX=ke[0],_.startY=ke[1],_.arrowStartX=Oe[0],_.arrowStartY=Oe[1],T&&(_.badLine=!rO(_.startX)||!rO(_.startY)||!rO(_.endX)||!rO(_.endY))},eF.getSourceEndpoint=function(e){var t=e[0]._private.rscratch;switch(this.recalculateRenderedStyle(e),t.edgeType){case`haystack`:return{x:t.haystackPts[0],y:t.haystackPts[1]};default:return{x:t.arrowStartX,y:t.arrowStartY}}},eF.getTargetEndpoint=function(e){var t=e[0]._private.rscratch;switch(this.recalculateRenderedStyle(e),t.edgeType){case`haystack`:return{x:t.haystackPts[2],y:t.haystackPts[3]};default:return{x:t.arrowEndX,y:t.arrowEndY}}},tF={},tF.storeEdgeProjections=function(e){var t=e._private,n=t.rscratch,r=n.edgeType;if(t.rstyle.bezierPts=null,t.rstyle.linePts=null,t.rstyle.haystackPts=null,r===`multibezier`||r===`bezier`||r===`self`||r===`compound`){t.rstyle.bezierPts=[];for(var i=0;i+5<n.allpts.length;i+=4)tIe(this,e,n.allpts.slice(i,i+6))}else if(r===`segments`)for(var a=t.rstyle.linePts=[],i=0;i+1<n.allpts.length;i+=2)a.push({x:n.allpts[i],y:n.allpts[i+1]});else if(r===`haystack`){var o=n.haystackPts;t.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}t.rstyle.arrowWidth=this.getArrowWidth(e.pstyle(`width`).pfValue,e.pstyle(`arrow-scale`).value)*this.arrowShapeWidth},tF.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)},nF={},nF.recalculateNodeLabelProjection=function(e){var t=e.pstyle(`label`).strValue;if(!fO(t)){var n,r,i=e._private,a=e.width(),o=e.height(),s=e.padding(),l=e.position(),u=e.pstyle(`text-halign`).strValue,d=e.pstyle(`text-valign`).strValue,f=i.rscratch,p=i.rstyle;switch(u){case`left`:n=l.x-a/2-s;break;case`left-inside`:n=l.x-a/2+s;break;case`right`:n=l.x+a/2+s;break;case`right-inside`:n=l.x+a/2-s;break;default:n=l.x}switch(d){case`top`:r=l.y-o/2-s;break;case`top-inside`:r=l.y-o/2+s;break;case`bottom`:r=l.y+o/2+s;break;case`bottom-inside`:r=l.y+o/2-s;break;default:r=l.y}f.labelX=n,f.labelY=r,p.labelX=n,p.labelY=r,this.calculateLabelAngles(e),this.applyLabelDimensions(e)}},rF=function(e,t){var n=Math.atan(t/e);return e===0&&n<0&&(n*=-1),n},iF=function(e,t){return rF(t.x-e.x,t.y-e.y)},ABe=function(e,t,n,r){var i=OA(0,r-.001,1),a=OA(0,r+.001,1);return iF(DA(e,t,n,i),DA(e,t,n,a))},nF.recalculateEdgeLabelProjections=function(e){var t,n=e._private,r=n.rscratch,i=this,a={mid:e.pstyle(`label`).strValue,source:e.pstyle(`source-label`).strValue,target:e.pstyle(`target-label`).strValue};if(a.mid||a.source||a.target){t={x:r.midX,y:r.midY};var o=function(e,t,r){iA(n.rscratch,e,t,r),iA(n.rstyle,e,t,r)};o(`labelX`,null,t.x),o(`labelY`,null,t.y),o(`labelAutoAngle`,null,rF(r.midDispX,r.midDispY));var s=function(){if(s.cache)return s.cache;for(var e=[],t=0;t+5<r.allpts.length;t+=4){var a={x:r.allpts[t],y:r.allpts[t+1]},o={x:r.allpts[t+2],y:r.allpts[t+3]},l={x:r.allpts[t+4],y:r.allpts[t+5]};e.push({p0:a,p1:o,p2:l,startDist:0,length:0,segments:[]})}var u=n.rstyle.bezierPts,d=i.bezierProjPcts.length;function f(e,t,n,r,i){var a=wA(t,n),o=e.segments[e.segments.length-1],s={p0:t,p1:n,t0:r,t1:i,startDist:o?o.startDist+o.length:0,length:a};e.segments.push(s),e.length+=a}for(var p=0;p<e.length;p++){var m=e[p],h=e[p-1];h&&(m.startDist=h.startDist+h.length),f(m,m.p0,u[p*d],0,i.bezierProjPcts[0]);for(var g=0;g<d-1;g++)f(m,u[p*d+g],u[p*d+g+1],i.bezierProjPcts[g],i.bezierProjPcts[g+1]);f(m,u[p*d+d-1],m.p2,i.bezierProjPcts[d-1],1)}return s.cache=e},l=function(n){var i,l=n===`source`;if(a[n]){var u=e.pstyle(n+`-text-offset`).pfValue;switch(r.edgeType){case`self`:case`compound`:case`bezier`:case`multibezier`:for(var d=s(),f,p=0,m=0,h=0;h<d.length;h++){for(var g=d[l?h:d.length-1-h],_=0;_<g.segments.length;_++){var v=g.segments[l?_:g.segments.length-1-_],y=h===d.length-1&&_===g.segments.length-1;if(p=m,m+=v.length,m>=u||y){f={cp:g,segment:v};break}}if(f)break}var b=f.cp,x=f.segment,S=(u-p)/x.length,C=x.t1-x.t0,w=l?x.t0+C*S:x.t1-C*S;w=OA(0,w,1),t=DA(b.p0,b.p1,b.p2,w),i=ABe(b.p0,b.p1,b.p2,w);break;case`straight`:case`segments`:case`haystack`:for(var T=0,E,D,O,k,A=r.allpts.length,j=0;j+3<A&&(l?(O={x:r.allpts[j],y:r.allpts[j+1]},k={x:r.allpts[j+2],y:r.allpts[j+3]}):(O={x:r.allpts[A-2-j],y:r.allpts[A-1-j]},k={x:r.allpts[A-4-j],y:r.allpts[A-3-j]}),E=wA(O,k),D=T,T+=E,!(T>=u));j+=2);var M=(u-D)/E;M=OA(0,M,1),t=rLe(O,k,M),i=iF(O,k)}o(`labelX`,n,t.x),o(`labelY`,n,t.y),o(`labelAutoAngle`,n,i)}};l(`source`),l(`target`),this.applyLabelDimensions(e)}},nF.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,`source`),this.applyPrefixedLabelDimensions(e,`target`))},nF.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=Mk(r,e._private.labelDimsKey);if(rA(n.rscratch,`prefixedLabelDimsKey`,t)!==i){iA(n.rscratch,`prefixedLabelDimsKey`,t,i);var a=this.calculateLabelDimensions(e,r),o=e.pstyle(`line-height`).pfValue,s=e.pstyle(`font-size`).pfValue,l=e.pstyle(`text-wrap`).strValue,u=rA(n.rscratch,`labelWrapCachedLines`,t)||[],d=l===`wrap`?Math.max(u.length,1):1,f=s*o,p=a.width,m=a.height+(d-1)*(o-1)*s;iA(n.rstyle,`labelWidth`,t,p),iA(n.rscratch,`labelWidth`,t,p),iA(n.rstyle,`labelHeight`,t,m),iA(n.rscratch,`labelHeight`,t,m),iA(n.rscratch,`labelLineHeight`,t,f),iA(n.rscratch,`labelActualDescent`,t,a.labelActualDescent)}},nF.getLabelText=function(e,t){var n=e._private,r=t?t+`-`:``,i=e.pstyle(r+`label`).strValue,a=e.pstyle(`text-transform`).value,o=function(e,r){return r?(iA(n.rscratch,e,t,r),r):rA(n.rscratch,e,t)};if(!i)return``;a==`none`||(a==`uppercase`?i=i.toUpperCase():a==`lowercase`&&(i=i.toLowerCase()));var s=e.pstyle(`text-wrap`).value;if(s===`wrap`){var l=o(`labelKey`);if(l!=null&&o(`labelWrapKey`)===l)return o(`labelWrapCachedText`);for(var u=``,d=i.split(`565+`),f=e.pstyle(`text-max-width`).pfValue,p=e.pstyle(`text-overflow-wrap`).value===`anywhere`,m=[],h=/[\s\u200b]+|$/g,g=0;g<d.length;g++){var _=d[g],v=this.calculateLabelDimensions(e,_).width;if(p&&(_=_.split(``).join(u)),v>f){var y=_.matchAll(h),b=``,x=0,S=gE(y),C;try{for(S.s();!(C=S.n()).done;){var w=C.value,T=w[0],E=_.substring(x,w.index);x=w.index+T.length;var D=b.length===0?E:b+E+T;this.calculateLabelDimensions(e,D).width<=f?b+=E+T:(b&&m.push(b),b=E+T)}}catch(e){S.e(e)}finally{S.f()}b.match(/^[\s\u200b]+$/)||m.push(b)}else m.push(_)}o(`labelWrapCachedLines`,m),i=o(`labelWrapCachedText`,m.join(`566+`)),o(`labelWrapKey`,l)}else if(s===`ellipsis`){var O=e.pstyle(`text-max-width`).pfValue,k=``,A=`…`,j=!1;if(this.calculateLabelDimensions(e,i).width<O)return i;for(var M=0;M<i.length&&!(this.calculateLabelDimensions(e,k+i[M]+A).width>O);M++)k+=i[M],M===i.length-1&&(j=!0);return j||(k+=A),k}return i},nF.getLabelJustification=function(e){var t=e.pstyle(`text-justification`).strValue,n=e.pstyle(`text-halign`).strValue;return t===`auto`?e.isNode()?Eze(n):`center`:t},nF.calculateLabelDimensions=function(e,t){var n=this.cy.window().document,r=0,i=e.pstyle(`font-style`).strValue,a=e.pstyle(`font-size`).pfValue,o=e.pstyle(`font-family`).strValue,s=e.pstyle(`font-weight`).strValue,l=e.pstyle(`text-metrics`).strValue||`font`,u=this.labelCalcCanvas,d=this.labelCalcCanvasContext;if(!u){u=this.labelCalcCanvas=n.createElement(`canvas`),d=this.labelCalcCanvasContext=u.getContext(`2d`);var f=u.style;f.position=`absolute`,f.left=`-9999px`,f.top=`-9999px`,f.zIndex=`-1`,f.visibility=`hidden`,f.pointerEvents=`none`}d.font=`${i} ${s} ${a}px ${o}`;for(var p=0,m=0,h=t.split(`567+`),g=h.length,_=0,v=0,y=0;y<g;y++){var b=h[y],x=d.measureText(b),S=Math.ceil(x.width),C=a;l===`glyph`&&(y===0&&(v=x.actualBoundingBoxAscent),y===g-1&&(_=x.actualBoundingBoxDescent)),p=Math.max(S,p),m+=C}return l===`glyph`&&(m-=a-v-_),p+=r,m+=r,{width:p,height:m,labelActualAscent:v,labelActualDescent:_}},nF.calculateLabelAngle=function(e,t){var n=e._private.rscratch,r=e.isEdge(),i=t?t+`-`:``,a=e.pstyle(i+`text-rotation`),o=a.strValue;return o===`none`?0:r&&o===`autorotate`?n.labelAutoAngle:o===`autorotate`?0:a.pfValue},nF.calculateLabelAngles=function(e){var t=this,n=e.isEdge(),r=e._private.rscratch;r.labelAngle=t.calculateLabelAngle(e),n&&(r.sourceLabelAngle=t.calculateLabelAngle(e,`source`),r.targetLabelAngle=t.calculateLabelAngle(e,`target`))},aF={},oF=28,jBe=!1,aF.getNodeShape=function(e){var t=this,n=e.pstyle(`shape`).value;if(n===`cutrectangle`&&(e.width()<oF||e.height()<oF))return jBe||=(Kk("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),!0),`rectangle`;if(e.isParent())return n===`rectangle`||n===`roundrectangle`||n===`round-rectangle`||n===`cutrectangle`||n===`cut-rectangle`||n===`barrel`?n:`rectangle`;if(n===`polygon`){var r=e.pstyle(`shape-polygon-points`).value;return t.nodeShapes.makePolygon(r).name}return n},sF={},sF.registerCalculationListeners=function(){var e=this.cy,t=e.collection(),n=this,r=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(t.merge(e),n)for(var r=0;r<e.length;r++){var i=e[r]._private.rstyle;i.clean=!1,i.cleanConnected=!1}};n.binder(e).on(`bounds.* dirty.*`,function(e){var t=e.target;r(t)}).on(`style.* background.*`,function(e){var t=e.target;r(t,!1)});var i=function(i){if(i){var a=n.onUpdateEleCalcsFns;t.cleanStyle();for(var o=0;o<t.length;o++){var s=t[o],l=s._private.rstyle;s.isNode()&&!l.cleanConnected&&(r(s.connectedEdges()),l.cleanConnected=!0)}if(a)for(var u=0;u<a.length;u++){var d=a[u];d(i,t)}n.recalculateRenderedStyle(t),t=e.collection()}};n.flushRenderedStyleQueue=function(){i(!0)},n.beforeRender(i,n.beforeRenderPriorities.eleCalcs)},sF.onUpdateEleCalcs=function(e){(this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[]).push(e)},sF.recalculateRenderedStyle=function(e,t){var n=function(e){return e._private.rstyle.cleanConnected};if(e.length!==0){var r=[],i=[];if(!this.destroyed){t===void 0&&(t=!0);for(var a=0;a<e.length;a++){var o=e[a],s=o._private,l=s.rstyle;o.isEdge()&&(!n(o.source())||!n(o.target()))&&(l.clean=!1),o.isEdge()&&o.isBundledBezier()&&o.parallelEdges().some(function(e){return!e._private.rstyle.clean&&e.isBundledBezier()})&&(l.clean=!1),!(t&&l.clean||o.removed())&&o.pstyle(`display`).value!==`none`&&(s.group===`nodes`?i.push(o):r.push(o),l.clean=!0)}for(var u=0;u<i.length;u++){var d=i[u],f=d._private.rstyle,p=d.position();this.recalculateNodeLabelProjection(d),f.nodeX=p.x,f.nodeY=p.y,f.nodeW=d.pstyle(`width`).pfValue,f.nodeH=d.pstyle(`height`).pfValue}this.recalculateEdgeProjections(r);for(var m=0;m<r.length;m++){var h=r[m]._private,g=h.rstyle,_=h.rscratch;g.srcX=_.arrowStartX,g.srcY=_.arrowStartY,g.tgtX=_.arrowEndX,g.tgtY=_.arrowEndY,g.midX=_.midX,g.midY=_.midY,g.labelAngle=_.labelAngle,g.sourceLabelAngle=_.sourceLabelAngle,g.targetLabelAngle=_.targetLabelAngle}}}},cF={},cF.updateCachedGrabbedEles=function(){var e=this.cachedZSortedEles;if(e){e.drag=[],e.nondrag=[];for(var t=[],n=0;n<e.length;n++){var r=e[n],i=r._private.rscratch;r.grabbed()&&!r.isParent()?t.push(r):i.inDragLayer?e.drag.push(r):e.nondrag.push(r)}for(var n=0;n<t.length;n++){var r=t[n];e.drag.push(r)}}},cF.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},cF.getCachedZSortedEles=function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(UN),t.interactive=t.filter(function(e){return e.interactive()}),this.cachedZSortedEles=t,this.updateCachedGrabbedEles()}else t=this.cachedZSortedEles;return t},lF={},[FP,IP,$P,eF,tF,nF,aF,sF,cF].forEach(function(e){MO(lF,e)}),uF={},uF.getCachedImage=function(e,t,n){var r=this,i=r.imageCache=r.imageCache||{},a=i[e];if(a)return a.image.complete||a.image.addEventListener(`load`,n),a.image;a=i[e]=i[e]||{};var o=a.image=new Image;o.addEventListener(`load`,n),o.addEventListener(`error`,function(){o.error=!0});var s=`data:`;return e.substring(0,s.length).toLowerCase()!==s&&(t=t===`null`?null:t,o.crossOrigin=t),o.src=e,o},dF=function(e,t){var n=e[0];!n||n._private.grabbed===t||(n._private.grabbed=t,e.updateStyle(!1))},MBe=function(e){dF(e,!0)},NBe=function(e){dF(e,!1)},fF={},fF.registerBinding=function(e,t,n,r){var i=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(e)){for(var a=[],o=0;o<e.length;o++){var s=e[o];if(s!==void 0){var l=this.binder(s);a.push(l.on.apply(l,i))}}return a}var l=this.binder(e);return l.on.apply(l,i)},fF.binder=function(e){var t=this,n=t.cy.window(),r=e===n||e===n.document||e===n.document.body||pO(e);if(t.supportsPassiveEvents==null){var i=!1;try{var a=Object.defineProperty({},"passive",{get:function(){return i=!0,!0}});n.addEventListener(`test`,null,a)}catch{}t.supportsPassiveEvents=i}var o=function(n,i,a){var o=Array.prototype.slice.call(arguments);return r&&t.supportsPassiveEvents&&(o[2]={capture:a??!1,passive:!1,once:!1}),t.bindings.push({target:e,args:o}),(e.addEventListener||e.on).apply(e,o),this};return{on:o,addEventListener:o,addListener:o,bind:o}},fF.nodeIsDraggable=function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()},fF.nodeIsGrabbable=function(e){return this.nodeIsDraggable(e)&&e.interactive()},fF.load=function(){var e=this,t=e.cy.window(),n=function(e){return e.selected()},r=function(e){var t=e.getRootNode();if(t&&t.nodeType===11&&t.host!==void 0)return t},i=function(t,n,r,i){t??=e.cy;for(var a=0;a<n.length;a++){var o=n[a];t.emit({originalEvent:r,type:o,position:i})}},a=function(e){return e.shiftKey||e.metaKey||e.ctrlKey},o=function(t,n){var r=!0;if(e.cy.hasCompoundNodes()&&t&&t.pannable())for(var i=0;n&&i<n.length;i++){var t=n[i];if(t.isNode()&&t.isParent()&&!t.pannable()){r=!1;break}}else r=!0;return r},s=function(e){e[0]._private.rscratch.inDragLayer=!0},l=function(e){e[0]._private.rscratch.inDragLayer=!1},u=function(e){e[0]._private.rscratch.isGrabTarget=!0},d=function(e){e[0]._private.rscratch.isGrabTarget=!1},f=function(e,t){var n=t.addToList;!n.has(e)&&e.grabbable()&&!e.locked()&&(n.merge(e),MBe(e))},p=function(e,t){if(e.cy().hasCompoundNodes()&&(t.inDragLayer!=null||t.addToList!=null)){var n=e.descendants();t.inDragLayer&&(n.forEach(s),n.connectedEdges().forEach(s)),t.addToList&&f(n,t)}},m=function(t,n){n||={};var r=t.cy().hasCompoundNodes();n.inDragLayer&&(t.forEach(s),t.neighborhood().stdFilter(function(e){return!r||e.isEdge()}).forEach(s)),n.addToList&&t.forEach(function(e){f(e,n)}),p(t,n),_(t,{inDragLayer:n.inDragLayer}),e.updateCachedGrabbedEles()},h=m,g=function(t){t&&(e.getCachedZSortedEles().forEach(function(e){NBe(e),l(e),d(e)}),e.updateCachedGrabbedEles())},_=function(e,t){if((t.inDragLayer!=null||t.addToList!=null)&&e.cy().hasCompoundNodes()){var n=e.ancestors().orphans();if(!n.same(e)){var r=n.descendants().spawnSelf().merge(n).unmerge(e).unmerge(e.descendants()),i=r.connectedEdges();t.inDragLayer&&(i.forEach(s),r.forEach(s)),t.addToList&&r.forEach(function(e){f(e,t)})}}},v=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},y=typeof MutationObserver<`u`,b=typeof ResizeObserver<`u`;y?(e.removeObserver=new MutationObserver(function(t){for(var n=0;n<t.length;n++){var r=t[n].removedNodes;if(r){for(var i=0;i<r.length;i++)if(r[i]===e.container){e.destroy();break}}}}),e.container.parentNode&&e.removeObserver.observe(e.container.parentNode,{childList:!0})):e.registerBinding(e.container,`DOMNodeRemoved`,function(t){e.destroy()});var x=gk(function(){e.cy.resize()},100);y&&(e.styleObserver=new MutationObserver(x),e.styleObserver.observe(e.container,{attributes:!0})),e.registerBinding(t,`resize`,x),b&&(e.resizeObserver=new ResizeObserver(x),e.resizeObserver.observe(e.container));var S=function(e,t){for(;e!=null;)t(e),e=e.parentNode},C=function(){e.invalidateContainerClientCoordsCache()};S(e.container,function(t){e.registerBinding(t,`transitionend`,C),e.registerBinding(t,`animationend`,C),e.registerBinding(t,`scroll`,C)}),e.registerBinding(e.container,`contextmenu`,function(e){e.preventDefault()});var w=function(){return e.selection[4]!==0},T=function(t){for(var n=e.findContainerClientCoords(),r=n[0],i=n[1],a=n[2],o=n[3],s=t.touches?t.touches:[t],l=!1,u=0;u<s.length;u++){var d=s[u];if(r<=d.clientX&&d.clientX<=r+a&&i<=d.clientY&&d.clientY<=i+o){l=!0;break}}if(!l)return!1;for(var f=e.container,p=t.target.parentNode,m=!1;p;){if(p===f){m=!0;break}p=p.parentNode}return!!m};e.registerBinding(e.container,`mousedown`,function(t){if(T(t)&&(e.hoverData.which!==1||t.which===1)){t.preventDefault(),v(),e.hoverData.capture=!0,e.hoverData.which=t.which;var n=e.cy,r=[t.clientX,t.clientY],a=e.projectIntoViewport(r[0],r[1]),o=e.selection,s=e.findNearestElements(a[0],a[1],!0,!1),l=s[0],d=e.dragData.possibleDragElements;e.hoverData.mdownPos=a,e.hoverData.mdownGPos=r;var f=function(e){return{originalEvent:t,type:e,position:{x:a[0],y:a[1]}}},p=function(){e.hoverData.tapholdCancelled=!1,clearTimeout(e.hoverData.tapholdTimeout),e.hoverData.tapholdTimeout=setTimeout(function(){if(!e.hoverData.tapholdCancelled){var t=e.hoverData.down;t?t.emit(f(`taphold`)):n.emit(f(`taphold`))}},e.tapholdDuration)};if(t.which==3){e.hoverData.cxtStarted=!0;var g={originalEvent:t,type:`cxttapstart`,position:{x:a[0],y:a[1]}};l?(l.activate(),l.emit(g),e.hoverData.down=l):n.emit(g),e.hoverData.downTime=new Date().getTime(),e.hoverData.cxtDragged=!1}else if(t.which==1){if(l&&l.activate(),l!=null&&e.nodeIsGrabbable(l)){var _=function(e){e.emit(f(`grab`))};if(u(l),!l.selected())d=e.dragData.possibleDragElements=n.collection(),h(l,{addToList:d}),l.emit(f(`grabon`)).emit(f(`grab`));else{d=e.dragData.possibleDragElements=n.collection();var y=n.$(function(t){return t.isNode()&&t.selected()&&e.nodeIsGrabbable(t)});m(y,{addToList:d}),l.emit(f(`grabon`)),y.forEach(_)}e.redrawHint(`eles`,!0),e.redrawHint(`drag`,!0)}e.hoverData.down=l,e.hoverData.downs=s,e.hoverData.downTime=new Date().getTime(),i(l,[`mousedown`,`tapstart`,`vmousedown`],t,{x:a[0],y:a[1]}),l==null?(o[4]=1,e.data.bgActivePosistion={x:a[0],y:a[1]},e.redrawHint(`select`,!0),e.redraw()):l.pannable()&&(o[4]=1),p()}o[0]=o[2]=a[0],o[1]=o[3]=a[1]}},!1);var E=r(e.container);e.registerBinding([t,E],`mousemove`,function(t){if(!(!e.hoverData.capture&&!T(t))){var n=!1,r=e.cy,s=r.zoom(),l=[t.clientX,t.clientY],u=e.projectIntoViewport(l[0],l[1]),d=e.hoverData.mdownPos,f=e.hoverData.mdownGPos,p=e.selection,h=null;!e.hoverData.draggingEles&&!e.hoverData.dragging&&!e.hoverData.selecting&&(h=e.findNearestElement(u[0],u[1],!0,!1));var _=e.hoverData.last,v=e.hoverData.down,y=[u[0]-p[2],u[1]-p[3]],b=e.dragData.possibleDragElements,x;if(f){var S=l[0]-f[0],C=S*S,w=l[1]-f[1],E=C+w*w;e.hoverData.isOverThresholdDrag=x=E>=e.desktopTapThreshold2}var D=a(t);x&&(e.hoverData.tapholdCancelled=!0);var O=function(){var t=e.hoverData.dragDelta=e.hoverData.dragDelta||[];t.length===0?(t.push(y[0]),t.push(y[1])):(t[0]+=y[0],t[1]+=y[1])};n=!0,i(h,[`mousemove`,`vmousemove`,`tapdrag`],t,{x:u[0],y:u[1]});var k=function(e){return{originalEvent:t,type:e,position:{x:u[0],y:u[1]}}},A=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||r.emit(k(`boxstart`)),p[4]=1,e.hoverData.selecting=!0,e.redrawHint(`select`,!0),e.redraw()};if(e.hoverData.which===3){if(x){var j=k(`cxtdrag`);v?v.emit(j):r.emit(j),e.hoverData.cxtDragged=!0,(!e.hoverData.cxtOver||h!==e.hoverData.cxtOver)&&(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit(k(`cxtdragout`)),e.hoverData.cxtOver=h,h&&h.emit(k(`cxtdragover`)))}}else if(e.hoverData.dragging){if(n=!0,r.panningEnabled()&&r.userPanningEnabled()){var M;if(e.hoverData.justStartedPan){var N=e.hoverData.mdownPos;M={x:(u[0]-N[0])*s,y:(u[1]-N[1])*s},e.hoverData.justStartedPan=!1}else M={x:y[0]*s,y:y[1]*s};r.panBy(M),r.emit(k(`dragpan`)),e.hoverData.dragged=!0}u=e.projectIntoViewport(t.clientX,t.clientY)}else if(p[4]==1&&(v==null||v.pannable()))x&&(!e.hoverData.dragging&&r.boxSelectionEnabled()&&(D||!r.panningEnabled()||!r.userPanningEnabled())?A():!e.hoverData.selecting&&r.panningEnabled()&&r.userPanningEnabled()&&o(v,e.hoverData.downs)&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,p[4]=0,e.data.bgActivePosistion=yA(d),e.redrawHint(`select`,!0),e.redraw()),v&&v.pannable()&&v.active()&&v.unactivate());else{if(v&&v.pannable()&&v.active()&&v.unactivate(),(!v||!v.grabbed())&&h!=_&&(_&&i(_,[`mouseout`,`tapdragout`],t,{x:u[0],y:u[1]}),h&&i(h,[`mouseover`,`tapdragover`],t,{x:u[0],y:u[1]}),e.hoverData.last=h),v){if(x){if(r.boxSelectionEnabled()&&D)v&&v.grabbed()&&(g(b),v.emit(k(`freeon`)),b.emit(k(`free`)),e.dragData.didDrag&&(v.emit(k(`dragfreeon`)),b.emit(k(`dragfree`)))),A();else if(v&&v.grabbed()&&e.nodeIsDraggable(v)){var P=!e.dragData.didDrag;P&&e.redrawHint(`eles`,!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||m(b,{inDragLayer:!0});var F={x:0,y:0};if(rO(y[0])&&rO(y[1])&&(F.x+=y[0],F.y+=y[1],P)){var I=e.hoverData.dragDelta;I&&rO(I[0])&&rO(I[1])&&(F.x+=I[0],F.y+=I[1])}e.hoverData.draggingEles=!0,b.silentShift(F).emit(k(`position`)).emit(k(`drag`)),e.redrawHint(`drag`,!0),e.redraw()}}else O()}n=!0}if(p[2]=u[0],p[3]=u[1],n)return t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),!1}},!1);var D,O,k;e.registerBinding(t,`mouseup`,function(t){if(!(e.hoverData.which===1&&t.which!==1&&e.hoverData.capture)&&e.hoverData.capture){e.hoverData.capture=!1;var r=e.cy,o=e.projectIntoViewport(t.clientX,t.clientY),s=e.selection,l=e.findNearestElement(o[0],o[1],!0,!1),u=e.dragData.possibleDragElements,d=e.hoverData.down,f=a(t);e.data.bgActivePosistion&&(e.redrawHint(`select`,!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,d&&d.unactivate();var p=function(e){return{originalEvent:t,type:e,position:{x:o[0],y:o[1]}}};if(e.hoverData.which===3){var m=p(`cxttapend`);if(d?d.emit(m):r.emit(m),!e.hoverData.cxtDragged){var h=p(`cxttap`);d?d.emit(h):r.emit(h)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(e.hoverData.which===1){if(i(l,[`mouseup`,`tapend`,`vmouseup`],t,{x:o[0],y:o[1]}),!e.dragData.didDrag&&!e.hoverData.dragged&&!e.hoverData.selecting&&!e.hoverData.isOverThresholdDrag&&(i(d,[`click`,`tap`,`vclick`],t,{x:o[0],y:o[1]}),O=!1,t.timeStamp-k<=r.multiClickDebounceTime()?(D&&clearTimeout(D),O=!0,k=null,i(d,[`dblclick`,`dbltap`,`vdblclick`],t,{x:o[0],y:o[1]})):(D=setTimeout(function(){O||i(d,[`oneclick`,`onetap`,`voneclick`],t,{x:o[0],y:o[1]})},r.multiClickDebounceTime()),k=t.timeStamp)),d==null&&!e.dragData.didDrag&&!e.hoverData.selecting&&!e.hoverData.dragged&&!a(t)&&(r.$(n).unselect([`tapunselect`]),u.length>0&&e.redrawHint(`eles`,!0),e.dragData.possibleDragElements=u=r.collection()),l==d&&!e.dragData.didDrag&&!e.hoverData.selecting&&l!=null&&l._private.selectable&&(e.hoverData.dragging||(r.selectionType()===`additive`||f?l.selected()?l.unselect([`tapunselect`]):l.select([`tapselect`]):f||(r.$(n).unmerge(l).unselect([`tapunselect`]),l.select([`tapselect`]))),e.redrawHint(`eles`,!0)),e.hoverData.selecting){var _=r.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));e.redrawHint(`select`,!0),_.length>0&&e.redrawHint(`eles`,!0),r.emit(p(`boxend`)),r.selectionType()===`additive`||f||r.$(n).unmerge(_).unselect(),_.emit(p(`box`)).stdFilter(function(e){return e.selectable()&&!e.selected()}).select().emit(p(`boxselect`)),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint(`select`,!0),e.redrawHint(`eles`,!0),e.redraw()),!s[4]){e.redrawHint(`drag`,!0),e.redrawHint(`eles`,!0);var v=d&&d.grabbed();g(u),v&&(d.emit(p(`freeon`)),u.emit(p(`free`)),e.dragData.didDrag&&(d.emit(p(`dragfreeon`)),u.emit(p(`dragfree`))))}}s[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null,e.hoverData.which=null}},!1);var A=[],j=4,M,N=1e5,P=function(e){for(var t=Math.abs(e[0]),n=1;n<e.length;n++)if(Math.abs(e[n])!==t)return!1;return!0},F=function(t){var n=!1,r=t.deltaY;if(r??(t.wheelDeltaY==null?t.wheelDelta!=null&&(r=t.wheelDelta/4):r=t.wheelDeltaY/4),r!==0){if(M==null){if(A.length>=j){M=!1;var i=A;if(i[0]>=5){var a=P(i)?i[0]:eLe(i);a>1&&(M=!0,N=a)}}else A.push(Math.abs(r)),n=!0}else M&&(N=Math.min(Math.abs(r),N));if(!e.scrollingPage){var o=e.cy,s=o.zoom(),l=o.pan(),u=e.projectIntoViewport(t.clientX,t.clientY),d=[u[0]*s+l.x,u[1]*s+l.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||w()){t.preventDefault();return}if(o.panningEnabled()&&o.userPanningEnabled()&&o.zoomingEnabled()&&o.userZoomingEnabled()){t.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout(function(){e.data.wheelZooming=!1,e.redrawHint(`eles`,!0),e.redraw()},150);var f;n&&Math.abs(r)>5&&(r=CA(r)*5),f=r/-250,M&&(f/=N,f*=3),f*=e.wheelSensitivity,t.deltaMode===1&&(f*=33);var p=o.zoom()*10**f;t.type===`gesturechange`&&(p=e.gestureStartZoom*t.scale),o.zoom({level:p,renderedPosition:{x:d[0],y:d[1]}}),o.emit({type:t.type===`gesturechange`?`pinchzoom`:`scrollzoom`,originalEvent:t,position:{x:u[0],y:u[1]}})}}}};e.registerBinding(e.container,`wheel`,F,!0),e.registerBinding(t,`scroll`,function(t){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout(function(){e.scrollingPage=!1},250)},!0),e.registerBinding(e.container,`gesturestart`,function(t){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||t.preventDefault()},!0),e.registerBinding(e.container,`gesturechange`,function(t){e.hasTouchStarted||F(t)},!0),e.registerBinding(e.container,`mouseout`,function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:`mouseout`,position:{x:n[0],y:n[1]}})},!1),e.registerBinding(e.container,`mouseover`,function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:`mouseover`,position:{x:n[0],y:n[1]}})},!1);var I,L,R,ee,z,B,te,ne,re,ie,ae,oe,se,ce=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},le=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)},ue;e.registerBinding(e.container,`touchstart`,ue=function(t){if(e.hasTouchStarted=!0,T(t)){v(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var n=e.cy,r=e.touchData.now,a=e.touchData.earlier;if(t.touches[0]){var o=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);r[0]=o[0],r[1]=o[1]}if(t.touches[1]){var o=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);r[2]=o[0],r[3]=o[1]}if(t.touches[2]){var o=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);r[4]=o[0],r[5]=o[1]}var s=function(e){return{originalEvent:t,type:e,position:{x:r[0],y:r[1]}}};if(t.touches[1]){e.touchData.singleTouchMoved=!0,g(e.dragData.touchDragEles);var l=e.findContainerClientCoords();re=l[0],ie=l[1],ae=l[2],oe=l[3],I=t.touches[0].clientX-re,L=t.touches[0].clientY-ie,R=t.touches[1].clientX-re,ee=t.touches[1].clientY-ie,se=0<=I&&I<=ae&&0<=R&&R<=ae&&0<=L&&L<=oe&&0<=ee&&ee<=oe;var d=n.pan(),f=n.zoom();z=ce(I,L,R,ee),B=le(I,L,R,ee),te=[(I+R)/2,(L+ee)/2],ne=[(te[0]-d.x)/f,(te[1]-d.y)/f];var p=200,_=p*p;if(B<_&&!t.touches[2]){var y=e.findNearestElement(r[0],r[1],!0,!0),b=e.findNearestElement(r[2],r[3],!0,!0);y&&y.isNode()?(y.activate().emit(s(`cxttapstart`)),e.touchData.start=y):b&&b.isNode()?(b.activate().emit(s(`cxttapstart`)),e.touchData.start=b):n.emit(s(`cxttapstart`)),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,e.redraw();return}}if(t.touches[2])n.boxSelectionEnabled()&&t.preventDefault();else if(!t.touches[1]&&t.touches[0]){var x=e.findNearestElements(r[0],r[1],!0,!0),S=x[0];if(S!=null&&(S.activate(),e.touchData.start=S,e.touchData.starts=x,e.nodeIsGrabbable(S))){var C=e.dragData.touchDragEles=n.collection(),w=null;e.redrawHint(`eles`,!0),e.redrawHint(`drag`,!0),S.selected()?(w=n.$(function(t){return t.selected()&&e.nodeIsGrabbable(t)}),m(w,{addToList:C})):h(S,{addToList:C}),u(S),S.emit(s(`grabon`)),w?w.forEach(function(e){e.emit(s(`grab`))}):S.emit(s(`grab`))}i(S,[`touchstart`,`tapstart`,`vmousedown`],t,{x:r[0],y:r[1]}),S??(e.data.bgActivePosistion={x:o[0],y:o[1]},e.redrawHint(`select`,!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout(function(){e.touchData.singleTouchMoved===!1&&!e.pinching&&!e.touchData.selecting&&i(e.touchData.start,[`taphold`],t,{x:r[0],y:r[1]})},e.tapholdDuration)}if(t.touches.length>=1){for(var E=e.touchData.startPosition=[null,null,null,null,null,null],D=0;D<r.length;D++)E[D]=a[D]=r[D];var O=t.touches[0];e.touchData.startGPosition=[O.clientX,O.clientY]}}},!1);var de;e.registerBinding(t,`touchmove`,de=function(t){var n=e.touchData.capture;if(!(!n&&!T(t))){var r=e.selection,a=e.cy,s=e.touchData.now,l=e.touchData.earlier,u=a.zoom();if(t.touches[0]){var d=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=d[0],s[1]=d[1]}if(t.touches[1]){var d=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);s[2]=d[0],s[3]=d[1]}if(t.touches[2]){var d=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);s[4]=d[0],s[5]=d[1]}var f=function(e){return{originalEvent:t,type:e,position:{x:s[0],y:s[1]}}},p=e.touchData.startGPosition,h;if(n&&t.touches[0]&&p){for(var _=[],v=0;v<s.length;v++)_[v]=s[v]-l[v];var y=t.touches[0].clientX-p[0],b=y*y,x=t.touches[0].clientY-p[1];h=b+x*x>=e.touchTapThreshold2}if(n&&e.touchData.cxt){t.preventDefault();var S=t.touches[0].clientX-re,C=t.touches[0].clientY-ie,w=t.touches[1].clientX-re,E=t.touches[1].clientY-ie,D=le(S,C,w,E),O=D/B,k=150,A=k*k,j=1.5;if(O>=j*j||D>=A){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint(`select`,!0);var M=f(`cxttapend`);e.touchData.start?(e.touchData.start.unactivate().emit(M),e.touchData.start=null):a.emit(M)}}if(n&&e.touchData.cxt){var M=f(`cxtdrag`);e.data.bgActivePosistion=void 0,e.redrawHint(`select`,!0),e.touchData.start?e.touchData.start.emit(M):a.emit(M),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var N=e.findNearestElement(s[0],s[1],!0,!0);(!e.touchData.cxtOver||N!==e.touchData.cxtOver)&&(e.touchData.cxtOver&&e.touchData.cxtOver.emit(f(`cxtdragout`)),e.touchData.cxtOver=N,N&&N.emit(f(`cxtdragover`)))}else if(n&&t.touches[2]&&a.boxSelectionEnabled())t.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||a.emit(f(`boxstart`)),e.touchData.selecting=!0,e.touchData.didSelect=!0,r[4]=1,!r||r.length===0||r[0]===void 0?(r[0]=(s[0]+s[2]+s[4])/3,r[1]=(s[1]+s[3]+s[5])/3,r[2]=(s[0]+s[2]+s[4])/3+1,r[3]=(s[1]+s[3]+s[5])/3+1):(r[2]=(s[0]+s[2]+s[4])/3,r[3]=(s[1]+s[3]+s[5])/3),e.redrawHint(`select`,!0),e.redraw();else if(n&&t.touches[1]&&!e.touchData.didSelect&&a.zoomingEnabled()&&a.panningEnabled()&&a.userZoomingEnabled()&&a.userPanningEnabled()){t.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint(`select`,!0);var P=e.dragData.touchDragEles;if(P){e.redrawHint(`drag`,!0);for(var F=0;F<P.length;F++){var te=P[F]._private;te.grabbed=!1,te.rscratch.inDragLayer=!1}}var ae=e.touchData.start,S=t.touches[0].clientX-re,C=t.touches[0].clientY-ie,w=t.touches[1].clientX-re,E=t.touches[1].clientY-ie,oe=ce(S,C,w,E),ue=oe/z;if(se){var de=S-I,fe=C-L,pe=w-R,me=E-ee,he=(de+pe)/2,ge=(fe+me)/2,_e=a.zoom(),ve=_e*ue,ye=a.pan(),be=ne[0]*_e+ye.x,xe=ne[1]*_e+ye.y,Se={x:-ve/_e*(be-ye.x-he)+be,y:-ve/_e*(xe-ye.y-ge)+xe};if(ae&&ae.active()){var P=e.dragData.touchDragEles;g(P),e.redrawHint(`drag`,!0),e.redrawHint(`eles`,!0),ae.unactivate().emit(f(`freeon`)),P&&P.emit(f(`free`)),e.dragData.didDrag&&(ae.emit(f(`dragfreeon`)),P&&P.emit(f(`dragfree`)))}a.viewport({zoom:ve,pan:Se,cancelOnFailedZoom:!0}),a.emit(f(`pinchzoom`)),z=oe,I=S,L=C,R=w,ee=E,e.pinching=!0}if(t.touches[0]){var d=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=d[0],s[1]=d[1]}if(t.touches[1]){var d=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);s[2]=d[0],s[3]=d[1]}if(t.touches[2]){var d=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);s[4]=d[0],s[5]=d[1]}}else if(t.touches[0]&&!e.touchData.didSelect){var V=e.touchData.start,Ce=e.touchData.last,N;if(!e.hoverData.draggingEles&&!e.swipePanning&&(N=e.findNearestElement(s[0],s[1],!0,!0)),n&&V!=null&&t.preventDefault(),n&&V!=null&&e.nodeIsDraggable(V)){if(h){var P=e.dragData.touchDragEles,we=!e.dragData.didDrag;we&&m(P,{inDragLayer:!0}),e.dragData.didDrag=!0;var Te={x:0,y:0};if(rO(_[0])&&rO(_[1])&&(Te.x+=_[0],Te.y+=_[1],we)){e.redrawHint(`eles`,!0);var Ee=e.touchData.dragDelta;Ee&&rO(Ee[0])&&rO(Ee[1])&&(Te.x+=Ee[0],Te.y+=Ee[1])}e.hoverData.draggingEles=!0,P.silentShift(Te).emit(f(`position`)).emit(f(`drag`)),e.redrawHint(`drag`,!0),e.touchData.startPosition[0]==l[0]&&e.touchData.startPosition[1]==l[1]&&e.redrawHint(`eles`,!0),e.redraw()}else{var Ee=e.touchData.dragDelta=e.touchData.dragDelta||[];Ee.length===0?(Ee.push(_[0]),Ee.push(_[1])):(Ee[0]+=_[0],Ee[1]+=_[1])}}if(i(V||N,[`touchmove`,`tapdrag`,`vmousemove`],t,{x:s[0],y:s[1]}),(!V||!V.grabbed())&&N!=Ce&&(Ce&&Ce.emit(f(`tapdragout`)),N&&N.emit(f(`tapdragover`))),e.touchData.last=N,n)for(var F=0;F<s.length;F++)s[F]&&e.touchData.startPosition[F]&&h&&(e.touchData.singleTouchMoved=!0);if(n&&(V==null||V.pannable())&&a.panningEnabled()&&a.userPanningEnabled()){o(V,e.touchData.starts)&&(t.preventDefault(),e.data.bgActivePosistion||(e.data.bgActivePosistion=yA(e.touchData.startPosition)),e.swipePanning?(a.panBy({x:_[0]*u,y:_[1]*u}),a.emit(f(`dragpan`))):h&&(e.swipePanning=!0,a.panBy({x:y*u,y:x*u}),a.emit(f(`dragpan`)),V&&(V.unactivate(),e.redrawHint(`select`,!0),e.touchData.start=null)));var d=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=d[0],s[1]=d[1]}}for(var v=0;v<s.length;v++)l[v]=s[v];n&&t.touches.length>0&&!e.hoverData.draggingEles&&!e.swipePanning&&e.data.bgActivePosistion!=null&&(e.data.bgActivePosistion=void 0,e.redrawHint(`select`,!0),e.redraw())}},!1);var fe;e.registerBinding(t,`touchcancel`,fe=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()});var pe,me,he,ge;if(e.registerBinding(t,`touchend`,pe=function(t){var r=e.touchData.start;if(e.touchData.capture)t.touches.length===0&&(e.touchData.capture=!1),t.preventDefault();else return;var a=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var o=e.cy,s=o.zoom(),l=e.touchData.now,u=e.touchData.earlier;if(t.touches[0]){var d=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);l[0]=d[0],l[1]=d[1]}if(t.touches[1]){var d=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);l[2]=d[0],l[3]=d[1]}if(t.touches[2]){var d=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);l[4]=d[0],l[5]=d[1]}var f=function(e){return{originalEvent:t,type:e,position:{x:l[0],y:l[1]}}};r&&r.unactivate();var p;if(e.touchData.cxt){if(p=f(`cxttapend`),r?r.emit(p):o.emit(p),!e.touchData.cxtDragged){var m=f(`cxttap`);r?r.emit(m):o.emit(m)}e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,e.redraw();return}if(!t.touches[2]&&o.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var h=o.collection(e.getAllInBox(a[0],a[1],a[2],a[3]));a[0]=void 0,a[1]=void 0,a[2]=void 0,a[3]=void 0,a[4]=0,e.redrawHint(`select`,!0),o.emit(f(`boxend`)),h.emit(f(`box`)).stdFilter(function(e){return e.selectable()&&!e.selected()}).select().emit(f(`boxselect`)),h.nonempty()&&e.redrawHint(`eles`,!0),e.redraw()}if(r?.unactivate(),t.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint(`select`,!0);else if(!t.touches[1]&&!t.touches[0]&&!t.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint(`select`,!0);var _=e.dragData.touchDragEles;if(r!=null){var v=r._private.grabbed;g(_),e.redrawHint(`drag`,!0),e.redrawHint(`eles`,!0),v&&(r.emit(f(`freeon`)),_.emit(f(`free`)),e.dragData.didDrag&&(r.emit(f(`dragfreeon`)),_.emit(f(`dragfree`)))),i(r,[`touchend`,`tapend`,`vmouseup`,`tapdragout`],t,{x:l[0],y:l[1]}),r.unactivate(),e.touchData.start=null}else i(e.findNearestElement(l[0],l[1],!0,!0),[`touchend`,`tapend`,`vmouseup`,`tapdragout`],t,{x:l[0],y:l[1]});var y=e.touchData.startPosition[0]-l[0],b=y*y,x=e.touchData.startPosition[1]-l[1],S=(b+x*x)*s*s;e.touchData.singleTouchMoved||(r||o.$(`:selected`).unselect([`tapunselect`]),i(r,[`tap`,`vclick`],t,{x:l[0],y:l[1]}),me=!1,t.timeStamp-ge<=o.multiClickDebounceTime()?(he&&clearTimeout(he),me=!0,ge=null,i(r,[`dbltap`,`vdblclick`],t,{x:l[0],y:l[1]})):(he=setTimeout(function(){me||i(r,[`onetap`,`voneclick`],t,{x:l[0],y:l[1]})},o.multiClickDebounceTime()),ge=t.timeStamp)),r!=null&&!e.dragData.didDrag&&r._private.selectable&&S<e.touchTapThreshold2&&!e.pinching&&(o.selectionType()===`single`?(o.$(n).unmerge(r).unselect([`tapunselect`]),r.select([`tapselect`])):r.selected()?r.unselect([`tapunselect`]):r.select([`tapselect`]),e.redrawHint(`eles`,!0)),e.touchData.singleTouchMoved=!0}for(var C=0;C<l.length;C++)u[C]=l[C];e.dragData.didDrag=!1,t.touches.length===0&&(e.touchData.dragDelta=[],e.touchData.startPosition=[null,null,null,null,null,null],e.touchData.startGPosition=null,e.touchData.didSelect=!1),t.touches.length<2&&(t.touches.length===1&&(e.touchData.startGPosition=[t.touches[0].clientX,t.touches[0].clientY]),e.pinching=!1,e.redrawHint(`eles`,!0),e.redraw())},!1),typeof TouchEvent>`u`){var _e=[],ve=function(e){return{clientX:e.clientX,clientY:e.clientY,force:1,identifier:e.pointerId,pageX:e.pageX,pageY:e.pageY,radiusX:e.width/2,radiusY:e.height/2,screenX:e.screenX,screenY:e.screenY,target:e.target}},ye=function(e){return{event:e,touch:ve(e)}},be=function(e){_e.push(ye(e))},xe=function(e){for(var t=0;t<_e.length;t++)if(_e[t].event.pointerId===e.pointerId){_e.splice(t,1);return}},Se=function(e){var t=_e.filter(function(t){return t.event.pointerId===e.pointerId})[0];t.event=e,t.touch=ve(e)},V=function(e){e.touches=_e.map(function(e){return e.touch})},Ce=function(e){return e.pointerType===`mouse`||e.pointerType===4};e.registerBinding(e.container,`pointerdown`,function(e){Ce(e)||(e.preventDefault(),be(e),V(e),ue(e))}),e.registerBinding(e.container,`pointerup`,function(e){Ce(e)||(xe(e),V(e),pe(e))}),e.registerBinding(e.container,`pointercancel`,function(e){Ce(e)||(xe(e),V(e),fe(e))}),e.registerBinding(e.container,`pointermove`,function(e){Ce(e)||(e.preventDefault(),Se(e),V(e),de(e))})}},pF={},pF.generatePolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:function(e,t,n,r,i,a){this.renderer.nodeShapeImpl(`polygon`,e,t,n,r,i,this.points)},intersectLine:function(e,t,n,r,i,a,o,s){return qA(i,a,this.points,e,t,n/2,r/2,o)},checkPoint:function(e,t,n,r,i,a,o,s){return BA(e,t,this.points,a,o,r,i,[0,-1],n)},hasMiterBounds:e!==`rectangle`,miterBounds:function(e,t,n,r,i,a){return uFe(this.points,e,t,n,r,i)}}},pF.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:`ellipse`,draw:function(e,t,n,r,i,a){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,a,o,s){return hLe(i,a,e,t,n/2+o,r/2+o)},checkPoint:function(e,t,n,r,i,a,o,s){return UA(e,t,r,i,a,o,n)}}},pF.generateRoundPolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,getOrCreateCorners:function(e,n,r,i,a,o,s){if(o[s]!==void 0&&o[s+`-cx`]===e&&o[s+`-cy`]===n&&o[s+`-w`]===r&&o[s+`-h`]===i&&o[s+`-corner-radius`]===a)return o[s];o[s]=Array(t.length/2),o[s+`-cx`]=e,o[s+`-cy`]=n,o[s+`-w`]=r,o[s+`-h`]=i,o[s+`-corner-radius`]=a;var l=r/2,u=i/2;a=a===`auto`?$A(r,i):a;for(var d=Array(t.length/2),f=0;f<t.length/2;f++)d[f]={x:e+l*t[f*2],y:n+u*t[f*2+1]};var p,m,h,g,_=d.length;for(m=d[_-1],p=0;p<_;p++)h=d[p%_],g=d[(p+1)%_],o[s][p]=bD(m,h,g,a),m=h,h=g;return o[s]},draw:function(e,t,n,r,i,a,o){this.renderer.nodeShapeImpl(`round-polygon`,e,t,n,r,i,this.points,this.getOrCreateCorners(t,n,r,i,a,o,`drawCorners`))},intersectLine:function(e,t,n,r,i,a,o,s,l){return _Le(i,a,this.points,e,t,n,r,o,this.getOrCreateCorners(e,t,n,r,s,l,`corners`))},checkPoint:function(e,t,n,r,i,a,o,s,l){return mLe(e,t,this.points,a,o,r,i,this.getOrCreateCorners(a,o,r,i,s,l,`corners`))}}},pF.generateRoundRectangle=function(){return this.nodeShapes[`round-rectangle`]=this.nodeShapes.roundrectangle={renderer:this,name:`round-rectangle`,points:YA(4,0),draw:function(e,t,n,r,i,a){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i,this.points,a)},intersectLine:function(e,t,n,r,i,a,o,s){return RA(i,a,e,t,n,r,o,s)},checkPoint:function(e,t,n,r,i,a,o,s){var l=r/2,u=i/2;s=s===`auto`?QA(r,i):s,s=Math.min(l,u,s);var d=s*2;return!!(BA(e,t,this.points,a,o,r,i-d,[0,-1],n)||BA(e,t,this.points,a,o,r-d,i,[0,-1],n)||UA(e,t,d,d,a-l+s,o-u+s,n)||UA(e,t,d,d,a+l-s,o-u+s,n)||UA(e,t,d,d,a+l-s,o+u-s,n)||UA(e,t,d,d,a-l+s,o+u-s,n))}}},pF.generateCutRectangle=function(){return this.nodeShapes[`cut-rectangle`]=this.nodeShapes.cutrectangle={renderer:this,name:`cut-rectangle`,cornerLength:ej(),points:YA(4,0),draw:function(e,t,n,r,i,a){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i,null,a)},generateCutTrianglePts:function(e,t,n,r,i){var a=i===`auto`?this.cornerLength:i,o=t/2,s=e/2,l=n-s,u=n+s,d=r-o,f=r+o;return{topLeft:[l,d+a,l+a,d,l+a,d+a],topRight:[u-a,d,u,d+a,u-a,d+a],bottomRight:[u,f-a,u-a,f,u-a,f-a],bottomLeft:[l+a,f,l,f-a,l+a,f-a]}},intersectLine:function(e,t,n,r,i,a,o,s){var l=this.generateCutTrianglePts(n+2*o,r+2*o,e,t,s);return qA(i,a,[].concat.apply([],[l.topLeft.splice(0,4),l.topRight.splice(0,4),l.bottomRight.splice(0,4),l.bottomLeft.splice(0,4)]),e,t)},checkPoint:function(e,t,n,r,i,a,o,s){var l=s===`auto`?this.cornerLength:s;if(BA(e,t,this.points,a,o,r,i-2*l,[0,-1],n)||BA(e,t,this.points,a,o,r-2*l,i,[0,-1],n))return!0;var u=this.generateCutTrianglePts(r,i,a,o);return zA(e,t,u.topLeft)||zA(e,t,u.topRight)||zA(e,t,u.bottomRight)||zA(e,t,u.bottomLeft)}}},pF.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:`barrel`,points:YA(4,0),draw:function(e,t,n,r,i,a){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,a,o,s){var l=this.generateBarrelBezierPts(n+2*o,r+2*o,e,t),u=function(e){var t=DA({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.15),n=DA({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.5),r=DA({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.85);return[e[0],e[1],t.x,t.y,n.x,n.y,r.x,r.y,e[4],e[5]]};return qA(i,a,[].concat(u(l.topLeft),u(l.topRight),u(l.bottomRight),u(l.bottomLeft)),e,t)},generateBarrelBezierPts:function(e,t,n,r){var i=t/2,a=e/2,o=n-a,s=n+a,l=r-i,u=r+i,d=tj(e,t),f=d.heightOffset,p=d.widthOffset,m=d.ctrlPtOffsetPct*e,h={topLeft:[o,l+f,o+m,l,o+p,l],topRight:[s-p,l,s-m,l,s,l+f],bottomRight:[s,u-f,s-m,u,s-p,u],bottomLeft:[o+p,u,o+m,u,o,u-f]};return h.topLeft.isTop=!0,h.topRight.isTop=!0,h.bottomLeft.isBottom=!0,h.bottomRight.isBottom=!0,h},checkPoint:function(e,t,n,r,i,a,o,s){var l=tj(r,i),u=l.heightOffset,d=l.widthOffset;if(BA(e,t,this.points,a,o,r,i-2*u,[0,-1],n)||BA(e,t,this.points,a,o,r-2*d,i,[0,-1],n))return!0;for(var f=this.generateBarrelBezierPts(r,i,a,o),p=function(e,t,n){var r=n[4],i=n[2],a=n[0],o=n[5],s=n[1];if(Math.min(r,a)<=e&&e<=Math.max(r,a)&&Math.min(o,s)<=t&&t<=Math.max(o,s)){var l=vLe(r,i,a),u=uLe(l[0],l[1],l[2],e).filter(function(e){return 0<=e&&e<=1});if(u.length>0)return u[0]}return null},m=Object.keys(f),h=0;h<m.length;h++){var g=f[m[h]],_=p(e,t,g);if(_!=null){var v=g[5],y=g[3],b=g[1],x=EA(v,y,b,_);if(g.isTop&&x<=t||g.isBottom&&t<=x)return!0}}return!1}}},pF.generateBottomRoundrectangle=function(){return this.nodeShapes[`bottom-round-rectangle`]=this.nodeShapes.bottomroundrectangle={renderer:this,name:`bottom-round-rectangle`,points:YA(4,0),draw:function(e,t,n,r,i,a){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i,this.points,a)},intersectLine:function(e,t,n,r,i,a,o,s){var l=e-(n/2+o),u=t-(r/2+o),d=u,f=KA(i,a,e,t,l,u,e+(n/2+o),d,!1);return f.length>0?f:RA(i,a,e,t,n,r,o,s)},checkPoint:function(e,t,n,r,i,a,o,s){s=s===`auto`?QA(r,i):s;var l=2*s;if(BA(e,t,this.points,a,o,r,i-l,[0,-1],n)||BA(e,t,this.points,a,o,r-l,i,[0,-1],n))return!0;var u=r/2+2*n,d=i/2+2*n;return!!(zA(e,t,[a-u,o-d,a-u,o,a+u,o,a+u,o-d])||UA(e,t,l,l,a+r/2-s,o+i/2-s,n)||UA(e,t,l,l,a-r/2+s,o+i/2-s,n))}}},pF.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon(`triangle`,YA(3,0)),this.generateRoundPolygon(`round-triangle`,YA(3,0)),this.generatePolygon(`rectangle`,YA(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon(`diamond`,n),this.generateRoundPolygon(`round-diamond`,n),this.generatePolygon(`pentagon`,YA(5,0)),this.generateRoundPolygon(`round-pentagon`,YA(5,0)),this.generatePolygon(`hexagon`,YA(6,0)),this.generateRoundPolygon(`round-hexagon`,YA(6,0)),this.generatePolygon(`heptagon`,YA(7,0)),this.generateRoundPolygon(`round-heptagon`,YA(7,0)),this.generatePolygon(`octagon`,YA(8,0)),this.generateRoundPolygon(`round-octagon`,YA(8,0));var r=Array(20),i=ZA(5,0),a=ZA(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s<a.length/2;s++)a[s*2]*=o,a[s*2+1]*=o;for(var s=0;s<5;s++)r[s*4]=i[s*2],r[s*4+1]=i[s*2+1],r[s*4+2]=a[s*2],r[s*4+3]=a[s*2+1];r=XA(r),this.generatePolygon(`star`,r),this.generatePolygon(`vee`,[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon(`rhomboid`,[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon(`right-rhomboid`,[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon(`concave-hexagon`,[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);var l=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon(`tag`,l),this.generateRoundPolygon(`round-tag`,l),e.makePolygon=function(e){var n=`polygon-`+e.join(`$`),r;return(r=this[n])?r:t.generatePolygon(n,e)}},mF={},mF.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},mF.redraw=function(e){e||=Qk();var t=this;t.averageRedrawTime===void 0&&(t.averageRedrawTime=0),t.lastRedrawTime===void 0&&(t.lastRedrawTime=0),t.lastDrawTime===void 0&&(t.lastDrawTime=0),t.requestedFrame=!0,t.renderOptions=e},mF.beforeRender=function(e,t){if(!this.destroyed){t??Wk(`Priority is not optional for beforeRender`);var n=this.beforeRenderCallbacks;n.push({fn:e,priority:t}),n.sort(function(e,t){return t.priority-e.priority})}},hF=function(e,t,n){for(var r=e.beforeRenderCallbacks,i=0;i<r.length;i++)r[i].fn(t,n)},mF.startRenderLoop=function(){var e=this,t=e.cy;if(!e.renderLoopStarted){e.renderLoopStarted=!0;var n=function(r){if(!e.destroyed){if(!t.batching()){if(e.requestedFrame&&!e.skipFrame){hF(e,!0,r);var i=xk();e.render(e.renderOptions);var a=e.lastDrawTime=xk();e.averageRedrawTime===void 0&&(e.averageRedrawTime=a-i),e.redrawCount===void 0&&(e.redrawCount=0),e.redrawCount++,e.redrawTotalTime===void 0&&(e.redrawTotalTime=0);var o=a-i;e.redrawTotalTime+=o,e.lastRedrawTime=o,e.averageRedrawTime=e.averageRedrawTime/2+o/2,e.requestedFrame=!1}else hF(e,!1,r)}e.skipFrame=!1,bk(n)}};bk(n)}},gF=function(e){this.init(e)},_F=gF.prototype,_F.clientFunctions=[`redrawHint`,`render`,`renderTo`,`matchCanvasSize`,`nodeShapeImpl`,`arrowShapeImpl`],_F.init=function(e){var t=this;t.options=e,t.cy=e.cy;var n=t.container=e.cy.container(),r=t.cy.window();if(r){var i=r.document,a=i.head,o=`__________cytoscape_stylesheet`,s=`__________cytoscape_container`,l=i.getElementById(o)!=null;if(n.className.indexOf(s)<0&&(n.className=(n.className||``)+` `+s),!l){var u=i.createElement(`style`);u.id=o,u.textContent=`.`+s+` { position: relative; }`,a.insertBefore(u,a.children[0])}r.getComputedStyle(n).getPropertyValue(`position`)===`static`&&Kk(`A Cytoscape container has style position:static and so can not use UI extensions properly`)}t.selection=[void 0,void 0,void 0,void 0,0],t.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],t.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},t.dragData={possibleDragElements:[]},t.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},t.redraws=0,t.showFps=e.showFps,t.debug=e.debug,t.webgl=e.webgl,t.hideEdgesOnViewport=e.hideEdgesOnViewport,t.textureOnViewport=e.textureOnViewport,t.wheelSensitivity=e.wheelSensitivity,t.motionBlurEnabled=e.motionBlur,t.forcedPixelRatio=rO(e.pixelRatio)?e.pixelRatio:null,t.motionBlur=e.motionBlur,t.motionBlurOpacity=e.motionBlurOpacity,t.motionBlurTransparency=1-t.motionBlurOpacity,t.motionBlurPxRatio=1,t.mbPxRBlurry=1,t.minMbLowQualFrames=4,t.fullQualityMb=!1,t.clearedForMotionBlur=[],t.desktopTapThreshold=e.desktopTapThreshold,t.desktopTapThreshold2=e.desktopTapThreshold*e.desktopTapThreshold,t.touchTapThreshold=e.touchTapThreshold,t.touchTapThreshold2=e.touchTapThreshold*e.touchTapThreshold,t.tapholdDuration=500,t.bindings=[],t.beforeRenderCallbacks=[],t.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},t.registerNodeShapes(),t.registerArrowShapes(),t.registerCalculationListeners()},_F.notify=function(e,t){var n=this,r=n.cy;if(!this.destroyed){if(e===`init`){n.load();return}if(e===`destroy`){n.destroy();return}(e===`add`||e===`remove`||e===`move`&&r.hasCompoundNodes()||e===`load`||e===`zorder`||e===`mount`)&&n.invalidateCachedZSortedEles(),e===`viewport`&&n.redrawHint(`select`,!0),e===`gc`&&n.redrawHint(`gc`,!0),(e===`load`||e===`resize`||e===`mount`)&&(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint(`eles`,!0),n.redrawHint(`drag`,!0),this.startRenderLoop(),this.redraw()}},_F.destroy=function(){var e=this;e.destroyed=!0,e.cy.stopAnimationLoop();for(var t=0;t<e.bindings.length;t++){var n=e.bindings[t],r=n.target;(r.off||r.removeEventListener).apply(r,n.args)}if(e.bindings=[],e.beforeRenderCallbacks=[],e.onUpdateEleCalcsFns=[],e.removeObserver&&e.removeObserver.disconnect(),e.styleObserver&&e.styleObserver.disconnect(),e.resizeObserver&&e.resizeObserver.disconnect(),e.labelCalcDiv)try{document.body.removeChild(e.labelCalcDiv)}catch{}},_F.isHeadless=function(){return!1},[PP,lF,uF,fF,pF,mF].forEach(function(e){MO(_F,e)}),vF=1e3/60,yF={setupDequeueing:function(e){return function(){var t=this,n=this.renderer;if(!t.dequeueingSetup){t.dequeueingSetup=!0;var r=gk(function(){n.redrawHint(`eles`,!0),n.redrawHint(`drag`,!0),n.redraw()},e.deqRedrawThreshold),i=function(i,a){var o=xk(),s=n.averageRedrawTime,l=n.lastRedrawTime,u=[],d=n.cy.extent(),f=n.getPixelRatio();for(i||n.flushRenderedStyleQueue();;){var p=xk(),m=p-o,h=p-a;if(l<vF){var g=vF-(i?s:0);if(h>=e.deqFastCost*g)break}else if(i){if(m>=e.deqCost*l||m>=e.deqAvgCost*s)break}else if(h>=e.deqNoDrawCost*vF)break;var _=e.deq(t,f,d);if(_.length>0)for(var v=0;v<_.length;v++)u.push(_[v]);else break}u.length>0&&(e.onDeqd(t,u),!i&&e.shouldRedraw(t,u,f,d)&&r())},a=e.priority||Uk;n.beforeRender(i,a(t))}}}},PBe=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vk;mE(this,e),this.idsByKey=new aA,this.keyForId=new aA,this.cachesByLvl=new aA,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return hE(e,[{key:`getIdsFor`,value:function(e){e??Wk(`Can not get id list for null key`);var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new cA,t.set(e,n)),n}},{key:`addIdForKey`,value:function(e,t){e!=null&&this.getIdsFor(e).add(t)}},{key:`deleteIdForKey`,value:function(e,t){e!=null&&this.getIdsFor(e).delete(t)}},{key:`getNumberOfIdsForKey`,value:function(e){return e==null?0:this.getIdsFor(e).size}},{key:`updateKeyMappingFor`,value:function(e){var t=e.id(),n=this.keyForId.get(t),r=this.getKey(e);this.deleteIdForKey(n,t),this.addIdForKey(r,t),this.keyForId.set(t,r)}},{key:`deleteKeyMappingFor`,value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteIdForKey(n,t),this.keyForId.delete(t)}},{key:`keyHasChangedFor`,value:function(e){var t=e.id();return this.keyForId.get(t)!==this.getKey(e)}},{key:`isInvalid`,value:function(e){return this.keyHasChangedFor(e)||this.doesEleInvalidateKey(e)}},{key:`getCachesAt`,value:function(e){var t=this.cachesByLvl,n=this.lvls,r=t.get(e);return r||(r=new aA,t.set(e,r),n.push(e)),r}},{key:`getCache`,value:function(e,t){return this.getCachesAt(t).get(e)}},{key:`get`,value:function(e,t){var n=this.getKey(e),r=this.getCache(n,t);return r!=null&&this.updateKeyMappingFor(e),r}},{key:`getForCachedKey`,value:function(e,t){var n=this.keyForId.get(e.id());return this.getCache(n,t)}},{key:`hasCache`,value:function(e,t){return this.getCachesAt(t).has(e)}},{key:`has`,value:function(e,t){var n=this.getKey(e);return this.hasCache(n,t)}},{key:`setCache`,value:function(e,t,n){n.key=e,this.getCachesAt(t).set(e,n)}},{key:`set`,value:function(e,t,n){var r=this.getKey(e);this.setCache(r,t,n),this.updateKeyMappingFor(e)}},{key:`deleteCache`,value:function(e,t){this.getCachesAt(t).delete(e)}},{key:`delete`,value:function(e,t){var n=this.getKey(e);this.deleteCache(n,t)}},{key:`invalidateKey`,value:function(e){var t=this;this.lvls.forEach(function(n){return t.deleteCache(e,n)})}},{key:`invalidate`,value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteKeyMappingFor(e);var r=this.doesEleInvalidateKey(e);return r&&this.invalidateKey(n),r||this.getNumberOfIdsForKey(n)===0}}])}(),bF=25,xF=50,SF=-4,CF=3,wF=7.99,FBe=8,IBe=1024,LBe=1024,RBe=1024,zBe=.2,BBe=.8,VBe=10,HBe=.15,UBe=.1,WBe=.9,GBe=.9,KBe=100,qBe=1,TF={dequeue:`dequeue`,downscale:`downscale`,highQuality:`highQuality`},JBe=$k({getKey:null,doesEleInvalidateKey:Vk,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Bk,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),EF=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var r=JBe(t);MO(n,r),n.lookup=new PBe(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()},DF=EF.prototype,DF.reasons=TF,DF.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},DF.getRetiredTextureQueue=function(e){var t=this,n=t.eleImgCaches.retired=t.eleImgCaches.retired||{};return n[e]=n[e]||[]},DF.getElementQueue=function(){var e=this;return e.eleCacheQueue=e.eleCacheQueue||new hA(function(e,t){return t.reqs-e.reqs})},DF.getElementKeyToQueue=function(){var e=this;return e.eleKeyToCacheQueue=e.eleKeyToCacheQueue||{}},DF.getElement=function(e,t,n,r,i){var a=this,o=this.renderer,s=o.cy.zoom(),l=this.lookup;if(!t||t.w===0||t.h===0||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed()||!a.allowEdgeTxrCaching&&e.isEdge()||!a.allowParentTxrCaching&&e.isParent())return null;if(r??=Math.ceil(SA(s*n)),r<SF)r=SF;else if(s>=wF||r>CF)return null;var u=2**r,d=t.h*u,f=t.w*u,p=o.eleTextBiggerThanMin(e,u);if(!this.isVisible(e,p))return null;var m=l.get(e,r);if(m&&m.invalidated&&(m.invalidated=!1,m.texture.invalidatedWidth-=m.width),m)return m;var h=d<=bF?bF:d<=xF?xF:Math.ceil(d/xF)*xF;if(d>RBe||f>LBe)return null;var g=a.getTextureQueue(h),_=g[g.length-2],v=function(){return a.recycleTexture(h,f)||a.addTexture(h,f)};_||=g[g.length-1],_||=v(),_.width-_.usedWidth<f&&(_=v());for(var y=function(e){return e&&e.scaledLabelShown===p},b=i&&i===TF.dequeue,x=i&&i===TF.highQuality,S=i&&i===TF.downscale,C,w=r+1;w<=CF;w++){var T=l.get(e,w);if(T){C=T;break}}var E=C&&C.level===r+1?C:null,D=function(){_.context.drawImage(E.texture.canvas,E.x,0,E.width,E.height,_.usedWidth,0,f,d)};if(_.context.setTransform(1,0,0,1,0,0),_.context.clearRect(_.usedWidth,0,f,h),y(E))D();else if(y(C)){if(x){for(var O=C.level;O>r;O--)E=a.getElement(e,t,n,O,TF.downscale);D()}else return a.queueElement(e,C.level-1),C}else{var k;if(!b&&!x&&!S)for(var A=r-1;A>=SF;A--){var j=l.get(e,A);if(j){k=j;break}}if(y(k))return a.queueElement(e,r),k;_.context.translate(_.usedWidth,0),_.context.scale(u,u),this.drawElement(_.context,e,t,p,!1),_.context.scale(1/u,1/u),_.context.translate(-_.usedWidth,0)}return m={x:_.usedWidth,texture:_,level:r,scale:u,width:f,height:d,scaledLabelShown:p},_.usedWidth+=Math.ceil(f+FBe),_.eleCaches.push(m),l.set(e,r,m),a.checkTextureFullness(_),m},DF.invalidateElements=function(e){for(var t=0;t<e.length;t++)this.invalidateElement(e[t])},DF.invalidateElement=function(e){var t=this,n=t.lookup,r=[];if(n.isInvalid(e)){for(var i=SF;i<=CF;i++){var a=n.getForCachedKey(e,i);a&&r.push(a)}if(n.invalidate(e))for(var o=0;o<r.length;o++){var s=r[o],l=s.texture;l.invalidatedWidth+=s.width,s.invalidated=!0,t.checkTextureUtility(l)}t.removeFromQueue(e)}},DF.checkTextureUtility=function(e){e.invalidatedWidth>=zBe*e.width&&this.retireTexture(e)},DF.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>BBe&&e.fullnessChecks>=VBe?eA(t,e):e.fullnessChecks++},DF.retireTexture=function(e){var t=this,n=e.height,r=t.getTextureQueue(n),i=this.lookup;eA(r,e),e.retired=!0;for(var a=e.eleCaches,o=0;o<a.length;o++){var s=a[o];i.deleteCache(s.key,s.level)}tA(a),t.getRetiredTextureQueue(n).push(e)},DF.addTexture=function(e,t){var n=this,r=n.getTextureQueue(e),i={};return r.push(i),i.eleCaches=[],i.height=e,i.width=Math.max(IBe,t),i.usedWidth=0,i.invalidatedWidth=0,i.fullnessChecks=0,i.canvas=n.renderer.makeOffscreenCanvas(i.width,i.height),i.context=i.canvas.getContext(`2d`),i},DF.recycleTexture=function(e,t){for(var n=this,r=n.getTextureQueue(e),i=n.getRetiredTextureQueue(e),a=0;a<i.length;a++){var o=i[a];if(o.width>=t)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,tA(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),eA(i,o),r.push(o),o}},DF.queueElement=function(e,t){var n=this,r=n.getElementQueue(),i=n.getElementKeyToQueue(),a=this.getKey(e),o=i[a];if(o)o.level=Math.max(o.level,t),o.eles.merge(e),o.reqs++,r.updateItem(o);else{var s={eles:e.spawn().merge(e),level:t,reqs:1,key:a};r.push(s),i[a]=s}},DF.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),i=[],a=t.lookup,o=0;o<qBe&&n.size()>0;o++){var s=n.pop(),l=s.key,u=s.eles[0],d=a.hasCache(u,s.level);if(r[l]=null,!d){i.push(s);var f=t.getBoundingBox(u);t.getElement(u,f,e,s.level,TF.dequeue)}}return i},DF.removeFromQueue=function(e){var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),i=this.getKey(e),a=r[i];a!=null&&(a.eles.length===1?(a.reqs=zk,n.updateItem(a),n.pop(),r[i]=null):a.eles.unmerge(e))},DF.onDequeue=function(e){this.onDequeues.push(e)},DF.offDequeue=function(e){eA(this.onDequeues,e)},DF.setupDequeueing=yF.setupDequeueing({deqRedrawThreshold:KBe,deqCost:HBe,deqAvgCost:UBe,deqNoDrawCost:WBe,deqFastCost:GBe,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n<e.onDequeues.length;n++){var r=e.onDequeues[n];r(t)}},shouldRedraw:function(e,t,n,r){for(var i=0;i<t.length;i++)for(var a=t[i].eles,o=0;o<a.length;o++)if(PA(a[o].boundingBox(),r))return!0;return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}}),YBe=1,OF=-4,kF=2,XBe=3.99,ZBe=50,QBe=50,$Be=.15,eVe=.1,tVe=.9,nVe=.9,rVe=1,AF=250,iVe=16e6,jF=32767,aVe=!0,MF=function(e){var t=this,n=t.renderer=e,r=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=xk()-2*AF,t.skipping=!1,t.eleTxrDeqs=r.collection(),t.scheduleElementRefinement=gk(function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)},QBe),n.beforeRender(function(e,n){t.skipping=n-t.lastInvalidationTime<=AF},n.beforeRenderPriorities.lyrTxrSkip),t.layersQueue=new hA(function(e,t){return t.reqs-e.reqs}),t.setupDequeueing()},NF=MF.prototype,PF=0,oVe=2**53-1,NF.makeLayer=function(e,t){var n=2**t,r=Math.ceil(e.w*n),i=Math.ceil(e.h*n),a=this.renderer.makeOffscreenCanvas(r,i),o={id:PF=++PF%oVe,bb:e,level:t,width:r,height:i,canvas:a,context:a.getContext(`2d`),eles:[],elesQueue:[],reqs:0},s=o.context,l=-o.bb.x1,u=-o.bb.y1;return s.scale(n,n),s.translate(l,u),o},NF.getLayers=function(e,t,n){var r=this,i=r.renderer.cy.zoom(),a=r.firstGet;if(r.firstGet=!1,n==null){if(n=Math.ceil(SA(i*t)),n<OF)n=OF;else if(i>=XBe||n>kF)return null}r.validateLayersElesOrdering(n,e);var o=r.layersByLevel,s=2**n,l=o[n]=o[n]||[],u,d=r.levelIsComplete(n,e),f,p=function(){var t=function(t){if(r.validateLayersElesOrdering(t,e),r.levelIsComplete(t,e))return f=o[t],!0},i=function(e){if(!f)for(var r=n+e;OF<=r&&r<=kF&&!t(r);r+=e);};i(1),i(-1);for(var a=l.length-1;a>=0;a--){var s=l[a];s.invalid&&eA(l,s)}};if(!d)p();else return l;var m=function(){if(!u){u=kA();for(var t=0;t<e.length;t++)oLe(u,e[t].boundingBox())}return u},h=function(e){e||={};var t=e.after;m();var i=Math.ceil(u.w*s),a=Math.ceil(u.h*s);if(i>jF||a>jF||i*a>iVe)return null;var o=r.makeLayer(u,n);if(t!=null){var d=l.indexOf(t)+1;l.splice(d,0,o)}else(e.insert===void 0||e.insert)&&l.unshift(o);return o};if(r.skipping&&!a)return null;for(var g=null,_=e.length/YBe,v=!a,y=0;y<e.length;y++){var b=e[y],x=b._private.rscratch,S=x.imgLayerCaches=x.imgLayerCaches||{},C=S[n];if(C){g=C;continue}if((!g||g.eles.length>=_||!LA(g.bb,b.boundingBox()))&&(g=h({insert:!0,after:g}),!g))return null;f||v?r.queueLayer(g,b):r.drawEleInLayer(g,b,n,t),g.eles.push(b),S[n]=g}return f||(v?null:l)},NF.getEleLevelForLayerLevel=function(e,t){return e},NF.drawEleInLayer=function(e,t,n,r){var i=this,a=this.renderer,o=e.context,s=t.boundingBox();s.w===0||s.h===0||!t.visible()||(n=i.getEleLevelForLayerLevel(n,r),a.setImgSmoothing(o,!1),a.drawCachedElement(o,t,null,null,n,aVe),a.setImgSmoothing(o,!0))},NF.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||n.length===0)return!1;for(var r=0,i=0;i<n.length;i++){var a=n[i];if(a.reqs>0||a.invalid)return!1;r+=a.eles.length}return r===t.length},NF.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r<n.length;r++){for(var i=n[r],a=-1,o=0;o<t.length;o++)if(i.eles[0]===t[o]){a=o;break}if(a<0){this.invalidateLayer(i);continue}for(var s=a,o=0;o<i.eles.length;o++)if(i.eles[o]!==t[s+o]){this.invalidateLayer(i);break}}},NF.updateElementsInLayers=function(e,t){for(var n=this,r=sO(e[0]),i=0;i<e.length;i++)for(var a=r?null:e[i],o=r?e[i]:e[i].ele,s=o._private.rscratch,l=s.imgLayerCaches=s.imgLayerCaches||{},u=OF;u<=kF;u++){var d=l[u];d&&(a&&n.getEleLevelForLayerLevel(d.level)!==a.level||t(d,o,a))}},NF.haveLayers=function(){for(var e=this,t=!1,n=OF;n<=kF;n++){var r=e.layersByLevel[n];if(r&&r.length>0){t=!0;break}}return t},NF.invalidateElements=function(e){var t=this;e.length!==0&&(t.lastInvalidationTime=xk(),!(e.length===0||!t.haveLayers())&&t.updateElementsInLayers(e,function(e,n,r){t.invalidateLayer(e)}))},NF.invalidateLayer=function(e){if(this.lastInvalidationTime=xk(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];eA(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var i=0;i<n.length;i++){var a=n[i]._private.rscratch.imgLayerCaches;a&&(a[t]=null)}}},NF.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,function(e,n,r){var i=e.replacement;if(i||(i=e.replacement=t.makeLayer(e.bb,e.level),i.replaces=e,i.eles=e.eles),!i.reqs)for(var a=0;a<i.eles.length;a++)t.queueLayer(i,i.eles[a])})},NF.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()},NF.queueLayer=function(e,t){var n=this.layersQueue,r=e.elesQueue,i=r.hasId=r.hasId||{};if(!e.replacement){if(t){if(i[t.id()])return;r.push(t),i[t.id()]=!0}e.reqs?(e.reqs++,n.updateItem(e)):(e.reqs=1,n.push(e))}},NF.dequeue=function(e){for(var t=this,n=t.layersQueue,r=[],i=0;i<rVe&&n.size()!==0;){var a=n.peek();if(a.replacement){n.pop();continue}if(a.replaces&&a!==a.replaces.replacement){n.pop();continue}if(a.invalid){n.pop();continue}var o=a.elesQueue.shift();o&&(t.drawEleInLayer(a,o,a.level,e),i++),r.length===0&&r.push(!0),a.elesQueue.length===0&&(n.pop(),a.reqs=0,a.replaces&&t.applyLayerReplacement(a),t.requestRedraw())}return r},NF.applyLayerReplacement=function(e){var t=this,n=t.layersByLevel[e.level],r=e.replaces,i=n.indexOf(r);if(!(i<0||r.invalid)){n[i]=e;for(var a=0;a<e.eles.length;a++){var o=e.eles[a]._private,s=o.imgLayerCaches=o.imgLayerCaches||{};s&&(s[e.level]=e)}t.requestRedraw()}},NF.requestRedraw=gk(function(){var e=this.renderer;e.redrawHint(`eles`,!0),e.redrawHint(`drag`,!0),e.redraw()},100),NF.setupDequeueing=yF.setupDequeueing({deqRedrawThreshold:ZBe,deqCost:$Be,deqAvgCost:eVe,deqNoDrawCost:tVe,deqFastCost:nVe,deq:function(e,t){return e.dequeue(t)},onDeqd:Uk,shouldRedraw:Bk,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}}),FF={},FF.arrowShapeImpl=function(e){return(sVe||={polygon:nIe,"triangle-backcurve":rIe,"triangle-tee":SD,"circle-triangle":iIe,"triangle-cross":SD,circle:aIe})[e]},IF={},IF.drawElement=function(e,t,n,r,i,a){var o=this;t.isNode()?o.drawNode(e,t,n,r,i,a):o.drawEdge(e,t,n,r,i,a)},IF.drawElementOverlay=function(e,t){var n=this;t.isNode()?n.drawNodeOverlay(e,t):n.drawEdgeOverlay(e,t)},IF.drawElementUnderlay=function(e,t){var n=this;t.isNode()?n.drawNodeUnderlay(e,t):n.drawEdgeUnderlay(e,t)},IF.drawCachedElementPortion=function(e,t,n,r,i,a,o,s){var l=this,u=n.getBoundingBox(t);if(u.w!==0&&u.h!==0){var d=n.getElement(t,u,r,i,a);if(d!=null){var f=s(l,t);if(f===0)return;var p=o(l,t),m=u.x1,h=u.y1,g=u.w,_=u.h,v,y,b,x,S;if(p!==0){var C=n.getRotationPoint(t);b=C.x,x=C.y,e.translate(b,x),e.rotate(p),S=l.getImgSmoothing(e),S||l.setImgSmoothing(e,!0);var w=n.getRotationOffset(t);v=w.x,y=w.y}else v=m,y=h;var T;f!==1&&(T=e.globalAlpha,e.globalAlpha=T*f),e.drawImage(d.texture.canvas,d.x,0,d.width,d.height,v,y,g,_),f!==1&&(e.globalAlpha=T),p!==0&&(e.rotate(-p),e.translate(-b,-x),S||l.setImgSmoothing(e,!1))}else n.drawElement(e,t)}},cVe=function(){return 0},lVe=function(e,t){return e.getTextAngle(t,null)},uVe=function(e,t){return e.getTextAngle(t,`source`)},dVe=function(e,t){return e.getTextAngle(t,`target`)},fVe=function(e,t){return t.effectiveOpacity()},LF=function(e,t){return t.pstyle(`text-opacity`).pfValue*t.effectiveOpacity()},IF.drawCachedElement=function(e,t,n,r,i,a){var o=this,s=o.data,l=s.eleTxrCache,u=s.lblTxrCache,d=s.slbTxrCache,f=s.tlbTxrCache,p=t.boundingBox(),m=a===!0?l.reasons.highQuality:null;if(!(p.w===0||p.h===0||!t.visible())&&(!r||PA(p,r))){var h=t.isEdge(),g=t.element()._private.rscratch.badLine;o.drawElementUnderlay(e,t),o.drawCachedElementPortion(e,t,l,n,i,m,cVe,fVe),(!h||!g)&&o.drawCachedElementPortion(e,t,u,n,i,m,lVe,LF),h&&!g&&(o.drawCachedElementPortion(e,t,d,n,i,m,uVe,LF),o.drawCachedElementPortion(e,t,f,n,i,m,dVe,LF)),o.drawElementOverlay(e,t)}},IF.drawElements=function(e,t){for(var n=this,r=0;r<t.length;r++){var i=t[r];n.drawElement(e,i)}},IF.drawCachedElements=function(e,t,n,r){for(var i=this,a=0;a<t.length;a++){var o=t[a];i.drawCachedElement(e,o,n,r)}},IF.drawCachedNodes=function(e,t,n,r){for(var i=this,a=0;a<t.length;a++){var o=t[a];o.isNode()&&i.drawCachedElement(e,o,n,r)}},IF.drawLayeredElements=function(e,t,n,r){var i=this,a=i.data.lyrTxrCache.getLayers(t,n);if(a)for(var o=0;o<a.length;o++){var s=a[o],l=s.bb;l.w!==0&&l.h!==0&&e.drawImage(s.canvas,l.x1,l.y1,l.w,l.h)}else i.drawCachedElements(e,t,n,r)},RF={},RF.drawEdge=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s=t._private.rscratch;if(!(a&&!t.visible())&&!(s.badLine||s.allpts==null||isNaN(s.allpts[0]))){var l;n&&(l=n,e.translate(-l.x1,-l.y1));var u=a?t.pstyle(`opacity`).value:1,d=a?t.pstyle(`line-opacity`).value:1,f=t.pstyle(`curve-style`).value,p=t.pstyle(`line-style`).value,m=t.pstyle(`width`).pfValue,h=t.pstyle(`line-cap`).value,g=t.pstyle(`line-outline-width`).value,_=t.pstyle(`line-outline-color`).value,v=u*d,y=u*d,b=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;f===`straight-triangle`?(o.eleStrokeStyle(e,t,n),o.drawEdgeTrianglePath(t,e,s.allpts)):(e.lineWidth=m,e.lineCap=h,o.eleStrokeStyle(e,t,n),o.drawEdgePath(t,e,s.allpts,p),e.lineCap=`butt`)},x=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v;if(e.lineWidth=m+g,e.lineCap=h,g>0)o.colorStrokeStyle(e,_[0],_[1],_[2],n);else{e.lineCap=`butt`;return}f===`straight-triangle`?o.drawEdgeTrianglePath(t,e,s.allpts):(o.drawEdgePath(t,e,s.allpts,p),e.lineCap=`butt`)},S=function(){i&&o.drawEdgeOverlay(e,t)},C=function(){i&&o.drawEdgeUnderlay(e,t)},w=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;o.drawArrowheads(e,t,n)},T=function(){o.drawElementText(e,t,null,r)};if(e.lineJoin=`round`,t.pstyle(`ghost`).value===`yes`){var E=t.pstyle(`ghost-offset-x`).pfValue,D=t.pstyle(`ghost-offset-y`).pfValue,O=v*t.pstyle(`ghost-opacity`).value;e.translate(E,D),b(O),w(O),e.translate(-E,-D)}else x();C(),b(),w(),S(),T(),n&&e.translate(l.x1,l.y1)}},zF=function(e){if(![`overlay`,`underlay`].includes(e))throw Error(`Invalid state`);return function(t,n){if(n.visible()){var r=n.pstyle(`${e}-opacity`).value;if(r!==0){var i=this,a=i.usePaths(),o=n._private.rscratch,s=2*n.pstyle(`${e}-padding`).pfValue,l=n.pstyle(`${e}-color`).value;t.lineWidth=s,t.lineCap=o.edgeType===`self`&&!a?`butt`:`round`,i.colorStrokeStyle(t,l[0],l[1],l[2],r),i.drawEdgePath(n,t,o.allpts,`solid`)}}}},RF.drawEdgeOverlay=zF(`overlay`),RF.drawEdgeUnderlay=zF(`underlay`),RF.drawEdgePath=function(e,t,n,r){var i=e._private.rscratch,a=t,o,s=!1,l=this.usePaths(),u=e.pstyle(`line-dash-pattern`).pfValue,d=e.pstyle(`line-dash-offset`).pfValue;if(l){var f=n.join(`$`);i.pathCacheKey&&i.pathCacheKey===f?(o=t=i.pathCache,s=!0):(o=t=new Path2D,i.pathCacheKey=f,i.pathCache=o)}if(a.setLineDash)switch(r){case`dotted`:a.setLineDash([1,1]);break;case`dashed`:a.setLineDash(u),a.lineDashOffset=d;break;case`solid`:a.setLineDash([])}if(!s&&!i.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),i.edgeType){case`bezier`:case`self`:case`compound`:case`multibezier`:for(var p=2;p+3<n.length;p+=4)t.quadraticCurveTo(n[p],n[p+1],n[p+2],n[p+3]);break;case`straight`:case`haystack`:for(var m=2;m+1<n.length;m+=2)t.lineTo(n[m],n[m+1]);break;case`segments`:if(i.isRound){var h=gE(i.roundCorners),g;try{for(h.s();!(g=h.n()).done;){var _=g.value;yD(t,_)}}catch(e){h.e(e)}finally{h.f()}t.lineTo(n[n.length-2],n[n.length-1])}else for(var v=2;v+1<n.length;v+=2)t.lineTo(n[v],n[v+1])}t=a,l?t.stroke(o):t.stroke(),t.setLineDash&&t.setLineDash([])},RF.drawEdgeTrianglePath=function(e,t,n){t.fillStyle=t.strokeStyle;for(var r=e.pstyle(`width`).pfValue,i=0;i+1<n.length;i+=2){var a=[n[i+2]-n[i],n[i+3]-n[i+1]],o=Math.sqrt(a[0]*a[0]+a[1]*a[1]),s=[a[1]/o,-a[0]/o],l=[s[0]*r/2,s[1]*r/2];t.beginPath(),t.moveTo(n[i]-l[0],n[i+1]-l[1]),t.lineTo(n[i]+l[0],n[i+1]+l[1]),t.lineTo(n[i+2],n[i+3]),t.closePath(),t.fill()}},RF.drawArrowheads=function(e,t,n){var r=t._private.rscratch,i=r.edgeType===`haystack`;i||this.drawArrowhead(e,t,`source`,r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(e,t,`mid-target`,r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(e,t,`mid-source`,r.midX,r.midY,r.midsrcArrowAngle,n),i||this.drawArrowhead(e,t,`target`,r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)},RF.drawArrowhead=function(e,t,n,r,i,a,o){if(!(isNaN(r)||r==null||isNaN(i)||i==null||isNaN(a)||a==null)){var s=this,l=t.pstyle(n+`-arrow-shape`).value;if(l!==`none`){var u=t.pstyle(n+`-arrow-fill`).value===`hollow`?`both`:`filled`,d=t.pstyle(n+`-arrow-fill`).value,f=t.pstyle(`width`).pfValue,p=t.pstyle(n+`-arrow-width`),m=p.value===`match-line`?f:p.pfValue;p.units===`%`&&(m*=f);var h=t.pstyle(`opacity`).value;o===void 0&&(o=h);var g=e.globalCompositeOperation;(o!==1||d===`hollow`)&&(e.globalCompositeOperation=`destination-out`,s.colorFillStyle(e,255,255,255,1),s.colorStrokeStyle(e,255,255,255,1),s.drawArrowShape(t,e,u,f,l,m,r,i,a),e.globalCompositeOperation=g);var _=t.pstyle(n+`-arrow-color`).value;s.colorFillStyle(e,_[0],_[1],_[2],o),s.colorStrokeStyle(e,_[0],_[1],_[2],o),s.drawArrowShape(t,e,d,f,l,m,r,i,a)}}},RF.drawArrowShape=function(e,t,n,r,i,a,o,s,l){var u=this,d=this.usePaths()&&i!==`triangle-cross`,f=!1,p,m=t,h={x:o,y:s},g=e.pstyle(`arrow-scale`).value,_=this.getArrowWidth(r,g),v=u.arrowShapes[i];if(d){var y=u.arrowPathCache=u.arrowPathCache||[],b=Mk(i),x=y[b];x==null?(p=t=new Path2D,y[b]=p):(p=t=x,f=!0)}f||(t.beginPath&&t.beginPath(),d?v.draw(t,1,0,{x:0,y:0},1):v.draw(t,_,l,h,r),t.closePath&&t.closePath()),t=m,d&&(t.translate(o,s),t.rotate(l),t.scale(_,_)),(n===`filled`||n===`both`)&&(d?t.fill(p):t.fill()),(n===`hollow`||n===`both`)&&(t.lineWidth=a/(d?_:1),t.lineJoin=`miter`,d?t.stroke(p):t.stroke()),d&&(t.scale(1/_,1/_),t.rotate(-l),t.translate(-o,-s))},BF={},BF.safeDrawImage=function(e,t,n,r,i,a,o,s,l,u){if(!(i<=0||a<=0||l<=0||u<=0))try{e.drawImage(t,n,r,i,a,o,s,l,u)}catch(e){Kk(e)}},BF.drawInscribedImage=function(e,t,n,r,i){var a=this,o=n.position(),s=o.x,l=o.y,u=n.cy().style(),d=u.getIndexedStyle.bind(u),f=d(n,`background-fit`,`value`,r),p=d(n,`background-repeat`,`value`,r),m=n.width(),h=n.height(),g=n.padding()*2,_=m+(d(n,`background-width-relative-to`,`value`,r)===`inner`?0:g),v=h+(d(n,`background-height-relative-to`,`value`,r)===`inner`?0:g),y=n._private.rscratch,b=d(n,`background-clip`,`value`,r)===`node`,x=d(n,`background-image-opacity`,`value`,r)*i,S=d(n,`background-image-smoothing`,`value`,r),C=n.pstyle(`corner-radius`).value;C!==`auto`&&(C=n.pstyle(`corner-radius`).pfValue);var w=t.width||t.cachedW,T=t.height||t.cachedH;(w==null||T==null)&&(document.body.appendChild(t),w=t.cachedW=t.width||t.offsetWidth,T=t.cachedH=t.height||t.offsetHeight,document.body.removeChild(t));var E=w,D=T;if(d(n,`background-width`,`value`,r)!==`auto`&&(E=d(n,`background-width`,`units`,r)===`%`?d(n,`background-width`,`pfValue`,r)*_:d(n,`background-width`,`pfValue`,r)),d(n,`background-height`,`value`,r)!==`auto`&&(D=d(n,`background-height`,`units`,r)===`%`?d(n,`background-height`,`pfValue`,r)*v:d(n,`background-height`,`pfValue`,r)),E!==0&&D!==0){if(f===`contain`){var O=Math.min(_/E,v/D);E*=O,D*=O}else if(f===`cover`){var O=Math.max(_/E,v/D);E*=O,D*=O}var k=s-_/2,A=d(n,`background-position-x`,`units`,r),j=d(n,`background-position-x`,`pfValue`,r);k+=A===`%`?(_-E)*j:j;var M=d(n,`background-offset-x`,`units`,r),N=d(n,`background-offset-x`,`pfValue`,r);k+=M===`%`?(_-E)*N:N;var P=l-v/2,F=d(n,`background-position-y`,`units`,r),I=d(n,`background-position-y`,`pfValue`,r);P+=F===`%`?(v-D)*I:I;var L=d(n,`background-offset-y`,`units`,r),R=d(n,`background-offset-y`,`pfValue`,r);P+=L===`%`?(v-D)*R:R,y.pathCache&&(k-=s,P-=l,s=0,l=0);var ee=e.globalAlpha;e.globalAlpha=x;var z=a.getImgSmoothing(e),B=!1;S===`no`&&z?(a.setImgSmoothing(e,!1),B=!0):S===`yes`&&!z&&(a.setImgSmoothing(e,!0),B=!0),p===`no-repeat`?(b&&(e.save(),y.pathCache?e.clip(y.pathCache):(a.nodeShapes[a.getNodeShape(n)].draw(e,s,l,_,v,C,y),e.clip())),a.safeDrawImage(e,t,0,0,w,T,k,P,E,D),b&&e.restore()):(e.fillStyle=e.createPattern(t,p),a.nodeShapes[a.getNodeShape(n)].draw(e,s,l,_,v,C,y),e.translate(k,P),e.fill(),e.translate(-k,-P)),e.globalAlpha=ee,B&&a.setImgSmoothing(e,z)}},VF={},VF.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio();t=2**Math.ceil(SA(n*r))}return!(e.pstyle(`font-size`).pfValue*t<e.pstyle(`min-zoomed-font-size`).pfValue)},VF.drawElementText=function(e,t,n,r,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this;if(r==null){if(a&&!o.eleTextBiggerThanMin(t))return}else if(r===!1)return;if(t.isNode()){var s=t.pstyle(`label`);if(!s||!s.value)return;var l=o.getLabelJustification(t),u=t.pstyle(`text-metrics`).strValue===`glyph`;e.textAlign=l,e.textBaseline=u?`alphabetic`:`bottom`}else{var d=t.element()._private.rscratch.badLine,f=t.pstyle(`label`),p=t.pstyle(`source-label`),m=t.pstyle(`target-label`);if(d||(!f||!f.value)&&(!p||!p.value)&&(!m||!m.value))return;e.textAlign=`center`,e.textBaseline=`bottom`}var h=!n,g;n&&(g=n,e.translate(-g.x1,-g.y1)),i==null?(o.drawText(e,t,null,h,a),t.isEdge()&&(o.drawText(e,t,`source`,h,a),o.drawText(e,t,`target`,h,a))):o.drawText(e,t,i,h,a),n&&e.translate(g.x1,g.y1)},VF.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if(t=this.fontCaches[n],t.context===e)return t;return t={context:e},this.fontCaches.push(t),t},VF.setupTextStyle=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=t.pstyle(`font-style`).strValue,i=t.pstyle(`font-size`).pfValue+`px`,a=t.pstyle(`font-family`).strValue,o=t.pstyle(`font-weight`).strValue,s=n?t.effectiveOpacity()*t.pstyle(`text-opacity`).value:1,l=t.pstyle(`text-outline-opacity`).value*s,u=t.pstyle(`color`).value,d=t.pstyle(`text-outline-color`).value;e.font=r+` `+o+` `+i+` `+a,e.lineJoin=`round`,this.colorFillStyle(e,u[0],u[1],u[2],s),this.colorStrokeStyle(e,d[0],d[1],d[2],l)},VF.getTextAngle=function(e,t){var n,r=e._private.rscratch,i=t?t+`-`:``,a=e.pstyle(i+`text-rotation`);if(a.strValue===`autorotate`){var o=rA(r,`labelAngle`,t);n=e.isEdge()?o:0}else n=a.strValue===`none`?0:a.pfValue;return n},VF.drawText=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=t._private.rscratch,o=i?t.effectiveOpacity():1;if(!(i&&(o===0||t.pstyle(`text-opacity`).value===0))){n===`main`&&(n=null);var s=rA(a,`labelX`,n),l=rA(a,`labelY`,n),u,d,f=this.getLabelText(t,n);if(f!=null&&f!==``&&!isNaN(s)&&!isNaN(l)){this.setupTextStyle(e,t,i);var p=n?n+`-`:``,m=rA(a,`labelWidth`,n),h=rA(a,`labelHeight`,n),g=rA(a,`labelActualDescent`,n),_=t.pstyle(p+`text-margin-x`).pfValue,v=t.pstyle(p+`text-margin-y`).pfValue,y=t.isEdge(),b=t.pstyle(`text-halign`).value,x=t.pstyle(`text-valign`).value;y&&(b=`center`,x=`center`),s+=_,l+=v;var S=r?this.getTextAngle(t,n):0;S!==0&&(u=s,d=l,e.translate(u,d),e.rotate(S),s=0,l=0);var C=uN(b),w=dN(x);switch(w){case`top`:break;case`center`:l+=h/2;break;case`bottom`:l+=h}var T=t.pstyle(`text-background-opacity`).value,E=t.pstyle(`text-border-opacity`).value,D=t.pstyle(`text-border-width`).pfValue,O=t.pstyle(`text-background-padding`).pfValue,k=t.pstyle(`text-background-shape`).strValue,A=k===`round-rectangle`||k===`roundrectangle`,j=k===`circle`,M=2;if(T>0||D>0&&E>0){var N=e.fillStyle,P=e.strokeStyle,F=e.lineWidth,I=t.pstyle(`text-background-color`).value,L=t.pstyle(`text-border-color`).value,R=t.pstyle(`text-border-style`).value,ee=T>0,z=D>0&&E>0,B=s-O;switch(C){case`left`:B-=m;break;case`center`:B-=m/2}var te=l-h-O,ne=m+2*O,re=h+2*O;if(ee&&(e.fillStyle=`rgba(${I[0]},${I[1]},${I[2]},${T*o})`),z&&(e.strokeStyle=`rgba(${L[0]},${L[1]},${L[2]},${E*o})`,e.lineWidth=D,e.setLineDash))switch(R){case`dotted`:e.setLineDash([1,1]);break;case`dashed`:e.setLineDash([4,2]);break;case`double`:e.lineWidth=D/4,e.setLineDash([]);break;default:e.setLineDash([])}if(A?(e.beginPath(),CD(e,B,te,ne,re,M)):j?(e.beginPath(),oIe(e,B,te,ne,re)):(e.beginPath(),e.rect(B,te,ne,re)),ee&&e.fill(),z&&e.stroke(),z&&R===`double`){var ie=D/2;e.beginPath(),A?CD(e,B+ie,te+ie,ne-2*ie,re-2*ie,M):e.rect(B+ie,te+ie,ne-2*ie,re-2*ie),e.stroke()}e.fillStyle=N,e.strokeStyle=P,e.lineWidth=F,e.setLineDash&&e.setLineDash([])}var ae=2*t.pstyle(`text-outline-width`).pfValue;if(ae>0&&(e.lineWidth=ae),l-=g,t.pstyle(`text-wrap`).value===`wrap`){var oe=rA(a,`labelWrapCachedLines`,n),se=rA(a,`labelLineHeight`,n),ce=m/2,le=this.getLabelJustification(t);switch(le===`auto`||(C===`left`?le===`left`?s+=-m:le===`center`&&(s+=-ce):C===`center`?le===`left`?s+=-ce:le===`right`&&(s+=ce):C===`right`&&(le===`center`?s+=ce:le===`right`&&(s+=m))),w){case`top`:l-=(oe.length-1)*se;break;case`center`:case`bottom`:l-=(oe.length-1)*se}for(var ue=0;ue<oe.length;ue++)ae>0&&e.strokeText(oe[ue],s,l),e.fillText(oe[ue],s,l),l+=se}else ae>0&&e.strokeText(f,s,l),e.fillText(f,s,l);S!==0&&(e.rotate(-S),e.translate(-u,-d))}}},HF={},HF.drawNode=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s,l,u=t._private,d=u.rscratch,f=t.position();if(!(!rO(f.x)||!rO(f.y))&&!(a&&!t.visible())){var p=a?t.effectiveOpacity():1,m=o.usePaths(),h,g=!1,_=t.padding();s=t.width()+2*_,l=t.height()+2*_;var v;n&&(v=n,e.translate(-v.x1,-v.y1));for(var y=t.pstyle(`background-image`).value,b=Array(y.length),x=Array(y.length),S=0,C=0;C<y.length;C++){var w=y[C];if(b[C]=w!=null&&w!==`none`){var T=t.cy().style().getIndexedStyle(t,`background-image-crossorigin`,`value`,C);S++,x[C]=o.getCachedImage(w,T,function(){u.backgroundTimestamp=Date.now(),t.emitAndNotify(`background`)})}}var E=t.pstyle(`background-blacken`).value,D=t.pstyle(`border-width`).pfValue,O=t.pstyle(`background-opacity`).value*p,k=t.pstyle(`border-color`).value,A=t.pstyle(`border-style`).value,j=t.pstyle(`border-join`).value,M=t.pstyle(`border-cap`).value,N=t.pstyle(`border-position`).value,P=t.pstyle(`border-dash-pattern`).pfValue,F=t.pstyle(`border-dash-offset`).pfValue,I=t.pstyle(`border-opacity`).value*p,L=t.pstyle(`outline-width`).pfValue,R=t.pstyle(`outline-color`).value,ee=t.pstyle(`outline-style`).value,z=t.pstyle(`outline-opacity`).value*p,B=t.pstyle(`outline-offset`).value,te=t.pstyle(`corner-radius`).value;te!==`auto`&&(te=t.pstyle(`corner-radius`).pfValue);var ne=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:O;o.eleFillStyle(e,t,n)},re=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I;o.colorStrokeStyle(e,k[0],k[1],k[2],t)},ie=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:z;o.colorStrokeStyle(e,R[0],R[1],R[2],t)},ae=function(e,t,n,r){var i=o.nodePathCache=o.nodePathCache||[],a=Nk(n===`polygon`?n+`,`+r.join(`,`):n,``+t,``+e,``+te),s=i[a],l,u=!1;return s==null?(l=new Path2D,i[a]=d.pathCache=l):(l=s,u=!0,d.pathCache=l),{path:l,cacheHit:u}},oe=t.pstyle(`shape`).strValue,se=t.pstyle(`shape-polygon-points`).pfValue;if(m){e.translate(f.x,f.y);var ce=ae(s,l,oe,se);h=ce.path,g=ce.cacheHit}var le=function(){if(!g){var n=f;m&&(n={x:0,y:0}),o.nodeShapes[o.getNodeShape(t)].draw(h||e,n.x,n.y,s,l,te,d)}m?e.fill(h):e.fill()},ue=function(){for(var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=u.backgrounding,a=0,s=0;s<x.length;s++){var l=t.cy().style().getIndexedStyle(t,`background-image-containment`,`value`,s);if(r&&l===`over`||!r&&l===`inside`){a++;continue}b[s]&&x[s].complete&&!x[s].error&&(a++,o.drawInscribedImage(e,x[s],t,s,n))}u.backgrounding=a!==S,i!==u.backgrounding&&t.updateStyle(!1)},de=function(){var n=arguments.length>0&&arguments[0]!==void 0&&arguments[0],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p;o.hasPie(t)&&(o.drawPie(e,t,r),n&&(m||o.nodeShapes[o.getNodeShape(t)].draw(e,f.x,f.y,s,l,te,d)))},fe=function(){var n=arguments.length>0&&arguments[0]!==void 0&&arguments[0],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p;o.hasStripe(t)&&(e.save(),m?e.clip(d.pathCache):(o.nodeShapes[o.getNodeShape(t)].draw(e,f.x,f.y,s,l,te,d),e.clip()),o.drawStripe(e,t,r),e.restore(),n&&(m||o.nodeShapes[o.getNodeShape(t)].draw(e,f.x,f.y,s,l,te,d)))},pe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p,n=(E>0?E:-E)*t,r=E>0?0:255;E!==0&&(o.colorFillStyle(e,r,r,r,n),m?e.fill(h):e.fill())},me=function(){if(D>0){if(e.lineWidth=D,e.lineCap=M,e.lineJoin=j,e.setLineDash)switch(A){case`dotted`:e.setLineDash([1,1]);break;case`dashed`:e.setLineDash(P),e.lineDashOffset=F;break;case`solid`:case`double`:e.setLineDash([])}if(N!==`center`){if(e.save(),e.lineWidth*=2,N===`inside`)m?e.clip(h):e.clip();else{var t=new Path2D;t.rect(-s/2-D,-l/2-D,s+2*D,l+2*D),t.addPath(h),e.clip(t,`evenodd`)}m?e.stroke(h):e.stroke(),e.restore()}else m?e.stroke(h):e.stroke();if(A===`double`){e.lineWidth=D/3;var n=e.globalCompositeOperation;e.globalCompositeOperation=`destination-out`,m?e.stroke(h):e.stroke(),e.globalCompositeOperation=n}e.setLineDash&&e.setLineDash([])}},he=function(){if(L>0){if(e.lineWidth=L,e.lineCap=`butt`,e.setLineDash)switch(ee){case`dotted`:e.setLineDash([1,1]);break;case`dashed`:e.setLineDash([4,2]);break;case`solid`:case`double`:e.setLineDash([])}var n=f;m&&(n={x:0,y:0});var r=o.getNodeShape(t),i=D;N===`inside`&&(i=0),N===`outside`&&(i*=2);var a=(s+i+(L+B))/s,u=(l+i+(L+B))/l,d=s*a,p=l*u,h=o.nodeShapes[r].points,g;if(m&&(g=ae(d,p,r,h).path),r===`ellipse`)o.drawEllipsePath(g||e,n.x,n.y,d,p);else if([`round-diamond`,`round-heptagon`,`round-hexagon`,`round-octagon`,`round-pentagon`,`round-polygon`,`round-triangle`,`round-tag`].includes(r)){var _=0,v=0,y=0;r===`round-diamond`?_=(i+B+L)*1.4:r===`round-heptagon`?(_=(i+B+L)*1.075,y=-(i/2+B+L)/35):r===`round-hexagon`?_=(i+B+L)*1.12:r===`round-pentagon`?(_=(i+B+L)*1.13,y=-(i/2+B+L)/15):r===`round-tag`?(_=(i+B+L)*1.12,v=(i/2+L+B)*.07):r===`round-triangle`&&(_=(i+B+L)*(Math.PI/2),y=-(i+B/2+L)/Math.PI),_!==0&&(a=(s+_)/s,d=s*a,[`round-hexagon`,`round-tag`].includes(r)||(u=(l+_)/l,p=l*u)),te=te===`auto`?$A(d,p):te;for(var b=d/2,x=p/2,S=te+(i+L+B)/2,C=Array(h.length/2),w=Array(h.length/2),T=0;T<h.length/2;T++)C[T]={x:n.x+v+b*h[T*2],y:n.y+y+x*h[T*2+1]};var E,O,k,A,j=C.length;for(O=C[j-1],E=0;E<j;E++)k=C[E%j],A=C[(E+1)%j],w[E]=bD(O,k,A,S),O=k,k=A;o.drawRoundPolygonPath(g||e,n.x+v,n.y+y,s*a,l*u,h,w)}else if([`roundrectangle`,`round-rectangle`].includes(r))te=te===`auto`?QA(d,p):te,o.drawRoundRectanglePath(g||e,n.x,n.y,d,p,te+(i+L+B)/2);else if([`cutrectangle`,`cut-rectangle`].includes(r))te=te===`auto`?ej():te,o.drawCutRectanglePath(g||e,n.x,n.y,d,p,null,te+(i+L+B)/4);else if([`bottomroundrectangle`,`bottom-round-rectangle`].includes(r))te=te===`auto`?QA(d,p):te,o.drawBottomRoundRectanglePath(g||e,n.x,n.y,d,p,te+(i+L+B)/2);else if(r===`barrel`)o.drawBarrelPath(g||e,n.x,n.y,d,p);else if(r.startsWith(`polygon`)||[`rhomboid`,`right-rhomboid`,`round-tag`,`tag`,`vee`].includes(r)){var M=(i+L+B)/s;h=VA(HA(h,M)),o.drawPolygonPath(g||e,n.x,n.y,s,l,h)}else{var P=(i+L+B)/s;h=VA(HA(h,-P)),o.drawPolygonPath(g||e,n.x,n.y,s,l,h)}if(m?e.stroke(g):e.stroke(),ee===`double`){e.lineWidth=i/3;var F=e.globalCompositeOperation;e.globalCompositeOperation=`destination-out`,m?e.stroke(g):e.stroke(),e.globalCompositeOperation=F}e.setLineDash&&e.setLineDash([])}},ge=function(){i&&o.drawNodeOverlay(e,t,f,s,l)},_e=function(){i&&o.drawNodeUnderlay(e,t,f,s,l)},ve=function(){o.drawElementText(e,t,null,r)};if(t.pstyle(`ghost`).value===`yes`){var ye=t.pstyle(`ghost-offset-x`).pfValue,be=t.pstyle(`ghost-offset-y`).pfValue,xe=t.pstyle(`ghost-opacity`).value,Se=xe*p;e.translate(ye,be),ie(),he(),ne(xe*O),le(),ue(Se,!0),re(xe*I),me(),de(E!==0||D!==0),fe(E!==0||D!==0),ue(Se,!1),pe(Se),e.translate(-ye,-be)}m&&e.translate(-f.x,-f.y),_e(),m&&e.translate(f.x,f.y),ie(),he(),ne(),le(),ue(p,!0),re(),me(),de(E!==0||D!==0),fe(E!==0||D!==0),ue(p,!1),pe(),m&&e.translate(-f.x,-f.y),ve(),ge(),n&&e.translate(v.x1,v.y1)}},UF=function(e){if(![`overlay`,`underlay`].includes(e))throw Error(`Invalid state`);return function(t,n,r,i,a){var o=this;if(n.visible()){var s=n.pstyle(`${e}-padding`).pfValue,l=n.pstyle(`${e}-opacity`).value,u=n.pstyle(`${e}-color`).value,d=n.pstyle(`${e}-shape`).value,f=n.pstyle(`${e}-corner-radius`).value;if(l>0){if(r||=n.position(),i==null||a==null){var p=n.padding();i=n.width()+2*p,a=n.height()+2*p}o.colorFillStyle(t,u[0],u[1],u[2],l),o.nodeShapes[d].draw(t,r.x,r.y,i+s*2,a+s*2,f),t.fill()}}}},HF.drawNodeOverlay=UF(`overlay`),HF.drawNodeUnderlay=UF(`underlay`),HF.hasPie=function(e){return e=e[0],e._private.hasPie},HF.hasStripe=function(e){return e=e[0],e._private.hasStripe},HF.drawPie=function(e,t,n,r){t=t[0],r||=t.position();var i=t.cy().style(),a=t.pstyle(`pie-size`),o=t.pstyle(`pie-hole`),s=t.pstyle(`pie-start-angle`).pfValue,l=r.x,u=r.y,d=t.width(),f=t.height(),p=Math.min(d,f)/2,m,h=0;if(this.usePaths()&&(l=0,u=0),a.units===`%`?p*=a.pfValue:a.pfValue!==void 0&&(p=a.pfValue/2),o.units===`%`?m=p*o.pfValue:o.pfValue!==void 0&&(m=o.pfValue/2),!(m>=p))for(var g=1;g<=i.pieBackgroundN;g++){var _=t.pstyle(`pie-`+g+`-background-size`).value,v=t.pstyle(`pie-`+g+`-background-color`).value,y=t.pstyle(`pie-`+g+`-background-opacity`).value*n,b=_/100;b+h>1&&(b=1-h);var x=1.5*Math.PI+2*Math.PI*h;x+=s;var S=2*Math.PI*b,C=x+S;_===0||h>=1||h+b>1||(m===0?(e.beginPath(),e.moveTo(l,u),e.arc(l,u,p,x,C),e.closePath()):(e.beginPath(),e.arc(l,u,p,x,C),e.arc(l,u,m,C,x,!0),e.closePath()),this.colorFillStyle(e,v[0],v[1],v[2],y),e.fill(),h+=b)}},HF.drawStripe=function(e,t,n,r){t=t[0],r||=t.position();var i=t.cy().style(),a=r.x,o=r.y,s=t.width(),l=t.height(),u=0,d=this.usePaths();e.save();var f=t.pstyle(`stripe-direction`).value,p=t.pstyle(`stripe-size`);switch(f){case`vertical`:break;case`righward`:e.rotate(-Math.PI/2)}var m=s,h=l;p.units===`%`?(m*=p.pfValue,h*=p.pfValue):p.pfValue!==void 0&&(m=p.pfValue,h=p.pfValue),d&&(a=0,o=0),o-=m/2,a-=h/2;for(var g=1;g<=i.stripeBackgroundN;g++){var _=t.pstyle(`stripe-`+g+`-background-size`).value,v=t.pstyle(`stripe-`+g+`-background-color`).value,y=t.pstyle(`stripe-`+g+`-background-opacity`).value*n,b=_/100;b+u>1&&(b=1-u),!(_===0||u>=1||u+b>1)&&(e.beginPath(),e.rect(a,o+h*u,m,h*b),e.closePath(),this.colorFillStyle(e,v[0],v[1],v[2],y),e.fill(),u+=b)}e.restore()},WF={},pVe=100,WF.getPixelRatio=function(){var e=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var t=this.cy.window(),n=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/n},WF.paintCache=function(e){for(var t=this.paintCaches=this.paintCaches||[],n=!0,r,i=0;i<t.length;i++)if(r=t[i],r.context===e){n=!1;break}return n&&(r={context:e},t.push(r)),r},WF.createGradientStyleFor=function(e,t,n,r,i){var a,o=this.usePaths(),s=n.pstyle(t+`-gradient-stop-colors`).value,l=n.pstyle(t+`-gradient-stop-positions`).pfValue;if(r===`radial-gradient`){if(n.isEdge()){var u=n.sourceEndpoint(),d=n.targetEndpoint(),f=n.midpoint(),p=wA(u,f),m=wA(d,f);a=e.createRadialGradient(f.x,f.y,0,f.x,f.y,Math.max(p,m))}else{var h=o?{x:0,y:0}:n.position(),g=n.paddedWidth(),_=n.paddedHeight();a=e.createRadialGradient(h.x,h.y,0,h.x,h.y,Math.max(g,_))}}else if(n.isEdge()){var v=n.sourceEndpoint(),y=n.targetEndpoint();a=e.createLinearGradient(v.x,v.y,y.x,y.y)}else{var b=o?{x:0,y:0}:n.position(),x=n.paddedWidth(),S=n.paddedHeight(),C=x/2,w=S/2;switch(n.pstyle(`background-gradient-direction`).value){case`to-bottom`:a=e.createLinearGradient(b.x,b.y-w,b.x,b.y+w);break;case`to-top`:a=e.createLinearGradient(b.x,b.y+w,b.x,b.y-w);break;case`to-left`:a=e.createLinearGradient(b.x+C,b.y,b.x-C,b.y);break;case`to-right`:a=e.createLinearGradient(b.x-C,b.y,b.x+C,b.y);break;case`to-bottom-right`:case`to-right-bottom`:a=e.createLinearGradient(b.x-C,b.y-w,b.x+C,b.y+w);break;case`to-top-right`:case`to-right-top`:a=e.createLinearGradient(b.x-C,b.y+w,b.x+C,b.y-w);break;case`to-bottom-left`:case`to-left-bottom`:a=e.createLinearGradient(b.x+C,b.y-w,b.x-C,b.y+w);break;case`to-top-left`:case`to-left-top`:a=e.createLinearGradient(b.x+C,b.y+w,b.x-C,b.y-w)}}if(!a)return null;for(var T=l.length===s.length,E=s.length,D=0;D<E;D++)a.addColorStop(T?l[D]:D/(E-1),`rgba(`+s[D][0]+`,`+s[D][1]+`,`+s[D][2]+`,`+i+`)`);return a},WF.gradientFillStyle=function(e,t,n,r){var i=this.createGradientStyleFor(e,`background`,t,n,r);if(!i)return null;e.fillStyle=i},WF.colorFillStyle=function(e,t,n,r,i){e.fillStyle=`rgba(`+t+`,`+n+`,`+r+`,`+i+`)`},WF.eleFillStyle=function(e,t,n){var r=t.pstyle(`background-fill`).value;if(r===`linear-gradient`||r===`radial-gradient`)this.gradientFillStyle(e,t,r,n);else{var i=t.pstyle(`background-color`).value;this.colorFillStyle(e,i[0],i[1],i[2],n)}},WF.gradientStrokeStyle=function(e,t,n,r){var i=this.createGradientStyleFor(e,`line`,t,n,r);if(!i)return null;e.strokeStyle=i},WF.colorStrokeStyle=function(e,t,n,r,i){e.strokeStyle=`rgba(`+t+`,`+n+`,`+r+`,`+i+`)`},WF.eleStrokeStyle=function(e,t,n){var r=t.pstyle(`line-fill`).value;if(r===`linear-gradient`||r===`radial-gradient`)this.gradientStrokeStyle(e,t,r,n);else{var i=t.pstyle(`line-color`).value;this.colorStrokeStyle(e,i[0],i[1],i[2],n)}},WF.matchCanvasSize=function(e){var t=this,n=t.data,r=t.findContainerClientCoords(),i=r[2],a=r[3],o=t.getPixelRatio(),s=t.motionBlurPxRatio;(e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE]||e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG])&&(o=s);var l=i*o,u=a*o,d;if(l!==t.canvasWidth||u!==t.canvasHeight){t.fontCaches=null;var f=n.canvasContainer;f.style.width=i+`px`,f.style.height=a+`px`;for(var p=0;p<t.CANVAS_LAYERS;p++)d=n.canvases[p],d.width=l,d.height=u,d.style.width=i+`px`,d.style.height=a+`px`;for(var p=0;p<t.BUFFER_COUNT;p++)d=n.bufferCanvases[p],d.width=l,d.height=u,d.style.width=i+`px`,d.style.height=a+`px`;t.textureMult=1,o<=1&&(d=n.bufferCanvases[t.TEXTURE_BUFFER],t.textureMult=2,d.width=l*t.textureMult,d.height=u*t.textureMult),t.canvasWidth=l,t.canvasHeight=u,t.pixelRatio=o}},WF.renderTo=function(e,t,n,r){this.render({forcedContext:e,forcedZoom:t,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})},WF.clearCanvas=function(){var e=this,t=e.data;function n(t){t.clearRect(0,0,e.canvasWidth,e.canvasHeight)}n(t.contexts[e.NODE]),n(t.contexts[e.DRAG])},WF.render=function(e){var t=this;e||=Qk();var n=t.cy,r=e.forcedContext,i=e.drawAllLayers,a=e.drawOnlyNodeLayer,o=e.forcedZoom,s=e.forcedPan,l=e.forcedPxRatio===void 0?this.getPixelRatio():e.forcedPxRatio,u=t.data,d=u.canvasNeedsRedraw,f=t.textureOnViewport&&!r&&(t.pinching||t.hoverData.dragging||t.swipePanning||t.data.wheelZooming),p=e.motionBlur===void 0?t.motionBlur:e.motionBlur,m=t.motionBlurPxRatio,h=n.hasCompoundNodes(),g=t.hoverData.draggingEles,_=!!(t.hoverData.selecting||t.touchData.selecting);p=p&&!r&&t.motionBlurEnabled&&!_;var v=p;r||(t.prevPxRatio!==l&&(t.invalidateContainerClientCoordsCache(),t.matchCanvasSize(t.container),t.redrawHint(`eles`,!0),t.redrawHint(`drag`,!0)),t.prevPxRatio=l),!r&&t.motionBlurTimeout&&clearTimeout(t.motionBlurTimeout),p&&(t.mbFrames??=0,t.mbFrames++,t.mbFrames<3&&(v=!1),t.mbFrames>t.minMbLowQualFrames&&(t.motionBlurPxRatio=t.mbPxRBlurry)),t.clearingMotionBlur&&(t.motionBlurPxRatio=1),t.textureDrawLastFrame&&!f&&(d[t.NODE]=!0,d[t.SELECT_BOX]=!0);var y=n.style(),b=n.zoom(),x=o===void 0?b:o,S=n.pan(),C={x:S.x,y:S.y},w={zoom:b,pan:{x:S.x,y:S.y}},T=t.prevViewport;T!==void 0&&w.zoom===T.zoom&&w.pan.x===T.pan.x&&w.pan.y===T.pan.y&&!(g&&!h)&&(t.motionBlurPxRatio=1),s&&(C=s),x*=l,C.x*=l,C.y*=l;var E=t.getCachedZSortedEles();function D(e,n,r,i,a){var o=e.globalCompositeOperation;e.globalCompositeOperation=`destination-out`,t.colorFillStyle(e,255,255,255,t.motionBlurTransparency),e.fillRect(n,r,i,a),e.globalCompositeOperation=o}function O(e,n){var a,l,d,f;!t.clearingMotionBlur&&(e===u.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]||e===u.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG])?(a={x:S.x*m,y:S.y*m},l=b*m,d=t.canvasWidth*m,f=t.canvasHeight*m):(a=C,l=x,d=t.canvasWidth,f=t.canvasHeight),e.setTransform(1,0,0,1,0,0),n===`motionBlur`?D(e,0,0,d,f):!r&&(n===void 0||n)&&e.clearRect(0,0,d,f),i||(e.translate(a.x,a.y),e.scale(l,l)),s&&e.translate(s.x,s.y),o&&e.scale(o,o)}if(f||(t.textureDrawLastFrame=!1),f){if(t.textureDrawLastFrame=!0,!t.textureCache){t.textureCache={},t.textureCache.bb=n.mutableElements().boundingBox(),t.textureCache.texture=t.data.bufferCanvases[t.TEXTURE_BUFFER];var k=t.data.bufferContexts[t.TEXTURE_BUFFER];k.setTransform(1,0,0,1,0,0),k.clearRect(0,0,t.canvasWidth*t.textureMult,t.canvasHeight*t.textureMult),t.render({forcedContext:k,drawOnlyNodeLayer:!0,forcedPxRatio:l*t.textureMult});var w=t.textureCache.viewport={zoom:n.zoom(),pan:n.pan(),width:t.canvasWidth,height:t.canvasHeight};w.mpan={x:(0-w.pan.x)/w.zoom,y:(0-w.pan.y)/w.zoom}}d[t.DRAG]=!1,d[t.NODE]=!1;var A=u.contexts[t.NODE],j=t.textureCache.texture,w=t.textureCache.viewport;A.setTransform(1,0,0,1,0,0),p?D(A,0,0,w.width,w.height):A.clearRect(0,0,w.width,w.height);var M=y.core(`outside-texture-bg-color`).value,N=y.core(`outside-texture-bg-opacity`).value;t.colorFillStyle(A,M[0],M[1],M[2],N),A.fillRect(0,0,w.width,w.height);var b=n.zoom();O(A,!1),A.clearRect(w.mpan.x,w.mpan.y,w.width/w.zoom/l,w.height/w.zoom/l),A.drawImage(j,w.mpan.x,w.mpan.y,w.width/w.zoom/l,w.height/w.zoom/l)}else t.textureOnViewport&&!r&&(t.textureCache=null);var P=n.extent(),F=t.pinching||t.hoverData.dragging||t.swipePanning||t.data.wheelZooming||t.hoverData.draggingEles||t.cy.animated(),I=t.hideEdgesOnViewport&&F,L=[];if(L[t.NODE]=!d[t.NODE]&&p&&!t.clearedForMotionBlur[t.NODE]||t.clearingMotionBlur,L[t.NODE]&&(t.clearedForMotionBlur[t.NODE]=!0),L[t.DRAG]=!d[t.DRAG]&&p&&!t.clearedForMotionBlur[t.DRAG]||t.clearingMotionBlur,L[t.DRAG]&&(t.clearedForMotionBlur[t.DRAG]=!0),d[t.NODE]||i||a||L[t.NODE]){var R=p&&!L[t.NODE]&&m!==1,A=r||(R?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]:u.contexts[t.NODE]);O(A,p&&!R?`motionBlur`:void 0),I?t.drawCachedNodes(A,E.nondrag,l,P):t.drawLayeredElements(A,E.nondrag,l,P),t.debug&&t.drawDebugPoints(A,E.nondrag),!i&&!p&&(d[t.NODE]=!1)}if(!a&&(d[t.DRAG]||i||L[t.DRAG])){var R=p&&!L[t.DRAG]&&m!==1,A=r||(R?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG]:u.contexts[t.DRAG]);O(A,p&&!R?`motionBlur`:void 0),I?t.drawCachedNodes(A,E.drag,l,P):t.drawCachedElements(A,E.drag,l,P),t.debug&&t.drawDebugPoints(A,E.drag),!i&&!p&&(d[t.DRAG]=!1)}if(this.drawSelectionRectangle(e,O),p&&m!==1){var ee=u.contexts[t.NODE],z=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE],B=u.contexts[t.DRAG],te=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG],ne=function(e,n,r){e.setTransform(1,0,0,1,0,0),r||!v?e.clearRect(0,0,t.canvasWidth,t.canvasHeight):D(e,0,0,t.canvasWidth,t.canvasHeight);var i=m;e.drawImage(n,0,0,t.canvasWidth*i,t.canvasHeight*i,0,0,t.canvasWidth,t.canvasHeight)};(d[t.NODE]||L[t.NODE])&&(ne(ee,z,L[t.NODE]),d[t.NODE]=!1),(d[t.DRAG]||L[t.DRAG])&&(ne(B,te,L[t.DRAG]),d[t.DRAG]=!1)}t.prevViewport=w,t.clearingMotionBlur&&(t.clearingMotionBlur=!1,t.motionBlurCleared=!0,t.motionBlur=!0),p&&(t.motionBlurTimeout=setTimeout(function(){t.motionBlurTimeout=null,t.clearedForMotionBlur[t.NODE]=!1,t.clearedForMotionBlur[t.DRAG]=!1,t.motionBlur=!1,t.clearingMotionBlur=!f,t.mbFrames=0,d[t.NODE]=!0,d[t.DRAG]=!0,t.redraw()},pVe)),r||n.emit(`render`)},WF.drawSelectionRectangle=function(e,t){var n=this,r=n.cy,i=n.data,a=r.style(),o=e.drawOnlyNodeLayer,s=e.drawAllLayers,l=i.canvasNeedsRedraw,u=e.forcedContext;if(n.showFps||!o&&l[n.SELECT_BOX]&&!s){var d=u||i.contexts[n.SELECT_BOX];if(t(d),n.selection[4]==1&&(n.hoverData.selecting||n.touchData.selecting)){var f=n.cy.zoom(),p=a.core(`selection-box-border-width`).value/f;d.lineWidth=p,d.fillStyle=`rgba(`+a.core(`selection-box-color`).value[0]+`,`+a.core(`selection-box-color`).value[1]+`,`+a.core(`selection-box-color`).value[2]+`,`+a.core(`selection-box-opacity`).value+`)`,d.fillRect(n.selection[0],n.selection[1],n.selection[2]-n.selection[0],n.selection[3]-n.selection[1]),p>0&&(d.strokeStyle=`rgba(`+a.core(`selection-box-border-color`).value[0]+`,`+a.core(`selection-box-border-color`).value[1]+`,`+a.core(`selection-box-border-color`).value[2]+`,`+a.core(`selection-box-opacity`).value+`)`,d.strokeRect(n.selection[0],n.selection[1],n.selection[2]-n.selection[0],n.selection[3]-n.selection[1]))}if(i.bgActivePosistion&&!n.hoverData.selecting){var f=n.cy.zoom(),m=i.bgActivePosistion;d.fillStyle=`rgba(`+a.core(`active-bg-color`).value[0]+`,`+a.core(`active-bg-color`).value[1]+`,`+a.core(`active-bg-color`).value[2]+`,`+a.core(`active-bg-opacity`).value+`)`,d.beginPath(),d.arc(m.x,m.y,a.core(`active-bg-size`).pfValue/f,0,2*Math.PI),d.fill()}var h=n.lastRedrawTime;if(n.showFps&&h){h=Math.round(h);var g=Math.round(1e3/h),_=`1 frame = `+h+` ms = `+g+` fps`;d.setTransform(1,0,0,1,0,0),d.fillStyle=`rgba(255, 0, 0, 0.75)`,d.strokeStyle=`rgba(255, 0, 0, 0.75)`,d.font=`30px Arial`,GF||=d.measureText(_).actualBoundingBoxAscent,d.fillText(_,0,GF),d.strokeRect(0,GF+10,250,20),d.fillRect(0,GF+10,250*Math.min(g/60,1),20)}s||(l[n.SELECT_BOX]=!1)}},KF=typeof Float32Array<`u`?Float32Array:Array,Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)}),mVe=function(){function e(t,n,r,i){mE(this,e),this.debugID=Math.floor(Math.random()*1e4),this.r=t,this.texSize=n,this.texRows=r,this.texHeight=Math.floor(n/r),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=i(t,n,n),this.scratch=i(t,n,this.texHeight,`scratch`)}return hE(e,[{key:`lock`,value:function(){this.locked=!0}},{key:`getKeys`,value:function(){return new Set(this.keyToLocation.keys())}},{key:`getScale`,value:function(e){var t=e.w,n=e.h,r=this.texHeight,i=this.texSize,a=r/n,o=t*a,s=n*a;return o>i&&(a=i/t,o=t*a,s=n*a),{scale:a,texW:o,texH:s}}},{key:`draw`,value:function(e,t,n){var r=this;if(this.locked)throw Error(`can't draw, atlas is locked`);var i=this.texSize,a=this.texRows,o=this.texHeight,s=this.getScale(t),l=s.scale,u=s.texW,d=s.texH,f=function(e,r){if(n&&r){var i=r.context,a=e.x,s=e.row,u=a,d=o*s;i.save(),i.translate(u,d),i.scale(l,l),n(i,t),i.restore()}},p=[null,null],m=function(){f(r.freePointer,r.canvas),p[0]={x:r.freePointer.x,y:r.freePointer.row*o,w:u,h:d},p[1]={x:r.freePointer.x+u,y:r.freePointer.row*o,w:0,h:d},r.freePointer.x+=u,r.freePointer.x==i&&(r.freePointer.x=0,r.freePointer.row++)},h=function(){var e=r.scratch,t=r.canvas;e.clear(),f({x:0,row:0},e);var n=i-r.freePointer.x,a=u-n,s=o,l=r.freePointer.x,m=r.freePointer.row*o,h=n;t.context.drawImage(e,0,0,h,s,l,m,h,s),p[0]={x:l,y:m,w:h,h:d};var g=n,_=(r.freePointer.row+1)*o,v=a;t&&t.context.drawImage(e,g,0,v,s,0,_,v,s),p[1]={x:0,y:_,w:v,h:d},r.freePointer.x=a,r.freePointer.row++},g=function(){r.freePointer.x=0,r.freePointer.row++};if(this.freePointer.x+u<=i)m();else if(this.freePointer.row>=a-1)return!1;else this.freePointer.x===i?(g(),m()):this.enableWrapping?h():(g(),m());return this.keyToLocation.set(e,p),this.needsBuffer=!0,p}},{key:`getOffsets`,value:function(e){return this.keyToLocation.get(e)}},{key:`isEmpty`,value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:`canFit`,value:function(e){if(this.locked)return!1;var t=this.texSize,n=this.texRows,r=this.getScale(e).texW;return this.freePointer.x+r>t?this.freePointer.row<n-1:!0}},{key:`bufferIfNeeded`,value:function(e){this.texture||=mIe(e,this.debugID),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))}},{key:`dispose`,value:function(){this.texture&&=(this.texture.deleteTexture(),null),this.canvas=null,this.scratch=null,this.locked=!0}}])}(),hVe=function(){function e(t,n,r,i){mE(this,e),this.r=t,this.texSize=n,this.texRows=r,this.createTextureCanvas=i,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return hE(e,[{key:`getKeys`,value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:`_createAtlas`,value:function(){var e=this.r,t=this.texSize,n=this.texRows,r=this.createTextureCanvas;return new mVe(e,t,n,r)}},{key:`_getScratchCanvas`,value:function(){if(!this.scratch){var e=this.r,t=this.texSize,n=this.texRows,r=this.createTextureCanvas,i=Math.floor(t/n);this.scratch=r(e,t,i,`scratch`)}return this.scratch}},{key:`draw`,value:function(e,t,n){var r=this.styleKeyToAtlas.get(e);return r||(r=this.atlases[this.atlases.length-1],(!r||!r.canFit(t))&&(r&&r.lock(),r=this._createAtlas(),this.atlases.push(r)),r.draw(e,t,n),this.styleKeyToAtlas.set(e,r)),r}},{key:`getAtlas`,value:function(e){return this.styleKeyToAtlas.get(e)}},{key:`hasAtlas`,value:function(e){return this.styleKeyToAtlas.has(e)}},{key:`markKeyForGC`,value:function(e){this.markedKeys.add(e)}},{key:`gc`,value:function(){var e=this,t=this.markedKeys;if(t.size===0){console.log(`nothing to garbage collect`);return}var n=[],r=new Map,i=null,a=gE(this.atlases),o;try{var s=function(){var a=o.value,s=a.getKeys(),l=xIe(t,s);if(l.size===0)return n.push(a),s.forEach(function(e){return r.set(e,a)}),1;i||(i=e._createAtlas(),n.push(i));var u=gE(s),d;try{for(u.s();!(d=u.n()).done;){var f=d.value;if(!l.has(f)){var p=_E(a.getOffsets(f),2),m=p[0],h=p[1];i.canFit({w:m.w+h.w,h:m.h})||(i.lock(),i=e._createAtlas(),n.push(i)),a.canvas&&(e._copyTextureToNewAtlas(f,a,i),r.set(f,i))}}}catch(e){u.e(e)}finally{u.f()}a.dispose()};for(a.s();!(o=a.n()).done;)if(s())continue}catch(e){a.e(e)}finally{a.f()}this.atlases=n,this.styleKeyToAtlas=r,this.markedKeys=new Set}},{key:`_copyTextureToNewAtlas`,value:function(e,t,n){var r=_E(t.getOffsets(e),2),i=r[0],a=r[1];if(a.w===0)n.draw(e,i,function(e){e.drawImage(t.canvas,i.x,i.y,i.w,i.h,0,0,i.w,i.h)});else{var o=this._getScratchCanvas();o.clear(),o.context.drawImage(t.canvas,i.x,i.y,i.w,i.h,0,0,i.w,i.h),o.context.drawImage(t.canvas,a.x,a.y,a.w,a.h,i.w,0,a.w,a.h);var s=i.w+a.w,l=i.h;n.draw(e,{w:s,h:l},function(e){e.drawImage(o,0,0,s,l,0,0,s,l)})}}},{key:`getCounts`,value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])}(),gVe=function(){function e(t,n){mE(this,e),this.r=t,this.globalOptions=n,this.atlasSize=n.webglTexSize,this.maxAtlasesPerBatch=n.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map}return hE(e,[{key:`getAtlasSize`,value:function(){return this.atlasSize}},{key:`addAtlasCollection`,value:function(e,t){var n=this.globalOptions,r=n.webglTexSize,i=n.createTextureCanvas,a=t.texRows,o=this._cacheScratchCanvas(i),s=new hVe(this.r,r,a,o);this.collections.set(e,s)}},{key:`addRenderType`,value:function(e,t){var n=t.collection;if(!this.collections.has(n))throw Error(`invalid atlas collection name '${n}'`);var r=MO({type:e,atlasCollection:this.collections.get(n)},t);this.renderTypes.set(e,r)}},{key:`getRenderTypeOpts`,value:function(e){return this.renderTypes.get(e)}},{key:`getAtlasCollection`,value:function(e){return this.collections.get(e)}},{key:`_cacheScratchCanvas`,value:function(e){var t=-1,n=-1,r=null;return function(i,a,o,s){return s?((!r||a!=t||o!=n)&&(t=a,n=o,r=e(i,a,o)),r):e(i,a,o)}}},{key:`_key`,value:function(e,t){return`${e}-${t}`}},{key:`invalidate`,value:function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.forceRedraw,i=r!==void 0&&r,a=n.filterEle,o=a===void 0?function(){return!0}:a,s=n.filterType,l=s===void 0?function(){return!0}:s,u=!1,d=!1,f=gE(e),p;try{for(f.s();!(p=f.n()).done;){var m=p.value;if(o(m)){var h=gE(this.renderTypes.values()),g;try{var _=function(){var e=g.value,n=e.type;if(l(n)){var r=t.collections.get(e.collection),a=e.getKey(m),o=Array.isArray(a)?a:[a];if(i)o.forEach(function(e){return r.markKeyForGC(e)}),d=!0;else{var s=e.getID?e.getID(m):m.id(),f=t._key(n,s),p=t.typeAndIdToKey.get(f);p!==void 0&&!fIe(o,p)&&(u=!0,t.typeAndIdToKey.delete(f),p.forEach(function(e){return r.markKeyForGC(e)}))}}};for(h.s();!(g=h.n()).done;)_()}catch(e){h.e(e)}finally{h.f()}}}}catch(e){f.e(e)}finally{f.f()}return d&&(this.gc(),u=!1),u}},{key:`gc`,value:function(){var e=gE(this.collections.values()),t;try{for(e.s();!(t=e.n()).done;)t.value.gc()}catch(t){e.e(t)}finally{e.f()}}},{key:`getOrCreateAtlas`,value:function(e,t,n,r){var i=this.renderTypes.get(t),a=this.collections.get(i.collection),o=!1,s=a.draw(r,n,function(t){i.drawClipped?(t.save(),t.beginPath(),t.rect(0,0,n.w,n.h),t.clip(),i.drawElement(t,e,n,!0,!0),t.restore()):i.drawElement(t,e,n,!0,!0),o=!0});if(o){var l=i.getID?i.getID(e):e.id(),u=this._key(t,l);this.typeAndIdToKey.has(u)?this.typeAndIdToKey.get(u).push(r):this.typeAndIdToKey.set(u,[r])}return s}},{key:`getAtlasInfo`,value:function(e,t){var n=this,r=this.renderTypes.get(t),i=r.getKey(e);return(Array.isArray(i)?i:[i]).map(function(i){var a=r.getBoundingBox(e,i),o=n.getOrCreateAtlas(e,t,a,i),s=_E(o.getOffsets(i),2),l=s[0];return{atlas:o,tex:l,tex1:l,tex2:s[1],bb:a}})}},{key:`getDebugInfo`,value:function(){var e=[],t=gE(this.collections),n;try{for(t.s();!(n=t.n()).done;){var r=_E(n.value,2),i=r[0],a=r[1].getCounts(),o=a.keyCount,s=a.atlasCount;e.push({type:i,keyCount:o,atlasCount:s})}}catch(e){t.e(e)}finally{t.f()}return e}}])}(),_Ve=function(){function e(t){mE(this,e),this.globalOptions=t,this.atlasSize=t.webglTexSize,this.maxAtlasesPerBatch=t.webglTexPerBatch,this.batchAtlases=[]}return hE(e,[{key:`getMaxAtlasesPerBatch`,value:function(){return this.maxAtlasesPerBatch}},{key:`getAtlasSize`,value:function(){return this.atlasSize}},{key:`getIndexArray`,value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(e,t){return t})}},{key:`startBatch`,value:function(){this.batchAtlases=[]}},{key:`getAtlasCount`,value:function(){return this.batchAtlases.length}},{key:`getAtlases`,value:function(){return this.batchAtlases}},{key:`canAddToCurrentBatch`,value:function(e){return this.batchAtlases.length!==this.maxAtlasesPerBatch||this.batchAtlases.includes(e)}},{key:`getAtlasIndexForBatch`,value:function(e){var t=this.batchAtlases.indexOf(e);if(t<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw Error(`cannot add more atlases to batch`);this.batchAtlases.push(e),t=this.batchAtlases.length-1}return t}}])}(),vVe=`568+ float circleSD(vec2 p, float r) {569+ return distance(vec2(0), p) - r; // signed distance570+ }571+`,yVe=`572+ float rectangleSD(vec2 p, vec2 b) {573+ vec2 d = abs(p)-b;574+ return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);575+ }576+`,bVe=`577+ float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {578+ cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;579+ cr.x = (p.y > 0.0) ? cr.x : cr.y;580+ vec2 q = abs(p) - b + cr.x;581+ return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;582+ }583+`,xVe=`584+ float ellipseSD(vec2 p, vec2 ab) {585+ p = abs( p ); // symmetry586+587+ // find root with Newton solver588+ vec2 q = ab*(p-ab);589+ float w = (q.x<q.y)? 1.570796327 : 0.0;590+ for( int i=0; i<5; i++ ) {591+ vec2 cs = vec2(cos(w),sin(w));592+ vec2 u = ab*vec2( cs.x,cs.y);593+ vec2 v = ab*vec2(-cs.y,cs.x);594+ w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));595+ }596+ 597+ // compute final point and distance598+ float d = length(p-ab*vec2(cos(w),sin(w)));599+ 600+ // return signed distance601+ return (dot(p/ab,p/ab)>1.0) ? d : -d;602+ }603+`,qF={SCREEN:{name:`screen`,screen:!0},PICKING:{name:`picking`,picking:!0}},JF={IGNORE:1,USE_BB:2},YF=0,XF=1,ZF=2,QF=3,$F=4,eI=5,tI=6,nI=7,SVe=function(){function e(t,n,r){mE(this,e),this.r=t,this.gl=n,this.maxInstances=r.webglBatchSize,this.atlasSize=r.webglTexSize,this.bgColor=r.bgColor,this.debug=r.webglDebug,this.batchDebugInfo=[],r.enableWrapping=!0,r.createTextureCanvas=cIe,this.atlasManager=new gVe(t,r),this.batchManager=new _Ve(r),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(qF.SCREEN),this.pickingProgram=this._createShaderProgram(qF.PICKING),this.vao=this._createVAO()}return hE(e,[{key:`addAtlasCollection`,value:function(e,t){this.atlasManager.addAtlasCollection(e,t)}},{key:`addTextureAtlasRenderType`,value:function(e,t){this.atlasManager.addRenderType(e,t)}},{key:`addSimpleShapeRenderType`,value:function(e,t){this.simpleShapeOptions.set(e,t)}},{key:`invalidate`,value:function(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).type,n=this.atlasManager;return t?n.invalidate(e,{filterType:function(e){return e===t},forceRedraw:!0}):n.invalidate(e)}},{key:`gc`,value:function(){this.atlasManager.gc()}},{key:`_createShaderProgram`,value:function(e){var t=this.gl,n=`#version 300 es604+ precision highp float;605+606+ uniform mat3 uPanZoomMatrix;607+ uniform int uAtlasSize;608+ 609+ // instanced610+ in vec2 aPosition; // a vertex from the unit square611+ 612+ in mat3 aTransform; // used to transform verticies, eg into a bounding box613+ in int aVertType; // the type of thing we are rendering614+615+ // the z-index that is output when using picking mode616+ in vec4 aIndex;617+ 618+ // For textures619+ in int aAtlasId; // which shader unit/atlas to use620+ in vec4 aTex; // x/y/w/h of texture in atlas621+622+ // for edges623+ in vec4 aPointAPointB;624+ in vec4 aPointCPointD;625+ in vec2 aLineWidth; // also used for node border width626+627+ // simple shapes628+ in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]629+ in vec4 aColor; // also used for edges630+ in vec4 aBorderColor; // aLineWidth is used for border width631+632+ // output values passed to the fragment shader633+ out vec2 vTexCoord;634+ out vec4 vColor;635+ out vec2 vPosition;636+ // flat values are not interpolated637+ flat out int vAtlasId; 638+ flat out int vVertType;639+ flat out vec2 vTopRight;640+ flat out vec2 vBotLeft;641+ flat out vec4 vCornerRadius;642+ flat out vec4 vBorderColor;643+ flat out vec2 vBorderWidth;644+ flat out vec4 vIndex;645+ 646+ void main(void) {647+ int vid = gl_VertexID;648+ vec2 position = aPosition; // TODO make this a vec3, simplifies some code below649+650+ if(aVertType == ${YF}) {651+ float texX = aTex.x; // texture coordinates652+ float texY = aTex.y;653+ float texW = aTex.z;654+ float texH = aTex.w;655+656+ if(vid == 1 || vid == 2 || vid == 4) {657+ texX += texW;658+ }659+ if(vid == 2 || vid == 4 || vid == 5) {660+ texY += texH;661+ }662+663+ float d = float(uAtlasSize);664+ vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1665+666+ gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);667+ }668+ else if(aVertType == ${$F} || aVertType == ${nI} 669+ || aVertType == ${eI} || aVertType == ${tI}) { // simple shapes670+671+ // the bounding box is needed by the fragment shader672+ vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat673+ vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat674+ vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated675+676+ // calculations are done in the fragment shader, just pass these along677+ vColor = aColor;678+ vCornerRadius = aCornerRadius;679+ vBorderColor = aBorderColor;680+ vBorderWidth = aLineWidth;681+682+ gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);683+ }684+ else if(aVertType == ${XF}) {685+ vec2 source = aPointAPointB.xy;686+ vec2 target = aPointAPointB.zw;687+688+ // adjust the geometry so that the line is centered on the edge689+ position.y = position.y - 0.5;690+691+ // stretch the unit square into a long skinny rectangle692+ vec2 xBasis = target - source;693+ vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));694+ vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;695+696+ gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);697+ vColor = aColor;698+ } 699+ else if(aVertType == ${ZF}) {700+ vec2 pointA = aPointAPointB.xy;701+ vec2 pointB = aPointAPointB.zw;702+ vec2 pointC = aPointCPointD.xy;703+ vec2 pointD = aPointCPointD.zw;704+705+ // adjust the geometry so that the line is centered on the edge706+ position.y = position.y - 0.5;707+708+ vec2 p0, p1, p2, pos;709+ if(position.x == 0.0) { // The left side of the unit square710+ p0 = pointA;711+ p1 = pointB;712+ p2 = pointC;713+ pos = position;714+ } else { // The right side of the unit square, use same approach but flip the geometry upside down715+ p0 = pointD;716+ p1 = pointC;717+ p2 = pointB;718+ pos = vec2(0.0, -position.y);719+ }720+721+ vec2 p01 = p1 - p0;722+ vec2 p12 = p2 - p1;723+ vec2 p21 = p1 - p2;724+725+ // Find the normal vector.726+ vec2 tangent = normalize(normalize(p12) + normalize(p01));727+ vec2 normal = vec2(-tangent.y, tangent.x);728+729+ // Find the vector perpendicular to p0 -> p1.730+ vec2 p01Norm = normalize(vec2(-p01.y, p01.x));731+732+ // Determine the bend direction.733+ float sigma = sign(dot(p01 + p21, normal));734+ float width = aLineWidth[0];735+736+ if(sign(pos.y) == -sigma) {737+ // This is an intersecting vertex. Adjust the position so that there's no overlap.738+ vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);739+ gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);740+ } else {741+ // This is a non-intersecting vertex. Treat it like a mitre join.742+ vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);743+ gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);744+ }745+746+ vColor = aColor;747+ } 748+ else if(aVertType == ${QF} && vid < 3) {749+ // massage the first triangle into an edge arrow750+ if(vid == 0)751+ position = vec2(-0.15, -0.3);752+ if(vid == 1)753+ position = vec2( 0.0, 0.0);754+ if(vid == 2)755+ position = vec2( 0.15, -0.3);756+757+ gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);758+ vColor = aColor;759+ }760+ else {761+ gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space762+ }763+764+ vAtlasId = aAtlasId;765+ vVertType = aVertType;766+ vIndex = aIndex;767+ }768+ `,r=this.batchManager.getIndexArray(),i=sIe(t,n,`#version 300 es769+ precision highp float;770+771+ // declare texture unit for each texture atlas in the batch772+ ${r.map(function(e){return`uniform sampler2D uTexture${e};`}).join(`773+ `)}774+775+ uniform vec4 uBGColor;776+ uniform float uZoom;777+778+ in vec2 vTexCoord;779+ in vec4 vColor;780+ in vec2 vPosition; // model coordinates781+782+ flat in int vAtlasId;783+ flat in vec4 vIndex;784+ flat in int vVertType;785+ flat in vec2 vTopRight;786+ flat in vec2 vBotLeft;787+ flat in vec4 vCornerRadius;788+ flat in vec4 vBorderColor;789+ flat in vec2 vBorderWidth;790+791+ out vec4 outColor;792+793+ ${vVe}794+ ${yVe}795+ ${bVe}796+ ${xVe}797+798+ vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha799+ return vec4( 800+ top.rgb + (bot.rgb * (1.0 - top.a)),801+ top.a + (bot.a * (1.0 - top.a)) 802+ );803+ }804+805+ vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance806+ // scale to the zoom level so that borders don't look blurry when zoomed in807+ // note 1.5 is an aribitrary value chosen because it looks good808+ return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); 809+ }810+811+ void main(void) {812+ if(vVertType == ${YF}) {813+ // look up the texel from the texture unit814+ ${r.map(function(e){return`if(vAtlasId == ${e}) outColor = texture(uTexture${e}, vTexCoord);`}).join(`815+ else `)}816+ } 817+ else if(vVertType == ${QF}) {818+ // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';819+ outColor = blend(vColor, uBGColor);820+ outColor.a = 1.0; // make opaque, masks out line under arrow821+ }822+ else if(vVertType == ${$F} && vBorderWidth == vec2(0.0)) { // simple rectangle with no border823+ outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done824+ }825+ else if(vVertType == ${$F} || vVertType == ${nI} 826+ || vVertType == ${eI} || vVertType == ${tI}) { // use SDF827+828+ float outerBorder = vBorderWidth[0];829+ float innerBorder = vBorderWidth[1];830+ float borderPadding = outerBorder * 2.0;831+ float w = vTopRight.x - vBotLeft.x - borderPadding;832+ float h = vTopRight.y - vBotLeft.y - borderPadding;833+ vec2 b = vec2(w/2.0, h/2.0); // half width, half height834+ vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center835+836+ float d; // signed distance837+ if(vVertType == ${$F}) {838+ d = rectangleSD(p, b);839+ } else if(vVertType == ${nI} && w == h) {840+ d = circleSD(p, b.x); // faster than ellipse841+ } else if(vVertType == ${nI}) {842+ d = ellipseSD(p, b);843+ } else {844+ d = roundRectangleSD(p, b, vCornerRadius.wzyx);845+ }846+847+ // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling848+ // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box849+ if(d > 0.0) {850+ if(d > outerBorder) {851+ discard;852+ } else {853+ outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);854+ }855+ } else {856+ if(d > innerBorder) {857+ vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;858+ vec4 innerBorderColor = blend(vBorderColor, vColor);859+ outColor = distInterp(innerBorderColor, outerColor, d);860+ } 861+ else {862+ vec4 outerColor;863+ if(innerBorder == 0.0 && outerBorder == 0.0) {864+ outerColor = vec4(0);865+ } else if(innerBorder == 0.0) {866+ outerColor = vBorderColor;867+ } else {868+ outerColor = blend(vBorderColor, vColor);869+ }870+ outColor = distInterp(vColor, outerColor, d - innerBorder);871+ }872+ }873+ }874+ else {875+ outColor = vColor;876+ }877+878+ ${e.picking?`if(outColor.a == 0.0) discard;879+ else outColor = vIndex;`:``}880+ }881+ `);i.aPosition=t.getAttribLocation(i,`aPosition`),i.aIndex=t.getAttribLocation(i,`aIndex`),i.aVertType=t.getAttribLocation(i,`aVertType`),i.aTransform=t.getAttribLocation(i,`aTransform`),i.aAtlasId=t.getAttribLocation(i,`aAtlasId`),i.aTex=t.getAttribLocation(i,`aTex`),i.aPointAPointB=t.getAttribLocation(i,`aPointAPointB`),i.aPointCPointD=t.getAttribLocation(i,`aPointCPointD`),i.aLineWidth=t.getAttribLocation(i,`aLineWidth`),i.aColor=t.getAttribLocation(i,`aColor`),i.aCornerRadius=t.getAttribLocation(i,`aCornerRadius`),i.aBorderColor=t.getAttribLocation(i,`aBorderColor`),i.uPanZoomMatrix=t.getUniformLocation(i,`uPanZoomMatrix`),i.uAtlasSize=t.getUniformLocation(i,`uAtlasSize`),i.uBGColor=t.getUniformLocation(i,`uBGColor`),i.uZoom=t.getUniformLocation(i,`uZoom`),i.uTextures=[];for(var a=0;a<this.batchManager.getMaxAtlasesPerBatch();a++)i.uTextures.push(t.getUniformLocation(i,`uTexture${a}`));return i}},{key:`_createVAO`,value:function(){var e=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=e.length/2;var t=this.maxInstances,n=this.gl,r=this.program,i=n.createVertexArray();return n.bindVertexArray(i),gIe(n,`vec2`,r.aPosition,e),this.transformBuffer=_Ie(n,t,r.aTransform),this.indexBuffer=AD(n,t,`vec4`,r.aIndex),this.vertTypeBuffer=AD(n,t,`int`,r.aVertType),this.atlasIdBuffer=AD(n,t,`int`,r.aAtlasId),this.texBuffer=AD(n,t,`vec4`,r.aTex),this.pointAPointBBuffer=AD(n,t,`vec4`,r.aPointAPointB),this.pointCPointDBuffer=AD(n,t,`vec4`,r.aPointCPointD),this.lineWidthBuffer=AD(n,t,`vec2`,r.aLineWidth),this.colorBuffer=AD(n,t,`vec4`,r.aColor),this.cornerRadiusBuffer=AD(n,t,`vec4`,r.aCornerRadius),this.borderColorBuffer=AD(n,t,`vec4`,r.aBorderColor),n.bindVertexArray(null),i}},{key:`buffers`,get:function(){var e=this;return this._buffers||=Object.keys(this).filter(function(e){return SO(e,`Buffer`)}).map(function(t){return e[t]}),this._buffers}},{key:`startFrame`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:qF.SCREEN;this.panZoomMatrix=e,this.renderTarget=t,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:`startBatch`,value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:`endFrame`,value:function(){this.endBatch()}},{key:`_isVisible`,value:function(e,t){return e.visible()?t&&t.isVisible?t.isVisible(e):!0:!1}},{key:`drawTexture`,value:function(e,t,n){var r=this.atlasManager,i=this.batchManager,a=r.getRenderTypeOpts(n);if(this._isVisible(e,a)&&!(e.isEdge()&&!this._isValidEdge(e))){if(this.renderTarget.picking&&a.getTexPickingMode){var o=a.getTexPickingMode(e);if(o===JF.IGNORE)return;if(o==JF.USE_BB){this.drawPickingRectangle(e,t,n);return}}var s=gE(r.getAtlasInfo(e,n)),l;try{for(s.s();!(l=s.n()).done;){var u=l.value,d=u.atlas,f=u.tex1,p=u.tex2;i.canAddToCurrentBatch(d)||this.endBatch();for(var m=i.getAtlasIndexForBatch(d),h=0,g=[[f,!0],[p,!1]];h<g.length;h++){var _=_E(g[h],2),v=_[0],y=_[1];if(v.w!=0){var b=this.instanceCount;this.vertTypeBuffer.getView(b)[0]=YF,DD(t,this.indexBuffer.getView(b));var x=this.atlasIdBuffer.getView(b);x[0]=m;var S=this.texBuffer.getView(b);S[0]=v.x,S[1]=v.y,S[2]=v.w,S[3]=v.h;var C=this.transformBuffer.getMatrixView(b);this.setTransformMatrix(e,C,a,u,y),this.instanceCount++,y||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(e){s.e(e)}finally{s.f()}}}},{key:`setTransformMatrix`,value:function(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=0;if(n.shapeProps&&n.shapeProps.padding&&(a=e.pstyle(n.shapeProps.padding).pfValue),r){var o=r.bb,s=r.tex1,l=r.tex2,u=s.w/(s.w+l.w);i||(u=1-u);var d=this._getAdjustedBB(o,a,i,u);this._applyTransformMatrix(t,d,n,e)}else{var f=n.getBoundingBox(e),p=this._getAdjustedBB(f,a,!0,1);this._applyTransformMatrix(t,p,n,e)}}},{key:`_applyTransformMatrix`,value:function(e,t,n,r){var i,a;MD(e);var o=n.getRotation?n.getRotation(r):0;if(o!==0){var s=n.getRotationPoint(r),l=s.x,u=s.y;ND(e,e,[l,u]),PD(e,e,o);var d=n.getRotationOffset(r);i=d.x+(t.xOffset||0),a=d.y+(t.yOffset||0)}else i=t.x1,a=t.y1;ND(e,e,[i,a]),FD(e,e,[t.w,t.h])}},{key:`_getAdjustedBB`,value:function(e,t,n,r){var i=e.x1,a=e.y1,o=e.w,s=e.h,l=e.yOffset;t&&(i-=t,a-=t,o+=2*t,s+=2*t);var u=0,d=o*r;return n&&r<1?o=d:!n&&r<1&&(u=o-d,i+=u,o=d),{x1:i,y1:a,w:o,h:s,xOffset:u,yOffset:l}}},{key:`drawPickingRectangle`,value:function(e,t,n){var r=this.atlasManager.getRenderTypeOpts(n),i=this.instanceCount;this.vertTypeBuffer.getView(i)[0]=$F,DD(t,this.indexBuffer.getView(i)),ED([0,0,0],1,this.colorBuffer.getView(i));var a=this.transformBuffer.getMatrixView(i);this.setTransformMatrix(e,a,r),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:`drawNode`,value:function(e,t,n){var r=this.simpleShapeOptions.get(n);if(this._isVisible(e,r)){var i=r.shapeProps,a=this._getVertTypeForShape(e,i.shape);if(a===void 0||r.isSimple&&!r.isSimple(e,this.renderTarget)){this.drawTexture(e,t,n);return}var o=this.instanceCount;if(this.vertTypeBuffer.getView(o)[0]=a,a===eI||a===tI){var s=r.getBoundingBox(e),l=this._getCornerRadius(e,i.radius,s),u=this.cornerRadiusBuffer.getView(o);u[0]=l,u[1]=l,u[2]=l,u[3]=l,a===tI&&(u[0]=0,u[2]=0)}DD(t,this.indexBuffer.getView(o));var d=this.renderTarget.picking?1:n===`node-body`?e.effectiveOpacity():1,f=this.renderTarget.picking?1:e.pstyle(i.opacity).value*d,p=e.pstyle(i.color).value;ED(p,f,this.colorBuffer.getView(o));var m=this.lineWidthBuffer.getView(o);if(m[0]=0,m[1]=0,i.border){var h=e.pstyle(`border-width`).value;if(h>0){var g=e.pstyle(`border-color`).value;ED(g,d*e.pstyle(`border-opacity`).value,this.borderColorBuffer.getView(o));var _=e.pstyle(`border-position`).value;if(_===`inside`)m[0]=0,m[1]=-h;else if(_===`outside`)m[0]=h,m[1]=0;else{var v=h/2;m[0]=v,m[1]=-v}}}var y=this.transformBuffer.getMatrixView(o);this.setTransformMatrix(e,y,r),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:`_getVertTypeForShape`,value:function(e,t){switch(e.pstyle(t).value){case`rectangle`:return $F;case`ellipse`:return nI;case`roundrectangle`:case`round-rectangle`:return eI;case`bottom-round-rectangle`:return tI;default:return}}},{key:`_getCornerRadius`,value:function(e,t,n){var r=n.w,i=n.h;if(e.pstyle(t).value===`auto`)return QA(r,i);var a=e.pstyle(t).pfValue,o=r/2,s=i/2;return Math.min(a,s,o)}},{key:`drawEdgeArrow`,value:function(e,t,n){if(e.visible()){var r=e._private.rscratch,i,a,o;if(n===`source`?(i=r.arrowStartX,a=r.arrowStartY,o=r.srcArrowAngle):(i=r.arrowEndX,a=r.arrowEndY,o=r.tgtArrowAngle),!(isNaN(i)||i==null||isNaN(a)||a==null||isNaN(o)||o==null)&&e.pstyle(n+`-arrow-shape`).value!==`none`){var s=e.pstyle(n+`-arrow-color`).value,l=e.pstyle(`opacity`).value*e.pstyle(`line-opacity`).value,u=e.pstyle(`width`).pfValue,d=e.pstyle(`arrow-scale`).value,f=this.r.getArrowWidth(u,d),p=this.instanceCount,m=this.transformBuffer.getMatrixView(p);MD(m),ND(m,m,[i,a]),FD(m,m,[f,f]),PD(m,m,o),this.vertTypeBuffer.getView(p)[0]=QF,DD(t,this.indexBuffer.getView(p)),ED(s,l,this.colorBuffer.getView(p)),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}},{key:`drawEdgeLine`,value:function(e,t){if(e.visible()){var n=this._getEdgePoints(e);if(n){var r=e.pstyle(`opacity`).value,i=e.pstyle(`line-opacity`).value,a=e.pstyle(`width`).pfValue,o=e.pstyle(`line-color`).value,s=r*i;if(n.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),n.length==4){var l=this.instanceCount;this.vertTypeBuffer.getView(l)[0]=XF,DD(t,this.indexBuffer.getView(l)),ED(o,s,this.colorBuffer.getView(l));var u=this.lineWidthBuffer.getView(l);u[0]=a;var d=this.pointAPointBBuffer.getView(l);d[0]=n[0],d[1]=n[1],d[2]=n[2],d[3]=n[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var f=0;f<n.length-2;f+=2){var p=this.instanceCount;this.vertTypeBuffer.getView(p)[0]=ZF,DD(t,this.indexBuffer.getView(p)),ED(o,s,this.colorBuffer.getView(p));var m=this.lineWidthBuffer.getView(p);m[0]=a;var h=n[f-2],g=n[f-1],_=n[f],v=n[f+1],y=n[f+2],b=n[f+3],x=n[f+4],S=n[f+5];f==0&&(h=2*_-y+.001,g=2*v-b+.001),f==n.length-4&&(x=2*y-_+.001,S=2*b-v+.001);var C=this.pointAPointBBuffer.getView(p);C[0]=h,C[1]=g,C[2]=_,C[3]=v;var w=this.pointCPointDBuffer.getView(p);w[0]=y,w[1]=b,w[2]=x,w[3]=S,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:`_isValidEdge`,value:function(e){var t=e._private.rscratch;return!(t.badLine||t.allpts==null||isNaN(t.allpts[0]))}},{key:`_getEdgePoints`,value:function(e){var t=e._private.rscratch;if(this._isValidEdge(e)){var n=t.allpts;if(n.length==4)return n;var r=this._getNumSegments(e);return this._getCurveSegmentPoints(n,r)}}},{key:`_getNumSegments`,value:function(e){return Math.min(15,this.maxInstances)}},{key:`_getCurveSegmentPoints`,value:function(e,t){if(e.length==4)return e;for(var n=Array((t+1)*2),r=0;r<=t;r++)if(r==0)n[0]=e[0],n[1]=e[1];else if(r==t)n[r*2]=e[e.length-2],n[r*2+1]=e[e.length-1];else{var i=r/t;this._setCurvePoint(e,i,n,r*2)}return n}},{key:`_setCurvePoint`,value:function(e,t,n,r){if(e.length<=2)n[r]=e[0],n[r+1]=e[1];else{for(var i=Array(e.length-2),a=0;a<i.length;a+=2){var o=(1-t)*e[a]+t*e[a+2],s=(1-t)*e[a+1]+t*e[a+3];i[a]=o,i[a+1]=s}return this._setCurvePoint(i,t,n,r)}}},{key:`endBatch`,value:function(){var e=this.gl,t=this.vao,n=this.vertexCount,r=this.instanceCount;if(r!==0){var i=this.renderTarget.picking?this.pickingProgram:this.program;e.useProgram(i),e.bindVertexArray(t);var a=gE(this.buffers),o;try{for(a.s();!(o=a.n()).done;)o.value.bufferSubData(r)}catch(e){a.e(e)}finally{a.f()}for(var s=this.batchManager.getAtlases(),l=0;l<s.length;l++)s[l].bufferIfNeeded(e);for(var u=0;u<s.length;u++)e.activeTexture(e.TEXTURE0+u),e.bindTexture(e.TEXTURE_2D,s[u].texture),e.uniform1i(i.uTextures[u],u);e.uniform1f(i.uZoom,lIe(this.r)),e.uniformMatrix3fv(i.uPanZoomMatrix,!1,this.panZoomMatrix),e.uniform1i(i.uAtlasSize,this.batchManager.getAtlasSize());var d=ED(this.bgColor,1);e.uniform4fv(i.uBGColor,d),e.drawArraysInstanced(e.TRIANGLES,0,n,r),e.bindVertexArray(null),e.bindTexture(e.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:r,atlasCount:s.length}),this.startBatch()}}},{key:`getDebugInfo`,value:function(){var e=this.atlasManager.getDebugInfo(),t=e.reduce(function(e,t){return e+t.atlasCount},0),n=this.batchDebugInfo,r=n.reduce(function(e,t){return e+t.count},0);return{atlasInfo:e,totalAtlases:t,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:n.length,batchInfo:n,totalInstances:r}}}])}(),rI={},rI.initWebgl=function(e,t){var n=this,r=n.data.contexts[n.WEBGL];e.bgColor=SIe(n),e.webglTexSize=Math.min(e.webglTexSize,r.getParameter(r.MAX_TEXTURE_SIZE)),e.webglTexRows=Math.min(e.webglTexRows,54),e.webglTexRowsNodes=Math.min(e.webglTexRowsNodes,54),e.webglBatchSize=Math.min(e.webglBatchSize,16384),e.webglTexPerBatch=Math.min(e.webglTexPerBatch,r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS)),n.webglDebug=e.webglDebug,n.webglDebugShowAtlases=e.webglDebugShowAtlases,n.pickingFrameBuffer=vIe(r),n.pickingFrameBuffer.needsDraw=!0,n.drawing=new SVe(n,r,e);var i=function(e){return function(t){return n.getTextAngle(t,e)}},a=function(e){return function(t){var n=t.pstyle(e);return n&&n.value}},o=function(e){return function(t){return t.pstyle(`${e}-opacity`).value>0}},s=function(e){return e.pstyle(`text-events`).strValue===`yes`?JF.USE_BB:JF.IGNORE},l=function(e){var t=e.position(),n=t.x,r=t.y,i=e.outerWidth(),a=e.outerHeight();return{w:i,h:a,x1:n-i/2,y1:r-a/2}};n.drawing.addAtlasCollection(`node`,{texRows:e.webglTexRowsNodes}),n.drawing.addAtlasCollection(`label`,{texRows:e.webglTexRows}),n.drawing.addTextureAtlasRenderType(`node-body`,{collection:`node`,getKey:t.getStyleKey,getBoundingBox:t.getElementBox,drawElement:t.drawElement}),n.drawing.addSimpleShapeRenderType(`node-body`,{getBoundingBox:l,isSimple:dIe,shapeProps:{shape:`shape`,color:`background-color`,opacity:`background-opacity`,radius:`corner-radius`,border:!0}}),n.drawing.addSimpleShapeRenderType(`node-overlay`,{getBoundingBox:l,isVisible:o(`overlay`),shapeProps:{shape:`overlay-shape`,color:`overlay-color`,opacity:`overlay-opacity`,padding:`overlay-padding`,radius:`overlay-corner-radius`}}),n.drawing.addSimpleShapeRenderType(`node-underlay`,{getBoundingBox:l,isVisible:o(`underlay`),shapeProps:{shape:`underlay-shape`,color:`underlay-color`,opacity:`underlay-opacity`,padding:`underlay-padding`,radius:`underlay-corner-radius`}}),n.drawing.addTextureAtlasRenderType(`label`,{collection:`label`,getTexPickingMode:s,getKey:iI(t.getLabelKey,null),getBoundingBox:aI(t.getLabelBox,null),drawClipped:!0,drawElement:t.drawLabel,getRotation:i(null),getRotationPoint:t.getLabelRotationPoint,getRotationOffset:t.getLabelRotationOffset,isVisible:a(`label`)}),n.drawing.addTextureAtlasRenderType(`edge-source-label`,{collection:`label`,getTexPickingMode:s,getKey:iI(t.getSourceLabelKey,`source`),getBoundingBox:aI(t.getSourceLabelBox,`source`),drawClipped:!0,drawElement:t.drawSourceLabel,getRotation:i(`source`),getRotationPoint:t.getSourceLabelRotationPoint,getRotationOffset:t.getSourceLabelRotationOffset,isVisible:a(`source-label`)}),n.drawing.addTextureAtlasRenderType(`edge-target-label`,{collection:`label`,getTexPickingMode:s,getKey:iI(t.getTargetLabelKey,`target`),getBoundingBox:aI(t.getTargetLabelBox,`target`),drawClipped:!0,drawElement:t.drawTargetLabel,getRotation:i(`target`),getRotationPoint:t.getTargetLabelRotationPoint,getRotationOffset:t.getTargetLabelRotationOffset,isVisible:a(`target-label`)});var u=gk(function(){console.log(`garbage collect flag set`),n.data.gc=!0},1e4);n.onUpdateEleCalcs(function(e,t){var r=!1;t&&t.length>0&&(r|=n.drawing.invalidate(t)),r&&u()}),CIe(n)},iI=function(e,t){return function(n){var r=e(n),i=ID(n,t);return i.length>1?i.map(function(e,t){return`${r}_${t}`}):r}},aI=function(e,t){return function(n,r){var i=e(n);if(typeof r==`string`){var a=r.indexOf(`_`);if(a>0){var o=Number(r.substring(a+1)),s=ID(n,t),l=i.h/s.length,u=l*o,d=i.y1+u;return{x1:i.x1,w:i.w,y1:d,h:l,yOffset:u}}}return i}},oI={},oI.drawPolygonPath=function(e,t,n,r,i,a){var o=r/2,s=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+o*a[0],n+s*a[1]);for(var l=1;l<a.length/2;l++)e.lineTo(t+o*a[l*2],n+s*a[l*2+1]);e.closePath()},oI.drawRoundPolygonPath=function(e,t,n,r,i,a,o){o.forEach(function(t){return yD(e,t)}),e.closePath()},oI.drawRoundRectanglePath=function(e,t,n,r,i,a){var o=r/2,s=i/2,l=a===`auto`?QA(r,i):Math.min(a,s,o);e.beginPath&&e.beginPath(),e.moveTo(t,n-s),e.arcTo(t+o,n-s,t+o,n,l),e.arcTo(t+o,n+s,t,n+s,l),e.arcTo(t-o,n+s,t-o,n,l),e.arcTo(t-o,n-s,t,n-s,l),e.lineTo(t,n-s),e.closePath()},oI.drawBottomRoundRectanglePath=function(e,t,n,r,i,a){var o=r/2,s=i/2,l=a===`auto`?QA(r,i):a;e.beginPath&&e.beginPath(),e.moveTo(t,n-s),e.lineTo(t+o,n-s),e.lineTo(t+o,n),e.arcTo(t+o,n+s,t,n+s,l),e.arcTo(t-o,n+s,t-o,n,l),e.lineTo(t-o,n-s),e.lineTo(t,n-s),e.closePath()},oI.drawCutRectanglePath=function(e,t,n,r,i,a,o){var s=r/2,l=i/2,u=o===`auto`?ej():o;e.beginPath&&e.beginPath(),e.moveTo(t-s+u,n-l),e.lineTo(t+s-u,n-l),e.lineTo(t+s,n-l+u),e.lineTo(t+s,n+l-u),e.lineTo(t+s-u,n+l),e.lineTo(t-s+u,n+l),e.lineTo(t-s,n+l-u),e.lineTo(t-s,n-l+u),e.closePath()},oI.drawBarrelPath=function(e,t,n,r,i){var a=r/2,o=i/2,s=t-a,l=t+a,u=n-o,d=n+o,f=tj(r,i),p=f.widthOffset,m=f.heightOffset,h=f.ctrlPtOffsetPct*p;e.beginPath&&e.beginPath(),e.moveTo(s,u+m),e.lineTo(s,d-m),e.quadraticCurveTo(s+h,d,s+p,d),e.lineTo(l-p,d),e.quadraticCurveTo(l-h,d,l,d-m),e.lineTo(l,u+m),e.quadraticCurveTo(l-h,u,l-p,u),e.lineTo(s+p,u),e.quadraticCurveTo(s+h,u,s,u+m),e.closePath()},sI=Math.sin(0),cI=Math.cos(0),lI={},uI={},dI=Math.PI/40,fI=0*Math.PI;fI<2*Math.PI;fI+=dI)lI[fI]=Math.sin(fI),uI[fI]=Math.cos(fI);oI.drawEllipsePath=function(e,t,n,r,i){if(e.beginPath&&e.beginPath(),e.ellipse)e.ellipse(t,n,r/2,i/2,0,0,2*Math.PI);else for(var a,o,s=r/2,l=i/2,u=0*Math.PI;u<2*Math.PI;u+=dI)a=t-s*lI[u]*sI+s*uI[u]*cI,o=n+l*uI[u]*sI+l*lI[u]*cI,u===0?e.moveTo(a,o):e.lineTo(a,o);e.closePath()},pI={},pI.createBuffer=function(e,t){var n=document.createElement(`canvas`);return n.width=e,n.height=t,[n,n.getContext(`2d`)]},pI.bufferCanvasImage=function(e){var t=this.cy,n=t.mutableElements().boundingBox(),r=this.findContainerClientCoords(),i=e.full?Math.ceil(n.w):r[2],a=e.full?Math.ceil(n.h):r[3],o=rO(e.maxWidth)||rO(e.maxHeight),s=this.getPixelRatio(),l=1;if(e.scale!==void 0)i*=e.scale,a*=e.scale,l=e.scale;else if(o){var u=1/0,d=1/0;rO(e.maxWidth)&&(u=l*e.maxWidth/i),rO(e.maxHeight)&&(d=l*e.maxHeight/a),l=Math.min(u,d),i*=l,a*=l}o||(i*=s,a*=s,l*=s);var f=document.createElement(`canvas`);f.width=i,f.height=a,f.style.width=i+`px`,f.style.height=a+`px`;var p=f.getContext(`2d`);if(i>0&&a>0){p.clearRect(0,0,i,a),p.globalCompositeOperation=`source-over`;var m=this.getCachedZSortedEles();if(e.full)p.translate(-n.x1*l,-n.y1*l),p.scale(l,l),this.drawElements(p,m),p.scale(1/l,1/l),p.translate(n.x1*l,n.y1*l);else{var h=t.pan(),g={x:h.x*l,y:h.y*l};l*=t.zoom(),p.translate(g.x,g.y),p.scale(l,l),this.drawElements(p,m),p.scale(1/l,1/l),p.translate(-g.x,-g.y)}e.bg&&(p.globalCompositeOperation=`destination-over`,p.fillStyle=e.bg,p.rect(0,0,i,a),p.fill())}return f},pI.png=function(e){return VD(e,this.bufferCanvasImage(e),`image/png`)},pI.jpg=function(e){return VD(e,this.bufferCanvasImage(e),`image/jpeg`)},mI={},mI.nodeShapeImpl=function(e,t,n,r,i,a,o,s){switch(e){case`ellipse`:return this.drawEllipsePath(t,n,r,i,a);case`polygon`:return this.drawPolygonPath(t,n,r,i,a,o);case`round-polygon`:return this.drawRoundPolygonPath(t,n,r,i,a,o,s);case`roundrectangle`:case`round-rectangle`:return this.drawRoundRectanglePath(t,n,r,i,a,s);case`cutrectangle`:case`cut-rectangle`:return this.drawCutRectanglePath(t,n,r,i,a,o,s);case`bottomroundrectangle`:case`bottom-round-rectangle`:return this.drawBottomRoundRectanglePath(t,n,r,i,a,s);case`barrel`:return this.drawBarrelPath(t,n,r,i,a)}},CVe=HD,hI=HD.prototype,hI.CANVAS_LAYERS=3,hI.SELECT_BOX=0,hI.DRAG=1,hI.NODE=2,hI.WEBGL=3,hI.CANVAS_TYPES=[`2d`,`2d`,`2d`,`webgl2`],hI.BUFFER_COUNT=3,hI.TEXTURE_BUFFER=0,hI.MOTIONBLUR_BUFFER_NODE=1,hI.MOTIONBLUR_BUFFER_DRAG=2,hI.redrawHint=function(e,t){var n=this;switch(e){case`eles`:n.data.canvasNeedsRedraw[hI.NODE]=t;break;case`drag`:n.data.canvasNeedsRedraw[hI.DRAG]=t;break;case`select`:n.data.canvasNeedsRedraw[hI.SELECT_BOX]=t;break;case`gc`:n.data.gc=!0}},wVe=typeof Path2D<`u`,hI.path2dEnabled=function(e){if(e===void 0)return this.pathsEnabled;this.pathsEnabled=!!e},hI.usePaths=function(){return wVe&&this.pathsEnabled},hI.setImgSmoothing=function(e,t){e.imageSmoothingEnabled==null?(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t):e.imageSmoothingEnabled=t},hI.getImgSmoothing=function(e){return e.imageSmoothingEnabled==null?e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled:e.imageSmoothingEnabled},hI.makeOffscreenCanvas=function(e,t){var n;return(typeof OffscreenCanvas>`u`?`undefined`:bE(OffscreenCanvas))===`undefined`?(n=this.cy.window().document.createElement(`canvas`),n.width=e,n.height=t):n=new OffscreenCanvas(e,t),n},[FF,IF,RF,BF,VF,HF,WF,rI,oI,pI,mI].forEach(function(e){MO(hI,e)}),TVe=[{type:`layout`,extensions:xBe},{type:`renderer`,extensions:[{name:`null`,impl:vD},{name:`base`,impl:gF},{name:`canvas`,impl:CVe}]}],gI={},_I={},vI=function(){if(arguments.length===2)return WD.apply(null,arguments);if(arguments.length===3)return UD.apply(null,arguments);if(arguments.length===4)return PIe.apply(null,arguments);if(arguments.length===5)return NIe.apply(null,arguments);Wk(`Invalid extension access syntax`)},SP.prototype.extension=vI,TVe.forEach(function(e){e.extensions.forEach(function(t){UD(e.type,t.name,t.impl)})}),yI=function(){if(!(this instanceof yI))return new yI;this.length=0},bI=yI.prototype,bI.instanceString=function(){return`stylesheet`},bI.selector=function(e){var t=this.length++;return this[t]={selector:e,properties:[]},this},bI.css=function(e,t){var n=this.length-1;if(QD(e))this[n].properties.push({name:e,value:t});else if(tO(e))for(var r=e,i=Object.keys(r),a=0;a<i.length;a++){var o=i[a],s=r[o];if(s!=null){var l=vP.properties[o]||vP.properties[yO(o)];if(l!=null){var u=l.name,d=s;this[n].properties.push({name:u,value:d})}}}return this},bI.style=bI.css,bI.generateStyle=function(e){var t=new vP(e);return this.appendToStyle(t)},bI.appendToStyle=function(e){for(var t=0;t<this.length;t++){var n=this[t],r=n.selector,i=n.properties;e.selector(r);for(var a=0;a<i.length;a++){var o=i[a];e.css(o.name,o.value)}}return e},EVe=`3.34.1`,xI=function(e){if(e===void 0&&(e={}),tO(e))return new SP(e);if(QD(e))return vI.apply(vI,arguments)},xI.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(xI),e.apply(null,t),this},xI.warnings=function(e){return Gk(e)},xI.version=EVe,xI.stylesheet=xI.Stylesheet=yI})),OVe=s(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.layoutBase=r():n.layoutBase=r()})(e,function(){return(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=26)})([(function(e,t,n){"use strict";function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,e.exports=r}),(function(e,t,n){"use strict";var r=n(2),i=n(8),a=n(9);function o(e,t,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=e,this.target=t}for(var s in o.prototype=Object.create(r.prototype),r)o[s]=r[s];o.prototype.getSource=function(){return this.source},o.prototype.getTarget=function(){return this.target},o.prototype.isInterGraph=function(){return this.isInterGraph},o.prototype.getLength=function(){return this.length},o.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},o.prototype.getBendpoints=function(){return this.bendpoints},o.prototype.getLca=function(){return this.lca},o.prototype.getSourceInLca=function(){return this.sourceInLca},o.prototype.getTargetInLca=function(){return this.targetInLca},o.prototype.getOtherEnd=function(e){if(this.source===e)return this.target;if(this.target===e)return this.source;throw`Node is not incident with this edge`},o.prototype.getOtherEndInGraph=function(e,t){for(var n=this.getOtherEnd(e),r=t.getGraphManager().getRoot();;){if(n.getOwner()==t)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},o.prototype.updateLength=function(){var e=[,,,,];this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),e),this.isOverlapingSourceAndTarget||(this.lengthX=e[0]-e[2],this.lengthY=e[1]-e[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},o.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},e.exports=o}),(function(e,t,n){"use strict";function r(e){this.vGraphObject=e}e.exports=r}),(function(e,t,n){"use strict";var r=n(2),i=n(10),a=n(13),o=n(0),s=n(16),l=n(4);function u(e,t,n,o){n==null&&o==null&&(o=t),r.call(this,o),e.graphManager!=null&&(e=e.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=o,this.edges=[],this.graphManager=e,this.rect=n!=null&&t!=null?new a(t.x,t.y,n.width,n.height):new a}for(var d in u.prototype=Object.create(r.prototype),r)u[d]=r[d];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(e){this.rect.width=e},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(e){this.rect.height=e},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.prototype.setRect=function(e,t){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=t.width,this.rect.height=t.height},u.prototype.setCenter=function(e,t){this.rect.x=e-this.rect.width/2,this.rect.y=t-this.rect.height/2},u.prototype.setLocation=function(e,t){this.rect.x=e,this.rect.y=t},u.prototype.moveBy=function(e,t){this.rect.x+=e,this.rect.y+=t},u.prototype.getEdgeListToNode=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(r.target==e){if(r.source!=n)throw`Incorrect edge source!`;t.push(r)}}),t},u.prototype.getEdgesBetween=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(r.source!=n&&r.target!=n)throw`Incorrect edge source and/or target`;(r.target==e||r.source==e)&&t.push(r)}),t},u.prototype.getNeighborsList=function(){var e=new Set,t=this;return t.edges.forEach(function(n){if(n.source==t)e.add(n.target);else{if(n.target!=t)throw`Incorrect incidency!`;e.add(n.source)}}),e},u.prototype.withChildren=function(){var e=new Set,t,n;if(e.add(this),this.child!=null)for(var r=this.child.getNodes(),i=0;i<r.length;i++)t=r[i],n=t.withChildren(),n.forEach(function(t){e.add(t)});return e},u.prototype.getNoOfChildren=function(){var e=0,t;if(this.child==null)e=1;else for(var n=this.child.getNodes(),r=0;r<n.length;r++)t=n[r],e+=t.getNoOfChildren();return e==0&&(e=1),e},u.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw`assert failed`;return this.estimatedSize},u.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},u.prototype.scatter=function(){var e,t,n=-o.INITIAL_WORLD_BOUNDARY,r=o.INITIAL_WORLD_BOUNDARY;e=o.WORLD_CENTER_X+s.nextDouble()*(r-n)+n;var i=-o.INITIAL_WORLD_BOUNDARY,a=o.INITIAL_WORLD_BOUNDARY;t=o.WORLD_CENTER_Y+s.nextDouble()*(a-i)+i,this.rect.x=e,this.rect.y=t},u.prototype.updateBounds=function(){if(this.getChild()==null)throw`assert failed`;if(this.getChild().getNodes().length!=0){var e=this.getChild();if(e.updateBounds(!0),this.rect.x=e.getLeft(),this.rect.y=e.getTop(),this.setWidth(e.getRight()-e.getLeft()),this.setHeight(e.getBottom()-e.getTop()),o.NODE_DIMENSIONS_INCLUDE_LABELS){var t=e.getRight()-e.getLeft(),n=e.getBottom()-e.getTop();this.labelWidth>t&&(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)),this.labelHeight>n&&(this.labelPos==`center`?this.rect.y-=(this.labelHeight-n)/2:this.labelPos==`top`&&(this.rect.y-=this.labelHeight-n),this.setHeight(this.labelHeight))}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw`assert failed`;return this.inclusionTreeDepth},u.prototype.transform=function(e){var t=this.rect.x;t>o.WORLD_BOUNDARY?t=o.WORLD_BOUNDARY:t<-o.WORLD_BOUNDARY&&(t=-o.WORLD_BOUNDARY);var n=this.rect.y;n>o.WORLD_BOUNDARY?n=o.WORLD_BOUNDARY:n<-o.WORLD_BOUNDARY&&(n=-o.WORLD_BOUNDARY);var r=new l(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},e.exports=u}),(function(e,t,n){"use strict";function r(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(e){this.x=e},r.prototype.setY=function(e){this.y=e},r.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=r}),(function(e,t,n){"use strict";var r=n(2),i=n(10),a=n(0),o=n(6),s=n(3),l=n(1),u=n(13),d=n(12),f=n(11);function p(e,t,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,t!=null&&t instanceof o?this.graphManager=t:t!=null&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var m in p.prototype=Object.create(r.prototype),r)p[m]=r[m];p.prototype.getNodes=function(){return this.nodes},p.prototype.getEdges=function(){return this.edges},p.prototype.getGraphManager=function(){return this.graphManager},p.prototype.getParent=function(){return this.parent},p.prototype.getLeft=function(){return this.left},p.prototype.getRight=function(){return this.right},p.prototype.getTop=function(){return this.top},p.prototype.getBottom=function(){return this.bottom},p.prototype.isConnected=function(){return this.isConnected},p.prototype.add=function(e,t,n){if(t==null&&n==null){var r=e;if(this.graphManager==null)throw`Graph has no graph mgr!`;if(this.getNodes().indexOf(r)>-1)throw`Node already in graph!`;return r.owner=this,this.getNodes().push(r),r}var i=e;if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw`Source or target not in graph!`;if(t.owner!=n.owner||t.owner!=this)throw`Both owners must be this graph!`;return t.owner==n.owner?(i.source=t,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),t.edges.push(i),n!=t&&n.edges.push(i),i):null},p.prototype.remove=function(e){var t=e;if(e instanceof s){if(t==null)throw`Node is null!`;if(t.owner==null||t.owner!=this)throw`Owner graph is invalid!`;if(this.graphManager==null)throw`Owner graph manager is invalid!`;for(var n=t.edges.slice(),r,i=n.length,a=0;a<i;a++)r=n[a],r.isInterGraph?this.graphManager.remove(r):r.source.owner.remove(r);var o=this.nodes.indexOf(t);if(o==-1)throw`Node not in owner node list!`;this.nodes.splice(o,1)}else if(e instanceof l){var r=e;if(r==null)throw`Edge is null!`;if(r.source==null||r.target==null)throw`Source and/or target is null!`;if(r.source.owner==null||r.target.owner==null||r.source.owner!=this||r.target.owner!=this)throw`Source and/or target owner is invalid!`;var u=r.source.edges.indexOf(r),d=r.target.edges.indexOf(r);if(!(u>-1&&d>-1))throw`Source and/or target doesn't know this edge!`;r.source.edges.splice(u,1),r.target!=r.source&&r.target.edges.splice(d,1);var o=r.source.owner.getEdges().indexOf(r);if(o==-1)throw`Not in owner's edge list!`;r.source.owner.getEdges().splice(o,1)}},p.prototype.updateLeftTop=function(){for(var e=i.MAX_VALUE,t=i.MAX_VALUE,n,r,a,o=this.getNodes(),s=o.length,l=0;l<s;l++){var u=o[l];n=u.getTop(),r=u.getLeft(),e>n&&(e=n),t>r&&(t=r)}return e==i.MAX_VALUE?null:(a=o[0].getParent().paddingLeft==null?this.margin:o[0].getParent().paddingLeft,this.left=t-a,this.top=e-a,new d(this.left,this.top))},p.prototype.updateBounds=function(e){for(var t=i.MAX_VALUE,n=-i.MAX_VALUE,r=i.MAX_VALUE,a=-i.MAX_VALUE,o,s,l,d,f,p=this.nodes,m=p.length,h=0;h<m;h++){var g=p[h];e&&g.child!=null&&g.updateBounds(),o=g.getLeft(),s=g.getRight(),l=g.getTop(),d=g.getBottom(),t>o&&(t=o),n<s&&(n=s),r>l&&(r=l),a<d&&(a=d)}var _=new u(t,r,n-t,a-r);t==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),f=p[0].getParent().paddingLeft==null?this.margin:p[0].getParent().paddingLeft,this.left=_.x-f,this.right=_.x+_.width+f,this.top=_.y-f,this.bottom=_.y+_.height+f},p.calculateBounds=function(e){for(var t=i.MAX_VALUE,n=-i.MAX_VALUE,r=i.MAX_VALUE,a=-i.MAX_VALUE,o,s,l,d,f=e.length,p=0;p<f;p++){var m=e[p];o=m.getLeft(),s=m.getRight(),l=m.getTop(),d=m.getBottom(),t>o&&(t=o),n<s&&(n=s),r>l&&(r=l),a<d&&(a=d)}return new u(t,r,n-t,a-r)},p.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},p.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw`assert failed`;return this.estimatedSize},p.prototype.calcEstimatedSize=function(){for(var e=0,t=this.nodes,n=t.length,r=0;r<n;r++){var i=t[r];e+=i.calcEstimatedSize()}return this.estimatedSize=e==0?a.EMPTY_COMPOUND_NODE_SIZE:e/Math.sqrt(this.nodes.length),this.estimatedSize},p.prototype.updateConnected=function(){var e=this;if(this.nodes.length==0){this.isConnected=!0;return}var t=new f,n=new Set,r=this.nodes[0],i,a;for(r.withChildren().forEach(function(e){t.push(e),n.add(e)});t.length!==0;){r=t.shift(),i=r.getEdges();for(var o=i.length,s=0;s<o;s++)a=i[s].getOtherEndInGraph(r,this),a!=null&&!n.has(a)&&a.withChildren().forEach(function(e){t.push(e),n.add(e)})}if(this.isConnected=!1,n.size>=this.nodes.length){var l=0;n.forEach(function(t){t.owner==e&&l++}),l==this.nodes.length&&(this.isConnected=!0)}},e.exports=p}),(function(e,t,n){"use strict";var r,i=n(1);function a(e){r=n(5),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},a.prototype.add=function(e,t,n,r,i){if(n==null&&r==null&&i==null){if(e==null)throw`Graph is null!`;if(t==null)throw`Parent node is null!`;if(this.graphs.indexOf(e)>-1)throw`Graph already in this graph mgr!`;if(this.graphs.push(e),e.parent!=null)throw`Already has a parent!`;if(t.child!=null)throw`Already has a child!`;return e.parent=t,t.child=e,e}i=n,r=t,n=e;var a=r.getOwner(),o=i.getOwner();if(a==null||a.getGraphManager()!=this)throw`Source not in this graph mgr!`;if(o==null||o.getGraphManager()!=this)throw`Target not in this graph mgr!`;if(a==o)return n.isInterGraph=!1,a.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw`Edge already in inter-graph edge list!`;if(this.edges.push(n),n.source==null||n.target==null)throw`Edge source and/or target is null!`;if(n.source.edges.indexOf(n)!=-1||n.target.edges.indexOf(n)!=-1)throw`Edge already in source and/or target incidency list!`;return n.source.edges.push(n),n.target.edges.push(n),n},a.prototype.remove=function(e){if(e instanceof r){var t=e;if(t.getGraphManager()!=this)throw`Graph not in this graph mgr`;if(!(t==this.rootGraph||t.parent!=null&&t.parent.graphManager==this))throw`Invalid parent node!`;var n=[];n=n.concat(t.getEdges());for(var a,o=n.length,s=0;s<o;s++)a=n[s],t.remove(a);var l=[];l=l.concat(t.getNodes());var u;o=l.length;for(var s=0;s<o;s++)u=l[s],t.remove(u);t==this.rootGraph&&this.setRootGraph(null);var d=this.graphs.indexOf(t);this.graphs.splice(d,1),t.parent=null}else if(e instanceof i){if(a=e,a==null)throw`Edge is null!`;if(!a.isInterGraph)throw`Not an inter-graph edge!`;if(a.source==null||a.target==null)throw`Source and/or target is null!`;if(a.source.edges.indexOf(a)==-1||a.target.edges.indexOf(a)==-1)throw`Source and/or target doesn't know this edge!`;var d=a.source.edges.indexOf(a);if(a.source.edges.splice(d,1),d=a.target.edges.indexOf(a),a.target.edges.splice(d,1),a.source.owner==null||a.source.owner.getGraphManager()==null)throw`Edge owner graph or owner graph manager is null!`;if(a.source.owner.getGraphManager().edges.indexOf(a)==-1)throw`Not in owner graph manager's edge list!`;var d=a.source.owner.getGraphManager().edges.indexOf(a);a.source.owner.getGraphManager().edges.splice(d,1)}},a.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},a.prototype.getGraphs=function(){return this.graphs},a.prototype.getAllNodes=function(){if(this.allNodes==null){for(var e=[],t=this.getGraphs(),n=t.length,r=0;r<n;r++)e=e.concat(t[r].getNodes());this.allNodes=e}return this.allNodes},a.prototype.resetAllNodes=function(){this.allNodes=null},a.prototype.resetAllEdges=function(){this.allEdges=null},a.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},a.prototype.getAllEdges=function(){if(this.allEdges==null){var e=[],t=this.getGraphs();t.length;for(var n=0;n<t.length;n++)e=e.concat(t[n].getEdges());e=e.concat(this.edges),this.allEdges=e}return this.allEdges},a.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},a.prototype.setAllNodesToApplyGravitation=function(e){if(this.allNodesToApplyGravitation!=null)throw`assert failed`;this.allNodesToApplyGravitation=e},a.prototype.getRoot=function(){return this.rootGraph},a.prototype.setRootGraph=function(e){if(e.getGraphManager()!=this)throw`Root not in this graph mgr!`;this.rootGraph=e,e.parent??=this.layout.newNode(`Root node`)},a.prototype.getLayout=function(){return this.layout},a.prototype.isOneAncestorOfOther=function(e,t){if(e==null||t==null)throw`assert failed`;if(e==t)return!0;var n=e.getOwner(),r;do{if(r=n.getParent(),r==null)break;if(r==t)return!0;if(n=r.getOwner(),n==null)break}while(!0);n=t.getOwner();do{if(r=n.getParent(),r==null)break;if(r==e)return!0;if(n=r.getOwner(),n==null)break}while(!0);return!1},a.prototype.calcLowestCommonAncestors=function(){for(var e,t,n,r,i,a=this.getAllEdges(),o=a.length,s=0;s<o;s++){if(e=a[s],t=e.source,n=e.target,e.lca=null,e.sourceInLca=t,e.targetInLca=n,t==n){e.lca=t.getOwner();continue}for(r=t.getOwner();e.lca==null;){for(e.targetInLca=n,i=n.getOwner();e.lca==null;){if(i==r){e.lca=i;break}if(i==this.rootGraph)break;if(e.lca!=null)throw`assert failed`;e.targetInLca=i.getParent(),i=e.targetInLca.getOwner()}if(r==this.rootGraph)break;e.lca??(e.sourceInLca=r.getParent(),r=e.sourceInLca.getOwner())}if(e.lca==null)throw`assert failed`}},a.prototype.calcLowestCommonAncestor=function(e,t){if(e==t)return e.getOwner();var n=e.getOwner();do{if(n==null)break;var r=t.getOwner();do{if(r==null)break;if(r==n)return r;r=r.getParent().getOwner()}while(!0);n=n.getParent().getOwner()}while(!0);return n},a.prototype.calcInclusionTreeDepths=function(e,t){e==null&&t==null&&(e=this.rootGraph,t=1);for(var n,r=e.getNodes(),i=r.length,a=0;a<i;a++)n=r[a],n.inclusionTreeDepth=t,n.child!=null&&this.calcInclusionTreeDepths(n.child,t+1)},a.prototype.includesInvalidEdge=function(){for(var e,t=this.edges.length,n=0;n<t;n++)if(e=this.edges[n],this.isOneAncestorOfOther(e.source,e.target))return!0;return!1},e.exports=a}),(function(e,t,n){"use strict";var r=n(0);function i(){}for(var a in r)i[a]=r[a];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=i.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,e.exports=i}),(function(e,t,n){"use strict";var r=n(12);function i(){}i.calcSeparationAmount=function(e,t,n,r){if(!e.intersects(t))throw`assert failed`;var i=[,,];this.decideDirectionsForOverlappingNodes(e,t,i),n[0]=Math.min(e.getRight(),t.getRight())-Math.max(e.x,t.x),n[1]=Math.min(e.getBottom(),t.getBottom())-Math.max(e.y,t.y),e.getX()<=t.getX()&&e.getRight()>=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var a=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(a=1);var o=a*n[0],s=n[1]/a;n[0]<s?s=n[0]:o=n[1],n[0]=-1*i[0]*(s/2+r),n[1]=-1*i[1]*(o/2+r)},i.decideDirectionsForOverlappingNodes=function(e,t,n){n[0]=e.getCenterX()<t.getCenterX()?-1:1,n[1]=e.getCenterY()<t.getCenterY()?-1:1},i.getIntersection2=function(e,t,n){var r=e.getCenterX(),i=e.getCenterY(),a=t.getCenterX(),o=t.getCenterY();if(e.intersects(t))return n[0]=r,n[1]=i,n[2]=a,n[3]=o,!0;var s=e.getX(),l=e.getY(),u=e.getRight(),d=e.getX(),f=e.getBottom(),p=e.getRight(),m=e.getWidthHalf(),h=e.getHeightHalf(),g=t.getX(),_=t.getY(),v=t.getRight(),y=t.getX(),b=t.getBottom(),x=t.getRight(),S=t.getWidthHalf(),C=t.getHeightHalf(),w=!1,T=!1;if(r===a){if(i>o)return n[0]=r,n[1]=l,n[2]=a,n[3]=b,!1;if(i<o)return n[0]=r,n[1]=f,n[2]=a,n[3]=_,!1}else if(i===o){if(r>a)return n[0]=s,n[1]=i,n[2]=v,n[3]=o,!1;if(r<a)return n[0]=u,n[1]=i,n[2]=g,n[3]=o,!1}else{var E=e.height/e.width,D=t.height/t.width,O=(o-i)/(a-r),k=void 0,A=void 0,j=void 0,M=void 0,N=void 0,P=void 0;if(-E===O?r>a?(n[0]=d,n[1]=f,w=!0):(n[0]=u,n[1]=l,w=!0):E===O&&(r>a?(n[0]=s,n[1]=l,w=!0):(n[0]=p,n[1]=f,w=!0)),-D===O?a>r?(n[2]=y,n[3]=b,T=!0):(n[2]=v,n[3]=_,T=!0):D===O&&(a>r?(n[2]=g,n[3]=_,T=!0):(n[2]=x,n[3]=b,T=!0)),w&&T)return!1;if(r>a?i>o?(k=this.getCardinalDirection(E,O,4),A=this.getCardinalDirection(D,O,2)):(k=this.getCardinalDirection(-E,O,3),A=this.getCardinalDirection(-D,O,1)):i>o?(k=this.getCardinalDirection(-E,O,1),A=this.getCardinalDirection(-D,O,3)):(k=this.getCardinalDirection(E,O,2),A=this.getCardinalDirection(D,O,4)),!w)switch(k){case 1:M=l,j=r+-h/O,n[0]=j,n[1]=M;break;case 2:j=p,M=i+m*O,n[0]=j,n[1]=M;break;case 3:M=f,j=r+h/O,n[0]=j,n[1]=M;break;case 4:j=d,M=i+-m*O,n[0]=j,n[1]=M}if(!T)switch(A){case 1:P=_,N=a+-C/O,n[2]=N,n[3]=P;break;case 2:N=x,P=o+S*O,n[2]=N,n[3]=P;break;case 3:P=b,N=a+C/O,n[2]=N,n[3]=P;break;case 4:N=y,P=o+-S*O,n[2]=N,n[3]=P}}return!1},i.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},i.getIntersection=function(e,t,n,i){if(i==null)return this.getIntersection2(e,t,n);var a=e.x,o=e.y,s=t.x,l=t.y,u=n.x,d=n.y,f=i.x,p=i.y,m=void 0,h=void 0,g=void 0,_=void 0,v=void 0,y=void 0,b=void 0,x=void 0,S=void 0;return g=l-o,v=a-s,b=s*o-a*l,_=p-d,y=u-f,x=f*d-u*p,S=g*y-_*v,S===0?null:(m=(v*x-y*b)/S,h=(_*b-g*x)/S,new r(m,h))},i.angleOfVector=function(e,t,n,r){var i=void 0;return e===n?i=r<t?this.ONE_AND_HALF_PI:this.HALF_PI:(i=Math.atan((r-t)/(n-e)),n<e?i+=Math.PI:r<t&&(i+=this.TWO_PI)),i},i.doIntersect=function(e,t,n,r){var i=e.x,a=e.y,o=t.x,s=t.y,l=n.x,u=n.y,d=r.x,f=r.y,p=(o-i)*(f-u)-(d-l)*(s-a);if(p===0)return!1;var m=((f-u)*(d-i)+(l-d)*(f-a))/p,h=((a-s)*(d-i)+(o-i)*(f-a))/p;return 0<m&&m<1&&0<h&&h<1},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,e.exports=i}),(function(e,t,n){"use strict";function r(){}r.sign=function(e){return e>0?1:e<0?-1:0},r.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},r.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=r}),(function(e,t,n){"use strict";function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,e.exports=r}),(function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var a=function(e){return{value:e,next:null,prev:null}},o=function(e,t,n,r){return e===null?r.head=t:e.next=t,n===null?r.tail=t:n.prev=t,t.prev=e,t.next=n,r.length++,t},s=function(e,t){var n=e.prev,r=e.next;return n===null?t.head=r:n.next=r,r===null?t.tail=n:r.prev=n,e.prev=e.next=null,t.length--,e};e.exports=function(){function e(t){var n=this;i(this,e),this.length=0,this.head=null,this.tail=null,t?.forEach(function(e){return n.push(e)})}return r(e,[{key:`size`,value:function(){return this.length}},{key:`insertBefore`,value:function(e,t){return o(t.prev,a(e),t,this)}},{key:`insertAfter`,value:function(e,t){return o(t,a(e),t.next,this)}},{key:`insertNodeBefore`,value:function(e,t){return o(t.prev,e,t,this)}},{key:`insertNodeAfter`,value:function(e,t){return o(t,e,t.next,this)}},{key:`push`,value:function(e){return o(this.tail,a(e),null,this)}},{key:`unshift`,value:function(e){return o(null,a(e),this.head,this)}},{key:`remove`,value:function(e){return s(e,this)}},{key:`pop`,value:function(){return s(this.tail,this).value}},{key:`popNode`,value:function(){return s(this.tail,this)}},{key:`shift`,value:function(){return s(this.head,this).value}},{key:`shiftNode`,value:function(){return s(this.head,this)}},{key:`get_object_at`,value:function(e){if(e<=this.length()){for(var t=1,n=this.head;t<e;)n=n.next,t++;return n.value}}},{key:`set_object_at`,value:function(e,t){if(e<=this.length()){for(var n=1,r=this.head;n<e;)r=r.next,n++;r.value=t}}}]),e}()}),(function(e,t,n){"use strict";function r(e,t,n){this.x=null,this.y=null,e==null&&t==null&&n==null?(this.x=0,this.y=0):typeof e==`number`&&typeof t==`number`&&n==null?(this.x=e,this.y=t):e.constructor.name==`Point`&&t==null&&n==null&&(n=e,this.x=n.x,this.y=n.y)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.getLocation=function(){return new r(this.x,this.y)},r.prototype.setLocation=function(e,t,n){e.constructor.name==`Point`&&t==null&&n==null?(n=e,this.setLocation(n.x,n.y)):typeof e==`number`&&typeof t==`number`&&n==null&&(parseInt(e)==e&&parseInt(t)==t?this.move(e,t):(this.x=Math.floor(e+.5),this.y=Math.floor(t+.5)))},r.prototype.move=function(e,t){this.x=e,this.y=t},r.prototype.translate=function(e,t){this.x+=e,this.y+=t},r.prototype.equals=function(e){if(e.constructor.name==`Point`){var t=e;return this.x==t.x&&this.y==t.y}return this==e},r.prototype.toString=function(){return new r().constructor.name+`[x=`+this.x+`,y=`+this.y+`]`},e.exports=r}),(function(e,t,n){"use strict";function r(e,t,n,r){this.x=0,this.y=0,this.width=0,this.height=0,e!=null&&t!=null&&n!=null&&r!=null&&(this.x=e,this.y=t,this.width=n,this.height=r)}r.prototype.getX=function(){return this.x},r.prototype.setX=function(e){this.x=e},r.prototype.getY=function(){return this.y},r.prototype.setY=function(e){this.y=e},r.prototype.getWidth=function(){return this.width},r.prototype.setWidth=function(e){this.width=e},r.prototype.getHeight=function(){return this.height},r.prototype.setHeight=function(e){this.height=e},r.prototype.getRight=function(){return this.x+this.width},r.prototype.getBottom=function(){return this.y+this.height},r.prototype.intersects=function(e){return!(this.getRight()<e.x||this.getBottom()<e.y||e.getRight()<this.x||e.getBottom()<this.y)},r.prototype.getCenterX=function(){return this.x+this.width/2},r.prototype.getMinX=function(){return this.getX()},r.prototype.getMaxX=function(){return this.getX()+this.width},r.prototype.getCenterY=function(){return this.y+this.height/2},r.prototype.getMinY=function(){return this.getY()},r.prototype.getMaxY=function(){return this.getY()+this.height},r.prototype.getWidthHalf=function(){return this.width/2},r.prototype.getHeightHalf=function(){return this.height/2},e.exports=r}),(function(e,t,n){"use strict";var r=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e};function i(){}i.lastID=0,i.createID=function(e){return i.isPrimitive(e)?e:e.uniqueID==null?(e.uniqueID=i.getString(),i.lastID++,e.uniqueID):e.uniqueID},i.getString=function(e){return e??=i.lastID,`Object#`+e},i.isPrimitive=function(e){var t=e===void 0?`undefined`:r(e);return e==null||t!=`object`&&t!=`function`},e.exports=i}),(function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var i=n(0),a=n(6),o=n(3),s=n(1),l=n(5),u=n(4),d=n(17),f=n(27);function p(e){f.call(this),this.layoutQuality=i.QUALITY,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=i.DEFAULT_INCREMENTAL,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new a(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,e!=null&&(this.isRemoteUse=e)}p.RANDOM_SEED=1,p.prototype=Object.create(f.prototype),p.prototype.getGraphManager=function(){return this.graphManager},p.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},p.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},p.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},p.prototype.newGraphManager=function(){var e=new a(this);return this.graphManager=e,e},p.prototype.newGraph=function(e){return new l(null,this.graphManager,e)},p.prototype.newNode=function(e){return new o(this.graphManager,e)},p.prototype.newEdge=function(e){return new s(null,null,e)},p.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},p.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var e=!this.checkLayoutSuccess()&&this.layout();return i.ANIMATE!==`during`&&(e&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,e)},p.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},p.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var e=this.graphManager.getAllEdges(),t=0;t<e.length;t++)e[t];for(var n=this.graphManager.getRoot().getNodes(),t=0;t<n.length;t++)n[t];this.update(this.graphManager.getRoot())}},p.prototype.update=function(e){if(e==null)this.update2();else if(e instanceof o){var t=e;if(t.getChild()!=null)for(var n=t.getChild().getNodes(),r=0;r<n.length;r++)update(n[r]);t.vGraphObject!=null&&t.vGraphObject.update(t)}else if(e instanceof s){var i=e;i.vGraphObject!=null&&i.vGraphObject.update(i)}else if(e instanceof l){var a=e;a.vGraphObject!=null&&a.vGraphObject.update(a)}},p.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=i.QUALITY,this.animationDuringLayout=i.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=i.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=i.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=i.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=i.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=i.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},p.prototype.transform=function(e){if(e==null)this.transform(new u(0,0));else{var t=new d,n=this.graphManager.getRoot().updateLeftTop();if(n!=null){t.setWorldOrgX(e.x),t.setWorldOrgY(e.y),t.setDeviceOrgX(n.x),t.setDeviceOrgY(n.y);for(var r=this.getAllNodes(),i,a=0;a<r.length;a++)i=r[a],i.transform(t)}}},p.prototype.positionNodesRandomly=function(e){if(e==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var t,n,r=e.getNodes(),i=0;i<r.length;i++)t=r[i],n=t.getChild(),n==null||n.getNodes().length==0?t.scatter():(this.positionNodesRandomly(n),t.updateBounds())},p.prototype.getFlatForest=function(){for(var e=[],t=!0,n=this.graphManager.getRoot().getNodes(),i=!0,a=0;a<n.length;a++)n[a].getChild()!=null&&(i=!1);if(!i)return e;var o=new Set,s=[],l=new Map,u=[];for(u=u.concat(n);u.length>0&&t;){for(s.push(u[0]);s.length>0&&t;){var d=s[0];s.splice(0,1),o.add(d);for(var f=d.getEdges(),a=0;a<f.length;a++){var p=f[a].getOtherEnd(d);if(l.get(d)!=p){if(!o.has(p))s.push(p),l.set(p,d);else{t=!1;break}}}}if(!t)e=[];else{var m=[].concat(r(o));e.push(m);for(var a=0;a<m.length;a++){var h=m[a],g=u.indexOf(h);g>-1&&u.splice(g,1)}o=new Set,l=new Map}}return e},p.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i<e.bendpoints.length;i++){var a=this.newNode(null);a.setRect(new Point(0,0),new Dimension(1,1)),r.add(a);var o=this.newEdge(null);this.graphManager.add(o,n,a),t.add(a),n=a}var o=this.newEdge(null);return this.graphManager.add(o,n,e.target),this.edgeToDummyNodes.set(e,t),e.isInterGraph()?this.graphManager.remove(e):r.remove(e),t},p.prototype.createBendpointsFromDummyNodes=function(){var e=[];e=e.concat(this.graphManager.getAllEdges()),e=[].concat(r(this.edgeToDummyNodes.keys()),e);for(var t=0;t<e.length;t++){var n=e[t];if(n.bendpoints.length>0){for(var i=this.edgeToDummyNodes.get(n),a=0;a<i.length;a++){var o=i[a],s=new u(o.getCenterX(),o.getCenterY()),l=n.bendpoints.get(a);l.x=s.x,l.y=s.y,o.getOwner().remove(o)}this.graphManager.add(n,n.source,n.target)}}},p.transform=function(e,t,n,r){if(n!=null&&r!=null){var i=t;if(e<=50){var a=t/n;i-=(t-a)/50*(50-e)}else{var o=t*r;i+=(o-t)/50*(e-50)}return i}var s,l;return e<=50?(s=9*t/500,l=t/10):(s=9*t/50,l=-8*t),s*e+l},p.findCenterOfTree=function(e){var t=[];t=t.concat(e);var n=[],r=new Map,i=!1,a=null;(t.length==1||t.length==2)&&(i=!0,a=t[0]);for(var o=0;o<t.length;o++){var s=t[o],l=s.getNeighborsList().size;r.set(s,s.getNeighborsList().size),l==1&&n.push(s)}var u=[];for(u=u.concat(n);!i;){var d=[];d=d.concat(u),u=[];for(var o=0;o<t.length;o++){var s=t[o],f=t.indexOf(s);f>=0&&t.splice(f,1),s.getNeighborsList().forEach(function(e){if(n.indexOf(e)<0){var t=r.get(e)-1;t==1&&u.push(e),r.set(e,t)}})}n=n.concat(u),(t.length==1||t.length==2)&&(i=!0,a=t[0])}return a},p.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=p}),(function(e,t,n){"use strict";function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=Math.sin(r.seed++)*1e4,r.x-Math.floor(r.x)},e.exports=r}),(function(e,t,n){"use strict";var r=n(4);function i(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(e){this.lworldExtX=e},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(e){this.lworldExtY=e},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},i.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return n!=0&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},i.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return n!=0&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},i.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return n!=0&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},i.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return n!=0&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},i.prototype.inverseTransformPoint=function(e){return new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=i}),(function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var i=n(15),a=n(7),o=n(0),s=n(8),l=n(9);function u(){i.call(this),this.useSmartIdealEdgeLengthCalculation=a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=a.DEFAULT_EDGE_LENGTH,this.springConstant=a.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=a.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=a.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=a.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=a.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=a.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=a.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=a.MAX_ITERATIONS}for(var d in u.prototype=Object.create(i.prototype),i)u[d]=i[d];u.prototype.initParameters=function(){i.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},u.prototype.calcIdealEdgeLengths=function(){for(var e,t,n,r,i,s,l=this.getGraphManager().getAllEdges(),u=0;u<l.length;u++)e=l[u],e.idealLength=this.idealEdgeLength,e.isInterGraph&&(n=e.getSource(),r=e.getTarget(),i=e.getSourceInLca().getEstimatedSize(),s=e.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(e.idealLength+=i+s-2*o.SIMPLE_NODE_SIZE),t=e.getLca().getInclusionTreeDepth(),e.idealLength+=a.DEFAULT_EDGE_LENGTH*a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(n.getInclusionTreeDepth()+r.getInclusionTreeDepth()-2*t))},u.prototype.initSpringEmbedder=function(){var e=this.getAllNodes().length;this.incremental?(e>a.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(this.coolingFactor=e>a.ADAPTATION_LOWER_NODE_LIMIT?Math.max(a.COOLING_ADAPTATION_FACTOR,1-(e-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},u.prototype.calcSpringForces=function(){for(var e=this.getAllEdges(),t,n=0;n<e.length;n++)t=e[n],this.calcSpringForce(t,t.idealLength)},u.prototype.calcRepulsionForces=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n,r,i,o,s=this.getAllNodes(),l;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&e&&this.updateGrid(),l=new Set,n=0;n<s.length;n++)i=s[n],this.calculateRepulsionForceOfANode(i,l,e,t),l.add(i);else for(n=0;n<s.length;n++)for(i=s[n],r=n+1;r<s.length;r++)o=s[r],i.getOwner()==o.getOwner()&&this.calcRepulsionForce(i,o)},u.prototype.calcGravitationalForces=function(){for(var e,t=this.getAllNodesToApplyGravitation(),n=0;n<t.length;n++)e=t[n],this.calcGravitationalForce(e)},u.prototype.moveNodes=function(){for(var e=this.getAllNodes(),t,n=0;n<e.length;n++)t=e[n],t.move()},u.prototype.calcSpringForce=function(e,t){var n=e.getSource(),r=e.getTarget(),i,a,o,s;if(this.uniformLeafNodeSizes&&n.getChild()==null&&r.getChild()==null)e.updateLengthSimple();else if(e.updateLength(),e.isOverlapingSourceAndTarget)return;i=e.getLength(),i!=0&&(a=this.springConstant*(i-t),o=a*(e.lengthX/i),s=a*(e.lengthY/i),n.springForceX+=o,n.springForceY+=s,r.springForceX-=o,r.springForceY-=s)},u.prototype.calcRepulsionForce=function(e,t){var n=e.getRect(),r=t.getRect(),i=[,,],o=[,,,,],u,d,f,p,m,h,g;if(n.intersects(r)){s.calcSeparationAmount(n,r,i,a.DEFAULT_EDGE_LENGTH/2),h=2*i[0],g=2*i[1];var _=e.noOfChildren*t.noOfChildren/(e.noOfChildren+t.noOfChildren);e.repulsionForceX-=_*h,e.repulsionForceY-=_*g,t.repulsionForceX+=_*h,t.repulsionForceY+=_*g}else this.uniformLeafNodeSizes&&e.getChild()==null&&t.getChild()==null?(u=r.getCenterX()-n.getCenterX(),d=r.getCenterY()-n.getCenterY()):(s.getIntersection(n,r,o),u=o[2]-o[0],d=o[3]-o[1]),Math.abs(u)<a.MIN_REPULSION_DIST&&(u=l.sign(u)*a.MIN_REPULSION_DIST),Math.abs(d)<a.MIN_REPULSION_DIST&&(d=l.sign(d)*a.MIN_REPULSION_DIST),f=u*u+d*d,p=Math.sqrt(f),m=this.repulsionConstant*e.noOfChildren*t.noOfChildren/f,h=m*u/p,g=m*d/p,e.repulsionForceX-=h,e.repulsionForceY-=g,t.repulsionForceX+=h,t.repulsionForceY+=g},u.prototype.calcGravitationalForce=function(e){var t=e.getOwner(),n=(t.getRight()+t.getLeft())/2,r=(t.getTop()+t.getBottom())/2,i=e.getCenterX()-n,a=e.getCenterY()-r,o=Math.abs(i)+e.getWidth()/2,s=Math.abs(a)+e.getHeight()/2,l;e.getOwner()==this.graphManager.getRoot()?(l=t.getEstimatedSize()*this.gravityRangeFactor,(o>l||s>l)&&(e.gravitationForceX=-this.gravityConstant*i,e.gravitationForceY=-this.gravityConstant*a)):(l=t.getEstimatedSize()*this.compoundGravityRangeFactor,(o>l||s>l)&&(e.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*a*this.compoundGravityConstant))},u.prototype.isConverged=function(){var e,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,e||t},u.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},u.prototype.calcNoOfChildrenForAllNodes=function(){for(var e,t=this.graphManager.getAllNodes(),n=0;n<t.length;n++)e=t[n],e.noOfChildren=e.getNoOfChildren()},u.prototype.calcGrid=function(e){var t=0,n=0;t=parseInt(Math.ceil((e.getRight()-e.getLeft())/this.repulsionRange)),n=parseInt(Math.ceil((e.getBottom()-e.getTop())/this.repulsionRange));for(var r=Array(t),i=0;i<t;i++)r[i]=Array(n);for(var i=0;i<t;i++)for(var a=0;a<n;a++)r[i][a]=[];return r},u.prototype.addNodeToGrid=function(e,t,n){var r=0,i=0,a=0,o=0;r=parseInt(Math.floor((e.getRect().x-t)/this.repulsionRange)),i=parseInt(Math.floor((e.getRect().width+e.getRect().x-t)/this.repulsionRange)),a=parseInt(Math.floor((e.getRect().y-n)/this.repulsionRange)),o=parseInt(Math.floor((e.getRect().height+e.getRect().y-n)/this.repulsionRange));for(var s=r;s<=i;s++)for(var l=a;l<=o;l++)this.grid[s][l].push(e),e.setGridCoordinates(r,i,a,o)},u.prototype.updateGrid=function(){var e,t,n=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),e=0;e<n.length;e++)t=n[e],this.addNodeToGrid(t,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},u.prototype.calculateRepulsionForceOfANode=function(e,t,n,i){if(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&n||i){var o=new Set;e.surrounding=[];for(var s,l=this.grid,u=e.startX-1;u<e.finishX+2;u++)for(var d=e.startY-1;d<e.finishY+2;d++)if(!(u<0||d<0||u>=l.length||d>=l[0].length)){for(var f=0;f<l[u][d].length;f++)if(s=l[u][d][f],e.getOwner()==s.getOwner()&&e!=s&&!t.has(s)&&!o.has(s)){var p=Math.abs(e.getCenterX()-s.getCenterX())-(e.getWidth()/2+s.getWidth()/2),m=Math.abs(e.getCenterY()-s.getCenterY())-(e.getHeight()/2+s.getHeight()/2);p<=this.repulsionRange&&m<=this.repulsionRange&&o.add(s)}}e.surrounding=[].concat(r(o))}for(u=0;u<e.surrounding.length;u++)this.calcRepulsionForce(e,e.surrounding[u])},u.prototype.calcRepulsionRange=function(){return 0},e.exports=u}),(function(e,t,n){"use strict";var r=n(1),i=n(7);function a(e,t,n){r.call(this,e,t,n),this.idealLength=i.DEFAULT_EDGE_LENGTH}for(var o in a.prototype=Object.create(r.prototype),r)a[o]=r[o];e.exports=a}),(function(e,t,n){"use strict";var r=n(3);function i(e,t,n,i){r.call(this,e,t,n,i),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];i.prototype.setGridCoordinates=function(e,t,n,r){this.startX=e,this.finishX=t,this.startY=n,this.finishY=r},e.exports=i}),(function(e,t,n){"use strict";function r(e,t){this.width=0,this.height=0,e!==null&&t!==null&&(this.height=t,this.width=e)}r.prototype.getWidth=function(){return this.width},r.prototype.setWidth=function(e){this.width=e},r.prototype.getHeight=function(){return this.height},r.prototype.setHeight=function(e){this.height=e},e.exports=r}),(function(e,t,n){"use strict";var r=n(14);function i(){this.map={},this.keys=[]}i.prototype.put=function(e,t){var n=r.createID(e);this.contains(n)||(this.map[n]=t,this.keys.push(e))},i.prototype.contains=function(e){return r.createID(e),this.map[e]!=null},i.prototype.get=function(e){var t=r.createID(e);return this.map[t]},i.prototype.keySet=function(){return this.keys},e.exports=i}),(function(e,t,n){"use strict";var r=n(14);function i(){this.set={}}i.prototype.add=function(e){var t=r.createID(e);this.contains(t)||(this.set[t]=e)},i.prototype.remove=function(e){delete this.set[r.createID(e)]},i.prototype.clear=function(){this.set={}},i.prototype.contains=function(e){return this.set[r.createID(e)]==e},i.prototype.isEmpty=function(){return this.size()===0},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAllTo=function(e){for(var t=Object.keys(this.set),n=t.length,r=0;r<n;r++)e.push(this.set[t[r]])},i.prototype.size=function(){return Object.keys(this.set).length},i.prototype.addAll=function(e){for(var t=e.length,n=0;n<t;n++){var r=e[n];this.add(r)}},e.exports=i}),(function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var a=n(11);e.exports=function(){function e(t,n){i(this,e),(n!==null||n!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var r=void 0;r=t instanceof a?t.size():t.length,this._quicksort(t,0,r-1)}return r(e,[{key:`_quicksort`,value:function(e,t,n){if(t<n){var r=this._partition(e,t,n);this._quicksort(e,t,r),this._quicksort(e,r+1,n)}}},{key:`_partition`,value:function(e,t,n){for(var r=this._get(e,t),i=t,a=n;;){for(;this.compareFunction(r,this._get(e,a));)a--;for(;this.compareFunction(this._get(e,i),r);)i++;if(i<a)this._swap(e,i,a),i++,a--;else return a}}},{key:`_get`,value:function(e,t){return e instanceof a?e.get_object_at(t):e[t]}},{key:`_set`,value:function(e,t,n){e instanceof a?e.set_object_at(t,n):e[t]=n}},{key:`_swap`,value:function(e,t,n){var r=this._get(e,t);this._set(e,t,this._get(e,n)),this._set(e,n,r)}},{key:`_defaultCompareFunction`,value:function(e,t){return t>e}}]),e}()}),(function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}e.exports=function(){function e(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;i(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=a,this.gap_penalty=o,this.iMax=t.length+1,this.jMax=n.length+1,this.grid=Array(this.iMax);for(var s=0;s<this.iMax;s++){this.grid[s]=Array(this.jMax);for(var l=0;l<this.jMax;l++)this.grid[s][l]=0}this.tracebackGrid=Array(this.iMax);for(var u=0;u<this.iMax;u++){this.tracebackGrid[u]=Array(this.jMax);for(var d=0;d<this.jMax;d++)this.tracebackGrid[u][d]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return r(e,[{key:`getScore`,value:function(){return this.score}},{key:`getAlignments`,value:function(){return this.alignments}},{key:`computeGrids`,value:function(){for(var e=1;e<this.jMax;e++)this.grid[0][e]=this.grid[0][e-1]+this.gap_penalty,this.tracebackGrid[0][e]=[!1,!1,!0];for(var t=1;t<this.iMax;t++)this.grid[t][0]=this.grid[t-1][0]+this.gap_penalty,this.tracebackGrid[t][0]=[!1,!0,!1];for(var n=1;n<this.iMax;n++)for(var r=1;r<this.jMax;r++){var i=void 0;i=this.sequence1[n-1]===this.sequence2[r-1]?this.grid[n-1][r-1]+this.match_score:this.grid[n-1][r-1]+this.mismatch_penalty;var a=this.grid[n-1][r]+this.gap_penalty,o=this.grid[n][r-1]+this.gap_penalty,s=[i,a,o],l=this.arrayAllMaxIndexes(s);this.grid[n][r]=s[l[0]],this.tracebackGrid[n][r]=[l.includes(0),l.includes(1),l.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:`alignmentTraceback`,value:function(){var e=[];for(e.push({pos:[this.sequence1.length,this.sequence2.length],seq1:``,seq2:``});e[0];){var t=e[0],n=this.tracebackGrid[t.pos[0]][t.pos[1]];n[0]&&e.push({pos:[t.pos[0]-1,t.pos[1]-1],seq1:this.sequence1[t.pos[0]-1]+t.seq1,seq2:this.sequence2[t.pos[1]-1]+t.seq2}),n[1]&&e.push({pos:[t.pos[0]-1,t.pos[1]],seq1:this.sequence1[t.pos[0]-1]+t.seq1,seq2:`-`+t.seq2}),n[2]&&e.push({pos:[t.pos[0],t.pos[1]-1],seq1:`-`+t.seq1,seq2:this.sequence2[t.pos[1]-1]+t.seq2}),t.pos[0]===0&&t.pos[1]===0&&this.alignments.push({sequence1:t.seq1,sequence2:t.seq2}),e.shift()}return this.alignments}},{key:`getAllIndexes`,value:function(e,t){for(var n=[],r=-1;(r=e.indexOf(t,r+1))!==-1;)n.push(r);return n}},{key:`arrayAllMaxIndexes`,value:function(e){return this.getAllIndexes(e,Math.max.apply(null,e))}}]),e}()}),(function(e,t,n){"use strict";var r=function(){};r.FDLayout=n(18),r.FDLayoutConstants=n(7),r.FDLayoutEdge=n(19),r.FDLayoutNode=n(20),r.DimensionD=n(21),r.HashMap=n(22),r.HashSet=n(23),r.IGeometry=n(8),r.IMath=n(9),r.Integer=n(10),r.Point=n(12),r.PointD=n(4),r.RandomSeed=n(16),r.RectangleD=n(13),r.Transform=n(17),r.UniqueIDGeneretor=n(14),r.Quicksort=n(24),r.LinkedList=n(11),r.LGraphObject=n(2),r.LGraph=n(5),r.LEdge=n(1),r.LGraphManager=n(6),r.LNode=n(3),r.Layout=n(15),r.LayoutConstants=n(0),r.NeedlemanWunsch=n(25),e.exports=r}),(function(e,t,n){"use strict";function r(){this.listeners=[]}var i=r.prototype;i.addListener=function(e,t){this.listeners.push({event:e,callback:t})},i.removeListener=function(e,t){for(var n=this.listeners.length;n>=0;n--){var r=this.listeners[n];r.event===e&&r.callback===t&&this.listeners.splice(n,1)}},i.emit=function(e,t){for(var n=0;n<this.listeners.length;n++){var r=this.listeners[n];e===r.event&&r.callback(t)}},e.exports=r})])})})),kVe=s(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r(OVe()):typeof define==`function`&&define.amd?define([`layout-base`],r):typeof e==`object`?e.coseBase=r(OVe()):n.coseBase=r(n.layoutBase)})(e,function(e){return(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=7)})([(function(t,n){t.exports=e}),(function(e,t,n){"use strict";var r=n(0).FDLayoutConstants;function i(){}for(var a in r)i[a]=r[a];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TREE_REDUCTION_ON_INCREMENTAL=!1,e.exports=i}),(function(e,t,n){"use strict";var r=n(0).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),(function(e,t,n){"use strict";var r=n(0).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),(function(e,t,n){"use strict";var r=n(0).LGraphManager;function i(e){r.call(this,e)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),(function(e,t,n){"use strict";var r=n(0).FDLayoutNode,i=n(0).IMath;function a(e,t,n,i){r.call(this,e,t,n,i)}for(var o in a.prototype=Object.create(r.prototype),r)a[o]=r[o];a.prototype.move=function(){var e=this.graphManager.getLayout();this.displacementX=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),this.child==null||this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),e.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},a.prototype.propogateDisplacementToChildren=function(e,t){for(var n=this.getChild().getNodes(),r,i=0;i<n.length;i++)r=n[i],r.getChild()==null?(r.moveBy(e,t),r.displacementX+=e,r.displacementY+=t):r.propogateDisplacementToChildren(e,t)},a.prototype.setPred1=function(e){this.pred1=e},a.prototype.getPred1=function(){return pred1},a.prototype.getPred2=function(){return pred2},a.prototype.setNext=function(e){this.next=e},a.prototype.getNext=function(){return next},a.prototype.setProcessed=function(e){this.processed=e},a.prototype.isProcessed=function(){return processed},e.exports=a}),(function(e,t,n){"use strict";var r=n(0).FDLayout,i=n(4),a=n(3),o=n(5),s=n(2),l=n(1),u=n(0).FDLayoutConstants,d=n(0).LayoutConstants,f=n(0).Point,p=n(0).PointD,m=n(0).Layout,h=n(0).Integer,g=n(0).IGeometry,_=n(0).LGraph,v=n(0).Transform;function y(){r.call(this),this.toBeTiled={}}for(var b in y.prototype=Object.create(r.prototype),r)y[b]=r[b];y.prototype.newGraphManager=function(){var e=new i(this);return this.graphManager=e,e},y.prototype.newGraph=function(e){return new a(null,this.graphManager,e)},y.prototype.newNode=function(e){return new o(this.graphManager,e)},y.prototype.newEdge=function(e){return new s(null,null,e)},y.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH<10?10:l.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=u.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=u.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=u.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=u.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/u.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=u.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},y.prototype.layout=function(){return d.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},y.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),!this.incremental){var e=this.getFlatForest();if(e.length>0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}else if(l.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(n)}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0}if(this.totalIterations%u.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0}this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-this.coolingCycle**+(Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0){if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0}this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n<e.length;n++){var r=e[n].rect,i=e[n].id;t[i]={id:i,x:r.getCenterX(),y:r.getCenterY(),w:r.width,h:r.height}}return t},y.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var e=!1;if(u.ANIMATE===`during`)this.emit(`layoutstarted`);else{for(;!e;)e=this.tick();this.graphManager.updateBounds()}},y.prototype.calculateNodesToApplyGravitationTo=function(){var e=[],t,n=this.graphManager.getGraphs(),r=n.length,i;for(i=0;i<r;i++)t=n[i],t.updateConnected(),t.isConnected||(e=e.concat(t.getNodes()));return e},y.prototype.createBendpoints=function(){var e=[];e=e.concat(this.graphManager.getAllEdges());var t=new Set,n;for(n=0;n<e.length;n++){var r=e[n];if(!t.has(r)){var i=r.getSource(),a=r.getTarget();if(i==a)r.getBendpoints().push(new p),r.getBendpoints().push(new p),this.createDummyNodesForBendpoints(r),t.add(r);else{var o=[];if(o=o.concat(i.getEdgeListToNode(a)),o=o.concat(a.getEdgeListToNode(i)),!t.has(o[0])){if(o.length>1){var s;for(s=0;s<o.length;s++){var l=o[s];l.getBendpoints().push(new p),this.createDummyNodesForBendpoints(l)}}o.forEach(function(e){t.add(e)})}}}if(t.size==e.length)break}},y.prototype.positionNodesRadially=function(e){for(var t=new f(0,0),n=Math.ceil(Math.sqrt(e.length)),r=0,i=0,a=0,o=new p(0,0),s=0;s<e.length;s++){s%n==0&&(a=0,i=r,s!=0&&(i+=l.DEFAULT_COMPONENT_SEPERATION),r=0);var u=e[s],h=m.findCenterOfTree(u);t.x=a,t.y=i,o=y.radialLayout(u,h,t),o.y>r&&(r=Math.floor(o.y)),a=Math.floor(o.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(d.WORLD_CENTER_X-o.x/2,d.WORLD_CENTER_Y-o.y/2))},y.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),l.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(t,null,0,359,0,r);var i=_.calculateBounds(e),a=new v;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(n.x),a.setWorldOrgY(n.y);for(var o=0;o<e.length;o++)e[o].transform(a);var s=new p(i.getMaxX(),i.getMaxY());return a.inverseTransformPoint(s)},y.branchRadialLayout=function(e,t,n,r,i,a){var o=(r-n+1)/2;o<0&&(o+=180);var s=(o+n)%360*g.TWO_PI/360,l=i*Math.cos(s),u=i*Math.sin(s);e.setCenter(l,u);var d=[];d=d.concat(e.getEdges());var f=d.length;t!=null&&f--;for(var p=0,m=d.length,h,_=e.getEdgesBetween(t);_.length>1;){var v=_[0];_.splice(0,1);var b=d.indexOf(v);b>=0&&d.splice(b,1),m--,f--}h=t==null?0:(d.indexOf(_[0])+1)%m;for(var x=Math.abs(r-n)/f,S=h;p!=f;S=++S%m){var C=d[S].getOtherEnd(e);if(C!=t){var w=(n+p*x)%360,T=(w+x)%360;y.branchRadialLayout(C,e,w,T,i+a,a),p++}}},y.maxDiagonalInTree=function(e){for(var t=h.MIN_VALUE,n=0;n<e.length;n++){var r=e[n].getDiagonal();r>t&&(t=r)}return t},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i<r.length;i++){var a=r[i],s=a.getParent();this.getNodeDegreeWithChildren(a)===0&&(s.id==null||!this.getToBeTiled(s))&&n.push(a)}for(var i=0;i<n.length;i++){var a=n[i],l=a.getParent().id;t[l]===void 0&&(t[l]=[]),t[l]=t[l].concat(a)}Object.keys(t).forEach(function(n){if(t[n].length>1){var r=`DummyCompound_`+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),a=new o(e.graphManager);a.id=r,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=a;var s=e.getGraphManager().add(e.newGraph(),a),l=i.getChild();l.add(a);for(var u=0;u<t[n].length;u++){var d=t[n][u];l.remove(d),s.add(d)}}})},y.prototype.clearCompounds=function(){var e={},t={};this.performDFSOnCompounds();for(var n=0;n<this.compoundOrder.length;n++)t[this.compoundOrder[n].id]=this.compoundOrder[n],e[this.compoundOrder[n].id]=[].concat(this.compoundOrder[n].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[n].getChild()),this.compoundOrder[n].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(e,t)},y.prototype.clearZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(n){var r=e.idToDummyNode[n];t[n]=e.tileNodes(e.memberGroups[n],r.paddingLeft+r.paddingRight),r.rect.width=t[n].width,r.rect.height=t[n].height})},y.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i)}},y.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach(function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,a=r.paddingTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,a)})},y.prototype.getToBeTiled=function(e){var t=e.id;if(this.toBeTiled[t]!=null)return this.toBeTiled[t];var n=e.getChild();if(n==null)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i<r.length;i++){var a=r[i];if(this.getNodeDegree(a)>0)return this.toBeTiled[t]=!1,!1;if(a.getChild()==null){this.toBeTiled[a.id]=!1;continue}if(!this.getToBeTiled(a))return this.toBeTiled[t]=!1,!1}return this.toBeTiled[t]=!0,!0},y.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;r<t.length;r++){var i=t[r];i.getSource().id!==i.getTarget().id&&(n+=1)}return n},y.prototype.getNodeDegreeWithChildren=function(e){var t=this.getNodeDegree(e);if(e.getChild()==null)return t;for(var n=e.getChild().getNodes(),r=0;r<n.length;r++){var i=n[r];t+=this.getNodeDegreeWithChildren(i)}return t},y.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},y.prototype.fillCompexOrderByDFS=function(e){for(var t=0;t<e.length;t++){var n=e[t];n.getChild()!=null&&this.fillCompexOrderByDFS(n.getChild().getNodes()),this.getToBeTiled(n)&&this.compoundOrder.push(n)}},y.prototype.adjustLocations=function(e,t,n,r,i){t+=r,n+=i;for(var a=t,o=0;o<e.rows.length;o++){var s=e.rows[o];t=a;for(var l=0,u=0;u<s.length;u++){var d=s[u];d.rect.x=t,d.rect.y=n,t+=d.rect.width+e.horizontalPadding,d.rect.height>l&&(l=d.rect.height)}n+=l+e.verticalPadding}},y.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach(function(r){var i=t[r];n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height})},y.prototype.tileNodes=function(e,t){var n={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:l.TILING_PADDING_VERTICAL,horizontalPadding:l.TILING_PADDING_HORIZONTAL};e.sort(function(e,t){return e.rect.width*e.rect.height>t.rect.width*t.rect.height?-1:+(e.rect.width*e.rect.height<t.rect.width*t.rect.height)});for(var r=0;r<e.length;r++){var i=e[r];n.rows.length==0?this.insertNodeToRow(n,i,0,t):this.canAddHorizontal(n,i.rect.width,i.rect.height)?this.insertNodeToRow(n,i,this.getShortestRowIndex(n),t):this.insertNodeToRow(n,i,n.rows.length,t),this.shiftToLastRow(n)}return n},y.prototype.insertNodeToRow=function(e,t,n,r){var i=r;n==e.rows.length&&(e.rows.push([]),e.rowWidth.push(i),e.rowHeight.push(0));var a=e.rowWidth[n]+t.rect.width;e.rows[n].length>0&&(a+=e.horizontalPadding),e.rowWidth[n]=a,e.width<a&&(e.width=a);var o=t.rect.height;n>0&&(o+=e.verticalPadding);var s=0;o>e.rowHeight[n]&&(s=e.rowHeight[n],e.rowHeight[n]=o,s=e.rowHeight[n]-s),e.height+=s,e.rows[n].push(t)},y.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;r<e.rows.length;r++)e.rowWidth[r]<n&&(t=r,n=e.rowWidth[r]);return t},y.prototype.getLongestRowIndex=function(e){for(var t=-1,n=Number.MIN_VALUE,r=0;r<e.rows.length;r++)e.rowWidth[r]>n&&(t=r,n=e.rowWidth[r]);return t},y.prototype.canAddHorizontal=function(e,t,n){var r=this.getShortestRowIndex(e);if(r<0)return!0;var i=e.rowWidth[r];if(i+e.horizontalPadding+t<=e.width)return!0;var a=0;e.rowHeight[r]<n&&r>0&&(a=n+e.verticalPadding-e.rowHeight[r]);var o=e.width-i>=t+e.horizontalPadding?(e.height+a)/(i+t+e.horizontalPadding):(e.height+a)/e.width;a=n+e.verticalPadding;var s=e.width<t?(e.height+a)/t:(e.height+a)/e.width;return s<1&&(s=1/s),o<1&&(o=1/o),o<s},y.prototype.shiftToLastRow=function(e){var t=this.getLongestRowIndex(e),n=e.rowWidth.length-1,r=e.rows[t],i=r[r.length-1],a=i.width+e.horizontalPadding;if(e.width-e.rowWidth[n]>a&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-a,e.rowWidth[n]=e.rowWidth[n]+a,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var o=Number.MIN_VALUE,s=0;s<r.length;s++)r[s].height>o&&(o=r[s].height);t>0&&(o+=e.verticalPadding);var l=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=o,e.rowHeight[n]<i.height+e.verticalPadding&&(e.rowHeight[n]=i.height+e.verticalPadding);var u=e.rowHeight[t]+e.rowHeight[n];e.height+=u-l,this.shiftToLastRow(e)}},y.prototype.tilingPreLayout=function(){l.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},y.prototype.tilingPostLayout=function(){l.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},y.prototype.reduceTrees=function(){for(var e=[],t=!0,n;t;){var r=this.graphManager.getAllNodes(),i=[];t=!1;for(var a=0;a<r.length;a++)n=r[a],n.getEdges().length==1&&!n.getEdges()[0].isInterGraph&&n.getChild()==null&&(i.push([n,n.getEdges()[0],n.getOwner()]),t=!0);if(t==1){for(var o=[],s=0;s<i.length;s++)i[s][0].getEdges().length==1&&(o.push(i[s]),i[s][0].getOwner().remove(i[s][0]));e.push(o),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=e},y.prototype.growTree=function(e){for(var t=e[e.length-1],n,r=0;r<t.length;r++)n=t[r],this.findPlaceforPrunedNode(n),n[2].add(n[0]),n[2].add(n[1],n[1].source,n[1].target);e.splice(e.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},y.prototype.findPlaceforPrunedNode=function(e){var t,n,r=e[0];n=r==e[1].source?e[1].target:e[1].source;var i=n.startX,a=n.finishX,o=n.startY,s=n.finishY,l=[0,0,0,0];if(o>0)for(var d=i;d<=a;d++)l[0]+=this.grid[d][o-1].length+this.grid[d][o].length-1;if(a<this.grid.length-1)for(var d=o;d<=s;d++)l[1]+=this.grid[a+1][d].length+this.grid[a][d].length-1;if(s<this.grid[0].length-1)for(var d=i;d<=a;d++)l[2]+=this.grid[d][s+1].length+this.grid[d][s].length-1;if(i>0)for(var d=o;d<=s;d++)l[3]+=this.grid[i-1][d].length+this.grid[i][d].length-1;for(var f=h.MAX_VALUE,p,m,g=0;g<l.length;g++)l[g]<f?(f=l[g],p=1,m=g):l[g]==f&&p++;if(p==3&&f==0)l[0]==0&&l[1]==0&&l[2]==0?t=1:l[0]==0&&l[1]==0&&l[3]==0?t=0:l[0]==0&&l[2]==0&&l[3]==0?t=3:l[1]==0&&l[2]==0&&l[3]==0&&(t=2);else if(p==2&&f==0){var _=Math.floor(Math.random()*2);t=l[0]==0&&l[1]==0?_==0?0:1:l[0]==0&&l[2]==0?_==0?0:2:l[0]==0&&l[3]==0?_==0?0:3:l[1]==0&&l[2]==0?_==0?1:2:l[1]==0&&l[3]==0?_==0?1:3:_==0?2:3}else if(p==4&&f==0){var _=Math.floor(Math.random()*4);t=_}else t=m;t==0?r.setCenter(n.getCenterX(),n.getCenterY()-n.getHeight()/2-u.DEFAULT_EDGE_LENGTH-r.getHeight()/2):t==1?r.setCenter(n.getCenterX()+n.getWidth()/2+u.DEFAULT_EDGE_LENGTH+r.getWidth()/2,n.getCenterY()):t==2?r.setCenter(n.getCenterX(),n.getCenterY()+n.getHeight()/2+u.DEFAULT_EDGE_LENGTH+r.getHeight()/2):r.setCenter(n.getCenterX()-n.getWidth()/2-u.DEFAULT_EDGE_LENGTH-r.getWidth()/2,n.getCenterY())},e.exports=y}),(function(e,t,n){"use strict";var r={};r.layoutBase=n(0),r.CoSEConstants=n(1),r.CoSEEdge=n(2),r.CoSEGraph=n(3),r.CoSEGraphManager=n(4),r.CoSELayout=n(6),r.CoSENode=n(5),e.exports=r})])})})),AVe=s(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r(kVe()):typeof define==`function`&&define.amd?define([`cose-base`],r):typeof e==`object`?e.cytoscapeCoseBilkent=r(kVe()):n.cytoscapeCoseBilkent=r(n.coseBase)})(e,function(e){return(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=1)})([(function(t,n){t.exports=e}),(function(e,t,n){"use strict";var r=n(0).layoutBase.LayoutConstants,i=n(0).layoutBase.FDLayoutConstants,a=n(0).CoSEConstants,o=n(0).CoSELayout,s=n(0).CoSENode,l=n(0).layoutBase.PointD,u=n(0).layoutBase.DimensionD,d={ready:function(){},stop:function(){},quality:`default`,nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:`end`,animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function f(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function p(e){this.options=f(d,e),m(this.options)}var m=function(e){e.nodeRepulsion!=null&&(a.DEFAULT_REPULSION_STRENGTH=i.DEFAULT_REPULSION_STRENGTH=e.nodeRepulsion),e.idealEdgeLength!=null&&(a.DEFAULT_EDGE_LENGTH=i.DEFAULT_EDGE_LENGTH=e.idealEdgeLength),e.edgeElasticity!=null&&(a.DEFAULT_SPRING_STRENGTH=i.DEFAULT_SPRING_STRENGTH=e.edgeElasticity),e.nestingFactor!=null&&(a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),e.gravity!=null&&(a.DEFAULT_GRAVITY_STRENGTH=i.DEFAULT_GRAVITY_STRENGTH=e.gravity),e.numIter!=null&&(a.MAX_ITERATIONS=i.MAX_ITERATIONS=e.numIter),e.gravityRange!=null&&(a.DEFAULT_GRAVITY_RANGE_FACTOR=i.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),e.gravityCompound!=null&&(a.DEFAULT_COMPOUND_GRAVITY_STRENGTH=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),e.gravityRangeCompound!=null&&(a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),e.initialEnergyOnIncremental!=null&&(a.DEFAULT_COOLING_FACTOR_INCREMENTAL=i.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),r.QUALITY=e.quality==`draft`?0:e.quality==`proof`?2:1,a.NODE_DIMENSIONS_INCLUDE_LABELS=i.NODE_DIMENSIONS_INCLUDE_LABELS=r.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,a.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=r.DEFAULT_INCREMENTAL=!e.randomize,a.ANIMATE=i.ANIMATE=r.ANIMATE=e.animate,a.TILE=e.tile,a.TILING_PADDING_VERTICAL=typeof e.tilingPaddingVertical==`function`?e.tilingPaddingVertical.call():e.tilingPaddingVertical,a.TILING_PADDING_HORIZONTAL=typeof e.tilingPaddingHorizontal==`function`?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal};p.prototype.run=function(){var e,t,n=this.options;this.idToLNode={};var r=this.layout=new o,i=this;i.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:`layoutstart`,layout:this});var a=r.newGraphManager();this.gm=a;var s=this.options.eles.nodes(),l=this.options.eles.edges();this.root=a.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(s),r);for(var u=0;u<l.length;u++){var d=l[u],f=this.idToLNode[d.data(`source`)],p=this.idToLNode[d.data(`target`)];if(f!==p&&f.getEdgesBetween(p).length==0){var m=a.add(r.newEdge(),f,p);m.id=d.id()}}var h=function(e,t){typeof e==`number`&&(e=t);var n=e.data(`id`),r=i.idToLNode[n];return{x:r.getRect().getCenterX(),y:r.getRect().getCenterY()}},g=function a(){for(var o=function(){n.fit&&n.cy.fit(n.eles,n.padding),e||(e=!0,i.cy.one(`layoutready`,n.ready),i.cy.trigger({type:`layoutready`,layout:i}))},s=i.options.refresh,l,u=0;u<s&&!l;u++)l=i.stopped||i.layout.tick();if(l){r.checkLayoutSuccess()&&!r.isSubLayout&&r.doPostLayout(),r.tilingPostLayout&&r.tilingPostLayout(),r.isLayoutFinished=!0,i.options.eles.nodes().positions(h),o(),i.cy.one(`layoutstop`,i.options.stop),i.cy.trigger({type:`layoutstop`,layout:i}),t&&cancelAnimationFrame(t),e=!1;return}var d=i.layout.getPositionsData();n.eles.nodes().positions(function(e,t){if(typeof e==`number`&&(e=t),!e.isParent()){for(var n=e.id(),r=d[n],i=e;r==null&&(r=d[i.data(`parent`)]||d[`DummyCompound_`+i.data(`parent`)],d[n]=r,i=i.parent()[0],i!=null););return r==null?{x:e.position(`x`),y:e.position(`y`)}:{x:r.x,y:r.y}}}),o(),t=requestAnimationFrame(a)};return r.addListener(`layoutstarted`,function(){i.options.animate===`during`&&(t=requestAnimationFrame(g))}),r.runLayout(),this.options.animate!==`during`&&(i.options.eles.nodes().not(`:parent`).layoutPositions(i,i.options,h),e=!1),this},p.prototype.getTopMostNodes=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].id()]=!0;return e.filter(function(e,n){typeof e==`number`&&(e=n);for(var r=e.parent()[0];r!=null;){if(t[r.id()])return!1;r=r.parent()[0]}return!0})},p.prototype.processChildrenList=function(e,t,n){for(var r=t.length,i=0;i<r;i++){var a=t[i],o=a.children(),d,f=a.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(d=a.outerWidth()!=null&&a.outerHeight()!=null?e.add(new s(n.graphManager,new l(a.position(`x`)-f.w/2,a.position(`y`)-f.h/2),new u(parseFloat(f.w),parseFloat(f.h)))):e.add(new s(this.graphManager)),d.id=a.data(`id`),d.paddingLeft=parseInt(a.css(`padding`)),d.paddingTop=parseInt(a.css(`padding`)),d.paddingRight=parseInt(a.css(`padding`)),d.paddingBottom=parseInt(a.css(`padding`)),this.options.nodeDimensionsIncludeLabels&&a.isParent()){var p=a.boundingBox({includeLabels:!0,includeNodes:!1}).w,m=a.boundingBox({includeLabels:!0,includeNodes:!1}).h,h=a.css(`text-halign`);d.labelWidth=p,d.labelHeight=m,d.labelPos=h}if(this.idToLNode[a.data(`id`)]=d,isNaN(d.rect.x)&&(d.rect.x=0),isNaN(d.rect.y)&&(d.rect.y=0),o!=null&&o.length>0){var g=n.getGraphManager().add(n.newGraph(),d);this.processChildrenList(g,o,n)}}},p.prototype.stop=function(){return this.stopped=!0,this};var h=function(e){e(`layout`,`cose-bilkent`,p)};typeof cytoscape<`u`&&h(cytoscape),e.exports=h})])})})),jVe=l({render:()=>BVe});function MVe(e,t){e.forEach(e=>{let n={id:e.id,labelText:e.label,height:e.height,width:e.width,padding:e.padding??0};Object.keys(e).forEach(t=>{[`id`,`label`,`height`,`width`,`padding`,`x`,`y`].includes(t)||(n[t]=e[t])}),t.add({group:`nodes`,data:n,position:{x:e.x??0,y:e.y??0}})})}function NVe(e,t){e.forEach(e=>{let n={id:e.id,source:e.start,target:e.end};Object.keys(e).forEach(t=>{[`id`,`start`,`end`].includes(t)||(n[t]=e[t])}),t.add({group:`edges`,data:n})})}function PVe(e){return new Promise(t=>{let n=$c(`body`).append(`div`).attr(`id`,`cy`).attr(`style`,`display:none`),r=xI({container:document.getElementById(`cy`),style:[{selector:`edge`,style:{"curve-style":`bezier`}}]});n.remove(),MVe(e.nodes,r),NVe(e.edges,r),r.nodes().forEach(function(e){e.layoutDimensions=()=>{let t=e.data();return{w:t.width,h:t.height}}}),r.layout({name:`cose-bilkent`,quality:`proof`,styleEnabled:!1,animate:!1}).run(),r.ready(e=>{y.info(`Cytoscape ready`,e),t(r)})})}function FVe(e){return e.nodes().map(e=>{let t=e.data(),n=e.position(),r={id:t.id,x:n.x,y:n.y};return Object.keys(t).forEach(e=>{e!==`id`&&(r[e]=t[e])}),r})}function IVe(e){return e.edges().map(e=>{let t=e.data(),n=e._private.rscratch,r={id:t.id,source:t.source,target:t.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(t).forEach(e=>{[`id`,`source`,`target`].includes(e)||(r[e]=t[e])}),r})}async function LVe(e,t){y.debug(`Starting cose-bilkent layout algorithm`);try{RVe(e);let t=await PVe(e),n=FVe(t),r=IVe(t);return y.debug(`Layout completed: ${n.length} nodes, ${r.length} edges`),{nodes:n,edges:r}}catch(e){throw y.error(`Error in cose-bilkent layout algorithm:`,e),e}}function RVe(e){if(!e)throw Error(`Layout data is required`);if(!e.config)throw Error(`Configuration is required in layout data`);if(!e.rootNode)throw Error(`Root node is required`);if(!e.nodes||!Array.isArray(e.nodes))throw Error(`No nodes found in layout data`);if(!Array.isArray(e.edges))throw Error(`Edges array is required in layout data`);return!0}var zVe,BVe,VVe=o((()=>{S(),h(),DVe(),zVe=d(AVe(),1),_p(),xI.use(zVe.default),p(MVe,`addNodes`),p(NVe,`addEdges`),p(PVe,`createCytoscapeInstance`),p(FVe,`extractPositionedNodes`),p(IVe,`extractPositionedEdges`),p(LVe,`executeCoseBilkentLayout`),p(RVe,`validateLayoutData`),BVe=p(async(e,t,{insertCluster:n,insertEdge:r,insertEdgeLabel:i,insertMarkers:a,insertNode:o,log:s,positionEdgeLabel:l},{algorithm:u})=>{let d={},f={},p=t.select(`g`);a(p,e.markers,e.type,e.diagramId);let m=p.insert(`g`).attr(`class`,`subgraphs`),h=p.insert(`g`).attr(`class`,`edgePaths`),g=p.insert(`g`).attr(`class`,`edgeLabels`),_=p.insert(`g`).attr(`class`,`nodes`);s.debug(`Inserting nodes into DOM for dimension calculation`),await Promise.all(e.nodes.map(async t=>{if(t.isGroup){let e={...t};f[t.id]=e,d[t.id]=e,await n(m,t)}else{let n={...t};d[t.id]=n;let r=await o(_,t,{config:e.config,dir:e.direction||`TB`}),i=r.node().getBBox();n.width=i.width,n.height=i.height,n.domId=r,s.debug(`Node ${t.id} dimensions: ${i.width}x${i.height}`)}})),s.debug(`Running cose-bilkent layout algorithm`);let v=await LVe({...e,nodes:e.nodes.map(e=>{let t=d[e.id];return{...e,width:t.width,height:t.height}})},e.config);s.debug(`Positioning nodes based on layout results`),v.nodes.forEach(e=>{let t=d[e.id];t?.domId&&(t.domId.attr(`transform`,`translate(${e.x}, ${e.y})`),t.x=e.x,t.y=e.y,s.debug(`Positioned node ${t.id} at center (${e.x}, ${e.y})`))}),v.edges.forEach(t=>{let n=e.edges.find(e=>e.id===t.id);n&&(n.points=[{x:t.startX,y:t.startY},{x:t.midX,y:t.midY},{x:t.endX,y:t.endY}])}),s.debug(`Inserting and positioning edges`),await Promise.all(e.edges.map(async t=>{await i(g,t);let n=d[t.start??``],a=d[t.end??``];if(n&&a){let i=v.edges.find(e=>e.id===t.id);if(i){s.debug(`APA01 positionedEdge`,i);let o={...t};l(o,r(h,o,f,e.type,n,a,e.diagramId))}else{let i={...t,points:[{x:n.x||0,y:n.y||0},{x:a.x||0,y:a.y||0}]};l(i,r(h,i,f,e.type,n,a,e.diagramId))}}})),s.debug(`Cose-bilkent rendering completed`)},`render`)})),HVe,SI,CI,wI,TI,EI=o((()=>{U_(),cv(),z_(),P_(),rh(),dc(),S(),h(),HVe={common:Vs,getConfig:ms,insertCluster:H_,insertEdge:ov,insertEdgeLabel:nv,insertMarkers:sv,insertNode:F_,interpolateToCurve:Im,labelHelper:r_,log:y,positionEdgeLabel:rv},SI={},CI=p(e=>{for(let t of e)SI[t.name]=t},`registerLayoutLoaders`),p(()=>{CI([{name:`dagre`,loader:p(async()=>await Promise.resolve().then(()=>(XMe(),zMe)),`loader`)},{name:`swimlane`,loader:p(async()=>await Promise.resolve().then(()=>(BPe(),ZMe)),`loader`)},{name:`cose-bilkent`,loader:p(async()=>await Promise.resolve().then(()=>(VVe(),jVe)),`loader`)}])},`registerDefaultLayoutLoaders`)(),wI=p(async(e,t)=>{if(!(e.layoutAlgorithm in SI))throw Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(let t of e.nodes){let n=t.domId||t.id;t.domId=`${e.diagramId}-${n}`}let n=SI[e.layoutAlgorithm],r=await n.loader(),{theme:i,themeVariables:a}=e.config,{useGradient:o,gradientStart:s,gradientStop:l}=a,u=t.attr(`id`);if(t.append(`defs`).append(`filter`).attr(`id`,`${u}-drop-shadow`).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${i?.includes(`dark`)?`#FFFFFF`:`#000000`}`),t.append(`defs`).append(`filter`).attr(`id`,`${u}-drop-shadow-small`).attr(`height`,`150%`).attr(`width`,`150%`).append(`feDropShadow`).attr(`dx`,`2`).attr(`dy`,`2`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${i?.includes(`dark`)?`#FFFFFF`:`#000000`}`),o){let e=t.append(`linearGradient`).attr(`id`,t.attr(`id`)+`-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);e.append(`svg:stop`).attr(`offset`,`0%`).attr(`stop-color`,s).attr(`stop-opacity`,1),e.append(`svg:stop`).attr(`offset`,`100%`).attr(`stop-color`,l).attr(`stop-opacity`,1)}return r.render(e,t,HVe,{algorithm:n.algorithm})},`render`),TI=p((e=``,{fallback:t=`dagre`}={})=>{if(e in SI)return e;if(t in SI)return y.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw Error(`Both layout algorithms ${e} and ${t} are not registered.`)},`getRegisteredLayoutAlgorithm`)})),DI=`comm`,UVe=`rule`,WVe=`decl`,GVe=`@import`,KVe=`@namespace`,qVe=`@keyframes`,JVe=`@layer`,YVe=Math.abs,OI=String.fromCharCode;function XVe(e){return e.trim()}function kI(e,t,n){return e.replace(t,n)}function AI(e,t){return e.charCodeAt(t)|0}function jI(e,t,n){return e.slice(t,n)}function MI(e){return e.length}function ZVe(e){return e.length}function NI(e,t){return t.push(e),e}var PI=1,FI=1,QVe=0,II=0,LI=0,RI=``;function zI(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:PI,column:FI,length:o,return:``,siblings:s}}function $Ve(){return LI}function eHe(){return LI=II>0?AI(RI,--II):0,FI--,LI===10&&(FI=1,PI--),LI}function BI(){return LI=II<QVe?AI(RI,II++):0,FI++,LI===10&&(FI=1,PI++),LI}function VI(){return AI(RI,II)}function HI(){return II}function UI(e,t){return jI(RI,e,t)}function WI(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function tHe(e){return PI=FI=1,QVe=MI(RI=e),II=0,[]}function nHe(e){return RI=``,e}function GI(e){return XVe(UI(II-1,KI(e===91?e+2:e===40?e+1:e)))}function rHe(e){for(;(LI=VI())&&LI<33;)BI();return WI(e)>2||WI(LI)>3?``:` `}function iHe(e,t){for(;--t&&BI()&&!(LI<48||LI>102||LI>57&&LI<65||LI>70&&LI<97););return UI(e,HI()+(t<6&&VI()==32&&BI()==32))}function KI(e){for(;BI();)switch(LI){case e:return II;case 34:case 39:e!==34&&e!==39&&KI(LI);break;case 40:e===41&&KI(e);break;case 92:BI();break}return II}function aHe(e,t){for(;BI()&&e+LI!==57&&(e+LI!==84||VI()!==47););return`/*`+UI(t,II-1)+`*`+OI(e===47?e:BI())}function oHe(e){for(;!WI(VI());)BI();return UI(e,II)}function sHe(e){return nHe(qI(``,null,null,null,[``],e=tHe(e),0,[0],e))}function qI(e,t,n,r,i,a,o,s,l){for(var u=0,d=0,f=o,p=0,m=0,h=0,g=1,_=1,v=1,y=0,b=0,x=``,S=i,C=a,w=r,T=x;_;)switch(h=b,b=BI()){case 40:h!=108&&AI(T,f-1)==58?(y++,T+=`(`):T+=GI(b);break;case 41:y--,T+=`)`;break;case 34:case 39:case 91:T+=GI(b);break;case 9:case 10:case 13:case 32:if(y>0){T+=OI(b);break}T+=rHe(h);break;case 92:T+=iHe(HI()-1,7);continue;case 47:switch(VI()){case 42:case 47:NI(lHe(aHe(BI(),HI()),t,n,l),l),(WI(h||1)==5||WI(VI()||1)==5)&&MI(T)&&jI(T,-1,void 0)!==` `&&(T+=` `);break;default:T+=`/`}break;case 123*g:s[u++]=MI(T)*v;case 125*g:case 59:case 0:if(y>0&&b){T+=OI(b);break}switch(b){case 0:case 125:_=0;case 59+d:v==-1&&(T=kI(T,/\f/g,``)),m>0&&(MI(T)-f||g===0)&&NI(m>32?uHe(T+`;`,r,n,f-1,l):uHe(kI(T,` `,``)+`;`,r,n,f-2,l),l);break;case 59:T+=`;`;default:if(NI(w=cHe(T,t,n,u,d,i,s,x,S=[],C=[],f,a),a),b===123){if(d===0)qI(T,t,w,w,S,a,f,s,C);else{switch(p){case 99:if(AI(T,3)===110)break;case 108:if(AI(T,2)===97)break;default:d=0;case 100:case 109:case 115:}d?qI(e,w,w,r&&NI(cHe(e,w,w,0,0,i,s,x,i,S=[],f,C),C),i,C,f,s,r?S:C):qI(T,w,w,w,[``],C,0,s,C)}}}u=d=m=0,g=v=1,x=T=``,f=o;break;case 58:f=1+MI(T),m=h;default:if(g<1){if(b==123)--g;else if(b==125&&g++==0&&eHe()==125)continue}switch(T+=OI(b),b*g){case 38:v=d>0?1:(T+=`\f`,-1);break;case 44:if(y>0)break;s[u++]=(MI(T)-1)*v,v=1;break;case 64:VI()===45&&(T+=GI(BI())),p=VI(),d=f=MI(x=T+=oHe(HI())),b++;break;case 45:h===45&&MI(T)==2&&(g=0)}}return a}function cHe(e,t,n,r,i,a,o,s,l,u,d,f){for(var p=i-1,m=i===0?a:[``],h=ZVe(m),g=0,_=0,v=0;g<r;++g)for(var y=0,b=jI(e,p+1,p=YVe(_=o[g])),x=e;y<h;++y)(x=XVe(_>0?m[y]+` `+b:kI(b,/&\f/g,m[y])))&&(l[v++]=x);return zI(e,t,n,i===0?UVe:s,l,u,d,f)}function lHe(e,t,n,r){return zI(e,t,n,DI,OI($Ve()),jI(e,2,-2),0,r)}function uHe(e,t,n,r,i){return zI(e,t,n,WVe,jI(e,0,r),jI(e,r+1,-1),r,i)}function JI(e,t){for(var n=``,r=0;r<e.length;r++)n+=t(e[r],r,e,t)||``;return n}function dHe(e,t,n,r){switch(e.type){case JVe:if(e.children.length)break;case GVe:case KVe:case WVe:return e.return=e.return||e.value;case DI:return``;case qVe:return e.return=e.value+`{`+JI(e.children,r)+`}`;case UVe:if(!MI(e.value=e.props.join(`,`)))return``}return MI(n=JI(e.children,r))?e.return=e.value+`{`+n+`}`:``}function fHe(e){var t=ZVe(e);return function(n,r,i,a){for(var o=``,s=0;s<t;s++)o+=e[s](n,r,i,a)||``;return o}}var YI,XI,ZI,pHe,QI,$I,eL,tL,nL,rL=o((()=>{dc(),h(),YI=Kp(),_p(),XI=p((e,t)=>{let n=e.append(`rect`);if(n.attr(`x`,t.x),n.attr(`y`,t.y),n.attr(`fill`,t.fill),n.attr(`stroke`,t.stroke),n.attr(`width`,t.width),n.attr(`height`,t.height),t.name&&n.attr(`name`,t.name),t.rx&&n.attr(`rx`,t.rx),t.ry&&n.attr(`ry`,t.ry),t.attrs!==void 0)for(let e in t.attrs)n.attr(e,t.attrs[e]);return t.class&&n.attr(`class`,t.class),n},`drawRect`),ZI=p((e,t)=>{XI(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:`rect`}).lower()},`drawBackgroundRect`),pHe=p((e,t)=>{let n=t.text.replace(Os,` `),r=e.append(`text`);r.attr(`x`,t.x),r.attr(`y`,t.y),r.attr(`class`,`legend`),r.style(`text-anchor`,t.anchor),t.class&&r.attr(`class`,t.class);let i=r.append(`tspan`);return i.attr(`x`,t.x+t.textMargin*2),i.text(n),r},`drawText`),QI=p((e,t,n,r)=>{let i=e.append(`image`);i.attr(`x`,t),i.attr(`y`,n);let a=(0,YI.sanitizeUrl)(r);i.attr(`xlink:href`,a)},`drawImage`),$I=p((e,t,n,r)=>{let i=e.append(`use`);i.attr(`x`,t),i.attr(`y`,n);let a=(0,YI.sanitizeUrl)(r);i.attr(`xlink:href`,`#${a}`)},`drawEmbeddedImage`),eL=p(()=>({x:0,y:0,width:100,height:100,fill:`#EDF2AE`,stroke:`#666`,anchor:`start`,rx:0,ry:0}),`getNoteRect`),tL=p(()=>({x:0,y:0,width:100,height:100,"text-anchor":`start`,style:`#666`,textMargin:0,rx:0,ry:0,tspan:!0}),`getTextObj`),nL=p(()=>{let e=$c(`.mermaidTooltip`);return e.empty()&&(e=$c(`body`).append(`div`).attr(`class`,`mermaidTooltip`).style(`opacity`,0).style(`position`,`absolute`).style(`text-align`,`center`).style(`max-width`,`200px`).style(`padding`,`2px`).style(`font-size`,`12px`).style(`background`,`#ffffde`).style(`border`,`1px solid #333`).style(`border-radius`,`2px`).style(`pointer-events`,`none`).style(`z-index`,`100`)),e},`createTooltip`)})),mHe=l({diagram:()=>dUe});function iL(e,t,n,r,i){let a=t[e];if(!a.width){if(n)a.text=Xm(a.text,i,r),a.textLines=a.text.split(Vs.lineBreakRegex).length,a.width=i,a.height=zm(a.text,r);else{let e=a.text.split(Vs.lineBreakRegex);a.textLines=e.length;let t=0;a.height=0,a.width=0;for(let n of e)a.width=Math.max(Bm(n,r),a.width),t=zm(n,r),a.height+=t}}return a}async function aL(e,t,n,r,i){let a=i.db,o=new IL(i);o.data.widthLimit=n.data.widthLimit/Math.min(PL,r.length);for(let[s,l]of r.entries()){let r=0;l.image={width:0,height:0,Y:0},l.sprite&&(l.image.width=48,l.image.height=48,l.image.Y=r,r=l.image.Y+l.image.height);let u=l.wrap&&FL.wrap,d=RL(FL);d.fontSize+=2,d.fontWeight=`bold`;let f=iL(`label`,l,u,d,o.data.widthLimit);if(f.Y=r+8,r=f.Y+f.height,l.type&&l.type.text!==``){l.type.text=`[`+l.type.text+`]`;let e=iL(`type`,l,u,RL(FL),o.data.widthLimit);e.Y=r+5,r=e.Y+e.height}if(l.descr&&l.descr.text!==``){let e=RL(FL);e.fontSize-=2;let t=iL(`descr`,l,u,e,o.data.widthLimit);t.Y=r+20,r=t.Y+t.height}if(s==0||s%PL===0){let e=n.data.startx+FL.diagramMarginX,t=n.data.stopy+FL.diagramMarginY+r;o.setData(e,e,t,t)}else{let e=o.data.stopx===o.data.startx?o.data.startx:o.data.stopx+FL.diagramMarginX,t=o.data.starty;o.setData(e,e,t,t)}o.name=l.alias;let p=a.getC4ShapeArray(l.alias),m=a.getC4ShapeKeys(l.alias);m.length>0&&await BL(o,e,p,m),t=l.alias;let h=a.getBoundaries(t);h.length>0&&await aL(e,t,o,h,i),l.alias!==`global`&&zL(e,l,o),n.data.stopy=Math.max(o.data.stopy+FL.c4ShapeMargin,n.data.stopy),n.data.stopx=Math.max(o.data.stopx+FL.c4ShapeMargin,n.data.stopx),jL=Math.max(jL,n.data.stopx),ML=Math.max(ML,n.data.stopy)}}var oL,hHe,sL,cL,lL,uL,dL,fL,pL,mL,hL,gL,_L,vL,yL,gHe,_He,vHe,yHe,bHe,xHe,SHe,CHe,wHe,THe,EHe,DHe,OHe,kHe,AHe,jHe,MHe,NHe,bL,PHe,FHe,xL,IHe,LHe,RHe,zHe,SL,CL,wL,BHe,VHe,HHe,UHe,WHe,GHe,KHe,qHe,JHe,TL,EL,YHe,XHe,ZHe,QHe,DL,$He,eUe,tUe,nUe,rUe,OL,iUe,kL,aUe,AL,jL,ML,NL,PL,FL,IL,LL,RL,oUe,zL,BL,sUe,VL,cUe,lUe,HL,uUe,dUe,fUe=o((()=>{rL(),P_(),Op(),ig(),Gp(),rh(),dc(),S(),h(),_p(),oL=(function(){var e=p(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,24],n=[1,25],r=[1,26],i=[1,27],a=[1,28],o=[1,63],s=[1,64],l=[1,65],u=[1,66],d=[1,67],f=[1,68],m=[1,69],h=[1,29],g=[1,30],_=[1,31],v=[1,32],y=[1,33],b=[1,34],x=[1,35],S=[1,36],C=[1,37],w=[1,38],T=[1,39],E=[1,40],D=[1,41],O=[1,42],k=[1,43],A=[1,44],j=[1,45],M=[1,46],N=[1,47],P=[1,48],F=[1,50],I=[1,51],L=[1,52],R=[1,53],ee=[1,54],z=[1,55],B=[1,56],te=[1,57],ne=[1,58],re=[1,59],ie=[1,60],ae=[14,42],oe=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],se=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],ce=[1,82],le=[1,83],ue=[1,84],de=[1,85],fe=[12,14,42],pe=[12,14,33,42],me=[12,14,33,42,76,77,79,80],he=[12,33],ge=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],_e={trace:p(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:`error`,6:`direction_tb`,7:`direction_bt`,8:`direction_rl`,9:`direction_lr`,11:`C4_CONTEXT`,12:`NEWLINE`,14:`EOF`,15:`C4_CONTAINER`,16:`C4_COMPONENT`,17:`C4_DYNAMIC`,18:`C4_DEPLOYMENT`,22:`title`,23:`accDescription`,24:`acc_title`,25:`acc_title_value`,26:`acc_descr`,27:`acc_descr_value`,28:`acc_descr_multiline_value`,33:`LBRACE`,34:`ENTERPRISE_BOUNDARY`,36:`SYSTEM_BOUNDARY`,37:`BOUNDARY`,38:`CONTAINER_BOUNDARY`,39:`NODE`,40:`NODE_L`,41:`NODE_R`,42:`RBRACE`,44:`PERSON`,45:`PERSON_EXT`,46:`SYSTEM`,47:`SYSTEM_DB`,48:`SYSTEM_QUEUE`,49:`SYSTEM_EXT`,50:`SYSTEM_EXT_DB`,51:`SYSTEM_EXT_QUEUE`,52:`CONTAINER`,53:`CONTAINER_DB`,54:`CONTAINER_QUEUE`,55:`CONTAINER_EXT`,56:`CONTAINER_EXT_DB`,57:`CONTAINER_EXT_QUEUE`,58:`COMPONENT`,59:`COMPONENT_DB`,60:`COMPONENT_QUEUE`,61:`COMPONENT_EXT`,62:`COMPONENT_EXT_DB`,63:`COMPONENT_EXT_QUEUE`,64:`REL`,65:`BIREL`,66:`REL_U`,67:`REL_D`,68:`REL_L`,69:`REL_R`,70:`REL_B`,71:`REL_INDEX`,72:`UPDATE_EL_STYLE`,73:`UPDATE_REL_STYLE`,74:`UPDATE_LAYOUT_CONFIG`,76:`STR`,77:`STR_KEY`,78:`STR_VALUE`,79:`ATTRIBUTE`,80:`ATTRIBUTE_EMPTY`},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:p(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:r.setDirection(`TB`);break;case 4:r.setDirection(`BT`);break;case 5:r.setDirection(`RL`);break;case 6:r.setDirection(`LR`);break;case 8:case 9:case 10:case 11:case 12:r.setC4Type(a[s-3]);break;case 19:r.setTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 20:r.setAccDescription(a[s].substring(15)),this.$=a[s].substring(15);break;case 21:this.$=a[s].trim(),r.setTitle(this.$);break;case 22:case 23:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 28:a[s].splice(2,0,`ENTERPRISE`),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 29:a[s].splice(2,0,`SYSTEM`),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 30:r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 31:a[s].splice(2,0,`CONTAINER`),r.addContainerBoundary(...a[s]),this.$=a[s];break;case 32:r.addDeploymentNode(`node`,...a[s]),this.$=a[s];break;case 33:r.addDeploymentNode(`nodeL`,...a[s]),this.$=a[s];break;case 34:r.addDeploymentNode(`nodeR`,...a[s]),this.$=a[s];break;case 35:r.popBoundaryParseStack();break;case 39:r.addPersonOrSystem(`person`,...a[s]),this.$=a[s];break;case 40:r.addPersonOrSystem(`external_person`,...a[s]),this.$=a[s];break;case 41:r.addPersonOrSystem(`system`,...a[s]),this.$=a[s];break;case 42:r.addPersonOrSystem(`system_db`,...a[s]),this.$=a[s];break;case 43:r.addPersonOrSystem(`system_queue`,...a[s]),this.$=a[s];break;case 44:r.addPersonOrSystem(`external_system`,...a[s]),this.$=a[s];break;case 45:r.addPersonOrSystem(`external_system_db`,...a[s]),this.$=a[s];break;case 46:r.addPersonOrSystem(`external_system_queue`,...a[s]),this.$=a[s];break;case 47:r.addContainer(`container`,...a[s]),this.$=a[s];break;case 48:r.addContainer(`container_db`,...a[s]),this.$=a[s];break;case 49:r.addContainer(`container_queue`,...a[s]),this.$=a[s];break;case 50:r.addContainer(`external_container`,...a[s]),this.$=a[s];break;case 51:r.addContainer(`external_container_db`,...a[s]),this.$=a[s];break;case 52:r.addContainer(`external_container_queue`,...a[s]),this.$=a[s];break;case 53:r.addComponent(`component`,...a[s]),this.$=a[s];break;case 54:r.addComponent(`component_db`,...a[s]),this.$=a[s];break;case 55:r.addComponent(`component_queue`,...a[s]),this.$=a[s];break;case 56:r.addComponent(`external_component`,...a[s]),this.$=a[s];break;case 57:r.addComponent(`external_component_db`,...a[s]),this.$=a[s];break;case 58:r.addComponent(`external_component_queue`,...a[s]),this.$=a[s];break;case 60:r.addRel(`rel`,...a[s]),this.$=a[s];break;case 61:r.addRel(`birel`,...a[s]),this.$=a[s];break;case 62:r.addRel(`rel_u`,...a[s]),this.$=a[s];break;case 63:r.addRel(`rel_d`,...a[s]),this.$=a[s];break;case 64:r.addRel(`rel_l`,...a[s]),this.$=a[s];break;case 65:r.addRel(`rel_r`,...a[s]),this.$=a[s];break;case 66:r.addRel(`rel_b`,...a[s]),this.$=a[s];break;case 67:a[s].splice(0,1),r.addRel(`rel`,...a[s]),this.$=a[s];break;case 68:r.updateElStyle(`update_el_style`,...a[s]),this.$=a[s];break;case 69:r.updateRelStyle(`update_rel_style`,...a[s]),this.$=a[s];break;case 70:r.updateLayoutConfig(`update_layout_config`,...a[s]),this.$=a[s];break;case 71:this.$=[a[s]];break;case 72:a[s].unshift(a[s-1]),this.$=a[s];break;case 73:case 75:this.$=a[s].trim();break;case 74:let e={};e[a[s-1].trim()]=a[s].trim(),this.$=e;break;case 76:this.$=``}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:f,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:ee,69:z,70:B,71:te,72:ne,73:re,74:ie},{13:70,19:20,20:21,21:22,22:t,23:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:f,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:ee,69:z,70:B,71:te,72:ne,73:re,74:ie},{13:71,19:20,20:21,21:22,22:t,23:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:f,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:ee,69:z,70:B,71:te,72:ne,73:re,74:ie},{13:72,19:20,20:21,21:22,22:t,23:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:f,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:ee,69:z,70:B,71:te,72:ne,73:re,74:ie},{13:73,19:20,20:21,21:22,22:t,23:n,24:r,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:f,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:ee,69:z,70:B,71:te,72:ne,73:re,74:ie},{14:[1,74]},e(ae,[2,13],{43:23,29:49,30:61,32:62,20:75,34:o,36:s,37:l,38:u,39:d,40:f,41:m,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:ee,69:z,70:B,71:te,72:ne,73:re,74:ie}),e(ae,[2,14]),e(oe,[2,16],{12:[1,76]}),e(ae,[2,36],{12:[1,77]}),e(se,[2,19]),e(se,[2,20]),{25:[1,78]},{27:[1,79]},e(se,[2,23]),{35:80,75:81,76:ce,77:le,79:ue,80:de},{35:86,75:81,76:ce,77:le,79:ue,80:de},{35:87,75:81,76:ce,77:le,79:ue,80:de},{35:88,75:81,76:ce,77:le,79:ue,80:de},{35:89,75:81,76:ce,77:le,79:ue,80:de},{35:90,75:81,76:ce,77:le,79:ue,80:de},{35:91,75:81,76:ce,77:le,79:ue,80:de},{35:92,75:81,76:ce,77:le,79:ue,80:de},{35:93,75:81,76:ce,77:le,79:ue,80:de},{35:94,75:81,76:ce,77:le,79:ue,80:de},{35:95,75:81,76:ce,77:le,79:ue,80:de},{35:96,75:81,76:ce,77:le,79:ue,80:de},{35:97,75:81,76:ce,77:le,79:ue,80:de},{35:98,75:81,76:ce,77:le,79:ue,80:de},{35:99,75:81,76:ce,77:le,79:ue,80:de},{35:100,75:81,76:ce,77:le,79:ue,80:de},{35:101,75:81,76:ce,77:le,79:ue,80:de},{35:102,75:81,76:ce,77:le,79:ue,80:de},{35:103,75:81,76:ce,77:le,79:ue,80:de},{35:104,75:81,76:ce,77:le,79:ue,80:de},e(fe,[2,59]),{35:105,75:81,76:ce,77:le,79:ue,80:de},{35:106,75:81,76:ce,77:le,79:ue,80:de},{35:107,75:81,76:ce,77:le,79:ue,80:de},{35:108,75:81,76:ce,77:le,79:ue,80:de},{35:109,75:81,76:ce,77:le,79:ue,80:de},{35:110,75:81,76:ce,77:le,79:ue,80:de},{35:111,75:81,76:ce,77:le,79:ue,80:de},{35:112,75:81,76:ce,77:le,79:ue,80:de},{35:113,75:81,76:ce,77:le,79:ue,80:de},{35:114,75:81,76:ce,77:le,79:ue,80:de},{35:115,75:81,76:ce,77:le,79:ue,80:de},{20:116,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:f,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:ee,69:z,70:B,71:te,72:ne,73:re,74:ie},{12:[1,118],33:[1,117]},{35:119,75:81,76:ce,77:le,79:ue,80:de},{35:120,75:81,76:ce,77:le,79:ue,80:de},{35:121,75:81,76:ce,77:le,79:ue,80:de},{35:122,75:81,76:ce,77:le,79:ue,80:de},{35:123,75:81,76:ce,77:le,79:ue,80:de},{35:124,75:81,76:ce,77:le,79:ue,80:de},{35:125,75:81,76:ce,77:le,79:ue,80:de},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(ae,[2,15]),e(oe,[2,17],{21:22,19:130,22:t,23:n,24:r,26:i,28:a}),e(ae,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:n,24:r,26:i,28:a,34:o,36:s,37:l,38:u,39:d,40:f,41:m,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:ee,69:z,70:B,71:te,72:ne,73:re,74:ie}),e(se,[2,21]),e(se,[2,22]),e(fe,[2,39]),e(pe,[2,71],{75:81,35:132,76:ce,77:le,79:ue,80:de}),e(me,[2,73]),{78:[1,133]},e(me,[2,75]),e(me,[2,76]),e(fe,[2,40]),e(fe,[2,41]),e(fe,[2,42]),e(fe,[2,43]),e(fe,[2,44]),e(fe,[2,45]),e(fe,[2,46]),e(fe,[2,47]),e(fe,[2,48]),e(fe,[2,49]),e(fe,[2,50]),e(fe,[2,51]),e(fe,[2,52]),e(fe,[2,53]),e(fe,[2,54]),e(fe,[2,55]),e(fe,[2,56]),e(fe,[2,57]),e(fe,[2,58]),e(fe,[2,60]),e(fe,[2,61]),e(fe,[2,62]),e(fe,[2,63]),e(fe,[2,64]),e(fe,[2,65]),e(fe,[2,66]),e(fe,[2,67]),e(fe,[2,68]),e(fe,[2,69]),e(fe,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(he,[2,28]),e(he,[2,29]),e(he,[2,30]),e(he,[2,31]),e(he,[2,32]),e(he,[2,33]),e(he,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(oe,[2,18]),e(ae,[2,38]),e(pe,[2,72]),e(me,[2,74]),e(fe,[2,24]),e(fe,[2,35]),e(ge,[2,25]),e(ge,[2,26],{12:[1,138]}),e(ge,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:p(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:p(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,l=0,u=0,d=0,f=2,m=1,h=a.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(_.yy[v]=this.yy[v]);g.setInput(e,_.yy),_.yy.lexer=g,_.yy.parser=this,g.yylloc===void 0&&(g.yylloc={});var y=g.yylloc;a.push(y);var b=g.options&&g.options.ranges;this.parseError=typeof _.yy.parseError==`function`?_.yy.parseError:Object.getPrototypeOf(this).parseError;function x(e){n.length-=2*e,i.length-=e,a.length-=e}p(x,`popStack`);function S(){var e=r.pop()||g.lex()||m;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}p(S,`lex`);for(var C,w,T,E,D,O={},k,A,j,M;;){if(T=n[n.length-1],this.defaultActions[T]?E=this.defaultActions[T]:(C??=S(),E=o[T]&&o[T][C]),E===void 0||!E.length||!E[0]){var N=``;for(k in M=[],o[T])this.terminals_[k]&&k>f&&M.push(`'`+this.terminals_[k]+`'`);N=g.showPosition?`Parse error on line `+(l+1)+`:882+`+g.showPosition()+`883+Expecting `+M.join(`, `)+`, got '`+(this.terminals_[C]||C)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(C==m?`end of input`:`'`+(this.terminals_[C]||C)+`'`),this.parseError(N,{text:g.match,token:this.terminals_[C]||C,line:g.yylineno,loc:y,expected:M})}if(E[0]instanceof Array&&E.length>1)throw Error(`Parse Error: multiple actions possible at state: `+T+`, token: `+C);switch(E[0]){case 1:n.push(C),i.push(g.yytext),a.push(g.yylloc),n.push(E[1]),C=null,w?(C=w,w=null):(u=g.yyleng,s=g.yytext,l=g.yylineno,y=g.yylloc,d>0&&d--);break;case 2:if(A=this.productions_[E[1]][1],O.$=i[i.length-A],O._$={first_line:a[a.length-(A||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(A||1)].first_column,last_column:a[a.length-1].last_column},b&&(O._$.range=[a[a.length-(A||1)].range[0],a[a.length-1].range[1]]),D=this.performAction.apply(O,[s,u,l,_.yy,E[1],i,a].concat(h)),D!==void 0)return D;A&&(n=n.slice(0,-1*A*2),i=i.slice(0,-1*A),a=a.slice(0,-1*A)),n.push(this.productions_[E[1]][0]),i.push(O.$),a.push(O._$),j=o[n[n.length-2]][n[n.length-1]],n.push(j);break;case 3:return!0}}return!0},`parse`)};_e.lexer=(function(){return{EOF:1,parseError:p(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:p(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:p(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:p(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:p(function(){return this._more=!0,this},`more`),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).884+`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:p(function(e){this.unput(this.match.slice(e))},`less`),pastInput:p(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:p(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:p(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`885+`+t+`^`},`showPosition`),test_match:p(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.886+`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:p(function(){return this.next()||this.lex()},`lex`),begin:p(function(e){this.conditionStack.push(e)},`begin`),popState:p(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:p(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:p(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:p(function(e){this.begin(e)},`pushState`),stateStackSize:p(function(){return this.conditionStack.length},`stateStackSize`),options:{},performAction:p(function(e,t,n,r){switch(n){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin(`acc_title`),24;case 7:return this.popState(),`acc_title_value`;case 8:return this.begin(`acc_descr`),26;case 9:return this.popState(),`acc_descr_value`;case 10:this.begin(`acc_descr_multiline`);break;case 11:this.popState();break;case 12:return`acc_descr_multiline_value`;case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin(`person_ext`),45;case 23:return this.begin(`person`),44;case 24:return this.begin(`system_ext_queue`),51;case 25:return this.begin(`system_ext_db`),50;case 26:return this.begin(`system_ext`),49;case 27:return this.begin(`system_queue`),48;case 28:return this.begin(`system_db`),47;case 29:return this.begin(`system`),46;case 30:return this.begin(`boundary`),37;case 31:return this.begin(`enterprise_boundary`),34;case 32:return this.begin(`system_boundary`),36;case 33:return this.begin(`container_ext_queue`),57;case 34:return this.begin(`container_ext_db`),56;case 35:return this.begin(`container_ext`),55;case 36:return this.begin(`container_queue`),54;case 37:return this.begin(`container_db`),53;case 38:return this.begin(`container`),52;case 39:return this.begin(`container_boundary`),38;case 40:return this.begin(`component_ext_queue`),63;case 41:return this.begin(`component_ext_db`),62;case 42:return this.begin(`component_ext`),61;case 43:return this.begin(`component_queue`),60;case 44:return this.begin(`component_db`),59;case 45:return this.begin(`component`),58;case 46:return this.begin(`node`),39;case 47:return this.begin(`node`),39;case 48:return this.begin(`node_l`),40;case 49:return this.begin(`node_r`),41;case 50:return this.begin(`rel`),64;case 51:return this.begin(`birel`),65;case 52:return this.begin(`rel_u`),66;case 53:return this.begin(`rel_u`),66;case 54:return this.begin(`rel_d`),67;case 55:return this.begin(`rel_d`),67;case 56:return this.begin(`rel_l`),68;case 57:return this.begin(`rel_l`),68;case 58:return this.begin(`rel_r`),69;case 59:return this.begin(`rel_r`),69;case 60:return this.begin(`rel_b`),70;case 61:return this.begin(`rel_index`),71;case 62:return this.begin(`update_el_style`),72;case 63:return this.begin(`update_rel_style`),73;case 64:return this.begin(`update_layout_config`),74;case 65:return`EOF_IN_STRUCT`;case 66:return this.begin(`attribute`),`ATTRIBUTE_EMPTY`;case 67:this.begin(`attribute`);break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin(`string`);break;case 73:this.popState();break;case 74:return`STR`;case 75:this.begin(`string_kv`);break;case 76:return this.begin(`string_kv_key`),`STR_KEY`;case 77:this.popState(),this.begin(`string_kv_value`);break;case 78:return`STR_VALUE`;case 79:this.popState(),this.popState();break;case 80:return`STR`;case 81:return`LBRACE`;case 82:return`RBRACE`;case 83:return`SPACE`;case 84:return`EOL`;case 85:return 14}},`anonymous`),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}}})();function ve(){this.yy={}}return p(ve,`Parser`),ve.prototype=_e,_e.Parser=ve,new ve})(),oL.parser=oL,hHe=oL,sL=p(e=>Z()[e],`getRequiredConfig`),cL=p((e,t)=>{for(let[n,r]of Object.entries(t))if(r!==void 0){if(typeof r==`object`){let[t,n]=Object.entries(r)[0];e[t]=n}else e[n]=r}},`assignAttributes`),lL=p(()=>({alias:`global`,label:{text:`global`},type:{text:`global`},tags:null,link:null,parentBoundary:``}),`createGlobalBoundary`),uL=[],dL=[``],fL=`global`,pL=``,mL=[lL()],hL=[],gL=``,_L=!1,vL=4,yL=2,_He=p(function(){return gHe},`getC4Type`),vHe=p(function(e){gHe=js(e,Z())},`setC4Type`),yHe=p(function(e,t,n,r,i,a,o,s,l){if(e==null||t==null||n==null||r==null)return;let u={},d=hL.find(e=>e.from===t&&e.to===n);if(d?u=d:hL.push(u),u.type=e,u.from=t,u.to=n,u.label={text:r},i==null)u.techn={text:``};else if(typeof i==`object`){let[e,t]=Object.entries(i)[0];u[e]={text:t}}else u.techn={text:i};if(a==null)u.descr={text:``};else if(typeof a==`object`){let[e,t]=Object.entries(a)[0];u[e]={text:t}}else u.descr={text:a};cL(u,{sprite:o,tags:s,link:l}),u.wrap=SL()},`addRel`),bHe=p(function(e,t,n,r,i,a,o){if(t===null||n===null)return;let s={},l=uL.find(e=>e.alias===t);if(l&&t===l.alias?s=l:(s.alias=t,uL.push(s)),n==null?s.label={text:``}:s.label={text:n},r==null)s.descr={text:``};else if(typeof r==`object`){let[e,t]=Object.entries(r)[0];s[e]={text:t}}else s.descr={text:r};cL(s,{sprite:i,tags:a,link:o}),s.typeC4Shape={text:e},s.parentBoundary=fL,s.wrap=SL()},`addPersonOrSystem`),xHe=p(function(e,t,n,r,i,a,o,s){if(t===null||n===null)return;let l={},u=uL.find(e=>e.alias===t);if(u&&t===u.alias?l=u:(l.alias=t,uL.push(l)),n==null?l.label={text:``}:l.label={text:n},r==null)l.techn={text:``};else if(typeof r==`object`){let[e,t]=Object.entries(r)[0];l[e]={text:t}}else l.techn={text:r};if(i==null)l.descr={text:``};else if(typeof i==`object`){let[e,t]=Object.entries(i)[0];l[e]={text:t}}else l.descr={text:i};cL(l,{sprite:a,tags:o,link:s}),l.wrap=SL(),l.typeC4Shape={text:e},l.parentBoundary=fL},`addContainer`),SHe=p(function(e,t,n,r,i,a,o,s){if(t===null||n===null)return;let l={},u=uL.find(e=>e.alias===t);if(u&&t===u.alias?l=u:(l.alias=t,uL.push(l)),n==null?l.label={text:``}:l.label={text:n},r==null)l.techn={text:``};else if(typeof r==`object`){let[e,t]=Object.entries(r)[0];l[e]={text:t}}else l.techn={text:r};if(i==null)l.descr={text:``};else if(typeof i==`object`){let[e,t]=Object.entries(i)[0];l[e]={text:t}}else l.descr={text:i};cL(l,{sprite:a,tags:o,link:s}),l.wrap=SL(),l.typeC4Shape={text:e},l.parentBoundary=fL},`addComponent`),CHe=p(function(e,t,n,r,i){if(e===null||t===null)return;let a={},o=mL.find(t=>t.alias===e);if(o&&e===o.alias?a=o:(a.alias=e,mL.push(a)),t==null?a.label={text:``}:a.label={text:t},n==null)a.type={text:`system`};else if(typeof n==`object`){let[e,t]=Object.entries(n)[0];a[e]={text:t}}else a.type={text:n};cL(a,{tags:r,link:i}),a.parentBoundary=fL,a.wrap=SL(),pL=fL,fL=e,dL.push(pL)},`addPersonOrSystemBoundary`),wHe=p(function(e,t,n,r,i){if(e===null||t===null)return;let a={},o=mL.find(t=>t.alias===e);if(o&&e===o.alias?a=o:(a.alias=e,mL.push(a)),t==null?a.label={text:``}:a.label={text:t},n==null)a.type={text:`container`};else if(typeof n==`object`){let[e,t]=Object.entries(n)[0];a[e]={text:t}}else a.type={text:n};cL(a,{tags:r,link:i}),a.parentBoundary=fL,a.wrap=SL(),pL=fL,fL=e,dL.push(pL)},`addContainerBoundary`),THe=p(function(e,t,n,r,i,a,o,s){if(t===null||n===null)return;let l={},u=mL.find(e=>e.alias===t);if(u&&t===u.alias?l=u:(l.alias=t,mL.push(l)),n==null?l.label={text:``}:l.label={text:n},r==null)l.type={text:`node`};else if(typeof r==`object`){let[e,t]=Object.entries(r)[0];l[e]={text:t}}else l.type={text:r};if(i==null)l.descr={text:``};else if(typeof i==`object`){let[e,t]=Object.entries(i)[0];l[e]={text:t}}else l.descr={text:i};cL(l,{tags:o,link:s}),l.nodeType=e,l.parentBoundary=fL,l.wrap=SL(),pL=fL,fL=t,dL.push(pL)},`addDeploymentNode`),EHe=p(function(){fL=pL,dL.pop(),pL=dL.pop(),dL.push(pL)},`popBoundaryParseStack`),DHe=p(function(e,t,n,r,i,a,o,s,l,u,d){let f=uL.find(e=>e.alias===t);if(!(f===void 0&&(f=mL.find(e=>e.alias===t),f===void 0))){if(n!=null){if(typeof n==`object`){let[e,t]=Object.entries(n)[0];f[e]=t}else f.bgColor=n}if(r!=null){if(typeof r==`object`){let[e,t]=Object.entries(r)[0];f[e]=t}else f.fontColor=r}if(i!=null){if(typeof i==`object`){let[e,t]=Object.entries(i)[0];f[e]=t}else f.borderColor=i}if(a!=null){if(typeof a==`object`){let[e,t]=Object.entries(a)[0];f[e]=t}else f.shadowing=a}if(o!=null){if(typeof o==`object`){let[e,t]=Object.entries(o)[0];f[e]=t}else f.shape=o}if(s!=null){if(typeof s==`object`){let[e,t]=Object.entries(s)[0];f[e]=t}else f.sprite=s}if(l!=null){if(typeof l==`object`){let[e,t]=Object.entries(l)[0];f[e]=t}else f.techn=l}if(u!=null){if(typeof u==`object`){let[e,t]=Object.entries(u)[0];f[e]=t}else f.legendText=u}if(d!=null){if(typeof d==`object`){let[e,t]=Object.entries(d)[0];f[e]=t}else f.legendSprite=d}}},`updateElStyle`),OHe=p(function(e,t,n,r,i,a,o){let s=hL.find(e=>e.from===t&&e.to===n);if(s!==void 0){if(r!=null){if(typeof r==`object`){let[e,t]=Object.entries(r)[0];s[e]=t}else s.textColor=r}if(i!=null){if(typeof i==`object`){let[e,t]=Object.entries(i)[0];s[e]=t}else s.lineColor=i}if(a!=null){if(typeof a==`object`){let[e,t]=Object.entries(a)[0];s[e]=parseInt(t)}else s.offsetX=parseInt(a)}if(o!=null){if(typeof o==`object`){let[e,t]=Object.entries(o)[0];s[e]=parseInt(t)}else s.offsetY=parseInt(o)}}},`updateRelStyle`),kHe=p(function(e,t,n){let r=vL,i=yL;if(typeof t==`object`){let e=Object.values(t)[0];r=parseInt(e)}else r=parseInt(t);if(typeof n==`object`){let e=Object.values(n)[0];i=parseInt(e)}else i=parseInt(n);r>=1&&(vL=r),i>=1&&(yL=i)},`updateLayoutConfig`),AHe=p(function(){return vL},`getC4ShapeInRow`),jHe=p(function(){return yL},`getC4BoundaryInRow`),MHe=p(function(){return fL},`getCurrentBoundaryParse`),NHe=p(function(){return pL},`getParentBoundaryParse`),bL=p(function(e){return e==null?uL:uL.filter(t=>t.parentBoundary===e)},`getC4ShapeArray`),PHe=p(function(e){return uL.find(t=>t.alias===e)},`getC4Shape`),FHe=p(function(e){return Object.keys(bL(e))},`getC4ShapeKeys`),xL=p(function(e){return e==null?mL:mL.filter(t=>t.parentBoundary===e)},`getBoundaries`),IHe=xL,LHe=p(function(){return hL},`getRels`),RHe=p(function(){return gL},`getTitle`),zHe=p(function(e){_L=e},`setWrap`),SL=p(function(){return _L},`autoWrap`),CL={addPersonOrSystem:bHe,addPersonOrSystemBoundary:CHe,addContainer:xHe,addContainerBoundary:wHe,addComponent:SHe,addDeploymentNode:THe,popBoundaryParseStack:EHe,addRel:yHe,updateElStyle:DHe,updateRelStyle:OHe,updateLayoutConfig:kHe,autoWrap:SL,setWrap:zHe,getC4ShapeArray:bL,getC4Shape:PHe,getC4ShapeKeys:FHe,getBoundaries:xL,getBoundarys:IHe,getCurrentBoundaryParse:MHe,getParentBoundaryParse:NHe,getRels:LHe,getTitle:RHe,getC4Type:_He,getC4ShapeInRow:AHe,getC4BoundaryInRow:jHe,setAccTitle:Zs,getAccTitle:Qs,getAccDescription:ec,setAccDescription:$s,getConfig:p(()=>sL(`c4`),`getConfig`),clear:p(function(){uL=[],mL=[lL()],pL=``,fL=`global`,dL=[``],hL=[],dL=[``],gL=``,_L=!1,vL=4,yL=2},`clear`),LINETYPE:{SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},ARROWTYPE:{FILLED:0,OPEN:1},PLACEMENT:{LEFTOF:0,RIGHTOF:1,OVER:2},setTitle:p(function(e){gL=js(e,Z())},`setTitle`),setC4Type:vHe},wL=p(function(e,t){return XI(e,t)},`drawRect`),BHe=p((e,t,n,r)=>{let i=e.append(`g`),a=0;for(let e of t){let t=e.textColor?e.textColor:`#444444`,o=e.lineColor?e.lineColor:`#444444`,s=e.offsetX?parseInt(String(e.offsetX)):0,l=e.offsetY?parseInt(String(e.offsetY)):0;if(a===0){let t=i.append(`line`);t.attr(`x1`,e.startPoint.x),t.attr(`y1`,e.startPoint.y),t.attr(`x2`,e.endPoint.x),t.attr(`y2`,e.endPoint.y),t.attr(`stroke-width`,`1`),t.attr(`stroke`,o),t.style(`fill`,`none`),e.type!==`rel_b`&&t.attr(`marker-end`,`url(#`+r+`-arrowhead)`),(e.type===`birel`||e.type===`rel_b`)&&t.attr(`marker-start`,`url(#`+r+`-arrowend)`),a=-1}else{let t=i.append(`path`);t.attr(`fill`,`none`).attr(`stroke-width`,`1`).attr(`stroke`,o).attr(`d`,`Mstartx,starty Qcontrolx,controly stopx,stopy `.replaceAll(`startx`,e.startPoint.x).replaceAll(`starty`,e.startPoint.y).replaceAll(`controlx`,e.startPoint.x+(e.endPoint.x-e.startPoint.x)/2-(e.endPoint.x-e.startPoint.x)/4).replaceAll(`controly`,e.startPoint.y+(e.endPoint.y-e.startPoint.y)/2).replaceAll(`stopx`,e.endPoint.x).replaceAll(`stopy`,e.endPoint.y)),e.type!==`rel_b`&&t.attr(`marker-end`,`url(#`+r+`-arrowhead)`),(e.type===`birel`||e.type===`rel_b`)&&t.attr(`marker-start`,`url(#`+r+`-arrowend)`)}let u=e.label.width,d=n.messageFont();TL(n)(e.label.text,i,Math.min(e.startPoint.x,e.endPoint.x)+Math.abs(e.endPoint.x-e.startPoint.x)/2+s,Math.min(e.startPoint.y,e.endPoint.y)+Math.abs(e.endPoint.y-e.startPoint.y)/2+l,u,e.label.height,{fill:t},d),e.techn&&e.techn.text!==``&&(d=n.messageFont(),TL(n)(`[`+e.techn.text+`]`,i,Math.min(e.startPoint.x,e.endPoint.x)+Math.abs(e.endPoint.x-e.startPoint.x)/2+s,Math.min(e.startPoint.y,e.endPoint.y)+Math.abs(e.endPoint.y-e.startPoint.y)/2+n.messageFontSize+5+l,Math.max(u,e.techn.width),e.techn.height,{fill:t,"font-style":`italic`},d))}},`drawRels`),VHe=p(function(e,t,n){let r=e.append(`g`),i=t.bgColor?t.bgColor:`none`,a=t.borderColor?t.borderColor:`#444444`,o=t.fontColor?t.fontColor:`black`,s={"stroke-width":1,"stroke-dasharray":`7.0,7.0`};t.nodeType&&(s={"stroke-width":1}),wL(r,{x:t.x,y:t.y,fill:i,stroke:a,width:t.width,height:t.height,rx:2.5,ry:2.5,attrs:s});let l=n.boundaryFont();l.fontWeight=`bold`,l.fontSize+=2,l.fontColor=o,TL(n)(t.label.text,r,t.x,t.y+t.label.Y,t.width,t.height,{fill:`#444444`},l),t.type&&t.type.text!==``&&(l=n.boundaryFont(),l.fontColor=o,TL(n)(t.type.text,r,t.x,t.y+t.type.Y,t.width,t.height,{fill:`#444444`},l)),t.descr&&t.descr.text!==``&&(l=n.boundaryFont(),l.fontSize-=2,l.fontColor=o,TL(n)(t.descr.text,r,t.x,t.y+t.descr.Y,t.width,t.height,{fill:`#444444`},l))},`drawBoundary`),HHe=p(function(e,t){e.append(`defs`).append(`symbol`).attr(`id`,t+`-database`).attr(`fill-rule`,`evenodd`).attr(`clip-rule`,`evenodd`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z`)},`insertDatabaseIcon`),UHe=p(function(e,t){e.append(`defs`).append(`symbol`).attr(`id`,t+`-computer`).attr(`width`,`24`).attr(`height`,`24`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z`)},`insertComputerIcon`),WHe=p(function(e,t){e.append(`defs`).append(`symbol`).attr(`id`,t+`-clock`).attr(`width`,`24`).attr(`height`,`24`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z`)},`insertClockIcon`),GHe=p(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-arrowhead`).attr(`refX`,9).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`)},`insertArrowHead`),KHe=p(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-arrowend`).attr(`refX`,1).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 10 0 L 0 5 L 10 10 z`)},`insertArrowEnd`),qHe=p(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-filled-head`).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`)},`insertArrowFilledHead`),JHe=p(function(e,t){let n=e.append(`defs`).append(`marker`).attr(`id`,t+`-crosshead`).attr(`markerWidth`,15).attr(`markerHeight`,8).attr(`orient`,`auto`).attr(`refX`,16).attr(`refY`,4);n.append(`path`).attr(`fill`,`black`).attr(`stroke`,`#000000`).style(`stroke-dasharray`,`0, 0`).attr(`stroke-width`,`1px`).attr(`d`,`M 9,2 V 6 L16,4 Z`),n.append(`path`).attr(`fill`,`none`).attr(`stroke`,`#000000`).style(`stroke-dasharray`,`0, 0`).attr(`stroke-width`,`1px`).attr(`d`,`M 0,1 L 6,7 M 6,1 L 0,7`)},`insertArrowCrossHead`),TL=(function(){function e(e,t,n,i,a,o,s){r(t.append(`text`).attr(`x`,n+a/2).attr(`y`,i+o/2+5).style(`text-anchor`,`middle`).text(e),s)}p(e,`byText`);function t(e,t,n,i,a,o,s,l){let{fontSize:u,fontFamily:d,fontWeight:f}=l,p=e.split(Vs.lineBreakRegex);for(let e=0;e<p.length;e++){let o=e*u-u*(p.length-1)/2,l=t.append(`text`).attr(`x`,n+a/2).attr(`y`,i).style(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).style(`font-size`,u).style(`font-weight`,f).style(`font-family`,d);l.append(`tspan`).attr(`dy`,o).text(p[e]).attr(`alignment-baseline`,`mathematical`),r(l,s)}}p(t,`byTspan`);function n(e,n,i,a,o,s,l,u){let d=n.append(`switch`),f=d.append(`foreignObject`).attr(`x`,i).attr(`y`,a).attr(`width`,o).attr(`height`,s).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`);f.append(`div`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).text(e),t(e,d,i,a,o,s,l,u),r(f,l)}p(n,`byFo`);function r(e,t){for(let n in t)t.hasOwnProperty(n)&&e.attr(n,t[n])}return p(r,`_setTextAttrs`),function(r){return r.textPlacement===`fo`?n:r.textPlacement===`old`?e:t}})(),EL={drawRect:wL,drawBoundary:VHe,drawRels:BHe,insertArrowHead:GHe,insertArrowEnd:KHe,insertArrowFilledHead:qHe,insertArrowCrossHead:JHe,insertDatabaseIcon:HHe,insertComputerIcon:UHe,insertClockIcon:WHe},YHe=p((e,t)=>{if(t===`sandbox`){let t=$c(`#i`+e).node()?.contentDocument;if(!t)throw Error(`Sandbox iframe #i${e} is missing its content document`);return{root:$c(t.body),doc:t}}return{root:$c(`body`),doc:document}},`getDiagramRoot`),XHe=new Set([`system_queue`,`external_system_queue`,`container_queue`,`external_container_queue`,`component_queue`,`external_component_queue`]),ZHe=new Set([`system_db`,`external_system_db`,`container_db`,`external_container_db`,`component_db`,`external_component_db`]),QHe={person:`person`,box:`rounded`,rounded:`rounded`,cylinder:`cylinder`,database:`cylinder`,db:`cylinder`,queue:`h-cyl`,pipe:`h-cyl`,component:`fr-rect`},DL=p(e=>e?QHe[e.toLowerCase()]:void 0,`keywordShape`),$He=p(e=>{let t=DL(e.shape)??DL(e.sprite);if(t)return t;if(e.tags)for(let t of e.tags.split(`,`)){let e=DL(t.trim());if(e)return e}let n=e.typeC4Shape.text;return n===`person`||n===`external_person`?`person`:ZHe.has(n)?`cylinder`:XHe.has(n)?`h-cyl`:`rounded`},`resolveNodeShape`),eUe={person:`Person`,system:`Software System`,container:`Container`,component:`Component`},tUe=p(e=>{let t=e.replace(/^external_/,``).replace(/_(db|queue)$/,``);return eUe[t]??t.replace(/_/g,` `)},`stereotypeLabel`),nUe=p(e=>e.startsWith(`external_`),`isExternal`),rUe=p(e=>{let t=tUe(e.typeC4Shape.text);return e.techn?.text?`[${t}: ${e.techn.text}]`:`[${t}]`},`stereotypeText`),OL=[`person`,`system`,`system_db`,`system_queue`,`container`,`container_db`,`container_queue`,`component`,`component_db`,`component_queue`].flatMap(e=>[e,`external_${e}`]),iUe=new Set(OL),kL=p(e=>iUe.has(e),`isC4ElementType`),aUe=p((e,t)=>{let n=e.typeC4Shape.text,r=e.bgColor??(kL(n)&&t[`${n}_bg_color`]),i=e.borderColor??(kL(n)&&t[`${n}_border_color`]),a=[];return r&&a.push(`fill:${r}`),i&&a.push(`stroke:${i}`),a.push(`color:${e.fontColor??`#FFFFFF`}`),a},`elementCssStyles`),AL=p((e,t,n,r,i)=>{let a=e.typeC4Shape.text,o=[`c4-shape`,`c4-${a}`];nUe(a)&&o.push(`c4-external`);let s=$He(e),l=aUe(e,t);return(s===`rounded`||s===`fr-rect`)&&l.push(`rx:12px`,`ry:12px`),{id:e.alias,label:e.label.text,stereotype:rUe(e),description:e.descr?.text?[e.descr.text]:void 0,labelType:`string`,isGroup:!1,shape:s,cssClasses:o.join(` `),cssStyles:l,padding:n,look:r,useHtmlLabels:!1,width:i}},`buildC4Node`),jL=0,ML=0,NL=4,PL=2,oL.yy=CL,FL={},IL=class{static{p(this,`Bounds`)}constructor(e){this.name=``,this.data={},this.data.startx=void 0,this.data.stopx=void 0,this.data.starty=void 0,this.data.stopy=void 0,this.data.widthLimit=void 0,this.nextData={},this.nextData.startx=void 0,this.nextData.stopx=void 0,this.nextData.starty=void 0,this.nextData.stopy=void 0,this.nextData.cnt=0,LL(e.db.getConfig())}setData(e,t,n,r){this.nextData.startx=this.data.startx=e,this.nextData.stopx=this.data.stopx=t,this.nextData.starty=this.data.starty=n,this.nextData.stopy=this.data.stopy=r}updateVal(e,t,n,r){e[t]=e[t]===void 0?n:r(n,e[t])}insert(e){this.nextData.cnt=this.nextData.cnt+1;let t=this.nextData.stopx,n=this.data.widthLimit,r=this.nextData.startx===this.nextData.stopx?t+e.margin:t+e.margin*2,i=r+e.width,a=this.nextData.starty+e.margin*2,o=a+e.height;(r>=n||i>=n||this.nextData.cnt>NL)&&(r=this.nextData.startx+e.margin+FL.nextLinePaddingX,a=this.nextData.stopy+e.margin*2,this.nextData.stopx=i=r+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=o=a+e.height,this.nextData.cnt=1),e.x=r,e.y=a,this.updateVal(this.data,`startx`,r,Math.min),this.updateVal(this.data,`starty`,a,Math.min),this.updateVal(this.data,`stopx`,i,Math.max),this.updateVal(this.data,`stopy`,o,Math.max),this.updateVal(this.nextData,`startx`,r,Math.min),this.updateVal(this.nextData,`starty`,a,Math.min),this.updateVal(this.nextData,`stopx`,i,Math.max),this.updateVal(this.nextData,`stopy`,o,Math.max)}init(e){this.name=``,this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},LL(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},LL=p(function(e){qo(FL,e),e?.fontFamily&&(FL.personFontFamily=FL.systemFontFamily=FL.messageFontFamily=e.fontFamily),e?.fontSize&&(FL.personFontSize=FL.systemFontSize=FL.messageFontSize=e.fontSize),e?.fontWeight&&(FL.personFontWeight=FL.systemFontWeight=FL.messageFontWeight=e.fontWeight)},`setConf`),RL=p(e=>({fontFamily:e.boundaryFontFamily,fontSize:e.boundaryFontSize,fontWeight:e.boundaryFontWeight}),`boundaryFont`),oUe=p(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),`messageFont`),p(iL,`calcC4ShapeTextWH`),zL=p(function(e,t,n){let r=n.data.startx,i=n.data.starty;t.x=r,t.y=i,t.width=n.data.stopx-r,t.height=n.data.stopy-i,t.label.y=FL.c4ShapeMargin-35;let a=t.wrap&&FL.wrap,o=RL(FL);o.fontSize+=2,o.fontWeight=`bold`,iL(`label`,t,a,o,Bm(t.label.text,o)),EL.drawBoundary(e,t,FL)},`drawBoundary`),BL=p(async function(e,t,n,r){let i=Z(),a=i.look??`classic`,o={config:i},s=t.attr(`id`)??``,l=r.map(e=>n[Number(e)]),u=p(e=>{let t=e.shape?N_[e.shape]:void 0;if(!t)throw Error(`C4: no shape handler for "${e.shape}"`);return t},`shapeHandlerFor`);await Promise.all(l.map(async e=>{let n=AL(e,FL,FL.c4ShapePadding,a,FL.width);n.domId=`${s}-${n.id}`;let r=await u(n)(t,n,o);e.width=n.width??FL.width,e.height=n.height??FL.height,e.margin=FL.c4ShapeMargin,r.remove()}));for(let t of l)e.insert(t);await Promise.all(l.map(async e=>{let n=AL(e,FL,FL.c4ShapePadding,a,FL.width);n.domId=`${s}-${n.id}`,n.x=e.x+e.width/2,n.y=e.y+e.height/2;let r=t.append(`g`).attr(`transform`,`translate(${e.x+e.width/2}, ${e.y+e.height/2})`);await u(n)(r,n,o),e.intersect=n.intersect})),e.bumpLastMargin(FL.c4ShapeMargin)},`drawC4ShapeArray`),sUe=class{static{p(this,`Point`)}constructor(e,t){this.x=e,this.y=t}},VL=p(function(e,t){if(!e.intersect)throw Error(`C4 shape "${e.alias}" has no intersect function. Please report this to https://github.com/mermaid-js/mermaid/issues`);let{x:n,y:r}=e.intersect(t);return new sUe(n,r)},`getIntersectPoint`),cUe=p(function(e,t){let n={x:0,y:0};n.x=t.x+t.width/2,n.y=t.y+t.height/2;let r=VL(e,n);return n.x=e.x+e.width/2,n.y=e.y+e.height/2,{startPoint:r,endPoint:VL(t,n)}},`getIntersectPoints`),lUe=p(function(e,t,n,r,i){let a=r.db.getC4Type(),o=0;for(let e of t){o+=1;let t=e.wrap&&FL.wrap,r=oUe(FL);a===`C4Dynamic`&&(e.label.text=o+`: `+e.label.text);let i=Bm(e.label.text,r);iL(`label`,e,t,r,i),e.techn&&e.techn.text!==``&&(i=Bm(e.techn.text,r),iL(`techn`,e,t,r,i)),e.descr&&e.descr.text!==``&&(i=Bm(e.descr.text,r),iL(`descr`,e,t,r,i));let s=n(e.from),l=n(e.to);if(!s||!l)throw Error(`C4 rel "${e.from}" -> "${e.to}" references an unknown shape`);let u=cUe(s,l);if(!u.startPoint||!u.endPoint)throw Error(`Could not calculate intersection points for rel "${e.from}" -> "${e.to}"`);e.startPoint=u.startPoint,e.endPoint=u.endPoint}EL.drawRels(e,t,FL,i)},`drawRels`),p(aL,`drawInsideBoundary`),HL={drawPersonOrSystemArray:BL,drawBoundary:zL,setConf:LL,draw:p(async function(e,t,n,r){FL=sL(`c4`);let i=Z().securityLevel,{root:a}=YHe(t,i),o=r.db;o.setWrap(FL.wrap),NL=o.getC4ShapeInRow(),PL=o.getC4BoundaryInRow(),y.debug(`C:${JSON.stringify(FL,null,2)}`);let s=a.select(`[id="${t}"]`);EL.insertComputerIcon(s,t),EL.insertDatabaseIcon(s,t),EL.insertClockIcon(s,t);let l=new IL(r);l.setData(FL.diagramMarginX,FL.diagramMarginX,FL.diagramMarginY,FL.diagramMarginY),l.data.widthLimit=screen.availWidth,jL=FL.diagramMarginX,ML=FL.diagramMarginY;let u=o.getTitle();await aL(s,``,l,o.getBoundaries(``),r),EL.insertArrowHead(s,t),EL.insertArrowEnd(s,t),EL.insertArrowCrossHead(s,t),EL.insertArrowFilledHead(s,t),lUe(s,o.getRels(),o.getC4Shape,r,t),l.data.stopx=jL,l.data.stopy=ML;let d=l.data,f=d.startx,p=d.starty,m=ML-p+2*FL.diagramMarginY,h=jL-f,g=h+2*FL.diagramMarginX;u&&s.append(`text`).text(u).attr(`x`,h/2-4*FL.diagramMarginX).attr(`y`,p+FL.diagramMarginY),Hs(s,m,g,FL.useMaxWidth);let _=u?60:0;s.attr(`viewBox`,f-FL.diagramMarginX+` -`+(FL.diagramMarginY+_)+` `+g+` `+(m+_)),y.debug(`models:`,d)},`draw`)},uUe=p(()=>{let e=Z().c4??{},t=new CSSStyleSheet;for(let n of OL){let r=t.cssRules[t.insertRule(`.c4-shape.c4-${n} .label {}`,t.cssRules.length)],i=e[`${n}FontFamily`],a=e[`${n}FontSize`],o=e[`${n}FontWeight`];i&&r.style.setProperty(`font-family`,i),a&&r.style.setProperty(`font-size`,typeof a==`number`?`${a}px`:a),o&&r.style.setProperty(`font-weight`,String(o))}return[...t.cssRules].filter(e=>e.style.length>0).map(e=>` ${e.cssText}`).join(`887+`)},`elementFontStyles`),dUe={parser:hHe,db:CL,renderer:HL,styles:p(e=>`.person {888+ stroke: ${e.personBorder};889+ fill: ${e.personBkg};890+ }891+${uUe()}892+893+ /* The element font colour is set inline per element (default white); the894+ label text takes it via currentColor. */895+ .c4-shape .label,896+ .c4-shape .label text {897+ color: inherit;898+ fill: currentColor;899+ }900+ /* Structurizr typography: bold name, smaller stereotype/type and description lines. */901+ .c4-shape .label .c4-name {902+ font-weight: bold;903+ }904+ .c4-shape .label .c4-type {905+ font-size: 0.75em;906+ }907+ .c4-shape .label .c4-descr {908+ font-size: 0.82em;909+ }910+ .c4-shape .basic,911+ .c4-shape rect,912+ .c4-shape path,913+ .c4-shape circle,914+ .c4-shape ellipse,915+ .c4-shape line {916+ stroke-width: 2px;917+ }918+`,`getStyles`),init:p(({c4:e,wrap:t})=>{HL.setConf(e),CL.setWrap(t)},`init`)}})),UL,WL=o((()=>{h(),UL=p(()=>`919+ /* Font Awesome icon styling - consolidated */920+ .label-icon {921+ display: inline-block;922+ height: 1em;923+ overflow: visible;924+ vertical-align: -0.125em;925+ }926+ 927+ .node .label-icon path {928+ fill: currentColor;929+ stroke: revert;930+ stroke-width: revert;931+ }932+`,`getIconStyles`)})),GL,KL=o((()=>{h(),_p(),GL=p((e,t)=>{let n;return t===`sandbox`&&(n=$c(`#i`+e)),$c(t===`sandbox`?n.nodes()[0].contentDocument.body:`body`).select(`[id="${e}"]`)},`getDiagramElement`)})),qL,pUe,mUe,JL=o((()=>{dc(),S(),h(),qL=p((e,t,n,r)=>{e.attr(`class`,n);let{width:i,height:a,x:o,y:s}=pUe(e,t);Hs(e,a,i,r);let l=mUe(o,s,i,a,t);e.attr(`viewBox`,l),y.debug(`viewBox configured: ${l} with padding: ${t}`)},`setupViewPortForSVG`),pUe=p((e,t)=>{let n=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:n.width+t*2,height:n.height+t*2,x:n.x,y:n.y}},`calculateDimensionsWithPadding`),mUe=p((e,t,n,r,i)=>`${e-i} ${t-i} ${n} ${r}`,`createViewBox`)})),hUe,gUe,_Ue,YL,XL,ZL,vUe,yUe,QL,$L,bUe,xUe=o((()=>{WL(),KL(),JL(),DC(),EI(),rL(),P_(),rh(),dc(),S(),h(),_p(),qt(),Ne(),hUe=`flowchart-`,gUe=class{constructor(){this.vertexCounter=0,this.config=Z(),this.diagramId=``,this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Zs,this.setAccDescription=$s,this.setDiagramTitle=tc,this.getAccTitle=Qs,this.getAccDescription=ec,this.getDiagramTitle=nc,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen(`gen-2`)}static{p(this,`FlowDB`)}sanitizeText(e){return Vs.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case`markdown`:case`string`:case`text`:return e;default:return`markdown`}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let t of this.vertices.values())if(t.id===e)return this.diagramId?`${this.diagramId}-${t.domId}`:t.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,t,n,r,i,a,o={},s){if(!e||e.trim().length===0)return;let l;if(s!==void 0){let e;e=s.includes(`933+`)?s+`934+`:`{935+`+s+`936+}`,l=EC(e,{schema:TC})}let u=this.subGraphLookup.get(e);if(u&&l){u.metadata={...u.metadata,...l};return}let d=this.edges.find(t=>t.id===e);if(d){let e=l;e?.animate!==void 0&&(d.animate=e.animate),e?.animation!==void 0&&(d.animation=e.animation),e?.curve!==void 0&&(d.interpolate=e.curve);return}let f,p=this.vertices.get(e);if(p===void 0&&(t===void 0&&n===void 0&&r!=null&&y.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),p={id:e,labelType:`text`,domId:hUe+e+`-`+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,p)),this.vertexCounter++,t===void 0?p.text===void 0&&(p.text=e):(this.config=Z(),f=this.sanitizeText(t.text.trim()),p.labelType=t.type,f.startsWith(`"`)&&f.endsWith(`"`)&&(f=f.substring(1,f.length-1)),p.text=f),n!==void 0&&(p.type=n),r?.forEach(e=>{p.styles.push(e)}),i?.forEach(e=>{p.classes.push(e)}),a!==void 0&&(p.dir=a),p.props===void 0?p.props=o:o!==void 0&&Object.assign(p.props,o),l!==void 0){if(l.shape){if(l.shape!==l.shape.toLowerCase()||l.shape.includes(`_`))throw Error(`No such shape: ${l.shape}. Shape names should be lowercase.`);if(!kve(l.shape))throw Error(`No such shape: ${l.shape}.`);p.type=l?.shape}l?.label&&(p.text=l?.label,p.labelType=this.sanitizeNodeLabelType(l?.labelType)),l?.icon&&(p.icon=l?.icon,!l.label?.trim()&&p.text===e&&(p.text=``)),l?.form&&(p.form=l?.form),l?.pos&&(p.pos=l?.pos),l?.img&&(p.img=l?.img,!l.label?.trim()&&p.text===e&&(p.text=``)),l?.constraint&&(p.constraint=l.constraint),l.w&&(p.assetWidth=Number(l.w)),l.h&&(p.assetHeight=Number(l.h))}}addSingleLink(e,t,n,r){let i={start:e,end:t,type:void 0,text:``,labelType:`text`,classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};y.info(`abc78 Got edge...`,i);let a=n.text;if(a!==void 0&&(i.text=this.sanitizeText(a.text.trim()),i.text.startsWith(`"`)&&i.text.endsWith(`"`)&&(i.text=i.text.substring(1,i.text.length-1)),i.labelType=this.sanitizeNodeLabelType(a.type)),n!==void 0&&(i.type=n.type,i.stroke=n.stroke,i.length=n.length>10?10:n.length),r&&!this.edges.some(e=>e.id===r))i.id=r,i.isUserDefinedId=!0;else{let e=this.edges.filter(e=>e.start===i.start&&e.end===i.end);i.id=e.length===0?nh(i.start,i.end,{counter:0,prefix:`L`}):nh(i.start,i.end,{counter:e.length+1,prefix:`L`})}if(this.edges.length<(this.config.maxEdges??500))y.info(`Pushing edge...`),this.edges.push(i);else throw Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.937+938+Initialize mermaid with maxEdges set to a higher number to allow more edges.939+You cannot set this config via configuration inside the diagram as it is a secure config.940+You have to call mermaid.initialize.`)}isLinkData(e){return typeof e==`object`&&!!e&&`id`in e&&typeof e.id==`string`}addLink(e,t,n){let r=this.isLinkData(n)?n.id.replace(`@`,``):void 0;y.info(`addLink`,e,t,r);for(let i of e)for(let a of t){let o=i===e[e.length-1],s=a===t[0];o&&s?this.addSingleLink(i,a,n,r):this.addSingleLink(i,a,n,void 0)}}updateLinkInterpolate(e,t){e.forEach(e=>{e==="default"?this.edges.defaultInterpolate=t:this.edges[e].interpolate=t})}updateLink(e,t){e.forEach(e=>{if(typeof e==`number`&&e>=this.edges.length)throw Error(`The index ${e} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);e==="default"?this.edges.defaultStyle=t:(this.edges[e].style=t,(this.edges[e]?.style?.length??0)>0&&!this.edges[e]?.style?.some(e=>e?.startsWith(`fill`))&&this.edges[e]?.style?.push(`fill:none`))})}addClass(e,t){let n=t.join().replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);e.split(`,`).forEach(e=>{let t=this.classes.get(e);t===void 0&&(t={id:e,styles:[],textStyles:[]},this.classes.set(e,t)),n?.forEach(e=>{if(/color/.exec(e)){let n=e.replace(`fill`,`bgFill`);t.textStyles.push(n)}t.styles.push(e)})})}setDirection(e){this.direction=e.trim(),/.*</.exec(this.direction)&&(this.direction=`RL`),/.*\^/.exec(this.direction)&&(this.direction=`BT`),/.*>/.exec(this.direction)&&(this.direction=`LR`),/.*v/.exec(this.direction)&&(this.direction=`TB`),this.direction===`TD`&&(this.direction=`TB`)}setClass(e,t){for(let n of e.split(`,`)){let e=this.vertices.get(n);e&&e.classes.push(t);let r=this.edges.find(e=>e.id===n);r&&r.classes.push(t);let i=this.subGraphLookup.get(n);i&&i.classes.push(t)}}setTooltip(e,t){if(t!==void 0){t=this.sanitizeText(t);for(let n of e.split(`,`))this.tooltips.set(this.version===`gen-1`?this.lookUpDomId(n):n,t)}}setClickFun(e,t,n){if(Z().securityLevel!==`loose`||t===void 0)return;let r=[];if(typeof n==`string`){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e<r.length;e++){let t=r[e].trim();t.startsWith(`"`)&&t.endsWith(`"`)&&(t=t.substr(1,t.length-2)),r[e]=t}}r.length===0&&r.push(e);let i=this.vertices.get(e);i&&(i.haveCallback=!0,this.funs.push(()=>{let n=this.lookUpDomId(e),i=document.querySelector(`[id="${n}"]`);i!==null&&i.addEventListener(`click`,()=>{eh.runFunc(t,...r)},!1)}))}setLink(e,t,n){e.split(`,`).forEach(e=>{let r=this.vertices.get(e);r!==void 0&&(r.link=eh.formatUrl(t,this.config),r.linkTarget=n)}),this.setClass(e,`clickable`)}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,t,n){e.split(`,`).forEach(e=>{this.setClickFun(e,t,n)}),this.setClass(e,`clickable`)}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){let t=nL();$c(e).select(`svg`).selectAll(`g.node`).on(`mouseover`,e=>{let n=$c(e.currentTarget),r=n.attr(`title`);if(r===null)return;let i=e.currentTarget?.getBoundingClientRect();t.transition().duration(200).style(`opacity`,`.9`),t.text(n.attr(`title`)).style(`left`,window.scrollX+i.left+(i.right-i.left)/2+`px`).style(`top`,window.scrollY+i.bottom+`px`),t.html(Kt.sanitize(r)),n.classed(`hover`,!0)}).on(`mouseout`,e=>{t.transition().duration(500).style(`opacity`,0),$c(e.currentTarget).classed(`hover`,!1)})}clear(e=`gen-2`){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId=``,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=Z(),Xs()}setGen(e){this.version=e||`gen-2`}defaultStyle(){return`fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;`}addSubGraph(e,t,n){let r=e.text.trim(),i=n.text;e===n&&/\s/.exec(n.text)&&(r=void 0);let a=p(e=>{let t={boolean:{},number:{},string:{}},n=[],r;return{nodeList:e.filter(function(e){let i=typeof e;return e.stmt&&e.stmt===`dir`?(r=e.value,!1):e.trim()===``?!1:i in t?t[i].hasOwnProperty(e)?!1:t[i][e]=!0:!n.includes(e)&&n.push(e)}),dir:r}},`uniq`)(t.flat()),o=a.nodeList,s=a.dir,l=Z().flowchart??{};if(s??=l.inheritDir?this.getDirection()??Z().direction??void 0:void 0,this.version===`gen-1`)for(let e=0;e<o.length;e++)o[e]=this.lookUpDomId(o[e]);r??=`subGraph`+this.subCount,i||=``,i=this.sanitizeText(i),this.subCount+=1;let u={id:r,nodes:o,title:i.trim(),classes:[],dir:s,labelType:this.sanitizeNodeLabelType(n?.type)};return y.info(`Adding`,u.id,u.nodes,u.dir),u.nodes=this.makeUniq(u,this.subGraphs).nodes,this.subGraphs.push(u),this.subGraphLookup.set(r,u),r}getPosForId(e){for(let[t,n]of this.subGraphs.entries())if(n.id===e)return t;return-1}indexNodes2(e,t){let n=this.subGraphs[t].nodes;if(this.secCount+=1,this.secCount>2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=t,this.subGraphs[t].id===e)return{result:!0,count:0};let r=0,i=1;for(;r<n.length;){let t=this.getPosForId(n[r]);if(t>=0){let n=this.indexNodes2(e,t);if(n.result)return{result:!0,count:i+n.count};i+=n.count}r+=1}return{result:!1,count:i}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2(`none`,this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let t=e.trim(),n=`arrow_open`;switch(t[0]){case`<`:n=`arrow_point`,t=t.slice(1);break;case`x`:n=`arrow_cross`,t=t.slice(1);break;case`o`:n=`arrow_circle`,t=t.slice(1)}let r=`normal`;return t.includes(`=`)&&(r=`thick`),t.includes(`.`)&&(r=`dotted`),{type:n,stroke:r}}countChar(e,t){let n=t.length,r=0;for(let i=0;i<n;++i)t[i]===e&&++r;return r}destructEndLink(e){let t=e.trim(),n=t.slice(0,-1),r=`arrow_open`;switch(t.slice(-1)){case`x`:r=`arrow_cross`,t.startsWith(`x`)&&(r=`double_`+r,n=n.slice(1));break;case`>`:r=`arrow_point`,t.startsWith(`<`)&&(r=`double_`+r,n=n.slice(1));break;case`o`:r=`arrow_circle`,t.startsWith(`o`)&&(r=`double_`+r,n=n.slice(1))}let i=`normal`,a=n.length-1;n.startsWith(`=`)&&(i=`thick`),n.startsWith(`~`)&&(i=`invisible`);let o=this.countChar(`.`,n);return o&&(i=`dotted`,a=o),{type:r,stroke:i,length:a}}destructLink(e,t){let n=this.destructEndLink(e),r;if(t){if(r=this.destructStartLink(t),r.stroke!==n.stroke)return{type:`INVALID`,stroke:`INVALID`};if(r.type===`arrow_open`)r.type=n.type;else{if(r.type!==n.type)return{type:`INVALID`,stroke:`INVALID`};r.type=`double_`+r.type}return r.type===`double_arrow`&&(r.type=`double_arrow_point`),r.length=n.length,r}return n}exists(e,t){for(let n of e)if(n.nodes.includes(t))return!0;return!1}makeUniq(e,t){let n=[];return e.nodes.forEach((r,i)=>{this.exists(t,r)||n.push(e.nodes[i])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return`imageSquare`;if(e.icon)return e.form===`circle`?`iconCircle`:e.form===`square`?`iconSquare`:e.form===`rounded`?`iconRounded`:`icon`;switch(e.type){case`square`:case void 0:return`squareRect`;case`round`:return`roundedRect`;case`ellipse`:return`ellipse`;default:return e.type}}findNode(e,t){return e.find(e=>e.id===t)}destructEdgeType(e){let t=`none`,n=`arrow_point`;switch(e){case`arrow_point`:case`arrow_circle`:case`arrow_cross`:n=e;break;case`double_arrow_point`:case`double_arrow_circle`:case`double_arrow_cross`:t=e.replace(`double_`,``),n=t}return{arrowTypeStart:t,arrowTypeEnd:n}}addNodeFromVertex(e,t,n,r,i,a){let o=n.get(e.id),s=r.get(e.id)??!1,l=this.findNode(t,e.id);if(l)l.cssStyles=e.styles,l.cssCompiledStyles=this.getCompiledStyles(e.classes),l.cssClasses=e.classes.join(` `);else{let n={id:e.id,label:e.text,labelType:e.labelType,labelStyle:``,parentId:o,padding:i.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles([`default`,`node`,...e.classes]),cssClasses:`default `+e.classes.join(` `),dir:e.dir,domId:e.domId,look:a,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};s?t.push({...n,isGroup:!0,shape:`rect`}):t.push({...n,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let t=[];for(let n of e){let e=this.classes.get(n);e?.styles&&(t=[...t,...e.styles??[]].map(e=>e.trim())),e?.textStyles&&(t=[...t,...e.textStyles??[]].map(e=>e.trim()))}return t}getData(){let e=Z(),t=[],n=[],r=this.getSubGraphs(),i=new Map,a=new Map,o=new Map;for(let e of r)for(let t of e.nodes)this.subGraphLookup.has(t)&&o.set(t,e.id);let s=p(e=>this.subGraphLookup.get(e)?.metadata?.view===`collapsed`,`isCollapsed`),l=p(e=>{let t,n=new Set,r=e;for(;r!==void 0&&!n.has(r);)n.add(r),s(r)&&(t=r),r=o.get(r);return t},`outermostCollapsed`),u=new Set,d=new Map;for(let e of r){let t=l(e.id);if(t!==void 0){e.id!==t&&(u.add(e.id),d.set(e.id,t));for(let n of e.nodes)n!==t&&(u.add(n),d.set(n,t))}}for(let e=r.length-1;e>=0;e--){let t=r[e];if(!u.has(t.id)){t.nodes.length>0&&a.set(t.id,!0);for(let e of t.nodes)i.set(e,t.id)}}for(let n=r.length-1;n>=0;n--){let a=r[n];u.has(a.id)||(a.metadata?.view===`collapsed`?t.push({id:a.id,label:a.title,labelStyle:``,labelType:a.labelType,parentId:i.get(a.id),padding:8,cssCompiledStyles:this.getCompiledStyles(a.classes),cssClasses:a.classes.join(` `),shape:`collapsedGroup`,dir:a.dir,isGroup:!1,look:e.look}):t.push({id:a.id,label:a.title,labelStyle:``,labelType:a.labelType,parentId:i.get(a.id),padding:8,cssCompiledStyles:this.getCompiledStyles(a.classes),cssClasses:a.classes.join(` `),shape:`rect`,dir:a.dir,isGroup:!0,look:e.look}))}this.getVertices().forEach(n=>{u.has(n.id)||this.addNodeFromVertex(n,t,i,a,e,e.look||`classic`)});let f=this.getEdges();return f.forEach((t,r)=>{let{arrowTypeStart:i,arrowTypeEnd:a}=this.destructEdgeType(t.type),o=[...f.defaultStyle??[]],s=d.get(t.start)??t.start,l=d.get(t.end)??t.end;if(s===l&&(d.has(t.start)||d.has(t.end)))return;t.style&&o.push(...t.style);let u={id:nh(s,l,{counter:r,prefix:`L`},t.id),isUserDefinedId:t.isUserDefinedId,start:s,end:l,type:t.type??`normal`,label:t.text,labelType:t.labelType,labelpos:`c`,thickness:t.stroke,minlen:t.length,classes:t?.stroke===`invisible`?``:`edge-thickness-normal edge-pattern-solid flowchart-link`,arrowTypeStart:t?.stroke===`invisible`||t?.type===`arrow_open`?`none`:i,arrowTypeEnd:t?.stroke===`invisible`||t?.type===`arrow_open`?`none`:a,arrowheadStyle:`fill: #333`,cssCompiledStyles:this.getCompiledStyles(t.classes),labelStyle:o,style:o,pattern:t.stroke,look:e.look,animate:t.animate,animation:t.animation,curve:t.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};n.push(u)}),{nodes:t,edges:n,other:{},config:e}}defaultConfig(){return ac.flowchart}},_Ue={getClasses:p(function(e,t){return t.db.getClasses()},`getClasses`),draw:p(async function(e,t,n,r){y.info(`REF0:`),y.info(`Drawing state diagram (v2)`,t);let{securityLevel:i,flowchart:a,layout:o}=Z();r.db.setDiagramId(t),y.debug(`Before getData: `);let s=r.db.getData();y.debug(`Data: `,s);let l=GL(t,i),u=r.db.getDirection();s.type=r.type,s.layoutAlgorithm=TI(o),s.layoutAlgorithm===`dagre`&&o===`elk`&&y.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),s.direction=u,s.nodeSpacing=a?.nodeSpacing||50,s.rankSpacing=a?.rankSpacing||50,s.markers=[`point`,`circle`,`cross`],s.diagramId=t,y.debug(`REF1:`,s),await wI(s,l);let d=s.config.flowchart?.diagramPadding??8;eh.insertTitle(l,`flowchartTitleText`,a?.titleTopMargin||0,r.db.getDiagramTitle()),qL(l,d,`flowchart`,a?.useMaxWidth||!1)},`draw`)},YL=(function(){var e=p(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,4],n=[1,3],r=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],a=[2,2],o=[1,13],s=[1,14],l=[1,15],u=[1,16],d=[1,23],f=[1,25],m=[1,26],h=[1,27],g=[1,50],_=[1,49],v=[1,29],y=[1,30],b=[1,31],x=[1,32],S=[1,33],C=[1,45],w=[1,47],T=[1,43],E=[1,48],D=[1,44],O=[1,51],k=[1,46],A=[1,52],j=[1,53],M=[1,34],N=[1,35],P=[1,36],F=[1,37],I=[1,38],L=[1,58],R=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],ee=[1,62],z=[1,61],B=[1,63],te=[8,9,11,75,77,78],ne=[1,79],re=[1,92],ie=[1,97],ae=[1,96],oe=[1,93],se=[1,89],ce=[1,95],le=[1,91],ue=[1,98],de=[1,94],fe=[1,99],pe=[1,90],me=[8,9,10,11,40,75,77,78],he=[8,9,10,11,40,46,75,77,78],ge=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],_e=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],ve=[44,60,89,102,105,106,109,111,114,115,116],ye=[1,122],be=[1,123],xe=[1,125],Se=[1,124],V=[44,60,62,74,89,102,105,106,109,111,114,115,116],Ce=[1,134],we=[1,148],Te=[1,149],Ee=[1,150],De=[1,151],H=[1,136],Oe=[1,138],ke=[1,142],Ae=[1,143],U=[1,144],je=[1,145],Me=[1,146],Ne=[1,147],Pe=[1,152],Fe=[1,153],Ie=[1,132],Le=[1,133],Re=[1,140],ze=[1,135],Be=[1,139],Ve=[1,137],He=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],Ue=[1,155],We=[1,157],Ge=[8,9,11],Ke=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],qe=[1,177],Je=[1,173],Ye=[1,174],Xe=[1,178],Ze=[1,175],Qe=[1,176],$e=[77,116,119],et=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],tt=[10,106],nt=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],rt=[1,248],it=[1,246],at=[1,250],ot=[1,244],st=[1,245],ct=[1,247],lt=[1,249],ut=[1,251],dt=[1,269],ft=[8,9,11,106],pt=[8,9,10,11,60,84,105,106,109,110,111,112],mt={trace:p(function(){},`trace`),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:`error`,8:`SEMI`,9:`NEWLINE`,10:`SPACE`,11:`EOF`,12:`GRAPH`,13:`NODIR`,14:`DIR`,27:`subgraph`,29:`SQS`,31:`SQE`,32:`end`,34:`acc_title`,35:`acc_title_value`,36:`acc_descr`,37:`acc_descr_value`,38:`acc_descr_multiline_value`,40:`SHAPE_DATA`,44:`AMP`,46:`STYLE_SEPARATOR`,48:`DOUBLECIRCLESTART`,49:`DOUBLECIRCLEEND`,50:`PS`,51:`PE`,52:`(-`,53:`-)`,54:`STADIUMSTART`,55:`STADIUMEND`,56:`SUBROUTINESTART`,57:`SUBROUTINEEND`,58:`VERTEX_WITH_PROPS_START`,59:`NODE_STRING[field]`,60:`COLON`,61:`NODE_STRING[value]`,62:`PIPE`,63:`CYLINDERSTART`,64:`CYLINDEREND`,65:`DIAMOND_START`,66:`DIAMOND_STOP`,67:`TAGEND`,68:`TRAPSTART`,69:`TRAPEND`,70:`INVTRAPSTART`,71:`INVTRAPEND`,74:`TESTSTR`,75:`START_LINK`,77:`LINK`,78:`LINK_ID`,80:`STR`,81:`MD_STR`,84:`STYLE`,85:`LINKSTYLE`,86:`CLASSDEF`,87:`CLASS`,88:`CLICK`,89:`DOWN`,90:`UP`,93:`idString[vertex]`,94:`idString[class]`,95:`CALLBACKNAME`,96:`CALLBACKARGS`,97:`HREF`,98:`LINK_TARGET`,99:`STR[link]`,100:`STR[tooltip]`,102:`DEFAULT`,104:`INTERPOLATE`,105:`NUM`,106:`COMMA`,109:`NODE_STRING`,110:`UNIT`,111:`BRKT`,112:`PCT`,114:`MINUS`,115:`MULT`,116:`UNICODE_TEXT`,117:`TEXT`,118:`TAGSTART`,119:`EDGE_TEXT`,121:`direction_tb`,122:`direction_bt`,123:`direction_rl`,124:`direction_lr`,125:`direction_td`},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:p(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 2:this.$=[];break;case 3:(!Array.isArray(a[s])||a[s].length>0)&&a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 183:this.$=a[s];break;case 11:r.setDirection(`TB`),this.$=`TB`;break;case 12:r.setDirection(a[s-1]),this.$=a[s-1];break;case 27:this.$=a[s-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=r.addSubGraph(a[s-6],a[s-1],a[s-4]);break;case 34:this.$=r.addSubGraph(a[s-3],a[s-1],a[s-3]);break;case 35:this.$=r.addSubGraph(void 0,a[s-1],void 0);break;case 37:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 38:case 39:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 43:this.$=a[s-1]+a[s];break;case 44:this.$=a[s];break;case 45:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s]),r.addLink(a[s-3].stmt,a[s-1],a[s-2]),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 46:r.addLink(a[s-2].stmt,a[s],a[s-1]),this.$={stmt:a[s],nodes:a[s].concat(a[s-2].nodes)};break;case 47:r.addLink(a[s-3].stmt,a[s-1],a[s-2]),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 48:this.$={stmt:a[s-1],nodes:a[s-1]};break;case 49:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s]),this.$={stmt:a[s-1],nodes:a[s-1],shapeData:a[s]};break;case 50:this.$={stmt:a[s],nodes:a[s]};break;case 51:this.$=[a[s]];break;case 52:r.addVertex(a[s-5][a[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s-4]),this.$=a[s-5].concat(a[s]);break;case 53:this.$=a[s-4].concat(a[s]);break;case 54:this.$=a[s];break;case 55:this.$=a[s-2],r.setClass(a[s-2],a[s]);break;case 56:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`square`);break;case 57:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`doublecircle`);break;case 58:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],`circle`);break;case 59:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`ellipse`);break;case 60:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`stadium`);break;case 61:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`subroutine`);break;case 62:this.$=a[s-7],r.addVertex(a[s-7],a[s-1],`rect`,void 0,void 0,void 0,Object.fromEntries([[a[s-5],a[s-3]]]));break;case 63:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`cylinder`);break;case 64:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`round`);break;case 65:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`diamond`);break;case 66:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],`hexagon`);break;case 67:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`odd`);break;case 68:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`trapezoid`);break;case 69:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`inv_trapezoid`);break;case 70:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`lean_right`);break;case 71:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`lean_left`);break;case 72:this.$=a[s],r.addVertex(a[s]);break;case 73:a[s-1].text=a[s],this.$=a[s-1];break;case 74:case 75:a[s-2].text=a[s-1],this.$=a[s-2];break;case 76:this.$=a[s];break;case 77:var l=r.destructLink(a[s],a[s-2]);this.$={type:l.type,stroke:l.stroke,length:l.length,text:a[s-1]};break;case 78:var l=r.destructLink(a[s],a[s-2]);this.$={type:l.type,stroke:l.stroke,length:l.length,text:a[s-1],id:a[s-3]};break;case 79:this.$={text:a[s],type:`text`};break;case 80:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 81:this.$={text:a[s],type:`string`};break;case 82:this.$={text:a[s],type:`markdown`};break;case 83:var l=r.destructLink(a[s]);this.$={type:l.type,stroke:l.stroke,length:l.length};break;case 84:var l=r.destructLink(a[s]);this.$={type:l.type,stroke:l.stroke,length:l.length,id:a[s-1]};break;case 85:this.$=a[s-1];break;case 86:this.$={text:a[s],type:`text`};break;case 87:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 88:this.$={text:a[s],type:`string`};break;case 89:case 104:this.$={text:a[s],type:`markdown`};break;case 101:this.$={text:a[s],type:`text`};break;case 102:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 103:this.$={text:a[s],type:`text`};break;case 105:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 106:this.$=a[s-4],r.setClass(a[s-2],a[s]);break;case 107:case 115:this.$=a[s-1],r.setClickEvent(a[s-1],a[s]);break;case 108:case 116:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 109:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 110:this.$=a[s-4],r.setClickEvent(a[s-4],a[s-3],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 111:this.$=a[s-2],r.setLink(a[s-2],a[s]);break;case 112:this.$=a[s-4],r.setLink(a[s-4],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 113:this.$=a[s-4],r.setLink(a[s-4],a[s-2],a[s]);break;case 114:this.$=a[s-6],r.setLink(a[s-6],a[s-4],a[s]),r.setTooltip(a[s-6],a[s-2]);break;case 117:this.$=a[s-1],r.setLink(a[s-1],a[s]);break;case 118:this.$=a[s-3],r.setLink(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 119:this.$=a[s-3],r.setLink(a[s-3],a[s-2],a[s]);break;case 120:this.$=a[s-5],r.setLink(a[s-5],a[s-4],a[s]),r.setTooltip(a[s-5],a[s-2]);break;case 121:this.$=a[s-4],r.addVertex(a[s-2],void 0,void 0,a[s]);break;case 122:this.$=a[s-4],r.updateLink([a[s-2]],a[s]);break;case 123:this.$=a[s-4],r.updateLink(a[s-2],a[s]);break;case 124:this.$=a[s-8],r.updateLinkInterpolate([a[s-6]],a[s-2]),r.updateLink([a[s-6]],a[s]);break;case 125:this.$=a[s-8],r.updateLinkInterpolate(a[s-6],a[s-2]),r.updateLink(a[s-6],a[s]);break;case 126:this.$=a[s-6],r.updateLinkInterpolate([a[s-4]],a[s]);break;case 127:this.$=a[s-6],r.updateLinkInterpolate(a[s-4],a[s]);break;case 128:case 130:this.$=[a[s]];break;case 129:case 131:a[s-2].push(a[s]),this.$=a[s-2];break;case 133:this.$=a[s-1]+a[s];break;case 181:this.$=a[s];break;case 182:this.$=a[s-1]+``+a[s];break;case 184:this.$=a[s-1]+``+a[s];break;case 185:this.$={stmt:`dir`,value:`TB`};break;case 186:this.$={stmt:`dir`,value:`BT`};break;case 187:this.$={stmt:`dir`,value:`RL`};break;case 188:this.$={stmt:`dir`,value:`LR`};break;case 189:this.$={stmt:`dir`,value:`TD`}}},`anonymous`),table:[{3:1,4:2,9:t,10:n,12:r},{1:[3]},e(i,a,{5:6}),{4:7,9:t,10:n,12:r},{4:8,9:t,10:n,12:r},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:o,9:s,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,33:24,34:f,36:m,38:h,42:28,43:39,44:g,45:40,47:41,60:_,84:v,85:y,86:b,87:x,88:S,89:C,102:w,105:T,106:E,109:D,111:O,113:42,114:k,115:A,116:j,121:M,122:N,123:P,124:F,125:I},e(i,[2,9]),e(i,[2,10]),e(i,[2,11]),{8:[1,55],9:[1,56],10:L,15:54,18:57},e(R,[2,3]),e(R,[2,4]),e(R,[2,5]),e(R,[2,6]),e(R,[2,7]),e(R,[2,8]),{8:ee,9:z,11:B,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:ee,9:z,11:B,21:68},{8:ee,9:z,11:B,21:69},{8:ee,9:z,11:B,21:70},{8:ee,9:z,11:B,21:71},{8:ee,9:z,11:B,21:72},{8:ee,9:z,10:[1,73],11:B,21:74},e(R,[2,36]),{35:[1,75]},{37:[1,76]},e(R,[2,39]),e(te,[2,50],{18:77,39:78,10:L,40:ne}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:re,44:ie,60:ae,80:[1,87],89:oe,95:[1,84],97:[1,85],101:86,105:se,106:ce,109:le,111:ue,114:de,115:fe,116:pe,120:88},e(R,[2,185]),e(R,[2,186]),e(R,[2,187]),e(R,[2,188]),e(R,[2,189]),e(me,[2,51]),e(me,[2,54],{46:[1,100]}),e(he,[2,72],{113:113,29:[1,101],44:g,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:_,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:C,102:w,105:T,106:E,109:D,111:O,114:k,115:A,116:j}),e(ge,[2,181]),e(ge,[2,142]),e(ge,[2,143]),e(ge,[2,144]),e(ge,[2,145]),e(ge,[2,146]),e(ge,[2,147]),e(ge,[2,148]),e(ge,[2,149]),e(ge,[2,150]),e(ge,[2,151]),e(ge,[2,152]),e(i,[2,12]),e(i,[2,18]),e(i,[2,19]),{9:[1,114]},e(_e,[2,26],{18:115,10:L}),e(R,[2,27]),{42:116,43:39,44:g,45:40,47:41,60:_,89:C,102:w,105:T,106:E,109:D,111:O,113:42,114:k,115:A,116:j},e(R,[2,40]),e(R,[2,41]),e(R,[2,42]),e(ve,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:ye,81:be,116:xe,119:Se},{75:[1,126],77:[1,127]},e(V,[2,83]),e(R,[2,28]),e(R,[2,29]),e(R,[2,30]),e(R,[2,31]),e(R,[2,32]),{10:Ce,12:we,14:Te,27:Ee,28:128,32:De,44:H,60:Oe,75:ke,80:[1,130],81:[1,131],83:141,84:Ae,85:U,86:je,87:Me,88:Ne,89:Pe,90:Fe,91:129,105:Ie,109:Le,111:Re,114:ze,115:Be,116:Ve},e(He,a,{5:154}),e(R,[2,37]),e(R,[2,38]),e(te,[2,48],{44:Ue}),e(te,[2,49],{18:156,10:L,40:We}),e(me,[2,44]),{44:g,47:158,60:_,89:C,102:w,105:T,106:E,109:D,111:O,113:42,114:k,115:A,116:j},{102:[1,159],103:160,105:[1,161]},{44:g,47:162,60:_,89:C,102:w,105:T,106:E,109:D,111:O,113:42,114:k,115:A,116:j},{44:g,47:163,60:_,89:C,102:w,105:T,106:E,109:D,111:O,113:42,114:k,115:A,116:j},e(Ge,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},e(Ge,[2,115],{120:168,10:[1,167],14:re,44:ie,60:ae,89:oe,105:se,106:ce,109:le,111:ue,114:de,115:fe,116:pe}),e(Ge,[2,117],{10:[1,169]}),e(Ke,[2,183]),e(Ke,[2,170]),e(Ke,[2,171]),e(Ke,[2,172]),e(Ke,[2,173]),e(Ke,[2,174]),e(Ke,[2,175]),e(Ke,[2,176]),e(Ke,[2,177]),e(Ke,[2,178]),e(Ke,[2,179]),e(Ke,[2,180]),{44:g,47:170,60:_,89:C,102:w,105:T,106:E,109:D,111:O,113:42,114:k,115:A,116:j},{30:171,67:qe,80:Je,81:Ye,82:172,116:Xe,117:Ze,118:Qe},{30:179,67:qe,80:Je,81:Ye,82:172,116:Xe,117:Ze,118:Qe},{30:181,50:[1,180],67:qe,80:Je,81:Ye,82:172,116:Xe,117:Ze,118:Qe},{30:182,67:qe,80:Je,81:Ye,82:172,116:Xe,117:Ze,118:Qe},{30:183,67:qe,80:Je,81:Ye,82:172,116:Xe,117:Ze,118:Qe},{30:184,67:qe,80:Je,81:Ye,82:172,116:Xe,117:Ze,118:Qe},{109:[1,185]},{30:186,67:qe,80:Je,81:Ye,82:172,116:Xe,117:Ze,118:Qe},{30:187,65:[1,188],67:qe,80:Je,81:Ye,82:172,116:Xe,117:Ze,118:Qe},{30:189,67:qe,80:Je,81:Ye,82:172,116:Xe,117:Ze,118:Qe},{30:190,67:qe,80:Je,81:Ye,82:172,116:Xe,117:Ze,118:Qe},{30:191,67:qe,80:Je,81:Ye,82:172,116:Xe,117:Ze,118:Qe},e(ge,[2,182]),e(i,[2,20]),e(_e,[2,25]),e(te,[2,46],{39:192,18:193,10:L,40:ne}),e(ve,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:qe,80:Je,81:Ye,82:172,116:Xe,117:Ze,118:Qe},{77:[1,197],79:198,116:xe,119:Se},e($e,[2,79]),e($e,[2,81]),e($e,[2,82]),e($e,[2,168]),e($e,[2,169]),{76:199,79:121,80:ye,81:be,116:xe,119:Se},e(V,[2,84]),{8:ee,9:z,10:Ce,11:B,12:we,14:Te,21:201,27:Ee,29:[1,200],32:De,44:H,60:Oe,75:ke,83:141,84:Ae,85:U,86:je,87:Me,88:Ne,89:Pe,90:Fe,91:202,105:Ie,109:Le,111:Re,114:ze,115:Be,116:Ve},e(et,[2,101]),e(et,[2,103]),e(et,[2,104]),e(et,[2,157]),e(et,[2,158]),e(et,[2,159]),e(et,[2,160]),e(et,[2,161]),e(et,[2,162]),e(et,[2,163]),e(et,[2,164]),e(et,[2,165]),e(et,[2,166]),e(et,[2,167]),e(et,[2,90]),e(et,[2,91]),e(et,[2,92]),e(et,[2,93]),e(et,[2,94]),e(et,[2,95]),e(et,[2,96]),e(et,[2,97]),e(et,[2,98]),e(et,[2,99]),e(et,[2,100]),{6:11,7:12,8:o,9:s,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,203],33:24,34:f,36:m,38:h,42:28,43:39,44:g,45:40,47:41,60:_,84:v,85:y,86:b,87:x,88:S,89:C,102:w,105:T,106:E,109:D,111:O,113:42,114:k,115:A,116:j,121:M,122:N,123:P,124:F,125:I},{10:L,18:204},{44:[1,205]},e(me,[2,43]),{10:[1,206],44:g,60:_,89:C,102:w,105:T,106:E,109:D,111:O,113:113,114:k,115:A,116:j},{10:[1,207]},{10:[1,208],106:[1,209]},e(tt,[2,128]),{10:[1,210],44:g,60:_,89:C,102:w,105:T,106:E,109:D,111:O,113:113,114:k,115:A,116:j},{10:[1,211],44:g,60:_,89:C,102:w,105:T,106:E,109:D,111:O,113:113,114:k,115:A,116:j},{80:[1,212]},e(Ge,[2,109],{10:[1,213]}),e(Ge,[2,111],{10:[1,214]}),{80:[1,215]},e(Ke,[2,184]),{80:[1,216],98:[1,217]},e(me,[2,55],{113:113,44:g,60:_,89:C,102:w,105:T,106:E,109:D,111:O,114:k,115:A,116:j}),{31:[1,218],67:qe,82:219,116:Xe,117:Ze,118:Qe},e(nt,[2,86]),e(nt,[2,88]),e(nt,[2,89]),e(nt,[2,153]),e(nt,[2,154]),e(nt,[2,155]),e(nt,[2,156]),{49:[1,220],67:qe,82:219,116:Xe,117:Ze,118:Qe},{30:221,67:qe,80:Je,81:Ye,82:172,116:Xe,117:Ze,118:Qe},{51:[1,222],67:qe,82:219,116:Xe,117:Ze,118:Qe},{53:[1,223],67:qe,82:219,116:Xe,117:Ze,118:Qe},{55:[1,224],67:qe,82:219,116:Xe,117:Ze,118:Qe},{57:[1,225],67:qe,82:219,116:Xe,117:Ze,118:Qe},{60:[1,226]},{64:[1,227],67:qe,82:219,116:Xe,117:Ze,118:Qe},{66:[1,228],67:qe,82:219,116:Xe,117:Ze,118:Qe},{30:229,67:qe,80:Je,81:Ye,82:172,116:Xe,117:Ze,118:Qe},{31:[1,230],67:qe,82:219,116:Xe,117:Ze,118:Qe},{67:qe,69:[1,231],71:[1,232],82:219,116:Xe,117:Ze,118:Qe},{67:qe,69:[1,234],71:[1,233],82:219,116:Xe,117:Ze,118:Qe},e(te,[2,45],{18:156,10:L,40:We}),e(te,[2,47],{44:Ue}),e(ve,[2,75]),e(ve,[2,74]),{62:[1,235],67:qe,82:219,116:Xe,117:Ze,118:Qe},e(ve,[2,77]),e($e,[2,80]),{77:[1,236],79:198,116:xe,119:Se},{30:237,67:qe,80:Je,81:Ye,82:172,116:Xe,117:Ze,118:Qe},e(He,a,{5:238}),e(et,[2,102]),e(R,[2,35]),{43:239,44:g,45:40,47:41,60:_,89:C,102:w,105:T,106:E,109:D,111:O,113:42,114:k,115:A,116:j},{10:L,18:240},{10:rt,60:it,84:at,92:241,105:ot,107:242,108:243,109:st,110:ct,111:lt,112:ut},{10:rt,60:it,84:at,92:252,104:[1,253],105:ot,107:242,108:243,109:st,110:ct,111:lt,112:ut},{10:rt,60:it,84:at,92:254,104:[1,255],105:ot,107:242,108:243,109:st,110:ct,111:lt,112:ut},{105:[1,256]},{10:rt,60:it,84:at,92:257,105:ot,107:242,108:243,109:st,110:ct,111:lt,112:ut},{44:g,47:258,60:_,89:C,102:w,105:T,106:E,109:D,111:O,113:42,114:k,115:A,116:j},e(Ge,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},e(Ge,[2,116]),e(Ge,[2,118],{10:[1,262]}),e(Ge,[2,119]),e(he,[2,56]),e(nt,[2,87]),e(he,[2,57]),{51:[1,263],67:qe,82:219,116:Xe,117:Ze,118:Qe},e(he,[2,64]),e(he,[2,59]),e(he,[2,60]),e(he,[2,61]),{109:[1,264]},e(he,[2,63]),e(he,[2,65]),{66:[1,265],67:qe,82:219,116:Xe,117:Ze,118:Qe},e(he,[2,67]),e(he,[2,68]),e(he,[2,70]),e(he,[2,69]),e(he,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(ve,[2,78]),{31:[1,266],67:qe,82:219,116:Xe,117:Ze,118:Qe},{6:11,7:12,8:o,9:s,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,267],33:24,34:f,36:m,38:h,42:28,43:39,44:g,45:40,47:41,60:_,84:v,85:y,86:b,87:x,88:S,89:C,102:w,105:T,106:E,109:D,111:O,113:42,114:k,115:A,116:j,121:M,122:N,123:P,124:F,125:I},e(me,[2,53]),{43:268,44:g,45:40,47:41,60:_,89:C,102:w,105:T,106:E,109:D,111:O,113:42,114:k,115:A,116:j},e(Ge,[2,121],{106:dt}),e(ft,[2,130],{108:270,10:rt,60:it,84:at,105:ot,109:st,110:ct,111:lt,112:ut}),e(pt,[2,132]),e(pt,[2,134]),e(pt,[2,135]),e(pt,[2,136]),e(pt,[2,137]),e(pt,[2,138]),e(pt,[2,139]),e(pt,[2,140]),e(pt,[2,141]),e(Ge,[2,122],{106:dt}),{10:[1,271]},e(Ge,[2,123],{106:dt}),{10:[1,272]},e(tt,[2,129]),e(Ge,[2,105],{106:dt}),e(Ge,[2,106],{113:113,44:g,60:_,89:C,102:w,105:T,106:E,109:D,111:O,114:k,115:A,116:j}),e(Ge,[2,110]),e(Ge,[2,112],{10:[1,273]}),e(Ge,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:ee,9:z,11:B,21:278},e(R,[2,34]),e(me,[2,52]),{10:rt,60:it,84:at,105:ot,107:279,108:243,109:st,110:ct,111:lt,112:ut},e(pt,[2,133]),{14:re,44:ie,60:ae,89:oe,101:280,105:se,106:ce,109:le,111:ue,114:de,115:fe,116:pe,120:88},{14:re,44:ie,60:ae,89:oe,101:281,105:se,106:ce,109:le,111:ue,114:de,115:fe,116:pe,120:88},{98:[1,282]},e(Ge,[2,120]),e(he,[2,58]),{30:283,67:qe,80:Je,81:Ye,82:172,116:Xe,117:Ze,118:Qe},e(he,[2,66]),e(He,a,{5:284}),e(ft,[2,131],{108:270,10:rt,60:it,84:at,105:ot,109:st,110:ct,111:lt,112:ut}),e(Ge,[2,126],{120:168,10:[1,285],14:re,44:ie,60:ae,89:oe,105:se,106:ce,109:le,111:ue,114:de,115:fe,116:pe}),e(Ge,[2,127],{120:168,10:[1,286],14:re,44:ie,60:ae,89:oe,105:se,106:ce,109:le,111:ue,114:de,115:fe,116:pe}),e(Ge,[2,114]),{31:[1,287],67:qe,82:219,116:Xe,117:Ze,118:Qe},{6:11,7:12,8:o,9:s,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,288],33:24,34:f,36:m,38:h,42:28,43:39,44:g,45:40,47:41,60:_,84:v,85:y,86:b,87:x,88:S,89:C,102:w,105:T,106:E,109:D,111:O,113:42,114:k,115:A,116:j,121:M,122:N,123:P,124:F,125:I},{10:rt,60:it,84:at,92:289,105:ot,107:242,108:243,109:st,110:ct,111:lt,112:ut},{10:rt,60:it,84:at,92:290,105:ot,107:242,108:243,109:st,110:ct,111:lt,112:ut},e(he,[2,62]),e(R,[2,33]),e(Ge,[2,124],{106:dt}),e(Ge,[2,125],{106:dt})],defaultActions:{},parseError:p(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:p(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,l=0,u=0,d=0,f=2,m=1,h=a.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(_.yy[v]=this.yy[v]);g.setInput(e,_.yy),_.yy.lexer=g,_.yy.parser=this,g.yylloc===void 0&&(g.yylloc={});var y=g.yylloc;a.push(y);var b=g.options&&g.options.ranges;this.parseError=typeof _.yy.parseError==`function`?_.yy.parseError:Object.getPrototypeOf(this).parseError;function x(e){n.length-=2*e,i.length-=e,a.length-=e}p(x,`popStack`);function S(){var e=r.pop()||g.lex()||m;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}p(S,`lex`);for(var C,w,T,E,D,O={},k,A,j,M;;){if(T=n[n.length-1],this.defaultActions[T]?E=this.defaultActions[T]:(C??=S(),E=o[T]&&o[T][C]),E===void 0||!E.length||!E[0]){var N=``;for(k in M=[],o[T])this.terminals_[k]&&k>f&&M.push(`'`+this.terminals_[k]+`'`);N=g.showPosition?`Parse error on line `+(l+1)+`:941+`+g.showPosition()+`942+Expecting `+M.join(`, `)+`, got '`+(this.terminals_[C]||C)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(C==m?`end of input`:`'`+(this.terminals_[C]||C)+`'`),this.parseError(N,{text:g.match,token:this.terminals_[C]||C,line:g.yylineno,loc:y,expected:M})}if(E[0]instanceof Array&&E.length>1)throw Error(`Parse Error: multiple actions possible at state: `+T+`, token: `+C);switch(E[0]){case 1:n.push(C),i.push(g.yytext),a.push(g.yylloc),n.push(E[1]),C=null,w?(C=w,w=null):(u=g.yyleng,s=g.yytext,l=g.yylineno,y=g.yylloc,d>0&&d--);break;case 2:if(A=this.productions_[E[1]][1],O.$=i[i.length-A],O._$={first_line:a[a.length-(A||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(A||1)].first_column,last_column:a[a.length-1].last_column},b&&(O._$.range=[a[a.length-(A||1)].range[0],a[a.length-1].range[1]]),D=this.performAction.apply(O,[s,u,l,_.yy,E[1],i,a].concat(h)),D!==void 0)return D;A&&(n=n.slice(0,-1*A*2),i=i.slice(0,-1*A),a=a.slice(0,-1*A)),n.push(this.productions_[E[1]][0]),i.push(O.$),a.push(O._$),j=o[n[n.length-2]][n[n.length-1]],n.push(j);break;case 3:return!0}}return!0},`parse`)};mt.lexer=(function(){return{EOF:1,parseError:p(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:p(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:p(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:p(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:p(function(){return this._more=!0,this},`more`),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).943+`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:p(function(e){this.unput(this.match.slice(e))},`less`),pastInput:p(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:p(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:p(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`944+`+t+`^`},`showPosition`),test_match:p(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.945+`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:p(function(){return this.next()||this.lex()},`lex`),begin:p(function(e){this.conditionStack.push(e)},`begin`),popState:p(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:p(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:p(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:p(function(e){this.begin(e)},`pushState`),stateStackSize:p(function(){return this.conditionStack.length},`stateStackSize`),options:{},performAction:p(function(e,t,n,r){switch(n){case 0:return this.begin(`acc_title`),34;case 1:return this.popState(),`acc_title_value`;case 2:return this.begin(`acc_descr`),36;case 3:return this.popState(),`acc_descr_value`;case 4:this.begin(`acc_descr_multiline`);break;case 5:this.popState();break;case 6:return`acc_descr_multiline_value`;case 7:return this.pushState(`shapeData`),t.yytext=``,40;case 8:return this.pushState(`shapeDataStr`),40;case 9:return this.popState(),40;case 10:return t.yytext=t.yytext.replace(/\n\s*/g,`<br/>`),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin(`callbackname`);break;case 14:this.popState();break;case 15:this.popState(),this.begin(`callbackargs`);break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return`MD_STR`;case 20:this.popState();break;case 21:this.begin(`md_string`);break;case 22:return`STR`;case 23:this.popState();break;case 24:this.pushState(`string`);break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin(`click`);break;case 33:this.popState();break;case 34:return 88;case 35:return e.lex.firstGraph()&&this.begin(`dir`),12;case 36:return e.lex.firstGraph()&&this.begin(`dir`),12;case 37:return e.lex.firstGraph()&&this.begin(`dir`),12;case 38:return e.lex.firstGraph()&&this.begin(`dir`),12;case 39:return 27;case 40:return 32;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return 98;case 45:return this.popState(),13;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return this.popState(),14;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 124;case 60:return 125;case 61:return 78;case 62:return 105;case 63:return 111;case 64:return 46;case 65:return 60;case 66:return 44;case 67:return 8;case 68:return 106;case 69:return 115;case 70:return this.popState(),77;case 71:return this.pushState(`edgeText`),75;case 72:return 119;case 73:return this.popState(),77;case 74:return this.pushState(`thickEdgeText`),75;case 75:return 119;case 76:return this.popState(),77;case 77:return this.pushState(`dottedEdgeText`),75;case 78:return 119;case 79:return 77;case 80:return this.popState(),53;case 81:return`TEXT`;case 82:return this.pushState(`ellipseText`),52;case 83:return this.popState(),55;case 84:return this.pushState(`text`),54;case 85:return this.popState(),57;case 86:return this.pushState(`text`),56;case 87:return 58;case 88:return this.pushState(`text`),67;case 89:return this.popState(),64;case 90:return this.pushState(`text`),63;case 91:return this.popState(),49;case 92:return this.pushState(`text`),48;case 93:return this.popState(),69;case 94:return this.popState(),71;case 95:return 117;case 96:return this.pushState(`trapText`),68;case 97:return this.pushState(`trapText`),70;case 98:return 118;case 99:return 67;case 100:return 90;case 101:return`SEP`;case 102:return 89;case 103:return 115;case 104:return 111;case 105:return 44;case 106:return 109;case 107:return 114;case 108:return 116;case 109:return this.popState(),62;case 110:return this.pushState(`text`),62;case 111:return this.popState(),51;case 112:return this.pushState(`text`),50;case 113:return this.popState(),31;case 114:return this.pushState(`text`),29;case 115:return this.popState(),66;case 116:return this.pushState(`text`),65;case 117:return`TEXT`;case 118:return`QUOTE`;case 119:return 9;case 120:return 10;case 121:return 11}},`anonymous`),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:swimlane-beta\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeData:{rules:[8,11,12,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackargs:{rules:[17,18,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackname:{rules:[14,15,16,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},href:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},click:{rules:[21,24,33,34,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dottedEdgeText:{rules:[21,24,76,78,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},thickEdgeText:{rules:[21,24,73,75,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},edgeText:{rules:[21,24,70,72,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},trapText:{rules:[21,24,79,82,84,86,90,92,93,94,95,96,97,110,112,114,116],inclusive:!1},ellipseText:{rules:[21,24,79,80,81,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},text:{rules:[21,24,79,82,83,84,85,86,89,90,91,92,96,97,109,110,111,112,113,114,115,116,117],inclusive:!1},vertex:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dir:{rules:[21,24,45,46,47,48,49,50,51,52,53,54,55,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr:{rules:[3,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_title:{rules:[1,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},md_string:{rules:[19,20,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},string:{rules:[21,22,23,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,44,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,74,76,77,79,82,84,86,87,88,90,92,96,97,98,99,100,101,102,103,104,105,106,107,108,110,112,114,116,118,119,120,121],inclusive:!0}}}})();function ht(){this.yy={}}return p(ht,`Parser`),ht.prototype=mt,mt.Parser=ht,new ht})(),YL.parser=YL,XL=YL,ZL=Object.assign({},XL),ZL.parse=e=>{let t=e.replace(/}\s*\n/g,`}946+`);return XL.parse(t)},vUe=ZL,yUe=p((e,t)=>{let n=pe,r=n(e,`r`),i=n(e,`g`),a=n(e,`b`);return de(r,i,a,t)},`fade`),QL=p(e=>`.label {947+ font-family: ${e.fontFamily};948+ color: ${e.nodeTextColor||e.textColor};949+ }950+ .cluster-label text {951+ fill: ${e.titleColor};952+ }953+ .cluster-label span {954+ color: ${e.titleColor};955+ }956+ .cluster-label span p {957+ background-color: transparent;958+ }959+960+ .label text,span {961+ fill: ${e.nodeTextColor||e.textColor};962+ color: ${e.nodeTextColor||e.textColor};963+ }964+965+ .node rect,966+ .node circle,967+ .node ellipse,968+ .node polygon,969+ .node path {970+ fill: ${e.mainBkg};971+ stroke: ${e.nodeBorder};972+ stroke-width: ${e.strokeWidth??1}px;973+ }974+ .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {975+ text-anchor: middle;976+ }977+978+ .node .katex path {979+ fill: #000;980+ stroke: #000;981+ stroke-width: 1px;982+ }983+984+ .rough-node .label,.node .label, .image-shape .label, .icon-shape .label {985+ text-align: center;986+ }987+ .node.clickable {988+ cursor: pointer;989+ }990+991+992+ .root .anchor path {993+ fill: ${e.lineColor} !important;994+ stroke-width: 0;995+ stroke: ${e.lineColor};996+ }997+998+ .arrowheadPath {999+ fill: ${e.arrowheadColor};1000+ }1001+1002+ .edgePath .path {1003+ stroke: ${e.lineColor};1004+ stroke-width: ${e.strokeWidth??2}px;1005+ }1006+1007+ .flowchart-link {1008+ stroke: ${e.lineColor};1009+ fill: none;1010+ }1011+1012+ .edgeLabel {1013+ background-color: ${e.edgeLabelBackground};1014+ p {1015+ background-color: ${e.edgeLabelBackground};1016+ }1017+ rect {1018+ opacity: 0.5;1019+ background-color: ${e.edgeLabelBackground};1020+ fill: ${e.edgeLabelBackground};1021+ }1022+ text-align: center;1023+ }1024+1025+ /* For html labels only */1026+ .labelBkg {1027+ background-color: ${yUe(e.edgeLabelBackground,.5)};1028+ // background-color:1029+ }1030+1031+ .cluster rect {1032+ fill: ${e.clusterBkg};1033+ stroke: ${e.clusterBorder};1034+ stroke-width: 1px;1035+ }1036+1037+ .cluster text {1038+ fill: ${e.titleColor};1039+ }1040+1041+ .cluster span {1042+ color: ${e.titleColor};1043+ }1044+ /* .cluster div {1045+ color: ${e.titleColor};1046+ } */1047+1048+ /* Collapsed subgraph node (@{ view: collapsed }) */1049+ .node .collapsed-indicator {1050+ fill: ${e.clusterBorder};1051+ stroke: none;1052+ opacity: 0.6;1053+ }1054+1055+ .node .collapsed-separator {1056+ stroke: ${e.clusterBorder};1057+ stroke-width: 0.75px;1058+ }1059+1060+ div.mermaidTooltip {1061+ position: absolute;1062+ text-align: center;1063+ max-width: 200px;1064+ padding: 2px;1065+ font-family: ${e.fontFamily};1066+ font-size: 12px;1067+ background: ${e.tertiaryColor};1068+ border: 1px solid ${e.border2};1069+ border-radius: 2px;1070+ pointer-events: none;1071+ z-index: 100;1072+ }1073+1074+ .flowchartTitleText {1075+ text-anchor: middle;1076+ font-size: 18px;1077+ fill: ${e.textColor};1078+ }1079+1080+ rect.text {1081+ fill: none;1082+ stroke-width: 0;1083+ }1084+1085+ .icon-shape, .image-shape {1086+ background-color: ${e.edgeLabelBackground};1087+ p {1088+ background-color: ${e.edgeLabelBackground};1089+ padding: 2px;1090+ }1091+ .label rect {1092+ opacity: 0.5;1093+ background-color: ${e.edgeLabelBackground};1094+ fill: ${e.edgeLabelBackground};1095+ }1096+ text-align: center;1097+ }1098+ ${UL()}1099+`,`getStyles`),$L=p(({defaultLayout:e,styles:t=QL}={})=>({parser:vUe,get db(){return new gUe},renderer:_Ue,styles:t,init:p(t=>{t.flowchart||={};let n=ys().layout??e??t.layout;n&&ic({layout:n}),t.flowchart.arrowMarkerAbsolute=t.arrowMarkerAbsolute,ic({flowchart:{arrowMarkerAbsolute:t.arrowMarkerAbsolute}})},`init`)}),`createFlowDiagram`),bUe=$L()})),eR=l({createFlowDiagram:()=>$L,diagram:()=>bUe}),tR=o((()=>{xUe(),KL(),JL(),DC(),EI(),rL(),U_(),cv(),z_(),P_(),Op(),ig(),Gp(),rh(),dc(),S()})),SUe=l({diagram:()=>CUe}),CUe,wUe=o((()=>{xUe(),KL(),JL(),DC(),EI(),rL(),U_(),cv(),z_(),P_(),Op(),ig(),Gp(),rh(),dc(),S(),h(),CUe=$L({defaultLayout:`swimlane`,styles:p(e=>`${QL(e)}1100+ .swimlane.cluster rect {1101+ stroke: ${e.clusterBorder} !important;1102+ }1103+ [data-look="neo"].cluster rect {1104+ filter: none;1105+ }1106+`,`getStyles`)})})),TUe=l({diagram:()=>AUe}),nR,EUe,DUe,rR,OUe,iR,aR,kUe,AUe,jUe=o((()=>{KL(),JL(),EI(),U_(),cv(),z_(),P_(),Op(),ig(),Gp(),rh(),dc(),S(),h(),_p(),Ne(),nR=(function(){var e=p(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],n=[2,2],r=[1,7],i=[1,9],a=[1,10],o=[1,11],s=[1,12],l=[1,30],u=[1,23],d=[1,24],f=[1,25],m=[1,26],h=[1,27],g=[1,19],_=[1,28],v=[1,29],y=[1,20],b=[1,18],x=[1,21],S=[1,22],C=[2,6],w=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],T=[1,36],E=[1,37],D=[1,38],O=[1,39],k=[1,40],A=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],j=[1,46],M=[1,47],N=[1,57],P=[43,51,53,54,55,74,75],F=[1,70],I=[1,68],L=[1,65],R=[1,69],ee=[1,71],z=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],B=[1,78],te=[1,77],ne=[1,76],re=[69,70,71,72,73],ie=[1,91],ae=[6,9,45,50],oe=[6,9,12,44,45,50,51,52],se=[1,101],ce=[1,100],le=[1,99],ue=[18,61],de=[1,110],fe=[1,109],pe=[20,43,51,53,54,55],me=[18,61,64,66],he={trace:p(function(){},`trace`),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:`error`,4:`ER_DIAGRAM`,6:`EOF`,9:`NEWLINE`,12:`COLON`,14:`STYLE_SEPARATOR`,16:`BLOCK_START`,18:`BLOCK_STOP`,19:`SQS`,20:`SQE`,21:`title`,22:`title_value`,23:`acc_title`,24:`acc_title_value`,25:`acc_descr`,26:`acc_descr_value`,27:`acc_descr_multiline_value`,33:`END`,34:`SUBGRAPH`,37:`direction_tb`,38:`direction_bt`,39:`direction_rl`,40:`direction_lr`,41:`CLASSDEF`,43:`UNICODE_TEXT`,44:`STYLE_TEXT`,45:`COMMA`,46:`CLASS`,47:`STYLE`,50:`SEMI`,51:`NUM`,52:`BRKT`,53:`ENTITY_NAME`,54:`DECIMAL_NUM`,55:`ENTITY_ONE`,61:`ATTRIBUTE_WORD`,62:`?`,64:`,`,65:`ATTRIBUTE_KEY`,66:`COMMENT`,69:`ZERO_OR_ONE`,70:`ZERO_OR_MORE`,71:`ONE_OR_MORE`,72:`ONLY_ONE`,73:`MD_PARENT`,74:`NON_IDENTIFYING`,75:`IDENTIFYING`,76:`WORD`},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:p(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:break;case 2:this.$=[];break;case 3:this.$=a[s-1].concat(a[s]);break;case 4:this.$=a[s];break;case 5:case 6:this.$=[];break;case 7:r.addEntity(a[s-4]),r.addEntity(a[s-2]),r.addRelationship(a[s-4],a[s],a[s-2],a[s-3]),this.$=[a[s-4],a[s-2]];break;case 8:r.addEntity(a[s-8]),r.addEntity(a[s-4]),r.addRelationship(a[s-8],a[s],a[s-4],a[s-5]),r.setClass([a[s-8]],a[s-6]),r.setClass([a[s-4]],a[s-2]),this.$=[a[s-8],a[s-4]];break;case 9:r.addEntity(a[s-6]),r.addEntity(a[s-2]),r.addRelationship(a[s-6],a[s],a[s-2],a[s-3]),r.setClass([a[s-6]],a[s-4]),this.$=[a[s-6],a[s-2]];break;case 10:r.addEntity(a[s-6]),r.addEntity(a[s-4]),r.addRelationship(a[s-6],a[s],a[s-4],a[s-5]),r.setClass([a[s-4]],a[s-2]),this.$=[a[s-6],a[s-4]];break;case 11:r.addEntity(a[s-3]),r.addAttributes(a[s-3],a[s-1]),this.$=[a[s-3]];break;case 12:r.addEntity(a[s-5]),r.addAttributes(a[s-5],a[s-1]),r.setClass([a[s-5]],a[s-3]),this.$=[a[s-5]];break;case 13:r.addEntity(a[s-2]),this.$=[a[s-2]];break;case 14:r.addEntity(a[s-4]),r.setClass([a[s-4]],a[s-2]),this.$=[a[s-4]];break;case 15:r.addEntity(a[s]),this.$=[a[s]];break;case 16:r.addEntity(a[s-2]),r.setClass([a[s-2]],a[s]),this.$=[a[s-2]];break;case 17:r.addEntity(a[s-6],a[s-4]),r.addAttributes(a[s-6],a[s-1]),this.$=[a[s-6]];break;case 18:r.addEntity(a[s-8],a[s-6]),r.addAttributes(a[s-8],a[s-1]),r.setClass([a[s-8]],a[s-3]),this.$=[a[s-8]];break;case 19:r.addEntity(a[s-5],a[s-3]),this.$=[a[s-5]];break;case 20:r.addEntity(a[s-7],a[s-5]),r.setClass([a[s-7]],a[s-2]),this.$=[a[s-7]];break;case 21:r.addEntity(a[s-3],a[s-1]);break;case 22:r.addEntity(a[s-5],a[s-3]),r.setClass([a[s-5]],a[s]);break;case 23:case 24:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 25:case 26:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 27:r.subgraphDepth?this.$=a[s]:(r.setDirection(a[s].value),this.$=[]);break;case 31:r.subgraphDepth=(r.subgraphDepth||1)-1,this.$=r.addSubGraph({text:a[s-2].id},a[s-1],{text:a[s-2].text});break;case 32:r.subgraphDepth=(r.subgraphDepth||0)+1,this.$={id:a[s-1],text:a[s-1]};break;case 33:r.subgraphDepth=(r.subgraphDepth||0)+1,this.$={id:a[s-4],text:a[s-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=a[s];break;case 35:this.$=a[s-1]+` `+a[s];break;case 36:this.$={stmt:`dir`,value:`TB`};break;case 37:this.$={stmt:`dir`,value:`BT`};break;case 38:this.$={stmt:`dir`,value:`RL`};break;case 39:this.$={stmt:`dir`,value:`LR`};break;case 40:this.$=a[s-3],r.addClass(a[s-2],a[s-1]);break;case 41:case 42:case 63:case 72:this.$=[a[s]];break;case 43:case 44:this.$=a[s-2].concat([a[s]]);break;case 45:this.$=a[s-2],r.setClass(a[s-1],a[s]);break;case 46:this.$=a[s-3],r.addCssStyles(a[s-2],a[s-1]);break;case 47:this.$=[a[s]];break;case 48:a[s-2].push(a[s]),this.$=a[s-2];break;case 50:this.$=a[s-1]+a[s];break;case 58:case 84:case 85:this.$=a[s].replace(/"/g,``);break;case 64:a[s].push(a[s-1]),this.$=a[s];break;case 65:this.$={type:a[s-1],name:a[s]};break;case 66:this.$={type:a[s-2],name:a[s-1],keys:a[s]};break;case 67:this.$={type:a[s-2],name:a[s-1],comment:a[s]};break;case 68:this.$={type:a[s-3],name:a[s-2],keys:a[s-1],comment:a[s]};break;case 69:case 71:case 74:this.$=a[s];break;case 70:this.$=a[s-1]+a[s];break;case 73:a[s-2].push(a[s]),this.$=a[s-2];break;case 75:this.$=a[s].replace(/"/g,``);break;case 76:this.$={cardA:a[s],relType:a[s-1],cardB:a[s-2]};break;case 77:this.$=r.Cardinality.ZERO_OR_ONE;break;case 78:this.$=r.Cardinality.ZERO_OR_MORE;break;case 79:this.$=r.Cardinality.ONE_OR_MORE;break;case 80:this.$=r.Cardinality.ONLY_ONE;break;case 81:this.$=r.Cardinality.MD_PARENT;break;case 82:this.$=r.Identification.NON_IDENTIFYING;break;case 83:this.$=r.Identification.IDENTIFYING}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},e(t,n,{5:3}),{6:[1,4],7:5,8:6,9:r,10:8,21:i,23:a,25:o,27:s,28:13,29:14,30:15,31:16,32:17,34:l,37:u,38:d,39:f,40:m,41:h,43:g,46:_,47:v,51:y,53:b,54:x,55:S},e(t,C,{1:[2,1]}),e(w,[2,3]),e(w,[2,4]),e(w,[2,5]),e(w,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:T,70:E,71:D,72:O,73:k}),{22:[1,41]},{24:[1,42]},{26:[1,43]},e(w,[2,26]),e(w,[2,27]),e(w,[2,28]),e(w,[2,29]),e(w,[2,30]),e(w,n,{5:44}),e(A,[2,58]),e(A,[2,59]),e(A,[2,60]),e(A,[2,61]),e(A,[2,62]),e(w,[2,36]),e(w,[2,37]),e(w,[2,38]),e(w,[2,39]),{15:45,43:j,44:M},{15:48,43:j,44:M},{15:49,43:j,44:M},{10:50,43:g,51:y,53:b,54:x,55:S},{10:51,43:g,51:y,53:b,54:x,55:S},{15:52,43:j,44:M},{17:53,18:[1,54],56:55,57:56,61:N},{10:58,43:g,51:y,53:b,54:x,55:S},{68:59,74:[1,60],75:[1,61]},e(P,[2,77]),e(P,[2,78]),e(P,[2,79]),e(P,[2,80]),e(P,[2,81]),e(w,[2,23]),e(w,[2,24]),e(w,[2,25]),{6:[1,63],7:5,8:6,9:r,10:8,21:i,23:a,25:o,27:s,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:l,37:u,38:d,39:f,40:m,41:h,43:g,46:_,47:v,51:y,53:b,54:x,55:S},{12:F,42:64,44:I,45:L,48:66,49:67,51:R,52:ee},e(z,[2,41]),e(z,[2,42]),{15:72,43:j,44:M,45:L},{12:F,42:73,44:I,45:L,48:66,49:67,51:R,52:ee},{6:B,9:te,19:[1,75],35:74,50:ne},{12:[1,79],14:[1,80]},e(w,[2,16],{67:35,11:81,16:[1,82],45:L,69:T,70:E,71:D,72:O,73:k}),{18:[1,83]},e(w,[2,13]),{17:84,18:[2,63],56:55,57:56,61:N},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:T,70:E,71:D,72:O,73:k},e(re,[2,82]),e(re,[2,83]),e(w,[2,31]),e(w,C),{6:B,9:te,35:90,45:ie,50:ne},{43:[1,92],44:[1,93]},e(ae,[2,47],{49:94,12:F,44:I,51:R,52:ee}),e(oe,[2,49]),e(oe,[2,54]),e(oe,[2,55]),e(oe,[2,56]),e(oe,[2,57]),e(w,[2,45],{45:L}),{6:B,9:te,35:95,45:ie,50:ne},e(w,[2,32]),{10:97,36:96,43:g,51:y,53:b,54:x,55:S},e(w,[2,51]),e(w,[2,52]),e(w,[2,53]),{13:98,43:se,53:ce,76:le},{15:102,43:j,44:M},{10:103,43:g,51:y,53:b,54:x,55:S},{17:104,18:[1,105],56:55,57:56,61:N},e(w,[2,11]),{18:[2,64]},e(ue,[2,65],{59:106,60:107,63:108,65:de,66:fe}),e([18,61,65,66],[2,71]),{61:[2,70]},e(w,[2,21],{14:[1,112],16:[1,111]}),e([43,51,53,54,55],[2,76]),e(w,[2,40]),{12:F,44:I,48:113,49:67,51:R,52:ee},e(z,[2,43]),e(z,[2,44]),e(oe,[2,50]),e(w,[2,46]),{10:115,20:[1,114],43:g,51:y,53:b,54:x,55:S},e(pe,[2,34]),e(w,[2,7]),e(w,[2,84]),e(w,[2,85]),e(w,[2,86]),{12:[1,116],45:L},{12:[1,118],14:[1,117]},{18:[1,119]},e(w,[2,14]),e(ue,[2,66],{60:120,64:[1,121],66:fe}),e(ue,[2,67]),e(me,[2,72]),e(ue,[2,75]),e(me,[2,74]),{17:122,18:[1,123],56:55,57:56,61:N},{15:124,43:j,44:M},e(ae,[2,48],{49:94,12:F,44:I,51:R,52:ee}),{6:B,9:te,35:125,50:ne},e(pe,[2,35]),{13:126,43:se,53:ce,76:le},{15:127,43:j,44:M},{13:128,43:se,53:ce,76:le},e(w,[2,12]),e(ue,[2,68]),{63:129,65:de},{18:[1,130]},e(w,[2,19]),e(w,[2,22],{16:[1,131],45:L}),e(w,[2,33]),e(w,[2,10]),{12:[1,132],45:L},e(w,[2,9]),e(me,[2,73]),e(w,[2,17]),{17:133,18:[1,134],56:55,57:56,61:N},{13:135,43:se,53:ce,76:le},{18:[1,136]},e(w,[2,20]),e(w,[2,8]),e(w,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:p(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:p(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,l=0,u=0,d=0,f=2,m=1,h=a.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(_.yy[v]=this.yy[v]);g.setInput(e,_.yy),_.yy.lexer=g,_.yy.parser=this,g.yylloc===void 0&&(g.yylloc={});var y=g.yylloc;a.push(y);var b=g.options&&g.options.ranges;this.parseError=typeof _.yy.parseError==`function`?_.yy.parseError:Object.getPrototypeOf(this).parseError;function x(e){n.length-=2*e,i.length-=e,a.length-=e}p(x,`popStack`);function S(){var e=r.pop()||g.lex()||m;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}p(S,`lex`);for(var C,w,T,E,D,O={},k,A,j,M;;){if(T=n[n.length-1],this.defaultActions[T]?E=this.defaultActions[T]:(C??=S(),E=o[T]&&o[T][C]),E===void 0||!E.length||!E[0]){var N=``;for(k in M=[],o[T])this.terminals_[k]&&k>f&&M.push(`'`+this.terminals_[k]+`'`);N=g.showPosition?`Parse error on line `+(l+1)+`:1107+`+g.showPosition()+`1108+Expecting `+M.join(`, `)+`, got '`+(this.terminals_[C]||C)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(C==m?`end of input`:`'`+(this.terminals_[C]||C)+`'`),this.parseError(N,{text:g.match,token:this.terminals_[C]||C,line:g.yylineno,loc:y,expected:M})}if(E[0]instanceof Array&&E.length>1)throw Error(`Parse Error: multiple actions possible at state: `+T+`, token: `+C);switch(E[0]){case 1:n.push(C),i.push(g.yytext),a.push(g.yylloc),n.push(E[1]),C=null,w?(C=w,w=null):(u=g.yyleng,s=g.yytext,l=g.yylineno,y=g.yylloc,d>0&&d--);break;case 2:if(A=this.productions_[E[1]][1],O.$=i[i.length-A],O._$={first_line:a[a.length-(A||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(A||1)].first_column,last_column:a[a.length-1].last_column},b&&(O._$.range=[a[a.length-(A||1)].range[0],a[a.length-1].range[1]]),D=this.performAction.apply(O,[s,u,l,_.yy,E[1],i,a].concat(h)),D!==void 0)return D;A&&(n=n.slice(0,-1*A*2),i=i.slice(0,-1*A),a=a.slice(0,-1*A)),n.push(this.productions_[E[1]][0]),i.push(O.$),a.push(O._$),j=o[n[n.length-2]][n[n.length-1]],n.push(j);break;case 3:return!0}}return!0},`parse`)};he.lexer=(function(){return{EOF:1,parseError:p(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:p(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:p(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:p(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:p(function(){return this._more=!0,this},`more`),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).1109+`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:p(function(e){this.unput(this.match.slice(e))},`less`),pastInput:p(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:p(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:p(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`1110+`+t+`^`},`showPosition`),test_match:p(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.1111+`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:p(function(){return this.next()||this.lex()},`lex`),begin:p(function(e){this.conditionStack.push(e)},`begin`),popState:p(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:p(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:p(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:p(function(e){this.begin(e)},`pushState`),stateStackSize:p(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:p(function(e,t,n,r){switch(n){case 0:return this.begin(`acc_title`),23;case 1:return this.popState(),`acc_title_value`;case 2:return this.begin(`acc_descr`),25;case 3:return this.popState(),`acc_descr_value`;case 4:this.begin(`acc_descr_multiline`);break;case 5:this.popState();break;case 6:return`acc_descr_multiline_value`;case 7:return 37;case 8:return 38;case 9:return 39;case 10:return 40;case 11:break;case 12:return 9;case 13:return 53;case 14:return 76;case 15:return 4;case 16:return this.begin(`block`),16;case 17:return 52;case 18:return 52;case 19:return 45;case 20:return 14;case 21:return 12;case 22:break;case 23:return 65;case 24:return 61;case 25:return 61;case 26:this.begin(`block_bq`);break;case 27:return 61;case 28:this.popState();break;case 29:return 66;case 30:break;case 31:return this.popState(),18;case 32:return t.yytext[0];case 33:return 19;case 34:return 20;case 35:return this.begin(`style`),47;case 36:return this.popState(),9;case 37:break;case 38:return 12;case 39:return 45;case 40:return 52;case 41:return this.begin(`style`),41;case 42:return 46;case 43:return 34;case 44:return 33;case 45:return 69;case 46:return 71;case 47:return 71;case 48:return 71;case 49:return 69;case 50:return 69;case 51:return 70;case 52:return 70;case 53:return 70;case 54:return 70;case 55:return 70;case 56:return 71;case 57:return 70;case 58:return 71;case 59:return 72;case 60:return 72;case 61:return 54;case 62:return 72;case 63:return 72;case 64:return 72;case 65:return 55;case 66:return 51;case 67:return 72;case 68:return 69;case 69:return 70;case 70:return 71;case 71:return 73;case 72:return 74;case 73:return 75;case 74:return 75;case 75:return 74;case 76:return 74;case 77:return 74;case 78:return 44;case 79:return 50;case 80:return 43;case 81:return t.yytext[0];case 82:return 6}},`anonymous`),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[ \t\r]+)/i,/^(?:[\n]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:subgraph\b)/i,/^(?:end\b\s*)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[36,37,38,39,40,78,79],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[27,28],inclusive:!1},block:{rules:[22,23,24,25,26,29,30,31,32],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,33,34,35,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,80,81,82],inclusive:!0}}}})();function ge(){this.yy={}}return p(ge,`Parser`),ge.prototype=he,he.Parser=ge,new ge})(),nR.parser=nR,EUe=nR,DUe=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.subgraphDepth=0,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.direction=`TB`,this.Cardinality={ZERO_OR_ONE:`ZERO_OR_ONE`,ZERO_OR_MORE:`ZERO_OR_MORE`,ONE_OR_MORE:`ONE_OR_MORE`,ONLY_ONE:`ONLY_ONE`,MD_PARENT:`MD_PARENT`},this.Identification={NON_IDENTIFYING:`NON_IDENTIFYING`,IDENTIFYING:`IDENTIFYING`},this.setAccTitle=Zs,this.getAccTitle=Qs,this.setAccDescription=$s,this.getAccDescription=ec,this.setDiagramTitle=tc,this.getDiagramTitle=nc,this.getConfig=p(()=>Z().er,`getConfig`),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this),this.addSubGraph=this.addSubGraph.bind(this)}static{p(this,`ErDB`)}addEntity(e,t=``){return this.entities.has(e)?!this.entities.get(e)?.alias&&t&&(this.entities.get(e).alias=t,y.info(`Add alias '${t}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:t,shape:`erBox`,look:Z().look??`default`,cssClasses:`default`,cssStyles:[],labelType:`markdown`}),y.info(`Added new entity :`,e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,t){let n=this.addEntity(e),r;for(r=t.length-1;r>=0;r--)t[r].keys||(t[r].keys=[]),t[r].comment||(t[r].comment=``),n.attributes.push(t[r]),y.debug(`Added attribute `,t[r].name)}addRelationship(e,t,n,r){let i;if(this.subGraphLookup.has(e))i=e;else{let t=this.addEntity(e);if(!t)return;i=t.id}let a;if(this.subGraphLookup.has(n))a=n;else{let e=this.addEntity(n);if(!e)return;a=e.id}let o={entityA:i,roleA:t,entityB:a,relSpec:r};this.relationships.push(o),y.debug(`Added new relationship :`,o)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let t=[];for(let n of e){let e=this.classes.get(n);e?.styles&&(t=[...t,...e.styles??[]].map(e=>e.trim())),e?.textStyles&&(t=[...t,...e.textStyles??[]].map(e=>e.trim()))}return t}addCssStyles(e,t){for(let n of e){let e=this.entities.get(n),r=this.subGraphLookup.get(n);if(t){if(e)for(let n of t)e.cssStyles.push(n);if(r){r.cssStyles||=[];for(let e of t)r.cssStyles.push(e)}}}}addClass(e,t){e.forEach(e=>{let n=this.classes.get(e);n===void 0&&(n={id:e,styles:[],textStyles:[]},this.classes.set(e,n)),t&&t.forEach(function(e){if(/color/.exec(e)){let t=e.replace(`fill`,`bgFill`);n.textStyles.push(t)}n.styles.push(e)})})}addSubGraph(e,t,n){let r=e.text.trim(),i=n.text,a=p(e=>{let t=new Set,n;return{nodeList:e.filter(e=>{if(e?.stmt)return e.stmt===`dir`&&(n=e.value),!1;if(typeof e!=`string`)return!1;let r=e.trim();return!r||t.has(r)?!1:(t.add(r),!0)}),dir:n}},`uniq`)(t.flat()),o=a.nodeList,s=a.dir;r??=`subGraph`+this.subCount,i||=``,i=this.sanitizeText(i),this.subCount+=1;let l={id:r,nodes:o,title:i.trim(),classes:[],cssStyles:[],dir:s,labelType:this.sanitizeNodeLabelType(n?.type)};return y.info(`Adding`,l.id,l.nodes,l.dir),l.nodes=this.makeUniq(l,this.subGraphs).nodes,this.subGraphs.push(l),this.subGraphLookup.set(r,l),r}getSubGraphs(){return this.subGraphs}setClass(e,t){for(let n of e){let e=this.entities.get(n);if(e)for(let n of t)e.cssClasses+=` `+n;let r=this.subGraphLookup.get(n);if(r)for(let e of t)r.classes.push(e)}}subgraphNodeCache(e){let t=new Set;for(let n of e)for(let e of n.nodes)t.add(e);return t}makeUniq(e,t){let n=this.subgraphNodeCache(t),r=[];return e.nodes.forEach((t,i)=>{n.has(t)?y.warn(`Entity '${t}' already belongs to another subgraph and will be ignored`):r.push(e.nodes[i])}),{nodes:r}}sanitizeText(e){return Vs.sanitizeText(e,Z())}sanitizeNodeLabelType(e){switch(e){case`markdown`:case`string`:case`text`:return e;default:return`markdown`}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.subgraphDepth=0,Xs()}getData(){let e=[],t=[],n=Z(),r=this.getSubGraphs(),i=new Map,a=new Map;for(let e=r.length-1;e>=0;e--){let t=r[e];t.nodes.length>0&&a.set(t.id,!0);for(let e of t.nodes)i.set(e,t.id)}for(let t=r.length-1;t>=0;t--){let a=r[t];e.push({id:a.id,label:a.title,labelStyle:``,labelType:a.labelType,parentId:i.get(a.id),padding:8,cssCompiledStyles:this.getCompiledStyles(a.classes),cssStyles:a.cssStyles,cssClasses:a.classes.join(` `),shape:`rect`,dir:a.dir,isGroup:!0,look:n.look})}let o=new Set(r.map(e=>e.id)),s=0;for(let t of this.entities.keys()){if(o.has(t))continue;let n=this.entities.get(t);n&&(n.cssCompiledStyles=this.getCompiledStyles(n.cssClasses.split(` `)),n.colorIndex=s++,e.push({...n,parentId:i.get(t),isGroup:!1}))}let l=0;for(let e of this.relationships){let r={id:nh(e.entityA,e.entityB,{prefix:`id`,counter:l++}),type:`normal`,curve:`basis`,start:e.entityA,end:e.entityB,label:e.roleA,labelpos:`c`,thickness:`normal`,classes:`relationshipLine`,arrowTypeStart:e.relSpec.cardB.toLowerCase(),arrowTypeEnd:e.relSpec.cardA.toLowerCase(),pattern:e.relSpec.relType==`IDENTIFYING`?`solid`:`dashed`,look:n.look,labelType:`markdown`};t.push(r)}return{nodes:e,edges:t,other:{},config:n,direction:this.direction}}},rR={},m(rR,{draw:()=>OUe}),OUe=p(async function(e,t,n,r){y.info(`REF0:`),y.info(`Drawing er diagram (unified)`,t);let{securityLevel:i,er:a,layout:o}=Z(),s=r.db.getData(),l=GL(t,i);s.type=r.type,s.layoutAlgorithm=TI(o),s.config.flowchart.nodeSpacing=a?.nodeSpacing||140,s.config.flowchart.rankSpacing=a?.rankSpacing||80,s.direction=r.db.getDirection();let{config:u}=s,{look:d}=u;s.markers=d===`neo`?[`only_one_neo`,`zero_or_one_neo`,`one_or_more_neo`,`zero_or_more_neo`]:[`only_one`,`zero_or_one`,`one_or_more`,`zero_or_more`],s.diagramId=t,await wI(s,l),s.layoutAlgorithm===`elk`&&l.select(`.edges`).lower();let f=l.selectAll(`[id*="-background"]`);Array.from(f).length>0&&f.each(function(){let e=$c(this),t=e.attr(`id`).replace(`-background`,``),n=l.select(`#${CSS.escape(t)}`);if(!n.empty()){let t=n.attr(`transform`);e.attr(`transform`,t)}}),eh.insertTitle(l,`erDiagramTitleText`,a?.titleTopMargin??25,r.db.getDiagramTitle()),qL(l,8,`erDiagram`,a?.useMaxWidth??!0)},`draw`),iR=p((e,t)=>{let n=pe,r=n(e,`r`),i=n(e,`g`),a=n(e,`b`);return de(r,i,a,t)},`fade`),aR=new Set([`redux-color`,`redux-dark-color`]),kUe=p(e=>{let{theme:t,look:n,bkgColorArray:r,borderColorArray:i}=e;if(!aR.has(t))return``;let a=r?.length>0,o=``;for(let t=0;t<e.THEME_COLOR_LIMIT;t++)o+=`1112+1113+ [data-look="${n}"][data-color-id="color-${t}"].node path {1114+ stroke: ${i[t]};1115+ ${a?`fill: ${r[t]};`:``}1116+ }1117+1118+ [data-look="${n}"][data-color-id="color-${t}"].node rect {1119+ stroke: ${i[t]};1120+ ${a?`fill: ${r[t]};`:``}1121+ }1122+ `;return o},`genColor`),AUe={parser:EUe,get db(){return new DUe},renderer:rR,styles:p(e=>{let{look:t,theme:n,erEdgeLabelBackground:r,strokeWidth:i}=e;return`1123+ ${kUe(e)}1124+ .entityBox {1125+ fill: ${e.mainBkg};1126+ stroke: ${e.nodeBorder};1127+ }1128+1129+ .relationshipLabelBox {1130+ fill: ${e.tertiaryColor};1131+ opacity: 0.7;1132+ background-color: ${e.tertiaryColor};1133+ rect {1134+ opacity: 0.5;1135+ }1136+ }1137+1138+ .labelBkg {1139+ background-color: ${aR.has(n)&&r?r:iR(e.tertiaryColor,.5)};1140+ }1141+1142+ .edgeLabel {1143+ background-color: ${aR.has(n)&&r?r:e.edgeLabelBackground};1144+ }1145+ .edgeLabel .label rect {1146+ fill: ${aR.has(n)&&r?r:e.edgeLabelBackground};1147+ }1148+ .edgeLabel .label text {1149+ fill: ${e.textColor};1150+ }1151+1152+ .edgeLabel .label {1153+ fill: ${e.nodeBorder};1154+ font-size: 14px;1155+ }1156+1157+ .label {1158+ font-family: ${e.fontFamily};1159+ color: ${e.nodeTextColor||e.textColor};1160+ }1161+1162+ .edge-pattern-dashed {1163+ stroke-dasharray: 8,8;1164+ }1165+1166+ .node rect,1167+ .node circle,1168+ .node ellipse,1169+ .node polygon1170+ {1171+ fill: ${e.mainBkg};1172+ stroke: ${e.nodeBorder};1173+ stroke-width: ${t===`neo`?i:`1px`};1174+ }1175+1176+ .relationshipLine {1177+ stroke: ${e.lineColor};1178+ stroke-width: ${t===`neo`?i:`1px`};1179+ fill: none;1180+ }1181+1182+ .marker {1183+ fill: none !important;1184+ stroke: ${e.lineColor} !important;1185+ stroke-width: 1;1186+ }1187+ [data-look=neo].labelBkg {1188+ background-color: ${iR(e.tertiaryColor,.5)};1189+ }1190+1191+ .cluster rect {1192+ fill: ${e.clusterBkg??e.mainBkg};1193+ stroke: ${e.clusterBorder??e.nodeBorder};1194+ stroke-width: 1px;1195+ }1196+1197+ .cluster text {1198+ fill: ${e.titleColor??e.textColor};1199+ }1200+1201+ .cluster-label text {1202+ fill: ${e.titleColor??e.textColor};1203+ }1204+`},`getStyles`)}})),oR,sR=o((()=>{h(),oR=class{constructor(e){this.init=e,this.records=this.init()}static{p(this,`ImperativeState`)}reset(){this.records=this.init()}}}));function cR(e,t){e.accDescr&&t.setAccDescription?.(e.accDescr),e.accTitle&&t.setAccTitle?.(e.accTitle),e.title&&t.setDiagramTitle?.(e.title)}var lR=o((()=>{h(),p(cR,`populateCommonDb`)}));function uR(e){return typeof e==`object`&&!!e&&typeof e.$type==`string`}function dR(e){return typeof e==`object`&&!!e&&typeof e.$refText==`string`&&`ref`in e}function fR(e){return typeof e==`object`&&!!e&&typeof e.$refText==`string`&&`items`in e}function pR(e){return typeof e==`object`&&!!e&&typeof e.name==`string`&&typeof e.type==`string`&&typeof e.path==`string`}function mR(e){return typeof e==`object`&&!!e&&typeof e.info==`object`&&typeof e.message==`string`}function hR(e){return typeof e==`object`&&!!e&&Array.isArray(e.content)}function gR(e){return typeof e==`object`&&!!e&&typeof e.tokenType==`object`}function _R(e){return hR(e)&&typeof e.fullText==`string`}function MUe(e){return typeof e==`string`?e:e===void 0?`undefined`:typeof e.toString==`function`?e.toString():Object.prototype.toString.call(e)}function vR(e){return!!e&&typeof e[Symbol.iterator]==`function`}function yR(...e){if(e.length===1){let t=e[0];if(t instanceof GU)return t;if(vR(t))return new GU(()=>t[Symbol.iterator](),e=>e.next());if(typeof t.length==`number`)return new GU(()=>({index:0}),e=>e.index<t.length?{done:!1,value:t[e.index++]}:qU)}return e.length>1?new GU(()=>({collIndex:0,arrIndex:0}),t=>{do{if(t.iterator){let e=t.iterator.next();if(!e.done)return e;t.iterator=void 0}if(t.array){if(t.arrIndex<t.array.length)return{done:!1,value:t.array[t.arrIndex++]};t.array=void 0,t.arrIndex=0}if(t.collIndex<e.length){let n=e[t.collIndex++];vR(n)?t.iterator=n[Symbol.iterator]():n&&typeof n.length==`number`&&(t.array=n)}}while(t.iterator||t.array||t.collIndex<e.length);return qU}):KU}function bR(e,t={}){for(let[n,r]of Object.entries(e))n.startsWith(`$`)||(Array.isArray(r)?r.forEach((r,i)=>{uR(r)&&(r.$container=e,r.$containerProperty=n,r.$containerIndex=i,t.deep&&bR(r,t))}):uR(r)&&(r.$container=e,r.$containerProperty=n,t.deep&&bR(r,t)))}function xR(e,t){let n=e;for(;n;){if(t(n))return n;n=n.$container}}function NUe(e,t){let n=e;for(;n;){if(t(n))return!0;n=n.$container}return!1}function SR(e){let t=CR(e).$document;if(!t)throw Error(`AST node has no document.`);return t}function CR(e){for(;e.$container;)e=e.$container;return e}function wR(e){return dR(e)?e.ref?[e.ref]:[]:fR(e)?e.items.map(e=>e.ref):[]}function TR(e,t){if(!e)throw Error(`Node must be an AstNode.`);let n=t?.range;return new GU(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),t=>{for(;t.keyIndex<t.keys.length;){let r=t.keys[t.keyIndex];if(!r.startsWith(`$`)){let i=e[r];if(uR(i)){if(t.keyIndex++,OR(i,n))return{done:!1,value:i}}else if(Array.isArray(i)){for(;t.arrayIndex<i.length;){let e=i[t.arrayIndex++];if(uR(e)&&OR(e,n))return{done:!1,value:e}}t.arrayIndex=0}}t.keyIndex++}return qU})}function ER(e,t){if(!e)throw Error(`Root node must be an AstNode.`);return new JU(e,e=>TR(e,t))}function DR(e,t){if(!e)throw Error(`Root node must be an AstNode.`);return t?.range&&!OR(e,t.range)?new JU(e,()=>[]):new JU(e,e=>TR(e,t),{includeRoot:!0})}function OR(e,t){if(!t)return!0;let n=e.$cstNode?.range;return n?yz(n,t):!1}function kR(e){return new GU(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),t=>{for(;t.keyIndex<t.keys.length;){let n=t.keys[t.keyIndex];if(!n.startsWith(`$`)){let r=e[n];if(dR(r)||fR(r))return t.keyIndex++,{done:!1,value:{reference:r,container:e,property:n}};if(Array.isArray(r)){for(;t.arrayIndex<r.length;){let i=t.arrayIndex++,a=r[i];if(dR(a)||fR(r))return{done:!1,value:{reference:a,container:e,property:n,index:i}}}t.arrayIndex=0}}t.keyIndex++}return qU})}function AR(e,t){let n=e.getTypeMetaData(t.$type),r=t;for(let e of Object.values(n.properties))e.defaultValue!==void 0&&r[e.name]===void 0&&(r[e.name]=jR(e.defaultValue))}function jR(e){return Array.isArray(e)?[...e.map(jR)]:e}function MR(e,t,n){let r={$type:e.$type};n&&(n.set(e,r),n.set(r,e));for(let[i,a]of Object.entries(e))if(!i.startsWith(`$`)){if(uR(a))r[i]=MR(a,t,n);else if(dR(a))r[i]=t(r,i,a.$refNode,a.$refText,a);else if(Array.isArray(a)){let e=[];for(let o of a)uR(o)?e.push(MR(o,t,n)):dR(o)?e.push(t(r,i,o.$refNode,o.$refText,o)):e.push(o);r[i]=e}else r[i]=a}return bR(r,{deep:!0}),r}function NR(e){return XW.isInstance(e,QU.$type)}function PR(e){return XW.isInstance(e,$U.$type)}function PUe(e){return XW.isInstance(e,eW.$type)}function FUe(e){return XW.isInstance(e,tW.$type)}function FR(e){return XW.isInstance(e,nW.$type)}function IR(e){return XW.isInstance(e,rW.$type)}function IUe(e){return XW.isInstance(e,iW.$type)}function LR(e){return XW.isInstance(e,aW.$type)}function RR(e){return XW.isInstance(e,oW.$type)}function zR(e){return XW.isInstance(e,sW.$type)}function BR(e){return XW.isInstance(e,cW.$type)}function LUe(e){return XW.isInstance(e,lW.$type)}function VR(e){return XW.isInstance(e,uW.$type)}function HR(e){return XW.isInstance(e,dW.$type)}function UR(e){return XW.isInstance(e,fW.$type)}function WR(e){return XW.isInstance(e,pW.$type)}function RUe(e){return XW.isInstance(e,mW.$type)}function zUe(e){return XW.isInstance(e,hW.$type)}function GR(e){return XW.isInstance(e,gW.$type)}function KR(e){return XW.isInstance(e,_W.$type)}function qR(e){return XW.isInstance(e,vW.$type)}function BUe(e){return XW.isInstance(e,yW.$type)}function VUe(e){return XW.isInstance(e,bW.$type)}function JR(e){return XW.isInstance(e,xW.$type)}function YR(e){return XW.isInstance(e,SW.$type)}function HUe(e){return XW.isInstance(e,CW.$type)}function XR(e){return XW.isInstance(e,wW.$type)}function ZR(e){return XW.isInstance(e,TW.$type)}function UUe(e){return XW.isInstance(e,EW.$type)}function WUe(e){return XW.isInstance(e,DW.$type)}function QR(e){return XW.isInstance(e,OW.$type)}function $R(e){return XW.isInstance(e,kW.$type)}function ez(e){return XW.isInstance(e,AW.$type)}function tz(e){return XW.isInstance(e,jW.$type)}function nz(e){return XW.isInstance(e,MW.$type)}function rz(e){return XW.isInstance(e,NW.$type)}function iz(e){return XW.isInstance(e,PW.$type)}function GUe(e){return XW.isInstance(e,FW.$type)}function az(e){return XW.isInstance(e,IW.$type)}function KUe(e){return XW.isInstance(e,LW.$type)}function oz(e){return XW.isInstance(e,RW.$type)}function sz(e){return XW.isInstance(e,zW.$type)}function cz(e){return XW.isInstance(e,BW.$type)}function lz(e){return XW.isInstance(e,VW.$type)}function qUe(e){return XW.isInstance(e,HW.$type)}function JUe(e){return XW.isInstance(e,UW.$type)}function uz(e){return XW.isInstance(e,WW.$type)}function dz(e){return XW.isInstance(e,GW.$type)}function fz(e){return XW.isInstance(e,KW.$type)}function YUe(e){return XW.isInstance(e,qW.$type)}function pz(e){return XW.isInstance(e,JW.$type)}function XUe(e){let t=e,n=!1;for(;t;){let e=xR(t.grammarSource,$R);if(e&&e.dataType)t=t.container,n=!0;else if(n)return t;else return}}function mz(e){return new JU(e,e=>hR(e)?e.content:[],{includeRoot:!0})}function ZUe(e){return mz(e).filter(gR)}function hz(e,t){for(;e.container;)if(e=e.container,e===t)return!0;return!1}function gz(e){return{start:{character:e.startColumn-1,line:e.startLine-1},end:{character:e.endColumn,line:e.endLine-1}}}function _z(e){if(!e)return;let{offset:t,end:n,range:r}=e;return{range:r,offset:t,end:n,length:n-t}}function vz(e,t){if(e.end.line<t.start.line||e.end.line===t.start.line&&e.end.character<=t.start.character)return ZW.Before;if(e.start.line>t.end.line||e.start.line===t.end.line&&e.start.character>=t.end.character)return ZW.After;let n=e.start.line>t.start.line||e.start.line===t.start.line&&e.start.character>=t.start.character,r=e.end.line<t.end.line||e.end.line===t.end.line&&e.end.character<=t.end.character;return n&&r?ZW.Inside:n?ZW.OverlapBack:r?ZW.OverlapFront:ZW.Outside}function yz(e,t){return vz(e,t)>ZW.After}function QUe(e,t,n=QW){if(e){if(t>0){let r=t-e.offset,i=e.text.charAt(r);n.test(i)||t--}return Sz(e,t)}}function bz(e,t){if(e){let n=Tz(e,!0);if(n&&xz(n,t))return n;if(_R(e)){let n=e.content.findIndex(e=>!e.hidden);for(let r=n-1;r>=0;r--){let n=e.content[r];if(xz(n,t))return n}}}}function xz(e,t){return gR(e)&&t.includes(e.tokenType.name)}function Sz(e,t){if(gR(e))return e;if(hR(e)){let n=wz(e,t,!1);if(n)return Sz(n,t)}}function Cz(e,t){if(gR(e))return e;if(hR(e)){let n=wz(e,t,!0);if(n)return Cz(n,t)}}function wz(e,t,n){let r=0,i=e.content.length-1,a;for(;r<=i;){let o=Math.floor((r+i)/2),s=e.content[o];if(s.offset<=t&&s.end>t)return s;s.end<=t?(a=n?s:void 0,r=o+1):i=o-1}return a}function Tz(e,t=!0){for(;e.container;){let n=e.container,r=n.content.indexOf(e);for(;r>0;){r--;let e=n.content[r];if(t||!e.hidden)return e}e=n}}function $Ue(e,t=!0){for(;e.container;){let n=e.container,r=n.content.indexOf(e),i=n.content.length-1;for(;r<i;){r++;let e=n.content[r];if(t||!e.hidden)return e}e=n}}function eWe(e){if(e.range.start.character===0)return e;let t=e.range.start.line,n=e,r;for(;e.container;){let i=e.container,a=r??i.content.indexOf(e);if(a===0?(e=i,r=void 0):(r=a-1,e=i.content[r]),e.range.start.line!==t)break;n=e}return n}function tWe(e,t){let n=nWe(e,t);return n?n.parent.content.slice(n.a+1,n.b):[]}function nWe(e,t){let n=Ez(e),r=Ez(t),i;for(let e=0;e<n.length&&e<r.length;e++){let t=n[e],a=r[e];if(t.parent===a.parent)i={parent:t.parent,a:t.index,b:a.index};else break}return i}function Ez(e){let t=[];for(;e.container;){let n=e.container,r=n.content.indexOf(e);t.push({parent:n,index:r}),e=n}return t.reverse()}function Dz(e,t=`Error: Got unexpected value.`){throw Error(t)}function Oz(e,t=`Error: Condition is violated.`){if(!e)throw Error(t)}function kz(e){return e.charCodeAt(0)}function Az(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function jz(e,t){if(e[t]===!0)throw`duplicate flag `+t;e[t],e[t]=!0}function Mz(e){if(e===void 0)throw Error(`Internal Error - Should never get here!`);return!0}function Nz(){throw Error(`Internal Error - Should never get here!`)}function Pz(e){return e.type===`Character`}function rWe(e){try{typeof e!=`string`&&(e=e.source),e=`/${e}/`;let t=lG.pattern(e),n=[];for(let r of t.value.value)uG.reset(e),uG.visit(r),n.push({start:uG.startRegexp,end:uG.endRegex});return n}catch{return[]}}function Fz(e){try{return typeof e==`string`&&(e=new RegExp(e)),e=e.toString(),uG.reset(e),uG.visit(lG.pattern(e)),uG.multiline}catch{return!1}}function Iz(e){let t=typeof e==`string`?new RegExp(e):e;return dG.some(e=>t.test(e))}function Lz(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Rz(e,t){let n=zz(e),r=t.match(n);return!!r&&r[0].length>0}function zz(e){typeof e==`string`&&(e=new RegExp(e));let t=e,n=e.source,r=0;function i(){let e=``,a;function o(t){e+=n.substr(r,t),r+=t}Q(o,`appendRaw`);function s(t){e+=`(?:`+n.substr(r,t)+`|$)`,r+=t}for(Q(s,`appendOptional`);r<n.length;)switch(n[r]){case`\\`:switch(n[r+1]){case`c`:s(3);break;case`x`:s(4);break;case`u`:t.unicode?n[r+2]===`{`?s(n.indexOf(`}`,r)-r+1):s(6):s(2);break;case`p`:case`P`:t.unicode?s(n.indexOf(`}`,r)-r+1):s(2);break;case`k`:s(n.indexOf(`>`,r)-r+1);break;default:s(2)}break;case`[`:a=/\[(?:\\.|.)*?\]/g,a.lastIndex=r,a=a.exec(n)||[],s(a[0].length);break;case`|`:case`^`:case`$`:case`*`:case`+`:case`?`:o(1);break;case`{`:a=/\{\d+,?\d*\}/g,a.lastIndex=r,a=a.exec(n),a?o(a[0].length):s(1);break;case`(`:if(n[r+1]===`?`)switch(n[r+2]){case`:`:e+=`(?:`,r+=3,e+=i()+`|$)`;break;case`=`:e+=`(?=`,r+=3,e+=i()+`)`;break;case`!`:a=r,r+=3,i(),e+=n.substr(a,r-a);break;case`<`:switch(n[r+3]){case`=`:case`!`:a=r,r+=4,i(),e+=n.substr(a,r-a);break;default:o(n.indexOf(`>`,r)-r+1),e+=i()+`|$)`}}else o(1),e+=i()+`|$)`;break;case`)`:return++r,e;default:s(1)}return e}return Q(i,`process`),new RegExp(i(),e.flags)}function Bz(e){return e.rules.find(e=>$R(e)&&e.entry)}function Vz(e){return e.rules.filter(e=>sz(e)&&e.hidden)}function Hz(e,t){let n=new Set,r=Bz(e);if(!r)return new Set(e.rules);let i=[r].concat(Vz(e));for(let e of i)Uz(e,n,t);let a=new Set;for(let t of e.rules)(n.has(t.name)||sz(t)&&t.hidden)&&a.add(t);return a}function Uz(e,t,n){t.add(e.name),ER(e).forEach(e=>{if(rz(e)||n&&cz(e)){let r=e.rule.ref;r&&!t.has(r.name)&&Uz(r,t,n)}})}function iWe(e){let t=new Set;return ER(e).forEach(e=>{HR(e)&&($R(e.type.ref)&&t.add(e.type.ref),KR(e.type.ref)&&$R(e.type.ref.$container)&&t.add(e.type.ref.$container))}),t}function Wz(e){if(e.terminal)return e.terminal;if(e.type.ref)return Qz(e.type.ref)?.terminal}function Gz(e){return e.hidden&&!Iz(cB(e))}function Kz(e,t){return!e||!t?[]:Jz(e,t,e.astNode,!0)}function qz(e,t,n){if(!e||!t)return;let r=Jz(e,t,e.astNode,!0);if(r.length!==0)return n=n===void 0?0:Math.max(0,Math.min(n,r.length-1)),r[n]}function Jz(e,t,n,r){if(!r){let n=xR(e.grammarSource,RR);if(n&&n.feature===t)return[e]}return hR(e)&&e.astNode===n?e.content.flatMap(e=>Jz(e,t,n,!1)):[]}function aWe(e,t){return e?Xz(e,t,e?.astNode):[]}function Yz(e,t,n){if(!e)return;let r=Xz(e,t,e?.astNode);if(r.length!==0)return n=n===void 0?0:Math.max(0,Math.min(n,r.length-1)),r[n]}function Xz(e,t,n){if(e.astNode!==n)return[];if(YR(e.grammarSource)&&e.grammarSource.value===t)return[e];let r=mz(e).iterator(),i,a=[];do if(i=r.next(),!i.done){let e=i.value;e.astNode===n?YR(e.grammarSource)&&e.grammarSource.value===t&&a.push(e):r.prune()}while(!i.done);return a}function Zz(e){let t=e.astNode;for(;t===e.container?.astNode;){let t=xR(e.grammarSource,RR);if(t)return t;e=e.container}}function Qz(e){let t=e;return KR(t)&&(FR(t.$container)?t=t.$container.$container:PR(t.$container)?t=t.$container:Dz(t.$container)),$z(e,t,new Map)}function $z(e,t,n){function r(t,r){let i;return xR(t,RR)||(i=$z(r,r,n)),n.set(e,i),i}if(Q(r,`go`),n.has(e))return n.get(e);n.set(e,void 0);for(let i of ER(t))if(RR(i)&&i.feature.toLowerCase()===`name`)return n.set(e,i),i;else if(rz(i)&&$R(i.rule.ref))return r(i,i.rule.ref);else if(iz(i)&&i.typeRef?.ref)return r(i,i.typeRef.ref)}function eB(e){let t=e.$container;if(GR(t)){let n=t.elements,r=n.indexOf(e);for(let e=r-1;e>=0;e--){let t=n[e];if(FR(t))return t;{let t=ER(n[e]).find(FR);if(t)return t}}}if(NR(t))return eB(t)}function oWe(e,t){return e===`?`||e===`*`||GR(t)&&!!t.guardCondition}function sWe(e){return e===`*`||e===`+`}function cWe(e){return e===`+=`}function tB(e){return nB(e,new Set)}function nB(e,t){if(t.has(e))return!0;t.add(e);for(let n of ER(e))if(rz(n)){if(!n.rule.ref||$R(n.rule.ref)&&!nB(n.rule.ref,t)||qR(n.rule.ref))return!1}else if(RR(n))return!1;else if(FR(n))return!1;return!!e.definition}function lWe(e){return rB(e.type,new Set)}function rB(e,t){if(t.has(e))return!0;if(t.add(e),LR(e)||ez(e))return!1;if(uz(e))return e.types.every(e=>rB(e,t));if(iz(e)){if(e.primitiveType!==void 0||e.stringType!==void 0)return!0;if(e.typeRef!==void 0){let n=e.typeRef.ref;return lz(n)?rB(n.type,t):!1}return!1}return!1}function iB(e){if(!sz(e)){if(e.inferredType)return e.inferredType.name;if(e.dataType)return e.dataType;if(e.returnType){let t=e.returnType.ref;if(t)return t.name}}}function aB(e){if(PR(e))return $R(e)&&tB(e)?e.name:iB(e)??e.name;if(JR(e)||lz(e)||nz(e))return e.name;if(FR(e)){let t=oB(e);if(t)return t}else if(KR(e))return e.name;throw Error(`Cannot get name of Unknown Type`)}function oB(e){if(e.inferredType)return e.inferredType.name;if(e.type?.ref)return aB(e.type.ref)}function uWe(e){return sz(e)?e.type?.name??`string`:$R(e)&&tB(e)?e.name:iB(e)??e.name}function sB(e){return sz(e)?e.type?.name??`string`:iB(e)??e.name}function cB(e){let t={s:!1,i:!1,u:!1},n=lB(e.definition,t),r=Object.entries(t).filter(([,e])=>e).map(([e])=>e).join(``);return new RegExp(n,r)}function lB(e,t){if(az(e))return dWe(e);if(oz(e))return fWe(e);if(BR(e))return hWe(e);if(cz(e)){let t=e.rule.ref;if(!t)throw Error(`Missing rule reference.`);return dB(lB(t.definition),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}if(XR(e))return mWe(e);if(fz(e))return pWe(e);if(tz(e)){let n=e.regex.lastIndexOf(`/`),r=e.regex.substring(1,n),i=e.regex.substring(n+1);return t&&(t.i=i.includes(`i`),t.s=i.includes(`s`),t.u=i.includes(`u`)),dB(r,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}if(pz(e))return dB(fG,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized});throw Error(`Invalid terminal element: ${e?.$type}, ${e?.$cstNode?.text}`)}function dWe(e){return dB(e.elements.map(e=>lB(e)).join(`|`),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}function fWe(e){return dB(e.elements.map(e=>lB(e)).join(``),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}function pWe(e){return dB(`${fG}*?${lB(e.terminal)}`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}function mWe(e){return dB(`(?!${lB(e.terminal)})${fG}*?`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}function hWe(e){return e.right?dB(`[${uB(e.left)}-${uB(e.right)}]`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1}):dB(uB(e.left),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}function uB(e){return Lz(e.value)}function dB(e,t){return(t.parenthesized||t.lookahead||t.wrap!==!1)&&(e=`(${t.lookahead??(t.parenthesized?``:`?:`)}${e})`),t.cardinality?`${e}${t.cardinality}`:e}function fB(e){let t=[],n=e.Grammar;for(let e of n.rules)sz(e)&&Gz(e)&&Fz(cB(e))&&t.push(e.name);return{multilineCommentRules:t,nameRegexp:QW}}function gWe(e){var t=w1e.call(e,_G),n=e[_G];try{e[_G]=void 0;var r=!0}catch{}var i=T1e.call(e);return r&&(t?e[_G]=n:delete e[_G]),i}function _We(e){return D1e.call(e)}function vWe(e){return e==null?e===void 0?A1e:k1e:vG&&vG in Object(e)?E1e(e):O1e(e)}function yWe(e){return typeof e==`object`&&!!e}function bWe(e){return typeof e==`symbol`||bG(e)&&yG(e)==j1e}function xWe(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function pB(e){if(typeof e==`string`)return e;if(CG(e))return SG(e,pB)+``;if(xG(e))return TG?TG.call(e):``;var t=e+``;return t==`0`&&1/e==-M1e?`-0`:t}function SWe(e){for(var t=e.length;t--&&P1e.test(e.charAt(t)););return t}function CWe(e){return e&&e.slice(0,F1e(e)+1).replace(I1e,``)}function wWe(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}function TWe(e){if(typeof e==`number`)return e;if(xG(e))return DG;if(EG(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=EG(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=L1e(e);var n=z1e.test(e);return n||B1e.test(e)?V1e(e.slice(2),n?2:8):R1e.test(e)?DG:+e}function EWe(e){return e?(e=H1e(e),e===OG||e===-OG?(e<0?-1:1)*U1e:e===e?e:0):e===0?e:0}function DWe(e){var t=W1e(e),n=t%1;return t===t?n?t-n:t:0}function OWe(e){return e}function kWe(e){if(!EG(e))return!1;var t=yG(e);return t==K1e||t==q1e||t==G1e||t==J1e}function AWe(e){return!!NG&&NG in e}function jWe(e){if(e!=null){try{return X1e.call(e)}catch{}try{return e+``}catch{}}return``}function MWe(e){return!EG(e)||Y1e(e)?!1:(jG(e)?r0e:Q1e).test(PG(e))}function NWe(e,t){return e?.[t]}function PWe(e,t){var n=a0e(e,t);return i0e(n)?n:void 0}function FWe(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function IWe(){}function LWe(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}function RWe(e){var t=0,n=0;return function(){var r=d0e(),i=u0e-(r-n);if(n=r,i>0){if(++t>=l0e)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function zWe(e){return function(){return e}}function BWe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function VWe(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function HWe(e){return e!==e}function UWe(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function WWe(e,t,n){return t===t?g0e(e,t,n):VG(e,h0e,n)}function GWe(e,t){return!!(e!=null&&e.length)&&HG(e,t,0)>-1}function KWe(e,t){var n=typeof e;return t??=_0e,!!t&&(n==`number`||n!=`symbol`&&v0e.test(e))&&e>-1&&e%1==0&&e<t}function qWe(e,t,n){t==`__proto__`&&zG?zG(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function JWe(e,t){return e===t||e!==e&&t!==t}function YWe(e,t,n){var r=e[t];(!(y0e.call(e,t)&&KG(r,n))||n===void 0&&!(t in e))&&GG(e,t,n)}function XWe(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],l=r?r(n[s],e[s],s,n,e):void 0;l===void 0&&(l=e[s]),i?GG(n,s,l):qG(n,s,l)}return n}function ZWe(e,t,n){return t=YG(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=YG(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),s0e(e,this,s)}}function QWe(e,t){return m0e(b0e(e,t,AG),e+``)}function $We(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=x0e}function eGe(e){return e!=null&&ZG(e.length)&&!jG(e)}function tGe(e,t,n){if(!EG(n))return!1;var r=typeof t;return(r==`number`?QG(n)&&WG(t,n.length):r==`string`&&t in n)?KG(n[t],e):!1}function nGe(e){return XG(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&$G(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}function rGe(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||C0e)}function iGe(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function aGe(e){return bG(e)&&yG(e)==T0e}function oGe(){return!1}function sGe(e){return bG(e)&&ZG(e.length)&&!!cK[yG(e)]}function cGe(e){return function(t){return e(t)}}function lGe(e,t){var n=CG(e),r=!n&&rK(e),i=!n&&!r&&sK(e),a=!n&&!r&&!i&&hK(e),o=n||r||i||a,s=o?w0e(e.length,String):[],l=s.length;for(var u in e)(t||e2e.call(e,u))&&!(o&&(u==`length`||i&&(u==`offset`||u==`parent`)||a&&(u==`buffer`||u==`byteLength`||u==`byteOffset`)||WG(u,l)))&&s.push(u);return s}function uGe(e,t){return function(n){return e(t(n))}}function dGe(e){if(!eK(e))return t2e(e);var t=[];for(var n in Object(e))n2e.call(e,n)&&n!=`constructor`&&t.push(n);return t}function fGe(e){return QG(e)?gK(e):vK(e)}function pGe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}function mGe(e){if(!EG(e))return i2e(e);var t=eK(e),n=[];for(var r in e)r==`constructor`&&(t||!a2e.call(e,r))||n.push(r);return n}function hGe(e){return QG(e)?gK(e,!0):o2e(e)}function gGe(e,t){if(CG(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||xG(e)?!0:c2e.test(e)||!s2e.test(e)||t!=null&&e in Object(t)}function _Ge(){this.__data__=CK?CK(null):{},this.size=0}function vGe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}function yGe(e){var t=this.__data__;if(CK){var n=t[e];return n===d2e?void 0:n}return f2e.call(t,e)?t[e]:void 0}function bGe(e){var t=this.__data__;return CK?t[e]!==void 0:m2e.call(t,e)}function xGe(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=CK&&t===void 0?g2e:t,this}function mB(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function SGe(){this.__data__=[],this.size=0}function CGe(e,t){for(var n=e.length;n--;)if(KG(e[n][0],t))return n;return-1}function wGe(e){var t=this.__data__,n=TK(t,e);return n<0?!1:(n==t.length-1?t.pop():y2e.call(t,n,1),--this.size,!0)}function TGe(e){var t=this.__data__,n=TK(t,e);return n<0?void 0:t[n][1]}function EGe(e){return TK(this.__data__,e)>-1}function DGe(e,t){var n=this.__data__,r=TK(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function hB(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function OGe(){this.size=0,this.__data__={hash:new wK,map:new(DK||EK),string:new wK}}function kGe(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function AGe(e,t){var n=e.__data__;return T2e(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function jGe(e){var t=OK(this,e).delete(e);return this.size-=+!!t,t}function MGe(e){return OK(this,e).get(e)}function NGe(e){return OK(this,e).has(e)}function PGe(e,t){var n=OK(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function gB(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function _B(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(A2e);var n=Q(function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o},`memoized`);return n.cache=new(_B.Cache||kK),n}function FGe(e){var t=j2e(e,function(e){return n.size===M2e&&n.clear(),e}),n=t.cache;return t}function IGe(e){return e==null?``:N1e(e)}function LGe(e,t){return CG(e)?e:SK(e,t)?[e]:I2e(L2e(e))}function RGe(e){if(typeof e==`string`||xG(e))return e;var t=e+``;return t==`0`&&1/e==-R2e?`-0`:t}function zGe(e,t){t=AK(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[jK(t[n++])];return n&&n==r?e:void 0}function BGe(e,t,n){var r=e==null?void 0:MK(e,t);return r===void 0?n:r}function VGe(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function HGe(e){return CG(e)||rK(e)||!!(PK&&e&&e[PK])}function vB(e,t,n,r,i){var a=-1,o=e.length;for(n||=B2e,i||=[];++a<o;){var s=e[a];t>0&&n(s)?t>1?vB(s,t-1,n,r,i):NK(i,s):r||(i[i.length]=s)}return i}function UGe(e){return e!=null&&e.length?FK(e,1):[]}function WGe(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}function GGe(e,t,n,r){var i=-1,a=e==null?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function KGe(){this.__data__=new EK,this.size=0}function qGe(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function JGe(e){return this.__data__.get(e)}function YGe(e){return this.__data__.has(e)}function XGe(e,t){var n=this.__data__;if(n instanceof EK){var r=n.__data__;if(!DK||r.length<K2e-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new kK(r)}return n.set(e,t),this.size=n.size,this}function yB(e){var t=this.__data__=new EK(e);this.size=t.size}function ZGe(e,t){return e&&JG(t,yK(t),e)}function QGe(e,t){return e&&JG(t,xK(t),e)}function $Ge(e,t){if(t)return e.slice();var n=e.length,r=UK?UK(n):new e.constructor(n);return e.copy(r),r}function eKe(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function tKe(){return[]}function nKe(e,t){return JG(e,qK(e),t)}function rKe(e,t){return JG(e,JK(e),t)}function iKe(e,t,n){var r=t(e);return CG(e)?r:NK(r,n(e))}function aKe(e){return YK(e,yK,qK)}function oKe(e){return YK(e,xK,JK)}function sKe(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&o4e.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function cKe(e){var t=new e.constructor(e.byteLength);return new cq(t).set(new cq(e)),t}function lKe(e,t){var n=t?lq(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function uKe(e){var t=new e.constructor(e.source,l4e.exec(e));return t.lastIndex=e.lastIndex,t}function dKe(e){return dq?Object(dq.call(e)):{}}function fKe(e,t){var n=t?lq(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function pKe(e,t,n){var r=e.constructor;switch(t){case x4e:return lq(e);case p4e:case m4e:return new r(+e);case S4e:return c4e(e,n);case C4e:case w4e:case T4e:case E4e:case D4e:case O4e:case k4e:case A4e:case j4e:return f4e(e,n);case h4e:return new r;case g4e:case y4e:return new r(e);case _4e:return u4e(e);case v4e:return new r;case b4e:return d4e(e)}}function mKe(e){return typeof e.constructor==`function`&&!eK(e)?o0e(LK(e)):{}}function hKe(e){return bG(e)&&sq(e)==P4e}function gKe(e){return bG(e)&&sq(e)==L4e}function bB(e,t,n,r,i,a){var o,s=t&B4e,l=t&V4e,u=t&H4e;if(n&&(o=i?n(e,r,i,a):n(e)),o!==void 0)return o;if(!EG(e))return e;var d=CG(e);if(d){if(o=s4e(e),!s)return c0e(e,o)}else{var f=sq(e),p=f==hq||f==q4e;if(sK(e))return X2e(e,s);if(f==gq||f==mq||p&&!i){if(o=l||p?{}:N4e(e),!s)return l?$2e(e,Y2e(o,e)):Q2e(e,J2e(o,e))}else{if(!_q[f])return i?e:{};o=M4e(e,f,s)}}a||=new zK;var m=a.get(e);if(m)return m;a.set(e,o),z4e(e)?e.forEach(function(r){o.add(bB(r,t,n,r,e,a))}):I4e(e)&&e.forEach(function(r,i){o.set(i,bB(r,t,n,i,e,a))});var h=d?void 0:(u?l?ZK:XK:l?xK:yK)(e);return BG(h||e,function(r,i){h&&(i=r,r=e[i]),qG(o,i,bB(r,t,n,i,e,a))}),o}function _Ke(e){return f3e(e,p3e)}function vKe(e){for(var t=-1,n=e==null?0:e.length,r=0,i=[];++t<n;){var a=e[t];a&&(i[r++]=a)}return i}function yKe(e){return this.__data__.set(e,m3e),this}function bKe(e){return this.__data__.has(e)}function xB(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new kK;++t<n;)this.add(e[t])}function xKe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function SKe(e,t){return e.has(t)}function CKe(e,t,n,r,i,a){var o=n&_3e,s=e.length,l=t.length;if(s!=l&&!(o&&l>s))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var f=-1,p=!0,m=n&v3e?new bq:void 0;for(a.set(e,t),a.set(t,e);++f<s;){var h=e[f],g=t[f];if(r)var _=o?r(g,h,f,t,e,a):r(h,g,f,e,t,a);if(_!==void 0){if(_)continue;p=!1;break}if(m){if(!xq(t,function(e,t){if(!Sq(m,t)&&(h===e||i(h,e,n,r,a)))return m.push(t)})){p=!1;break}}else if(!(h===g||i(h,g,n,r,a))){p=!1;break}}return a.delete(e),a.delete(t),p}function wKe(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function TKe(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function EKe(e,t,n,r,i,a,o){switch(n){case M3e:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case j3e:return!(e.byteLength!=t.byteLength||!a(new cq(e),new cq(t)));case S3e:case C3e:case E3e:return KG(+e,+t);case w3e:return e.name==t.name&&e.message==t.message;case D3e:case k3e:return e==t+``;case T3e:var s=y3e;case O3e:var l=r&b3e;if(s||=wq,e.size!=t.size&&!l)return!1;var u=o.get(e);if(u)return u==t;r|=x3e,o.set(e,t);var d=Cq(s(e),s(t),r,i,a,o);return o.delete(e),d;case A3e:if(Eq)return Eq.call(e)==Eq.call(t)}return!1}function DKe(e,t,n,r,i,a){var o=n&P3e,s=XK(e),l=s.length;if(l!=XK(t).length&&!o)return!1;for(var u=l;u--;){var d=s[u];if(!(o?d in t:F3e.call(t,d)))return!1}var f=a.get(e),p=a.get(t);if(f&&p)return f==t&&p==e;var m=!0;a.set(e,t),a.set(t,e);for(var h=o;++u<l;){d=s[u];var g=e[d],_=t[d];if(r)var v=o?r(_,g,d,t,e,a):r(g,_,d,e,t,a);if(!(v===void 0?g===_||i(g,_,n,r,a):v)){m=!1;break}h||=d==`constructor`}if(m&&!h){var y=e.constructor,b=t.constructor;y!=b&&`constructor`in e&&`constructor`in t&&!(typeof y==`function`&&y instanceof y&&typeof b==`function`&&b instanceof b)&&(m=!1)}return a.delete(e),a.delete(t),m}function OKe(e,t,n,r,i,a){var o=CG(e),s=CG(t),l=o?Oq:sq(e),u=s?Oq:sq(t);l=l==Dq?kq:l,u=u==Dq?kq:u;var d=l==kq,f=u==kq,p=l==u;if(p&&sK(e)){if(!sK(t))return!1;o=!0,d=!1}if(p&&!d)return a||=new zK,o||hK(e)?Cq(e,t,n,r,i,a):N3e(e,t,l,n,r,i,a);if(!(n&L3e)){var m=d&&Aq.call(e,`__wrapped__`),h=f&&Aq.call(t,`__wrapped__`);if(m||h){var g=m?e.value():e,_=h?t.value():t;return a||=new zK,i(g,_,n,r,a)}}return p?(a||=new zK,I3e(e,t,n,r,i,a)):!1}function SB(e,t,n,r,i){return e===t?!0:e==null||t==null||!bG(e)&&!bG(t)?e!==e&&t!==t:R3e(e,t,n,r,SB,i)}function kKe(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var l=s[0],u=e[l],d=s[1];if(o&&s[2]){if(u===void 0&&!(l in e))return!1}else{var f=new zK;if(r)var p=r(u,d,l,e,t,f);if(!(p===void 0?jq(d,u,z3e|B3e,r,f):p))return!1}}return!0}function AKe(e){return e===e&&!EG(e)}function jKe(e){for(var t=yK(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Mq(i)]}return t}function MKe(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}}function NKe(e){var t=H3e(e);return t.length==1&&t[0][2]?Nq(t[0][0],t[0][1]):function(n){return n===e||V3e(n,e,t)}}function PKe(e,t){return e!=null&&t in Object(e)}function FKe(e,t,n){t=AK(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=jK(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&ZG(i)&&WG(o,i)&&(CG(e)||rK(e)))}function IKe(e,t){return e!=null&&Pq(e,t,W3e)}function LKe(e,t){return SK(e)&&Mq(t)?Nq(jK(e),t):function(n){var r=z2e(n,e);return r===void 0&&r===t?G3e(n,e):jq(t,r,K3e|q3e)}}function RKe(e){return function(t){return t?.[e]}}function zKe(e){return function(t){return MK(t,e)}}function BKe(e){return SK(e)?Y3e(jK(e)):X3e(e)}function VKe(e){return typeof e==`function`?e:e==null?AG:typeof e==`object`?CG(e)?J3e(e[0],e[1]):U3e(e):Z3e(e)}function HKe(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}function UKe(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var l=o[e?s:++i];if(n(a[l],l,a)===!1)break}return t}}function WKe(e,t){return e&&$3e(e,t,yK)}function GKe(e,t){return function(n,r){if(n==null)return n;if(!QG(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}function KKe(e,t,n,r){return Iq(e,function(e,i,a){t(r,e,n(e),a)}),r}function qKe(e,t){return function(n,r){var i=CG(n)?Q3e:t6e,a=t?t():{};return i(n,e,Fq(r,2),a)}}function JKe(e){return bG(e)&&QG(e)}function YKe(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function XKe(e,t,n,r){var i=-1,a=UG,o=!0,s=e.length,l=[],u=t.length;if(!s)return l;n&&(t=SG(t,lK(n))),r?(a=Bq,o=!1):t.length>=i6e&&(a=Sq,o=!1,t=new bq(t));outer:for(;++i<s;){var d=e[i],f=n==null?d:n(d);if(d=r||d!==0?d:0,o&&f===f){for(var p=u;p--;)if(t[p]===f)continue outer;l.push(d)}else a(t,f,r)||l.push(d)}return l}function ZKe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function QKe(e,t,n){var r=e==null?0:e.length;return r?(t=n||t===void 0?1:kG(t),RK(e,t<0?0:t,r)):[]}function $Ke(e,t,n){var r=e==null?0:e.length;return r?(t=n||t===void 0?1:kG(t),t=r-t,RK(e,0,t<0?0:t)):[]}function eqe(e){return typeof e==`function`?e:AG}function tqe(e,t){return(CG(e)?BG:Iq)(e,o6e(t))}function nqe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function rqe(e,t){var n=!0;return Iq(e,function(e,r,i){return n=!!t(e,r,i),n}),n}function iqe(e,t,n){var r=CG(e)?s6e:c6e;return n&&$G(e,t,n)&&(t=void 0),r(e,Fq(t,3))}function aqe(e,t){var n=[];return Iq(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function oqe(e,t){return(CG(e)?WK:qq)(e,Fq(t,3))}function sqe(e){return function(t,n,r){var i=Object(t);if(!QG(t)){var a=Fq(n,3);t=yK(t),n=Q(function(e){return a(i[e],e,i)},`predicate`)}var o=e(t,n,r);return o>-1?i[a?t[o]:o]:void 0}}function cqe(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:kG(n);return i<0&&(i=u6e(r+i,0)),VG(e,Fq(t,3),i)}function lqe(e){return e&&e.length?e[0]:void 0}function uqe(e,t){var n=-1,r=QG(e)?Array(e.length):[];return Iq(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function dqe(e,t){return(CG(e)?SG:d6e)(e,Fq(t,3))}function fqe(e,t){return FK(Zq(e,t),1)}function pqe(e,t){return e!=null&&m6e.call(e,t)}function mqe(e,t){return e!=null&&Pq(e,t,h6e)}function hqe(e){return typeof e==`string`||!CG(e)&&bG(e)&&yG(e)==g6e}function gqe(e,t){return SG(t,function(t){return e[t]})}function _qe(e){return e==null?[]:_6e(e,yK(e))}function vqe(e,t,n,r){e=QG(e)?e:tJ(e),n=n&&!r?kG(n):0;var i=e.length;return n<0&&(n=v6e(i+n,0)),eJ(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&HG(e,t,n)>-1}function yqe(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:kG(n);return i<0&&(i=y6e(r+i,0)),HG(e,t,i)}function bqe(e){if(e==null)return!0;if(QG(e)&&(CG(e)||typeof e==`string`||typeof e.splice==`function`||sK(e)||hK(e)||rK(e)))return!e.length;var t=sq(e);if(t==b6e||t==x6e)return!e.size;if(eK(e))return!vK(e).length;for(var n in e)if(S6e.call(e,n))return!1;return!0}function xqe(e){return bG(e)&&yG(e)==C6e}function Sqe(e){return e===void 0}function Cqe(e){if(typeof e!=`function`)throw TypeError(T6e);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function wqe(e,t,n,r){if(!EG(e))return e;t=AK(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i<a;){var l=jK(t[i]),u=n;if(l===`__proto__`||l===`constructor`||l===`prototype`)return e;if(i!=o){var d=s[l];u=r?r(d,l,s):void 0,u===void 0&&(u=EG(d)?d:WG(t[i+1])?[]:{})}qG(s,l,u),s=s[l]}return e}function Tqe(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=MK(e,o);n(s,o)&&D6e(a,AK(o,e),s)}return a}function Eqe(e,t){if(e==null)return{};var n=SG(ZK(e),function(e){return[e]});return t=Fq(t),O6e(e,n,function(e,n){return t(e,n[0])})}function Dqe(e,t,n,r,i){return i(e,function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)}),n}function Oqe(e,t,n){var r=CG(e)?V2e:k6e,i=arguments.length<3;return r(e,Fq(t,4),n,i,Iq)}function kqe(e,t){return(CG(e)?WK:qq)(e,E6e(Fq(t,3)))}function Aqe(e,t){var n;return Iq(e,function(e,r,i){return n=t(e,r,i),!n}),!!n}function jqe(e,t,n){var r=CG(e)?xq:A6e;return n&&$G(e,t,n)&&(t=void 0),r(e,Fq(t,3))}function Mqe(e,t,n){var r=-1,i=UG,a=e.length,o=!0,s=[],l=s;if(n)o=!1,i=Bq;else if(a>=M6e){var u=t?null:j6e(e);if(u)return wq(u);o=!1,i=Sq,l=new bq}else l=t?[]:s;outer:for(;++r<a;){var d=e[r],f=t?t(d):d;if(d=n||d!==0?d:0,o&&f===f){for(var p=l.length;p--;)if(l[p]===f)continue outer;t&&l.push(f),s.push(d)}else i(l,f,n)||(l!==s&&l.push(f),s.push(d))}return s}function Nqe(e){return e&&e.length?N6e(e):[]}function CB(e){console&&console.error&&console.error(`Error: ${e}`)}function wB(e){console&&console.warn&&console.warn(`Warning: ${e}`)}function TB(e){let t=new Date().getTime(),n=e();return{time:new Date().getTime()-t,value:n}}function EB(e){function t(){}Q(t,`FakeConstructor`),t.prototype=e;let n=new t;function r(){return typeof n.bar}return Q(r,`fakeAccess`),r(),r(),e}function Pqe(e){return Fqe(e)?e.LABEL:e.name}function Fqe(e){return eJ(e.LABEL)&&e.LABEL!==``}function Iqe(e){return Zq(e,DB)}function DB(e){function t(e){return Zq(e,DB)}if(Q(t,`convertDefinition`),e instanceof mJ){let t={type:`NonTerminal`,name:e.nonTerminalName,idx:e.idx};return eJ(e.label)&&(t.label=e.label),t}if(e instanceof gJ)return{type:`Alternative`,definition:t(e.definition)};if(e instanceof _J)return{type:`Option`,idx:e.idx,definition:t(e.definition)};if(e instanceof vJ)return{type:`RepetitionMandatory`,idx:e.idx,definition:t(e.definition)};if(e instanceof yJ)return{type:`RepetitionMandatoryWithSeparator`,idx:e.idx,separator:DB(new CJ({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof xJ)return{type:`RepetitionWithSeparator`,idx:e.idx,separator:DB(new CJ({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof bJ)return{type:`Repetition`,idx:e.idx,definition:t(e.definition)};if(e instanceof SJ)return{type:`Alternation`,idx:e.idx,definition:t(e.definition)};if(e instanceof CJ){let t={type:`Terminal`,name:e.terminalType.name,label:Pqe(e.terminalType),idx:e.idx};eJ(e.label)&&(t.terminalLabel=e.label);let n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=oJ(n)?n.source:n),t}if(e instanceof hJ)return{type:`Rule`,name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error(`non exhaustive match`)}function Lqe(e){return e instanceof gJ||e instanceof _J||e instanceof bJ||e instanceof vJ||e instanceof yJ||e instanceof xJ||e instanceof CJ||e instanceof hJ}function OB(e,t=[]){return e instanceof _J||e instanceof bJ||e instanceof xJ?!0:e instanceof SJ?dJ(e.definition,e=>OB(e,t)):e instanceof mJ&&nJ(t,e)?!1:e instanceof pJ&&(e instanceof mJ&&t.push(e),Kq(e.definition,e=>OB(e,t)))}function Rqe(e){return e instanceof SJ}function kB(e){if(e instanceof mJ)return`SUBRULE`;if(e instanceof _J)return`OPTION`;if(e instanceof SJ)return`OR`;if(e instanceof vJ)return`AT_LEAST_ONE`;if(e instanceof yJ)return`AT_LEAST_ONE_SEP`;if(e instanceof xJ)return`MANY_SEP`;if(e instanceof bJ)return`MANY`;if(e instanceof CJ)return`CONSUME`;throw Error(`non exhaustive match`)}function AB(e,t,n){return[new _J({definition:[new CJ({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function jB(e){if(e instanceof mJ)return jB(e.referencedRule);if(e instanceof CJ)return Vqe(e);if(Lqe(e))return zqe(e);if(Rqe(e))return Bqe(e);throw Error(`non exhaustive match`)}function zqe(e){let t=[],n=e.definition,r=0,i=n.length>r,a,o=!0;for(;i&&o;)a=n[r],o=OB(a),t=t.concat(jB(a)),r+=1,i=n.length>r;return fJ(t)}function Bqe(e){return fJ(IK(Zq(e.definition,e=>jB(e))))}function Vqe(e){return[e.terminalType]}function Hqe(e){let t={};return Gq(e,e=>{let n=new P6e(e).startWalking();bK(t,n)}),t}function Uqe(e,t){return e.name+t+EJ}function MB(e){let t=e.toString();if(DJ.hasOwnProperty(t))return DJ[t];{let e=F6e.pattern(t);return DJ[t]=e,e}}function Wqe(){DJ={}}function Gqe(e,t=!1){try{let t=MB(e);return NB(t.value,{},t.flags.ignoreCase)}catch(n){if(n.message===OJ)t&&wB(`${kJ} Unable to optimize: < ${e.toString()} >1205+ Complement Sets cannot be automatically optimized.1206+ This will disable the lexer's first char optimizations.1207+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n=``;t&&(n=`1208+ This will disable the lexer's first char optimizations.1209+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),CB(`${kJ}1210+ Failed parsing: < ${e.toString()} >1211+ Using the @chevrotain/regexp-to-ast library1212+ Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function NB(e,t,n){switch(e.type){case`Disjunction`:for(let r=0;r<e.value.length;r++)NB(e.value[r],t,n);break;case`Alternative`:let r=e.value;for(let e=0;e<r.length;e++){let i=r[e];switch(i.type){case`EndAnchor`:case`GroupBackReference`:case`Lookahead`:case`NegativeLookahead`:case`Lookbehind`:case`NegativeLookbehind`:case`StartAnchor`:case`WordBoundary`:case`NonWordBoundary`:continue}let a=i;switch(a.type){case`Character`:PB(a.value,t,n);break;case`Set`:if(a.complement===!0)throw Error(OJ);Gq(a.value,e=>{if(typeof e==`number`)PB(e,t,n);else{let r=e;if(n===!0)for(let e=r.from;e<=r.to;e++)PB(e,t,n);else{for(let e=r.from;e<=r.to&&e<NJ;e++)PB(e,t,n);if(r.to>=NJ){let e=r.from>=NJ?r.from:NJ,n=r.to,i=UB(e),a=UB(n);for(let e=i;e<=a;e++)t[e]=e}}}});break;case`Group`:NB(a.value,t,n);break;default:throw Error(`Non Exhaustive Match`)}let o=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type===`Group`&&IB(a)===!1||a.type!==`Group`&&o===!1)break}break;default:throw Error(`non exhaustive match!`)}return tJ(t)}function PB(e,t,n){let r=UB(e);t[r]=r,n===!0&&Kqe(e,t)}function Kqe(e,t){let n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){let e=UB(r.charCodeAt(0));t[e]=e}else{let e=n.toLowerCase();if(e!==n){let n=UB(e.charCodeAt(0));t[n]=n}}}function FB(e,t){return Yq(e.value,e=>{if(typeof e==`number`)return nJ(t,e);{let n=e;return Yq(t,e=>n.from<=e&&e<=n.to)!==void 0}})}function IB(e){let t=e.quantifier;return t&&t.atLeast===0?!0:e.value?CG(e.value)?Kq(e.value,IB):IB(e.value):!1}function LB(e,t){if(t instanceof RegExp){let n=MB(t),r=new I6e(e);return r.visit(n),r.found}return Yq(t,t=>nJ(e,t.charCodeAt(0)))!==void 0}function qqe(e,t){t=Rq(t,{debug:!1,safeMode:!1,positionTracking:`full`,lineTerminatorCharacters:[`\r`,`1213+`],tracer:Q((e,t)=>t(),`tracer`)});let n=t.tracer;n(`initCharCodeToOptimizedIndexMap`,()=>{mJe()});let r;n(`Reject Lexer.NA`,()=>{r=uJ(e,e=>e[AJ]===BJ.NA)});let i=!1,a;n(`Transform Patterns`,()=>{i=!1,a=Zq(r,e=>{let t=e[AJ];if(oJ(t)){let e=t.source;return e.length===1&&e!==`^`&&e!==`$`&&e!==`.`&&!t.ignoreCase?e:e.length===2&&e[0]===`\\`&&!nJ([`d`,`D`,`s`,`S`,`t`,`r`,`n`,`t`,`0`,`c`,`b`,`B`,`f`,`v`,`w`,`W`],e[1])?e[1]:RB(t)}if(jG(t))return i=!0,{exec:t};if(typeof t==`object`)return i=!0,t;if(typeof t==`string`){if(t.length===1)return t;{let e=t.replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`);return RB(new RegExp(e))}}throw Error(`non exhaustive match`)})});let o,s,l,u,d;n(`misc mapping`,()=>{o=Zq(r,e=>e.tokenTypeIdx),s=Zq(r,e=>{let t=e.GROUP;if(t!==BJ.SKIPPED){if(eJ(t))return t;if(sJ(t))return!1;throw Error(`non exhaustive match`)}}),l=Zq(r,e=>{let t=e.LONGER_ALT;if(t)return CG(t)?Zq(t,e=>rJ(r,e)):[rJ(r,t)]}),u=Zq(r,e=>e.PUSH_MODE),d=Zq(r,e=>$q(e,`POP_MODE`))});let f;n(`Line Terminator Handling`,()=>{let e=VB(t.lineTerminatorCharacters);f=Zq(r,e=>!1),t.positionTracking!==`onlyOffset`&&(f=Zq(r,t=>$q(t,`LINE_BREAKS`)?!!t.LINE_BREAKS:BB(t,e)===!1&&LB(e,t.PATTERN)))});let p,m,h,g;n(`Misc Mapping #2`,()=>{p=Zq(r,zB),m=Zq(a,fJe),h=lJ(r,(e,t)=>{let n=t.GROUP;return eJ(n)&&n!==BJ.SKIPPED&&(e[n]=[]),e},{}),g=Zq(a,(e,t)=>({pattern:a[t],longerAlt:l[t],canLineTerminator:f[t],isCustom:p[t],short:m[t],group:s[t],push:u[t],pop:d[t],tokenTypeIdx:o[t],tokenType:r[t]}))});let _=!0,v=[];return t.safeMode||n(`First Char Optimization`,()=>{v=lJ(r,(e,n,r)=>{if(typeof n.PATTERN==`string`)HB(e,UB(n.PATTERN.charCodeAt(0)),g[r]);else if(CG(n.START_CHARS_HINT)){let t;Gq(n.START_CHARS_HINT,n=>{let i=UB(typeof n==`string`?n.charCodeAt(0):n);t!==i&&(t=i,HB(e,i,g[r]))})}else if(oJ(n.PATTERN)){if(n.PATTERN.unicode)_=!1,t.ensureOptimizations&&CB(`${kJ} Unable to analyze < ${n.PATTERN.toString()} > pattern.1214+ The regexp unicode flag is not currently supported by the regexp-to-ast library.1215+ This will disable the lexer's first char optimizations.1216+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let i=Gqe(n.PATTERN,t.ensureOptimizations);iJ(i)&&(_=!1),Gq(i,t=>{HB(e,t,g[r])})}}else t.ensureOptimizations&&CB(`${kJ} TokenType: <${n.name}> is using a custom token pattern without providing <start_chars_hint> parameter.1217+ This will disable the lexer's first char optimizations.1218+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),_=!1;return e},[])}),{emptyGroups:h,patternIdxToConfig:g,charCodeToPatternIdxToConfig:v,hasCustom:i,canBeOptimized:_}}function Jqe(e,t){let n=[],r=Xqe(e);n=n.concat(r.errors);let i=Zqe(r.valid),a=i.valid;return n=n.concat(i.errors),n=n.concat(Yqe(a)),n=n.concat(rJe(a)),n=n.concat(iJe(a,t)),n=n.concat(aJe(a)),n}function Yqe(e){let t=[],n=Jq(e,e=>oJ(e[AJ]));return t=t.concat(Qqe(n)),t=t.concat(eJe(n)),t=t.concat(tJe(n)),t=t.concat(nJe(n)),t=t.concat($qe(n)),t}function Xqe(e){let t=Jq(e,e=>!$q(e,AJ));return{errors:Zq(t,e=>({message:`Token Type: ->`+e.name+`<- missing static 'PATTERN' property`,type:RJ.MISSING_PATTERN,tokenTypes:[e]})),valid:Vq(e,t)}}function Zqe(e){let t=Jq(e,e=>{let t=e[AJ];return!oJ(t)&&!jG(t)&&!$q(t,`exec`)&&!eJ(t)});return{errors:Zq(t,e=>({message:`Token Type: ->`+e.name+`<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.`,type:RJ.INVALID_PATTERN,tokenTypes:[e]})),valid:Vq(e,t)}}function Qqe(e){class t extends sG{static{Q(this,`EndAnchorFinder`)}constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}return Zq(Jq(e,e=>{let n=e.PATTERN;try{let e=MB(n),r=new t;return r.visit(e),r.found}catch{return L6e.test(n.source)}}),e=>({message:`Unexpected RegExp Anchor Error:1219+ Token Type: ->`+e.name+`<- static 'PATTERN' cannot contain end of input anchor '$'1220+ See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:RJ.EOI_ANCHOR_FOUND,tokenTypes:[e]}))}function $qe(e){return Zq(Jq(e,e=>e.PATTERN.test(``)),e=>({message:`Token Type: ->`+e.name+`<- static 'PATTERN' must not match an empty string`,type:RJ.EMPTY_MATCH_PATTERN,tokenTypes:[e]}))}function eJe(e){class t extends sG{static{Q(this,`StartAnchorFinder`)}constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}return Zq(Jq(e,e=>{let n=e.PATTERN;try{let e=MB(n),r=new t;return r.visit(e),r.found}catch{return R6e.test(n.source)}}),e=>({message:`Unexpected RegExp Anchor Error:1221+ Token Type: ->`+e.name+`<- static 'PATTERN' cannot contain start of input anchor '^'1222+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:RJ.SOI_ANCHOR_FOUND,tokenTypes:[e]}))}function tJe(e){return Zq(Jq(e,e=>{let t=e[AJ];return t instanceof RegExp&&(t.multiline||t.global)}),e=>({message:`Token Type: ->`+e.name+`<- static 'PATTERN' may NOT contain global('g') or multiline('m')`,type:RJ.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}))}function nJe(e){let t=[],n=Zq(e,n=>lJ(e,(e,r)=>n.PATTERN.source===r.PATTERN.source&&!nJ(t,r)&&r.PATTERN!==BJ.NA?(t.push(r),e.push(r),e):e,[]));return n=yq(n),Zq(Jq(n,e=>e.length>1),e=>{let t=Zq(e,e=>e.name);return{message:`The same RegExp pattern ->${Xq(e).PATTERN}<-has been used in all of the following Token Types: ${t.join(`, `)} <-`,type:RJ.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})}function rJe(e){return Zq(Jq(e,e=>{if(!$q(e,`GROUP`))return!1;let t=e.GROUP;return t!==BJ.SKIPPED&&t!==BJ.NA&&!eJ(t)}),e=>({message:`Token Type: ->`+e.name+`<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String`,type:RJ.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}))}function iJe(e,t){return Zq(Jq(e,e=>e.PUSH_MODE!==void 0&&!nJ(t,e.PUSH_MODE)),e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:RJ.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}))}function aJe(e){let t=[],n=lJ(e,(e,t,n)=>{let r=t.PATTERN;return r===BJ.NA||(eJ(r)?e.push({str:r,idx:n,tokenType:t}):oJ(r)&&sJe(r)&&e.push({str:r.source,idx:n,tokenType:t})),e},[]);return Gq(e,(e,r)=>{Gq(n,({str:n,idx:i,tokenType:a})=>{if(r<i&&oJe(n,e.PATTERN)){let n=`Token: ->${a.name}<- can never be matched.1223+Because it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.1224+See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:RJ.UNREACHABLE_PATTERN,tokenTypes:[e,a]})}})}),t}function oJe(e,t){if(oJ(t)){if(cJe(t))return!1;let n=t.exec(e);return n!==null&&n.index===0}if(jG(t))return t(e,0,[],{});if($q(t,`exec`))return t.exec(e,0,[],{});if(typeof t==`string`)return t===e;throw Error(`non exhaustive match`)}function sJe(e){return Yq([`.`,`\\`,`[`,`]`,`|`,`^`,`$`,`(`,`)`,`?`,`*`,`+`,`{`],t=>e.source.indexOf(t)!==-1)===void 0}function cJe(e){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(e.source)}function RB(e){let t=e.ignoreCase?`iy`:`y`;return RegExp(`${e.source}`,t)}function lJe(e,t,n){let r=[];return $q(e,jJ)||r.push({message:`A MultiMode Lexer cannot be initialized without a <`+jJ+`> property in its definition1225+`,type:RJ.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),$q(e,MJ)||r.push({message:`A MultiMode Lexer cannot be initialized without a <`+MJ+`> property in its definition1226+`,type:RJ.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),$q(e,MJ)&&$q(e,jJ)&&!$q(e.modes,e.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${jJ}: <${e.defaultMode}>which does not exist1227+`,type:RJ.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),$q(e,MJ)&&Gq(e.modes,(e,t)=>{Gq(e,(n,i)=>{sJ(n)?r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${t}> at index: <${i}>1228+`,type:RJ.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):$q(n,`LONGER_ALT`)&&Gq(CG(n.LONGER_ALT)?n.LONGER_ALT:[n.LONGER_ALT],i=>{!sJ(i)&&!nJ(e,i)&&r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${n.name}> outside of mode <${t}>1229+`,type:RJ.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),r}function uJe(e,t,n){let r=[],i=!1,a=uJ(yq(IK(tJ(e.modes))),e=>e[AJ]===BJ.NA),o=VB(n);return t&&Gq(a,e=>{let t=BB(e,o);if(t!==!1){let n={message:pJe(e,t),type:t.issue,tokenType:e};r.push(n)}else $q(e,`LINE_BREAKS`)?e.LINE_BREAKS===!0&&(i=!0):LB(o,e.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:`Warning: No LINE_BREAKS Found.1230+ This Lexer has been defined to track line and column information,1231+ But none of the Token Types can be identified as matching a line terminator.1232+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS 1233+ for details.`,type:RJ.NO_LINE_BREAKS_FLAGS}),r}function dJe(e){let t={};return Gq(yK(e),n=>{let r=e[n];if(CG(r))t[n]=[];else throw Error(`non exhaustive match`)}),t}function zB(e){let t=e.PATTERN;if(oJ(t))return!1;if(jG(t)||$q(t,`exec`))return!0;if(eJ(t))return!1;throw Error(`non exhaustive match`)}function fJe(e){return eJ(e)&&e.length===1?e.charCodeAt(0):!1}function BB(e,t){if($q(e,`LINE_BREAKS`))return!1;if(oJ(e.PATTERN)){try{LB(t,e.PATTERN)}catch(e){return{issue:RJ.IDENTIFY_TERMINATOR,errMsg:e.message}}return!1}if(eJ(e.PATTERN))return!1;if(zB(e))return{issue:RJ.CUSTOM_LINE_BREAK};throw Error(`non exhaustive match`)}function pJe(e,t){if(t.issue===RJ.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.1234+ The problem is in the <${e.name}> Token Type1235+ Root cause: ${t.errMsg}.1236+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===RJ.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.1237+ The problem is in the <${e.name}> Token Type1238+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error(`non exhaustive match`)}function VB(e){return Zq(e,e=>eJ(e)?e.charCodeAt(0):e)}function HB(e,t,n){e[t]===void 0?e[t]=[n]:e[t].push(n)}function UB(e){return e<NJ?e:PJ[e]}function mJe(){if(iJ(PJ)){PJ=Array(65536);for(let e=0;e<65536;e++)PJ[e]=e>255?255+~~(e/255):e}}function WB(e,t){let n=e.tokenTypeIdx;return n===t.tokenTypeIdx||t.isParent===!0&&t.categoryMatchesMap[n]===!0}function GB(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}function KB(e){let t=hJe(e);gJe(t),vJe(t),_Je(t),Gq(t,e=>{e.isParent=e.categoryMatches.length>0})}function hJe(e){let t=vq(e),n=e,r=!0;for(;r;){n=yq(IK(Zq(n,e=>e.CATEGORIES)));let e=Vq(n,t);t=t.concat(e),iJ(e)?r=!1:n=e}return t}function gJe(e){Gq(e,e=>{JB(e)||(IJ[FJ]=e,e.tokenTypeIdx=FJ++),YB(e)&&!CG(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),YB(e)||(e.CATEGORIES=[]),yJe(e)||(e.categoryMatches=[]),bJe(e)||(e.categoryMatchesMap={})})}function _Je(e){Gq(e,e=>{e.categoryMatches=[],Gq(e.categoryMatchesMap,(t,n)=>{e.categoryMatches.push(IJ[n].tokenTypeIdx)})})}function vJe(e){Gq(e,e=>{qB([],e)})}function qB(e,t){Gq(e,e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0}),Gq(t.CATEGORIES,n=>{let r=e.concat(t);nJ(r,n)||qB(r,n)})}function JB(e){return $q(e,`tokenTypeIdx`)}function YB(e){return $q(e,`CATEGORIES`)}function yJe(e){return $q(e,`categoryMatches`)}function bJe(e){return $q(e,`categoryMatchesMap`)}function xJe(e){return $q(e,`tokenTypeIdx`)}function XB(e){return ZB(e)?e.LABEL:e.name}function ZB(e){return eJ(e.LABEL)&&e.LABEL!==``}function QB(e){return SJe(e)}function SJe(e){let t=e.pattern,n={};if(n.name=e.name,sJ(t)||(n.PATTERN=t),$q(e,B6e))throw`The parent property is no longer supported.1239+See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return $q(e,VJ)&&(n.CATEGORIES=e[VJ]),KB([n]),$q(e,HJ)&&(n.LABEL=e[HJ]),$q(e,UJ)&&(n.GROUP=e[UJ]),$q(e,GJ)&&(n.POP_MODE=e[GJ]),$q(e,WJ)&&(n.PUSH_MODE=e[WJ]),$q(e,KJ)&&(n.LONGER_ALT=e[KJ]),$q(e,qJ)&&(n.LINE_BREAKS=e[qJ]),$q(e,JJ)&&(n.START_CHARS_HINT=e[JJ]),n}function $B(e,t,n,r,i,a,o,s){return{image:t,startOffset:n,endOffset:r,startLine:i,endLine:a,startColumn:o,endColumn:s,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}function eV(e,t){return WB(e,t)}function CJe(e,t){let n=new H6e(e,t);return n.resolveRefs(),n.errors}function tV(e,t,n=[]){n=vq(n);let r=[],i=0;function a(t){return t.concat(Uq(e,i+1))}Q(a,`remainingPathWith`);function o(e){let i=tV(a(e),t,n);return r.concat(i)}for(Q(o,`getAlternativesForProd`);n.length<t&&i<e.length;){let t=e[i];if(t instanceof gJ||t instanceof mJ)return o(t.definition);if(t instanceof _J)r=o(t.definition);else if(t instanceof vJ)return o(t.definition.concat([new bJ({definition:t.definition})]));else if(t instanceof yJ)return o([new gJ({definition:t.definition}),new bJ({definition:[new CJ({terminalType:t.separator})].concat(t.definition)})]);else if(t instanceof xJ)r=o(t.definition.concat([new bJ({definition:[new CJ({terminalType:t.separator})].concat(t.definition)})]));else if(t instanceof bJ)r=o(t.definition.concat([new bJ({definition:t.definition})]));else if(t instanceof SJ)return Gq(t.definition,e=>{iJ(e.definition)===!1&&(r=o(e.definition))}),r;else if(t instanceof CJ)n.push(t.terminalType);else throw Error(`non exhaustive match`);i++}return r.push({partialPath:n,suffixDef:Uq(e,i)}),r}function nV(e,t,n,r){let i=`EXIT_NONE_TERMINAL`,a=[i],o=`EXIT_ALTERNATIVE`,s=!1,l=t.length,u=l-r-1,d=[],f=[];for(f.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!iJ(f);){let e=f.pop();if(e===o){s&&Hq(f).idx<=u&&f.pop();continue}let r=e.def,p=e.idx,m=e.ruleStack,h=e.occurrenceStack;if(iJ(r))continue;let g=r[0];if(g===i){let e={idx:p,def:Uq(r),ruleStack:Wq(m),occurrenceStack:Wq(h)};f.push(e)}else if(g instanceof CJ){if(p<l-1){let e=p+1,i=t[e];if(n(i,g.terminalType)){let t={idx:e,def:Uq(r),ruleStack:m,occurrenceStack:h};f.push(t)}}else if(p===l-1)d.push({nextTokenType:g.terminalType,nextTokenOccurrence:g.idx,ruleStack:m,occurrenceStack:h}),s=!0;else throw Error(`non exhaustive match`)}else if(g instanceof mJ){let e=vq(m);e.push(g.nonTerminalName);let t=vq(h);t.push(g.idx);let n={idx:p,def:g.definition.concat(a,Uq(r)),ruleStack:e,occurrenceStack:t};f.push(n)}else if(g instanceof _J){let e={idx:p,def:Uq(r),ruleStack:m,occurrenceStack:h};f.push(e),f.push(o);let t={idx:p,def:g.definition.concat(Uq(r)),ruleStack:m,occurrenceStack:h};f.push(t)}else if(g instanceof vJ){let e=new bJ({definition:g.definition,idx:g.idx}),t={idx:p,def:g.definition.concat([e],Uq(r)),ruleStack:m,occurrenceStack:h};f.push(t)}else if(g instanceof yJ){let e=new bJ({definition:[new CJ({terminalType:g.separator})].concat(g.definition),idx:g.idx}),t={idx:p,def:g.definition.concat([e],Uq(r)),ruleStack:m,occurrenceStack:h};f.push(t)}else if(g instanceof xJ){let e={idx:p,def:Uq(r),ruleStack:m,occurrenceStack:h};f.push(e),f.push(o);let t=new bJ({definition:[new CJ({terminalType:g.separator})].concat(g.definition),idx:g.idx}),n={idx:p,def:g.definition.concat([t],Uq(r)),ruleStack:m,occurrenceStack:h};f.push(n)}else if(g instanceof bJ){let e={idx:p,def:Uq(r),ruleStack:m,occurrenceStack:h};f.push(e),f.push(o);let t=new bJ({definition:g.definition,idx:g.idx}),n={idx:p,def:g.definition.concat([t],Uq(r)),ruleStack:m,occurrenceStack:h};f.push(n)}else if(g instanceof SJ)for(let e=g.definition.length-1;e>=0;e--){let t={idx:p,def:g.definition[e].definition.concat(Uq(r)),ruleStack:m,occurrenceStack:h};f.push(t),f.push(o)}else if(g instanceof gJ)f.push({idx:p,def:g.definition.concat(Uq(r)),ruleStack:m,occurrenceStack:h});else if(g instanceof hJ)f.push(wJe(g,p,m,h));else throw Error(`non exhaustive match`)}return d}function wJe(e,t,n,r){let i=vq(n);i.push(e.name);let a=vq(r);return a.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:a}}function rV(e){if(e instanceof _J||e===`Option`)return tY.OPTION;if(e instanceof bJ||e===`Repetition`)return tY.REPETITION;if(e instanceof vJ||e===`RepetitionMandatory`)return tY.REPETITION_MANDATORY;if(e instanceof yJ||e===`RepetitionMandatoryWithSeparator`)return tY.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof xJ||e===`RepetitionWithSeparator`)return tY.REPETITION_WITH_SEPARATOR;if(e instanceof SJ||e===`Alternation`)return tY.ALTERNATION;throw Error(`non exhaustive match`)}function iV(e){let{occurrence:t,rule:n,prodType:r,maxLookahead:i}=e,a=rV(r);return a===tY.ALTERNATION?cV(t,n,i):lV(t,n,a,i)}function TJe(e,t,n,r,i,a){let o=cV(e,t,n);return a(o,r,dV(o)?GB:WB,i)}function EJe(e,t,n,r,i,a){let o=lV(e,t,i,n),s=dV(o)?GB:WB;return a(o[0],s,r)}function DJe(e,t,n,r){let i=e.length,a=Kq(e,e=>Kq(e,e=>e.length===1));if(t)return function(t){let r=Zq(t,e=>e.GATE);for(let t=0;t<i;t++){let i=e[t],a=i.length,o=r[t];if(o===void 0||o.call(this)!==!1)nextPath:for(let e=0;e<a;e++){let r=i[e],a=r.length;for(let e=0;e<a;e++)if(n(this.LA(e+1),r[e])===!1)continue nextPath;return t}}};if(a&&!r){let t=lJ(Zq(e,e=>IK(e)),(e,t,n)=>(Gq(t,t=>{$q(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=n),Gq(t.categoryMatches,t=>{$q(e,t)||(e[t]=n)})}),e),{});return function(){let e=this.LA(1);return t[e.tokenTypeIdx]}}return function(){for(let t=0;t<i;t++){let r=e[t],i=r.length;nextPath:for(let e=0;e<i;e++){let i=r[e],a=i.length;for(let e=0;e<a;e++)if(n(this.LA(e+1),i[e])===!1)continue nextPath;return t}}}}function OJe(e,t,n){let r=Kq(e,e=>e.length===1),i=e.length;if(r&&!n){let t=IK(e);if(t.length===1&&iJ(t[0].categoryMatches)){let e=t[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===e}}{let e=lJ(t,(e,t,n)=>(e[t.tokenTypeIdx]=!0,Gq(t.categoryMatches,t=>{e[t]=!0}),e),[]);return function(){let t=this.LA(1);return e[t.tokenTypeIdx]===!0}}}return function(){nextPath:for(let n=0;n<i;n++){let r=e[n],i=r.length;for(let e=0;e<i;e++)if(t(this.LA(e+1),r[e])===!1)continue nextPath;return!0}return!1}}function aV(e){let t=Array(e);for(let n=0;n<e;n++)t[n]=[];return t}function oV(e){let t=[``];for(let n=0;n<e.length;n++){let r=e[n],i=[];for(let e=0;e<t.length;e++){let n=t[e];i.push(n+`_`+r.tokenTypeIdx);for(let e=0;e<r.categoryMatches.length;e++){let t=`_`+r.categoryMatches[e];i.push(n+t)}}t=i}return t}function kJe(e,t,n){for(let r=0;r<e.length;r++){if(r===n)continue;let i=e[r];for(let e=0;e<t.length;e++)if(i[t[e]]===!0)return!1}return!0}function sV(e,t){let n=Zq(e,e=>tV([e],1)),r=aV(n.length),i=Zq(n,e=>{let t={};return Gq(e,e=>{Gq(oV(e.partialPath),e=>{t[e]=!0})}),t}),a=n;for(let e=1;e<=t;e++){let n=a;a=aV(n.length);for(let o=0;o<n.length;o++){let s=n[o];for(let n=0;n<s.length;n++){let l=s[n].partialPath,u=s[n].suffixDef,d=oV(l);if(kJe(i,d,o)||iJ(u)||l.length===t){let e=r[o];if(uV(e,l)===!1){e.push(l);for(let e=0;e<d.length;e++){let t=d[e];i[o][t]=!0}}}else{let t=tV(u,e+1,l);a[o]=a[o].concat(t),Gq(t,e=>{Gq(oV(e.partialPath),e=>{i[o][e]=!0})})}}}}return r}function cV(e,t,n,r){let i=new nY(e,tY.ALTERNATION,r);return t.accept(i),sV(i.result,n)}function lV(e,t,n,r){let i=new nY(e,n);t.accept(i);let a=i.result,o=new q6e(t,e,n).startWalking();return sV([new gJ({definition:a}),new gJ({definition:o})],r)}function uV(e,t){compareOtherPath:for(let n=0;n<e.length;n++){let r=e[n];if(r.length===t.length){for(let e=0;e<r.length;e++){let n=t[e],i=r[e];if(n!==i&&i.categoryMatchesMap[n.tokenTypeIdx]===void 0)continue compareOtherPath}return!0}}return!1}function AJe(e,t){return e.length<t.length&&Kq(e,(e,n)=>{let r=t[n];return e===r||r.categoryMatchesMap[e.tokenTypeIdx]})}function dV(e){return Kq(e,e=>Kq(e,e=>Kq(e,e=>iJ(e.categoryMatches))))}function jJe(e){return Zq(e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}),e=>Object.assign({type:AY.CUSTOM_LOOKAHEAD_VALIDATION},e))}function MJe(e,t,n,r){let i=Qq(e,e=>NJe(e,n)),a=UJe(e,t,n),o=Qq(e,e=>zJe(e,n)),s=Qq(e,t=>FJe(t,e,r,n));return i.concat(a,o,s)}function NJe(e,t){let n=new J6e;e.accept(n);let r=n.allProductions;return Zq(tJ(cJ(p6e(r,PJe),e=>e.length>1)),n=>{let r=Xq(n),i=t.buildDuplicateFoundError(e,n),a=kB(r),o={message:i,type:AY.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:a,occurrence:r.idx},s=fV(r);return s&&(o.parameter=s),o})}function PJe(e){return`${kB(e)}_#_${e.idx}_#_${fV(e)}`}function fV(e){return e instanceof CJ?e.terminalType.name:e instanceof mJ?e.nonTerminalName:``}function FJe(e,t,n,r){let i=[];if(lJ(t,(t,n)=>n.name===e.name?t+1:t,0)>1){let t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:AY.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}function IJe(e,t,n){let r=[],i;return nJ(t,e)||(i=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:AY.INVALID_RULE_OVERRIDE,ruleName:e})),r}function pV(e,t,n,r=[]){let i=[],a=mV(t.definition);if(iJ(a))return[];{let t=e.name;nJ(a,e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:AY.LEFT_RECURSION,ruleName:t});let o=Qq(Vq(a,r.concat([e])),t=>{let i=vq(r);return i.push(t),pV(e,t,n,i)});return i.concat(o)}}function mV(e){let t=[];if(iJ(e))return t;let n=Xq(e);if(n instanceof mJ)t.push(n.referencedRule);else if(n instanceof gJ||n instanceof _J||n instanceof vJ||n instanceof yJ||n instanceof xJ||n instanceof bJ)t=t.concat(mV(n.definition));else if(n instanceof SJ)t=IK(Zq(n.definition,e=>mV(e.definition)));else if(!(n instanceof CJ))throw Error(`non exhaustive match`);let r=OB(n),i=e.length>1;if(r&&i){let n=Uq(e);return t.concat(mV(n))}return t}function LJe(e,t){let n=new rY;e.accept(n);let r=n.alternations;return Qq(r,n=>Qq(Wq(n.definition),(r,i)=>iJ(nV([r],[],WB,1))?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:AY.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]))}function RJe(e,t,n){let r=new rY;e.accept(r);let i=r.alternations;return i=uJ(i,e=>e.ignoreAmbiguities===!0),Qq(i,r=>{let i=r.idx,a=cV(i,e,r.maxLookahead||t,r),o=VJe(a,r,e,n),s=HJe(a,r,e,n);return o.concat(s)})}function zJe(e,t){let n=new rY;e.accept(n);let r=n.alternations;return Qq(r,n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:AY.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[])}function BJe(e,t,n){let r=[];return Gq(e,e=>{let i=new Y6e;e.accept(i);let a=i.allProductions;Gq(a,i=>{let a=rV(i),o=i.maxLookahead||t,s=i.idx,l=lV(s,e,a,o)[0];if(iJ(IK(l))){let t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:AY.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),r}function VJe(e,t,n,r){let i=[];return Zq(lJ(e,(n,r,a)=>(t.definition[a].ignoreAmbiguities===!0||Gq(r,r=>{let o=[a];Gq(e,(e,n)=>{a!==n&&uV(e,r)&&t.definition[n].ignoreAmbiguities!==!0&&o.push(n)}),o.length>1&&!uV(i,r)&&(i.push(r),n.push({alts:o,path:r}))}),n),[]),e=>{let i=Zq(e.alts,e=>e+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:AY.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}})}function HJe(e,t,n,r){let i=lJ(e,(e,t,n)=>{let r=Zq(t,e=>({idx:n,path:e}));return e.concat(r)},[]);return yq(Qq(i,e=>{if(t.definition[e.idx].ignoreAmbiguities===!0)return[];let a=e.idx,o=e.path;return Zq(Jq(i,e=>t.definition[e.idx].ignoreAmbiguities!==!0&&e.idx<a&&AJe(e.path,o)),e=>{let i=[e.idx+1,a+1],o=t.idx===0?``:t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:AY.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}})}))}function UJe(e,t,n){let r=[],i=Zq(t,e=>e.name);return Gq(e,e=>{let t=e.name;if(nJ(i,t)){let i=n.buildNamespaceConflictError(e);r.push({message:i,type:AY.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),r}function WJe(e){let t=Rq(e,{errMsgProvider:V6e}),n={};return Gq(e.rules,e=>{n[e.name]=e}),CJe(n,t.errMsgProvider)}function GJe(e){return e=Rq(e,{errMsgProvider:ZJ}),MJe(e.rules,e.tokenTypes,e.errMsgProvider,e.grammarName)}function hV(e){return nJ(cY,e.name)}function KJe(e,t,n,r,i,a,o){let s=this.getKeyForAutomaticLookahead(r,i),l=this.firstAfterRepMap[s];if(l===void 0){let e=this.getCurrRuleFullName(),t=this.getGAstProductions()[e];l=new a(t,i).startWalking(),this.firstAfterRepMap[s]=l}let u=l.token,d=l.occurrence,f=l.isEndOfRule;this.RULE_STACK.length===1&&f&&u===void 0&&(u=YJ,d=1),u!==void 0&&d!==void 0&&this.shouldInRepetitionRecoveryBeTried(u,d,o)&&this.tryInRepetitionRecovery(e,t,n,u)}function gV(e,t,n){return n|t|e}function qJe(e){xY.reset(),e.accept(xY);let t=xY.dslMethods;return xY.reset(),t}function _V(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset)}function vV(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.startColumn=t.startColumn,e.startLine=t.startLine,e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine)}function JJe(e,t,n){e.children[n]===void 0?e.children[n]=[t]:e.children[n].push(t)}function YJe(e,t,n){e.children[t]===void 0?e.children[t]=[n]:e.children[t].push(n)}function yV(e,t){Object.defineProperty(e,a8e,{enumerable:!1,configurable:!0,writable:!1,value:t})}function XJe(e,t){let n=yK(e),r=n.length;for(let i=0;i<r;i++){let r=e[n[i]],a=r.length;for(let e=0;e<a;e++){let n=r[e];n.tokenTypeIdx===void 0&&this[n.name](n.children,t)}}}function ZJe(e,t){let n=Q(function(){},`derivedConstructor`);return yV(n,e+`BaseSemantics`),n.prototype={visit:Q(function(e,t){if(CG(e)&&(e=e[0]),!sJ(e))return this[e.name](e.children,t)},`visit`),validateVisitor:Q(function(){let e=$Je(this,t);if(!iJ(e)){let t=Zq(e,e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:1240+ ${t.join(`1241+1242+`).replace(/\n/g,`1243+ `)}`)}},`validateVisitor`)},n.prototype.constructor=n,n._RULE_NAMES=t,n}function QJe(e,t,n){let r=Q(function(){},`derivedConstructor`);yV(r,e+`BaseSemanticsWithDefaults`);let i=Object.create(n.prototype);return Gq(t,e=>{i[e]=XJe}),r.prototype=i,r.prototype.constructor=r,r}function $Je(e,t){return eYe(e,t)}function eYe(e,t){return yq(Zq(Jq(t,t=>jG(e[t])===!1),t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:o8e.MISSING_METHOD,methodName:t})))}function bV(e,t,n,r=!1){SV(n);let i=Hq(this.recordingProdStack),a=jG(t)?t:t.DEF,o=new e({definition:[],idx:n});return r&&(o.separator=t.SEP),$q(t,`MAX_LOOKAHEAD`)&&(o.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(o),a.call(this),i.definition.push(o),this.recordingProdStack.pop(),SY}function tYe(e,t){SV(t);let n=Hq(this.recordingProdStack),r=CG(e)===!1,i=r===!1?e:e.DEF,a=new SJ({definition:[],idx:t,ignoreAmbiguities:r&&e.IGNORE_AMBIGUITIES===!0});return $q(e,`MAX_LOOKAHEAD`)&&(a.maxLookahead=e.MAX_LOOKAHEAD),a.hasPredicates=dJ(i,e=>jG(e.GATE)),n.definition.push(a),Gq(i,e=>{let t=new gJ({definition:[]});a.definition.push(t),$q(e,`IGNORE_AMBIGUITIES`)?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:$q(e,`GATE`)&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()}),SY}function xV(e){return e===0?``:`${e}`}function SV(e){if(e<0||e>wY){let t=Error(`Invalid DSL Method idx value: <${e}>1244+ Idx value must be a none negative value smaller than ${wY+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}function nYe(e,t){t.forEach(t=>{let n=t.prototype;Object.getOwnPropertyNames(n).forEach(r=>{if(r===`constructor`)return;let i=Object.getOwnPropertyDescriptor(n,r);i&&(i.get||i.set)?Object.defineProperty(e.prototype,r,i):e.prototype[r]=t.prototype[r]})})}function CV(e=void 0){return function(){return e}}function rYe(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function iYe(){this.__data__=[],this.size=0}function aYe(e,t){return e===t||e!==e&&t!==t}function oYe(e,t){for(var n=e.length;n--;)if(NY(e[n][0],t))return n;return-1}function sYe(e){var t=this.__data__,n=PY(t,e);return n<0?!1:(n==t.length-1?t.pop():v8e.call(t,n,1),--this.size,!0)}function cYe(e){var t=this.__data__,n=PY(t,e);return n<0?void 0:t[n][1]}function lYe(e){return PY(this.__data__,e)>-1}function uYe(e,t){var n=this.__data__,r=PY(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function wV(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function dYe(){this.__data__=new FY,this.size=0}function fYe(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function pYe(e){return this.__data__.get(e)}function mYe(e){return this.__data__.has(e)}function hYe(e){var t=O8e.call(e,BY),n=e[BY];try{e[BY]=void 0;var r=!0}catch{}var i=k8e.call(e);return r&&(t?e[BY]=n:delete e[BY]),i}function gYe(e){return j8e.call(e)}function _Ye(e){return e==null?e===void 0?P8e:N8e:VY&&VY in Object(e)?A8e(e):M8e(e)}function vYe(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}function yYe(e){if(!UY(e))return!1;var t=HY(e);return t==I8e||t==L8e||t==F8e||t==R8e}function bYe(e){return!!KY&&KY in e}function xYe(e){if(e!=null){try{return B8e.call(e)}catch{}try{return e+``}catch{}}return``}function SYe(e){return!UY(e)||z8e(e)?!1:(WY(e)?q8e:H8e).test(qY(e))}function CYe(e,t){return e?.[t]}function wYe(e,t){var n=Y8e(e,t);return J8e(n)?n:void 0}function TYe(){this.__data__=XY?XY(null):{},this.size=0}function EYe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}function DYe(e){var t=this.__data__;if(XY){var n=t[e];return n===Q8e?void 0:n}return $8e.call(t,e)?t[e]:void 0}function OYe(e){var t=this.__data__;return XY?t[e]!==void 0:t5e.call(t,e)}function kYe(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=XY&&t===void 0?r5e:t,this}function TV(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function AYe(){this.size=0,this.__data__={hash:new ZY,map:new(YY||FY),string:new ZY}}function jYe(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function MYe(e,t){var n=e.__data__;return o5e(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function NYe(e){var t=QY(this,e).delete(e);return this.size-=+!!t,t}function PYe(e){return QY(this,e).get(e)}function FYe(e){return QY(this,e).has(e)}function IYe(e,t){var n=QY(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function EV(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function LYe(e,t){var n=this.__data__;if(n instanceof FY){var r=n.__data__;if(!YY||r.length<d5e-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new $Y(r)}return n.set(e,t),this.size=n.size,this}function DV(e){var t=this.__data__=new FY(e);this.size=t.size}function RYe(e){return this.__data__.set(e,p5e),this}function zYe(e){return this.__data__.has(e)}function OV(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new $Y;++t<n;)this.add(e[t])}function BYe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function VYe(e,t){return e.has(t)}function HYe(e,t,n,r,i,a){var o=n&_5e,s=e.length,l=t.length;if(s!=l&&!(o&&l>s))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var f=-1,p=!0,m=n&v5e?new tX:void 0;for(a.set(e,t),a.set(t,e);++f<s;){var h=e[f],g=t[f];if(r)var _=o?r(g,h,f,t,e,a):r(h,g,f,e,t,a);if(_!==void 0){if(_)continue;p=!1;break}if(m){if(!g5e(t,function(e,t){if(!nX(m,t)&&(h===e||i(h,e,n,r,a)))return m.push(t)})){p=!1;break}}else if(!(h===g||i(h,g,n,r,a))){p=!1;break}}return a.delete(e),a.delete(t),p}function UYe(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function WYe(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function GYe(e,t,n,r,i,a,o){switch(n){case M5e:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case j5e:return!(e.byteLength!=t.byteLength||!a(new iX(e),new iX(t)));case S5e:case C5e:case E5e:return NY(+e,+t);case w5e:return e.name==t.name&&e.message==t.message;case D5e:case k5e:return e==t+``;case T5e:var s=y5e;case O5e:var l=r&b5e;if(s||=aX,e.size!=t.size&&!l)return!1;var u=o.get(e);if(u)return u==t;r|=x5e,o.set(e,t);var d=rX(s(e),s(t),r,i,a,o);return o.delete(e),d;case A5e:if(sX)return sX.call(e)==sX.call(t)}return!1}function KYe(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function qYe(e,t,n){var r=t(e);return lX(e)?r:cX(r,n(e))}function JYe(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function YYe(){return[]}function XYe(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function ZYe(e){return typeof e==`object`&&!!e}function QYe(e){return fX(e)&&HY(e)==z5e}function $Ye(){return!1}function eXe(e,t){var n=typeof e;return t??=U5e,!!t&&(n==`number`||n!=`symbol`&&W5e.test(e))&&e>-1&&e%1==0&&e<t}function tXe(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=G5e}function nXe(e){return fX(e)&&xX(e.length)&&!!SX[HY(e)]}function rXe(e){return function(t){return e(t)}}function iXe(e,t){var n=lX(e),r=!n&&hX(e),i=!n&&!r&&yX(e),a=!n&&!r&&!i&&OX(e),o=n||r||i||a,s=o?R5e(e.length,String):[],l=s.length;for(var u in e)(t||v7e.call(e,u))&&!(o&&(u==`length`||i&&(u==`offset`||u==`parent`)||a&&(u==`buffer`||u==`byteLength`||u==`byteOffset`)||bX(u,l)))&&s.push(u);return s}function aXe(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||b7e)}function oXe(e,t){return function(n){return e(t(n))}}function sXe(e){if(!kX(e))return x7e(e);var t=[];for(var n in Object(e))S7e.call(e,n)&&n!=`constructor`&&t.push(n);return t}function cXe(e){return e!=null&&xX(e.length)&&!WY(e)}function lXe(e){return jX(e)?y7e(e):AX(e)}function uXe(e){return P5e(e,MX,L5e)}function dXe(e,t,n,r,i,a){var o=n&C7e,s=NX(e),l=s.length;if(l!=NX(t).length&&!o)return!1;for(var u=l;u--;){var d=s[u];if(!(o?d in t:w7e.call(t,d)))return!1}var f=a.get(e),p=a.get(t);if(f&&p)return f==t&&p==e;var m=!0;a.set(e,t),a.set(t,e);for(var h=o;++u<l;){d=s[u];var g=e[d],_=t[d];if(r)var v=o?r(_,g,d,t,e,a):r(g,_,d,e,t,a);if(!(v===void 0?g===_||i(g,_,n,r,a):v)){m=!1;break}h||=d==`constructor`}if(m&&!h){var y=e.constructor,b=t.constructor;y!=b&&`constructor`in e&&`constructor`in t&&!(typeof y==`function`&&y instanceof y&&typeof b==`function`&&b instanceof b)&&(m=!1)}return a.delete(e),a.delete(t),m}function fXe(e,t,n,r,i,a){var o=lX(e),s=lX(t),l=o?KX:WX(e),u=s?KX:WX(t);l=l==GX?qX:l,u=u==GX?qX:u;var d=l==qX,f=u==qX,p=l==u;if(p&&yX(e)){if(!yX(t))return!1;o=!0,d=!1}if(p&&!d)return a||=new eX,o||OX(e)?rX(e,t,n,r,i,a):N5e(e,t,l,n,r,i,a);if(!(n&M7e)){var m=d&&JX.call(e,`__wrapped__`),h=f&&JX.call(t,`__wrapped__`);if(m||h){var g=m?e.value():e,_=h?t.value():t;return a||=new eX,i(g,_,n,r,a)}}return p?(a||=new eX,T7e(e,t,n,r,i,a)):!1}function kV(e,t,n,r,i){return e===t?!0:e==null||t==null||!fX(e)&&!fX(t)?e!==e&&t!==t:N7e(e,t,n,r,kV,i)}function pXe(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var l=s[0],u=e[l],d=s[1];if(o&&s[2]){if(u===void 0&&!(l in e))return!1}else{var f=new eX;if(r)var p=r(u,d,l,e,t,f);if(!(p===void 0?YX(d,u,P7e|F7e,r,f):p))return!1}}return!0}function mXe(e){return e===e&&!UY(e)}function hXe(e){for(var t=MX(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,XX(i)]}return t}function gXe(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}}function _Xe(e){var t=L7e(e);return t.length==1&&t[0][2]?ZX(t[0][0],t[0][1]):function(n){return n===e||I7e(n,e,t)}}function vXe(e){return typeof e==`symbol`||fX(e)&&HY(e)==z7e}function yXe(e,t){if(lX(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||QX(e)?!0:V7e.test(e)||!B7e.test(e)||t!=null&&e in Object(t)}function AV(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(H7e);var n=Q(function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o},`memoized`);return n.cache=new(AV.Cache||$Y),n}function bXe(e){var t=U7e(e,function(e){return n.size===W7e&&n.clear(),e}),n=t.cache;return t}function jV(e){if(typeof e==`string`)return e;if(lX(e))return MY(e,jV)+``;if(QX(e))return tZ?tZ.call(e):``;var t=e+``;return t==`0`&&1/e==-Y7e?`-0`:t}function xXe(e){return e==null?``:X7e(e)}function SXe(e,t){return lX(e)?e:$X(e,t)?[e]:J7e(Z7e(e))}function CXe(e){if(typeof e==`string`||QX(e))return e;var t=e+``;return t==`0`&&1/e==-Q7e?`-0`:t}function wXe(e,t){t=nZ(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[rZ(t[n++])];return n&&n==r?e:void 0}function TXe(e,t,n){var r=e==null?void 0:iZ(e,t);return r===void 0?n:r}function EXe(e,t){return e!=null&&t in Object(e)}function DXe(e,t,n){t=nZ(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=rZ(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&xX(i)&&bX(o,i)&&(lX(e)||hX(e)))}function OXe(e,t){return e!=null&&t9e(e,t,e9e)}function kXe(e,t){return $X(e)&&XX(t)?ZX(rZ(e),t):function(n){var r=$7e(n,e);return r===void 0&&r===t?n9e(n,e):YX(t,r,r9e|i9e)}}function AXe(e){return e}function jXe(e){return function(t){return t?.[e]}}function MXe(e){return function(t){return iZ(t,e)}}function NXe(e){return $X(e)?o9e(rZ(e)):s9e(e)}function PXe(e){return typeof e==`function`?e:e==null?aZ:typeof e==`object`?lX(e)?a9e(e[0],e[1]):R7e(e):c9e(e)}function FXe(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var l=o[e?s:++i];if(n(a[l],l,a)===!1)break}return t}}function IXe(e,t){return e&&l9e(e,t,MX)}function LXe(e,t){return function(n,r){if(n==null)return n;if(!jX(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}function RXe(e,t){var n=-1,r=jX(e)?Array(e.length):[];return sZ(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function zXe(e,t){return(lX(e)?MY:d9e)(e,oZ(t,3))}function BXe(e,t){var n=[];return sZ(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function VXe(e,t){return(lX(e)?uX:f9e)(e,oZ(t,3))}function MV(e,t,n){return`${e.name}_${t}_${n}`}function HXe(e){let t={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};UXe(t,e);let n=e.length;for(let r=0;r<n;r++){let n=e[r],i=PV(t,n,n);i!==void 0&&eZe(t,n,i)}return t}function UXe(e,t){let n=t.length;for(let r=0;r<n;r++){let n=t[r],i=VV(e,n,void 0,{type:m9e}),a=VV(e,n,void 0,{type:fZ});i.stop=a,e.ruleToStartState.set(n,i),e.ruleToStopState.set(n,a)}}function NV(e,t,n){return n instanceof CJ?zV(e,t,n.terminalType,n):n instanceof mJ?$Xe(e,t,n):n instanceof SJ?JXe(e,t,n):n instanceof _J?YXe(e,t,n):n instanceof bJ?WXe(e,t,n):n instanceof xJ?GXe(e,t,n):n instanceof vJ?KXe(e,t,n):n instanceof yJ?qXe(e,t,n):PV(e,t,n)}function WXe(e,t,n){let r=VV(e,t,n,{type:dZ});return LV(e,r),IV(e,t,n,RV(e,t,r,n,PV(e,t,n)))}function GXe(e,t,n){let r=VV(e,t,n,{type:dZ});return LV(e,r),IV(e,t,n,RV(e,t,r,n,PV(e,t,n)),zV(e,t,n.separator,n))}function KXe(e,t,n){let r=VV(e,t,n,{type:uZ});return LV(e,r),FV(e,t,n,RV(e,t,r,n,PV(e,t,n)))}function qXe(e,t,n){let r=VV(e,t,n,{type:uZ});return LV(e,r),FV(e,t,n,RV(e,t,r,n,PV(e,t,n)),zV(e,t,n.separator,n))}function JXe(e,t,n){let r=VV(e,t,n,{type:lZ});return LV(e,r),RV(e,t,r,n,...cZ(n.definition,n=>NV(e,t,n)))}function YXe(e,t,n){let r=VV(e,t,n,{type:lZ});return LV(e,r),XXe(e,t,n,RV(e,t,r,n,PV(e,t,n)))}function PV(e,t,n){let r=p9e(cZ(n.definition,n=>NV(e,t,n)),e=>e!==void 0);return r.length===1?r[0]:r.length===0?void 0:QXe(e,r)}function FV(e,t,n,r,i){let a=r.left,o=r.right,s=VV(e,t,n,{type:v9e});LV(e,s);let l=VV(e,t,n,{type:pZ});return a.loopback=s,l.loopback=s,e.decisionMap[MV(t,i?`RepetitionMandatoryWithSeparator`:`RepetitionMandatory`,n.idx)]=s,BV(o,s),i===void 0?(BV(s,a),BV(s,l)):(BV(s,l),BV(s,i.left),BV(i.right,a)),{left:a,right:l}}function IV(e,t,n,r,i){let a=r.left,o=r.right,s=VV(e,t,n,{type:_9e});LV(e,s);let l=VV(e,t,n,{type:pZ}),u=VV(e,t,n,{type:g9e});return s.loopback=u,l.loopback=u,BV(s,a),BV(s,l),BV(o,u),i===void 0?BV(u,s):(BV(u,l),BV(u,i.left),BV(i.right,a)),e.decisionMap[MV(t,i?`RepetitionWithSeparator`:`Repetition`,n.idx)]=s,{left:s,right:l}}function XXe(e,t,n,r){let i=r.left,a=r.right;return BV(i,a),e.decisionMap[MV(t,`Option`,n.idx)]=i,r}function LV(e,t){return e.decisionStates.push(t),t.decision=e.decisionStates.length-1,t.decision}function RV(e,t,n,r,...i){let a=VV(e,t,r,{type:h9e,start:n});n.end=a;for(let e of i)e===void 0?BV(n,a):(BV(n,e.left),BV(e.right,a));let o={left:n,right:a};return e.decisionMap[MV(t,ZXe(r),r.idx)]=n,o}function ZXe(e){if(e instanceof SJ)return`Alternation`;if(e instanceof _J)return`Option`;if(e instanceof bJ)return`Repetition`;if(e instanceof xJ)return`RepetitionWithSeparator`;if(e instanceof vJ)return`RepetitionMandatory`;if(e instanceof yJ)return`RepetitionMandatoryWithSeparator`;throw Error(`Invalid production type encountered`)}function QXe(e,t){let n=t.length;for(let r=0;r<n-1;r++){let n=t[r],i;n.left.transitions.length===1&&(i=n.left.transitions[0]);let a=i instanceof _Z,o=i,s=t[r+1].left;n.left.type===lZ&&n.right.type===lZ&&i!==void 0&&(a&&o.followState===n.right||i.target===n.right)?(a?o.followState=s:i.target=s,tZe(e,n.right)):BV(n.right,s)}let r=t[0],i=t[n-1];return{left:r.left,right:i.right}}function zV(e,t,n,r){let i=VV(e,t,r,{type:lZ}),a=VV(e,t,r,{type:lZ});return HV(i,new hZ(a,n)),{left:i,right:a}}function $Xe(e,t,n){let r=n.referencedRule,i=e.ruleToStartState.get(r),a=VV(e,t,n,{type:lZ}),o=VV(e,t,n,{type:lZ});return HV(a,new _Z(i,r,o)),{left:a,right:o}}function eZe(e,t,n){let r=e.ruleToStartState.get(t);BV(r,n.left);let i=e.ruleToStopState.get(t);return BV(n.right,i),{left:r,right:i}}function BV(e,t){HV(e,new gZ(t))}function VV(e,t,n,r){let i=Object.assign({atn:e,production:n,epsilonOnlyTransitions:!1,rule:t,transitions:[],nextTokenWithinRule:[],stateNumber:e.states.length},r);return e.states.push(i),i}function HV(e,t){e.transitions.length===0&&(e.epsilonOnlyTransitions=t.isEpsilon()),e.transitions.push(t)}function tZe(e,t){e.states.splice(e.states.indexOf(t),1)}function UV(e,t=!0){return`${t?`a${e.alt}`:``}s${e.state.stateNumber}:${e.stack.map(e=>e.stateNumber.toString()).join(`_`)}`}function nZe(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],o=t(a);if(o!=null&&(s===void 0?o===o&&!QX(o):n(o,s)))var s=o,l=a}return l}function rZe(e,t){return e<t}function iZe(e){return e&&e.length?y9e(e,aZ,b9e):void 0}function aZe(e){return lX(e)||hX(e)||!!(bZ&&e&&e[bZ])}function WV(e,t,n,r,i){var a=-1,o=e.length;for(n||=S9e,i||=[];++a<o;){var s=e[a];t>0&&n(s)?t>1?WV(s,t-1,n,r,i):cX(i,s):r||(i[i.length]=s)}return i}function oZe(e,t){return xZ(cZ(e,t),1)}function sZe(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function cZe(e){return e!==e}function lZe(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function uZe(e,t,n){return t===t?E9e(e,t,n):w9e(e,T9e,n)}function dZe(e,t){return!!(e!=null&&e.length)&&D9e(e,t,0)>-1}function fZe(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function pZe(){}function mZe(e,t,n){var r=-1,i=O9e,a=e.length,o=!0,s=[],l=s;if(n)o=!1,i=k9e;else if(a>=M9e){var u=t?null:j9e(e);if(u)return aX(u);o=!1,i=nX,l=new tX}else l=t?[]:s;outer:for(;++r<a;){var d=e[r],f=t?t(d):d;if(d=n||d!==0?d:0,o&&f===f){for(var p=l.length;p--;)if(l[p]===f)continue outer;t&&l.push(f),s.push(d)}else i(l,f,n)||(l!==s&&l.push(f),s.push(d))}return s}function hZe(e,t){return e&&e.length?N9e(e,oZ(t,2)):[]}function gZe(e){return e!=null&&e.length?xZ(e,1):[]}function _Ze(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function vZe(e){return typeof e==`function`?e:aZ}function yZe(e,t){return(lX(e)?I9e:sZ)(e,L9e(t))}function bZe(e){if(e==null)return!0;if(jX(e)&&(lX(e)||typeof e==`string`||typeof e.splice==`function`||yX(e)||OX(e)||hX(e)))return!e.length;var t=WX(e);if(t==R9e||t==z9e)return!e.size;if(kX(e))return!AX(e).length;for(var n in e)if(B9e.call(e,n))return!1;return!0}function xZe(e,t,n,r){var i=-1,a=e==null?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function SZe(e,t,n,r,i){return i(e,function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)}),n}function CZe(e,t,n){var r=lX(e)?H9e:U9e,i=arguments.length<3;return r(e,oZ(t,4),n,i,sZ)}function wZe(e,t){let n={};return r=>{let i=r.toString(),a=n[i];return a===void 0?(a={atnStartState:e,decision:t,states:{}},n[i]=a,a):a}}function GV(e,t=!0){let n=new Set;for(let r of e){let e=new Set;for(let i of r){if(i===void 0){if(t)break;return!1}let r=[i.tokenTypeIdx].concat(i.categoryMatches);for(let t of r)if(n.has(t)){if(!e.has(t))return!1}else n.add(t),e.add(t)}}return!0}function TZe(e){let t=e.decisionStates.length,n=Array(t);for(let r=0;r<t;r++)n[r]=wZe(e.decisionStates[r],r);return n}function KV(e,t,n,r){let i=e[t](n),a=i.start;return a===void 0&&(a=YV(i,qV(IZe(i.atnStartState))),i.start=a),EZe.apply(this,[i,a,n,r])}function EZe(e,t,n,r){let i=t,a=1,o=[],s=this.LA(a++);for(;;){let t=MZe(i,s);if(t===void 0&&(t=DZe.apply(this,[e,i,s,a,n,r])),t===vZ)return jZe(o,i,s);if(t.isAcceptState===!0)return t.prediction;i=t,o.push(s),s=this.LA(a++)}}function DZe(e,t,n,r,i,a){let o=NZe(t.configs,n,i);if(o.size===0)return JV(e,t,n,vZ),vZ;let s=qV(o),l=FZe(o,i);if(l!==void 0)s.isAcceptState=!0,s.prediction=l,s.configs.uniqueAlt=l;else if(BZe(o)){let t=x9e(o.alts);s.isAcceptState=!0,s.prediction=t,s.configs.uniqueAlt=t,OZe.apply(this,[e,r,o.alts,a])}return s=JV(e,t,n,s),s}function OZe(e,t,n,r){let i=[];for(let e=1;e<=t;e++)i.push(this.LA(e).tokenType);let a=e.atnStartState,o=a.rule,s=a.production;r(kZe({topLevelRule:o,ambiguityIndices:n,production:s,prefixPath:i}))}function kZe(e){let t=cZ(e.prefixPath,e=>XB(e)).join(`, `),n=e.production.idx===0?``:e.production.idx,r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(`, `)}> in <${AZe(e.production)}${n}> inside <${e.topLevelRule.name}> Rule,1245+<${t}> may appears as a prefix path in all these alternatives.1246+`;return r+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES1247+For Further details.`,r}function AZe(e){if(e instanceof mJ)return`SUBRULE`;if(e instanceof _J)return`OPTION`;if(e instanceof SJ)return`OR`;if(e instanceof vJ)return`AT_LEAST_ONE`;if(e instanceof yJ)return`AT_LEAST_ONE_SEP`;if(e instanceof xJ)return`MANY_SEP`;if(e instanceof bJ)return`MANY`;if(e instanceof CJ)return`CONSUME`;throw Error(`non exhaustive match`)}function jZe(e,t,n){return{actualToken:n,possibleTokenTypes:P9e(C9e(t.configs.elements,e=>e.state.transitions).filter(e=>e instanceof hZ).map(e=>e.tokenType),e=>e.tokenTypeIdx),tokenPath:e}}function MZe(e,t){return e.edges[t.tokenTypeIdx]}function NZe(e,t,n){let r=new yZ,i=[];for(let a of e.elements){if(n.is(a.alt)===!1)continue;if(a.state.type===fZ){i.push(a);continue}let e=a.state.transitions.length;for(let n=0;n<e;n++){let e=a.state.transitions[n],i=PZe(e,t);i!==void 0&&r.add({state:i,alt:a.alt,stack:a.stack})}}let a;if(i.length===0&&r.size===1&&(a=r),a===void 0){a=new yZ;for(let e of r.elements)XV(e,a)}if(i.length>0&&!RZe(a))for(let e of i)a.add(e);return a}function PZe(e,t){if(e instanceof hZ&&eV(t,e.tokenType))return e.target}function FZe(e,t){let n;for(let r of e.elements)if(t.is(r.alt)===!0){if(n===void 0)n=r.alt;else if(n!==r.alt)return}return n}function qV(e){return{configs:e,edges:{},isAcceptState:!1,prediction:-1}}function JV(e,t,n,r){return r=YV(e,r),t.edges[n.tokenTypeIdx]=r,r}function YV(e,t){if(t===vZ)return t;let n=t.configs.key,r=e.states[n];return r===void 0?(t.configs.finalize(),e.states[n]=t,t):r}function IZe(e){let t=new yZ,n=e.transitions.length;for(let r=0;r<n;r++)XV({state:e.transitions[r].target,alt:r,stack:[]},t);return t}function XV(e,t){let n=e.state;if(n.type===fZ){if(e.stack.length>0){let n=[...e.stack];XV({state:n.pop(),alt:e.alt,stack:n},t)}else t.add(e);return}n.epsilonOnlyTransitions||t.add(e);let r=n.transitions.length;for(let i=0;i<r;i++){let r=n.transitions[i],a=LZe(e,r);a!==void 0&&XV(a,t)}}function LZe(e,t){if(t instanceof gZ)return{state:t.target,alt:e.alt,stack:e.stack};if(t instanceof _Z){let n=[...e.stack,t.followState];return{state:t.target,alt:e.alt,stack:n}}}function RZe(e){for(let t of e.elements)if(t.state.type===fZ)return!0;return!1}function zZe(e){for(let t of e.elements)if(t.state.type!==fZ)return!1;return!0}function BZe(e){if(zZe(e))return!0;let t=VZe(e.elements);return HZe(t)&&!UZe(t)}function VZe(e){let t=new Map;for(let n of e){let e=UV(n,!1),r=t.get(e);r===void 0&&(r={},t.set(e,r)),r[n.alt]=!0}return t}function HZe(e){for(let t of Array.from(e.values()))if(Object.keys(t).length>1)return!0;return!1}function UZe(e){for(let t of Array.from(e.values()))if(Object.keys(t).length===1)return!0;return!1}function ZV(e){return e.$type===jZ}function QV(e,t,n){return WZe({parser:t,tokens:n,ruleNames:new Map},e),t}function WZe(e,t){let n=Hz(t,!1),r=yR(t.rules).filter($R).filter(e=>n.has(e));for(let t of r){let n={...e,consume:1,optional:1,subrule:1,many:1,or:1};e.parser.rule(t,$V(n,t.definition))}let i=yR(t.rules).filter(qR).filter(e=>n.has(e));for(let t of i)e.parser.rule(t,GZe(e,t))}function GZe(e,t){let n=t.call.rule.ref;if(!n)throw Error(`Could not resolve reference to infix operator rule: `+t.call.rule.$refText);if(sz(n))throw Error(`Cannot use terminal rule in infix expression`);let r=t.operators.precedences.flatMap(e=>e.operators),i={$type:`Group`,elements:[]},a={$container:i,$type:`Assignment`,feature:`parts`,operator:`+=`,terminal:t.call},o={$container:i,$type:`Group`,elements:[],cardinality:`*`};i.elements.push(a,o);let s={$container:o,$type:`Assignment`,feature:`operators`,operator:`+=`,terminal:{$type:`Alternatives`,elements:r}},l={...a,$container:o};o.elements.push(s,l);let u=r.map(t=>e.tokens[t.value]).map((t,n)=>({ALT:Q(()=>e.parser.consume(n,t,s),`ALT`)})),d;return t=>{d??=iH(e,n),e.parser.subrule(0,d,!1,a,t),e.parser.many(0,{DEF:Q(()=>{e.parser.alternatives(0,u),e.parser.subrule(1,d,!1,l,t)},`DEF`)})}}function $V(e,t,n=!1){let r;if(YR(t))r=QZe(e,t);else if(FR(t))r=KZe(e,t);else if(RR(t))r=$V(e,t.terminal);else if(HR(t))r=nH(e,t);else if(rz(t))r=qZe(e,t);else if(IR(t))r=YZe(e,t);else if(dz(t))r=XZe(e,t);else if(GR(t))r=ZZe(e,t);else if(WR(t)){let n=e.consume++;r=Q(()=>e.parser.consume(n,YJ,t),`method`)}else throw new eG(t.$cstNode,`Unexpected element type: ${t.$type}`);return rH(e,n?void 0:tH(t),r,t.cardinality)}function KZe(e,t){let n=aB(t);return()=>e.parser.action(n,t)}function qZe(e,t){let n=t.rule.ref;if(PR(n)){let r=e.subrule++,i=$R(n)&&n.fragment,a=t.arguments.length>0?JZe(n,t.arguments):()=>({}),o;return s=>{o??=iH(e,n),e.parser.subrule(r,o,i,t,a(s))}}if(sz(n)){let r=e.consume++,i=aH(e,n.name);return()=>e.parser.consume(r,i,t)}if(n)Dz(n);else throw new eG(t.$cstNode,`Undefined rule: ${t.rule.$refText}`)}function JZe(e,t){if(t.some(e=>e.calledByName)){let e=t.map(e=>({parameterName:e.parameter?.ref?.name,predicate:eH(e.value)}));return t=>{let n={};for(let{parameterName:r,predicate:i}of e)r&&(n[r]=i(t));return n}}{let n=t.map(e=>eH(e.value));return t=>{let r={};for(let i=0;i<n.length;i++)if(i<e.parameters.length){let a=e.parameters[i].name,o=n[i];r[a]=o(t)}return r}}}function eH(e){if(UR(e)){let t=eH(e.left),n=eH(e.right);return e=>t(e)||n(e)}if(VR(e)){let t=eH(e.left),n=eH(e.right);return e=>t(e)&&n(e)}if(ZR(e)){let t=eH(e.value);return e=>!t(e)}if(QR(e)){let t=e.parameter.ref.name;return e=>e!==void 0&&e[t]===!0}if(zR(e)){let t=!!e.true;return()=>t}Dz(e)}function YZe(e,t){if(t.elements.length===1)return $V(e,t.elements[0]);{let n=[];for(let r of t.elements){let t={ALT:$V(e,r,!0)},i=tH(r);i&&(t.GATE=eH(i)),n.push(t)}let r=e.or++;return t=>e.parser.alternatives(r,n.map(e=>{let n={ALT:Q(()=>e.ALT(t),`ALT`)},r=e.GATE;return r&&(n.GATE=()=>r(t)),n}))}}function XZe(e,t){if(t.elements.length===1)return $V(e,t.elements[0]);let n=[];for(let r of t.elements){let t={ALT:$V(e,r,!0)},i=tH(r);i&&(t.GATE=eH(i)),n.push(t)}let r=e.or++,i=Q((e,t)=>`uGroup_${e}_${t.getRuleStack().join(`-`)}`,`idFunc`),a=Q(t=>e.parser.alternatives(r,n.map((n,a)=>{let o={ALT:Q(()=>!0,`ALT`)},s=e.parser;o.ALT=()=>{if(n.ALT(t),!s.isRecording()){let e=i(r,s);s.unorderedGroups.get(e)||s.unorderedGroups.set(e,[]);let t=s.unorderedGroups.get(e);t?.[a]===void 0&&(t[a]=!0)}};let l=n.GATE;return o.GATE=l?()=>l(t):()=>!s.unorderedGroups.get(i(r,s))?.[a],o})),`alternatives`),o=rH(e,tH(t),a,`*`);return t=>{o(t),e.parser.isRecording()||e.parser.unorderedGroups.delete(i(r,e.parser))}}function ZZe(e,t){let n=t.elements.map(t=>$V(e,t));return e=>n.forEach(t=>t(e))}function tH(e){if(GR(e))return e.guardCondition}function nH(e,t,n=t.terminal){if(!n){if(!t.type.ref)throw Error(`Could not resolve reference to type: `+t.type.$refText);let n=Qz(t.type.ref)?.terminal;if(!n)throw Error(`Could not find name assignment for type: `+aB(t.type.ref));return nH(e,t,n)}if(rz(n)&&$R(n.rule.ref)){let r=n.rule.ref,i=e.subrule++,a;return n=>{a??=iH(e,r),e.parser.subrule(i,a,!1,t,n)}}if(rz(n)&&sz(n.rule.ref)){let r=e.consume++,i=aH(e,n.rule.ref.name);return()=>e.parser.consume(r,i,t)}if(YR(n)){let r=e.consume++,i=aH(e,n.value);return()=>e.parser.consume(r,i,t)}throw Error(`Could not build cross reference parser`)}function QZe(e,t){let n=e.consume++,r=e.tokens[t.value];if(!r)throw Error(`Could not find token for keyword: `+t.value);return()=>e.parser.consume(n,r,t)}function rH(e,t,n,r){let i=t&&eH(t);if(!r){if(i){let t=e.or++;return r=>e.parser.alternatives(t,[{ALT:Q(()=>n(r),`ALT`),GATE:Q(()=>i(r),`GATE`)},{ALT:CV(),GATE:Q(()=>!i(r),`GATE`)}])}return n}if(r===`*`){let t=e.many++;return r=>e.parser.many(t,{DEF:Q(()=>n(r),`DEF`),GATE:i?()=>i(r):void 0})}if(r===`+`){let t=e.many++;if(i){let r=e.or++;return a=>e.parser.alternatives(r,[{ALT:Q(()=>e.parser.atLeastOne(t,{DEF:Q(()=>n(a),`DEF`)}),`ALT`),GATE:Q(()=>i(a),`GATE`)},{ALT:CV(),GATE:Q(()=>!i(a),`GATE`)}])}return r=>e.parser.atLeastOne(t,{DEF:Q(()=>n(r),`DEF`)})}if(r===`?`){let t=e.optional++;return r=>e.parser.optional(t,{DEF:Q(()=>n(r),`DEF`),GATE:i?()=>i(r):void 0})}Dz(r)}function iH(e,t){let n=$Ze(e,t),r=e.parser.getRule(n);if(!r)throw Error(`Rule "${n}" not found."`);return r}function $Ze(e,t){if(PR(t))return t.name;if(e.ruleNames.has(t))return e.ruleNames.get(t);{let n=t,r=n.$container,i=t.$type;for(;!$R(r);)(GR(r)||IR(r)||dz(r))&&(i=r.elements.indexOf(n).toString()+`:`+i),n=r,r=r.$container;return i=r.name+`:`+i,e.ruleNames.set(t,i),i}}function aH(e,t){let n=e.tokens[t];if(!n)throw Error(`Token "${t}" not found."`);return n}function oH(e){let t=e.Grammar,n=e.parser.Lexer,r=new RZ(e);return QV(t,r,n.definition),r.finalize(),r}function sH(e){let t=cH(e);return t.finalize(),t}function cH(e){let t=e.Grammar,n=e.parser.Lexer;return QV(t,new FZ(e),n.definition)}function lH(){return new Promise(e=>{typeof setImmediate>`u`?setTimeout(e,0):setImmediate(e)})}function uH(){return WZ=performance.now(),new UZ.CancellationTokenSource}function dH(e){GZ=e}function fH(e){return e===KZ}async function pH(e){if(e===UZ.CancellationToken.None)return;let t=performance.now();if(t-WZ>=GZ&&(WZ=t,await lH(),WZ=performance.now()),e.isCancellationRequested)throw KZ}function mH(e,t){if(e.length<=1)return e;let n=e.length/2|0,r=e.slice(0,n),i=e.slice(n);mH(r,t),mH(i,t);let a=0,o=0,s=0;for(;a<r.length&&o<i.length;)t(r[a],i[o])<=0?e[s++]=r[a++]:e[s++]=i[o++];for(;a<r.length;)e[s++]=r[a++];for(;o<i.length;)e[s++]=i[o++];return e}function hH(e,t,n=0){let r=t?[n]:[];for(let t=0;t<e.length;t++){let i=e.charCodeAt(t);gH(i)&&(i===13&&t+1<e.length&&e.charCodeAt(t+1)===10&&t++,r.push(n+t+1))}return r}function gH(e){return e===13||e===10}function _H(e){let t=e.start,n=e.end;return t.line>n.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function eQe(e){let t=_H(e.range);return t===e.range?e:{newText:e.newText,range:t}}function vH(e){return typeof e.name==`string`}function yH(e){return typeof e.$comment==`string`}function bH(e){return typeof e==`object`&&!!e&&(`$ref`in e||`$error`in e)}function xH(e){return{code:e}}function SH(e){if(e.range)return e.range;let t;return typeof e.property==`string`?t=qz(e.node.$cstNode,e.property,e.index):typeof e.keyword==`string`&&(t=Yz(e.node.$cstNode,e.keyword,e.index)),t??=e.node.$cstNode,t?t.range:{start:{line:0,character:0},end:{line:0,character:0}}}function CH(e){switch(e){case`error`:return 1;case`warning`:return 2;case`info`:return 3;case`hint`:return 4;default:throw Error(`Invalid diagnostic severity: `+e)}}function wH(e){switch(e){case`error`:return xH(wQ.LexingError);case`warning`:return xH(wQ.LexingWarning);case`info`:return xH(wQ.LexingInfo);case`hint`:return xH(wQ.LexingHint);default:throw Error(`Invalid diagnostic severity: `+e)}}function TH(e){return Array.isArray(e)&&(e.length===0||`name`in e[0])}function EH(e){return e&&`modes`in e&&`defaultMode`in e}function DH(e){return!TH(e)&&!EH(e)}function OH(e,t,n){let r,i;typeof e==`string`?(i=t,r=n):(i=e.range.start,r=t),i||=rU.create(0,0);let a=AH(e),o=FH(r);return iQe({index:0,tokens:tQe({lines:a,position:i,options:o}),position:i})}function kH(e,t){let n=FH(t),r=AH(e);if(r.length===0)return!1;let i=r[0],a=r[r.length-1],o=n.start,s=n.end;return!!o?.exec(i)&&!!s?.exec(a)}function AH(e){let t=``;return t=typeof e==`string`?e:e.text,t.split(cG)}function tQe(e){let t=[],n=e.position.line,r=e.position.character;for(let i=0;i<e.lines.length;i++){let a=i===0,o=i===e.lines.length-1,s=e.lines[i],l=0;if(a&&e.options.start){let t=e.options.start?.exec(s);t&&(l=t.index+t[0].length)}else{let t=e.options.line?.exec(s);t&&(l=t.index+t[0].length)}if(o){let t=e.options.end?.exec(s);t&&(s=s.substring(0,t.index))}if(s=s.substring(0,rQe(s)),jH(s,l)>=s.length){if(t.length>0){let e=rU.create(n,r);t.push({type:`break`,content:``,range:iU.create(e,e)})}}else{RQ.lastIndex=l;let e=RQ.exec(s);if(e){let i=e[0],a=e[1],o=rU.create(n,r+l),u=rU.create(n,r+l+i.length);t.push({type:`tag`,content:a,range:iU.create(o,u)}),l+=i.length,l=jH(s,l)}if(l<s.length){let e=s.substring(l),i=Array.from(e.matchAll(Z9e));t.push(...nQe(i,e,n,r+l))}}n++,r=0}return t.length>0&&t[t.length-1].type===`break`?t.slice(0,-1):t}function nQe(e,t,n,r){let i=[];if(e.length===0){let e=rU.create(n,r),a=rU.create(n,r+t.length);i.push({type:`text`,content:t,range:iU.create(e,a)})}else{let a=0;for(let o of e){let e=o.index,s=t.substring(a,e);s.length>0&&i.push({type:`text`,content:t.substring(a,e),range:iU.create(rU.create(n,a+r),rU.create(n,e+r))});let l=s.length+1,u=o[1];if(i.push({type:`inline-tag`,content:u,range:iU.create(rU.create(n,a+l+r),rU.create(n,a+l+u.length+r))}),l+=u.length,o.length===4){l+=o[2].length;let e=o[3];i.push({type:`text`,content:e,range:iU.create(rU.create(n,a+l+r),rU.create(n,a+l+e.length+r))})}else i.push({type:`text`,content:``,range:iU.create(rU.create(n,a+l+r),rU.create(n,a+l+r))});a=e+o[0].length}let o=t.substring(a);o.length>0&&i.push({type:`text`,content:o,range:iU.create(rU.create(n,a+r),rU.create(n,a+r+o.length))})}return i}function jH(e,t){let n=e.substring(t).match(Q9e);return n?t+n.index:e.length}function rQe(e){let t=e.match($9e);if(t&&typeof t.index==`number`)return t.index}function iQe(e){let t=rU.create(e.position.line,e.position.character);if(e.tokens.length===0)return new zQ([],iU.create(t,t));let n=[];for(;e.index<e.tokens.length;){let t=aQe(e,n[n.length-1]);t&&n.push(t)}let r=n[0]?.range.start??t,i=n[n.length-1]?.range.end??t;return new zQ(n,iU.create(r,i))}function aQe(e,t){let n=e.tokens[e.index];if(n.type===`tag`)return NH(e,!1);if(n.type===`text`||n.type===`inline-tag`)return MH(e);oQe(n,t),e.index++}function oQe(e,t){if(t){let n=new HQ(``,e.range);`inlines`in t?t.inlines.push(n):t.content.inlines.push(n)}}function MH(e){let t=e.tokens[e.index],n=t,r=t,i=[];for(;t&&t.type!==`break`&&t.type!==`tag`;)i.push(sQe(e)),r=t,t=e.tokens[e.index];return new VQ(i,iU.create(n.range.start,r.range.end))}function sQe(e){return e.tokens[e.index].type===`inline-tag`?NH(e,!0):PH(e)}function NH(e,t){let n=e.tokens[e.index++],r=n.content.substring(1);if(e.tokens[e.index]?.type===`text`){if(t){let i=PH(e);return new BQ(r,new VQ([i],i.range),t,iU.create(n.range.start,i.range.end))}{let i=MH(e);return new BQ(r,i,t,iU.create(n.range.start,i.range.end))}}{let e=n.range;return new BQ(r,new VQ([],e),t,e)}}function PH(e){let t=e.tokens[e.index++];return new HQ(t.content,t.range)}function FH(e){if(!e)return FH({start:`/**`,end:`*/`,line:`*`});let{start:t,end:n,line:r}=e;return{start:IH(t,!0),end:IH(n,!1),line:IH(r,!0)}}function IH(e,t){if(typeof e==`string`||typeof e==`object`){let n=typeof e==`string`?Lz(e):e.source;return RegExp(t?`^\\s*${n}`:`\\s*${n}\\s*$`)}return e}function cQe(e,t,n){if(e===`linkplain`||e===`linkcode`||e===`link`){let r=t.indexOf(` `),i=t;if(r>0){let e=jH(t,r);i=t.substring(e),t=t.substring(0,r)}return(e===`linkcode`||e===`link`&&n.link===`code`)&&(i=`\`${i}\``),n.renderLink?.(t,i)??lQe(t,i)}}function lQe(e,t){try{return XZ.parse(e,!0),`[${t}](${e})`}catch{return e}}function LH(e){return e.endsWith(`1248+`)?`1249+`:`1250+1251+`}function RH(e){return{documentation:{CommentProvider:Q(e=>new WQ(e),`CommentProvider`),DocumentationProvider:Q(e=>new UQ(e),`DocumentationProvider`)},parser:{AsyncParser:Q(e=>new GQ(e),`AsyncParser`),GrammarConfig:Q(e=>fB(e),`GrammarConfig`),LangiumParser:Q(e=>sH(e),`LangiumParser`),CompletionParser:Q(e=>oH(e),`CompletionParser`),ValueConverter:Q(()=>new VZ,`ValueConverter`),TokenBuilder:Q(()=>new BZ,`TokenBuilder`),Lexer:Q(e=>new LQ(e),`Lexer`),ParserErrorMessageProvider:Q(()=>new LZ,`ParserErrorMessageProvider`),LexerErrorMessageProvider:Q(()=>new FQ,`LexerErrorMessageProvider`)},workspace:{AstNodeLocator:Q(()=>new DQ,`AstNodeLocator`),AstNodeDescriptionProvider:Q(e=>new TQ(e),`AstNodeDescriptionProvider`),ReferenceDescriptionProvider:Q(e=>new EQ(e),`ReferenceDescriptionProvider`)},references:{Linker:Q(e=>new iQ(e),`Linker`),NameProvider:Q(()=>new aQ,`NameProvider`),ScopeProvider:Q(e=>new _Q(e),`ScopeProvider`),ScopeComputation:Q(e=>new lQ(e),`ScopeComputation`),References:Q(e=>new oQ(e),`References`)},serializer:{Hydrator:Q(e=>new qQ(e),`Hydrator`),JsonSerializer:Q(e=>new vQ(e),`JsonSerializer`)},validation:{DocumentValidator:Q(e=>new CQ(e),`DocumentValidator`),ValidationRegistry:Q(e=>new xQ(e),`ValidationRegistry`)},shared:Q(()=>e.shared,`shared`)}}function zH(e){return{ServiceRegistry:Q(e=>new yQ(e),`ServiceRegistry`),workspace:{LangiumDocuments:Q(e=>new nQ(e),`LangiumDocuments`),LangiumDocumentFactory:Q(e=>new tQ(e),`LangiumDocumentFactory`),DocumentBuilder:Q(e=>new MQ(e),`DocumentBuilder`),IndexManager:Q(e=>new NQ(e),`IndexManager`),WorkspaceManager:Q(e=>new PQ(e),`WorkspaceManager`),FileSystemProvider:Q(t=>e.fileSystemProvider(t),`FileSystemProvider`),WorkspaceLock:Q(()=>new KQ,`WorkspaceLock`),ConfigurationProvider:Q(e=>new kQ(e),`ConfigurationProvider`)},profilers:{}}}function BH(e,t,n,r,i,a,o,s,l){return HH([e,t,n,r,i,a,o,s,l].reduce(WH,{}))}function VH(e){if(e&&e[JQ])for(let t of Object.values(e))VH(t);return e}function HH(e,t){let n=new Proxy({},{deleteProperty:Q(()=>!1,`deleteProperty`),set:Q(()=>{throw Error(`Cannot set property on injected service container`)},`set`),get:Q((r,i)=>i===JQ||UH(r,i,e,t||n),`get`),getOwnPropertyDescriptor:Q((r,i)=>(UH(r,i,e,t||n),Object.getOwnPropertyDescriptor(r,i)),`getOwnPropertyDescriptor`),has:Q((t,n)=>n in e,`has`),ownKeys:Q(()=>[...Object.getOwnPropertyNames(e)],`ownKeys`)});return n}function UH(e,t,n,r){if(t in e){if(e[t]instanceof Error)throw Error(`Construction failure. Please make sure that your dependencies are constructable. Cause: `+e[t]);if(e[t]===YQ)throw Error(`Cycle detected. Please make "`+String(t)+`" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies`);return e[t]}if(t in n){let i=n[t];e[t]=YQ;try{e[t]=typeof i==`function`?i(r):HH(i,r)}catch(n){throw e[t]=n instanceof Error?n:void 0,n}return e[t]}}function WH(e,t){if(t){for(let[n,r]of Object.entries(t))if(r!=null){if(typeof r==`object`){let t=e[n];e[n]=WH(typeof t==`object`&&t?t:{},r)}else e[n]=r}}return e}function uQe(){let e=BH(zH(t$),aet),t=BH(RH({shared:e}),iet);return e.ServiceRegistry.register(t),t}function GH(e){let t=uQe(),n=t.serializer.JsonSerializer.deserialize(e);return t.shared.workspace.LangiumDocumentFactory.fromModel(n,XZ.parse(`memory:/${n.name??`grammar`}.langium`)),n}function dQe(e){return l0.isInstance(e,v$.$type)}function fQe(e){return l0.isInstance(e,b$.$type)}function pQe(e){return l0.isInstance(e,w$.$type)}function mQe(e){return l0.isInstance(e,O$.$type)}function hQe(e){return l0.isInstance(e,M$.$type)}function gQe(e){return l0.isInstance(e,N$.$type)}function _Qe(e){return e===`rmo`||e===`readmodel`||e===`ui`||e===`cmd`||e===`command`||e===`evt`||e===`event`||e===`pcr`||e===`processor`}function vQe(e){return l0.isInstance(e,r1.$type)}function yQe(e){return l0.isInstance(e,u1.$type)}function bQe(e){return l0.isInstance(e,f1.$type)}function xQe(e){return l0.isInstance(e,v1.$type)}function SQe(e){return l0.isInstance(e,x1.$type)}function CQe(e){return l0.isInstance(e,S1.$type)}function wQe(e){return l0.isInstance(e,N1.$type)}function TQe(e){return l0.isInstance(e,P1.$type)}function EQe(e){return l0.isInstance(e,R1.$type)}function DQe(e){return l0.isInstance(e,z1.$type)}function OQe(e){return l0.isInstance(e,V1.$type)}function kQe(e){return l0.isInstance(e,K1.$type)}function AQe(e){return l0.isInstance(e,n0.$type)}function jQe(e){return l0.isInstance(e,r0.$type)}function MQe(e){return l0.isInstance(e,s0.$type)}var NQe,KH,PQe,qH,FQe,IQe,Q,LQe,JH,YH,XH,ZH,QH,$H,eU,RQe,tU,zQe,nU,rU,iU,aU,BQe,oU,VQe,HQe,UQe,WQe,sU,GQe,KQe,qQe,cU,lU,uU,dU,fU,pU,mU,hU,gU,_U,vU,yU,bU,JQe,YQe,XQe,xU,ZQe,SU,CU,QQe,$Qe,e$e,t$e,n$e,r$e,i$e,a$e,wU,o$e,s$e,c$e,l$e,u$e,d$e,f$e,p$e,m$e,h$e,g$e,TU,_$e,v$e,y$e,b$e,x$e,S$e,C$e,w$e,T$e,E$e,D$e,O$e,k$e,EU,DU,A$e,j$e,M$e,N$e,P$e,F$e,I$e,L$e,R$e,z$e,B$e,OU,kU,AU,jU,MU,NU,PU,FU,V$e,H$e,IU,U$e,W$e,G$e,K$e,LU,q$e,RU,zU,BU,VU,J$e,Y$e,X$e,Z$e,Q$e,$$e,e1e,t1e,n1e,r1e,i1e,a1e,o1e,s1e,c1e,l1e,u1e,d1e,f1e,p1e,m1e,h1e,g1e,_1e,v1e,HU,UU,WU,GU,KU,qU,JU,YU,XU,ZU,y1e,QU,$U,eW,tW,nW,rW,iW,aW,oW,sW,cW,lW,uW,dW,fW,pW,mW,hW,gW,_W,vW,yW,bW,xW,SW,CW,wW,TW,EW,DW,OW,kW,AW,jW,MW,NW,PW,FW,IW,LW,RW,zW,BW,VW,HW,UW,WW,GW,KW,qW,JW,YW,XW,ZW,QW,$W,eG,tG,nG,rG,iG,b1e,aG,x1e,oG,sG,cG,lG,S1e,uG,dG,fG,pG,C1e,mG,hG,gG,w1e,T1e,_G,E1e,D1e,O1e,k1e,A1e,vG,yG,bG,j1e,xG,SG,CG,M1e,wG,TG,N1e,P1e,F1e,I1e,L1e,EG,DG,R1e,z1e,B1e,V1e,H1e,OG,U1e,W1e,kG,AG,G1e,K1e,q1e,J1e,jG,MG,NG,Y1e,X1e,PG,Z1e,Q1e,$1e,e0e,t0e,n0e,r0e,i0e,a0e,FG,IG,LG,o0e,s0e,RG,c0e,l0e,u0e,d0e,f0e,p0e,zG,m0e,BG,VG,h0e,g0e,HG,UG,_0e,v0e,WG,GG,KG,y0e,qG,JG,YG,b0e,XG,x0e,ZG,QG,$G,S0e,C0e,eK,w0e,T0e,tK,nK,E0e,D0e,rK,O0e,iK,aK,oK,sK,k0e,A0e,j0e,M0e,N0e,P0e,F0e,I0e,L0e,R0e,z0e,B0e,V0e,H0e,U0e,W0e,G0e,K0e,q0e,J0e,Y0e,X0e,Z0e,Q0e,cK,$0e,lK,uK,dK,fK,pK,mK,hK,e2e,gK,_K,t2e,n2e,vK,yK,r2e,bK,i2e,a2e,o2e,xK,s2e,c2e,SK,CK,l2e,u2e,d2e,f2e,p2e,m2e,h2e,g2e,_2e,wK,v2e,TK,y2e,b2e,x2e,S2e,C2e,EK,DK,w2e,T2e,OK,E2e,D2e,O2e,k2e,kK,A2e,j2e,M2e,N2e,P2e,F2e,I2e,L2e,AK,R2e,jK,MK,z2e,NK,PK,B2e,FK,IK,LK,RK,V2e,H2e,U2e,W2e,G2e,K2e,q2e,zK,J2e,Y2e,BK,VK,HK,UK,X2e,WK,GK,Z2e,KK,qK,Q2e,JK,$2e,YK,XK,ZK,QK,$K,eq,tq,e4e,nq,rq,iq,aq,t4e,n4e,r4e,i4e,a4e,oq,sq,o4e,s4e,cq,lq,c4e,l4e,u4e,uq,dq,d4e,f4e,p4e,m4e,h4e,g4e,_4e,v4e,y4e,b4e,x4e,S4e,C4e,w4e,T4e,E4e,D4e,O4e,k4e,A4e,j4e,M4e,N4e,P4e,F4e,fq,I4e,L4e,R4e,pq,z4e,B4e,V4e,H4e,mq,U4e,W4e,G4e,K4e,hq,q4e,J4e,Y4e,gq,X4e,Z4e,Q4e,$4e,e3e,t3e,n3e,r3e,i3e,a3e,o3e,s3e,c3e,l3e,u3e,d3e,_q,f3e,p3e,vq,yq,m3e,h3e,g3e,bq,xq,Sq,_3e,v3e,Cq,y3e,wq,b3e,x3e,S3e,C3e,w3e,T3e,E3e,D3e,O3e,k3e,A3e,j3e,M3e,Tq,Eq,N3e,P3e,F3e,I3e,L3e,Dq,Oq,kq,Aq,R3e,jq,z3e,B3e,V3e,Mq,H3e,Nq,U3e,W3e,Pq,G3e,K3e,q3e,J3e,Y3e,X3e,Z3e,Fq,Q3e,$3e,e6e,Iq,t6e,n6e,Lq,r6e,Rq,zq,Bq,i6e,a6e,Vq,Hq,Uq,Wq,o6e,Gq,s6e,c6e,Kq,qq,Jq,l6e,u6e,Yq,Xq,d6e,Zq,Qq,f6e,p6e,m6e,h6e,$q,g6e,eJ,_6e,tJ,v6e,nJ,y6e,rJ,b6e,x6e,S6e,iJ,C6e,w6e,aJ,oJ,sJ,T6e,E6e,D6e,O6e,cJ,k6e,lJ,uJ,A6e,dJ,j6e,M6e,N6e,fJ,pJ,mJ,hJ,gJ,_J,vJ,yJ,bJ,xJ,SJ,CJ,wJ,TJ,EJ,P6e,DJ,F6e,OJ,kJ,I6e,AJ,jJ,MJ,L6e,R6e,z6e,NJ,PJ,FJ,IJ,LJ,RJ,zJ,BJ,B6e,VJ,HJ,UJ,WJ,GJ,KJ,qJ,JJ,YJ,XJ,V6e,ZJ,H6e,U6e,W6e,QJ,G6e,$J,K6e,eY,tY,q6e,nY,J6e,rY,Y6e,iY,aY,oY,sY,cY,lY,uY,X6e,Z6e,Q6e,dY,fY,$6e,e8e,t8e,pY,n8e,mY,hY,gY,_Y,vY,yY,bY,r8e,i8e,xY,a8e,o8e,s8e,c8e,l8e,u8e,d8e,f8e,SY,CY,wY,TY,EY,p8e,m8e,h8e,DY,OY,kY,AY,jY,g8e,MY,_8e,NY,PY,v8e,y8e,b8e,x8e,S8e,FY,C8e,w8e,T8e,E8e,IY,D8e,LY,RY,zY,O8e,k8e,BY,A8e,j8e,M8e,N8e,P8e,VY,HY,UY,F8e,I8e,L8e,R8e,WY,GY,KY,z8e,B8e,qY,V8e,H8e,U8e,W8e,G8e,K8e,q8e,J8e,Y8e,JY,YY,XY,X8e,Z8e,Q8e,$8e,e5e,t5e,n5e,r5e,i5e,ZY,a5e,o5e,QY,s5e,c5e,l5e,u5e,$Y,d5e,f5e,eX,p5e,m5e,h5e,tX,g5e,nX,_5e,v5e,rX,iX,y5e,aX,b5e,x5e,S5e,C5e,w5e,T5e,E5e,D5e,O5e,k5e,A5e,j5e,M5e,oX,sX,N5e,cX,lX,P5e,uX,F5e,I5e,dX,L5e,R5e,fX,z5e,pX,mX,B5e,V5e,hX,H5e,gX,_X,vX,yX,U5e,W5e,bX,G5e,xX,K5e,q5e,J5e,Y5e,X5e,Z5e,Q5e,$5e,e7e,t7e,n7e,r7e,i7e,a7e,o7e,s7e,c7e,l7e,u7e,d7e,f7e,p7e,m7e,h7e,SX,g7e,_7e,CX,wX,TX,EX,DX,OX,v7e,y7e,b7e,kX,x7e,S7e,AX,jX,MX,NX,C7e,w7e,T7e,PX,FX,IX,LX,RX,E7e,zX,BX,VX,HX,D7e,O7e,k7e,A7e,j7e,UX,WX,M7e,GX,KX,qX,JX,N7e,YX,P7e,F7e,I7e,XX,L7e,ZX,R7e,z7e,QX,B7e,V7e,$X,H7e,U7e,W7e,G7e,K7e,q7e,J7e,Y7e,eZ,tZ,X7e,Z7e,nZ,Q7e,rZ,iZ,$7e,e9e,t9e,n9e,r9e,i9e,a9e,aZ,o9e,s9e,c9e,oZ,l9e,u9e,sZ,d9e,cZ,f9e,p9e,lZ,m9e,uZ,dZ,fZ,h9e,g9e,_9e,v9e,pZ,mZ,hZ,gZ,_Z,vZ,yZ,y9e,b9e,x9e,bZ,S9e,xZ,C9e,w9e,T9e,E9e,D9e,O9e,k9e,A9e,j9e,M9e,N9e,P9e,F9e,I9e,L9e,SZ,R9e,z9e,B9e,V9e,H9e,U9e,CZ,wZ,TZ,W9e,EZ,DZ,OZ,kZ,G9e,AZ,jZ,MZ,NZ,PZ,FZ,IZ,LZ,RZ,K9e,zZ,q9e,BZ,VZ,HZ,UZ,WZ,GZ,KZ,qZ,JZ,YZ,J9e,XZ,ZZ,QZ,$Z,eQ,tQ,nQ,rQ,iQ,aQ,oQ,sQ,cQ,lQ,uQ,Y9e,dQ,X9e,fQ,pQ,mQ,hQ,gQ,_Q,vQ,yQ,bQ,xQ,SQ,CQ,wQ,TQ,EQ,DQ,OQ,kQ,AQ,jQ,MQ,NQ,PQ,FQ,IQ,LQ,RQ,Z9e,Q9e,$9e,zQ,BQ,VQ,HQ,UQ,WQ,GQ,eet,tet,KQ,qQ,net,JQ,YQ,XQ,ZQ,QQ,ret,$Q,e$,t$,iet,aet,oet,n$,set,cet,uet,det,fet,pet,met,het,get,_et,vet,yet,bet,xet,Cet,r$,i$,a$,o$,s$,c$,l$,u$,d$,f$,p$,m$,h$,g$,_$,v$,y$,b$,x$,S$,C$,w$,T$,E$,D$,O$,k$,A$,j$,M$,N$,P$,F$,I$,L$,R$,z$,B$,V$,H$,U$,W$,G$,K$,q$,J$,Y$,X$,Z$,Q$,$$,e1,t1,n1,r1,i1,a1,o1,s1,c1,l1,u1,d1,f1,p1,m1,h1,g1,_1,v1,y1,b1,x1,S1,C1,w1,T1,E1,D1,O1,k1,A1,j1,M1,N1,P1,F1,I1,L1,R1,z1,B1,V1,H1,U1,W1,G1,K1,q1,J1,Y1,X1,Z1,Q1,$1,e0,t0,n0,r0,i0,a0,o0,s0,c0,l0,wet,Tet,Eet,Det,Oet,ket,Aet,jet,Met,Net,Pet,Fet,Iet,Let,Ret,zet,Bet,Vet,Het,Uet,Wet,Get,Ket,qet,Jet,Yet,Xet,Zet,Qet,$et,ett,ttt,ntt,rtt,itt,att,ott,stt,ctt,ltt,utt,dtt,ftt,ptt,mtt,u0,htt,gtt,_tt,vtt,ytt,btt,xtt,Stt,Ctt,wtt,Ttt,Ett,Dtt,Ott,ktt,Att,d0,f0,p0,m0=o((()=>{NQe=Object.create,KH=Object.defineProperty,PQe=Object.getOwnPropertyDescriptor,qH=Object.getOwnPropertyNames,FQe=Object.getPrototypeOf,IQe=Object.prototype.hasOwnProperty,Q=(e,t)=>KH(e,`name`,{value:t,configurable:!0}),LQe=(e,t)=>function(){return e&&(t=(0,e[qH(e)[0]])(e=0)),t},JH=(e,t)=>function(){return t||(0,e[qH(e)[0]])((t={exports:{}}).exports,t),t.exports},YH=(e,t)=>{for(var n in t)KH(e,n,{get:t[n],enumerable:!0})},XH=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of qH(t))!IQe.call(e,i)&&i!==n&&KH(e,i,{get:()=>t[i],enumerable:!(r=PQe(t,i))||r.enumerable});return e},ZH=(e,t,n)=>(XH(e,t,`default`),n&&XH(n,t,`default`)),QH=(e,t,n)=>(n=e==null?{}:NQe(FQe(e)),XH(t||!e||!e.__esModule?KH(n,`default`,{value:e,enumerable:!0}):n,e)),$H=e=>XH(KH({},`__esModule`,{value:!0}),e),eU={},YH(eU,{AnnotatedTextEdit:()=>pU,ChangeAnnotation:()=>dU,ChangeAnnotationIdentifier:()=>fU,CodeAction:()=>v$e,CodeActionContext:()=>_$e,CodeActionKind:()=>g$e,CodeActionTriggerKind:()=>TU,CodeDescription:()=>qQe,CodeLens:()=>y$e,Color:()=>oU,ColorInformation:()=>VQe,ColorPresentation:()=>HQe,Command:()=>lU,CompletionItem:()=>i$e,CompletionItemKind:()=>QQe,CompletionItemLabelDetails:()=>r$e,CompletionItemTag:()=>e$e,CompletionList:()=>a$e,CreateFile:()=>hU,DeleteFile:()=>_U,Diagnostic:()=>cU,DiagnosticRelatedInformation:()=>sU,DiagnosticSeverity:()=>GQe,DiagnosticTag:()=>KQe,DocumentHighlight:()=>u$e,DocumentHighlightKind:()=>l$e,DocumentLink:()=>x$e,DocumentSymbol:()=>h$e,DocumentUri:()=>RQe,EOL:()=>R$e,FoldingRange:()=>WQe,FoldingRangeKind:()=>UQe,FormattingOptions:()=>b$e,Hover:()=>o$e,InlayHint:()=>A$e,InlayHintKind:()=>EU,InlayHintLabelPart:()=>DU,InlineCompletionContext:()=>I$e,InlineCompletionItem:()=>M$e,InlineCompletionList:()=>N$e,InlineCompletionTriggerKind:()=>P$e,InlineValueContext:()=>k$e,InlineValueEvaluatableExpression:()=>O$e,InlineValueText:()=>E$e,InlineValueVariableLookup:()=>D$e,InsertReplaceEdit:()=>t$e,InsertTextFormat:()=>$Qe,InsertTextMode:()=>n$e,Location:()=>aU,LocationLink:()=>BQe,MarkedString:()=>wU,MarkupContent:()=>CU,MarkupKind:()=>SU,OptionalVersionedTextDocumentIdentifier:()=>xU,ParameterInformation:()=>s$e,Position:()=>rU,Range:()=>iU,RenameFile:()=>gU,SelectedCompletionInfo:()=>F$e,SelectionRange:()=>S$e,SemanticTokenModifiers:()=>w$e,SemanticTokenTypes:()=>C$e,SemanticTokens:()=>T$e,SignatureInformation:()=>c$e,StringValue:()=>j$e,SymbolInformation:()=>p$e,SymbolKind:()=>d$e,SymbolTag:()=>f$e,TextDocument:()=>z$e,TextDocumentEdit:()=>mU,TextDocumentIdentifier:()=>YQe,TextDocumentItem:()=>ZQe,TextEdit:()=>uU,URI:()=>tU,VersionedTextDocumentIdentifier:()=>XQe,WorkspaceChange:()=>JQe,WorkspaceEdit:()=>vU,WorkspaceFolder:()=>L$e,WorkspaceSymbol:()=>m$e,integer:()=>zQe,uinteger:()=>nU}),kU=LQe({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){"use strict";(function(e){function t(e){return typeof e==`string`}Q(t,`is`),e.is=t})(RQe||={}),(function(e){function t(e){return typeof e==`string`}Q(t,`is`),e.is=t})(tU||={}),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(t){return typeof t==`number`&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}Q(t,`is`),e.is=t})(zQe||={}),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(t){return typeof t==`number`&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}Q(t,`is`),e.is=t})(nU||={}),(function(e){function t(e,t){return e===Number.MAX_VALUE&&(e=nU.MAX_VALUE),t===Number.MAX_VALUE&&(t=nU.MAX_VALUE),{line:e,character:t}}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.objectLiteral(t)&&OU.uinteger(t.line)&&OU.uinteger(t.character)}Q(n,`is`),e.is=n})(rU||={}),(function(e){function t(e,t,n,r){if(OU.uinteger(e)&&OU.uinteger(t)&&OU.uinteger(n)&&OU.uinteger(r))return{start:rU.create(e,t),end:rU.create(n,r)};if(rU.is(e)&&rU.is(t))return{start:e,end:t};throw Error(`Range#create called with invalid arguments[${e}, ${t}, ${n}, ${r}]`)}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.objectLiteral(t)&&rU.is(t.start)&&rU.is(t.end)}Q(n,`is`),e.is=n})(iU||={}),(function(e){function t(e,t){return{uri:e,range:t}}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.objectLiteral(t)&&iU.is(t.range)&&(OU.string(t.uri)||OU.undefined(t.uri))}Q(n,`is`),e.is=n})(aU||={}),(function(e){function t(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.objectLiteral(t)&&iU.is(t.targetRange)&&OU.string(t.targetUri)&&iU.is(t.targetSelectionRange)&&(iU.is(t.originSelectionRange)||OU.undefined(t.originSelectionRange))}Q(n,`is`),e.is=n})(BQe||={}),(function(e){function t(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.objectLiteral(t)&&OU.numberRange(t.red,0,1)&&OU.numberRange(t.green,0,1)&&OU.numberRange(t.blue,0,1)&&OU.numberRange(t.alpha,0,1)}Q(n,`is`),e.is=n})(oU||={}),(function(e){function t(e,t){return{range:e,color:t}}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.objectLiteral(t)&&iU.is(t.range)&&oU.is(t.color)}Q(n,`is`),e.is=n})(VQe||={}),(function(e){function t(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.objectLiteral(t)&&OU.string(t.label)&&(OU.undefined(t.textEdit)||uU.is(t))&&(OU.undefined(t.additionalTextEdits)||OU.typedArray(t.additionalTextEdits,uU.is))}Q(n,`is`),e.is=n})(HQe||={}),(function(e){e.Comment=`comment`,e.Imports=`imports`,e.Region=`region`})(UQe||={}),(function(e){function t(e,t,n,r,i,a){let o={startLine:e,endLine:t};return OU.defined(n)&&(o.startCharacter=n),OU.defined(r)&&(o.endCharacter=r),OU.defined(i)&&(o.kind=i),OU.defined(a)&&(o.collapsedText=a),o}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.objectLiteral(t)&&OU.uinteger(t.startLine)&&OU.uinteger(t.startLine)&&(OU.undefined(t.startCharacter)||OU.uinteger(t.startCharacter))&&(OU.undefined(t.endCharacter)||OU.uinteger(t.endCharacter))&&(OU.undefined(t.kind)||OU.string(t.kind))}Q(n,`is`),e.is=n})(WQe||={}),(function(e){function t(e,t){return{location:e,message:t}}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.defined(t)&&aU.is(t.location)&&OU.string(t.message)}Q(n,`is`),e.is=n})(sU||={}),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(GQe||={}),(function(e){e.Unnecessary=1,e.Deprecated=2})(KQe||={}),(function(e){function t(e){let t=e;return OU.objectLiteral(t)&&OU.string(t.href)}Q(t,`is`),e.is=t})(qQe||={}),(function(e){function t(e,t,n,r,i,a){let o={range:e,message:t};return OU.defined(n)&&(o.severity=n),OU.defined(r)&&(o.code=r),OU.defined(i)&&(o.source=i),OU.defined(a)&&(o.relatedInformation=a),o}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.defined(t)&&iU.is(t.range)&&OU.string(t.message)&&(OU.number(t.severity)||OU.undefined(t.severity))&&(OU.integer(t.code)||OU.string(t.code)||OU.undefined(t.code))&&(OU.undefined(t.codeDescription)||OU.string(t.codeDescription?.href))&&(OU.string(t.source)||OU.undefined(t.source))&&(OU.undefined(t.relatedInformation)||OU.typedArray(t.relatedInformation,sU.is))}Q(n,`is`),e.is=n})(cU||={}),(function(e){function t(e,t,...n){let r={title:e,command:t};return OU.defined(n)&&n.length>0&&(r.arguments=n),r}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.defined(t)&&OU.string(t.title)&&OU.string(t.command)}Q(n,`is`),e.is=n})(lU||={}),(function(e){function t(e,t){return{range:e,newText:t}}Q(t,`replace`),e.replace=t;function n(e,t){return{range:{start:e,end:e},newText:t}}Q(n,`insert`),e.insert=n;function r(e){return{range:e,newText:``}}Q(r,`del`),e.del=r;function i(e){let t=e;return OU.objectLiteral(t)&&OU.string(t.newText)&&iU.is(t.range)}Q(i,`is`),e.is=i})(uU||={}),(function(e){function t(e,t,n){let r={label:e};return t!==void 0&&(r.needsConfirmation=t),n!==void 0&&(r.description=n),r}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.objectLiteral(t)&&OU.string(t.label)&&(OU.boolean(t.needsConfirmation)||t.needsConfirmation===void 0)&&(OU.string(t.description)||t.description===void 0)}Q(n,`is`),e.is=n})(dU||={}),(function(e){function t(e){let t=e;return OU.string(t)}Q(t,`is`),e.is=t})(fU||={}),(function(e){function t(e,t,n){return{range:e,newText:t,annotationId:n}}Q(t,`replace`),e.replace=t;function n(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}}Q(n,`insert`),e.insert=n;function r(e,t){return{range:e,newText:``,annotationId:t}}Q(r,`del`),e.del=r;function i(e){let t=e;return uU.is(t)&&(dU.is(t.annotationId)||fU.is(t.annotationId))}Q(i,`is`),e.is=i})(pU||={}),(function(e){function t(e,t){return{textDocument:e,edits:t}}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.defined(t)&&xU.is(t.textDocument)&&Array.isArray(t.edits)}Q(n,`is`),e.is=n})(mU||={}),(function(e){function t(e,t,n){let r={kind:`create`,uri:e};return t!==void 0&&(t.overwrite!==void 0||t.ignoreIfExists!==void 0)&&(r.options=t),n!==void 0&&(r.annotationId=n),r}Q(t,`create`),e.create=t;function n(e){let t=e;return t&&t.kind===`create`&&OU.string(t.uri)&&(t.options===void 0||(t.options.overwrite===void 0||OU.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||OU.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||fU.is(t.annotationId))}Q(n,`is`),e.is=n})(hU||={}),(function(e){function t(e,t,n,r){let i={kind:`rename`,oldUri:e,newUri:t};return n!==void 0&&(n.overwrite!==void 0||n.ignoreIfExists!==void 0)&&(i.options=n),r!==void 0&&(i.annotationId=r),i}Q(t,`create`),e.create=t;function n(e){let t=e;return t&&t.kind===`rename`&&OU.string(t.oldUri)&&OU.string(t.newUri)&&(t.options===void 0||(t.options.overwrite===void 0||OU.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||OU.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||fU.is(t.annotationId))}Q(n,`is`),e.is=n})(gU||={}),(function(e){function t(e,t,n){let r={kind:`delete`,uri:e};return t!==void 0&&(t.recursive!==void 0||t.ignoreIfNotExists!==void 0)&&(r.options=t),n!==void 0&&(r.annotationId=n),r}Q(t,`create`),e.create=t;function n(e){let t=e;return t&&t.kind===`delete`&&OU.string(t.uri)&&(t.options===void 0||(t.options.recursive===void 0||OU.boolean(t.options.recursive))&&(t.options.ignoreIfNotExists===void 0||OU.boolean(t.options.ignoreIfNotExists)))&&(t.annotationId===void 0||fU.is(t.annotationId))}Q(n,`is`),e.is=n})(_U||={}),(function(e){function t(e){let t=e;return t&&(t.changes!==void 0||t.documentChanges!==void 0)&&(t.documentChanges===void 0||t.documentChanges.every(e=>OU.string(e.kind)?hU.is(e)||gU.is(e)||_U.is(e):mU.is(e)))}Q(t,`is`),e.is=t})(vU||={}),yU=class{static{Q(this,`TextEditChangeImpl`)}constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,n){let r,i;if(n===void 0?r=uU.insert(e,t):fU.is(n)?(i=n,r=pU.insert(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=pU.insert(e,t,i)),this.edits.push(r),i!==void 0)return i}replace(e,t,n){let r,i;if(n===void 0?r=uU.replace(e,t):fU.is(n)?(i=n,r=pU.replace(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=pU.replace(e,t,i)),this.edits.push(r),i!==void 0)return i}delete(e,t){let n,r;if(t===void 0?n=uU.del(e):fU.is(t)?(r=t,n=pU.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(t),n=pU.del(e,r)),this.edits.push(n),r!==void 0)return r}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw Error(`Text edit change is not configured to manage change annotations.`)}},bU=class{static{Q(this,`ChangeAnnotations`)}constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let n;if(fU.is(e)?n=e:(n=this.nextId(),t=e),this._annotations[n]!==void 0)throw Error(`Id ${n} is already in use.`);if(t===void 0)throw Error(`No annotation provided for id ${n}`);return this._annotations[n]=t,this._size++,n}nextId(){return this._counter++,this._counter.toString()}},JQe=class{static{Q(this,`WorkspaceChange`)}constructor(e){this._textEditChanges=Object.create(null),e===void 0?this._workspaceEdit={}:(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new bU(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(e=>{if(mU.is(e)){let t=new yU(e.edits,this._changeAnnotations);this._textEditChanges[e.textDocument.uri]=t}})):e.changes&&Object.keys(e.changes).forEach(t=>{let n=new yU(e.changes[t]);this._textEditChanges[t]=n}))}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(xU.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error(`Workspace edit is not configured for document changes.`);let t={uri:e.uri,version:e.version},n=this._textEditChanges[t.uri];if(!n){let e=[],r={textDocument:t,edits:e};this._workspaceEdit.documentChanges.push(r),n=new yU(e,this._changeAnnotations),this._textEditChanges[t.uri]=n}return n}{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw Error(`Workspace edit is not configured for normal text edit changes.`);let t=this._textEditChanges[e];if(!t){let n=[];this._workspaceEdit.changes[e]=n,t=new yU(n),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new bU,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error(`Workspace edit is not configured for document changes.`);let r;dU.is(t)||fU.is(t)?r=t:n=t;let i,a;if(r===void 0?i=hU.create(e,n):(a=fU.is(r)?r:this._changeAnnotations.manage(r),i=hU.create(e,n,a)),this._workspaceEdit.documentChanges.push(i),a!==void 0)return a}renameFile(e,t,n,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error(`Workspace edit is not configured for document changes.`);let i;dU.is(n)||fU.is(n)?i=n:r=n;let a,o;if(i===void 0?a=gU.create(e,t,r):(o=fU.is(i)?i:this._changeAnnotations.manage(i),a=gU.create(e,t,r,o)),this._workspaceEdit.documentChanges.push(a),o!==void 0)return o}deleteFile(e,t,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error(`Workspace edit is not configured for document changes.`);let r;dU.is(t)||fU.is(t)?r=t:n=t;let i,a;if(r===void 0?i=_U.create(e,n):(a=fU.is(r)?r:this._changeAnnotations.manage(r),i=_U.create(e,n,a)),this._workspaceEdit.documentChanges.push(i),a!==void 0)return a}},(function(e){function t(e){return{uri:e}}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.defined(t)&&OU.string(t.uri)}Q(n,`is`),e.is=n})(YQe||={}),(function(e){function t(e,t){return{uri:e,version:t}}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.defined(t)&&OU.string(t.uri)&&OU.integer(t.version)}Q(n,`is`),e.is=n})(XQe||={}),(function(e){function t(e,t){return{uri:e,version:t}}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.defined(t)&&OU.string(t.uri)&&(t.version===null||OU.integer(t.version))}Q(n,`is`),e.is=n})(xU||={}),(function(e){function t(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.defined(t)&&OU.string(t.uri)&&OU.string(t.languageId)&&OU.integer(t.version)&&OU.string(t.text)}Q(n,`is`),e.is=n})(ZQe||={}),(function(e){e.PlainText=`plaintext`,e.Markdown=`markdown`;function t(t){let n=t;return n===e.PlainText||n===e.Markdown}Q(t,`is`),e.is=t})(SU||={}),(function(e){function t(e){let t=e;return OU.objectLiteral(e)&&SU.is(t.kind)&&OU.string(t.value)}Q(t,`is`),e.is=t})(CU||={}),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(QQe||={}),(function(e){e.PlainText=1,e.Snippet=2})($Qe||={}),(function(e){e.Deprecated=1})(e$e||={}),(function(e){function t(e,t,n){return{newText:e,insert:t,replace:n}}Q(t,`create`),e.create=t;function n(e){let t=e;return t&&OU.string(t.newText)&&iU.is(t.insert)&&iU.is(t.replace)}Q(n,`is`),e.is=n})(t$e||={}),(function(e){e.asIs=1,e.adjustIndentation=2})(n$e||={}),(function(e){function t(e){let t=e;return t&&(OU.string(t.detail)||t.detail===void 0)&&(OU.string(t.description)||t.description===void 0)}Q(t,`is`),e.is=t})(r$e||={}),(function(e){function t(e){return{label:e}}Q(t,`create`),e.create=t})(i$e||={}),(function(e){function t(e,t){return{items:e||[],isIncomplete:!!t}}Q(t,`create`),e.create=t})(a$e||={}),(function(e){function t(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,`\\$&`)}Q(t,`fromPlainText`),e.fromPlainText=t;function n(e){let t=e;return OU.string(t)||OU.objectLiteral(t)&&OU.string(t.language)&&OU.string(t.value)}Q(n,`is`),e.is=n})(wU||={}),(function(e){function t(e){let t=e;return!!t&&OU.objectLiteral(t)&&(CU.is(t.contents)||wU.is(t.contents)||OU.typedArray(t.contents,wU.is))&&(e.range===void 0||iU.is(e.range))}Q(t,`is`),e.is=t})(o$e||={}),(function(e){function t(e,t){return t?{label:e,documentation:t}:{label:e}}Q(t,`create`),e.create=t})(s$e||={}),(function(e){function t(e,t,...n){let r={label:e};return OU.defined(t)&&(r.documentation=t),r.parameters=OU.defined(n)?n:[],r}Q(t,`create`),e.create=t})(c$e||={}),(function(e){e.Text=1,e.Read=2,e.Write=3})(l$e||={}),(function(e){function t(e,t){let n={range:e};return OU.number(t)&&(n.kind=t),n}Q(t,`create`),e.create=t})(u$e||={}),(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(d$e||={}),(function(e){e.Deprecated=1})(f$e||={}),(function(e){function t(e,t,n,r,i){let a={name:e,kind:t,location:{uri:r,range:n}};return i&&(a.containerName=i),a}Q(t,`create`),e.create=t})(p$e||={}),(function(e){function t(e,t,n,r){return r===void 0?{name:e,kind:t,location:{uri:n}}:{name:e,kind:t,location:{uri:n,range:r}}}Q(t,`create`),e.create=t})(m$e||={}),(function(e){function t(e,t,n,r,i,a){let o={name:e,detail:t,kind:n,range:r,selectionRange:i};return a!==void 0&&(o.children=a),o}Q(t,`create`),e.create=t;function n(e){let t=e;return t&&OU.string(t.name)&&OU.number(t.kind)&&iU.is(t.range)&&iU.is(t.selectionRange)&&(t.detail===void 0||OU.string(t.detail))&&(t.deprecated===void 0||OU.boolean(t.deprecated))&&(t.children===void 0||Array.isArray(t.children))&&(t.tags===void 0||Array.isArray(t.tags))}Q(n,`is`),e.is=n})(h$e||={}),(function(e){e.Empty=``,e.QuickFix=`quickfix`,e.Refactor=`refactor`,e.RefactorExtract=`refactor.extract`,e.RefactorInline=`refactor.inline`,e.RefactorRewrite=`refactor.rewrite`,e.Source=`source`,e.SourceOrganizeImports=`source.organizeImports`,e.SourceFixAll=`source.fixAll`})(g$e||={}),(function(e){e.Invoked=1,e.Automatic=2})(TU||={}),(function(e){function t(e,t,n){let r={diagnostics:e};return t!=null&&(r.only=t),n!=null&&(r.triggerKind=n),r}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.defined(t)&&OU.typedArray(t.diagnostics,cU.is)&&(t.only===void 0||OU.typedArray(t.only,OU.string))&&(t.triggerKind===void 0||t.triggerKind===TU.Invoked||t.triggerKind===TU.Automatic)}Q(n,`is`),e.is=n})(_$e||={}),(function(e){function t(e,t,n){let r={title:e},i=!0;return typeof t==`string`?(i=!1,r.kind=t):lU.is(t)?r.command=t:r.edit=t,i&&n!==void 0&&(r.kind=n),r}Q(t,`create`),e.create=t;function n(e){let t=e;return t&&OU.string(t.title)&&(t.diagnostics===void 0||OU.typedArray(t.diagnostics,cU.is))&&(t.kind===void 0||OU.string(t.kind))&&(t.edit!==void 0||t.command!==void 0)&&(t.command===void 0||lU.is(t.command))&&(t.isPreferred===void 0||OU.boolean(t.isPreferred))&&(t.edit===void 0||vU.is(t.edit))}Q(n,`is`),e.is=n})(v$e||={}),(function(e){function t(e,t){let n={range:e};return OU.defined(t)&&(n.data=t),n}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.defined(t)&&iU.is(t.range)&&(OU.undefined(t.command)||lU.is(t.command))}Q(n,`is`),e.is=n})(y$e||={}),(function(e){function t(e,t){return{tabSize:e,insertSpaces:t}}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.defined(t)&&OU.uinteger(t.tabSize)&&OU.boolean(t.insertSpaces)}Q(n,`is`),e.is=n})(b$e||={}),(function(e){function t(e,t,n){return{range:e,target:t,data:n}}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.defined(t)&&iU.is(t.range)&&(OU.undefined(t.target)||OU.string(t.target))}Q(n,`is`),e.is=n})(x$e||={}),(function(e){function t(e,t){return{range:e,parent:t}}Q(t,`create`),e.create=t;function n(t){let n=t;return OU.objectLiteral(n)&&iU.is(n.range)&&(n.parent===void 0||e.is(n.parent))}Q(n,`is`),e.is=n})(S$e||={}),(function(e){e.namespace=`namespace`,e.type=`type`,e.class=`class`,e.enum=`enum`,e.interface=`interface`,e.struct=`struct`,e.typeParameter=`typeParameter`,e.parameter=`parameter`,e.variable=`variable`,e.property=`property`,e.enumMember=`enumMember`,e.event=`event`,e.function=`function`,e.method=`method`,e.macro=`macro`,e.keyword=`keyword`,e.modifier=`modifier`,e.comment=`comment`,e.string=`string`,e.number=`number`,e.regexp=`regexp`,e.operator=`operator`,e.decorator=`decorator`})(C$e||={}),(function(e){e.declaration=`declaration`,e.definition=`definition`,e.readonly=`readonly`,e.static=`static`,e.deprecated=`deprecated`,e.abstract=`abstract`,e.async=`async`,e.modification=`modification`,e.documentation=`documentation`,e.defaultLibrary=`defaultLibrary`})(w$e||={}),(function(e){function t(e){let t=e;return OU.objectLiteral(t)&&(t.resultId===void 0||typeof t.resultId==`string`)&&Array.isArray(t.data)&&(t.data.length===0||typeof t.data[0]==`number`)}Q(t,`is`),e.is=t})(T$e||={}),(function(e){function t(e,t){return{range:e,text:t}}Q(t,`create`),e.create=t;function n(e){let t=e;return t!=null&&iU.is(t.range)&&OU.string(t.text)}Q(n,`is`),e.is=n})(E$e||={}),(function(e){function t(e,t,n){return{range:e,variableName:t,caseSensitiveLookup:n}}Q(t,`create`),e.create=t;function n(e){let t=e;return t!=null&&iU.is(t.range)&&OU.boolean(t.caseSensitiveLookup)&&(OU.string(t.variableName)||t.variableName===void 0)}Q(n,`is`),e.is=n})(D$e||={}),(function(e){function t(e,t){return{range:e,expression:t}}Q(t,`create`),e.create=t;function n(e){let t=e;return t!=null&&iU.is(t.range)&&(OU.string(t.expression)||t.expression===void 0)}Q(n,`is`),e.is=n})(O$e||={}),(function(e){function t(e,t){return{frameId:e,stoppedLocation:t}}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.defined(t)&&iU.is(e.stoppedLocation)}Q(n,`is`),e.is=n})(k$e||={}),(function(e){e.Type=1,e.Parameter=2;function t(e){return e===1||e===2}Q(t,`is`),e.is=t})(EU||={}),(function(e){function t(e){return{value:e}}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.objectLiteral(t)&&(t.tooltip===void 0||OU.string(t.tooltip)||CU.is(t.tooltip))&&(t.location===void 0||aU.is(t.location))&&(t.command===void 0||lU.is(t.command))}Q(n,`is`),e.is=n})(DU||={}),(function(e){function t(e,t,n){let r={position:e,label:t};return n!==void 0&&(r.kind=n),r}Q(t,`create`),e.create=t;function n(e){let t=e;return OU.objectLiteral(t)&&rU.is(t.position)&&(OU.string(t.label)||OU.typedArray(t.label,DU.is))&&(t.kind===void 0||EU.is(t.kind))&&t.textEdits===void 0||OU.typedArray(t.textEdits,uU.is)&&(t.tooltip===void 0||OU.string(t.tooltip)||CU.is(t.tooltip))&&(t.paddingLeft===void 0||OU.boolean(t.paddingLeft))&&(t.paddingRight===void 0||OU.boolean(t.paddingRight))}Q(n,`is`),e.is=n})(A$e||={}),(function(e){function t(e){return{kind:`snippet`,value:e}}Q(t,`createSnippet`),e.createSnippet=t})(j$e||={}),(function(e){function t(e,t,n,r){return{insertText:e,filterText:t,range:n,command:r}}Q(t,`create`),e.create=t})(M$e||={}),(function(e){function t(e){return{items:e}}Q(t,`create`),e.create=t})(N$e||={}),(function(e){e.Invoked=0,e.Automatic=1})(P$e||={}),(function(e){function t(e,t){return{range:e,text:t}}Q(t,`create`),e.create=t})(F$e||={}),(function(e){function t(e,t){return{triggerKind:e,selectedCompletionInfo:t}}Q(t,`create`),e.create=t})(I$e||={}),(function(e){function t(e){let t=e;return OU.objectLiteral(t)&&tU.is(t.uri)&&OU.string(t.name)}Q(t,`is`),e.is=t})(L$e||={}),R$e=[`1252+`,`\r1253+`,`\r`],(function(e){function t(e,t,n,r){return new B$e(e,t,n,r)}Q(t,`create`),e.create=t;function n(e){let t=e;return!!(OU.defined(t)&&OU.string(t.uri)&&(OU.undefined(t.languageId)||OU.string(t.languageId))&&OU.uinteger(t.lineCount)&&OU.func(t.getText)&&OU.func(t.positionAt)&&OU.func(t.offsetAt))}Q(n,`is`),e.is=n;function r(e,t){let n=e.getText(),r=i(t,(e,t)=>{let n=e.range.start.line-t.range.start.line;return n===0?e.range.start.character-t.range.start.character:n}),a=n.length;for(let t=r.length-1;t>=0;t--){let i=r[t],o=e.offsetAt(i.range.start),s=e.offsetAt(i.range.end);if(s<=a)n=n.substring(0,o)+i.newText+n.substring(s,n.length);else throw Error(`Overlapping edit`);a=o}return n}Q(r,`applyEdits`),e.applyEdits=r;function i(e,t){if(e.length<=1)return e;let n=e.length/2|0,r=e.slice(0,n),a=e.slice(n);i(r,t),i(a,t);let o=0,s=0,l=0;for(;o<r.length&&s<a.length;)t(r[o],a[s])<=0?e[l++]=r[o++]:e[l++]=a[s++];for(;o<r.length;)e[l++]=r[o++];for(;s<a.length;)e[l++]=a[s++];return e}Q(i,`mergeSort`)})(z$e||={}),B$e=class{static{Q(this,`FullTextDocument`)}constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],t=this._content,n=!0;for(let r=0;r<t.length;r++){n&&=(e.push(r),!1);let i=t.charAt(r);n=i===`\r`||i===`1254+`,i===`\r`&&r+1<t.length&&t.charAt(r+1)===`1255+`&&r++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,r=t.length;if(r===0)return rU.create(0,e);for(;n<r;){let i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}let i=n-1;return rU.create(i,e-t[i])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)}get lineCount(){return this.getLineOffsets().length}},(function(e){let t=Object.prototype.toString;function n(e){return e!==void 0}Q(n,`defined`),e.defined=n;function r(e){return e===void 0}Q(r,`undefined`),e.undefined=r;function i(e){return e===!0||e===!1}Q(i,`boolean`),e.boolean=i;function a(e){return t.call(e)===`[object String]`}Q(a,`string`),e.string=a;function o(e){return t.call(e)===`[object Number]`}Q(o,`number`),e.number=o;function s(e,n,r){return t.call(e)===`[object Number]`&&n<=e&&e<=r}Q(s,`numberRange`),e.numberRange=s;function l(e){return t.call(e)===`[object Number]`&&-2147483648<=e&&e<=2147483647}Q(l,`integer`),e.integer=l;function u(e){return t.call(e)===`[object Number]`&&0<=e&&e<=2147483647}Q(u,`uinteger`),e.uinteger=u;function d(e){return t.call(e)===`[object Function]`}Q(d,`func`),e.func=d;function f(e){return typeof e==`object`&&!!e}Q(f,`objectLiteral`),e.objectLiteral=f;function p(e,t){return Array.isArray(e)&&e.every(t)}Q(p,`typedArray`),e.typedArray=p})(OU||={})}}),AU=JH({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t;function n(){if(t===void 0)throw Error(`No runtime abstraction layer installed`);return t}Q(n,`RAL`),(function(e){function n(e){if(e===void 0)throw Error(`No runtime abstraction layer provided`);t=e}Q(n,`install`),e.install=n})(n||={}),e.default=n}}),jU=JH({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(e){return e===!0||e===!1}Q(t,`boolean`),e.boolean=t;function n(e){return typeof e==`string`||e instanceof String}Q(n,`string`),e.string=n;function r(e){return typeof e==`number`||e instanceof Number}Q(r,`number`),e.number=r;function i(e){return e instanceof Error}Q(i,`error`),e.error=i;function a(e){return typeof e==`function`}Q(a,`func`),e.func=a;function o(e){return Array.isArray(e)}Q(o,`array`),e.array=o;function s(e){return o(e)&&e.every(e=>n(e))}Q(s,`stringArray`),e.stringArray=s}}),MU=JH({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;var t=AU(),n;(function(e){let t={dispose(){}};e.None=function(){return t}})(n||(e.Event=n={}));var r=class{static{Q(this,`CallbackList`)}add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:Q(()=>this.remove(e,t),`dispose`)})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let r=0,i=this._callbacks.length;r<i;r++)if(this._callbacks[r]===e){if(this._contexts[r]===t){this._callbacks.splice(r,1),this._contexts.splice(r,1);return}n=!0}if(n)throw Error(`When adding a listener with a context, you should remove it with the same context`)}invoke(...e){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let a=0,o=r.length;a<o;a++)try{n.push(r[a].apply(i[a],e))}catch(e){(0,t.default)().console.error(e)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},i=class e{static{Q(this,`Emitter`)}constructor(e){this._options=e}get event(){return this._event||=(t,n,i)=>{this._callbacks||=new r,this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,n);let a={dispose:Q(()=>{this._callbacks&&(this._callbacks.remove(t,n),a.dispose=e._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},`dispose`)};return Array.isArray(i)&&i.push(a),a},this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&=(this._callbacks.dispose(),void 0)}};e.Emitter=i,i._noop=function(){}}}),NU=JH({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;var t=AU(),n=jU(),r=MU(),i;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:r.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:r.Event.None});function t(t){let r=t;return r&&(r===e.None||r===e.Cancelled||n.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}Q(t,`is`),e.is=t})(i||(e.CancellationToken=i={}));var a=Object.freeze(function(e,n){let r=(0,t.default)().timer.setTimeout(e.bind(n),0);return{dispose(){r.dispose()}}}),o=class{static{Q(this,`MutableToken`)}constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?a:(this._emitter||=new r.Emitter,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),void 0)}};e.CancellationTokenSource=class{static{Q(this,`CancellationTokenSource`)}get token(){return this._token||=new o,this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof o&&this._token.dispose():this._token=i.None}}}}),PU=JH({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Message=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType=e.RequestType0=e.AbstractMessageSignature=e.ParameterStructures=e.ResponseError=e.ErrorCodes=void 0;var t=jU(),n;(function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3})(n||(e.ErrorCodes=n={})),e.ResponseError=class e extends Error{static{Q(this,`ResponseError`)}constructor(r,i,a){super(i),this.code=t.number(r)?r:n.UnknownErrorCode,this.data=a,Object.setPrototypeOf(this,e.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};var r=class e{static{Q(this,`ParameterStructures`)}constructor(e){this.kind=e}static is(t){return t===e.auto||t===e.byName||t===e.byPosition}toString(){return this.kind}};e.ParameterStructures=r,r.auto=new r(`auto`),r.byPosition=new r(`byPosition`),r.byName=new r(`byName`);var i=class{static{Q(this,`AbstractMessageSignature`)}constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return r.auto}};e.AbstractMessageSignature=i,e.RequestType0=class extends i{static{Q(this,`RequestType0`)}constructor(e){super(e,0)}},e.RequestType=class extends i{static{Q(this,`RequestType`)}constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.RequestType1=class extends i{static{Q(this,`RequestType1`)}constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.RequestType2=class extends i{static{Q(this,`RequestType2`)}constructor(e){super(e,2)}},e.RequestType3=class extends i{static{Q(this,`RequestType3`)}constructor(e){super(e,3)}},e.RequestType4=class extends i{static{Q(this,`RequestType4`)}constructor(e){super(e,4)}},e.RequestType5=class extends i{static{Q(this,`RequestType5`)}constructor(e){super(e,5)}},e.RequestType6=class extends i{static{Q(this,`RequestType6`)}constructor(e){super(e,6)}},e.RequestType7=class extends i{static{Q(this,`RequestType7`)}constructor(e){super(e,7)}},e.RequestType8=class extends i{static{Q(this,`RequestType8`)}constructor(e){super(e,8)}},e.RequestType9=class extends i{static{Q(this,`RequestType9`)}constructor(e){super(e,9)}},e.NotificationType=class extends i{static{Q(this,`NotificationType`)}constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.NotificationType0=class extends i{static{Q(this,`NotificationType0`)}constructor(e){super(e,0)}},e.NotificationType1=class extends i{static{Q(this,`NotificationType1`)}constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.NotificationType2=class extends i{static{Q(this,`NotificationType2`)}constructor(e){super(e,2)}},e.NotificationType3=class extends i{static{Q(this,`NotificationType3`)}constructor(e){super(e,3)}},e.NotificationType4=class extends i{static{Q(this,`NotificationType4`)}constructor(e){super(e,4)}},e.NotificationType5=class extends i{static{Q(this,`NotificationType5`)}constructor(e){super(e,5)}},e.NotificationType6=class extends i{static{Q(this,`NotificationType6`)}constructor(e){super(e,6)}},e.NotificationType7=class extends i{static{Q(this,`NotificationType7`)}constructor(e){super(e,7)}},e.NotificationType8=class extends i{static{Q(this,`NotificationType8`)}constructor(e){super(e,8)}},e.NotificationType9=class extends i{static{Q(this,`NotificationType9`)}constructor(e){super(e,9)}};var a;(function(e){function n(e){let n=e;return n&&t.string(n.method)&&(t.string(n.id)||t.number(n.id))}Q(n,`isRequest`),e.isRequest=n;function r(e){let n=e;return n&&t.string(n.method)&&e.id===void 0}Q(r,`isNotification`),e.isNotification=r;function i(e){let n=e;return n&&(n.result!==void 0||!!n.error)&&(t.string(n.id)||t.number(n.id)||n.id===null)}Q(i,`isResponse`),e.isResponse=i})(a||(e.Message=a={}))}}),FU=JH({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(e){"use strict";var t;Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0;var n;(function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last})(n||(e.Touch=n={}));var r=class{static{Q(this,`LinkedMap`)}constructor(){this[t]=`LinkedMap`,this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=n.None){let r=this._map.get(e);if(r)return t!==n.None&&this.touch(r,t),r.value}set(e,t,r=n.None){let i=this._map.get(e);if(i)i.value=t,r!==n.None&&this.touch(i,r);else{switch(i={key:e,value:t,next:void 0,previous:void 0},r){case n.None:this.addItemLast(i);break;case n.First:this.addItemFirst(i);break;case n.Last:this.addItemLast(i);break;default:this.addItemLast(i)}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error(`Invalid list`);let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let n=this._state,r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==n)throw Error(`LinkedMap got modified during iteration.`);r=r.next}}keys(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:Q(()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:t.key,done:!1};return t=t.next,e}return{value:void 0,done:!0}},`next`)};return n}values(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:Q(()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:t.value,done:!1};return t=t.next,e}return{value:void 0,done:!0}},`next`)};return n}entries(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:Q(()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:[t.key,t.value],done:!1};return t=t.next,e}return{value:void 0,done:!0}},`next`)};return n}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw Error(`Invalid list`);this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw Error(`Invalid list`);this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw Error(`Invalid list`);e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw Error(`Invalid list`);e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,n=e.previous;if(!t||!n)throw Error(`Invalid list`);t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw Error(`Invalid list`);if(t===n.First||t===n.Last){if(t===n.First){if(e===this._head)return;let t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===n.Last){if(e===this._tail)return;let t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(let[t,n]of e)this.set(t,n)}};e.LinkedMap=r,e.LRUCache=class extends r{static{Q(this,`LRUCache`)}constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=n.AsNew){return super.get(e,t)}peek(e){return super.get(e,n.None)}set(e,t){return super.set(e,t,n.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}}}),V$e=JH({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Disposable=void 0;var t;(function(e){function t(e){return{dispose:e}}Q(t,`create`),e.create=t})(t||(e.Disposable=t={}))}}),H$e=JH({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;var t=NU(),n;(function(e){e.Continue=0,e.Cancelled=1})(n||={}),e.SharedArraySenderStrategy=class{static{Q(this,`SharedArraySenderStrategy`)}constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),r=new Int32Array(t,0,1);r[0]=n.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let r=this.buffers.get(t);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,n.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};var r=class{static{Q(this,`SharedArrayBufferCancellationToken`)}constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===n.Cancelled}get onCancellationRequested(){throw Error(`Cancellation over SharedArrayBuffer doesn't support cancellation events`)}},i=class{static{Q(this,`SharedArrayBufferCancellationTokenSource`)}constructor(e){this.token=new r(e)}cancel(){}dispose(){}};e.SharedArrayReceiverStrategy=class{static{Q(this,`SharedArrayReceiverStrategy`)}constructor(){this.kind=`request`}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new t.CancellationTokenSource:new i(n)}}}}),IU=JH({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Semaphore=void 0;var t=AU();e.Semaphore=class{static{Q(this,`Semaphore`)}constructor(e=1){if(e<=0)throw Error(`Capacity must be greater than 0`);this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length!==0&&this._active!==this._capacity&&(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw Error(`To many thunks active`);try{let t=e.thunk();t instanceof Promise?t.then(t=>{this._active--,e.resolve(t),this.runNext()},t=>{this._active--,e.reject(t),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}}}}),U$e=JH({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;var t=AU(),n=jU(),r=MU(),i=IU(),a;(function(e){function t(e){let t=e;return t&&n.func(t.listen)&&n.func(t.dispose)&&n.func(t.onError)&&n.func(t.onClose)&&n.func(t.onPartialMessage)}Q(t,`is`),e.is=t})(a||(e.MessageReader=a={}));var o=class{static{Q(this,`AbstractMessageReader`)}constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter,this.partialMessageEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:Error(`Reader received error. Reason: ${n.string(e.message)?e.message:`unknown`}`)}};e.AbstractMessageReader=o;var s;(function(e){function n(e){let n,r,i=new Map,a,o=new Map;if(e===void 0||typeof e==`string`)n=e??`utf-8`;else{if(n=e.charset??`utf-8`,e.contentDecoder!==void 0&&(r=e.contentDecoder,i.set(r.name,r)),e.contentDecoders!==void 0)for(let t of e.contentDecoders)i.set(t.name,t);if(e.contentTypeDecoder!==void 0&&(a=e.contentTypeDecoder,o.set(a.name,a)),e.contentTypeDecoders!==void 0)for(let t of e.contentTypeDecoders)o.set(t.name,t)}return a===void 0&&(a=(0,t.default)().applicationJson.decoder,o.set(a.name,a)),{charset:n,contentDecoder:r,contentDecoders:i,contentTypeDecoder:a,contentTypeDecoders:o}}Q(n,`fromOptions`),e.fromOptions=n})(s||={}),e.ReadableStreamMessageReader=class extends o{static{Q(this,`ReadableStreamMessageReader`)}constructor(e,n){super(),this.readable=e,this.options=s.fromOptions(n),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let t=this.readable.onData(e=>{this.onData(e)});return this.readable.onError(e=>this.fireError(e)),this.readable.onClose(()=>this.fireClose()),t}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let e=this.buffer.tryReadHeaders(!0);if(!e)return;let t=e.get(`content-length`);if(!t){this.fireError(Error(`Header must provide a Content-Length property.1256+${JSON.stringify(Object.fromEntries(e))}`));return}let n=parseInt(t);if(isNaN(n)){this.fireError(Error(`Content-Length value must be a number. Got ${t}`));return}this.nextMessageLength=n}let e=this.buffer.tryReadBody(this.nextMessageLength);if(e===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let t=this.options.contentDecoder===void 0?e:await this.options.contentDecoder.decode(e),n=await this.options.contentTypeDecoder.decode(t,this.options);this.callback(n)}).catch(e=>{this.fireError(e)})}}catch(e){this.fireError(e)}}clearPartialMessageTimer(){this.partialMessageTimer&&=(this.partialMessageTimer.dispose(),void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}}}),W$e=JH({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;var t=AU(),n=jU(),r=IU(),i=MU(),a=`Content-Length: `,o=`\r1257+`,s;(function(e){function t(e){let t=e;return t&&n.func(t.dispose)&&n.func(t.onClose)&&n.func(t.onError)&&n.func(t.write)}Q(t,`is`),e.is=t})(s||(e.MessageWriter=s={}));var l=class{static{Q(this,`AbstractMessageWriter`)}constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,n){this.errorEmitter.fire([this.asError(e),t,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:Error(`Writer received error. Reason: ${n.string(e.message)?e.message:`unknown`}`)}};e.AbstractMessageWriter=l;var u;(function(e){function n(e){return e===void 0||typeof e==`string`?{charset:e??`utf-8`,contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:e.charset??`utf-8`,contentEncoder:e.contentEncoder,contentTypeEncoder:e.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}Q(n,`fromOptions`),e.fromOptions=n})(u||={}),e.WriteableStreamMessageWriter=class extends l{static{Q(this,`WriteableStreamMessageWriter`)}constructor(e,t){super(),this.writable=e,this.options=u.fromOptions(t),this.errorCount=0,this.writeSemaphore=new r.Semaphore(1),this.writable.onError(e=>this.fireError(e)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(e=>this.options.contentEncoder===void 0?e:this.options.contentEncoder.encode(e)).then(t=>{let n=[];return n.push(a,t.byteLength.toString(),o),n.push(o),this.doWrite(e,n,t)},e=>{throw this.fireError(e),e}))}async doWrite(e,t,n){try{return await this.writable.write(t.join(``),`ascii`),this.writable.write(n)}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}}}}),G$e=JH({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractMessageBuffer=void 0;var t=13,n=10,r=`\r1258+`;e.AbstractMessageBuffer=class{static{Q(this,`AbstractMessageBuffer`)}constructor(e=`utf-8`){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let t=typeof e==`string`?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let i=0,a=0,o=0,s=0;row:for(;a<this._chunks.length;){let e=this._chunks[a];o=0;column:for(;o<e.length;){switch(e[o]){case t:switch(i){case 0:i=1;break;case 2:i=3;break;default:i=0}break;case n:switch(i){case 1:i=2;break;case 3:i=4,o++;break row;default:i=0}break;default:i=0}o++}s+=e.byteLength,a++}if(i!==4)return;let l=this._read(s+o),u=new Map,d=this.toString(l,`ascii`).split(r);if(d.length<2)return u;for(let t=0;t<d.length-2;t++){let n=d[t],r=n.indexOf(`:`);if(r===-1)throw Error(`Message header must separate key and value using ':'1259+${n}`);let i=n.substr(0,r),a=n.substr(r+1).trim();u.set(e?i.toLowerCase():i,a)}return u}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw Error(`Cannot read so many bytes!`);if(this._chunks[0].byteLength===e){let t=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(t)}if(this._chunks[0].byteLength>e){let t=this._chunks[0],n=this.asNative(t,e);return this._chunks[0]=t.slice(e),this._totalLength-=e,n}let t=this.allocNative(e),n=0;for(;e>0;){let r=this._chunks[0];if(r.byteLength>e){let i=r.slice(0,e);t.set(i,n),n+=e,this._chunks[0]=r.slice(e),this._totalLength-=e,e-=e}else t.set(r,n),n+=r.byteLength,this._chunks.shift(),this._totalLength-=r.byteLength,e-=r.byteLength}return t}}}}),K$e=JH({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;var t=AU(),n=jU(),r=PU(),i=FU(),a=MU(),o=NU(),s;(function(e){e.type=new r.NotificationType(`$/cancelRequest`)})(s||={});var l;(function(e){function t(e){return typeof e==`string`||typeof e==`number`}Q(t,`is`),e.is=t})(l||(e.ProgressToken=l={}));var u;(function(e){e.type=new r.NotificationType(`$/progress`)})(u||={}),e.ProgressType=class{static{Q(this,`ProgressType`)}constructor(){}};var d;(function(e){function t(e){return n.func(e)}Q(t,`is`),e.is=t})(d||={}),e.NullLogger=Object.freeze({error:Q(()=>{},`error`),warn:Q(()=>{},`warn`),info:Q(()=>{},`info`),log:Q(()=>{},`log`)});var f;(function(e){e[e.Off=0]=`Off`,e[e.Messages=1]=`Messages`,e[e.Compact=2]=`Compact`,e[e.Verbose=3]=`Verbose`})(f||(e.Trace=f={}));var p;(function(e){e.Off=`off`,e.Messages=`messages`,e.Compact=`compact`,e.Verbose=`verbose`})(p||(e.TraceValues=p={})),(function(e){function t(t){if(!n.string(t))return e.Off;switch(t=t.toLowerCase(),t){case`off`:return e.Off;case`messages`:return e.Messages;case`compact`:return e.Compact;case`verbose`:return e.Verbose;default:return e.Off}}Q(t,`fromString`),e.fromString=t;function r(t){switch(t){case e.Off:return`off`;case e.Messages:return`messages`;case e.Compact:return`compact`;case e.Verbose:return`verbose`;default:return`off`}}Q(r,`toString`),e.toString=r})(f||(e.Trace=f={}));var m;(function(e){e.Text=`text`,e.JSON=`json`})(m||(e.TraceFormat=m={})),(function(e){function t(t){return n.string(t)?(t=t.toLowerCase(),t===`json`?e.JSON:e.Text):e.Text}Q(t,`fromString`),e.fromString=t})(m||(e.TraceFormat=m={}));var h;(function(e){e.type=new r.NotificationType(`$/setTrace`)})(h||(e.SetTraceNotification=h={}));var g;(function(e){e.type=new r.NotificationType(`$/logTrace`)})(g||(e.LogTraceNotification=g={}));var _;(function(e){e[e.Closed=1]=`Closed`,e[e.Disposed=2]=`Disposed`,e[e.AlreadyListening=3]=`AlreadyListening`})(_||(e.ConnectionErrors=_={}));var v=class e extends Error{static{Q(this,`ConnectionError`)}constructor(t,n){super(n),this.code=t,Object.setPrototypeOf(this,e.prototype)}};e.ConnectionError=v;var y;(function(e){function t(e){let t=e;return t&&n.func(t.cancelUndispatched)}Q(t,`is`),e.is=t})(y||(e.ConnectionStrategy=y={}));var b;(function(e){function t(e){let t=e;return t&&(t.kind===void 0||t.kind===`id`)&&n.func(t.createCancellationTokenSource)&&(t.dispose===void 0||n.func(t.dispose))}Q(t,`is`),e.is=t})(b||(e.IdCancellationReceiverStrategy=b={}));var x;(function(e){function t(e){let t=e;return t&&t.kind===`request`&&n.func(t.createCancellationTokenSource)&&(t.dispose===void 0||n.func(t.dispose))}Q(t,`is`),e.is=t})(x||(e.RequestCancellationReceiverStrategy=x={}));var S;(function(e){e.Message=Object.freeze({createCancellationTokenSource(e){return new o.CancellationTokenSource}});function t(e){return b.is(e)||x.is(e)}Q(t,`is`),e.is=t})(S||(e.CancellationReceiverStrategy=S={}));var C;(function(e){e.Message=Object.freeze({sendCancellation(e,t){return e.sendNotification(s.type,{id:t})},cleanup(e){}});function t(e){let t=e;return t&&n.func(t.sendCancellation)&&n.func(t.cleanup)}Q(t,`is`),e.is=t})(C||(e.CancellationSenderStrategy=C={}));var w;(function(e){e.Message=Object.freeze({receiver:S.Message,sender:C.Message});function t(e){let t=e;return t&&S.is(t.receiver)&&C.is(t.sender)}Q(t,`is`),e.is=t})(w||(e.CancellationStrategy=w={}));var T;(function(e){function t(e){let t=e;return t&&n.func(t.handleMessage)}Q(t,`is`),e.is=t})(T||(e.MessageStrategy=T={}));var E;(function(e){function t(e){let t=e;return t&&(w.is(t.cancellationStrategy)||y.is(t.connectionStrategy)||T.is(t.messageStrategy))}Q(t,`is`),e.is=t})(E||(e.ConnectionOptions=E={}));var D;(function(e){e[e.New=1]=`New`,e[e.Listening=2]=`Listening`,e[e.Closed=3]=`Closed`,e[e.Disposed=4]=`Disposed`})(D||={});function O(p,y,x,S){let C=x===void 0?e.NullLogger:x,E=0,O=0,k=0,A,j=new Map,M,N=new Map,P=new Map,F,I=new i.LinkedMap,L=new Map,R=new Set,ee=new Map,z=f.Off,B=m.Text,te,ne=D.New,re=new a.Emitter,ie=new a.Emitter,ae=new a.Emitter,oe=new a.Emitter,se=new a.Emitter,ce=S&&S.cancellationStrategy?S.cancellationStrategy:w.Message;function le(e){if(e===null)throw Error(`Can't send requests with id null since the response can't be correlated.`);return`req-`+e.toString()}Q(le,`createRequestQueueKey`);function ue(e){return e===null?`res-unknown-`+(++k).toString():`res-`+e.toString()}Q(ue,`createResponseQueueKey`);function de(){return`not-`+(++O).toString()}Q(de,`createNotificationQueueKey`);function fe(e,t){r.Message.isRequest(t)?e.set(le(t.id),t):r.Message.isResponse(t)?e.set(ue(t.id),t):e.set(de(),t)}Q(fe,`addMessageToQueue`);function pe(e){}Q(pe,`cancelUndispatched`);function me(){return ne===D.Listening}Q(me,`isListening`);function he(){return ne===D.Closed}Q(he,`isClosed`);function ge(){return ne===D.Disposed}Q(ge,`isDisposed`);function _e(){(ne===D.New||ne===D.Listening)&&(ne=D.Closed,ie.fire(void 0))}Q(_e,`closeHandler`);function ve(e){re.fire([e,void 0,void 0])}Q(ve,`readErrorHandler`);function ye(e){re.fire(e)}Q(ye,`writeErrorHandler`),p.onClose(_e),p.onError(ve),y.onClose(_e),y.onError(ye);function be(){F||I.size===0||(F=(0,t.default)().timer.setImmediate(()=>{F=void 0,Se()}))}Q(be,`triggerMessageQueue`);function xe(e){r.Message.isRequest(e)?Ce(e):r.Message.isNotification(e)?Te(e):r.Message.isResponse(e)?we(e):Ee(e)}Q(xe,`handleMessage`);function Se(){if(I.size===0)return;let e=I.shift();try{let t=S?.messageStrategy;T.is(t)?t.handleMessage(e,xe):xe(e)}finally{be()}}Q(Se,`processMessageQueue`);let V=Q(e=>{try{if(r.Message.isNotification(e)&&e.method===s.type.method){let t=e.params.id,n=le(t),i=I.get(n);if(r.Message.isRequest(i)){let r=S?.connectionStrategy,a=r&&r.cancelUndispatched?r.cancelUndispatched(i,pe):void 0;if(a&&(a.error!==void 0||a.result!==void 0)){I.delete(n),ee.delete(t),a.id=i.id,ke(a,e.method,Date.now()),y.write(a).catch(()=>C.error(`Sending response for canceled message failed.`));return}}let a=ee.get(t);if(a!==void 0){a.cancel(),U(e);return}R.add(t)}fe(I,e)}finally{be()}},`callback`);function Ce(e){if(ge())return;function t(t,n,i){let a={jsonrpc:`2.0`,id:e.id};t instanceof r.ResponseError?a.error=t.toJson():a.result=t===void 0?null:t,ke(a,n,i),y.write(a).catch(()=>C.error(`Sending response failed.`))}Q(t,`reply`);function i(t,n,r){let i={jsonrpc:`2.0`,id:e.id,error:t.toJson()};ke(i,n,r),y.write(i).catch(()=>C.error(`Sending response failed.`))}Q(i,`replyError`);function a(t,n,r){t===void 0&&(t=null);let i={jsonrpc:`2.0`,id:e.id,result:t};ke(i,n,r),y.write(i).catch(()=>C.error(`Sending response failed.`))}Q(a,`replySuccess`),Ae(e);let o=j.get(e.method),s,l;o&&(s=o.type,l=o.handler);let u=Date.now();if(l||A){let o=e.id??String(Date.now()),d=b.is(ce.receiver)?ce.receiver.createCancellationTokenSource(o):ce.receiver.createCancellationTokenSource(e);e.id!==null&&R.has(e.id)&&d.cancel(),e.id!==null&&ee.set(o,d);try{let f;if(l){if(e.params===void 0){if(s!==void 0&&s.numberOfParams!==0){i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines ${s.numberOfParams} params but received none.`),e.method,u);return}f=l(d.token)}else if(Array.isArray(e.params)){if(s!==void 0&&s.parameterStructures===r.ParameterStructures.byName){i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by name but received parameters by position`),e.method,u);return}f=l(...e.params,d.token)}else{if(s!==void 0&&s.parameterStructures===r.ParameterStructures.byPosition){i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by position but received parameters by name`),e.method,u);return}f=l(e.params,d.token)}}else A&&(f=A(e.method,e.params,d.token));let p=f;f?p.then?p.then(n=>{ee.delete(o),t(n,e.method,u)},t=>{ee.delete(o),t instanceof r.ResponseError?i(t,e.method,u):t&&n.string(t.message)?i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,u):i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)}):(ee.delete(o),t(f,e.method,u)):(ee.delete(o),a(f,e.method,u))}catch(a){ee.delete(o),a instanceof r.ResponseError?t(a,e.method,u):a&&n.string(a.message)?i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${a.message}`),e.method,u):i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)}}else i(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${e.method}`),e.method,u)}Q(Ce,`handleRequest`);function we(e){if(!ge()){if(e.id===null)e.error?C.error(`Received response message without id: Error is: 1260+${JSON.stringify(e.error,void 0,4)}`):C.error(`Received response message without id. No further error information provided.`);else{let t=e.id,n=L.get(t);if(je(e,n),n!==void 0){L.delete(t);try{if(e.error){let t=e.error;n.reject(new r.ResponseError(t.code,t.message,t.data))}else if(e.result!==void 0)n.resolve(e.result);else throw Error(`Should never happen.`)}catch(e){e.message?C.error(`Response handler '${n.method}' failed with message: ${e.message}`):C.error(`Response handler '${n.method}' failed unexpectedly.`)}}}}}Q(we,`handleResponse`);function Te(e){if(ge())return;let t,n;if(e.method===s.type.method){let t=e.params.id;R.delete(t),U(e);return}{let r=N.get(e.method);r&&(n=r.handler,t=r.type)}if(n||M)try{if(U(e),n){if(e.params===void 0)t!==void 0&&t.numberOfParams!==0&&t.parameterStructures!==r.ParameterStructures.byName&&C.error(`Notification ${e.method} defines ${t.numberOfParams} params but received none.`),n();else if(Array.isArray(e.params)){let i=e.params;e.method===u.type.method&&i.length===2&&l.is(i[0])?n({token:i[0],value:i[1]}):(t!==void 0&&(t.parameterStructures===r.ParameterStructures.byName&&C.error(`Notification ${e.method} defines parameters by name but received parameters by position`),t.numberOfParams!==e.params.length&&C.error(`Notification ${e.method} defines ${t.numberOfParams} params but received ${i.length} arguments`)),n(...i))}else t!==void 0&&t.parameterStructures===r.ParameterStructures.byPosition&&C.error(`Notification ${e.method} defines parameters by position but received parameters by name`),n(e.params)}else M&&M(e.method,e.params)}catch(t){t.message?C.error(`Notification handler '${e.method}' failed with message: ${t.message}`):C.error(`Notification handler '${e.method}' failed unexpectedly.`)}else ae.fire(e)}Q(Te,`handleNotification`);function Ee(e){if(!e){C.error(`Received empty message.`);return}C.error(`Received message which is neither a response nor a notification message:1261+${JSON.stringify(e,null,4)}`);let t=e;if(n.string(t.id)||n.number(t.id)){let e=t.id,n=L.get(e);n&&n.reject(Error(`The received response has neither a result nor an error property.`))}}Q(Ee,`handleInvalidMessage`);function De(e){if(e!=null)switch(z){case f.Verbose:return JSON.stringify(e,null,4);case f.Compact:return JSON.stringify(e);default:return}}Q(De,`stringifyTrace`);function H(e){if(!(z===f.Off||!te)){if(B===m.Text){let t;(z===f.Verbose||z===f.Compact)&&e.params&&(t=`Params: ${De(e.params)}1262+1263+`),te.log(`Sending request '${e.method} - (${e.id})'.`,t)}else Me(`send-request`,e)}}Q(H,`traceSendingRequest`);function Oe(e){if(!(z===f.Off||!te)){if(B===m.Text){let t;(z===f.Verbose||z===f.Compact)&&(t=e.params?`Params: ${De(e.params)}1264+1265+`:`No parameters provided.1266+1267+`),te.log(`Sending notification '${e.method}'.`,t)}else Me(`send-notification`,e)}}Q(Oe,`traceSendingNotification`);function ke(e,t,n){if(!(z===f.Off||!te)){if(B===m.Text){let r;(z===f.Verbose||z===f.Compact)&&(e.error&&e.error.data?r=`Error data: ${De(e.error.data)}1268+1269+`:e.result?r=`Result: ${De(e.result)}1270+1271+`:e.error===void 0&&(r=`No result returned.1272+1273+`)),te.log(`Sending response '${t} - (${e.id})'. Processing request took ${Date.now()-n}ms`,r)}else Me(`send-response`,e)}}Q(ke,`traceSendingResponse`);function Ae(e){if(!(z===f.Off||!te)){if(B===m.Text){let t;(z===f.Verbose||z===f.Compact)&&e.params&&(t=`Params: ${De(e.params)}1274+1275+`),te.log(`Received request '${e.method} - (${e.id})'.`,t)}else Me(`receive-request`,e)}}Q(Ae,`traceReceivedRequest`);function U(e){if(!(z===f.Off||!te||e.method===g.type.method)){if(B===m.Text){let t;(z===f.Verbose||z===f.Compact)&&(t=e.params?`Params: ${De(e.params)}1276+1277+`:`No parameters provided.1278+1279+`),te.log(`Received notification '${e.method}'.`,t)}else Me(`receive-notification`,e)}}Q(U,`traceReceivedNotification`);function je(e,t){if(!(z===f.Off||!te)){if(B===m.Text){let n;if((z===f.Verbose||z===f.Compact)&&(e.error&&e.error.data?n=`Error data: ${De(e.error.data)}1280+1281+`:e.result?n=`Result: ${De(e.result)}1282+1283+`:e.error===void 0&&(n=`No result returned.1284+1285+`)),t){let r=e.error?` Request failed: ${e.error.message} (${e.error.code}).`:``;te.log(`Received response '${t.method} - (${e.id})' in ${Date.now()-t.timerStart}ms.${r}`,n)}else te.log(`Received response ${e.id} without active response promise.`,n)}else Me(`receive-response`,e)}}Q(je,`traceReceivedResponse`);function Me(e,t){if(!te||z===f.Off)return;let n={isLSPMessage:!0,type:e,message:t,timestamp:Date.now()};te.log(n)}Q(Me,`logLSPMessage`);function Ne(){if(he())throw new v(_.Closed,`Connection is closed.`);if(ge())throw new v(_.Disposed,`Connection is disposed.`)}Q(Ne,`throwIfClosedOrDisposed`);function Pe(){if(me())throw new v(_.AlreadyListening,`Connection is already listening`)}Q(Pe,`throwIfListening`);function Fe(){if(!me())throw Error(`Call listen() first.`)}Q(Fe,`throwIfNotListening`);function Ie(e){return e===void 0?null:e}Q(Ie,`undefinedToNull`);function Le(e){if(e!==null)return e}Q(Le,`nullToUndefined`);function Re(e){return e!=null&&!Array.isArray(e)&&typeof e==`object`}Q(Re,`isNamedParam`);function ze(e,t){switch(e){case r.ParameterStructures.auto:return Re(t)?Le(t):[Ie(t)];case r.ParameterStructures.byName:if(!Re(t))throw Error(`Received parameters by name but param is not an object literal.`);return Le(t);case r.ParameterStructures.byPosition:return[Ie(t)];default:throw Error(`Unknown parameter structure ${e.toString()}`)}}Q(ze,`computeSingleParam`);function Be(e,t){let n,r=e.numberOfParams;switch(r){case 0:n=void 0;break;case 1:n=ze(e.parameterStructures,t[0]);break;default:n=[];for(let e=0;e<t.length&&e<r;e++)n.push(Ie(t[e]));if(t.length<r)for(let e=t.length;e<r;e++)n.push(null)}return n}Q(Be,`computeMessageParams`);let Ve={sendNotification:Q((e,...t)=>{Ne();let i,a;if(n.string(e)){i=e;let n=t[0],o=0,s=r.ParameterStructures.auto;r.ParameterStructures.is(n)&&(o=1,s=n);let l=t.length,u=l-o;switch(u){case 0:a=void 0;break;case 1:a=ze(s,t[o]);break;default:if(s===r.ParameterStructures.byName)throw Error(`Received ${u} parameters for 'by Name' notification parameter structure.`);a=t.slice(o,l).map(e=>Ie(e))}}else{let n=t;i=e.method,a=Be(e,n)}let o={jsonrpc:`2.0`,method:i,params:a};return Oe(o),y.write(o).catch(e=>{throw C.error(`Sending notification failed.`),e})},`sendNotification`),onNotification:Q((e,t)=>{Ne();let r;return n.func(e)?M=e:t&&(n.string(e)?(r=e,N.set(e,{type:void 0,handler:t})):(r=e.method,N.set(e.method,{type:e,handler:t}))),{dispose:Q(()=>{r===void 0?M=void 0:N.delete(r)},`dispose`)}},`onNotification`),onProgress:Q((e,t,n)=>{if(P.has(t))throw Error(`Progress handler for token ${t} already registered`);return P.set(t,n),{dispose:Q(()=>{P.delete(t)},`dispose`)}},`onProgress`),sendProgress:Q((e,t,n)=>Ve.sendNotification(u.type,{token:t,value:n}),`sendProgress`),onUnhandledProgress:oe.event,sendRequest:Q((e,...t)=>{Ne(),Fe();let i,a,s;if(n.string(e)){i=e;let n=t[0],l=t[t.length-1],u=0,d=r.ParameterStructures.auto;r.ParameterStructures.is(n)&&(u=1,d=n);let f=t.length;o.CancellationToken.is(l)&&(--f,s=l);let p=f-u;switch(p){case 0:a=void 0;break;case 1:a=ze(d,t[u]);break;default:if(d===r.ParameterStructures.byName)throw Error(`Received ${p} parameters for 'by Name' request parameter structure.`);a=t.slice(u,f).map(e=>Ie(e))}}else{let n=t;i=e.method,a=Be(e,n);let r=e.numberOfParams;s=o.CancellationToken.is(n[r])?n[r]:void 0}let l=E++,u;s&&(u=s.onCancellationRequested(()=>{let e=ce.sender.sendCancellation(Ve,l);return e===void 0?(C.log(`Received no promise from cancellation strategy when cancelling id ${l}`),Promise.resolve()):e.catch(()=>{C.log(`Sending cancellation messages for id ${l} failed`)})}));let d={jsonrpc:`2.0`,id:l,method:i,params:a};return H(d),typeof ce.sender.enableCancellation==`function`&&ce.sender.enableCancellation(d),new Promise(async(e,t)=>{let n=Q(t=>{e(t),ce.sender.cleanup(l),u?.dispose()},`resolveWithCleanup`),a=Q(e=>{t(e),ce.sender.cleanup(l),u?.dispose()},`rejectWithCleanup`),o={method:i,timerStart:Date.now(),resolve:n,reject:a};try{await y.write(d),L.set(l,o)}catch(e){throw C.error(`Sending request failed.`),o.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,e.message?e.message:`Unknown reason`)),e}})},`sendRequest`),onRequest:Q((e,t)=>{Ne();let r=null;return d.is(e)?(r=void 0,A=e):n.string(e)?(r=null,t!==void 0&&(r=e,j.set(e,{handler:t,type:void 0}))):t!==void 0&&(r=e.method,j.set(e.method,{type:e,handler:t})),{dispose:Q(()=>{r!==null&&(r===void 0?A=void 0:j.delete(r))},`dispose`)}},`onRequest`),hasPendingResponse:Q(()=>L.size>0,`hasPendingResponse`),trace:Q(async(e,t,r)=>{let i=!1,a=m.Text;r!==void 0&&(n.boolean(r)?i=r:(i=r.sendNotification||!1,a=r.traceFormat||m.Text)),z=e,B=a,te=z===f.Off?void 0:t,i&&!he()&&!ge()&&await Ve.sendNotification(h.type,{value:f.toString(e)})},`trace`),onError:re.event,onClose:ie.event,onUnhandledNotification:ae.event,onDispose:se.event,end:Q(()=>{y.end()},`end`),dispose:Q(()=>{if(ge())return;ne=D.Disposed,se.fire(void 0);let e=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,`Pending response rejected since connection got disposed`);for(let t of L.values())t.reject(e);L=new Map,ee=new Map,R=new Set,I=new i.LinkedMap,n.func(y.dispose)&&y.dispose(),n.func(p.dispose)&&p.dispose()},`dispose`),listen:Q(()=>{Ne(),Pe(),ne=D.Listening,p.listen(V)},`listen`),inspect:Q(()=>{(0,t.default)().console.log(`inspect`)},`inspect`)};return Ve.onNotification(g.type,e=>{if(z===f.Off||!te)return;let t=z===f.Verbose||z===f.Compact;te.log(e.message,t?e.verbose:void 0)}),Ve.onNotification(u.type,e=>{let t=P.get(e.token);t?t(e.value):oe.fire(e)}),Ve}Q(O,`createMessageConnection`),e.createMessageConnection=O}}),LU=JH({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;var t=PU();Object.defineProperty(e,"Message",{enumerable:!0,get:Q(function(){return t.Message},`get`)}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:Q(function(){return t.RequestType},`get`)}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:Q(function(){return t.RequestType0},`get`)}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:Q(function(){return t.RequestType1},`get`)}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:Q(function(){return t.RequestType2},`get`)}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:Q(function(){return t.RequestType3},`get`)}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:Q(function(){return t.RequestType4},`get`)}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:Q(function(){return t.RequestType5},`get`)}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:Q(function(){return t.RequestType6},`get`)}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:Q(function(){return t.RequestType7},`get`)}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:Q(function(){return t.RequestType8},`get`)}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:Q(function(){return t.RequestType9},`get`)}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:Q(function(){return t.ResponseError},`get`)}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:Q(function(){return t.ErrorCodes},`get`)}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:Q(function(){return t.NotificationType},`get`)}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:Q(function(){return t.NotificationType0},`get`)}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:Q(function(){return t.NotificationType1},`get`)}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:Q(function(){return t.NotificationType2},`get`)}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:Q(function(){return t.NotificationType3},`get`)}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:Q(function(){return t.NotificationType4},`get`)}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:Q(function(){return t.NotificationType5},`get`)}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:Q(function(){return t.NotificationType6},`get`)}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:Q(function(){return t.NotificationType7},`get`)}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:Q(function(){return t.NotificationType8},`get`)}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:Q(function(){return t.NotificationType9},`get`)}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:Q(function(){return t.ParameterStructures},`get`)});var n=FU();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:Q(function(){return n.LinkedMap},`get`)}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:Q(function(){return n.LRUCache},`get`)}),Object.defineProperty(e,"Touch",{enumerable:!0,get:Q(function(){return n.Touch},`get`)});var r=V$e();Object.defineProperty(e,"Disposable",{enumerable:!0,get:Q(function(){return r.Disposable},`get`)});var i=MU();Object.defineProperty(e,"Event",{enumerable:!0,get:Q(function(){return i.Event},`get`)}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:Q(function(){return i.Emitter},`get`)});var a=NU();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:Q(function(){return a.CancellationTokenSource},`get`)}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:Q(function(){return a.CancellationToken},`get`)});var o=H$e();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:Q(function(){return o.SharedArraySenderStrategy},`get`)}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:Q(function(){return o.SharedArrayReceiverStrategy},`get`)});var s=U$e();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:Q(function(){return s.MessageReader},`get`)}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:Q(function(){return s.AbstractMessageReader},`get`)}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:Q(function(){return s.ReadableStreamMessageReader},`get`)});var l=W$e();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:Q(function(){return l.MessageWriter},`get`)}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:Q(function(){return l.AbstractMessageWriter},`get`)}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:Q(function(){return l.WriteableStreamMessageWriter},`get`)});var u=G$e();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:Q(function(){return u.AbstractMessageBuffer},`get`)});var d=K$e();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:Q(function(){return d.ConnectionStrategy},`get`)}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:Q(function(){return d.ConnectionOptions},`get`)}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:Q(function(){return d.NullLogger},`get`)}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:Q(function(){return d.createMessageConnection},`get`)}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:Q(function(){return d.ProgressToken},`get`)}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:Q(function(){return d.ProgressType},`get`)}),Object.defineProperty(e,"Trace",{enumerable:!0,get:Q(function(){return d.Trace},`get`)}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:Q(function(){return d.TraceValues},`get`)}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:Q(function(){return d.TraceFormat},`get`)}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:Q(function(){return d.SetTraceNotification},`get`)}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:Q(function(){return d.LogTraceNotification},`get`)}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:Q(function(){return d.ConnectionErrors},`get`)}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:Q(function(){return d.ConnectionError},`get`)}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:Q(function(){return d.CancellationReceiverStrategy},`get`)}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:Q(function(){return d.CancellationSenderStrategy},`get`)}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:Q(function(){return d.CancellationStrategy},`get`)}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:Q(function(){return d.MessageStrategy},`get`)}),e.RAL=AU().default}}),q$e=JH({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=LU(),n=class e extends t.AbstractMessageBuffer{static{Q(this,`MessageBuffer`)}constructor(e=`utf-8`){super(e),this.asciiDecoder=new TextDecoder(`ascii`)}emptyBuffer(){return e.emptyBuffer}fromString(e,t){return new TextEncoder().encode(e)}toString(e,t){return t===`ascii`?this.asciiDecoder.decode(e):new TextDecoder(t).decode(e)}asNative(e,t){return t===void 0?e:e.slice(0,t)}allocNative(e){return new Uint8Array(e)}};n.emptyBuffer=new Uint8Array;var r=class{static{Q(this,`ReadableStreamWrapper`)}constructor(e){this.socket=e,this._onData=new t.Emitter,this._messageListener=e=>{e.data.arrayBuffer().then(e=>{this._onData.fire(new Uint8Array(e))},()=>{(0,t.RAL)().console.error(`Converting blob to array buffer failed.`)})},this.socket.addEventListener(`message`,this._messageListener)}onClose(e){return this.socket.addEventListener(`close`,e),t.Disposable.create(()=>this.socket.removeEventListener(`close`,e))}onError(e){return this.socket.addEventListener(`error`,e),t.Disposable.create(()=>this.socket.removeEventListener(`error`,e))}onEnd(e){return this.socket.addEventListener(`end`,e),t.Disposable.create(()=>this.socket.removeEventListener(`end`,e))}onData(e){return this._onData.event(e)}},i=class{static{Q(this,`WritableStreamWrapper`)}constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener(`close`,e),t.Disposable.create(()=>this.socket.removeEventListener(`close`,e))}onError(e){return this.socket.addEventListener(`error`,e),t.Disposable.create(()=>this.socket.removeEventListener(`error`,e))}onEnd(e){return this.socket.addEventListener(`end`,e),t.Disposable.create(()=>this.socket.removeEventListener(`end`,e))}write(e,t){if(typeof e==`string`){if(t!==void 0&&t!==`utf-8`)throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${t}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}},a=new TextEncoder,o=Object.freeze({messageBuffer:Object.freeze({create:Q(e=>new n(e),`create`)}),applicationJson:Object.freeze({encoder:Object.freeze({name:`application/json`,encode:Q((e,t)=>{if(t.charset!==`utf-8`)throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${t.charset}`);return Promise.resolve(a.encode(JSON.stringify(e,void 0,0)))},`encode`)}),decoder:Object.freeze({name:`application/json`,decode:Q((e,t)=>{if(!(e instanceof Uint8Array))throw Error(`In a Browser environments only Uint8Arrays are supported.`);return Promise.resolve(JSON.parse(new TextDecoder(t.charset).decode(e)))},`decode`)})}),stream:Object.freeze({asReadableStream:Q(e=>new r(e),`asReadableStream`),asWritableStream:Q(e=>new i(e),`asWritableStream`)}),console,timer:Object.freeze({setTimeout(e,t,...n){let r=setTimeout(e,t,...n);return{dispose:Q(()=>clearTimeout(r),`dispose`)}},setImmediate(e,...t){let n=setTimeout(e,0,...t);return{dispose:Q(()=>clearTimeout(n),`dispose`)}},setInterval(e,t,...n){let r=setInterval(e,t,...n);return{dispose:Q(()=>clearInterval(r),`dispose`)}}})});function s(){return o}Q(s,`RIL`),(function(e){function n(){t.RAL.install(o)}Q(n,`install`),e.install=n})(s||={}),e.default=s}}),RU=JH({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/main.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:Q(function(){return t[n]},`get`)}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0,q$e().default.install();var r=LU();n(LU(),e),e.BrowserMessageReader=class extends r.AbstractMessageReader{static{Q(this,`BrowserMessageReader`)}constructor(e){super(),this._onData=new r.Emitter,this._messageListener=e=>{this._onData.fire(e.data)},e.addEventListener(`error`,e=>this.fireError(e)),e.onmessage=this._messageListener}listen(e){return this._onData.event(e)}},e.BrowserMessageWriter=class extends r.AbstractMessageWriter{static{Q(this,`BrowserMessageWriter`)}constructor(e){super(),this.port=e,this.errorCount=0,e.addEventListener(`error`,e=>this.fireError(e))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};function i(e,t,n,i){return n===void 0&&(n=r.NullLogger),r.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,r.createMessageConnection)(e,t,n,i)}Q(i,`createMessageConnection`),e.createMessageConnection=i}}),zU=JH({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(e,t){"use strict";t.exports=RU()}}),BU=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;var t=RU(),n;(function(e){e.clientToServer=`clientToServer`,e.serverToClient=`serverToClient`,e.both=`both`})(n||(e.MessageDirection=n={})),e.RegistrationType=class{static{Q(this,`RegistrationType`)}constructor(e){this.method=e}},e.ProtocolRequestType0=class extends t.RequestType0{static{Q(this,`ProtocolRequestType0`)}constructor(e){super(e)}},e.ProtocolRequestType=class extends t.RequestType{static{Q(this,`ProtocolRequestType`)}constructor(e){super(e,t.ParameterStructures.byName)}},e.ProtocolNotificationType0=class extends t.NotificationType0{static{Q(this,`ProtocolNotificationType0`)}constructor(e){super(e)}},e.ProtocolNotificationType=class extends t.NotificationType{static{Q(this,`ProtocolNotificationType`)}constructor(e){super(e,t.ParameterStructures.byName)}}}}),VU=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.objectLiteral=e.typedArray=e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(e){return e===!0||e===!1}Q(t,`boolean`),e.boolean=t;function n(e){return typeof e==`string`||e instanceof String}Q(n,`string`),e.string=n;function r(e){return typeof e==`number`||e instanceof Number}Q(r,`number`),e.number=r;function i(e){return e instanceof Error}Q(i,`error`),e.error=i;function a(e){return typeof e==`function`}Q(a,`func`),e.func=a;function o(e){return Array.isArray(e)}Q(o,`array`),e.array=o;function s(e){return o(e)&&e.every(e=>n(e))}Q(s,`stringArray`),e.stringArray=s;function l(e,t){return Array.isArray(e)&&e.every(t)}Q(l,`typedArray`),e.typedArray=l;function u(e){return typeof e==`object`&&!!e}Q(u,`objectLiteral`),e.objectLiteral=u}}),J$e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationRequest=void 0;var t=BU(),n;(function(e){e.method=`textDocument/implementation`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.ImplementationRequest=n={}))}}),Y$e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeDefinitionRequest=void 0;var t=BU(),n;(function(e){e.method=`textDocument/typeDefinition`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.TypeDefinitionRequest=n={}))}}),X$e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;var t=BU(),n;(function(e){e.method=`workspace/workspaceFolders`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(n||(e.WorkspaceFoldersRequest=n={}));var r;(function(e){e.method=`workspace/didChangeWorkspaceFolders`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(r||(e.DidChangeWorkspaceFoldersNotification=r={}))}}),Z$e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationRequest=void 0;var t=BU(),n;(function(e){e.method=`workspace/configuration`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(n||(e.ConfigurationRequest=n={}))}}),Q$e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;var t=BU(),n;(function(e){e.method=`textDocument/documentColor`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.DocumentColorRequest=n={}));var r;(function(e){e.method=`textDocument/colorPresentation`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.ColorPresentationRequest=r={}))}}),$$e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=void 0;var t=BU(),n;(function(e){e.method=`textDocument/foldingRange`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.FoldingRangeRequest=n={}));var r;(function(e){e.method=`workspace/foldingRange/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(r||(e.FoldingRangeRefreshRequest=r={}))}}),e1e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DeclarationRequest=void 0;var t=BU(),n;(function(e){e.method=`textDocument/declaration`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.DeclarationRequest=n={}))}}),t1e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRangeRequest=void 0;var t=BU(),n;(function(e){e.method=`textDocument/selectionRange`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.SelectionRangeRequest=n={}))}}),n1e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;var t=RU(),n=BU(),r;(function(e){e.type=new t.ProgressType;function n(t){return t===e.type}Q(n,`is`),e.is=n})(r||(e.WorkDoneProgress=r={}));var i;(function(e){e.method=`window/workDoneProgress/create`,e.messageDirection=n.MessageDirection.serverToClient,e.type=new n.ProtocolRequestType(e.method)})(i||(e.WorkDoneProgressCreateRequest=i={}));var a;(function(e){e.method=`window/workDoneProgress/cancel`,e.messageDirection=n.MessageDirection.clientToServer,e.type=new n.ProtocolNotificationType(e.method)})(a||(e.WorkDoneProgressCancelNotification=a={}))}}),r1e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;var t=BU(),n;(function(e){e.method=`textDocument/prepareCallHierarchy`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.CallHierarchyPrepareRequest=n={}));var r;(function(e){e.method=`callHierarchy/incomingCalls`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.CallHierarchyIncomingCallsRequest=r={}));var i;(function(e){e.method=`callHierarchy/outgoingCalls`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(i||(e.CallHierarchyOutgoingCallsRequest=i={}))}}),i1e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;var t=BU(),n;(function(e){e.Relative=`relative`})(n||(e.TokenFormat=n={}));var r;(function(e){e.method=`textDocument/semanticTokens`,e.type=new t.RegistrationType(e.method)})(r||(e.SemanticTokensRegistrationType=r={}));var i;(function(e){e.method=`textDocument/semanticTokens/full`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.registrationMethod=r.method})(i||(e.SemanticTokensRequest=i={}));var a;(function(e){e.method=`textDocument/semanticTokens/full/delta`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.registrationMethod=r.method})(a||(e.SemanticTokensDeltaRequest=a={}));var o;(function(e){e.method=`textDocument/semanticTokens/range`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.registrationMethod=r.method})(o||(e.SemanticTokensRangeRequest=o={}));var s;(function(e){e.method=`workspace/semanticTokens/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(s||(e.SemanticTokensRefreshRequest=s={}))}}),a1e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentRequest=void 0;var t=BU(),n;(function(e){e.method=`window/showDocument`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(n||(e.ShowDocumentRequest=n={}))}}),o1e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeRequest=void 0;var t=BU(),n;(function(e){e.method=`textDocument/linkedEditingRange`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.LinkedEditingRangeRequest=n={}))}}),s1e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.DidRenameFilesNotification=e.WillRenameFilesRequest=e.DidCreateFilesNotification=e.WillCreateFilesRequest=e.FileOperationPatternKind=void 0;var t=BU(),n;(function(e){e.file=`file`,e.folder=`folder`})(n||(e.FileOperationPatternKind=n={}));var r;(function(e){e.method=`workspace/willCreateFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.WillCreateFilesRequest=r={}));var i;(function(e){e.method=`workspace/didCreateFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(i||(e.DidCreateFilesNotification=i={}));var a;(function(e){e.method=`workspace/willRenameFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(a||(e.WillRenameFilesRequest=a={}));var o;(function(e){e.method=`workspace/didRenameFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(o||(e.DidRenameFilesNotification=o={}));var s;(function(e){e.method=`workspace/didDeleteFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(s||(e.DidDeleteFilesNotification=s={}));var l;(function(e){e.method=`workspace/willDeleteFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(l||(e.WillDeleteFilesRequest=l={}))}}),c1e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;var t=BU(),n;(function(e){e.document=`document`,e.project=`project`,e.group=`group`,e.scheme=`scheme`,e.global=`global`})(n||(e.UniquenessLevel=n={}));var r;(function(e){e.$import=`import`,e.$export=`export`,e.local=`local`})(r||(e.MonikerKind=r={}));var i;(function(e){e.method=`textDocument/moniker`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(i||(e.MonikerRequest=i={}))}}),l1e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;var t=BU(),n;(function(e){e.method=`textDocument/prepareTypeHierarchy`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.TypeHierarchyPrepareRequest=n={}));var r;(function(e){e.method=`typeHierarchy/supertypes`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.TypeHierarchySupertypesRequest=r={}));var i;(function(e){e.method=`typeHierarchy/subtypes`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(i||(e.TypeHierarchySubtypesRequest=i={}))}}),u1e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;var t=BU(),n;(function(e){e.method=`textDocument/inlineValue`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.InlineValueRequest=n={}));var r;(function(e){e.method=`workspace/inlineValue/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(r||(e.InlineValueRefreshRequest=r={}))}}),d1e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;var t=BU(),n;(function(e){e.method=`textDocument/inlayHint`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.InlayHintRequest=n={}));var r;(function(e){e.method=`inlayHint/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.InlayHintResolveRequest=r={}));var i;(function(e){e.method=`workspace/inlayHint/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(i||(e.InlayHintRefreshRequest=i={}))}}),f1e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;var t=RU(),n=VU(),r=BU(),i;(function(e){function t(e){let t=e;return t&&n.boolean(t.retriggerRequest)}Q(t,`is`),e.is=t})(i||(e.DiagnosticServerCancellationData=i={}));var a;(function(e){e.Full=`full`,e.Unchanged=`unchanged`})(a||(e.DocumentDiagnosticReportKind=a={}));var o;(function(e){e.method=`textDocument/diagnostic`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolRequestType(e.method),e.partialResult=new t.ProgressType})(o||(e.DocumentDiagnosticRequest=o={}));var s;(function(e){e.method=`workspace/diagnostic`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolRequestType(e.method),e.partialResult=new t.ProgressType})(s||(e.WorkspaceDiagnosticRequest=s={}));var l;(function(e){e.method=`workspace/diagnostic/refresh`,e.messageDirection=r.MessageDirection.serverToClient,e.type=new r.ProtocolRequestType0(e.method)})(l||(e.DiagnosticRefreshRequest=l={}))}}),p1e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=void 0;var t=(kU(),$H(eU)),n=VU(),r=BU(),i;(function(e){e.Markup=1,e.Code=2;function t(e){return e===1||e===2}Q(t,`is`),e.is=t})(i||(e.NotebookCellKind=i={}));var a;(function(e){function r(e,t){let n={executionOrder:e};return(t===!0||t===!1)&&(n.success=t),n}Q(r,`create`),e.create=r;function i(e){let r=e;return n.objectLiteral(r)&&t.uinteger.is(r.executionOrder)&&(r.success===void 0||n.boolean(r.success))}Q(i,`is`),e.is=i;function a(e,t){return e===t?!0:e==null||t==null?!1:e.executionOrder===t.executionOrder&&e.success===t.success}Q(a,`equals`),e.equals=a})(a||(e.ExecutionSummary=a={}));var o;(function(e){function r(e,t){return{kind:e,document:t}}Q(r,`create`),e.create=r;function o(e){let r=e;return n.objectLiteral(r)&&i.is(r.kind)&&t.DocumentUri.is(r.document)&&(r.metadata===void 0||n.objectLiteral(r.metadata))}Q(o,`is`),e.is=o;function s(e,t){let n=new Set;return e.document!==t.document&&n.add(`document`),e.kind!==t.kind&&n.add(`kind`),e.executionSummary!==t.executionSummary&&n.add(`executionSummary`),(e.metadata!==void 0||t.metadata!==void 0)&&!l(e.metadata,t.metadata)&&n.add(`metadata`),(e.executionSummary!==void 0||t.executionSummary!==void 0)&&!a.equals(e.executionSummary,t.executionSummary)&&n.add(`executionSummary`),n}Q(s,`diff`),e.diff=s;function l(e,t){if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!=`object`)return!1;let r=Array.isArray(e),i=Array.isArray(t);if(r!==i)return!1;if(r&&i){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!l(e[n],t[n]))return!1}if(n.objectLiteral(e)&&n.objectLiteral(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length||(n.sort(),r.sort(),!l(n,r)))return!1;for(let r=0;r<n.length;r++){let i=n[r];if(!l(e[i],t[i]))return!1}}return!0}Q(l,`equalsMetadata`)})(o||(e.NotebookCell=o={}));var s;(function(e){function r(e,t,n,r){return{uri:e,notebookType:t,version:n,cells:r}}Q(r,`create`),e.create=r;function i(e){let r=e;return n.objectLiteral(r)&&n.string(r.uri)&&t.integer.is(r.version)&&n.typedArray(r.cells,o.is)}Q(i,`is`),e.is=i})(s||(e.NotebookDocument=s={}));var l;(function(e){e.method=`notebookDocument/sync`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.RegistrationType(e.method)})(l||(e.NotebookDocumentSyncRegistrationType=l={}));var u;(function(e){e.method=`notebookDocument/didOpen`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolNotificationType(e.method),e.registrationMethod=l.method})(u||(e.DidOpenNotebookDocumentNotification=u={}));var d;(function(e){function r(e){let r=e;return n.objectLiteral(r)&&t.uinteger.is(r.start)&&t.uinteger.is(r.deleteCount)&&(r.cells===void 0||n.typedArray(r.cells,o.is))}Q(r,`is`),e.is=r;function i(e,t,n){let r={start:e,deleteCount:t};return n!==void 0&&(r.cells=n),r}Q(i,`create`),e.create=i})(d||(e.NotebookCellArrayChange=d={}));var f;(function(e){e.method=`notebookDocument/didChange`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolNotificationType(e.method),e.registrationMethod=l.method})(f||(e.DidChangeNotebookDocumentNotification=f={}));var p;(function(e){e.method=`notebookDocument/didSave`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolNotificationType(e.method),e.registrationMethod=l.method})(p||(e.DidSaveNotebookDocumentNotification=p={}));var m;(function(e){e.method=`notebookDocument/didClose`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolNotificationType(e.method),e.registrationMethod=l.method})(m||(e.DidCloseNotebookDocumentNotification=m={}))}}),m1e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineCompletion.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InlineCompletionRequest=void 0;var t=BU(),n;(function(e){e.method=`textDocument/inlineCompletion`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.InlineCompletionRequest=n={}))}}),h1e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceSymbolRequest=e.CodeActionResolveRequest=e.CodeActionRequest=e.DocumentSymbolRequest=e.DocumentHighlightRequest=e.ReferencesRequest=e.DefinitionRequest=e.SignatureHelpRequest=e.SignatureHelpTriggerKind=e.HoverRequest=e.CompletionResolveRequest=e.CompletionRequest=e.CompletionTriggerKind=e.PublishDiagnosticsNotification=e.WatchKind=e.RelativePattern=e.FileChangeType=e.DidChangeWatchedFilesNotification=e.WillSaveTextDocumentWaitUntilRequest=e.WillSaveTextDocumentNotification=e.TextDocumentSaveReason=e.DidSaveTextDocumentNotification=e.DidCloseTextDocumentNotification=e.DidChangeTextDocumentNotification=e.TextDocumentContentChangeEvent=e.DidOpenTextDocumentNotification=e.TextDocumentSyncKind=e.TelemetryEventNotification=e.LogMessageNotification=e.ShowMessageRequest=e.ShowMessageNotification=e.MessageType=e.DidChangeConfigurationNotification=e.ExitNotification=e.ShutdownRequest=e.InitializedNotification=e.InitializeErrorCodes=e.InitializeRequest=e.WorkDoneProgressOptions=e.TextDocumentRegistrationOptions=e.StaticRegistrationOptions=e.PositionEncodingKind=e.FailureHandlingKind=e.ResourceOperationKind=e.UnregistrationRequest=e.RegistrationRequest=e.DocumentSelector=e.NotebookCellTextDocumentFilter=e.NotebookDocumentFilter=e.TextDocumentFilter=void 0,e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.WillRenameFilesRequest=e.DidRenameFilesNotification=e.WillCreateFilesRequest=e.DidCreateFilesNotification=e.FileOperationPatternKind=e.LinkedEditingRangeRequest=e.ShowDocumentRequest=e.SemanticTokensRegistrationType=e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.TokenFormat=e.CallHierarchyPrepareRequest=e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=e.SelectionRangeRequest=e.DeclarationRequest=e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=e.ColorPresentationRequest=e.DocumentColorRequest=e.ConfigurationRequest=e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=e.TypeDefinitionRequest=e.ImplementationRequest=e.ApplyWorkspaceEditRequest=e.ExecuteCommandRequest=e.PrepareRenameRequest=e.RenameRequest=e.PrepareSupportDefaultBehavior=e.DocumentOnTypeFormattingRequest=e.DocumentRangesFormattingRequest=e.DocumentRangeFormattingRequest=e.DocumentFormattingRequest=e.DocumentLinkResolveRequest=e.DocumentLinkRequest=e.CodeLensRefreshRequest=e.CodeLensResolveRequest=e.CodeLensRequest=e.WorkspaceSymbolResolveRequest=void 0,e.InlineCompletionRequest=e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=e.InlineValueRefreshRequest=e.InlineValueRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchySubtypesRequest=e.TypeHierarchyPrepareRequest=void 0;var t=BU(),n=(kU(),$H(eU)),r=VU(),i=J$e();Object.defineProperty(e,"ImplementationRequest",{enumerable:!0,get:Q(function(){return i.ImplementationRequest},`get`)});var a=Y$e();Object.defineProperty(e,"TypeDefinitionRequest",{enumerable:!0,get:Q(function(){return a.TypeDefinitionRequest},`get`)});var o=X$e();Object.defineProperty(e,"WorkspaceFoldersRequest",{enumerable:!0,get:Q(function(){return o.WorkspaceFoldersRequest},`get`)}),Object.defineProperty(e,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:Q(function(){return o.DidChangeWorkspaceFoldersNotification},`get`)});var s=Z$e();Object.defineProperty(e,"ConfigurationRequest",{enumerable:!0,get:Q(function(){return s.ConfigurationRequest},`get`)});var l=Q$e();Object.defineProperty(e,"DocumentColorRequest",{enumerable:!0,get:Q(function(){return l.DocumentColorRequest},`get`)}),Object.defineProperty(e,"ColorPresentationRequest",{enumerable:!0,get:Q(function(){return l.ColorPresentationRequest},`get`)});var u=$$e();Object.defineProperty(e,"FoldingRangeRequest",{enumerable:!0,get:Q(function(){return u.FoldingRangeRequest},`get`)}),Object.defineProperty(e,"FoldingRangeRefreshRequest",{enumerable:!0,get:Q(function(){return u.FoldingRangeRefreshRequest},`get`)});var d=e1e();Object.defineProperty(e,"DeclarationRequest",{enumerable:!0,get:Q(function(){return d.DeclarationRequest},`get`)});var f=t1e();Object.defineProperty(e,"SelectionRangeRequest",{enumerable:!0,get:Q(function(){return f.SelectionRangeRequest},`get`)});var p=n1e();Object.defineProperty(e,"WorkDoneProgress",{enumerable:!0,get:Q(function(){return p.WorkDoneProgress},`get`)}),Object.defineProperty(e,"WorkDoneProgressCreateRequest",{enumerable:!0,get:Q(function(){return p.WorkDoneProgressCreateRequest},`get`)}),Object.defineProperty(e,"WorkDoneProgressCancelNotification",{enumerable:!0,get:Q(function(){return p.WorkDoneProgressCancelNotification},`get`)});var m=r1e();Object.defineProperty(e,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:Q(function(){return m.CallHierarchyIncomingCallsRequest},`get`)}),Object.defineProperty(e,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:Q(function(){return m.CallHierarchyOutgoingCallsRequest},`get`)}),Object.defineProperty(e,"CallHierarchyPrepareRequest",{enumerable:!0,get:Q(function(){return m.CallHierarchyPrepareRequest},`get`)});var h=i1e();Object.defineProperty(e,"TokenFormat",{enumerable:!0,get:Q(function(){return h.TokenFormat},`get`)}),Object.defineProperty(e,"SemanticTokensRequest",{enumerable:!0,get:Q(function(){return h.SemanticTokensRequest},`get`)}),Object.defineProperty(e,"SemanticTokensDeltaRequest",{enumerable:!0,get:Q(function(){return h.SemanticTokensDeltaRequest},`get`)}),Object.defineProperty(e,"SemanticTokensRangeRequest",{enumerable:!0,get:Q(function(){return h.SemanticTokensRangeRequest},`get`)}),Object.defineProperty(e,"SemanticTokensRefreshRequest",{enumerable:!0,get:Q(function(){return h.SemanticTokensRefreshRequest},`get`)}),Object.defineProperty(e,"SemanticTokensRegistrationType",{enumerable:!0,get:Q(function(){return h.SemanticTokensRegistrationType},`get`)});var g=a1e();Object.defineProperty(e,"ShowDocumentRequest",{enumerable:!0,get:Q(function(){return g.ShowDocumentRequest},`get`)});var _=o1e();Object.defineProperty(e,"LinkedEditingRangeRequest",{enumerable:!0,get:Q(function(){return _.LinkedEditingRangeRequest},`get`)});var v=s1e();Object.defineProperty(e,"FileOperationPatternKind",{enumerable:!0,get:Q(function(){return v.FileOperationPatternKind},`get`)}),Object.defineProperty(e,"DidCreateFilesNotification",{enumerable:!0,get:Q(function(){return v.DidCreateFilesNotification},`get`)}),Object.defineProperty(e,"WillCreateFilesRequest",{enumerable:!0,get:Q(function(){return v.WillCreateFilesRequest},`get`)}),Object.defineProperty(e,"DidRenameFilesNotification",{enumerable:!0,get:Q(function(){return v.DidRenameFilesNotification},`get`)}),Object.defineProperty(e,"WillRenameFilesRequest",{enumerable:!0,get:Q(function(){return v.WillRenameFilesRequest},`get`)}),Object.defineProperty(e,"DidDeleteFilesNotification",{enumerable:!0,get:Q(function(){return v.DidDeleteFilesNotification},`get`)}),Object.defineProperty(e,"WillDeleteFilesRequest",{enumerable:!0,get:Q(function(){return v.WillDeleteFilesRequest},`get`)});var y=c1e();Object.defineProperty(e,"UniquenessLevel",{enumerable:!0,get:Q(function(){return y.UniquenessLevel},`get`)}),Object.defineProperty(e,"MonikerKind",{enumerable:!0,get:Q(function(){return y.MonikerKind},`get`)}),Object.defineProperty(e,"MonikerRequest",{enumerable:!0,get:Q(function(){return y.MonikerRequest},`get`)});var b=l1e();Object.defineProperty(e,"TypeHierarchyPrepareRequest",{enumerable:!0,get:Q(function(){return b.TypeHierarchyPrepareRequest},`get`)}),Object.defineProperty(e,"TypeHierarchySubtypesRequest",{enumerable:!0,get:Q(function(){return b.TypeHierarchySubtypesRequest},`get`)}),Object.defineProperty(e,"TypeHierarchySupertypesRequest",{enumerable:!0,get:Q(function(){return b.TypeHierarchySupertypesRequest},`get`)});var x=u1e();Object.defineProperty(e,"InlineValueRequest",{enumerable:!0,get:Q(function(){return x.InlineValueRequest},`get`)}),Object.defineProperty(e,"InlineValueRefreshRequest",{enumerable:!0,get:Q(function(){return x.InlineValueRefreshRequest},`get`)});var S=d1e();Object.defineProperty(e,"InlayHintRequest",{enumerable:!0,get:Q(function(){return S.InlayHintRequest},`get`)}),Object.defineProperty(e,"InlayHintResolveRequest",{enumerable:!0,get:Q(function(){return S.InlayHintResolveRequest},`get`)}),Object.defineProperty(e,"InlayHintRefreshRequest",{enumerable:!0,get:Q(function(){return S.InlayHintRefreshRequest},`get`)});var C=f1e();Object.defineProperty(e,"DiagnosticServerCancellationData",{enumerable:!0,get:Q(function(){return C.DiagnosticServerCancellationData},`get`)}),Object.defineProperty(e,"DocumentDiagnosticReportKind",{enumerable:!0,get:Q(function(){return C.DocumentDiagnosticReportKind},`get`)}),Object.defineProperty(e,"DocumentDiagnosticRequest",{enumerable:!0,get:Q(function(){return C.DocumentDiagnosticRequest},`get`)}),Object.defineProperty(e,"WorkspaceDiagnosticRequest",{enumerable:!0,get:Q(function(){return C.WorkspaceDiagnosticRequest},`get`)}),Object.defineProperty(e,"DiagnosticRefreshRequest",{enumerable:!0,get:Q(function(){return C.DiagnosticRefreshRequest},`get`)});var w=p1e();Object.defineProperty(e,"NotebookCellKind",{enumerable:!0,get:Q(function(){return w.NotebookCellKind},`get`)}),Object.defineProperty(e,"ExecutionSummary",{enumerable:!0,get:Q(function(){return w.ExecutionSummary},`get`)}),Object.defineProperty(e,"NotebookCell",{enumerable:!0,get:Q(function(){return w.NotebookCell},`get`)}),Object.defineProperty(e,"NotebookDocument",{enumerable:!0,get:Q(function(){return w.NotebookDocument},`get`)}),Object.defineProperty(e,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:Q(function(){return w.NotebookDocumentSyncRegistrationType},`get`)}),Object.defineProperty(e,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:Q(function(){return w.DidOpenNotebookDocumentNotification},`get`)}),Object.defineProperty(e,"NotebookCellArrayChange",{enumerable:!0,get:Q(function(){return w.NotebookCellArrayChange},`get`)}),Object.defineProperty(e,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:Q(function(){return w.DidChangeNotebookDocumentNotification},`get`)}),Object.defineProperty(e,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:Q(function(){return w.DidSaveNotebookDocumentNotification},`get`)}),Object.defineProperty(e,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:Q(function(){return w.DidCloseNotebookDocumentNotification},`get`)});var T=m1e();Object.defineProperty(e,"InlineCompletionRequest",{enumerable:!0,get:Q(function(){return T.InlineCompletionRequest},`get`)});var E;(function(e){function t(e){let t=e;return r.string(t)||r.string(t.language)||r.string(t.scheme)||r.string(t.pattern)}Q(t,`is`),e.is=t})(E||(e.TextDocumentFilter=E={}));var D;(function(e){function t(e){let t=e;return r.objectLiteral(t)&&(r.string(t.notebookType)||r.string(t.scheme)||r.string(t.pattern))}Q(t,`is`),e.is=t})(D||(e.NotebookDocumentFilter=D={}));var O;(function(e){function t(e){let t=e;return r.objectLiteral(t)&&(r.string(t.notebook)||D.is(t.notebook))&&(t.language===void 0||r.string(t.language))}Q(t,`is`),e.is=t})(O||(e.NotebookCellTextDocumentFilter=O={}));var k;(function(e){function t(e){if(!Array.isArray(e))return!1;for(let t of e)if(!r.string(t)&&!E.is(t)&&!O.is(t))return!1;return!0}Q(t,`is`),e.is=t})(k||(e.DocumentSelector=k={}));var A;(function(e){e.method=`client/registerCapability`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(A||(e.RegistrationRequest=A={}));var j;(function(e){e.method=`client/unregisterCapability`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(j||(e.UnregistrationRequest=j={}));var M;(function(e){e.Create=`create`,e.Rename=`rename`,e.Delete=`delete`})(M||(e.ResourceOperationKind=M={}));var N;(function(e){e.Abort=`abort`,e.Transactional=`transactional`,e.TextOnlyTransactional=`textOnlyTransactional`,e.Undo=`undo`})(N||(e.FailureHandlingKind=N={}));var P;(function(e){e.UTF8=`utf-8`,e.UTF16=`utf-16`,e.UTF32=`utf-32`})(P||(e.PositionEncodingKind=P={}));var F;(function(e){function t(e){let t=e;return t&&r.string(t.id)&&t.id.length>0}Q(t,`hasId`),e.hasId=t})(F||(e.StaticRegistrationOptions=F={}));var I;(function(e){function t(e){let t=e;return t&&(t.documentSelector===null||k.is(t.documentSelector))}Q(t,`is`),e.is=t})(I||(e.TextDocumentRegistrationOptions=I={}));var L;(function(e){function t(e){let t=e;return r.objectLiteral(t)&&(t.workDoneProgress===void 0||r.boolean(t.workDoneProgress))}Q(t,`is`),e.is=t;function n(e){let t=e;return t&&r.boolean(t.workDoneProgress)}Q(n,`hasWorkDoneProgress`),e.hasWorkDoneProgress=n})(L||(e.WorkDoneProgressOptions=L={}));var R;(function(e){e.method=`initialize`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(R||(e.InitializeRequest=R={}));var ee;(function(e){e.unknownProtocolVersion=1})(ee||(e.InitializeErrorCodes=ee={}));var z;(function(e){e.method=`initialized`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(z||(e.InitializedNotification=z={}));var B;(function(e){e.method=`shutdown`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType0(e.method)})(B||(e.ShutdownRequest=B={}));var te;(function(e){e.method=`exit`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType0(e.method)})(te||(e.ExitNotification=te={}));var ne;(function(e){e.method=`workspace/didChangeConfiguration`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(ne||(e.DidChangeConfigurationNotification=ne={}));var re;(function(e){e.Error=1,e.Warning=2,e.Info=3,e.Log=4,e.Debug=5})(re||(e.MessageType=re={}));var ie;(function(e){e.method=`window/showMessage`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)})(ie||(e.ShowMessageNotification=ie={}));var ae;(function(e){e.method=`window/showMessageRequest`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(ae||(e.ShowMessageRequest=ae={}));var oe;(function(e){e.method=`window/logMessage`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)})(oe||(e.LogMessageNotification=oe={}));var se;(function(e){e.method=`telemetry/event`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)})(se||(e.TelemetryEventNotification=se={}));var ce;(function(e){e.None=0,e.Full=1,e.Incremental=2})(ce||(e.TextDocumentSyncKind=ce={}));var le;(function(e){e.method=`textDocument/didOpen`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(le||(e.DidOpenTextDocumentNotification=le={}));var ue;(function(e){function t(e){let t=e;return t!=null&&typeof t.text==`string`&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength==`number`)}Q(t,`isIncremental`),e.isIncremental=t;function n(e){let t=e;return t!=null&&typeof t.text==`string`&&t.range===void 0&&t.rangeLength===void 0}Q(n,`isFull`),e.isFull=n})(ue||(e.TextDocumentContentChangeEvent=ue={}));var de;(function(e){e.method=`textDocument/didChange`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(de||(e.DidChangeTextDocumentNotification=de={}));var fe;(function(e){e.method=`textDocument/didClose`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(fe||(e.DidCloseTextDocumentNotification=fe={}));var pe;(function(e){e.method=`textDocument/didSave`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(pe||(e.DidSaveTextDocumentNotification=pe={}));var me;(function(e){e.Manual=1,e.AfterDelay=2,e.FocusOut=3})(me||(e.TextDocumentSaveReason=me={}));var he;(function(e){e.method=`textDocument/willSave`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(he||(e.WillSaveTextDocumentNotification=he={}));var ge;(function(e){e.method=`textDocument/willSaveWaitUntil`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(ge||(e.WillSaveTextDocumentWaitUntilRequest=ge={}));var _e;(function(e){e.method=`workspace/didChangeWatchedFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(_e||(e.DidChangeWatchedFilesNotification=_e={}));var ve;(function(e){e.Created=1,e.Changed=2,e.Deleted=3})(ve||(e.FileChangeType=ve={}));var ye;(function(e){function t(e){let t=e;return r.objectLiteral(t)&&(n.URI.is(t.baseUri)||n.WorkspaceFolder.is(t.baseUri))&&r.string(t.pattern)}Q(t,`is`),e.is=t})(ye||(e.RelativePattern=ye={}));var be;(function(e){e.Create=1,e.Change=2,e.Delete=4})(be||(e.WatchKind=be={}));var xe;(function(e){e.method=`textDocument/publishDiagnostics`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)})(xe||(e.PublishDiagnosticsNotification=xe={}));var Se;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.TriggerForIncompleteCompletions=3})(Se||(e.CompletionTriggerKind=Se={}));var V;(function(e){e.method=`textDocument/completion`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(V||(e.CompletionRequest=V={}));var Ce;(function(e){e.method=`completionItem/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ce||(e.CompletionResolveRequest=Ce={}));var we;(function(e){e.method=`textDocument/hover`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(we||(e.HoverRequest=we={}));var Te;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.ContentChange=3})(Te||(e.SignatureHelpTriggerKind=Te={}));var Ee;(function(e){e.method=`textDocument/signatureHelp`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ee||(e.SignatureHelpRequest=Ee={}));var De;(function(e){e.method=`textDocument/definition`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(De||(e.DefinitionRequest=De={}));var H;(function(e){e.method=`textDocument/references`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(H||(e.ReferencesRequest=H={}));var Oe;(function(e){e.method=`textDocument/documentHighlight`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Oe||(e.DocumentHighlightRequest=Oe={}));var ke;(function(e){e.method=`textDocument/documentSymbol`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(ke||(e.DocumentSymbolRequest=ke={}));var Ae;(function(e){e.method=`textDocument/codeAction`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ae||(e.CodeActionRequest=Ae={}));var U;(function(e){e.method=`codeAction/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(U||(e.CodeActionResolveRequest=U={}));var je;(function(e){e.method=`workspace/symbol`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(je||(e.WorkspaceSymbolRequest=je={}));var Me;(function(e){e.method=`workspaceSymbol/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Me||(e.WorkspaceSymbolResolveRequest=Me={}));var Ne;(function(e){e.method=`textDocument/codeLens`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ne||(e.CodeLensRequest=Ne={}));var Pe;(function(e){e.method=`codeLens/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Pe||(e.CodeLensResolveRequest=Pe={}));var Fe;(function(e){e.method=`workspace/codeLens/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(Fe||(e.CodeLensRefreshRequest=Fe={}));var Ie;(function(e){e.method=`textDocument/documentLink`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ie||(e.DocumentLinkRequest=Ie={}));var Le;(function(e){e.method=`documentLink/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Le||(e.DocumentLinkResolveRequest=Le={}));var Re;(function(e){e.method=`textDocument/formatting`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Re||(e.DocumentFormattingRequest=Re={}));var ze;(function(e){e.method=`textDocument/rangeFormatting`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(ze||(e.DocumentRangeFormattingRequest=ze={}));var Be;(function(e){e.method=`textDocument/rangesFormatting`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Be||(e.DocumentRangesFormattingRequest=Be={}));var Ve;(function(e){e.method=`textDocument/onTypeFormatting`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ve||(e.DocumentOnTypeFormattingRequest=Ve={}));var He;(function(e){e.Identifier=1})(He||(e.PrepareSupportDefaultBehavior=He={}));var Ue;(function(e){e.method=`textDocument/rename`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ue||(e.RenameRequest=Ue={}));var We;(function(e){e.method=`textDocument/prepareRename`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(We||(e.PrepareRenameRequest=We={}));var Ge;(function(e){e.method=`workspace/executeCommand`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ge||(e.ExecuteCommandRequest=Ge={}));var Ke;(function(e){e.method=`workspace/applyEdit`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(`workspace/applyEdit`)})(Ke||(e.ApplyWorkspaceEditRequest=Ke={}))}}),g1e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var t=RU();function n(e,n,r,i){return t.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,t.createMessageConnection)(e,n,r,i)}Q(n,`createProtocolConnection`),e.createProtocolConnection=n}}),_1e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:Q(function(){return t[n]},`get`)}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,n(RU(),e),n((kU(),$H(eU)),e),n(BU(),e),n(h1e(),e);var r=g1e();Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:Q(function(){return r.createProtocolConnection},`get`)});var i;(function(e){e.lspReservedErrorRangeStart=-32899,e.RequestFailed=-32803,e.ServerCancelled=-32802,e.ContentModified=-32801,e.RequestCancelled=-32800,e.lspReservedErrorRangeEnd=-32800})(i||(e.LSPErrorCodes=i={}))}}),v1e=JH({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/browser/main.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:Q(function(){return t[n]},`get`)}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var r=zU();n(zU(),e),n(_1e(),e);function i(e,t,n,i){return(0,r.createMessageConnection)(e,t,n,i)}Q(i,`createProtocolConnection`),e.createProtocolConnection=i}}),HU={},YH(HU,{AbstractAstReflection:()=>WU,AbstractCstNode:()=>DZ,AbstractLangiumParser:()=>PZ,AbstractParserErrorMessageProvider:()=>IZ,AbstractThreadedAsyncParser:()=>eet,AstUtils:()=>XU,BiMap:()=>cQ,Cancellation:()=>UZ,CompositeCstNodeImpl:()=>kZ,ContextCache:()=>mQ,CstNodeBuilder:()=>EZ,CstUtils:()=>UU,DEFAULT_TOKENIZE_OPTIONS:()=>IQ,DONE_RESULT:()=>qU,DatatypeSymbol:()=>jZ,DefaultAstNodeDescriptionProvider:()=>TQ,DefaultAstNodeLocator:()=>DQ,DefaultAsyncParser:()=>GQ,DefaultCommentProvider:()=>WQ,DefaultConfigurationProvider:()=>kQ,DefaultDocumentBuilder:()=>MQ,DefaultDocumentValidator:()=>CQ,DefaultHydrator:()=>qQ,DefaultIndexManager:()=>NQ,DefaultJsonSerializer:()=>vQ,DefaultLangiumDocumentFactory:()=>tQ,DefaultLangiumDocuments:()=>nQ,DefaultLangiumProfiler:()=>oet,DefaultLexer:()=>LQ,DefaultLexerErrorMessageProvider:()=>FQ,DefaultLinker:()=>iQ,DefaultNameProvider:()=>aQ,DefaultReferenceDescriptionProvider:()=>EQ,DefaultReferences:()=>oQ,DefaultScopeComputation:()=>lQ,DefaultScopeProvider:()=>_Q,DefaultServiceRegistry:()=>yQ,DefaultTokenBuilder:()=>BZ,DefaultValueConverter:()=>VZ,DefaultWorkspaceLock:()=>KQ,DefaultWorkspaceManager:()=>PQ,Deferred:()=>qZ,Disposable:()=>jQ,DisposableCache:()=>fQ,DocumentCache:()=>hQ,DocumentState:()=>eQ,DocumentValidator:()=>wQ,EMPTY_SCOPE:()=>X9e,EMPTY_STREAM:()=>KU,EmptyFileSystem:()=>t$,EmptyFileSystemProvider:()=>e$,ErrorWithLocation:()=>eG,GrammarAST:()=>ZU,GrammarUtils:()=>$W,IndentationAwareLexer:()=>ret,IndentationAwareTokenBuilder:()=>QQ,JSDocDocumentationProvider:()=>UQ,LangiumCompletionParser:()=>RZ,LangiumParser:()=>FZ,LangiumParserErrorMessageProvider:()=>LZ,LeafCstNodeImpl:()=>OZ,LexingMode:()=>ZQ,MapScope:()=>Y9e,Module:()=>net,MultiMap:()=>sQ,MultiMapScope:()=>dQ,OperationCancelled:()=>KZ,ParserWorker:()=>tet,ProfilingTask:()=>n$,Reduction:()=>YU,RefResolving:()=>rQ,RegExpUtils:()=>tG,RootCstNodeImpl:()=>AZ,SimpleCache:()=>pQ,StreamImpl:()=>GU,StreamScope:()=>uQ,TextDocument:()=>YZ,TreeStreamImpl:()=>JU,URI:()=>XZ,UriTrie:()=>$Z,UriUtils:()=>QZ,VALIDATE_EACH_NODE:()=>SQ,ValidationCategory:()=>bQ,ValidationRegistry:()=>xQ,ValueConverter:()=>HZ,WorkspaceCache:()=>gQ,assertCondition:()=>Oz,assertUnreachable:()=>Dz,createCompletionParser:()=>oH,createDefaultCoreModule:()=>RH,createDefaultSharedCoreModule:()=>zH,createGrammarConfig:()=>fB,createLangiumParser:()=>sH,createParser:()=>QV,delayNextTick:()=>lH,diagnosticData:()=>xH,eagerLoad:()=>VH,getDiagnosticRange:()=>SH,indentationBuilderDefaultOptions:()=>XQ,inject:()=>BH,interruptAndCheck:()=>pH,isAstNode:()=>uR,isAstNodeDescription:()=>pR,isAstNodeWithComment:()=>yH,isCompositeCstNode:()=>hR,isIMultiModeLexerDefinition:()=>EH,isJSDoc:()=>kH,isLeafCstNode:()=>gR,isLinkingError:()=>mR,isMultiReference:()=>fR,isNamed:()=>vH,isOperationCancelled:()=>fH,isReference:()=>dR,isRootCstNode:()=>_R,isTokenTypeArray:()=>TH,isTokenTypeDictionary:()=>DH,loadGrammarFromJson:()=>GH,parseJSDoc:()=>OH,prepareLangiumParser:()=>cH,setInterruptionPeriod:()=>dH,startCancelableOperation:()=>uH,stream:()=>yR,toDiagnosticData:()=>wH,toDiagnosticSeverity:()=>CH}),UU={},YH(UU,{DefaultNameRegexp:()=>QW,RangeComparison:()=>ZW,compareRange:()=>vz,findCommentNode:()=>bz,findDeclarationNodeAtOffset:()=>QUe,findLeafNodeAtOffset:()=>Sz,findLeafNodeBeforeOffset:()=>Cz,flattenCst:()=>ZUe,getDatatypeNode:()=>XUe,getInteriorNodes:()=>tWe,getNextNode:()=>$Ue,getPreviousNode:()=>Tz,getStartlineNode:()=>eWe,inRange:()=>yz,isChildNode:()=>hz,isCommentNode:()=>xz,streamCst:()=>mz,toDocumentSegment:()=>_z,tokenToRange:()=>gz}),Q(uR,`isAstNode`),Q(dR,`isReference`),Q(fR,`isMultiReference`),Q(pR,`isAstNodeDescription`),Q(mR,`isLinkingError`),WU=class{static{Q(this,`AbstractAstReflection`)}constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){let t=this.types[e.container.$type];if(!t)throw Error(`Type ${e.container.$type||`undefined`} not found.`);let n=t.properties[e.property]?.referenceType;if(!n)throw Error(`Property ${e.property||`undefined`} of type ${e.container.$type} is not a reference.`);return n}getTypeMetaData(e){return this.types[e]||{name:e,properties:{},superTypes:[]}}isInstance(e,t){return uR(e)&&this.isSubtype(e.$type,t)}isSubtype(e,t){if(e===t)return!0;let n=this.subtypes[e];n||=this.subtypes[e]={};let r=n[t];if(r!==void 0)return r;{let r=this.types[e],i=r?r.superTypes.some(e=>this.isSubtype(e,t)):!1;return n[t]=i,i}}getAllSubTypes(e){let t=this.allSubtypes[e];if(t)return t;{let t=this.getAllTypes(),n=[];for(let r of t)this.isSubtype(r,e)&&n.push(r);return this.allSubtypes[e]=n,n}}},Q(hR,`isCompositeCstNode`),Q(gR,`isLeafCstNode`),Q(_R,`isRootCstNode`),GU=class e{static{Q(this,`StreamImpl`)}constructor(e,t){this.startFn=e,this.nextFn=t}iterator(){let e={state:this.startFn(),next:Q(()=>this.nextFn(e.state),`next`),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){let e=this.iterator(),t=0,n=e.next();for(;!n.done;)t++,n=e.next();return t}toArray(){let e=[],t=this.iterator(),n;do n=t.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,t){let n=this.map(n=>[e?e(n):n,t?t(n):n]);return new Map(n)}toString(){return this.join()}concat(t){return new e(()=>({first:this.startFn(),firstDone:!1,iterator:t[Symbol.iterator]()}),e=>{let t;if(!e.firstDone){do if(t=this.nextFn(e.first),!t.done)return t;while(!t.done);e.firstDone=!0}do if(t=e.iterator.next(),!t.done)return t;while(!t.done);return qU})}join(e=`,`){let t=this.iterator(),n=``,r,i=!1;do r=t.next(),r.done||(i&&(n+=e),n+=MUe(r.value)),i=!0;while(!r.done);return n}indexOf(e,t=0){let n=this.iterator(),r=0,i=n.next();for(;!i.done;){if(r>=t&&i.value===e)return r;i=n.next(),r++}return-1}every(e){let t=this.iterator(),n=t.next();for(;!n.done;){if(!e(n.value))return!1;n=t.next()}return!0}some(e){let t=this.iterator(),n=t.next();for(;!n.done;){if(e(n.value))return!0;n=t.next()}return!1}forEach(e){let t=this.iterator(),n=0,r=t.next();for(;!r.done;)e(r.value,n),r=t.next(),n++}map(t){return new e(this.startFn,e=>{let{done:n,value:r}=this.nextFn(e);return n?qU:{done:!1,value:t(r)}})}filter(t){return new e(this.startFn,e=>{let n;do if(n=this.nextFn(e),!n.done&&t(n.value))return n;while(!n.done);return qU})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,t){let n=this.iterator(),r=t,i=n.next();for(;!i.done;)r=r===void 0?i.value:e(r,i.value),i=n.next();return r}reduceRight(e,t){return this.recursiveReduce(this.iterator(),e,t)}recursiveReduce(e,t,n){let r=e.next();if(r.done)return n;let i=this.recursiveReduce(e,t,n);return i===void 0?r.value:t(i,r.value)}find(e){let t=this.iterator(),n=t.next();for(;!n.done;){if(e(n.value))return n.value;n=t.next()}}findIndex(e){let t=this.iterator(),n=0,r=t.next();for(;!r.done;){if(e(r.value))return n;r=t.next(),n++}return-1}includes(e){let t=this.iterator(),n=t.next();for(;!n.done;){if(n.value===e)return!0;n=t.next()}return!1}flatMap(t){return new e(()=>({this:this.startFn()}),e=>{do{if(e.iterator){let t=e.iterator.next();if(t.done)e.iterator=void 0;else return t}let{done:n,value:r}=this.nextFn(e.this);if(!n){let n=t(r);if(vR(n))e.iterator=n[Symbol.iterator]();else return{done:!1,value:n}}}while(e.iterator);return qU})}flat(t){if(t===void 0&&(t=1),t<=0)return this;let n=t>1?this.flat(t-1):this;return new e(()=>({this:n.startFn()}),e=>{do{if(e.iterator){let t=e.iterator.next();if(t.done)e.iterator=void 0;else return t}let{done:t,value:r}=n.nextFn(e.this);if(!t){if(vR(r))e.iterator=r[Symbol.iterator]();else return{done:!1,value:r}}}while(e.iterator);return qU})}head(){let e=this.iterator().next();if(!e.done)return e.value}tail(t=1){return new e(()=>{let e=this.startFn();for(let n=0;n<t;n++)if(this.nextFn(e).done)return e;return e},this.nextFn)}limit(t){return new e(()=>({size:0,state:this.startFn()}),e=>(e.size++,e.size>t?qU:this.nextFn(e.state)))}distinct(t){return new e(()=>({set:new Set,internalState:this.startFn()}),e=>{let n;do if(n=this.nextFn(e.internalState),!n.done){let r=t?t(n.value):n.value;if(!e.set.has(r))return e.set.add(r),n}while(!n.done);return qU})}exclude(e,t){let n=new Set;for(let r of e){let e=t?t(r):r;n.add(e)}return this.filter(e=>{let r=t?t(e):e;return!n.has(r)})}},Q(MUe,`toString`),Q(vR,`isIterable`),KU=new GU(()=>void 0,()=>qU),qU=Object.freeze({done:!0,value:void 0}),Q(yR,`stream`),JU=class extends GU{static{Q(this,`TreeStreamImpl`)}constructor(e,t,n){super(()=>({iterators:n?.includeRoot?[[e][Symbol.iterator]()]:[t(e)[Symbol.iterator]()],pruned:!1}),e=>{for(e.pruned&&=(e.iterators.pop(),!1);e.iterators.length>0;){let n=e.iterators[e.iterators.length-1].next();if(n.done)e.iterators.pop();else return e.iterators.push(t(n.value)[Symbol.iterator]()),n}return qU})}iterator(){let e={state:this.startFn(),next:Q(()=>this.nextFn(e.state),`next`),prune:Q(()=>{e.state.pruned=!0},`prune`),[Symbol.iterator]:()=>e};return e}},(function(e){function t(e){return e.reduce((e,t)=>e+t,0)}Q(t,`sum`),e.sum=t;function n(e){return e.reduce((e,t)=>e*t,0)}Q(n,`product`),e.product=n;function r(e){return e.reduce((e,t)=>Math.min(e,t))}Q(r,`min`),e.min=r;function i(e){return e.reduce((e,t)=>Math.max(e,t))}Q(i,`max`),e.max=i})(YU||={}),XU={},YH(XU,{assignMandatoryProperties:()=>AR,copyAstNode:()=>MR,findRootNode:()=>CR,getContainerOfType:()=>xR,getDocument:()=>SR,getReferenceNodes:()=>wR,hasContainerOfType:()=>NUe,linkContentToContainer:()=>bR,streamAllContents:()=>ER,streamAst:()=>DR,streamContents:()=>TR,streamReferences:()=>kR}),Q(bR,`linkContentToContainer`),Q(xR,`getContainerOfType`),Q(NUe,`hasContainerOfType`),Q(SR,`getDocument`),Q(CR,`findRootNode`),Q(wR,`getReferenceNodes`),Q(TR,`streamContents`),Q(ER,`streamAllContents`),Q(DR,`streamAst`),Q(OR,`isAstNodeInRange`),Q(kR,`streamReferences`),Q(AR,`assignMandatoryProperties`),Q(jR,`copyDefaultValue`),Q(MR,`copyAstNode`),ZU={},YH(ZU,{AbstractElement:()=>QU,AbstractParserRule:()=>$U,AbstractRule:()=>eW,AbstractType:()=>tW,Action:()=>nW,Alternatives:()=>rW,ArrayLiteral:()=>iW,ArrayType:()=>aW,Assignment:()=>oW,BooleanLiteral:()=>sW,CharacterRange:()=>cW,Condition:()=>lW,Conjunction:()=>uW,CrossReference:()=>dW,Disjunction:()=>fW,EndOfFile:()=>pW,Grammar:()=>mW,GrammarImport:()=>hW,Group:()=>gW,InferredType:()=>_W,InfixRule:()=>vW,InfixRuleOperatorList:()=>yW,InfixRuleOperators:()=>bW,Interface:()=>xW,Keyword:()=>SW,LangiumGrammarAstReflection:()=>YW,LangiumGrammarTerminals:()=>y1e,NamedArgument:()=>CW,NegatedToken:()=>wW,Negation:()=>TW,NumberLiteral:()=>EW,Parameter:()=>DW,ParameterReference:()=>OW,ParserRule:()=>kW,ReferenceType:()=>AW,RegexToken:()=>jW,ReturnType:()=>MW,RuleCall:()=>NW,SimpleType:()=>PW,StringLiteral:()=>FW,TerminalAlternatives:()=>IW,TerminalElement:()=>LW,TerminalGroup:()=>RW,TerminalRule:()=>zW,TerminalRuleCall:()=>BW,Type:()=>VW,TypeAttribute:()=>HW,TypeDefinition:()=>UW,UnionType:()=>WW,UnorderedGroup:()=>GW,UntilToken:()=>KW,ValueLiteral:()=>qW,Wildcard:()=>JW,isAbstractElement:()=>NR,isAbstractParserRule:()=>PR,isAbstractRule:()=>PUe,isAbstractType:()=>FUe,isAction:()=>FR,isAlternatives:()=>IR,isArrayLiteral:()=>IUe,isArrayType:()=>LR,isAssignment:()=>RR,isBooleanLiteral:()=>zR,isCharacterRange:()=>BR,isCondition:()=>LUe,isConjunction:()=>VR,isCrossReference:()=>HR,isDisjunction:()=>UR,isEndOfFile:()=>WR,isGrammar:()=>RUe,isGrammarImport:()=>zUe,isGroup:()=>GR,isInferredType:()=>KR,isInfixRule:()=>qR,isInfixRuleOperatorList:()=>BUe,isInfixRuleOperators:()=>VUe,isInterface:()=>JR,isKeyword:()=>YR,isNamedArgument:()=>HUe,isNegatedToken:()=>XR,isNegation:()=>ZR,isNumberLiteral:()=>UUe,isParameter:()=>WUe,isParameterReference:()=>QR,isParserRule:()=>$R,isReferenceType:()=>ez,isRegexToken:()=>tz,isReturnType:()=>nz,isRuleCall:()=>rz,isSimpleType:()=>iz,isStringLiteral:()=>GUe,isTerminalAlternatives:()=>az,isTerminalElement:()=>KUe,isTerminalGroup:()=>oz,isTerminalRule:()=>sz,isTerminalRuleCall:()=>cz,isType:()=>lz,isTypeAttribute:()=>qUe,isTypeDefinition:()=>JUe,isUnionType:()=>uz,isUnorderedGroup:()=>dz,isUntilToken:()=>fz,isValueLiteral:()=>YUe,isWildcard:()=>pz,reflection:()=>XW}),y1e={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/},QU={$type:`AbstractElement`,cardinality:`cardinality`},Q(NR,`isAbstractElement`),$U={$type:`AbstractParserRule`},Q(PR,`isAbstractParserRule`),eW={$type:`AbstractRule`},Q(PUe,`isAbstractRule`),tW={$type:`AbstractType`},Q(FUe,`isAbstractType`),nW={$type:`Action`,cardinality:`cardinality`,feature:`feature`,inferredType:`inferredType`,operator:`operator`,type:`type`},Q(FR,`isAction`),rW={$type:`Alternatives`,cardinality:`cardinality`,elements:`elements`},Q(IR,`isAlternatives`),iW={$type:`ArrayLiteral`,elements:`elements`},Q(IUe,`isArrayLiteral`),aW={$type:`ArrayType`,elementType:`elementType`},Q(LR,`isArrayType`),oW={$type:`Assignment`,cardinality:`cardinality`,feature:`feature`,operator:`operator`,predicate:`predicate`,terminal:`terminal`},Q(RR,`isAssignment`),sW={$type:`BooleanLiteral`,true:`true`},Q(zR,`isBooleanLiteral`),cW={$type:`CharacterRange`,cardinality:`cardinality`,left:`left`,lookahead:`lookahead`,parenthesized:`parenthesized`,right:`right`},Q(BR,`isCharacterRange`),lW={$type:`Condition`},Q(LUe,`isCondition`),uW={$type:`Conjunction`,left:`left`,right:`right`},Q(VR,`isConjunction`),dW={$type:`CrossReference`,cardinality:`cardinality`,deprecatedSyntax:`deprecatedSyntax`,isMulti:`isMulti`,terminal:`terminal`,type:`type`},Q(HR,`isCrossReference`),fW={$type:`Disjunction`,left:`left`,right:`right`},Q(UR,`isDisjunction`),pW={$type:`EndOfFile`,cardinality:`cardinality`},Q(WR,`isEndOfFile`),mW={$type:`Grammar`,imports:`imports`,interfaces:`interfaces`,isDeclared:`isDeclared`,name:`name`,rules:`rules`,types:`types`},Q(RUe,`isGrammar`),hW={$type:`GrammarImport`,path:`path`},Q(zUe,`isGrammarImport`),gW={$type:`Group`,cardinality:`cardinality`,elements:`elements`,guardCondition:`guardCondition`,predicate:`predicate`},Q(GR,`isGroup`),_W={$type:`InferredType`,name:`name`},Q(KR,`isInferredType`),vW={$type:`InfixRule`,call:`call`,dataType:`dataType`,inferredType:`inferredType`,name:`name`,operators:`operators`,parameters:`parameters`,returnType:`returnType`},Q(qR,`isInfixRule`),yW={$type:`InfixRuleOperatorList`,associativity:`associativity`,operators:`operators`},Q(BUe,`isInfixRuleOperatorList`),bW={$type:`InfixRuleOperators`,precedences:`precedences`},Q(VUe,`isInfixRuleOperators`),xW={$type:`Interface`,attributes:`attributes`,name:`name`,superTypes:`superTypes`},Q(JR,`isInterface`),SW={$type:`Keyword`,cardinality:`cardinality`,predicate:`predicate`,value:`value`},Q(YR,`isKeyword`),CW={$type:`NamedArgument`,calledByName:`calledByName`,parameter:`parameter`,value:`value`},Q(HUe,`isNamedArgument`),wW={$type:`NegatedToken`,cardinality:`cardinality`,lookahead:`lookahead`,parenthesized:`parenthesized`,terminal:`terminal`},Q(XR,`isNegatedToken`),TW={$type:`Negation`,value:`value`},Q(ZR,`isNegation`),EW={$type:`NumberLiteral`,value:`value`},Q(UUe,`isNumberLiteral`),DW={$type:`Parameter`,name:`name`},Q(WUe,`isParameter`),OW={$type:`ParameterReference`,parameter:`parameter`},Q(QR,`isParameterReference`),kW={$type:`ParserRule`,dataType:`dataType`,definition:`definition`,entry:`entry`,fragment:`fragment`,inferredType:`inferredType`,name:`name`,parameters:`parameters`,returnType:`returnType`},Q($R,`isParserRule`),AW={$type:`ReferenceType`,isMulti:`isMulti`,referenceType:`referenceType`},Q(ez,`isReferenceType`),jW={$type:`RegexToken`,cardinality:`cardinality`,lookahead:`lookahead`,parenthesized:`parenthesized`,regex:`regex`},Q(tz,`isRegexToken`),MW={$type:`ReturnType`,name:`name`},Q(nz,`isReturnType`),NW={$type:`RuleCall`,arguments:`arguments`,cardinality:`cardinality`,predicate:`predicate`,rule:`rule`},Q(rz,`isRuleCall`),PW={$type:`SimpleType`,primitiveType:`primitiveType`,stringType:`stringType`,typeRef:`typeRef`},Q(iz,`isSimpleType`),FW={$type:`StringLiteral`,value:`value`},Q(GUe,`isStringLiteral`),IW={$type:`TerminalAlternatives`,cardinality:`cardinality`,elements:`elements`,lookahead:`lookahead`,parenthesized:`parenthesized`},Q(az,`isTerminalAlternatives`),LW={$type:`TerminalElement`,cardinality:`cardinality`,lookahead:`lookahead`,parenthesized:`parenthesized`},Q(KUe,`isTerminalElement`),RW={$type:`TerminalGroup`,cardinality:`cardinality`,elements:`elements`,lookahead:`lookahead`,parenthesized:`parenthesized`},Q(oz,`isTerminalGroup`),zW={$type:`TerminalRule`,definition:`definition`,fragment:`fragment`,hidden:`hidden`,name:`name`,type:`type`},Q(sz,`isTerminalRule`),BW={$type:`TerminalRuleCall`,cardinality:`cardinality`,lookahead:`lookahead`,parenthesized:`parenthesized`,rule:`rule`},Q(cz,`isTerminalRuleCall`),VW={$type:`Type`,name:`name`,type:`type`},Q(lz,`isType`),HW={$type:`TypeAttribute`,defaultValue:`defaultValue`,isOptional:`isOptional`,name:`name`,type:`type`},Q(qUe,`isTypeAttribute`),UW={$type:`TypeDefinition`},Q(JUe,`isTypeDefinition`),WW={$type:`UnionType`,types:`types`},Q(uz,`isUnionType`),GW={$type:`UnorderedGroup`,cardinality:`cardinality`,elements:`elements`},Q(dz,`isUnorderedGroup`),KW={$type:`UntilToken`,cardinality:`cardinality`,lookahead:`lookahead`,parenthesized:`parenthesized`,terminal:`terminal`},Q(fz,`isUntilToken`),qW={$type:`ValueLiteral`},Q(YUe,`isValueLiteral`),JW={$type:`Wildcard`,cardinality:`cardinality`,lookahead:`lookahead`,parenthesized:`parenthesized`},Q(pz,`isWildcard`),YW=class extends WU{static{Q(this,`LangiumGrammarAstReflection`)}constructor(){super(...arguments),this.types={AbstractElement:{name:QU.$type,properties:{cardinality:{name:QU.cardinality}},superTypes:[]},AbstractParserRule:{name:$U.$type,properties:{},superTypes:[eW.$type,tW.$type]},AbstractRule:{name:eW.$type,properties:{},superTypes:[]},AbstractType:{name:tW.$type,properties:{},superTypes:[]},Action:{name:nW.$type,properties:{cardinality:{name:nW.cardinality},feature:{name:nW.feature},inferredType:{name:nW.inferredType},operator:{name:nW.operator},type:{name:nW.type,referenceType:tW.$type}},superTypes:[QU.$type]},Alternatives:{name:rW.$type,properties:{cardinality:{name:rW.cardinality},elements:{name:rW.elements,defaultValue:[]}},superTypes:[QU.$type]},ArrayLiteral:{name:iW.$type,properties:{elements:{name:iW.elements,defaultValue:[]}},superTypes:[qW.$type]},ArrayType:{name:aW.$type,properties:{elementType:{name:aW.elementType}},superTypes:[UW.$type]},Assignment:{name:oW.$type,properties:{cardinality:{name:oW.cardinality},feature:{name:oW.feature},operator:{name:oW.operator},predicate:{name:oW.predicate},terminal:{name:oW.terminal}},superTypes:[QU.$type]},BooleanLiteral:{name:sW.$type,properties:{true:{name:sW.true,defaultValue:!1}},superTypes:[lW.$type,qW.$type]},CharacterRange:{name:cW.$type,properties:{cardinality:{name:cW.cardinality},left:{name:cW.left},lookahead:{name:cW.lookahead},parenthesized:{name:cW.parenthesized,defaultValue:!1},right:{name:cW.right}},superTypes:[LW.$type]},Condition:{name:lW.$type,properties:{},superTypes:[]},Conjunction:{name:uW.$type,properties:{left:{name:uW.left},right:{name:uW.right}},superTypes:[lW.$type]},CrossReference:{name:dW.$type,properties:{cardinality:{name:dW.cardinality},deprecatedSyntax:{name:dW.deprecatedSyntax,defaultValue:!1},isMulti:{name:dW.isMulti,defaultValue:!1},terminal:{name:dW.terminal},type:{name:dW.type,referenceType:tW.$type}},superTypes:[QU.$type]},Disjunction:{name:fW.$type,properties:{left:{name:fW.left},right:{name:fW.right}},superTypes:[lW.$type]},EndOfFile:{name:pW.$type,properties:{cardinality:{name:pW.cardinality}},superTypes:[QU.$type]},Grammar:{name:mW.$type,properties:{imports:{name:mW.imports,defaultValue:[]},interfaces:{name:mW.interfaces,defaultValue:[]},isDeclared:{name:mW.isDeclared,defaultValue:!1},name:{name:mW.name},rules:{name:mW.rules,defaultValue:[]},types:{name:mW.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:hW.$type,properties:{path:{name:hW.path}},superTypes:[]},Group:{name:gW.$type,properties:{cardinality:{name:gW.cardinality},elements:{name:gW.elements,defaultValue:[]},guardCondition:{name:gW.guardCondition},predicate:{name:gW.predicate}},superTypes:[QU.$type]},InferredType:{name:_W.$type,properties:{name:{name:_W.name}},superTypes:[tW.$type]},InfixRule:{name:vW.$type,properties:{call:{name:vW.call},dataType:{name:vW.dataType},inferredType:{name:vW.inferredType},name:{name:vW.name},operators:{name:vW.operators},parameters:{name:vW.parameters,defaultValue:[]},returnType:{name:vW.returnType,referenceType:tW.$type}},superTypes:[$U.$type]},InfixRuleOperatorList:{name:yW.$type,properties:{associativity:{name:yW.associativity},operators:{name:yW.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:bW.$type,properties:{precedences:{name:bW.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:xW.$type,properties:{attributes:{name:xW.attributes,defaultValue:[]},name:{name:xW.name},superTypes:{name:xW.superTypes,defaultValue:[],referenceType:tW.$type}},superTypes:[tW.$type]},Keyword:{name:SW.$type,properties:{cardinality:{name:SW.cardinality},predicate:{name:SW.predicate},value:{name:SW.value}},superTypes:[QU.$type]},NamedArgument:{name:CW.$type,properties:{calledByName:{name:CW.calledByName,defaultValue:!1},parameter:{name:CW.parameter,referenceType:DW.$type},value:{name:CW.value}},superTypes:[]},NegatedToken:{name:wW.$type,properties:{cardinality:{name:wW.cardinality},lookahead:{name:wW.lookahead},parenthesized:{name:wW.parenthesized,defaultValue:!1},terminal:{name:wW.terminal}},superTypes:[LW.$type]},Negation:{name:TW.$type,properties:{value:{name:TW.value}},superTypes:[lW.$type]},NumberLiteral:{name:EW.$type,properties:{value:{name:EW.value}},superTypes:[qW.$type]},Parameter:{name:DW.$type,properties:{name:{name:DW.name}},superTypes:[]},ParameterReference:{name:OW.$type,properties:{parameter:{name:OW.parameter,referenceType:DW.$type}},superTypes:[lW.$type]},ParserRule:{name:kW.$type,properties:{dataType:{name:kW.dataType},definition:{name:kW.definition},entry:{name:kW.entry,defaultValue:!1},fragment:{name:kW.fragment,defaultValue:!1},inferredType:{name:kW.inferredType},name:{name:kW.name},parameters:{name:kW.parameters,defaultValue:[]},returnType:{name:kW.returnType,referenceType:tW.$type}},superTypes:[$U.$type]},ReferenceType:{name:AW.$type,properties:{isMulti:{name:AW.isMulti,defaultValue:!1},referenceType:{name:AW.referenceType}},superTypes:[UW.$type]},RegexToken:{name:jW.$type,properties:{cardinality:{name:jW.cardinality},lookahead:{name:jW.lookahead},parenthesized:{name:jW.parenthesized,defaultValue:!1},regex:{name:jW.regex}},superTypes:[LW.$type]},ReturnType:{name:MW.$type,properties:{name:{name:MW.name}},superTypes:[]},RuleCall:{name:NW.$type,properties:{arguments:{name:NW.arguments,defaultValue:[]},cardinality:{name:NW.cardinality},predicate:{name:NW.predicate},rule:{name:NW.rule,referenceType:eW.$type}},superTypes:[QU.$type]},SimpleType:{name:PW.$type,properties:{primitiveType:{name:PW.primitiveType},stringType:{name:PW.stringType},typeRef:{name:PW.typeRef,referenceType:tW.$type}},superTypes:[UW.$type]},StringLiteral:{name:FW.$type,properties:{value:{name:FW.value}},superTypes:[qW.$type]},TerminalAlternatives:{name:IW.$type,properties:{cardinality:{name:IW.cardinality},elements:{name:IW.elements,defaultValue:[]},lookahead:{name:IW.lookahead},parenthesized:{name:IW.parenthesized,defaultValue:!1}},superTypes:[LW.$type]},TerminalElement:{name:LW.$type,properties:{cardinality:{name:LW.cardinality},lookahead:{name:LW.lookahead},parenthesized:{name:LW.parenthesized,defaultValue:!1}},superTypes:[QU.$type]},TerminalGroup:{name:RW.$type,properties:{cardinality:{name:RW.cardinality},elements:{name:RW.elements,defaultValue:[]},lookahead:{name:RW.lookahead},parenthesized:{name:RW.parenthesized,defaultValue:!1}},superTypes:[LW.$type]},TerminalRule:{name:zW.$type,properties:{definition:{name:zW.definition},fragment:{name:zW.fragment,defaultValue:!1},hidden:{name:zW.hidden,defaultValue:!1},name:{name:zW.name},type:{name:zW.type}},superTypes:[eW.$type]},TerminalRuleCall:{name:BW.$type,properties:{cardinality:{name:BW.cardinality},lookahead:{name:BW.lookahead},parenthesized:{name:BW.parenthesized,defaultValue:!1},rule:{name:BW.rule,referenceType:zW.$type}},superTypes:[LW.$type]},Type:{name:VW.$type,properties:{name:{name:VW.name},type:{name:VW.type}},superTypes:[tW.$type]},TypeAttribute:{name:HW.$type,properties:{defaultValue:{name:HW.defaultValue},isOptional:{name:HW.isOptional,defaultValue:!1},name:{name:HW.name},type:{name:HW.type}},superTypes:[]},TypeDefinition:{name:UW.$type,properties:{},superTypes:[]},UnionType:{name:WW.$type,properties:{types:{name:WW.types,defaultValue:[]}},superTypes:[UW.$type]},UnorderedGroup:{name:GW.$type,properties:{cardinality:{name:GW.cardinality},elements:{name:GW.elements,defaultValue:[]}},superTypes:[QU.$type]},UntilToken:{name:KW.$type,properties:{cardinality:{name:KW.cardinality},lookahead:{name:KW.lookahead},parenthesized:{name:KW.parenthesized,defaultValue:!1},terminal:{name:KW.terminal}},superTypes:[LW.$type]},ValueLiteral:{name:qW.$type,properties:{},superTypes:[]},Wildcard:{name:JW.$type,properties:{cardinality:{name:JW.cardinality},lookahead:{name:JW.lookahead},parenthesized:{name:JW.parenthesized,defaultValue:!1}},superTypes:[LW.$type]}}}},XW=new YW,Q(XUe,`getDatatypeNode`),Q(mz,`streamCst`),Q(ZUe,`flattenCst`),Q(hz,`isChildNode`),Q(gz,`tokenToRange`),Q(_z,`toDocumentSegment`),(function(e){e[e.Before=0]=`Before`,e[e.After=1]=`After`,e[e.OverlapFront=2]=`OverlapFront`,e[e.OverlapBack=3]=`OverlapBack`,e[e.Inside=4]=`Inside`,e[e.Outside=5]=`Outside`})(ZW||={}),Q(vz,`compareRange`),Q(yz,`inRange`),QW=/^[\w\p{L}]$/u,Q(QUe,`findDeclarationNodeAtOffset`),Q(bz,`findCommentNode`),Q(xz,`isCommentNode`),Q(Sz,`findLeafNodeAtOffset`),Q(Cz,`findLeafNodeBeforeOffset`),Q(wz,`binarySearch`),Q(Tz,`getPreviousNode`),Q($Ue,`getNextNode`),Q(eWe,`getStartlineNode`),Q(tWe,`getInteriorNodes`),Q(nWe,`getCommonParent`),Q(Ez,`getParentChain`),$W={},YH($W,{findAssignment:()=>Zz,findNameAssignment:()=>Qz,findNodeForKeyword:()=>Yz,findNodeForProperty:()=>qz,findNodesForKeyword:()=>aWe,findNodesForKeywordInternal:()=>Xz,findNodesForProperty:()=>Kz,getActionAtElement:()=>eB,getActionType:()=>oB,getAllReachableRules:()=>Hz,getAllRulesUsedForCrossReferences:()=>iWe,getCrossReferenceTerminal:()=>Wz,getEntryRule:()=>Bz,getExplicitRuleType:()=>iB,getHiddenRules:()=>Vz,getRuleType:()=>sB,getRuleTypeName:()=>uWe,getTypeName:()=>aB,isArrayCardinality:()=>sWe,isArrayOperator:()=>cWe,isCommentTerminal:()=>Gz,isDataType:()=>lWe,isDataTypeRule:()=>tB,isOptionalCardinality:()=>oWe,terminalRegex:()=>cB}),eG=class extends Error{static{Q(this,`ErrorWithLocation`)}constructor(e,t){super(e?`${t} at ${e.range.start.line}:${e.range.start.character}`:t)}},Q(Dz,`assertUnreachable`),Q(Oz,`assertCondition`),tG={},YH(tG,{NEWLINE_REGEXP:()=>cG,escapeRegExp:()=>Lz,getTerminalParts:()=>rWe,isMultilineComment:()=>Fz,isWhitespace:()=>Iz,partialMatches:()=>Rz,partialRegExp:()=>zz,whitespaceCharacters:()=>dG}),Q(kz,`cc`),Q(Az,`insertToSet`),Q(jz,`addFlag`),Q(Mz,`ASSERT_EXISTS`),Q(Nz,`ASSERT_NEVER_REACH_HERE`),Q(Pz,`isCharacter`),nG=[];for(let e=kz(`0`);e<=kz(`9`);e++)nG.push(e);rG=[kz(`_`)].concat(nG);for(let e=kz(`a`);e<=kz(`z`);e++)rG.push(e);for(let e=kz(`A`);e<=kz(`Z`);e++)rG.push(e);iG=[kz(` `),kz(`\f`),kz(`1286+`),kz(`\r`),kz(` `),kz(`\v`),kz(` `),kz(`\xA0`),kz(` `),kz(` `),kz(` `),kz(` `),kz(` `),kz(` `),kz(` `),kz(` `),kz(` `),kz(` `),kz(` `),kz(` `),kz(`\u2028`),kz(`\u2029`),kz(` `),kz(` `),kz(` `),kz(``)],b1e=/[0-9a-fA-F]/,aG=/[0-9]/,x1e=/[1-9]/,oG=class{static{Q(this,`RegExpParser`)}constructor(){this.idx=0,this.input=``,this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar(`/`);let t=this.disjunction();this.consumeChar(`/`);let n={type:`Flags`,loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case`g`:jz(n,`global`);break;case`i`:jz(n,`ignoreCase`);break;case`m`:jz(n,`multiLine`);break;case`u`:jz(n,`unicode`);break;case`y`:jz(n,`sticky`)}if(this.idx!==this.input.length)throw Error(`Redundant input: `+this.input.substring(this.idx));return{type:`Pattern`,flags:n,value:t,loc:this.loc(0)}}disjunction(){let e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()===`|`;)this.consumeChar(`|`),e.push(this.alternative());return{type:`Disjunction`,value:e,loc:this.loc(t)}}alternative(){let e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:`Alternative`,value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case`^`:return{type:`StartAnchor`,loc:this.loc(e)};case`$`:return{type:`EndAnchor`,loc:this.loc(e)};case`\\`:switch(this.popChar()){case`b`:return{type:`WordBoundary`,loc:this.loc(e)};case`B`:return{type:`NonWordBoundary`,loc:this.loc(e)}}throw Error(`Invalid Assertion Escape`);case`(`:this.consumeChar(`?`);let t;switch(this.popChar()){case`=`:t=`Lookahead`;break;case`!`:t=`NegativeLookahead`;break;case`<`:switch(this.popChar()){case`=`:t=`Lookbehind`;break;case`!`:t=`NegativeLookbehind`}}Mz(t);let n=this.disjunction();return this.consumeChar(`)`),{type:t,value:n,loc:this.loc(e)}}return Nz()}quantifier(e=!1){let t,n=this.idx;switch(this.popChar()){case`*`:t={atLeast:0,atMost:1/0};break;case`+`:t={atLeast:1,atMost:1/0};break;case`?`:t={atLeast:0,atMost:1};break;case`{`:let n=this.integerIncludingZero();switch(this.popChar()){case`}`:t={atLeast:n,atMost:n};break;case`,`:let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:n,atMost:e}):t={atLeast:n,atMost:1/0},this.consumeChar(`}`)}if(e===!0&&t===void 0)return;Mz(t)}if((e!==!0||t!==void 0)&&Mz(t))return this.peekChar(0)===`?`?(this.consumeChar(`?`),t.greedy=!1):t.greedy=!0,t.type=`Quantifier`,t.loc=this.loc(n),t}atom(){let e,t=this.idx;switch(this.peekChar()){case`.`:e=this.dotAll();break;case`\\`:e=this.atomEscape();break;case`[`:e=this.characterClass();break;case`(`:e=this.group()}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Mz(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):Nz()}dotAll(){return this.consumeChar(`.`),{type:`Set`,complement:!0,value:[kz(`1287+`),kz(`\r`),kz(`\u2028`),kz(`\u2029`)]}}atomEscape(){switch(this.consumeChar(`\\`),this.peekChar()){case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:return this.decimalEscapeAtom();case`d`:case`D`:case`s`:case`S`:case`w`:case`W`:return this.characterClassEscape();case`f`:case`n`:case`r`:case`t`:case`v`:return this.controlEscapeAtom();case`c`:return this.controlLetterEscapeAtom();case`0`:return this.nulCharacterAtom();case`x`:return this.hexEscapeSequenceAtom();case`u`:return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:`GroupBackReference`,value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case`d`:e=nG;break;case`D`:e=nG,t=!0;break;case`s`:e=iG;break;case`S`:e=iG,t=!0;break;case`w`:e=rG;break;case`W`:e=rG,t=!0}return Mz(e)?{type:`Set`,value:e,complement:t}:Nz()}controlEscapeAtom(){let e;switch(this.popChar()){case`f`:e=kz(`\f`);break;case`n`:e=kz(`1288+`);break;case`r`:e=kz(`\r`);break;case`t`:e=kz(` `);break;case`v`:e=kz(`\v`)}return Mz(e)?{type:`Character`,value:e}:Nz()}controlLetterEscapeAtom(){this.consumeChar(`c`);let e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error(`Invalid `);return{type:`Character`,value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar(`0`),{type:`Character`,value:kz(`\0`)}}hexEscapeSequenceAtom(){return this.consumeChar(`x`),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar(`u`),this.parseHexDigits(4)}identityEscapeAtom(){return{type:`Character`,value:kz(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case`1289+`:case`\r`:case`\u2028`:case`\u2029`:case`\\`:case`]`:throw Error(`TBD`);default:return{type:`Character`,value:kz(this.popChar())}}}characterClass(){let e=[],t=!1;for(this.consumeChar(`[`),this.peekChar(0)===`^`&&(this.consumeChar(`^`),t=!0);this.isClassAtom();){let t=this.classAtom();if(t.type,Pz(t)&&this.isRangeDash()){this.consumeChar(`-`);let n=this.classAtom();if(n.type,Pz(n)){if(n.value<t.value)throw Error(`Range out of order in character class`);e.push({from:t.value,to:n.value})}else Az(t.value,e),e.push(kz(`-`)),Az(n.value,e)}else Az(t.value,e)}return this.consumeChar(`]`),{type:`Set`,complement:t,value:e}}classAtom(){switch(this.peekChar()){case`]`:case`1290+`:case`\r`:case`\u2028`:case`\u2029`:throw Error(`TBD`);case`\\`:return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar(`\\`),this.peekChar()){case`b`:return this.consumeChar(`b`),{type:`Character`,value:kz(`\b`)};case`d`:case`D`:case`s`:case`S`:case`w`:case`W`:return this.characterClassEscape();case`f`:case`n`:case`r`:case`t`:case`v`:return this.controlEscapeAtom();case`c`:return this.controlLetterEscapeAtom();case`0`:return this.nulCharacterAtom();case`x`:return this.hexEscapeSequenceAtom();case`u`:return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar(`(`),this.peekChar(0)){case`?`:this.consumeChar(`?`),this.consumeChar(`:`),e=!1;break;default:this.groupIdx++}let t=this.disjunction();this.consumeChar(`)`);let n={type:`Group`,capturing:e,value:t};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(x1e.test(e)===!1)throw Error(`Expecting a positive integer`);for(;aG.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(aG.test(e)===!1)throw Error(`Expecting an integer`);for(;aG.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case`1291+`:case`\r`:case`\u2028`:case`\u2029`:case`^`:case`$`:case`\\`:case`.`:case`*`:case`+`:case`?`:case`(`:case`)`:case`[`:case`|`:throw Error(`TBD`);default:return{type:`Character`,value:kz(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case`g`:case`i`:case`m`:case`u`:case`y`:return!0;default:return!1}}isRangeDash(){return this.peekChar()===`-`&&this.isClassAtom(1)}isDigit(){return aG.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case`]`:case`1292+`:case`\r`:case`\u2028`:case`\u2029`:return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case`.`:case`\\`:case`[`:case`(`:return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case`^`:case`$`:return!0;case`\\`:switch(this.peekChar(1)){case`b`:case`B`:return!0;default:return!1}case`(`:return this.peekChar(1)===`?`&&(this.peekChar(2)===`=`||this.peekChar(2)===`!`||this.peekChar(2)===`<`&&(this.peekChar(3)===`=`||this.peekChar(3)===`!`));default:return!1}}isQuantifier(){let e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case`^`:case`$`:case`\\`:case`.`:case`*`:case`+`:case`?`:case`(`:case`)`:case`[`:case`|`:case`/`:case`1293+`:case`\r`:case`\u2028`:case`\u2029`:return!1;default:return!0}}parseHexDigits(e){let t=``;for(let n=0;n<e;n++){let e=this.popChar();if(b1e.test(e)===!1)throw Error(`Expecting a HexDecimal digits`);t+=e}return{type:`Character`,value:parseInt(t,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){let e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error(`Expected: '`+e+`' but found: '`+this.input[this.idx]+`' at offset: `+this.idx);if(this.idx>=this.input.length)throw Error(`Unexpected end of input`);this.idx++}loc(e){return{begin:e,end:this.idx}}},sG=class{static{Q(this,`BaseRegExpVisitor`)}visitChildren(e){for(let t in e){let n=e[t];e.hasOwnProperty(t)&&(n.type===void 0?Array.isArray(n)&&n.forEach(e=>{this.visit(e)},this):this.visit(n))}}visit(e){switch(e.type){case`Pattern`:this.visitPattern(e);break;case`Flags`:this.visitFlags(e);break;case`Disjunction`:this.visitDisjunction(e);break;case`Alternative`:this.visitAlternative(e);break;case`StartAnchor`:this.visitStartAnchor(e);break;case`EndAnchor`:this.visitEndAnchor(e);break;case`WordBoundary`:this.visitWordBoundary(e);break;case`NonWordBoundary`:this.visitNonWordBoundary(e);break;case`Lookahead`:this.visitLookahead(e);break;case`NegativeLookahead`:this.visitNegativeLookahead(e);break;case`Lookbehind`:this.visitLookbehind(e);break;case`NegativeLookbehind`:this.visitNegativeLookbehind(e);break;case`Character`:this.visitCharacter(e);break;case`Set`:this.visitSet(e);break;case`Group`:this.visitGroup(e);break;case`GroupBackReference`:this.visitGroupBackReference(e);break;case`Quantifier`:this.visitQuantifier(e)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},cG=/\r?\n/gm,lG=new oG,S1e=class extends sG{static{Q(this,`TerminalRegExpVisitor`)}constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join(``)}reset(e){this.multiline=!1,this.regex=e,this.startRegexp=``,this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){let t=String.fromCharCode(e.value);if(!this.multiline&&t===`1294+`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let e=Lz(t);this.endRegexpStack.push(e),this.isStarting&&(this.startRegexp+=e)}}visitSet(e){if(!this.multiline){let t=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(t);this.multiline=!!`1295+`.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let t=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(t),this.isStarting&&(this.startRegexp+=t)}}visitChildren(e){e.type===`Group`&&e.quantifier||super.visitChildren(e)}},uG=new S1e,Q(rWe,`getTerminalParts`),Q(Fz,`isMultilineComment`),dG=`\f1296+\r \v \xA0 \u2028\u2029 `.split(``),Q(Iz,`isWhitespace`),Q(Lz,`escapeRegExp`),Q(Rz,`partialMatches`),Q(zz,`partialRegExp`),Q(Bz,`getEntryRule`),Q(Vz,`getHiddenRules`),Q(Hz,`getAllReachableRules`),Q(Uz,`ruleDfs`),Q(iWe,`getAllRulesUsedForCrossReferences`),Q(Wz,`getCrossReferenceTerminal`),Q(Gz,`isCommentTerminal`),Q(Kz,`findNodesForProperty`),Q(qz,`findNodeForProperty`),Q(Jz,`findNodesForPropertyInternal`),Q(aWe,`findNodesForKeyword`),Q(Yz,`findNodeForKeyword`),Q(Xz,`findNodesForKeywordInternal`),Q(Zz,`findAssignment`),Q(Qz,`findNameAssignment`),Q($z,`findNameAssignmentInternal`),Q(eB,`getActionAtElement`),Q(oWe,`isOptionalCardinality`),Q(sWe,`isArrayCardinality`),Q(cWe,`isArrayOperator`),Q(tB,`isDataTypeRule`),Q(nB,`isDataTypeRuleInternal`),Q(lWe,`isDataType`),Q(rB,`isDataTypeInternal`),Q(iB,`getExplicitRuleType`),Q(aB,`getTypeName`),Q(oB,`getActionType`),Q(uWe,`getRuleTypeName`),Q(sB,`getRuleType`),Q(cB,`terminalRegex`),fG=`[\\s\\S]`,Q(lB,`abstractElementToRegex`),Q(dWe,`terminalAlternativesToRegex`),Q(fWe,`terminalGroupToRegex`),Q(pWe,`untilTokenToRegex`),Q(mWe,`negateTokenToRegex`),Q(hWe,`characterRangeToRegex`),Q(uB,`keywordToRegex`),Q(dB,`withCardinality`),Q(fB,`createGrammarConfig`),pG=typeof global==`object`&&global&&global.Object===Object&&global,C1e=typeof self==`object`&&self&&self.Object===Object&&self,mG=pG||C1e||Function(`return this`)(),hG=mG.Symbol,gG=Object.prototype,w1e=gG.hasOwnProperty,T1e=gG.toString,_G=hG?hG.toStringTag:void 0,Q(gWe,`getRawTag`),E1e=gWe,D1e=Object.prototype.toString,Q(_We,`objectToString`),O1e=_We,k1e=`[object Null]`,A1e=`[object Undefined]`,vG=hG?hG.toStringTag:void 0,Q(vWe,`baseGetTag`),yG=vWe,Q(yWe,`isObjectLike`),bG=yWe,j1e=`[object Symbol]`,Q(bWe,`isSymbol`),xG=bWe,Q(xWe,`arrayMap`),SG=xWe,CG=Array.isArray,M1e=1/0,wG=hG?hG.prototype:void 0,TG=wG?wG.toString:void 0,Q(pB,`baseToString`),N1e=pB,P1e=/\s/,Q(SWe,`trimmedEndIndex`),F1e=SWe,I1e=/^\s+/,Q(CWe,`baseTrim`),L1e=CWe,Q(wWe,`isObject`),EG=wWe,DG=NaN,R1e=/^[-+]0x[0-9a-f]+$/i,z1e=/^0b[01]+$/i,B1e=/^0o[0-7]+$/i,V1e=parseInt,Q(TWe,`toNumber`),H1e=TWe,OG=1/0,U1e=17976931348623157e292,Q(EWe,`toFinite`),W1e=EWe,Q(DWe,`toInteger`),kG=DWe,Q(OWe,`identity`),AG=OWe,G1e=`[object AsyncFunction]`,K1e=`[object Function]`,q1e=`[object GeneratorFunction]`,J1e=`[object Proxy]`,Q(kWe,`isFunction`),jG=kWe,MG=mG[`__core-js_shared__`],NG=(function(){var e=/[^.]+$/.exec(MG&&MG.keys&&MG.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``})(),Q(AWe,`isMasked`),Y1e=AWe,X1e=Function.prototype.toString,Q(jWe,`toSource`),PG=jWe,Z1e=/[\\^$.*+?()[\]{}|]/g,Q1e=/^\[object .+?Constructor\]$/,$1e=Function.prototype,e0e=Object.prototype,t0e=$1e.toString,n0e=e0e.hasOwnProperty,r0e=RegExp(`^`+t0e.call(n0e).replace(Z1e,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),Q(MWe,`baseIsNative`),i0e=MWe,Q(NWe,`getValue`),a0e=NWe,Q(PWe,`getNative`),FG=PWe,IG=FG(mG,`WeakMap`),LG=Object.create,o0e=(function(){function e(){}return Q(e,`object`),function(t){if(!EG(t))return{};if(LG)return LG(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})(),Q(FWe,`apply`),s0e=FWe,Q(IWe,`noop`),RG=IWe,Q(LWe,`copyArray`),c0e=LWe,l0e=800,u0e=16,d0e=Date.now,Q(RWe,`shortOut`),f0e=RWe,Q(zWe,`constant`),p0e=zWe,zG=(function(){try{var e=FG(Object,`defineProperty`);return e({},``,{}),e}catch{}})(),m0e=f0e(zG?function(e,t){return zG(e,`toString`,{configurable:!0,enumerable:!1,value:p0e(t),writable:!0})}:AG),Q(BWe,`arrayEach`),BG=BWe,Q(VWe,`baseFindIndex`),VG=VWe,Q(HWe,`baseIsNaN`),h0e=HWe,Q(UWe,`strictIndexOf`),g0e=UWe,Q(WWe,`baseIndexOf`),HG=WWe,Q(GWe,`arrayIncludes`),UG=GWe,_0e=9007199254740991,v0e=/^(?:0|[1-9]\d*)$/,Q(KWe,`isIndex`),WG=KWe,Q(qWe,`baseAssignValue`),GG=qWe,Q(JWe,`eq`),KG=JWe,y0e=Object.prototype.hasOwnProperty,Q(YWe,`assignValue`),qG=YWe,Q(XWe,`copyObject`),JG=XWe,YG=Math.max,Q(ZWe,`overRest`),b0e=ZWe,Q(QWe,`baseRest`),XG=QWe,x0e=9007199254740991,Q($We,`isLength`),ZG=$We,Q(eGe,`isArrayLike`),QG=eGe,Q(tGe,`isIterateeCall`),$G=tGe,Q(nGe,`createAssigner`),S0e=nGe,C0e=Object.prototype,Q(rGe,`isPrototype`),eK=rGe,Q(iGe,`baseTimes`),w0e=iGe,T0e=`[object Arguments]`,Q(aGe,`baseIsArguments`),tK=aGe,nK=Object.prototype,E0e=nK.hasOwnProperty,D0e=nK.propertyIsEnumerable,rK=tK((function(){return arguments})())?tK:function(e){return bG(e)&&E0e.call(e,`callee`)&&!D0e.call(e,`callee`)},Q(oGe,`stubFalse`),O0e=oGe,iK=typeof exports==`object`&&exports&&!exports.nodeType&&exports,aK=iK&&typeof module==`object`&&module&&!module.nodeType&&module,oK=aK&&aK.exports===iK?mG.Buffer:void 0,sK=(oK?oK.isBuffer:void 0)||O0e,k0e=`[object Arguments]`,A0e=`[object Array]`,j0e=`[object Boolean]`,M0e=`[object Date]`,N0e=`[object Error]`,P0e=`[object Function]`,F0e=`[object Map]`,I0e=`[object Number]`,L0e=`[object Object]`,R0e=`[object RegExp]`,z0e=`[object Set]`,B0e=`[object String]`,V0e=`[object WeakMap]`,H0e=`[object ArrayBuffer]`,U0e=`[object DataView]`,W0e=`[object Float32Array]`,G0e=`[object Float64Array]`,K0e=`[object Int8Array]`,q0e=`[object Int16Array]`,J0e=`[object Int32Array]`,Y0e=`[object Uint8Array]`,X0e=`[object Uint8ClampedArray]`,Z0e=`[object Uint16Array]`,Q0e=`[object Uint32Array]`,cK={},cK[W0e]=cK[G0e]=cK[K0e]=cK[q0e]=cK[J0e]=cK[Y0e]=cK[X0e]=cK[Z0e]=cK[Q0e]=!0,cK[k0e]=cK[A0e]=cK[H0e]=cK[j0e]=cK[U0e]=cK[M0e]=cK[N0e]=cK[P0e]=cK[F0e]=cK[I0e]=cK[L0e]=cK[R0e]=cK[z0e]=cK[B0e]=cK[V0e]=!1,Q(sGe,`baseIsTypedArray`),$0e=sGe,Q(cGe,`baseUnary`),lK=cGe,uK=typeof exports==`object`&&exports&&!exports.nodeType&&exports,dK=uK&&typeof module==`object`&&module&&!module.nodeType&&module,fK=dK&&dK.exports===uK&&pG.process,pK=(function(){try{return dK&&dK.require&&dK.require(`util`).types||fK&&fK.binding&&fK.binding(`util`)}catch{}})(),mK=pK&&pK.isTypedArray,hK=mK?lK(mK):$0e,e2e=Object.prototype.hasOwnProperty,Q(lGe,`arrayLikeKeys`),gK=lGe,Q(uGe,`overArg`),_K=uGe,t2e=_K(Object.keys,Object),n2e=Object.prototype.hasOwnProperty,Q(dGe,`baseKeys`),vK=dGe,Q(fGe,`keys`),yK=fGe,r2e=Object.prototype.hasOwnProperty,bK=S0e(function(e,t){if(eK(t)||QG(t)){JG(t,yK(t),e);return}for(var n in t)r2e.call(t,n)&&qG(e,n,t[n])}),Q(pGe,`nativeKeysIn`),i2e=pGe,a2e=Object.prototype.hasOwnProperty,Q(mGe,`baseKeysIn`),o2e=mGe,Q(hGe,`keysIn`),xK=hGe,s2e=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c2e=/^\w*$/,Q(gGe,`isKey`),SK=gGe,CK=FG(Object,`create`),Q(_Ge,`hashClear`),l2e=_Ge,Q(vGe,`hashDelete`),u2e=vGe,d2e=`__lodash_hash_undefined__`,f2e=Object.prototype.hasOwnProperty,Q(yGe,`hashGet`),p2e=yGe,m2e=Object.prototype.hasOwnProperty,Q(bGe,`hashHas`),h2e=bGe,g2e=`__lodash_hash_undefined__`,Q(xGe,`hashSet`),_2e=xGe,Q(mB,`Hash`),mB.prototype.clear=l2e,mB.prototype.delete=u2e,mB.prototype.get=p2e,mB.prototype.has=h2e,mB.prototype.set=_2e,wK=mB,Q(SGe,`listCacheClear`),v2e=SGe,Q(CGe,`assocIndexOf`),TK=CGe,y2e=Array.prototype.splice,Q(wGe,`listCacheDelete`),b2e=wGe,Q(TGe,`listCacheGet`),x2e=TGe,Q(EGe,`listCacheHas`),S2e=EGe,Q(DGe,`listCacheSet`),C2e=DGe,Q(hB,`ListCache`),hB.prototype.clear=v2e,hB.prototype.delete=b2e,hB.prototype.get=x2e,hB.prototype.has=S2e,hB.prototype.set=C2e,EK=hB,DK=FG(mG,`Map`),Q(OGe,`mapCacheClear`),w2e=OGe,Q(kGe,`isKeyable`),T2e=kGe,Q(AGe,`getMapData`),OK=AGe,Q(jGe,`mapCacheDelete`),E2e=jGe,Q(MGe,`mapCacheGet`),D2e=MGe,Q(NGe,`mapCacheHas`),O2e=NGe,Q(PGe,`mapCacheSet`),k2e=PGe,Q(gB,`MapCache`),gB.prototype.clear=w2e,gB.prototype.delete=E2e,gB.prototype.get=D2e,gB.prototype.has=O2e,gB.prototype.set=k2e,kK=gB,A2e=`Expected a function`,Q(_B,`memoize`),_B.Cache=kK,j2e=_B,M2e=500,Q(FGe,`memoizeCapped`),N2e=FGe,P2e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,F2e=/\\(\\)?/g,I2e=N2e(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(P2e,function(e,n,r,i){t.push(r?i.replace(F2e,`$1`):n||e)}),t}),Q(IGe,`toString`),L2e=IGe,Q(LGe,`castPath`),AK=LGe,R2e=1/0,Q(RGe,`toKey`),jK=RGe,Q(zGe,`baseGet`),MK=zGe,Q(BGe,`get`),z2e=BGe,Q(VGe,`arrayPush`),NK=VGe,PK=hG?hG.isConcatSpreadable:void 0,Q(HGe,`isFlattenable`),B2e=HGe,Q(vB,`baseFlatten`),FK=vB,Q(UGe,`flatten`),IK=UGe,LK=_K(Object.getPrototypeOf,Object),Q(WGe,`baseSlice`),RK=WGe,Q(GGe,`arrayReduce`),V2e=GGe,Q(KGe,`stackClear`),H2e=KGe,Q(qGe,`stackDelete`),U2e=qGe,Q(JGe,`stackGet`),W2e=JGe,Q(YGe,`stackHas`),G2e=YGe,K2e=200,Q(XGe,`stackSet`),q2e=XGe,Q(yB,`Stack`),yB.prototype.clear=H2e,yB.prototype.delete=U2e,yB.prototype.get=W2e,yB.prototype.has=G2e,yB.prototype.set=q2e,zK=yB,Q(ZGe,`baseAssign`),J2e=ZGe,Q(QGe,`baseAssignIn`),Y2e=QGe,BK=typeof exports==`object`&&exports&&!exports.nodeType&&exports,VK=BK&&typeof module==`object`&&module&&!module.nodeType&&module,HK=VK&&VK.exports===BK?mG.Buffer:void 0,UK=HK?HK.allocUnsafe:void 0,Q($Ge,`cloneBuffer`),X2e=$Ge,Q(eKe,`arrayFilter`),WK=eKe,Q(tKe,`stubArray`),GK=tKe,Z2e=Object.prototype.propertyIsEnumerable,KK=Object.getOwnPropertySymbols,qK=KK?function(e){return e==null?[]:(e=Object(e),WK(KK(e),function(t){return Z2e.call(e,t)}))}:GK,Q(nKe,`copySymbols`),Q2e=nKe,JK=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)NK(t,qK(e)),e=LK(e);return t}:GK,Q(rKe,`copySymbolsIn`),$2e=rKe,Q(iKe,`baseGetAllKeys`),YK=iKe,Q(aKe,`getAllKeys`),XK=aKe,Q(oKe,`getAllKeysIn`),ZK=oKe,QK=FG(mG,`DataView`),$K=FG(mG,`Promise`),eq=FG(mG,`Set`),tq=`[object Map]`,e4e=`[object Object]`,nq=`[object Promise]`,rq=`[object Set]`,iq=`[object WeakMap]`,aq=`[object DataView]`,t4e=PG(QK),n4e=PG(DK),r4e=PG($K),i4e=PG(eq),a4e=PG(IG),oq=yG,(QK&&oq(new QK(new ArrayBuffer(1)))!=aq||DK&&oq(new DK)!=tq||$K&&oq($K.resolve())!=nq||eq&&oq(new eq)!=rq||IG&&oq(new IG)!=iq)&&(oq=Q(function(e){var t=yG(e),n=t==e4e?e.constructor:void 0,r=n?PG(n):``;if(r)switch(r){case t4e:return aq;case n4e:return tq;case r4e:return nq;case i4e:return rq;case a4e:return iq}return t},`getTag`)),sq=oq,o4e=Object.prototype.hasOwnProperty,Q(sKe,`initCloneArray`),s4e=sKe,cq=mG.Uint8Array,Q(cKe,`cloneArrayBuffer`),lq=cKe,Q(lKe,`cloneDataView`),c4e=lKe,l4e=/\w*$/,Q(uKe,`cloneRegExp`),u4e=uKe,uq=hG?hG.prototype:void 0,dq=uq?uq.valueOf:void 0,Q(dKe,`cloneSymbol`),d4e=dKe,Q(fKe,`cloneTypedArray`),f4e=fKe,p4e=`[object Boolean]`,m4e=`[object Date]`,h4e=`[object Map]`,g4e=`[object Number]`,_4e=`[object RegExp]`,v4e=`[object Set]`,y4e=`[object String]`,b4e=`[object Symbol]`,x4e=`[object ArrayBuffer]`,S4e=`[object DataView]`,C4e=`[object Float32Array]`,w4e=`[object Float64Array]`,T4e=`[object Int8Array]`,E4e=`[object Int16Array]`,D4e=`[object Int32Array]`,O4e=`[object Uint8Array]`,k4e=`[object Uint8ClampedArray]`,A4e=`[object Uint16Array]`,j4e=`[object Uint32Array]`,Q(pKe,`initCloneByTag`),M4e=pKe,Q(mKe,`initCloneObject`),N4e=mKe,P4e=`[object Map]`,Q(hKe,`baseIsMap`),F4e=hKe,fq=pK&&pK.isMap,I4e=fq?lK(fq):F4e,L4e=`[object Set]`,Q(gKe,`baseIsSet`),R4e=gKe,pq=pK&&pK.isSet,z4e=pq?lK(pq):R4e,B4e=1,V4e=2,H4e=4,mq=`[object Arguments]`,U4e=`[object Array]`,W4e=`[object Boolean]`,G4e=`[object Date]`,K4e=`[object Error]`,hq=`[object Function]`,q4e=`[object GeneratorFunction]`,J4e=`[object Map]`,Y4e=`[object Number]`,gq=`[object Object]`,X4e=`[object RegExp]`,Z4e=`[object Set]`,Q4e=`[object String]`,$4e=`[object Symbol]`,e3e=`[object WeakMap]`,t3e=`[object ArrayBuffer]`,n3e=`[object DataView]`,r3e=`[object Float32Array]`,i3e=`[object Float64Array]`,a3e=`[object Int8Array]`,o3e=`[object Int16Array]`,s3e=`[object Int32Array]`,c3e=`[object Uint8Array]`,l3e=`[object Uint8ClampedArray]`,u3e=`[object Uint16Array]`,d3e=`[object Uint32Array]`,_q={},_q[mq]=_q[U4e]=_q[t3e]=_q[n3e]=_q[W4e]=_q[G4e]=_q[r3e]=_q[i3e]=_q[a3e]=_q[o3e]=_q[s3e]=_q[J4e]=_q[Y4e]=_q[gq]=_q[X4e]=_q[Z4e]=_q[Q4e]=_q[$4e]=_q[c3e]=_q[l3e]=_q[u3e]=_q[d3e]=!0,_q[K4e]=_q[hq]=_q[e3e]=!1,Q(bB,`baseClone`),f3e=bB,p3e=4,Q(_Ke,`clone`),vq=_Ke,Q(vKe,`compact`),yq=vKe,m3e=`__lodash_hash_undefined__`,Q(yKe,`setCacheAdd`),h3e=yKe,Q(bKe,`setCacheHas`),g3e=bKe,Q(xB,`SetCache`),xB.prototype.add=xB.prototype.push=h3e,xB.prototype.has=g3e,bq=xB,Q(xKe,`arraySome`),xq=xKe,Q(SKe,`cacheHas`),Sq=SKe,_3e=1,v3e=2,Q(CKe,`equalArrays`),Cq=CKe,Q(wKe,`mapToArray`),y3e=wKe,Q(TKe,`setToArray`),wq=TKe,b3e=1,x3e=2,S3e=`[object Boolean]`,C3e=`[object Date]`,w3e=`[object Error]`,T3e=`[object Map]`,E3e=`[object Number]`,D3e=`[object RegExp]`,O3e=`[object Set]`,k3e=`[object String]`,A3e=`[object Symbol]`,j3e=`[object ArrayBuffer]`,M3e=`[object DataView]`,Tq=hG?hG.prototype:void 0,Eq=Tq?Tq.valueOf:void 0,Q(EKe,`equalByTag`),N3e=EKe,P3e=1,F3e=Object.prototype.hasOwnProperty,Q(DKe,`equalObjects`),I3e=DKe,L3e=1,Dq=`[object Arguments]`,Oq=`[object Array]`,kq=`[object Object]`,Aq=Object.prototype.hasOwnProperty,Q(OKe,`baseIsEqualDeep`),R3e=OKe,Q(SB,`baseIsEqual`),jq=SB,z3e=1,B3e=2,Q(kKe,`baseIsMatch`),V3e=kKe,Q(AKe,`isStrictComparable`),Mq=AKe,Q(jKe,`getMatchData`),H3e=jKe,Q(MKe,`matchesStrictComparable`),Nq=MKe,Q(NKe,`baseMatches`),U3e=NKe,Q(PKe,`baseHasIn`),W3e=PKe,Q(FKe,`hasPath`),Pq=FKe,Q(IKe,`hasIn`),G3e=IKe,K3e=1,q3e=2,Q(LKe,`baseMatchesProperty`),J3e=LKe,Q(RKe,`baseProperty`),Y3e=RKe,Q(zKe,`basePropertyDeep`),X3e=zKe,Q(BKe,`property`),Z3e=BKe,Q(VKe,`baseIteratee`),Fq=VKe,Q(HKe,`arrayAggregator`),Q3e=HKe,Q(UKe,`createBaseFor`),$3e=UKe(),Q(WKe,`baseForOwn`),e6e=WKe,Q(GKe,`createBaseEach`),Iq=GKe(e6e),Q(KKe,`baseAggregator`),t6e=KKe,Q(qKe,`createAggregator`),n6e=qKe,Lq=Object.prototype,r6e=Lq.hasOwnProperty,Rq=XG(function(e,t){e=Object(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&$G(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],o=xK(a),s=-1,l=o.length;++s<l;){var u=o[s],d=e[u];(d===void 0||KG(d,Lq[u])&&!r6e.call(e,u))&&(e[u]=a[u])}return e}),Q(JKe,`isArrayLikeObject`),zq=JKe,Q(YKe,`arrayIncludesWith`),Bq=YKe,i6e=200,Q(XKe,`baseDifference`),a6e=XKe,Vq=XG(function(e,t){return zq(e)?a6e(e,FK(t,1,zq,!0)):[]}),Q(ZKe,`last`),Hq=ZKe,Q(QKe,`drop`),Uq=QKe,Q($Ke,`dropRight`),Wq=$Ke,Q(eqe,`castFunction`),o6e=eqe,Q(tqe,`forEach`),Gq=tqe,Q(nqe,`arrayEvery`),s6e=nqe,Q(rqe,`baseEvery`),c6e=rqe,Q(iqe,`every`),Kq=iqe,Q(aqe,`baseFilter`),qq=aqe,Q(oqe,`filter`),Jq=oqe,Q(sqe,`createFind`),l6e=sqe,u6e=Math.max,Q(cqe,`findIndex`),Yq=l6e(cqe),Q(lqe,`head`),Xq=lqe,Q(uqe,`baseMap`),d6e=uqe,Q(dqe,`map`),Zq=dqe,Q(fqe,`flatMap`),Qq=fqe,f6e=Object.prototype.hasOwnProperty,p6e=n6e(function(e,t,n){f6e.call(e,n)?e[n].push(t):GG(e,n,[t])}),m6e=Object.prototype.hasOwnProperty,Q(pqe,`baseHas`),h6e=pqe,Q(mqe,`has`),$q=mqe,g6e=`[object String]`,Q(hqe,`isString`),eJ=hqe,Q(gqe,`baseValues`),_6e=gqe,Q(_qe,`values`),tJ=_qe,v6e=Math.max,Q(vqe,`includes`),nJ=vqe,y6e=Math.max,Q(yqe,`indexOf`),rJ=yqe,b6e=`[object Map]`,x6e=`[object Set]`,S6e=Object.prototype.hasOwnProperty,Q(bqe,`isEmpty`),iJ=bqe,C6e=`[object RegExp]`,Q(xqe,`baseIsRegExp`),w6e=xqe,aJ=pK&&pK.isRegExp,oJ=aJ?lK(aJ):w6e,Q(Sqe,`isUndefined`),sJ=Sqe,T6e=`Expected a function`,Q(Cqe,`negate`),E6e=Cqe,Q(wqe,`baseSet`),D6e=wqe,Q(Tqe,`basePickBy`),O6e=Tqe,Q(Eqe,`pickBy`),cJ=Eqe,Q(Dqe,`baseReduce`),k6e=Dqe,Q(Oqe,`reduce`),lJ=Oqe,Q(kqe,`reject`),uJ=kqe,Q(Aqe,`baseSome`),A6e=Aqe,Q(jqe,`some`),dJ=jqe,j6e=eq&&1/wq(new eq([,-0]))[1]==1/0?function(e){return new eq(e)}:RG,M6e=200,Q(Mqe,`baseUniq`),N6e=Mqe,Q(Nqe,`uniq`),fJ=Nqe,Q(CB,`PRINT_ERROR`),Q(wB,`PRINT_WARNING`),Q(TB,`timer`),Q(EB,`toFastProperties`),Q(Pqe,`tokenLabel`),Q(Fqe,`hasTokenLabel`),pJ=class{static{Q(this,`AbstractProduction`)}get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),Gq(this.definition,t=>{t.accept(e)})}},mJ=class extends pJ{static{Q(this,`NonTerminal`)}constructor(e){super([]),this.idx=1,bK(this,cJ(e,e=>e!==void 0))}set definition(e){}get definition(){return this.referencedRule===void 0?[]:this.referencedRule.definition}accept(e){e.visit(this)}},hJ=class extends pJ{static{Q(this,`Rule`)}constructor(e){super(e.definition),this.orgText=``,bK(this,cJ(e,e=>e!==void 0))}},gJ=class extends pJ{static{Q(this,`Alternative`)}constructor(e){super(e.definition),this.ignoreAmbiguities=!1,bK(this,cJ(e,e=>e!==void 0))}},_J=class extends pJ{static{Q(this,`Option`)}constructor(e){super(e.definition),this.idx=1,bK(this,cJ(e,e=>e!==void 0))}},vJ=class extends pJ{static{Q(this,`RepetitionMandatory`)}constructor(e){super(e.definition),this.idx=1,bK(this,cJ(e,e=>e!==void 0))}},yJ=class extends pJ{static{Q(this,`RepetitionMandatoryWithSeparator`)}constructor(e){super(e.definition),this.idx=1,bK(this,cJ(e,e=>e!==void 0))}},bJ=class extends pJ{static{Q(this,`Repetition`)}constructor(e){super(e.definition),this.idx=1,bK(this,cJ(e,e=>e!==void 0))}},xJ=class extends pJ{static{Q(this,`RepetitionWithSeparator`)}constructor(e){super(e.definition),this.idx=1,bK(this,cJ(e,e=>e!==void 0))}},SJ=class extends pJ{static{Q(this,`Alternation`)}get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,bK(this,cJ(e,e=>e!==void 0))}},CJ=class{static{Q(this,`Terminal`)}constructor(e){this.idx=1,bK(this,cJ(e,e=>e!==void 0))}accept(e){e.visit(this)}},Q(Iqe,`serializeGrammar`),Q(DB,`serializeProduction`),wJ=class{static{Q(this,`GAstVisitor`)}visit(e){let t=e;switch(t.constructor){case mJ:return this.visitNonTerminal(t);case gJ:return this.visitAlternative(t);case _J:return this.visitOption(t);case vJ:return this.visitRepetitionMandatory(t);case yJ:return this.visitRepetitionMandatoryWithSeparator(t);case xJ:return this.visitRepetitionWithSeparator(t);case bJ:return this.visitRepetition(t);case SJ:return this.visitAlternation(t);case CJ:return this.visitTerminal(t);case hJ:return this.visitRule(t);default:throw Error(`non exhaustive match`)}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}},Q(Lqe,`isSequenceProd`),Q(OB,`isOptionalProd`),Q(Rqe,`isBranchingProd`),Q(kB,`getProductionDslName`),TJ=class{static{Q(this,`RestWalker`)}walk(e,t=[]){Gq(e.definition,(n,r)=>{let i=Uq(e.definition,r+1);if(n instanceof mJ)this.walkProdRef(n,i,t);else if(n instanceof CJ)this.walkTerminal(n,i,t);else if(n instanceof gJ)this.walkFlat(n,i,t);else if(n instanceof _J)this.walkOption(n,i,t);else if(n instanceof vJ)this.walkAtLeastOne(n,i,t);else if(n instanceof yJ)this.walkAtLeastOneSep(n,i,t);else if(n instanceof xJ)this.walkManySep(n,i,t);else if(n instanceof bJ)this.walkMany(n,i,t);else if(n instanceof SJ)this.walkOr(n,i,t);else throw Error(`non exhaustive match`)})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){let r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){let r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){let r=[new _J({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){let r=AB(e,t,n);this.walk(e,r)}walkMany(e,t,n){let r=[new _J({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){let r=AB(e,t,n);this.walk(e,r)}walkOr(e,t,n){let r=t.concat(n);Gq(e.definition,e=>{let t=new gJ({definition:[e]});this.walk(t,r)})}},Q(AB,`restForRepetitionWithSeparator`),Q(jB,`first`),Q(zqe,`firstForSequence`),Q(Bqe,`firstForBranching`),Q(Vqe,`firstForTerminal`),EJ=`_~IN~_`,P6e=class extends TJ{static{Q(this,`ResyncFollowsWalker`)}constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){let r=Uqe(e.referencedRule,e.idx)+this.topProd.name,i=jB(new gJ({definition:t.concat(n)}));this.follows[r]=i}},Q(Hqe,`computeAllProdsFollows`),Q(Uqe,`buildBetweenProdsFollowPrefix`),DJ={},F6e=new oG,Q(MB,`getRegExpAst`),Q(Wqe,`clearRegExpParserCache`),OJ=`Complement Sets are not supported for first char optimization`,kJ=`Unable to use "first char" lexer optimizations:1297+`,Q(Gqe,`getOptimizedStartCodesIndices`),Q(NB,`firstCharOptimizedIndices`),Q(PB,`addOptimizedIdxToResult`),Q(Kqe,`handleIgnoreCase`),Q(FB,`findCode`),Q(IB,`isWholeOptional`),I6e=class extends sG{static{Q(this,`CharCodeFinder`)}constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case`Lookahead`:this.visitLookahead(e);return;case`NegativeLookahead`:this.visitNegativeLookahead(e);return;case`Lookbehind`:this.visitLookbehind(e);return;case`NegativeLookbehind`:this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){nJ(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?FB(e,this.targetCharCodes)===void 0&&(this.found=!0):FB(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},Q(LB,`canMatchCharCode`),AJ=`PATTERN`,jJ=`defaultMode`,MJ=`modes`,Q(qqe,`analyzeTokenTypes`),Q(Jqe,`validatePatterns`),Q(Yqe,`validateRegExpPattern`),Q(Xqe,`findMissingPatterns`),Q(Zqe,`findInvalidPatterns`),L6e=/[^\\][$]/,Q(Qqe,`findEndOfInputAnchor`),Q($qe,`findEmptyMatchRegExps`),R6e=/[^\\[][\^]|^\^/,Q(eJe,`findStartOfInputAnchor`),Q(tJe,`findUnsupportedFlags`),Q(nJe,`findDuplicatePatterns`),Q(rJe,`findInvalidGroupType`),Q(iJe,`findModesThatDoNotExist`),Q(aJe,`findUnreachablePatterns`),Q(oJe,`tryToMatchStrToPattern`),Q(sJe,`noMetaChar`),Q(cJe,`usesLookAheadOrBehind`),Q(RB,`addStickyFlag`),Q(lJe,`performRuntimeChecks`),Q(uJe,`performWarningRuntimeChecks`),Q(dJe,`cloneEmptyGroups`),Q(zB,`isCustomPattern`),Q(fJe,`isShortPattern`),z6e={test:Q(function(e){let t=e.length;for(let n=this.lastIndex;n<t;n++){let t=e.charCodeAt(n);if(t===10)return this.lastIndex=n+1,!0;if(t===13)return this.lastIndex=e.charCodeAt(n+1)===10?n+2:n+1,!0}return!1},`test`),lastIndex:0},Q(BB,`checkLineBreaksIssues`),Q(pJe,`buildLineBreakIssueMessage`),Q(VB,`getCharCodes`),Q(HB,`addToMapOfArrays`),NJ=256,PJ=[],Q(UB,`charCodeToOptimizedIndex`),Q(mJe,`initCharCodeToOptimizedIndexMap`),Q(WB,`tokenStructuredMatcher`),Q(GB,`tokenStructuredMatcherNoCategories`),FJ=1,IJ={},Q(KB,`augmentTokenTypes`),Q(hJe,`expandCategories`),Q(gJe,`assignTokenDefaultProps`),Q(_Je,`assignCategoriesTokensProp`),Q(vJe,`assignCategoriesMapProp`),Q(qB,`singleAssignCategoriesToksMap`),Q(JB,`hasShortKeyProperty`),Q(YB,`hasCategoriesProperty`),Q(yJe,`hasExtendingTokensTypesProperty`),Q(bJe,`hasExtendingTokensTypesMapProperty`),Q(xJe,`isTokenType`),LJ={buildUnableToPopLexerModeMessage(e){return`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(e,t,n,r,i,a){return`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`}},(function(e){e[e.MISSING_PATTERN=0]=`MISSING_PATTERN`,e[e.INVALID_PATTERN=1]=`INVALID_PATTERN`,e[e.EOI_ANCHOR_FOUND=2]=`EOI_ANCHOR_FOUND`,e[e.UNSUPPORTED_FLAGS_FOUND=3]=`UNSUPPORTED_FLAGS_FOUND`,e[e.DUPLICATE_PATTERNS_FOUND=4]=`DUPLICATE_PATTERNS_FOUND`,e[e.INVALID_GROUP_TYPE_FOUND=5]=`INVALID_GROUP_TYPE_FOUND`,e[e.PUSH_MODE_DOES_NOT_EXIST=6]=`PUSH_MODE_DOES_NOT_EXIST`,e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]=`MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE`,e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]=`MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY`,e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]=`MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST`,e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]=`LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED`,e[e.SOI_ANCHOR_FOUND=11]=`SOI_ANCHOR_FOUND`,e[e.EMPTY_MATCH_PATTERN=12]=`EMPTY_MATCH_PATTERN`,e[e.NO_LINE_BREAKS_FLAGS=13]=`NO_LINE_BREAKS_FLAGS`,e[e.UNREACHABLE_PATTERN=14]=`UNREACHABLE_PATTERN`,e[e.IDENTIFY_TERMINATOR=15]=`IDENTIFY_TERMINATOR`,e[e.CUSTOM_LINE_BREAK=16]=`CUSTOM_LINE_BREAK`,e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]=`MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE`})(RJ||={}),zJ={deferDefinitionErrorsHandling:!1,positionTracking:`full`,lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`1298+`,`\r`],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:LJ,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0},Object.freeze(zJ),BJ=class{static{Q(this,`Lexer`)}constructor(e,t=zJ){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let n=Array(this.traceInitIndent+1).join(` `);this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);let{time:r,value:i}=TB(t),a=r>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${n}<-- <${e}> time: ${r}ms`),this.traceInitIndent--,i}return t()},typeof t==`boolean`)throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.1299+a boolean 2nd argument is no longer supported`);this.config=bK({},zJ,t);let n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n==`number`&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT(`Lexer Constructor`,()=>{let n,r=!0;this.TRACE_INIT(`Lexer Config handling`,()=>{if(this.config.lineTerminatorsPattern===zJ.lineTerminatorsPattern)this.config.lineTerminatorsPattern=z6e;else if(this.config.lineTerminatorCharacters===zJ.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.1300+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(t.safeMode&&t.ensureOptimizations)throw Error(`"safeMode" and "ensureOptimizations" flags are mutually exclusive.`);this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),CG(e)?n={modes:{defaultMode:vq(e)},defaultMode:jJ}:(r=!1,n=vq(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT(`performRuntimeChecks`,()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(lJe(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT(`performWarningRuntimeChecks`,()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(uJe(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},Gq(n.modes,(e,t)=>{n.modes[t]=uJ(e,e=>sJ(e))});let i=yK(n.modes);if(Gq(n.modes,(e,n)=>{this.TRACE_INIT(`Mode: <${n}> processing`,()=>{if(this.modes.push(n),this.config.skipValidations===!1&&this.TRACE_INIT(`validatePatterns`,()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Jqe(e,i))}),iJ(this.lexerDefinitionErrors)){KB(e);let r;this.TRACE_INIT(`analyzeTokenTypes`,()=>{r=qqe(e,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[n]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[n]=r.charCodeToPatternIdxToConfig,this.emptyGroups=bK({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[n]=r.canBeOptimized}})}),this.defaultMode=n.defaultMode,!iJ(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let e=Zq(this.lexerDefinitionErrors,e=>e.message).join(`-----------------------1301+`);throw Error(`Errors detected in definition of Lexer:1302+`+e)}Gq(this.lexerDefinitionWarning,e=>{wB(e.message)}),this.TRACE_INIT(`Choosing sub-methods implementations`,()=>{if(r&&(this.handleModes=RG),this.trackStartLines===!1&&(this.computeNewColumn=AG),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=RG),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT(`Failed Optimization Warnings`,()=>{let e=lJ(this.canModeBeOptimized,(e,t,n)=>(t===!1&&e.push(n),e),[]);if(t.ensureOptimizations&&!iJ(e))throw Error(`Lexer Modes: < ${e.join(`, `)} > cannot be optimized.1303+ Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.1304+ Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT(`clearRegExpParserCache`,()=>{Wqe()}),this.TRACE_INIT(`toFastProperties`,()=>{EB(this)})})}tokenize(e,t=this.defaultMode){if(!iJ(this.lexerDefinitionErrors)){let e=Zq(this.lexerDefinitionErrors,e=>e.message).join(`-----------------------1305+`);throw Error(`Unable to Tokenize because Errors detected in definition of Lexer:1306+`+e)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,a,o,s,l,u,d,f,p,m,h,g,_,v=e,y=v.length,b=0,x=0,S=this.hasCustom?0:Math.floor(e.length/10),C=Array(S),w=[],T=this.trackStartLines?1:void 0,E=this.trackStartLines?1:void 0,D=dJe(this.emptyGroups),O=this.trackStartLines,k=this.config.lineTerminatorsPattern,A=0,j=[],M=[],N=[],P=[];Object.freeze(P);let F=!1,I=Q(e=>{if(N.length===1&&e.tokenType.PUSH_MODE===void 0){let t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);w.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{N.pop();let e=Hq(N);j=this.patternIdxToConfig[e],M=this.charCodeToPatternIdxToConfig[e],A=j.length;let t=this.canModeBeOptimized[e]&&this.config.safeMode===!1;F=!!(M&&t)}},`pop_mode`);function L(e){N.push(e),M=this.charCodeToPatternIdxToConfig[e],j=this.patternIdxToConfig[e],A=j.length,A=j.length;let t=this.canModeBeOptimized[e]&&this.config.safeMode===!1;F=!!(M&&t)}Q(L,`push_mode`),L.call(this,t);let R,ee=this.config.recoveryEnabled;for(;b<y;){s=null,d=-1;let t=v.charCodeAt(b),S;if(F){let e=UB(t),n=M[e];S=n===void 0?P:n}else S=j;let z=S.length;for(n=0;n<z;n++){R=S[n];let r=R.pattern;l=null;let f=R.short;if(f===!1?R.isCustom===!0?(_=r.exec(v,b,C,D),_===null?s=null:(s=_[0],d=s.length,_.payload!==void 0&&(l=_.payload))):(r.lastIndex=b,d=this.matchLength(r,e,b)):t===f&&(d=1,s=r),d!==-1){if(o=R.longerAlt,o!==void 0){s=e.substring(b,b+d);let t=o.length;for(i=0;i<t;i++){let t=j[o[i]],n=t.pattern;if(u=null,t.isCustom===!0?(_=n.exec(v,b,C,D),_===null?a=null:(a=_[0],_.payload!==void 0&&(u=_.payload))):(n.lastIndex=b,a=this.match(n,e,b)),a&&a.length>s.length){s=a,d=a.length,l=u,R=t;break}}}break}}if(d!==-1){if(f=R.group,f!==void 0&&(s=s===null?e.substring(b,b+d):s,p=R.tokenTypeIdx,m=this.createTokenInstance(s,b,p,R.tokenType,T,E,d),this.handlePayload(m,l),f===!1?x=this.addToken(C,x,m):D[f].push(m)),O===!0&&R.canLineTerminator===!0){let t=0,n,r;k.lastIndex=0;do s=s===null?e.substring(b,b+d):s,n=k.test(s),n===!0&&(r=k.lastIndex-1,t++);while(n===!0);t===0?E=this.computeNewColumn(E,d):(T+=t,E=d-r,this.updateTokenEndLineColumnLocation(m,f,r,t,T,E,d))}else E=this.computeNewColumn(E,d);b+=d,this.handleModes(R,I,L,m)}else{let t=b,n=T,i=E,a=ee===!1;for(;a===!1&&b<y;)for(b++,r=0;r<A;r++){let t=j[r],n=t.pattern,i=t.short;if(i===!1?t.isCustom===!0?a=n.exec(v,b,C,D)!==null:(n.lastIndex=b,a=n.exec(e)!==null):v.charCodeAt(b)===i&&(a=!0),a===!0)break}if(h=b-t,E=this.computeNewColumn(E,h),g=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(v,t,h,n,i,Hq(N)),w.push({offset:t,line:n,column:i,length:h,message:g}),ee===!1)break}}return this.hasCustom||(C.length=x),{tokens:C,groups:D,errors:w}}handleModes(e,t,n,r){if(e.pop===!0){let i=e.push;t(r),i!==void 0&&n.call(this,i)}else e.push!==void 0&&n.call(this,e.push)}updateTokenEndLineColumnLocation(e,t,n,r,i,a,o){let s,l;t!==void 0&&(s=n===o-1,l=s?-1:0,(r!==1||s!==!0)&&(e.endLine=i+l,e.endColumn=a-1+-l))}computeNewColumn(e,t){return e+t}createOffsetOnlyToken(e,t,n,r){return{image:e,startOffset:t,tokenTypeIdx:n,tokenType:r}}createStartOnlyToken(e,t,n,r,i,a){return{image:e,startOffset:t,startLine:i,startColumn:a,tokenTypeIdx:n,tokenType:r}}createFullToken(e,t,n,r,i,a,o){return{image:e,startOffset:t,endOffset:t+o-1,startLine:i,endLine:i,startColumn:a,endColumn:a+o-1,tokenTypeIdx:n,tokenType:r}}addTokenUsingPush(e,t,n){return e.push(n),t}addTokenUsingMemberAccess(e,t,n){return e[t]=n,t++,t}handlePayloadNoCustom(e,t){}handlePayloadWithCustom(e,t){t!==null&&(e.payload=t)}match(e,t,n){return e.test(t)===!0?t.substring(n,e.lastIndex):null}matchLength(e,t,n){return e.test(t)===!0?e.lastIndex-n:-1}},BJ.SKIPPED=`This marks a skipped Token pattern, this means each token identified by it will be consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.`,BJ.NA=/NOT_APPLICABLE/,Q(XB,`tokenLabel`),Q(ZB,`hasTokenLabel`),B6e=`parent`,VJ=`categories`,HJ=`label`,UJ=`group`,WJ=`push_mode`,GJ=`pop_mode`,KJ=`longer_alt`,qJ=`line_breaks`,JJ=`start_chars_hint`,Q(QB,`createToken`),Q(SJe,`createTokenInternal`),YJ=QB({name:`EOF`,pattern:BJ.NA}),KB([YJ]),Q($B,`createTokenInstance`),Q(eV,`tokenMatcher`),XJ={buildMismatchTokenMessage({expected:e,actual:t,previous:n,ruleName:r}){return`Expecting ${ZB(e)?`--> ${XB(e)} <--`:`token of type --> ${e.name} <--`} but found --> '${t.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:e,ruleName:t}){return`Redundant input, expecting EOF but found: `+e.image},buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){let a=`1307+but found: '`+Xq(t).image+`'`;return r?`Expecting: `+r+a:`Expecting: one of these possible Token sequences:1308+${Zq(Zq(lJ(e,(e,t)=>e.concat(t),[]),e=>`[${Zq(e,e=>XB(e)).join(`, `)}]`),(e,t)=>` ${t+1}. ${e}`).join(`1309+`)}`+a},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){let i=`1310+but found: '`+Xq(t).image+`'`;return n?`Expecting: `+n+i:`Expecting: expecting at least one iteration which starts with one of these possible Token sequences::1311+ <${Zq(e,e=>`[${Zq(e,e=>XB(e)).join(`,`)}]`).join(` ,`)}>`+i}},Object.freeze(XJ),V6e={buildRuleNotFoundError(e,t){return`Invalid grammar, reference to a rule which is not defined: ->`+t.nonTerminalName+`<-1312+inside top level rule: ->`+e.name+`<-`}},ZJ={buildDuplicateFoundError(e,t){function n(e){return e instanceof CJ?e.terminalType.name:e instanceof mJ?e.nonTerminalName:``}Q(n,`getExtraProductionArgument`);let r=e.name,i=Xq(t),a=i.idx,o=kB(i),s=n(i),l=`->${o}${a>0?a:``}<- ${s?`with argument: ->${s}<-`:``}1313+ appears more than once (${t.length} times) in the top level rule: ->${r}<-. 1314+ For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES 1315+ `;return l=l.replace(/[ \t]+/g,` `),l=l.replace(/\s\s+/g,`1316+`),l},buildNamespaceConflictError(e){return`Namespace conflict found in grammar.1317+The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.1318+To resolve this make sure each Terminal and Non-Terminal names are unique1319+This is easy to accomplish by using the convention that Terminal names start with an uppercase letter1320+and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(e){let t=Zq(e.prefixPath,e=>XB(e)).join(`, `),n=e.alternation.idx===0?``:e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(` ,`)}> due to common lookahead prefix1321+in <OR${n}> inside <${e.topLevelRule.name}> Rule,1322+<${t}> may appears as a prefix path in all these alternatives.1323+See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX1324+For Further details.`},buildAlternationAmbiguityError(e){let t=e.alternation.idx===0?``:e.alternation.idx,n=e.prefixPath.length===0,r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(` ,`)}> in <OR${t}> inside <${e.topLevelRule.name}> Rule,1325+`;if(n)r+=`These alternatives are all empty (match no tokens), making them indistinguishable.1326+Only the last alternative may be empty.1327+`;else{let t=Zq(e.prefixPath,e=>XB(e)).join(`, `);r+=`<${t}> may appears as a prefix path in all these alternatives.1328+`}return r+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES1329+For Further details.`,r},buildEmptyRepetitionError(e){let t=kB(e.repetition);return e.repetition.idx!==0&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.1330+This could lead to an infinite loop.`},buildTokenNameError(e){return`deprecated`},buildEmptyAlternationError(e){return`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in <OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.1331+Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(e){return`An Alternation cannot have more than 256 alternatives:1332+<OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.1333+ has ${e.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(e){let t=e.topLevelRule.name;return`Left Recursion found in grammar.1334+rule: <${t}> can be invoked from itself (directly or indirectly)1335+without consuming any Tokens. The grammar path that causes this is: 1336+ ${`${t} --> ${Zq(e.leftRecursionPath,e=>e.name).concat([t]).join(` --> `)}`}1337+ To fix this refactor your grammar to remove the left recursion.1338+see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(e){return`deprecated`},buildDuplicateRuleNameError(e){let t;return t=e.topLevelRule instanceof hJ?e.topLevelRule.name:e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}},Q(CJe,`resolveGrammar`),H6e=class extends wJ{static{Q(this,`GastRefResolverVisitor`)}constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){Gq(tJ(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{let t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:AY.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},U6e=class extends TJ{static{Q(this,`AbstractNextPossibleTokensWalker`)}constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName=``,this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error(`The path does not start with the walker's top Rule!`);return this.ruleStack=vq(this.path.ruleStack).reverse(),this.occurrenceStack=vq(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){iJ(this.ruleStack)?(this.nextProductionName=``,this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},W6e=class extends U6e{static{Q(this,`NextAfterTokenWalker`)}constructor(e,t){super(e,t),this.path=t,this.nextTerminalName=``,this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let e=new gJ({definition:t.concat(n)});this.possibleTokTypes=jB(e),this.found=!0}}},QJ=class extends TJ{static{Q(this,`AbstractNextTerminalAfterProductionWalker`)}constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},G6e=class extends QJ{static{Q(this,`NextTerminalAfterManyWalker`)}walkMany(e,t,n){if(e.idx===this.occurrence){let e=Xq(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof CJ&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}},$J=class extends QJ{static{Q(this,`NextTerminalAfterManySepWalker`)}walkManySep(e,t,n){if(e.idx===this.occurrence){let e=Xq(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof CJ&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}},K6e=class extends QJ{static{Q(this,`NextTerminalAfterAtLeastOneWalker`)}walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){let e=Xq(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof CJ&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}},eY=class extends QJ{static{Q(this,`NextTerminalAfterAtLeastOneSepWalker`)}walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){let e=Xq(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof CJ&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}},Q(tV,`possiblePathsFrom`),Q(nV,`nextPossibleTokensAfter`),Q(wJe,`expandTopLevelRule`),(function(e){e[e.OPTION=0]=`OPTION`,e[e.REPETITION=1]=`REPETITION`,e[e.REPETITION_MANDATORY=2]=`REPETITION_MANDATORY`,e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]=`REPETITION_MANDATORY_WITH_SEPARATOR`,e[e.REPETITION_WITH_SEPARATOR=4]=`REPETITION_WITH_SEPARATOR`,e[e.ALTERNATION=5]=`ALTERNATION`})(tY||={}),Q(rV,`getProdType`),Q(iV,`getLookaheadPaths`),Q(TJe,`buildLookaheadFuncForOr`),Q(EJe,`buildLookaheadFuncForOptionalProd`),Q(DJe,`buildAlternativesLookAheadFunc`),Q(OJe,`buildSingleAlternativeLookaheadFunction`),q6e=class extends TJ{static{Q(this,`RestDefinitionFinderWalker`)}constructor(e,t,n){super(),this.topProd=e,this.targetOccurrence=t,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,t,n,r){return e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.restDef=n.concat(r),!0)}walkOption(e,t,n){this.checkIsTarget(e,tY.OPTION,t,n)||super.walkOption(e,t,n)}walkAtLeastOne(e,t,n){this.checkIsTarget(e,tY.REPETITION_MANDATORY,t,n)||super.walkOption(e,t,n)}walkAtLeastOneSep(e,t,n){this.checkIsTarget(e,tY.REPETITION_MANDATORY_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}walkMany(e,t,n){this.checkIsTarget(e,tY.REPETITION,t,n)||super.walkOption(e,t,n)}walkManySep(e,t,n){this.checkIsTarget(e,tY.REPETITION_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}},nY=class extends wJ{static{Q(this,`InsideDefinitionFinderVisitor`)}constructor(e,t,n){super(),this.targetOccurrence=e,this.targetProdType=t,this.targetRef=n,this.result=[]}checkIsTarget(e,t){e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,tY.OPTION)}visitRepetition(e){this.checkIsTarget(e,tY.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,tY.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,tY.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,tY.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,tY.ALTERNATION)}},Q(aV,`initializeArrayOfArrays`),Q(oV,`pathToHashKeys`),Q(kJe,`isUniquePrefixHash`),Q(sV,`lookAheadSequenceFromAlternatives`),Q(cV,`getLookaheadPathsForOr`),Q(lV,`getLookaheadPathsForOptionalProd`),Q(uV,`containsPath`),Q(AJe,`isStrictPrefixOfPath`),Q(dV,`areTokenCategoriesNotUsed`),Q(jJe,`validateLookahead`),Q(MJe,`validateGrammar`),Q(NJe,`validateDuplicateProductions`),Q(PJe,`identifyProductionForDuplicates`),Q(fV,`getExtraProductionArgument`),J6e=class extends wJ{static{Q(this,`OccurrenceValidationCollector`)}constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}},Q(FJe,`validateRuleDoesNotAlreadyExist`),Q(IJe,`validateRuleIsOverridden`),Q(pV,`validateNoLeftRecursion`),Q(mV,`getFirstNoneTerminal`),rY=class extends wJ{static{Q(this,`OrCollector`)}constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},Q(LJe,`validateEmptyOrAlternative`),Q(RJe,`validateAmbiguousAlternationAlternatives`),Y6e=class extends wJ{static{Q(this,`RepetitionCollector`)}constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}},Q(zJe,`validateTooManyAlts`),Q(BJe,`validateSomeNonEmptyLookaheadPath`),Q(VJe,`checkAlternativesAmbiguities`),Q(HJe,`checkPrefixAlternativesAmbiguities`),Q(UJe,`checkTerminalAndNoneTerminalsNameSpace`),Q(WJe,`resolveGrammar`),Q(GJe,`validateGrammar`),iY=`MismatchedTokenException`,aY=`NoViableAltException`,oY=`EarlyExitException`,sY=`NotAllInputParsedException`,cY=[iY,aY,oY,sY],Object.freeze(cY),Q(hV,`isRecognitionException`),lY=class extends Error{static{Q(this,`RecognitionException`)}constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},uY=class extends lY{static{Q(this,`MismatchedTokenException`)}constructor(e,t,n){super(e,t),this.previousToken=n,this.name=iY}},X6e=class extends lY{static{Q(this,`NoViableAltException`)}constructor(e,t,n){super(e,t),this.previousToken=n,this.name=aY}},Z6e=class extends lY{static{Q(this,`NotAllInputParsedException`)}constructor(e,t){super(e,t),this.name=sY}},Q6e=class extends lY{static{Q(this,`EarlyExitException`)}constructor(e,t,n){super(e,t),this.previousToken=n,this.name=oY}},dY={},fY=`InRuleRecoveryException`,$6e=class extends Error{static{Q(this,`InRuleRecoveryException`)}constructor(e){super(e),this.name=fY}},e8e=class{static{Q(this,`Recoverable`)}initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=$q(e,`recoveryEnabled`)?e.recoveryEnabled:OY.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=KJe)}getTokenToInsert(e){let t=$B(e,``,NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){let i=this.findReSyncTokenType(),a=this.exportLexerState(),o=[],s=!1,l=this.LA(1),u=this.LA(1),d=Q(()=>{let e=this.LA(0),t=new uY(this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:l,previous:e,ruleName:this.getCurrRuleFullName()}),l,this.LA(0));t.resyncedTokens=Wq(o),this.SAVE_ERROR(t)},`generateErrorMessage`);for(;!s;)if(this.tokenMatcher(u,r)){d();return}else if(n.call(this)){d(),e.apply(this,t);return}else this.tokenMatcher(u,i)?s=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,t,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))}getFollowsForInRuleRecovery(e,t){let n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new $6e(`sad sad panda`)}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e)||iJ(t))return!1;let n=this.LA(1);return Yq(t,e=>this.tokenMatcher(n,e))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let t=this.getCurrFollowKey();return nJ(this.getFollowSetFromFollowKey(t),e)}findReSyncTokenType(){let e=this.flattenFollowSet(),t=this.LA(1),n=2;for(;;){let r=Yq(e,e=>eV(t,e));if(r!==void 0)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return dY;let e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK;return Zq(e,(n,r)=>r===0?dY:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:t[r],inRule:this.shortRuleNameToFullName(e[r-1])})}flattenFollowSet(){return IK(Zq(this.buildFullFollowKeyStack(),e=>this.getFollowSetFromFollowKey(e)))}getFollowSetFromFollowKey(e){if(e===dY)return[YJ];let t=e.ruleName+e.idxInCallingRule+EJ+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,YJ)||t.push(e),t}reSyncTo(e){let t=[],n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return Wq(t)}attemptInRepetitionRecovery(e,t,n,r,i,a,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:vq(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){return Zq(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},Q(KJe,`attemptInRepetitionRecovery`),t8e=4,pY=8,n8e=8,mY=1<<pY,hY=2<<pY,gY=3<<pY,_Y=4<<pY,vY=5<<pY,yY=6<<pY,Q(gV,`getKeyForAutomaticLookahead`),32-n8e,bY=class{static{Q(this,`LLkLookaheadStrategy`)}constructor(e){this.maxLookahead=e?.maxLookahead??OY.maxLookahead}validate(e){let t=this.validateNoLeftRecursion(e.rules);if(iJ(t)){let n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return Qq(e,e=>pV(e,e,ZJ))}validateEmptyOrAlternatives(e){return Qq(e,e=>LJe(e,ZJ))}validateAmbiguousAlternationAlternatives(e,t){return Qq(e,e=>RJe(e,t,ZJ))}validateSomeNonEmptyLookaheadPath(e,t){return BJe(e,t,ZJ)}buildLookaheadForAlternation(e){return TJe(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,DJe)}buildLookaheadForOptional(e){return EJe(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,rV(e.prodType),OJe)}},r8e=class{static{Q(this,`LooksAhead`)}initLooksAhead(e){this.dynamicTokensEnabled=$q(e,`dynamicTokensEnabled`)?e.dynamicTokensEnabled:OY.dynamicTokensEnabled,this.maxLookahead=$q(e,`maxLookahead`)?e.maxLookahead:OY.maxLookahead,this.lookaheadStrategy=$q(e,`lookaheadStrategy`)?e.lookaheadStrategy:new bY({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){Gq(e,e=>{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{let{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:o}=qJe(e);Gq(t,t=>{let n=t.idx===0?``:t.idx;this.TRACE_INIT(`${kB(t)}${n}`,()=>{let n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=gV(this.fullRuleNameToShort[e.name],mY,t.idx);this.setLaFuncCache(r,n)})}),Gq(n,t=>{this.computeLookaheadFunc(e,t.idx,gY,`Repetition`,t.maxLookahead,kB(t))}),Gq(r,t=>{this.computeLookaheadFunc(e,t.idx,hY,`Option`,t.maxLookahead,kB(t))}),Gq(i,t=>{this.computeLookaheadFunc(e,t.idx,_Y,`RepetitionMandatory`,t.maxLookahead,kB(t))}),Gq(a,t=>{this.computeLookaheadFunc(e,t.idx,yY,`RepetitionMandatoryWithSeparator`,t.maxLookahead,kB(t))}),Gq(o,t=>{this.computeLookaheadFunc(e,t.idx,vY,`RepetitionWithSeparator`,t.maxLookahead,kB(t))})})})}computeLookaheadFunc(e,t,n,r,i,a){this.TRACE_INIT(`${a}${t===0?``:t}`,()=>{let a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),o=gV(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(o,a)})}getKeyForAutomaticLookahead(e,t){return gV(this.getLastExplicitRuleShortName(),e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},i8e=class extends wJ{static{Q(this,`DslMethodsCollectorVisitor`)}constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},xY=new i8e,Q(qJe,`collectMethods`),Q(_V,`setNodeLocationOnlyOffset`),Q(vV,`setNodeLocationFull`),Q(JJe,`addTerminalToCst`),Q(YJe,`addNoneTerminalToCst`),a8e=`name`,Q(yV,`defineNameProp`),Q(XJe,`defaultVisit`),Q(ZJe,`createBaseSemanticVisitorConstructor`),Q(QJe,`createBaseVisitorConstructorWithDefaults`),(function(e){e[e.REDUNDANT_METHOD=0]=`REDUNDANT_METHOD`,e[e.MISSING_METHOD=1]=`MISSING_METHOD`})(o8e||={}),Q($Je,`validateVisitor`),Q(eYe,`validateMissingCstMethods`),s8e=class{static{Q(this,`TreeBuilder`)}initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=$q(e,`nodeLocationTracking`)?e.nodeLocationTracking:OY.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=RG,this.cstFinallyStateUpdate=RG,this.cstPostTerminal=RG,this.cstPostNonTerminal=RG,this.cstPostRule=RG;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=vV,this.setNodeLocationFromNode=vV,this.cstPostRule=RG,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=RG,this.setNodeLocationFromNode=RG,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=_V,this.setNodeLocationFromNode=_V,this.cstPostRule=RG,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=RG,this.setNodeLocationFromNode=RG,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=RG,this.setNodeLocationFromNode=RG,this.cstPostRule=RG,this.setInitialNodeLocation=RG;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){let t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){let t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let t=this.LA(0),n=e.location;n.startOffset<=t.startOffset?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){let t=this.LA(0),n=e.location;n.startOffset<=t.startOffset?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){let n=this.CST_STACK[this.CST_STACK.length-1];JJe(n,t,e),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){let n=this.CST_STACK[this.CST_STACK.length-1];YJe(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(sJ(this.baseCstVisitorConstructor)){let e=ZJe(this.className,yK(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(sJ(this.baseCstVisitorWithDefaultsConstructor)){let e=QJe(this.className,yK(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){let e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},c8e=class{static{Q(this,`LexerAdapter`)}initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error(`Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.`);this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):DY}LA(e){let t=this.currIdx+e;return t<0||this.tokVectorLength<=t?DY:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},l8e=class{static{Q(this,`RecognizerApi`)}ACTION(e){return e.call(this)}consume(e,t,n){return this.consumeInternal(t,e,n)}subrule(e,t,n){return this.subruleInternal(t,e,n)}option(e,t){return this.optionInternal(t,e)}or(e,t){return this.orInternal(t,e)}many(e,t){return this.manyInternal(e,t)}atLeastOne(e,t){return this.atLeastOneInternal(e,t)}CONSUME(e,t){return this.consumeInternal(e,0,t)}CONSUME1(e,t){return this.consumeInternal(e,1,t)}CONSUME2(e,t){return this.consumeInternal(e,2,t)}CONSUME3(e,t){return this.consumeInternal(e,3,t)}CONSUME4(e,t){return this.consumeInternal(e,4,t)}CONSUME5(e,t){return this.consumeInternal(e,5,t)}CONSUME6(e,t){return this.consumeInternal(e,6,t)}CONSUME7(e,t){return this.consumeInternal(e,7,t)}CONSUME8(e,t){return this.consumeInternal(e,8,t)}CONSUME9(e,t){return this.consumeInternal(e,9,t)}SUBRULE(e,t){return this.subruleInternal(e,0,t)}SUBRULE1(e,t){return this.subruleInternal(e,1,t)}SUBRULE2(e,t){return this.subruleInternal(e,2,t)}SUBRULE3(e,t){return this.subruleInternal(e,3,t)}SUBRULE4(e,t){return this.subruleInternal(e,4,t)}SUBRULE5(e,t){return this.subruleInternal(e,5,t)}SUBRULE6(e,t){return this.subruleInternal(e,6,t)}SUBRULE7(e,t){return this.subruleInternal(e,7,t)}SUBRULE8(e,t){return this.subruleInternal(e,8,t)}SUBRULE9(e,t){return this.subruleInternal(e,9,t)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,t,n=kY){if(nJ(this.definedRulesNames,e)){let t={message:ZJ.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:AY.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(t)}this.definedRulesNames.push(e);let r=this.defineRule(e,t,n);return this[e]=r,r}OVERRIDE_RULE(e,t,n=kY){let r=IJe(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);let i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){return function(){this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{return e.apply(this,t),!0}catch(e){if(hV(e))return!1;throw e}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Iqe(tJ(this.gastProductionsCache))}},u8e=class{static{Q(this,`RecognizerEngine`)}initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=GB,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},$q(t,`serializedGrammar`))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.1339+ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-01340+ For Further details.`);if(CG(e)){if(iJ(e))throw Error(`A Token Vocabulary cannot be empty.1341+ Note that the first argument for the parser constructor1342+ is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset==`number`)throw Error(`The Parser constructor no longer accepts a token vector as the first argument.1343+ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-01344+ For Further details.`)}if(CG(e))this.tokensMap=lJ(e,(e,t)=>(e[t.name]=t,e),{});else if($q(e,`modes`)&&Kq(IK(tJ(e.modes)),xJe)){let t=fJ(IK(tJ(e.modes)));this.tokensMap=lJ(t,(e,t)=>(e[t.name]=t,e),{})}else if(EG(e))this.tokensMap=vq(e);else throw Error(`<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition`);this.tokensMap.EOF=YJ;let n=Kq($q(e,`modes`)?IK(tJ(e.modes)):tJ(e),e=>iJ(e.categoryMatches));this.tokenMatcher=n?GB:WB,KB(tJ(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'1345+Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let r=$q(n,`resyncEnabled`)?n.resyncEnabled:kY.resyncEnabled,i=$q(n,`recoveryValueFunc`)?n.recoveryValueFunc:kY.recoveryValueFunc,a=this.ruleShortNameIdx<<t8e+pY;this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a;let o;return o=this.outputCst===!0?Q(function(...n){try{this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,n);let r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},`invokeRuleWithTry`):Q(function(...n){try{return this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,n)}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},`invokeRuleWithTryCst`),Object.assign(o,{ruleName:e,originalGrammarAction:t})}invokeRuleCatch(e,t,n){let r=this.RULE_STACK.length===1,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(hV(e)){let t=e;if(i){let r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){let e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}return n(e)}if(this.outputCst){let e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}if(r)return this.moveToTerminatedState(),n(e);throw t}throw e}optionInternal(e,t){let n=this.getKeyForAutomaticLookahead(hY,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r=this.getLaFuncFromCache(n),i;if(typeof e!=`function`){i=e.DEF;let t=e.GATE;if(t!==void 0){let e=r;r=Q(()=>t.call(this)&&e.call(this),`lookAheadFunc`)}}else i=e;if(r.call(this)===!0)return i.call(this)}atLeastOneInternal(e,t){let n=this.getKeyForAutomaticLookahead(_Y,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r=this.getLaFuncFromCache(n),i;if(typeof t!=`function`){i=t.DEF;let e=t.GATE;if(e!==void 0){let t=r;r=Q(()=>e.call(this)&&t.call(this),`lookAheadFunc`)}}else i=t;if(r.call(this)===!0){let e=this.doSingleRepetition(i);for(;r.call(this)===!0&&e===!0;)e=this.doSingleRepetition(i)}else throw this.raiseEarlyExitException(e,tY.REPETITION_MANDATORY,t.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],r,_Y,e,K6e)}atLeastOneSepFirstInternal(e,t){let n=this.getKeyForAutomaticLookahead(yY,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){let r=t.DEF,i=t.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){r.call(this);let t=Q(()=>this.tokenMatcher(this.LA(1),i),`separatorLookAheadFunc`);for(;this.tokenMatcher(this.LA(1),i)===!0;)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,eY],t,yY,e,eY)}else throw this.raiseEarlyExitException(e,tY.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG)}manyInternal(e,t){let n=this.getKeyForAutomaticLookahead(gY,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r=this.getLaFuncFromCache(n),i;if(typeof t!=`function`){i=t.DEF;let e=t.GATE;if(e!==void 0){let t=r;r=Q(()=>e.call(this)&&t.call(this),`lookaheadFunction`)}}else i=t;let a=!0;for(;r.call(this)===!0&&a===!0;)a=this.doSingleRepetition(i);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],r,gY,e,G6e,a)}manySepFirstInternal(e,t){let n=this.getKeyForAutomaticLookahead(vY,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){let r=t.DEF,i=t.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){r.call(this);let t=Q(()=>this.tokenMatcher(this.LA(1),i),`separatorLookAheadFunc`);for(;this.tokenMatcher(this.LA(1),i)===!0;)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,$J],t,vY,e,$J)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,yY,e,i)}doSingleRepetition(e){let t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){let n=this.getKeyForAutomaticLookahead(mY,t),r=CG(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(i!==void 0)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){let e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Z6e(t,e))}}subruleInternal(e,t,n){let r;try{let i=n===void 0?void 0:n.ARGS;return this.subruleIdx=t,r=e.apply(this,i),this.cstPostNonTerminal(r,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),r}catch(t){throw this.subruleInternalError(t,n,e.ruleName)}}subruleInternalError(e,t,n){throw hV(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,t!==void 0&&t.LABEL!==void 0?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{let t=this.LA(1);this.tokenMatcher(t,e)===!0?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r,i=this.LA(0);throw r=n!==void 0&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new uY(r,t,i))}consumeInternalRecovery(e,t,n){if(this.recoveryEnabled&&n.name===`MismatchedTokenException`&&!this.isBackTracking()){let r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===fY?n:e}}throw n}saveRecogState(){let e=this.errors,t=vq(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),YJ)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},d8e=class{static{Q(this,`ErrorHandler`)}initErrorHandler(e){this._errors=[],this.errorMessageProvider=$q(e,`errorMessageProvider`)?e.errorMessageProvider:OY.errorMessageProvider}SAVE_ERROR(e){if(hV(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:vq(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error(`Trying to save an Error which is not a RecognitionException`)}get errors(){return vq(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){let r=this.getCurrRuleFullName(),i=this.getGAstProductions()[r],a=lV(e,i,t,this.maxLookahead)[0],o=[];for(let e=1;e<=this.maxLookahead;e++)o.push(this.LA(e));let s=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:o,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new Q6e(s,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){let n=this.getCurrRuleFullName(),r=this.getGAstProductions()[n],i=cV(e,r,this.maxLookahead),a=[];for(let e=1;e<=this.maxLookahead;e++)a.push(this.LA(e));let o=this.LA(0),s=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:i,actual:a,previous:o,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new X6e(s,this.LA(1),o))}},f8e=class{static{Q(this,`ContentAssist`)}initContentAssist(){}computeContentAssist(e,t){let n=this.gastProductionsCache[e];if(sJ(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return nV([n],t,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){let t=Xq(e.ruleStack),n=this.getGAstProductions()[t];return new W6e(n,e).startWalking()}},SY={description:`This Object indicates the Parser is during Recording Phase`},Object.freeze(SY),CY=!0,wY=2**pY-1,TY=QB({name:`RECORDING_PHASE_TOKEN`,pattern:BJ.NA}),KB([TY]),EY=$B(TY,`This IToken indicates the Parser is in Recording Phase1346+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1),Object.freeze(EY),p8e={name:`This CSTNode indicates the Parser is in Recording Phase1347+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},m8e=class{static{Q(this,`GastRecorder`)}initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT(`Enable Recording`,()=>{for(let e=0;e<10;e++){let t=e>0?e:``;this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT(`Deleting Recording methods`,()=>{let e=this;for(let t=0;t<10;t++){let n=t>0?t:``;delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return DY}topLevelRuleRecord(e,t){try{let n=new hJ({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(e.KNOWN_RECORDER_ERROR!==!0)try{e.message+=`1348+ This error was thrown during the "grammar recording phase" For more info see:1349+ https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw e}throw e}}optionInternalRecord(e,t){return bV.call(this,_J,e,t)}atLeastOneInternalRecord(e,t){bV.call(this,vJ,t,e)}atLeastOneSepFirstInternalRecord(e,t){bV.call(this,yJ,t,e,CY)}manyInternalRecord(e,t){bV.call(this,bJ,t,e)}manySepFirstInternalRecord(e,t){bV.call(this,xJ,t,e,CY)}orInternalRecord(e,t){return tYe.call(this,e,t)}subruleInternalRecord(e,t,n){if(SV(t),!e||$q(e,`ruleName`)===!1){let n=Error(`<SUBRULE${xV(t)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>1350+ inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}let r=Hq(this.recordingProdStack),i=e.ruleName,a=new mJ({idx:t,nonTerminalName:i,label:n?.LABEL,referencedRule:void 0});return r.definition.push(a),this.outputCst?p8e:SY}consumeInternalRecord(e,t,n){if(SV(t),!JB(e)){let n=Error(`<CONSUME${xV(t)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>1351+ inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}let r=Hq(this.recordingProdStack),i=new CJ({idx:t,terminalType:e,label:n?.LABEL});return r.definition.push(i),EY}},Q(bV,`recordProd`),Q(tYe,`recordOrProd`),Q(xV,`getIdxSuffix`),Q(SV,`assertMethodIdxIsValid`),h8e=class{static{Q(this,`PerformanceTracer`)}initPerformanceTracer(e){if($q(e,`traceInitPerf`)){let t=e.traceInitPerf,n=typeof t==`number`;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=OY.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(this.traceInitPerf===!0){this.traceInitIndent++;let n=Array(this.traceInitIndent+1).join(` `);this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);let{time:r,value:i}=TB(t),a=r>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${n}<-- <${e}> time: ${r}ms`),this.traceInitIndent--,i}return t()}},Q(nYe,`applyMixins`),DY=$B(YJ,``,NaN,NaN,NaN,NaN,NaN,NaN),Object.freeze(DY),OY=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:XJ,nodeLocationTracking:`none`,traceInitPerf:!1,skipValidations:!1}),kY=Object.freeze({recoveryValueFunc:Q(()=>void 0,`recoveryValueFunc`),resyncEnabled:!0}),(function(e){e[e.INVALID_RULE_NAME=0]=`INVALID_RULE_NAME`,e[e.DUPLICATE_RULE_NAME=1]=`DUPLICATE_RULE_NAME`,e[e.INVALID_RULE_OVERRIDE=2]=`INVALID_RULE_OVERRIDE`,e[e.DUPLICATE_PRODUCTIONS=3]=`DUPLICATE_PRODUCTIONS`,e[e.UNRESOLVED_SUBRULE_REF=4]=`UNRESOLVED_SUBRULE_REF`,e[e.LEFT_RECURSION=5]=`LEFT_RECURSION`,e[e.NONE_LAST_EMPTY_ALT=6]=`NONE_LAST_EMPTY_ALT`,e[e.AMBIGUOUS_ALTS=7]=`AMBIGUOUS_ALTS`,e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]=`CONFLICT_TOKENS_RULES_NAMESPACE`,e[e.INVALID_TOKEN_NAME=9]=`INVALID_TOKEN_NAME`,e[e.NO_NON_EMPTY_LOOKAHEAD=10]=`NO_NON_EMPTY_LOOKAHEAD`,e[e.AMBIGUOUS_PREFIX_ALTS=11]=`AMBIGUOUS_PREFIX_ALTS`,e[e.TOO_MANY_ALTS=12]=`TOO_MANY_ALTS`,e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]=`CUSTOM_LOOKAHEAD_VALIDATION`})(AY||={}),Q(CV,`EMPTY_ALT`),jY=class e{static{Q(this,`Parser`)}static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT(`performSelfAnalysis`,()=>{let t;this.selfAnalysisDone=!0;let n=this.className;this.TRACE_INIT(`toFastProps`,()=>{EB(this)}),this.TRACE_INIT(`Grammar Recording`,()=>{try{this.enableRecording(),Gq(this.definedRulesNames,e=>{let t=this[e].originalGrammarAction,n;this.TRACE_INIT(`${e} Rule`,()=>{n=this.topLevelRuleRecord(e,t)}),this.gastProductionsCache[e]=n})}finally{this.disableRecording()}});let r=[];if(this.TRACE_INIT(`Grammar Resolving`,()=>{r=WJe({rules:tJ(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)}),this.TRACE_INIT(`Grammar Validations`,()=>{if(iJ(r)&&this.skipValidations===!1){let e=GJe({rules:tJ(this.gastProductionsCache),tokenTypes:tJ(this.tokensMap),errMsgProvider:ZJ,grammarName:n}),t=jJe({lookaheadStrategy:this.lookaheadStrategy,rules:tJ(this.gastProductionsCache),tokenTypes:tJ(this.tokensMap),grammarName:n});this.definitionErrors=this.definitionErrors.concat(e,t)}}),iJ(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT(`computeAllProdsFollows`,()=>{let e=Hqe(tJ(this.gastProductionsCache));this.resyncFollows=e}),this.TRACE_INIT(`ComputeLookaheadFunctions`,()=>{var e,t;(t=(e=this.lookaheadStrategy).initialize)==null||t.call(e,{rules:tJ(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(tJ(this.gastProductionsCache))})),!e.DEFER_DEFINITION_ERRORS_HANDLING&&!iJ(this.definitionErrors))throw t=Zq(this.definitionErrors,e=>e.message),Error(`Parser Definition Errors detected:1352+ ${t.join(`1353+-------------------------------1354+`)}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;let n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initContentAssist(),n.initGastRecorder(t),n.initPerformanceTracer(t),$q(t,`ignoredIssues`))throw Error(`The <ignoredIssues> IParserConfig property has been deprecated.1355+ Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.1356+ See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES1357+ For further details.`);this.skipValidations=$q(t,`skipValidations`)?t.skipValidations:OY.skipValidations}},jY.DEFER_DEFINITION_ERRORS_HANDLING=!1,nYe(jY,[e8e,r8e,s8e,c8e,u8e,l8e,d8e,f8e,m8e,h8e]),g8e=class extends jY{static{Q(this,`EmbeddedActionsParser`)}constructor(e,t=OY){let n=vq(t);n.outputCst=!1,super(e,n)}},Q(rYe,`arrayMap`),MY=rYe,Q(iYe,`listCacheClear`),_8e=iYe,Q(aYe,`eq`),NY=aYe,Q(oYe,`assocIndexOf`),PY=oYe,v8e=Array.prototype.splice,Q(sYe,`listCacheDelete`),y8e=sYe,Q(cYe,`listCacheGet`),b8e=cYe,Q(lYe,`listCacheHas`),x8e=lYe,Q(uYe,`listCacheSet`),S8e=uYe,Q(wV,`ListCache`),wV.prototype.clear=_8e,wV.prototype.delete=y8e,wV.prototype.get=b8e,wV.prototype.has=x8e,wV.prototype.set=S8e,FY=wV,Q(dYe,`stackClear`),C8e=dYe,Q(fYe,`stackDelete`),w8e=fYe,Q(pYe,`stackGet`),T8e=pYe,Q(mYe,`stackHas`),E8e=mYe,IY=typeof global==`object`&&global&&global.Object===Object&&global,D8e=typeof self==`object`&&self&&self.Object===Object&&self,LY=IY||D8e||Function(`return this`)(),RY=LY.Symbol,zY=Object.prototype,O8e=zY.hasOwnProperty,k8e=zY.toString,BY=RY?RY.toStringTag:void 0,Q(hYe,`getRawTag`),A8e=hYe,j8e=Object.prototype.toString,Q(gYe,`objectToString`),M8e=gYe,N8e=`[object Null]`,P8e=`[object Undefined]`,VY=RY?RY.toStringTag:void 0,Q(_Ye,`baseGetTag`),HY=_Ye,Q(vYe,`isObject`),UY=vYe,F8e=`[object AsyncFunction]`,I8e=`[object Function]`,L8e=`[object GeneratorFunction]`,R8e=`[object Proxy]`,Q(yYe,`isFunction`),WY=yYe,GY=LY[`__core-js_shared__`],KY=(function(){var e=/[^.]+$/.exec(GY&&GY.keys&&GY.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``})(),Q(bYe,`isMasked`),z8e=bYe,B8e=Function.prototype.toString,Q(xYe,`toSource`),qY=xYe,V8e=/[\\^$.*+?()[\]{}|]/g,H8e=/^\[object .+?Constructor\]$/,U8e=Function.prototype,W8e=Object.prototype,G8e=U8e.toString,K8e=W8e.hasOwnProperty,q8e=RegExp(`^`+G8e.call(K8e).replace(V8e,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),Q(SYe,`baseIsNative`),J8e=SYe,Q(CYe,`getValue`),Y8e=CYe,Q(wYe,`getNative`),JY=wYe,YY=JY(LY,`Map`),XY=JY(Object,`create`),Q(TYe,`hashClear`),X8e=TYe,Q(EYe,`hashDelete`),Z8e=EYe,Q8e=`__lodash_hash_undefined__`,$8e=Object.prototype.hasOwnProperty,Q(DYe,`hashGet`),e5e=DYe,t5e=Object.prototype.hasOwnProperty,Q(OYe,`hashHas`),n5e=OYe,r5e=`__lodash_hash_undefined__`,Q(kYe,`hashSet`),i5e=kYe,Q(TV,`Hash`),TV.prototype.clear=X8e,TV.prototype.delete=Z8e,TV.prototype.get=e5e,TV.prototype.has=n5e,TV.prototype.set=i5e,ZY=TV,Q(AYe,`mapCacheClear`),a5e=AYe,Q(jYe,`isKeyable`),o5e=jYe,Q(MYe,`getMapData`),QY=MYe,Q(NYe,`mapCacheDelete`),s5e=NYe,Q(PYe,`mapCacheGet`),c5e=PYe,Q(FYe,`mapCacheHas`),l5e=FYe,Q(IYe,`mapCacheSet`),u5e=IYe,Q(EV,`MapCache`),EV.prototype.clear=a5e,EV.prototype.delete=s5e,EV.prototype.get=c5e,EV.prototype.has=l5e,EV.prototype.set=u5e,$Y=EV,d5e=200,Q(LYe,`stackSet`),f5e=LYe,Q(DV,`Stack`),DV.prototype.clear=C8e,DV.prototype.delete=w8e,DV.prototype.get=T8e,DV.prototype.has=E8e,DV.prototype.set=f5e,eX=DV,p5e=`__lodash_hash_undefined__`,Q(RYe,`setCacheAdd`),m5e=RYe,Q(zYe,`setCacheHas`),h5e=zYe,Q(OV,`SetCache`),OV.prototype.add=OV.prototype.push=m5e,OV.prototype.has=h5e,tX=OV,Q(BYe,`arraySome`),g5e=BYe,Q(VYe,`cacheHas`),nX=VYe,_5e=1,v5e=2,Q(HYe,`equalArrays`),rX=HYe,iX=LY.Uint8Array,Q(UYe,`mapToArray`),y5e=UYe,Q(WYe,`setToArray`),aX=WYe,b5e=1,x5e=2,S5e=`[object Boolean]`,C5e=`[object Date]`,w5e=`[object Error]`,T5e=`[object Map]`,E5e=`[object Number]`,D5e=`[object RegExp]`,O5e=`[object Set]`,k5e=`[object String]`,A5e=`[object Symbol]`,j5e=`[object ArrayBuffer]`,M5e=`[object DataView]`,oX=RY?RY.prototype:void 0,sX=oX?oX.valueOf:void 0,Q(GYe,`equalByTag`),N5e=GYe,Q(KYe,`arrayPush`),cX=KYe,lX=Array.isArray,Q(qYe,`baseGetAllKeys`),P5e=qYe,Q(JYe,`arrayFilter`),uX=JYe,Q(YYe,`stubArray`),F5e=YYe,I5e=Object.prototype.propertyIsEnumerable,dX=Object.getOwnPropertySymbols,L5e=dX?function(e){return e==null?[]:(e=Object(e),uX(dX(e),function(t){return I5e.call(e,t)}))}:F5e,Q(XYe,`baseTimes`),R5e=XYe,Q(ZYe,`isObjectLike`),fX=ZYe,z5e=`[object Arguments]`,Q(QYe,`baseIsArguments`),pX=QYe,mX=Object.prototype,B5e=mX.hasOwnProperty,V5e=mX.propertyIsEnumerable,hX=pX((function(){return arguments})())?pX:function(e){return fX(e)&&B5e.call(e,`callee`)&&!V5e.call(e,`callee`)},Q($Ye,`stubFalse`),H5e=$Ye,gX=typeof exports==`object`&&exports&&!exports.nodeType&&exports,_X=gX&&typeof module==`object`&&module&&!module.nodeType&&module,vX=_X&&_X.exports===gX?LY.Buffer:void 0,yX=(vX?vX.isBuffer:void 0)||H5e,U5e=9007199254740991,W5e=/^(?:0|[1-9]\d*)$/,Q(eXe,`isIndex`),bX=eXe,G5e=9007199254740991,Q(tXe,`isLength`),xX=tXe,K5e=`[object Arguments]`,q5e=`[object Array]`,J5e=`[object Boolean]`,Y5e=`[object Date]`,X5e=`[object Error]`,Z5e=`[object Function]`,Q5e=`[object Map]`,$5e=`[object Number]`,e7e=`[object Object]`,t7e=`[object RegExp]`,n7e=`[object Set]`,r7e=`[object String]`,i7e=`[object WeakMap]`,a7e=`[object ArrayBuffer]`,o7e=`[object DataView]`,s7e=`[object Float32Array]`,c7e=`[object Float64Array]`,l7e=`[object Int8Array]`,u7e=`[object Int16Array]`,d7e=`[object Int32Array]`,f7e=`[object Uint8Array]`,p7e=`[object Uint8ClampedArray]`,m7e=`[object Uint16Array]`,h7e=`[object Uint32Array]`,SX={},SX[s7e]=SX[c7e]=SX[l7e]=SX[u7e]=SX[d7e]=SX[f7e]=SX[p7e]=SX[m7e]=SX[h7e]=!0,SX[K5e]=SX[q5e]=SX[a7e]=SX[J5e]=SX[o7e]=SX[Y5e]=SX[X5e]=SX[Z5e]=SX[Q5e]=SX[$5e]=SX[e7e]=SX[t7e]=SX[n7e]=SX[r7e]=SX[i7e]=!1,Q(nXe,`baseIsTypedArray`),g7e=nXe,Q(rXe,`baseUnary`),_7e=rXe,CX=typeof exports==`object`&&exports&&!exports.nodeType&&exports,wX=CX&&typeof module==`object`&&module&&!module.nodeType&&module,TX=wX&&wX.exports===CX&&IY.process,EX=(function(){try{return wX&&wX.require&&wX.require(`util`).types||TX&&TX.binding&&TX.binding(`util`)}catch{}})(),DX=EX&&EX.isTypedArray,OX=DX?_7e(DX):g7e,v7e=Object.prototype.hasOwnProperty,Q(iXe,`arrayLikeKeys`),y7e=iXe,b7e=Object.prototype,Q(aXe,`isPrototype`),kX=aXe,Q(oXe,`overArg`),x7e=oXe(Object.keys,Object),S7e=Object.prototype.hasOwnProperty,Q(sXe,`baseKeys`),AX=sXe,Q(cXe,`isArrayLike`),jX=cXe,Q(lXe,`keys`),MX=lXe,Q(uXe,`getAllKeys`),NX=uXe,C7e=1,w7e=Object.prototype.hasOwnProperty,Q(dXe,`equalObjects`),T7e=dXe,PX=JY(LY,`DataView`),FX=JY(LY,`Promise`),IX=JY(LY,`Set`),LX=JY(LY,`WeakMap`),RX=`[object Map]`,E7e=`[object Object]`,zX=`[object Promise]`,BX=`[object Set]`,VX=`[object WeakMap]`,HX=`[object DataView]`,D7e=qY(PX),O7e=qY(YY),k7e=qY(FX),A7e=qY(IX),j7e=qY(LX),UX=HY,(PX&&UX(new PX(new ArrayBuffer(1)))!=HX||YY&&UX(new YY)!=RX||FX&&UX(FX.resolve())!=zX||IX&&UX(new IX)!=BX||LX&&UX(new LX)!=VX)&&(UX=Q(function(e){var t=HY(e),n=t==E7e?e.constructor:void 0,r=n?qY(n):``;if(r)switch(r){case D7e:return HX;case O7e:return RX;case k7e:return zX;case A7e:return BX;case j7e:return VX}return t},`getTag`)),WX=UX,M7e=1,GX=`[object Arguments]`,KX=`[object Array]`,qX=`[object Object]`,JX=Object.prototype.hasOwnProperty,Q(fXe,`baseIsEqualDeep`),N7e=fXe,Q(kV,`baseIsEqual`),YX=kV,P7e=1,F7e=2,Q(pXe,`baseIsMatch`),I7e=pXe,Q(mXe,`isStrictComparable`),XX=mXe,Q(hXe,`getMatchData`),L7e=hXe,Q(gXe,`matchesStrictComparable`),ZX=gXe,Q(_Xe,`baseMatches`),R7e=_Xe,z7e=`[object Symbol]`,Q(vXe,`isSymbol`),QX=vXe,B7e=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,V7e=/^\w*$/,Q(yXe,`isKey`),$X=yXe,H7e=`Expected a function`,Q(AV,`memoize`),AV.Cache=$Y,U7e=AV,W7e=500,Q(bXe,`memoizeCapped`),G7e=bXe,K7e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,q7e=/\\(\\)?/g,J7e=G7e(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(K7e,function(e,n,r,i){t.push(r?i.replace(q7e,`$1`):n||e)}),t}),Y7e=1/0,eZ=RY?RY.prototype:void 0,tZ=eZ?eZ.toString:void 0,Q(jV,`baseToString`),X7e=jV,Q(xXe,`toString`),Z7e=xXe,Q(SXe,`castPath`),nZ=SXe,Q7e=1/0,Q(CXe,`toKey`),rZ=CXe,Q(wXe,`baseGet`),iZ=wXe,Q(TXe,`get`),$7e=TXe,Q(EXe,`baseHasIn`),e9e=EXe,Q(DXe,`hasPath`),t9e=DXe,Q(OXe,`hasIn`),n9e=OXe,r9e=1,i9e=2,Q(kXe,`baseMatchesProperty`),a9e=kXe,Q(AXe,`identity`),aZ=AXe,Q(jXe,`baseProperty`),o9e=jXe,Q(MXe,`basePropertyDeep`),s9e=MXe,Q(NXe,`property`),c9e=NXe,Q(PXe,`baseIteratee`),oZ=PXe,Q(FXe,`createBaseFor`),l9e=FXe(),Q(IXe,`baseForOwn`),u9e=IXe,Q(LXe,`createBaseEach`),sZ=LXe(u9e),Q(RXe,`baseMap`),d9e=RXe,Q(zXe,`map`),cZ=zXe,Q(BXe,`baseFilter`),f9e=BXe,Q(VXe,`filter`),p9e=VXe,Q(MV,`buildATNKey`),lZ=1,m9e=2,uZ=4,dZ=5,fZ=7,h9e=8,g9e=9,_9e=10,v9e=11,pZ=12,mZ=class{static{Q(this,`AbstractTransition`)}constructor(e){this.target=e}isEpsilon(){return!1}},hZ=class extends mZ{static{Q(this,`AtomTransition`)}constructor(e,t){super(e),this.tokenType=t}},gZ=class extends mZ{static{Q(this,`EpsilonTransition`)}constructor(e){super(e)}isEpsilon(){return!0}},_Z=class extends mZ{static{Q(this,`RuleTransition`)}constructor(e,t,n){super(e),this.rule=t,this.followState=n}isEpsilon(){return!0}},Q(HXe,`createATN`),Q(UXe,`createRuleStartAndStopATNStates`),Q(NV,`atom`),Q(WXe,`repetition`),Q(GXe,`repetitionSep`),Q(KXe,`repetitionMandatory`),Q(qXe,`repetitionMandatorySep`),Q(JXe,`alternation`),Q(YXe,`option`),Q(PV,`block`),Q(FV,`plus`),Q(IV,`star`),Q(XXe,`optional`),Q(LV,`defineDecisionState`),Q(RV,`makeAlts`),Q(ZXe,`getProdType`),Q(QXe,`makeBlock`),Q(zV,`tokenRef`),Q($Xe,`ruleRef`),Q(eZe,`buildRuleHandle`),Q(BV,`epsilon`),Q(VV,`newState`),Q(HV,`addTransition`),Q(tZe,`removeState`),vZ={},yZ=class{static{Q(this,`ATNConfigSet`)}constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){let t=UV(e);t in this.map||(this.map[t]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return cZ(this.configs,e=>e.alt)}get key(){let e=``;for(let t in this.map)e+=t+`:`;return e}},Q(UV,`getATNConfigKey`),Q(nZe,`baseExtremum`),y9e=nZe,Q(rZe,`baseLt`),b9e=rZe,Q(iZe,`min`),x9e=iZe,bZ=RY?RY.isConcatSpreadable:void 0,Q(aZe,`isFlattenable`),S9e=aZe,Q(WV,`baseFlatten`),xZ=WV,Q(oZe,`flatMap`),C9e=oZe,Q(sZe,`baseFindIndex`),w9e=sZe,Q(cZe,`baseIsNaN`),T9e=cZe,Q(lZe,`strictIndexOf`),E9e=lZe,Q(uZe,`baseIndexOf`),D9e=uZe,Q(dZe,`arrayIncludes`),O9e=dZe,Q(fZe,`arrayIncludesWith`),k9e=fZe,Q(pZe,`noop`),A9e=pZe,j9e=IX&&1/aX(new IX([,-0]))[1]==1/0?function(e){return new IX(e)}:A9e,M9e=200,Q(mZe,`baseUniq`),N9e=mZe,Q(hZe,`uniqBy`),P9e=hZe,Q(gZe,`flatten`),F9e=gZe,Q(_Ze,`arrayEach`),I9e=_Ze,Q(vZe,`castFunction`),L9e=vZe,Q(yZe,`forEach`),SZ=yZe,R9e=`[object Map]`,z9e=`[object Set]`,B9e=Object.prototype.hasOwnProperty,Q(bZe,`isEmpty`),V9e=bZe,Q(xZe,`arrayReduce`),H9e=xZe,Q(SZe,`baseReduce`),U9e=SZe,Q(CZe,`reduce`),CZ=CZe,Q(wZe,`createDFACache`),wZ=class{static{Q(this,`PredicateSet`)}constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,t){this.predicates[e]=t}toString(){let e=``,t=this.predicates.length;for(let n=0;n<t;n++)e+=this.predicates[n]===!0?`1`:`0`;return e}},TZ=new wZ,W9e=class extends bY{static{Q(this,`LLStarLookaheadStrategy`)}constructor(e){super(),this.logging=e?.logging??(e=>console.log(e))}initialize(e){this.atn=HXe(e.rules),this.dfas=TZe(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){let{prodOccurrence:t,rule:n,hasPredicates:r,dynamicTokensEnabled:i}=e,a=this.dfas,o=this.logging,s=MV(n,`Alternation`,t),l=this.atn.decisionMap[s].decision,u=cZ(iV({maxLookahead:1,occurrence:t,prodType:`Alternation`,rule:n}),e=>cZ(e,e=>e[0]));if(GV(u,!1)&&!i){let e=CZ(u,(e,t,n)=>(SZ(t,t=>{t&&(e[t.tokenTypeIdx]=n,SZ(t.categoryMatches,t=>{e[t]=n}))}),e),{});return r?function(t){let n=this.LA(1),r=e[n.tokenTypeIdx];if(t!==void 0&&r!==void 0){let e=t[r]?.GATE;if(e!==void 0&&e.call(this)===!1)return}return r}:function(){let t=this.LA(1);return e[t.tokenTypeIdx]}}return r?function(e){let t=new wZ,n=e===void 0?0:e.length;for(let r=0;r<n;r++){let n=e?.[r].GATE;t.set(r,n===void 0||n.call(this))}let r=KV.call(this,a,l,t,o);return typeof r==`number`?r:void 0}:function(){let e=KV.call(this,a,l,TZ,o);return typeof e==`number`?e:void 0}}buildLookaheadForOptional(e){let{prodOccurrence:t,rule:n,prodType:r,dynamicTokensEnabled:i}=e,a=this.dfas,o=this.logging,s=MV(n,r,t),l=this.atn.decisionMap[s].decision,u=cZ(iV({maxLookahead:1,occurrence:t,prodType:r,rule:n}),e=>cZ(e,e=>e[0]));if(GV(u)&&u[0][0]&&!i){let e=u[0],t=F9e(e);if(t.length===1&&V9e(t[0].categoryMatches)){let e=t[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===e}}{let e=CZ(t,(e,t)=>(t!==void 0&&(e[t.tokenTypeIdx]=!0,SZ(t.categoryMatches,t=>{e[t]=!0})),e),{});return function(){let t=this.LA(1);return e[t.tokenTypeIdx]===!0}}}return function(){let e=KV.call(this,a,l,TZ,o);return typeof e!=`object`&&e===0}}},Q(GV,`isLL1Sequence`),Q(TZe,`initATNSimulator`),Q(KV,`adaptivePredict`),Q(EZe,`performLookahead`),Q(DZe,`computeLookaheadTarget`),Q(OZe,`reportLookaheadAmbiguity`),Q(kZe,`buildAmbiguityError`),Q(AZe,`getProductionDslName`),Q(jZe,`buildAdaptivePredictError`),Q(MZe,`getExistingTargetState`),Q(NZe,`computeReachSet`),Q(PZe,`getReachableTarget`),Q(FZe,`getUniqueAlt`),Q(qV,`newDFAState`),Q(JV,`addDFAEdge`),Q(YV,`addDFAState`),Q(IZe,`computeStartState`),Q(XV,`closure`),Q(LZe,`getEpsilonTarget`),Q(RZe,`hasConfigInRuleStopState`),Q(zZe,`allConfigsInRuleStopStates`),Q(BZe,`hasConflictTerminatingPrediction`),Q(VZe,`getConflictingAltSets`),Q(HZe,`hasConflictingAltSet`),Q(UZe,`hasStateAssociatedWithOneAlt`),kU(),EZ=class{static{Q(this,`CstNodeBuilder`)}constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new AZ(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){let t=new kZ;return t.grammarSource=e,t.root=this.rootNode,this.current.content.push(t),this.nodeStack.push(t),t}buildLeafNode(e,t){let n=new OZ(e.startOffset,e.image.length,gz(e),e.tokenType,!t);return n.grammarSource=t,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){let t=e.container;if(t){let n=t.content.indexOf(e);n>=0&&t.content.splice(n,1)}}addHiddenNodes(e){let t=[];for(let n of e){let e=new OZ(n.startOffset,n.image.length,gz(n),n.tokenType,!0);e.root=this.rootNode,t.push(e)}let n=this.current,r=!1;if(n.content.length>0){n.content.push(...t);return}for(;n.container;){let e=n.container.content.indexOf(n);if(e>0){n.container.content.splice(e,0,...t),r=!0;break}n=n.container}r||this.rootNode.content.unshift(...t)}construct(e){let t=this.current;typeof e.$type==`string`&&!e.$infixName&&(this.current.astNode=e),e.$cstNode=t;let n=this.nodeStack.pop();n?.content.length===0&&this.removeNode(n)}},DZ=class{static{Q(this,`AbstractCstNode`)}get hidden(){return!1}get astNode(){let e=typeof this._astNode?.$type==`string`?this._astNode:this.container?.astNode;if(!e)throw Error(`This node has no associated AST element`);return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}},OZ=class extends DZ{static{Q(this,`LeafCstNodeImpl`)}get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,t,n,r,i=!1){super(),this._hidden=i,this._offset=e,this._tokenType=r,this._length=t,this._range=n}},kZ=class extends DZ{static{Q(this,`CompositeCstNodeImpl`)}constructor(){super(...arguments),this.content=new G9e(this)}get offset(){return this.firstNonHiddenNode?.offset??0}get length(){return this.end-this.offset}get end(){return this.lastNonHiddenNode?.end??0}get range(){let e=this.firstNonHiddenNode,t=this.lastNonHiddenNode;if(e&&t){if(this._rangeCache===void 0){let{range:n}=e,{range:r}=t;this._rangeCache={start:n.start,end:r.end.line<n.start.line?n.start:r.end}}return this._rangeCache}return{start:rU.create(0,0),end:rU.create(0,0)}}get firstNonHiddenNode(){for(let e of this.content)if(!e.hidden)return e;return this.content[0]}get lastNonHiddenNode(){for(let e=this.content.length-1;e>=0;e--){let t=this.content[e];if(!t.hidden)return t}return this.content[this.content.length-1]}},G9e=class e extends Array{static{Q(this,`CstNodeContainer`)}constructor(t){super(),this.parent=t,Object.setPrototypeOf(this,e.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,t,...n){return this.addParents(n),super.splice(e,t,...n)}addParents(e){for(let t of e)t.container=this.parent}},AZ=class extends kZ{static{Q(this,`RootCstNodeImpl`)}get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text=``,this._text=e??``}},jZ=Symbol(`Datatype`),Q(ZV,`isDataTypeNode`),MZ=``,NZ=Q(e=>e.endsWith(MZ)?e:e+MZ,`withRuleSuffix`),PZ=class{static{Q(this,`AbstractLangiumParser`)}constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;let t=this.lexer.definition,n=e.LanguageMetaData.mode===`production`;this.wrapper=e.shared.profilers.LangiumProfiler?.isActive(`parsing`)?new q9e(t,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask(`parsing`,e.LanguageMetaData.languageId)):new zZ(t,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,t){this.wrapper.wrapOr(e,t)}optional(e,t){this.wrapper.wrapOption(e,t)}many(e,t){this.wrapper.wrapMany(e,t)}atLeastOne(e,t){this.wrapper.wrapAtLeastOne(e,t)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},FZ=class extends PZ{static{Q(this,`LangiumParser`)}get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new EZ,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,t){let n=this.computeRuleType(e),r;qR(e)&&(r=e.name,this.registerPrecedenceMap(e));let i=this.wrapper.DEFINE_RULE(NZ(e.name),this.startImplementation(n,r,t).bind(this));return this.allRules.set(e.name,i),$R(e)&&e.entry&&(this.mainRule=i),i}registerPrecedenceMap(e){let t=e.name,n=new Map;for(let t=0;t<e.operators.precedences.length;t++){let r=e.operators.precedences[t];for(let e of r.operators)n.set(e.value,{precedence:t,rightAssoc:r.associativity===`right`})}this.operatorPrecedence.set(t,n)}computeRuleType(e){return qR(e)?aB(e):e.fragment?void 0:tB(e)?jZ:aB(e)}parse(e,t={}){this.nodeBuilder.buildRootNode(e);let n=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=n.tokens;let r=t.rule?this.allRules.get(t.rule):this.mainRule;if(!r)throw Error(t.rule?`No rule found with name '${t.rule}'`:`No main rule available.`);let i=this.doParse(r);return this.nodeBuilder.addHiddenNodes(n.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,bR(i,{deep:!0}),{value:i,lexerErrors:n.errors,lexerReport:n.report,parserErrors:this.wrapper.errors}}doParse(e){let t=this.wrapper.rule(e);if(this.stack.length>0&&(t=this.construct()),t===void 0)throw Error(`No result from parser`);if(this.stack.length>0)throw Error(`Parser stack is not empty after parsing`);return t}startImplementation(e,t,n){return r=>{let i=!this.isRecording()&&e!==void 0;if(i){let n={$type:e};this.stack.push(n),e===jZ?n.value=``:t!==void 0&&(n.$infixName=t)}return n(r),i?this.construct():void 0}}extractHiddenTokens(e){let t=this.lexerResult.hidden;if(!t.length)return[];let n=e.startOffset;for(let e=0;e<t.length;e++)if(t[e].startOffset>n)return t.splice(0,e);return t.splice(0,t.length)}consume(e,t,n){let r=this.wrapper.wrapConsume(e,t);if(!this.isRecording()&&this.isValidToken(r)){let e=this.extractHiddenTokens(r);this.nodeBuilder.addHiddenNodes(e);let t=this.nodeBuilder.buildLeafNode(r,n),{assignment:i,crossRef:a}=this.getAssignment(n),o=this.current;if(i){let e=YR(n)?r.image:this.converter.convert(r.image,t);this.assign(i.operator,i.feature,e,t,a)}else if(ZV(o)){let e=r.image;YR(n)||(e=this.converter.convert(e,t).toString()),o.value+=e}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset==`number`&&!isNaN(e.endOffset)}subrule(e,t,n,r,i){let a;!this.isRecording()&&!n&&(a=this.nodeBuilder.buildCompositeNode(r));let o;try{o=this.wrapper.wrapSubrule(e,t,i)}finally{this.isRecording()||(o===void 0&&!n&&(o=this.construct()),o!==void 0&&a&&a.length>0&&this.performSubruleAssignment(o,r,a))}}performSubruleAssignment(e,t,n){let{assignment:r,crossRef:i}=this.getAssignment(t);if(r)this.assign(r.operator,r.feature,e,n,i);else if(!r){let t=this.current;if(ZV(t))t.value+=e.toString();else if(typeof e==`object`&&e){let n=this.assignWithoutOverride(e,t);this.stack.pop(),this.stack.push(n)}}}action(e,t){if(!this.isRecording()){let n=this.current;if(t.feature&&t.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(t).content.push(n.$cstNode);let r={$type:e};this.stack.push(r),this.assign(t.operator,t.feature,n,n.$cstNode)}else n.$type=e}}construct(){if(this.isRecording())return;let e=this.stack.pop();return this.nodeBuilder.construct(e),`$infixName`in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):ZV(e)?this.converter.convert(e.value,e.$cstNode):(AR(this.astReflection,e),e)}constructInfix(e,t){let n=e.parts;if(!Array.isArray(n)||n.length===0)return;let r=e.operators;if(!Array.isArray(r)||n.length<2)return n[0];let i=0,a=-1;for(let e=0;e<r.length;e++){let n=r[e],o=t.get(n)??{precedence:1/0,rightAssoc:!1};o.precedence>a?(a=o.precedence,i=e):o.precedence===a&&(o.rightAssoc||(i=e))}let o=r.slice(0,i),s=r.slice(i+1),l=n.slice(0,i+1),u=n.slice(i+1),d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:l,operators:o},f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:s},p=this.constructInfix(d,t),m=this.constructInfix(f,t);return{$type:e.$type,$cstNode:e.$cstNode,left:p,operator:r[i],right:m}}getAssignment(e){if(!this.assignmentMap.has(e)){let t=xR(e,RR);this.assignmentMap.set(e,{assignment:t,crossRef:t&&HR(t.terminal)?t.terminal.isMulti?`multi`:`single`:void 0})}return this.assignmentMap.get(e)}assign(e,t,n,r,i){let a=this.current,o;switch(o=i===`single`&&typeof n==`string`?this.linker.buildReference(a,t,r,n):i===`multi`&&typeof n==`string`?this.linker.buildMultiReference(a,t,r,n):n,e){case`=`:a[t]=o;break;case`?=`:a[t]=!0;break;case`+=`:Array.isArray(a[t])||(a[t]=[]),a[t].push(o)}}assignWithoutOverride(e,t){for(let[n,r]of Object.entries(t)){let t=e[n];t===void 0?e[n]=r:Array.isArray(t)&&Array.isArray(r)&&(r.push(...t),e[n]=r)}let n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},IZ=class{static{Q(this,`AbstractParserErrorMessageProvider`)}buildMismatchTokenMessage(e){return XJ.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return XJ.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return XJ.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return XJ.buildEarlyExitMessage(e)}},LZ=class extends IZ{static{Q(this,`LangiumParserErrorMessageProvider`)}buildMismatchTokenMessage({expected:e,actual:t}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(`:KW`)?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${t.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}},RZ=class extends PZ{static{Q(this,`LangiumCompletionParser`)}constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();let t=this.lexer.tokenize(e,{mode:`partial`});return this.tokens=t.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,t){let n=this.wrapper.DEFINE_RULE(NZ(e.name),this.startImplementation(t).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return t=>{let n=this.keepStackSize();try{e(t)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){let e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,t,n){this.wrapper.wrapConsume(e,t),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,t,n,r,i){this.before(r),this.wrapper.wrapSubrule(e,t,i),this.after(r)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){let t=this.elementStack.lastIndexOf(e);t>=0&&this.elementStack.splice(t)}}get currIdx(){return this.wrapper.currIdx}},K9e={recoveryEnabled:!0,nodeLocationTracking:`full`,skipValidations:!0,errorMessageProvider:new LZ},zZ=class extends g8e{static{Q(this,`ChevrotainWrapper`)}constructor(e,t){let n=t&&`maxLookahead`in t;super(e,{...K9e,lookaheadStrategy:n?new bY({maxLookahead:t.maxLookahead}):new W9e({logging:t.skipValidations?()=>{}:void 0}),...t})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,t,n){return this.RULE(e,t,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,t){return this.consume(e,t,void 0)}wrapSubrule(e,t,n){return this.subrule(e,t,{ARGS:[n]})}wrapOr(e,t){this.or(e,t)}wrapOption(e,t){this.option(e,t)}wrapMany(e,t){this.many(e,t)}wrapAtLeastOne(e,t){this.atLeastOne(e,t)}rule(e){return e.call(this,{})}},q9e=class extends zZ{static{Q(this,`ProfilerWrapper`)}constructor(e,t,n){super(e,t),this.task=n}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,t,n){this.task.startSubTask(this.ruleName(t));try{return super.subrule(e,t,n)}finally{this.task.stopSubTask(this.ruleName(t))}}},Q(QV,`createParser`),Q(WZe,`buildRules`),Q(GZe,`buildInfixRule`),Q($V,`buildElement`),Q(KZe,`buildAction`),Q(qZe,`buildRuleCall`),Q(JZe,`buildRuleCallPredicate`),Q(eH,`buildPredicate`),Q(YZe,`buildAlternatives`),Q(XZe,`buildUnorderedGroup`),Q(ZZe,`buildGroup`),Q(tH,`getGuardCondition`),Q(nH,`buildCrossReference`),Q(QZe,`buildKeyword`),Q(rH,`wrap`),Q(iH,`getRule`),Q($Ze,`getRuleName`),Q(aH,`getToken`),Q(oH,`createCompletionParser`),Q(sH,`createLangiumParser`),Q(cH,`prepareLangiumParser`),BZ=class{static{Q(this,`DefaultTokenBuilder`)}constructor(){this.diagnostics=[]}buildTokens(e,t){let n=yR(Hz(e,!1)),r=this.buildTerminalTokens(n),i=this.buildKeywordTokens(n,r,t);return i.push(...r),i}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){let e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(sz).filter(e=>!e.fragment).map(e=>this.buildTerminalToken(e)).toArray()}buildTerminalToken(e){let t=cB(e),n=this.requiresCustomPattern(t)?this.regexPatternFunction(t):t,r={name:e.name,PATTERN:n};return typeof n==`function`&&(r.LINE_BREAKS=!0),e.hidden&&(r.GROUP=Iz(t)?BJ.SKIPPED:`hidden`),r}requiresCustomPattern(e){return!!(e.flags.includes(`u`)||e.flags.includes(`s`))}regexPatternFunction(e){let t=new RegExp(e,e.flags+`y`);return(e,n)=>(t.lastIndex=n,t.exec(e))}buildKeywordTokens(e,t,n){return e.filter(PR).flatMap(e=>ER(e).filter(YR)).distinct(e=>e.value).toArray().sort((e,t)=>t.value.length-e.value.length).map(e=>this.buildKeywordToken(e,t,!!n?.caseInsensitive))}buildKeywordToken(e,t,n){let r=this.buildKeywordPattern(e,n),i={name:e.value,PATTERN:r,LONGER_ALT:this.findLongerAlt(e,t)};return typeof r==`function`&&(i.LINE_BREAKS=!0),i}buildKeywordPattern(e,t){return t?new RegExp(Lz(e.value),`i`):e.value}findLongerAlt(e,t){return t.reduce((t,n)=>{let r=n?.PATTERN;return r?.source&&Rz(`^`+r.source+`$`,e.value)&&t.push(n),t},[])}},VZ=class{static{Q(this,`DefaultValueConverter`)}convert(e,t){let n=t.grammarSource;if(HR(n)&&(n=Wz(n)),rz(n)){let r=n.rule.ref;if(!r)throw Error(`This cst node was not parsed by a rule.`);return this.runConverter(r,e,t)}return e}runConverter(e,t,n){switch(e.name.toUpperCase()){case`INT`:return HZ.convertInt(t);case`STRING`:return HZ.convertString(t);case`ID`:return HZ.convertID(t)}switch(sB(e)?.toLowerCase()){case`number`:return HZ.convertNumber(t);case`boolean`:return HZ.convertBoolean(t);case`bigint`:return HZ.convertBigint(t);case`date`:return HZ.convertDate(t);default:return t}}},(function(e){function t(e){let t=``;for(let r=1;r<e.length-1;r++){let i=e.charAt(r);if(i===`\\`){let i=e.charAt(++r);t+=n(i)}else t+=i}return t}Q(t,`convertString`),e.convertString=t;function n(e){switch(e){case`b`:return`\b`;case`f`:return`\f`;case`n`:return`1358+`;case`r`:return`\r`;case`t`:return` `;case`v`:return`\v`;case`0`:return`\0`;default:return e}}Q(n,`convertEscapeCharacter`);function r(e){return e.charAt(0)===`^`?e.substring(1):e}Q(r,`convertID`),e.convertID=r;function i(e){return parseInt(e)}Q(i,`convertInt`),e.convertInt=i;function a(e){return BigInt(e)}Q(a,`convertBigint`),e.convertBigint=a;function o(e){return new Date(e)}Q(o,`convertDate`),e.convertDate=o;function s(e){return Number(e)}Q(s,`convertNumber`),e.convertNumber=s;function l(e){return e.toLowerCase()===`true`}Q(l,`convertBoolean`),e.convertBoolean=l})(HZ||={}),UZ={},ZH(UZ,QH(NU(),1)),Q(lH,`delayNextTick`),WZ=0,GZ=10,Q(uH,`startCancelableOperation`),Q(dH,`setInterruptionPeriod`),KZ=Symbol(`OperationCancelled`),Q(fH,`isOperationCancelled`),Q(pH,`interruptAndCheck`),qZ=class{static{Q(this,`Deferred`)}constructor(){this.promise=new Promise((e,t)=>{this.resolve=t=>(e(t),this),this.reject=e=>(t(e),this)})}},JZ=class e{static{Q(this,`FullTextDocument`)}constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(t,n){for(let n of t)if(e.isIncremental(n)){let e=_H(n.range),t=this.offsetAt(e.start),r=this.offsetAt(e.end);this._content=this._content.substring(0,t)+n.text+this._content.substring(r,this._content.length);let i=Math.max(e.start.line,0),a=Math.max(e.end.line,0),o=this._lineOffsets,s=hH(n.text,!1,t);if(a-i===s.length)for(let e=0,t=s.length;e<t;e++)o[e+i+1]=s[e];else s.length<1e4?o.splice(i+1,a-i,...s):this._lineOffsets=o=o.slice(0,i+1).concat(s,o.slice(a+1));let l=n.text.length-(r-t);if(l!==0)for(let e=i+1+s.length,t=o.length;e<t;e++)o[e]=o[e]+l}else if(e.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw Error(`Unknown change event received`);this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=hH(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,r=t.length;if(r===0)return{line:0,character:e};for(;n<r;){let i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}let i=n-1;return e=this.ensureBeforeEOL(e,t[i]),{line:i,character:e-t[i]}}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line];if(e.character<=0)return n;let r=e.line+1<t.length?t[e.line+1]:this._content.length,i=Math.min(n+e.character,r);return this.ensureBeforeEOL(i,n)}ensureBeforeEOL(e,t){for(;e>t&&gH(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let t=e;return t!=null&&typeof t.text==`string`&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength==`number`)}static isFull(e){let t=e;return t!=null&&typeof t.text==`string`&&t.range===void 0&&t.rangeLength===void 0}},(function(e){function t(e,t,n,r){return new JZ(e,t,n,r)}Q(t,`create`),e.create=t;function n(e,t,n){if(e instanceof JZ)return e.update(t,n),e;throw Error(`TextDocument.update: document must be created by TextDocument.create`)}Q(n,`update`),e.update=n;function r(e,t){let n=e.getText(),r=mH(t.map(eQe),(e,t)=>{let n=e.range.start.line-t.range.start.line;return n===0?e.range.start.character-t.range.start.character:n}),i=0,a=[];for(let t of r){let r=e.offsetAt(t.range.start);if(r<i)throw Error(`Overlapping edit`);r>i&&a.push(n.substring(i,r)),t.newText.length&&a.push(t.newText),i=e.offsetAt(t.range.end)}return a.push(n.substr(i)),a.join(``)}Q(r,`applyEdits`),e.applyEdits=r})(YZ||={}),Q(mH,`mergeSort`),Q(hH,`computeLineOffsets`),Q(gH,`isEOL`),Q(_H,`getWellformedRange`),Q(eQe,`getWellformedEdit`),(()=>{"use strict";var e={975:e=>{function t(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}Q(t,`e`);function n(e,t){for(var n,r=``,i=0,a=-1,o=0,s=0;s<=e.length;++s){if(s<e.length)n=e.charCodeAt(s);else{if(n===47)break;n=47}if(n===47){if(a!==s-1&&o!==1){if(a!==s-1&&o===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var l=r.lastIndexOf(`/`);if(l!==r.length-1){l===-1?(r=``,i=0):i=(r=r.slice(0,l)).length-1-r.lastIndexOf(`/`),a=s,o=0;continue}}else if(r.length===2||r.length===1){r=``,i=0,a=s,o=0;continue}}t&&(r.length>0?r+=`/..`:r=`..`,i=2)}else r.length>0?r+=`/`+e.slice(a+1,s):r=e.slice(a+1,s),i=s-a-1}a=s,o=0}else n===46&&o!==-1?++o:o=-1}return r}Q(n,`r`);var r={resolve:Q(function(){for(var e,r=``,i=!1,a=arguments.length-1;a>=-1&&!i;a--){var o;a>=0?o=arguments[a]:(e===void 0&&(e=process.cwd()),o=e),t(o),o.length!==0&&(r=o+`/`+r,i=o.charCodeAt(0)===47)}return r=n(r,!i),i?r.length>0?`/`+r:`/`:r.length>0?r:`.`},`resolve`),normalize:Q(function(e){if(t(e),e.length===0)return`.`;var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return(e=n(e,!r)).length!==0||r||(e=`.`),e.length>0&&i&&(e+=`/`),r?`/`+e:e},`normalize`),isAbsolute:Q(function(e){return t(e),e.length>0&&e.charCodeAt(0)===47},`isAbsolute`),join:Q(function(){if(arguments.length===0)return`.`;for(var e,n=0;n<arguments.length;++n){var i=arguments[n];t(i),i.length>0&&(e===void 0?e=i:e+=`/`+i)}return e===void 0?`.`:r.normalize(e)},`join`),relative:Q(function(e,n){if(t(e),t(n),e===n||(e=r.resolve(e))===(n=r.resolve(n)))return``;for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var a=e.length,o=a-i,s=1;s<n.length&&n.charCodeAt(s)===47;++s);for(var l=n.length-s,u=o<l?o:l,d=-1,f=0;f<=u;++f){if(f===u){if(l>u){if(n.charCodeAt(s+f)===47)return n.slice(s+f+1);if(f===0)return n.slice(s+f)}else o>u&&(e.charCodeAt(i+f)===47?d=f:f===0&&(d=0));break}var p=e.charCodeAt(i+f);if(p!==n.charCodeAt(s+f))break;p===47&&(d=f)}var m=``;for(f=i+d+1;f<=a;++f)f!==a&&e.charCodeAt(f)!==47||(m.length===0?m+=`..`:m+=`/..`);return m.length>0?m+n.slice(s+d):(s+=d,n.charCodeAt(s)===47&&++s,n.slice(s))},`relative`),_makeLong:Q(function(e){return e},`_makeLong`),dirname:Q(function(e){if(t(e),e.length===0)return`.`;for(var n=e.charCodeAt(0),r=n===47,i=-1,a=!0,o=e.length-1;o>=1;--o)if((n=e.charCodeAt(o))===47){if(!a){i=o;break}}else a=!1;return i===-1?r?`/`:`.`:r&&i===1?`//`:e.slice(0,i)},`dirname`),basename:Q(function(e,n){if(n!==void 0&&typeof n!=`string`)throw TypeError(`"ext" argument must be a string`);t(e);var r,i=0,a=-1,o=!0;if(n!==void 0&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return``;var s=n.length-1,l=-1;for(r=e.length-1;r>=0;--r){var u=e.charCodeAt(r);if(u===47){if(!o){i=r+1;break}}else l===-1&&(o=!1,l=r+1),s>=0&&(u===n.charCodeAt(s)?--s==-1&&(a=r):(s=-1,a=l))}return i===a?a=l:a===-1&&(a=e.length),e.slice(i,a)}for(r=e.length-1;r>=0;--r)if(e.charCodeAt(r)===47){if(!o){i=r+1;break}}else a===-1&&(o=!1,a=r+1);return a===-1?``:e.slice(i,a)},`basename`),extname:Q(function(e){t(e);for(var n=-1,r=0,i=-1,a=!0,o=0,s=e.length-1;s>=0;--s){var l=e.charCodeAt(s);if(l!==47)i===-1&&(a=!1,i=s+1),l===46?n===-1?n=s:o!==1&&(o=1):n!==-1&&(o=-1);else if(!a){r=s+1;break}}return n===-1||i===-1||o===0||o===1&&n===i-1&&n===r+1?``:e.slice(n,i)},`extname`),format:Q(function(e){if(typeof e!=`object`||!e)throw TypeError(`The "pathObject" argument must be of type Object. Received type `+typeof e);return(function(e,t){var n=t.dir||t.root,r=t.base||(t.name||``)+(t.ext||``);return n?n===t.root?n+r:n+`/`+r:r})(0,e)},`format`),parse:Q(function(e){t(e);var n={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return n;var r,i=e.charCodeAt(0),a=i===47;a?(n.root=`/`,r=1):r=0;for(var o=-1,s=0,l=-1,u=!0,d=e.length-1,f=0;d>=r;--d)if((i=e.charCodeAt(d))!==47)l===-1&&(u=!1,l=d+1),i===46?o===-1?o=d:f!==1&&(f=1):o!==-1&&(f=-1);else if(!u){s=d+1;break}return o===-1||l===-1||f===0||f===1&&o===l-1&&o===s+1?l!==-1&&(n.base=n.name=s===0&&a?e.slice(1,l):e.slice(s,l)):(s===0&&a?(n.name=e.slice(1,o),n.base=e.slice(1,l)):(n.name=e.slice(s,o),n.base=e.slice(s,l)),n.ext=e.slice(o,l)),s>0?n.dir=e.slice(0,s-1):a&&(n.dir=`/`),n},`parse`),sep:`/`,delimiter:`:`,win32:null,posix:null};r.posix=r,e.exports=r}},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}Q(n,`r`),n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};let i;n.r(r),n.d(r,{URI:Q(()=>d,`URI`),Utils:Q(()=>w,`Utils`)}),typeof process==`object`?i=process.platform===`win32`:typeof navigator==`object`&&(i=navigator.userAgent.indexOf(`Windows`)>=0);let a=/^\w[\w\d+.-]*$/,o=/^\//,s=/^\/\//;function l(e,t){if(!e.scheme&&t)throw Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!a.test(e.scheme))throw Error(`[UriError]: Scheme contains illegal characters.`);if(e.path){if(e.authority){if(!o.test(e.path))throw Error(`[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character`)}else if(s.test(e.path))throw Error(`[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")`)}}Q(l,`a`);let u=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class d{static{Q(this,`l`)}static isUri(e){return e instanceof d||!!e&&typeof e.authority==`string`&&typeof e.fragment==`string`&&typeof e.path==`string`&&typeof e.query==`string`&&typeof e.scheme==`string`&&typeof e.fsPath==`string`&&typeof e.with==`function`&&typeof e.toString==`function`}scheme;authority;path;query;fragment;constructor(e,t,n,r,i,a=!1){typeof e==`object`?(this.scheme=e.scheme||``,this.authority=e.authority||``,this.path=e.path||``,this.query=e.query||``,this.fragment=e.fragment||``):(this.scheme=(function(e,t){return e||t?e:`file`})(e,a),this.authority=t||``,this.path=(function(e,t){switch(e){case`https`:case`http`:case`file`:t?t[0]!==`/`&&(t=`/`+t):t=`/`}return t})(this.scheme,n||``),this.query=r||``,this.fragment=i||``,l(this,a))}get fsPath(){return _(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:r,query:i,fragment:a}=e;return t===void 0?t=this.scheme:t===null&&(t=``),n===void 0?n=this.authority:n===null&&(n=``),r===void 0?r=this.path:r===null&&(r=``),i===void 0?i=this.query:i===null&&(i=``),a===void 0?a=this.fragment:a===null&&(a=``),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&a===this.fragment?this:new p(t,n,r,i,a)}static parse(e,t=!1){let n=u.exec(e);return n?new p(n[2]||``,x(n[4]||``),x(n[5]||``),x(n[7]||``),x(n[9]||``),t):new p(``,``,``,``,``)}static file(e){let t=``;if(i&&(e=e.replace(/\\/g,`/`)),e[0]===`/`&&e[1]===`/`){let n=e.indexOf(`/`,2);n===-1?(t=e.substring(2),e=`/`):(t=e.substring(2,n),e=e.substring(n)||`/`)}return new p(`file`,t,e,``,``)}static from(e){let t=new p(e.scheme,e.authority,e.path,e.query,e.fragment);return l(t,!0),t}toString(e=!1){return v(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof d)return e;{let t=new p(e);return t._formatted=e.external,t._fsPath=e._sep===f?e.fsPath:null,t}}return e}}let f=i?1:void 0;class p extends d{static{Q(this,`d`)}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||=_(this,!1),this._fsPath}toString(e=!1){return e?v(this,!0):(this._formatted||=v(this,!1),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=f),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}let m={58:`%3A`,47:`%2F`,63:`%3F`,35:`%23`,91:`%5B`,93:`%5D`,64:`%40`,33:`%21`,36:`%24`,38:`%26`,39:`%27`,40:`%28`,41:`%29`,42:`%2A`,43:`%2B`,44:`%2C`,59:`%3B`,61:`%3D`,32:`%20`};function h(e,t,n){let r,i=-1;for(let a=0;a<e.length;a++){let o=e.charCodeAt(a);if(o>=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||o===45||o===46||o===95||o===126||t&&o===47||n&&o===91||n&&o===93||n&&o===58)i!==-1&&(r+=encodeURIComponent(e.substring(i,a)),i=-1),r!==void 0&&(r+=e.charAt(a));else{r===void 0&&(r=e.substr(0,a));let t=m[o];t===void 0?i===-1&&(i=a):(i!==-1&&(r+=encodeURIComponent(e.substring(i,a)),i=-1),r+=t)}}return i!==-1&&(r+=encodeURIComponent(e.substring(i))),r===void 0?e:r}Q(h,`m`);function g(e){let t;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r===35||r===63?(t===void 0&&(t=e.substr(0,n)),t+=m[r]):t!==void 0&&(t+=e[n])}return t===void 0?e:t}Q(g,`y`);function _(e,t){let n;return n=e.authority&&e.path.length>1&&e.scheme===`file`?`//${e.authority}${e.path}`:e.path.charCodeAt(0)===47&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&e.path.charCodeAt(2)===58?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,i&&(n=n.replace(/\//g,`\\`)),n}Q(_,`v`);function v(e,t){let n=t?g:h,r=``,{scheme:i,authority:a,path:o,query:s,fragment:l}=e;if(i&&(r+=i,r+=`:`),(a||i===`file`)&&(r+=`/`,r+=`/`),a){let e=a.indexOf(`@`);if(e!==-1){let t=a.substr(0,e);a=a.substr(e+1),e=t.lastIndexOf(`:`),e===-1?r+=n(t,!1,!1):(r+=n(t.substr(0,e),!1,!1),r+=`:`,r+=n(t.substr(e+1),!1,!0)),r+=`@`}a=a.toLowerCase(),e=a.lastIndexOf(`:`),e===-1?r+=n(a,!1,!0):(r+=n(a.substr(0,e),!1,!0),r+=a.substr(e))}if(o){if(o.length>=3&&o.charCodeAt(0)===47&&o.charCodeAt(2)===58){let e=o.charCodeAt(1);e>=65&&e<=90&&(o=`/${String.fromCharCode(e+32)}:${o.substr(3)}`)}else if(o.length>=2&&o.charCodeAt(1)===58){let e=o.charCodeAt(0);e>=65&&e<=90&&(o=`${String.fromCharCode(e+32)}:${o.substr(2)}`)}r+=n(o,!0,!1)}return s&&(r+=`?`,r+=n(s,!1,!1)),l&&(r+=`#`,r+=t?l:h(l,!1,!1)),r}Q(v,`b`);function y(e){try{return decodeURIComponent(e)}catch{return e.length>3?e.substr(0,3)+y(e.substr(3)):e}}Q(y,`C`);let b=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function x(e){return e.match(b)?e.replace(b,(e=>y(e))):e}Q(x,`w`);var S=n(975);let C=S.posix||S;var w;(function(e){e.joinPath=function(e,...t){return e.with({path:C.join(e.path,...t)})},e.resolvePath=function(e,...t){let n=e.path,r=!1;n[0]!==`/`&&(n=`/`+n,r=!0);let i=C.resolve(n,...t);return r&&i[0]===`/`&&!e.authority&&(i=i.substring(1)),e.with({path:i})},e.dirname=function(e){if(e.path.length===0||e.path===`/`)return e;let t=C.dirname(e.path);return t.length===1&&t.charCodeAt(0)===46&&(t=``),e.with({path:t})},e.basename=function(e){return C.basename(e.path)},e.extname=function(e){return C.extname(e.path)}})(w||={}),J9e=r})(),{URI:XZ,Utils:ZZ}=J9e,(function(e){e.basename=ZZ.basename,e.dirname=ZZ.dirname,e.extname=ZZ.extname,e.joinPath=ZZ.joinPath,e.resolvePath=ZZ.resolvePath;let t=typeof process==`object`&&process?.platform===`win32`;function n(e,t){return e?.toString()===t?.toString()}Q(n,`equals`),e.equals=n;function r(e,n){let r=typeof e==`string`?XZ.parse(e).path:e.path,i=typeof n==`string`?XZ.parse(n).path:n.path,a=r.split(`/`).filter(e=>e.length>0),o=i.split(`/`).filter(e=>e.length>0);if(t){let e=/^[A-Z]:$/;if(a[0]&&e.test(a[0])&&(a[0]=a[0].toLowerCase()),o[0]&&e.test(o[0])&&(o[0]=o[0].toLowerCase()),a[0]!==o[0])return i.substring(1)}let s=0;for(;s<a.length&&a[s]===o[s];s++);return`../`.repeat(a.length-s)+o.slice(s).join(`/`)}Q(r,`relative`),e.relative=r;function i(e){return XZ.parse(e.toString()).toString()}Q(i,`normalize`),e.normalize=i;function a(e,t){let n=typeof e==`string`?e:e.path,r=typeof t==`string`?t:t.path;return r.charAt(r.length-1)===`/`&&(r=r.slice(0,-1)),n.charAt(n.length-1)===`/`&&(n=n.slice(0,-1)),r===n?!0:r.length<n.length||r.charAt(n.length)!==`/`?!1:r.startsWith(n)}Q(a,`contains`),e.contains=a})(QZ||={}),$Z=class{static{Q(this,`UriTrie`)}constructor(){this.root={name:``,children:new Map}}normalizeUri(e){return QZ.normalize(e)}clear(){this.root.children.clear()}insert(e,t){let n=this.getNode(this.normalizeUri(e),!0);n.element=t}delete(e){let t=this.getNode(this.normalizeUri(e),!1);t?.parent&&t.parent.children.delete(t.name)}has(e){return this.getNode(this.normalizeUri(e),!1)?.element!==void 0}hasNode(e){return this.getNode(this.normalizeUri(e),!1)!==void 0}find(e){return this.getNode(this.normalizeUri(e),!1)?.element}findNode(e){let t=this.normalizeUri(e),n=this.getNode(t,!1);if(n)return{name:n.name,uri:QZ.joinPath(XZ.parse(t),n.name).toString(),element:n.element}}findChildren(e){let t=this.normalizeUri(e),n=this.getNode(t,!1);return n?Array.from(n.children.values()).map(e=>({name:e.name,uri:QZ.joinPath(XZ.parse(t),e.name).toString(),element:e.element})):[]}all(){return this.collectValues(this.root)}findAll(e){let t=this.getNode(QZ.normalize(e),!1);return t?this.collectValues(t):[]}getNode(e,t){let n=e.split(`/`);e.charAt(e.length-1)===`/`&&n.pop();let r=this.root;for(let e of n){let n=r.children.get(e);if(!n){if(t)n={name:e,children:new Map,parent:r},r.children.set(e,n);else return}r=n}return r}collectValues(e){let t=[];e.element&&t.push(e.element);for(let n of e.children.values())t.push(...this.collectValues(n));return t}},(function(e){e[e.Changed=0]=`Changed`,e[e.Parsed=1]=`Parsed`,e[e.IndexedContent=2]=`IndexedContent`,e[e.ComputedScopes=3]=`ComputedScopes`,e[e.Linked=4]=`Linked`,e[e.IndexedReferences=5]=`IndexedReferences`,e[e.Validated=6]=`Validated`})(eQ||={}),tQ=class{static{Q(this,`DefaultLangiumDocumentFactory`)}constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,t=UZ.CancellationToken.None){let n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,t)}fromTextDocument(e,t,n){return t??=XZ.parse(e.uri),UZ.CancellationToken.is(n)?this.createAsync(t,e,n):this.create(t,e,n)}fromString(e,t,n){return UZ.CancellationToken.is(n)?this.createAsync(t,e,n):this.create(t,e,n)}fromModel(e,t){return this.create(t,{$model:e})}create(e,t,n){if(typeof t==`string`){let r=this.parse(e,t,n);return this.createLangiumDocument(r,e,void 0,t)}if(`$model`in t){let n={value:t.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(n,e)}{let r=this.parse(e,t.getText(),n);return this.createLangiumDocument(r,e,t)}}async createAsync(e,t,n){if(typeof t==`string`){let r=await this.parseAsync(e,t,n);return this.createLangiumDocument(r,e,void 0,t)}{let r=await this.parseAsync(e,t.getText(),n);return this.createLangiumDocument(r,e,t)}}createLangiumDocument(e,t,n,r){let i;if(n)i={parseResult:e,uri:t,state:eQ.Parsed,references:[],textDocument:n};else{let n=this.createTextDocumentGetter(t,r);i={parseResult:e,uri:t,state:eQ.Parsed,references:[],get textDocument(){return n()}}}return e.value.$document=i,i}async update(e,t){let n=e.parseResult.value.$cstNode?.root.fullText,r=this.textDocuments?.get(e.uri.toString()),i=r?r.getText():await this.fileSystemProvider.readFile(e.uri);if(r)Object.defineProperty(e,"textDocument",{value:r});else{let t=this.createTextDocumentGetter(e.uri,i);Object.defineProperty(e,"textDocument",{get:t})}return n!==i&&(e.parseResult=await this.parseAsync(e.uri,i,t),e.parseResult.value.$document=e),e.state=eQ.Parsed,e}parse(e,t,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(t,n)}parseAsync(e,t,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(t,n)}createTextDocumentGetter(e,t){let n=this.serviceRegistry,r;return()=>r??=YZ.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,t??``)}},nQ=class{static{Q(this,`DefaultLangiumDocuments`)}constructor(e){this.documentTrie=new $Z,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return yR(this.documentTrie.all())}addDocument(e){let t=e.uri.toString();if(this.documentTrie.has(t))throw Error(`A document with the URI '${t}' is already present.`);this.documentTrie.insert(t,e)}getDocument(e){let t=e.toString();return this.documentTrie.find(t)}getDocuments(e){let t=e.toString();return this.documentTrie.findAll(t)}async getOrCreateDocument(e,t){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,t),this.addDocument(n),n)}createDocument(e,t,n){if(n)return this.langiumDocumentFactory.fromString(t,e,n).then(e=>(this.addDocument(e),e));{let n=this.langiumDocumentFactory.fromString(t,e);return this.addDocument(n),n}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){let t=e.toString(),n=this.documentTrie.find(t);return n&&this.documentBuilder().resetToState(n,eQ.Changed),n}deleteDocument(e){let t=e.toString(),n=this.documentTrie.find(t);return n&&(n.state=eQ.Changed,this.documentTrie.delete(t)),n}deleteDocuments(e){let t=e.toString(),n=this.documentTrie.findAll(t);for(let e of n)e.state=eQ.Changed;return this.documentTrie.delete(t),n}},rQ=Symbol(`RefResolving`),iQ=class{static{Q(this,`DefaultLinker`)}constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,t=UZ.CancellationToken.None){if(this.profiler?.isActive(`linking`)){let n=this.profiler.createTask(`linking`,this.languageId);n.start();try{for(let r of DR(e.parseResult.value))await pH(t),kR(r).forEach(t=>{let i=`${r.$type}:${t.property}`;n.startSubTask(i);try{this.doLink(t,e)}finally{n.stopSubTask(i)}})}finally{n.stop()}}else for(let n of DR(e.parseResult.value))await pH(t),kR(n).forEach(t=>this.doLink(t,e))}doLink(e,t){let n=e.reference;if(`_ref`in n&&n._ref===void 0){n._ref=rQ;try{let t=this.getCandidate(e);mR(t)?n._ref=t:(n._nodeDescription=t,n._ref=this.loadAstNode(t)??this.createLinkingError(e,t))}catch(t){console.error(`An error occurred while resolving reference to '${n.$refText}':`,t);let r=t.message??String(t);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${r}`}}t.references.push(n)}else if(`_items`in n&&n._items===void 0){n._items=rQ;try{let t=this.getCandidates(e),r=[];if(mR(t))n._linkingError=t;else for(let e of t){let t=this.loadAstNode(e);t&&r.push({ref:t,$nodeDescription:e})}n._items=r}catch(t){n._linkingError={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${t}`},n._items=[]}t.references.push(n)}}unlink(e){for(let t of e.references)`_ref`in t?(t._ref=void 0,delete t._nodeDescription):`_items`in t&&(t._items=void 0,delete t._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){let t=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(e=>`${e.documentUri}#${e.path}`).toArray();return t.length>0?t:this.createLinkingError(e)}buildReference(e,t,n,r){let i=this,a={$refNode:n,$refText:r,_ref:void 0,get ref(){if(uR(this._ref))return this._ref;if(pR(this._nodeDescription)){let n=i.loadAstNode(this._nodeDescription);this._ref=n??i.createLinkingError({reference:a,container:e,property:t},this._nodeDescription)}else if(this._ref===void 0){this._ref=rQ;let n=CR(e).$document,r=i.getLinkedNode({reference:a,container:e,property:t});if(r.error&&n&&n.state<eQ.ComputedScopes){this._ref=void 0;return}this._ref=r.node??r.error,this._nodeDescription=r.descr,n?.references.push(this)}else this._ref===rQ&&i.throwCyclicReferenceError(e,t,r);return uR(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return mR(this._ref)?this._ref:void 0}};return a}buildMultiReference(e,t,n,r){let i=this,a={$refNode:n,$refText:r,_items:void 0,get items(){if(Array.isArray(this._items))return this._items;if(this._items===void 0){this._items=rQ;let n=CR(e).$document,r=i.getCandidates({reference:a,container:e,property:t}),o=[];if(mR(r))this._linkingError=r;else for(let e of r){let t=i.loadAstNode(e);t&&o.push({ref:t,$nodeDescription:e})}this._items=o,n?.references.push(this)}else this._items===rQ&&i.throwCyclicReferenceError(e,t,r);return Array.isArray(this._items)?this._items:[]},get error(){if(this._linkingError)return this._linkingError;if(!(this.items.length>0))return this._linkingError=i.createLinkingError({reference:a,container:e,property:t})}};return a}throwCyclicReferenceError(e,t,n){throw Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${t} (symbol '${n}')`)}getLinkedNode(e){try{let t=this.getCandidate(e);if(mR(t))return{error:t};let n=this.loadAstNode(t);return n?{node:n,descr:t}:{descr:t,error:this.createLinkingError(e,t)}}catch(t){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,t);let n=t.message??String(t);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${n}`}}}}loadAstNode(e){if(e.node)return e.node;let t=this.langiumDocuments().getDocument(e.documentUri);if(t)return this.astNodeLocator.getAstNode(t.parseResult.value,e.path)}createLinkingError(e,t){let n=CR(e.container).$document;return n&&n.state<eQ.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${n.uri}).`),{info:e,message:`Could not resolve reference to ${this.reflection.getReferenceType(e)} named '${e.reference.$refText}'.`,targetDescription:t}}},Q(vH,`isNamed`),aQ=class{static{Q(this,`DefaultNameProvider`)}getName(e){if(vH(e))return e.name}getNameNode(e){return qz(e.$cstNode,`name`)}},oQ=class{static{Q(this,`DefaultReferences`)}constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator,this.documents=e.shared.workspace.LangiumDocuments,this.hasMultiReference=DR(e.Grammar).some(e=>HR(e)&&e.isMulti)}findDeclarations(e){if(e){let t=Zz(e),n=e.astNode;if(t&&n){let r=n[t.feature];if(dR(r)||fR(r))return wR(r);if(Array.isArray(r)){for(let t of r)if((dR(t)||fR(t))&&t.$refNode&&t.$refNode.offset<=e.offset&&t.$refNode.end>=e.end)return wR(t)}}if(n){let t=this.nameProvider.getNameNode(n);if(t&&(t===e||hz(e,t)))return this.getSelfNodes(n)}}return[]}getSelfNodes(e){if(this.hasMultiReference){let t=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),n=this.getNodeFromReferenceDescription(t.head());if(n){for(let t of kR(n))if(fR(t.reference)&&t.reference.items.some(t=>t.ref===e))return t.reference.items.map(e=>e.ref)}return[e]}return[e]}getNodeFromReferenceDescription(e){if(!e)return;let t=this.documents.getDocument(e.sourceUri);if(t)return this.nodeLocator.getAstNode(t.parseResult.value,e.sourcePath)}findDeclarationNodes(e){let t=this.findDeclarations(e),n=[];for(let e of t){let t=this.nameProvider.getNameNode(e)??e.$cstNode;t&&n.push(t)}return n}findReferences(e,t){let n=[];t.includeDeclaration&&n.push(...this.getSelfReferences(e));let r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return t.documentUri&&(r=r.filter(e=>QZ.equals(e.sourceUri,t.documentUri))),n.push(...r),yR(n)}getSelfReferences(e){let t=this.getSelfNodes(e),n=[];for(let e of t){let t=this.nameProvider.getNameNode(e);if(t){let r=SR(e),i=this.nodeLocator.getAstNodePath(e);n.push({sourceUri:r.uri,sourcePath:i,targetUri:r.uri,targetPath:i,segment:_z(t),local:!0})}}return n}},sQ=class{static{Q(this,`MultiMap`)}constructor(e){if(this.map=new Map,e)for(let[t,n]of e)this.add(t,n)}get size(){return YU.sum(yR(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,t){if(t===void 0)return this.map.delete(e);{let n=this.map.get(e);if(n){let r=n.indexOf(t);if(r>=0)return n.length===1?this.map.delete(e):n.splice(r,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){let t=this.map.get(e);return t?yR(t):KU}has(e,t){if(t===void 0)return this.map.has(e);{let n=this.map.get(e);return n?n.indexOf(t)>=0:!1}}add(e,t){return this.map.has(e)?this.map.get(e).push(t):this.map.set(e,[t]),this}addAll(e,t){return this.map.has(e)?this.map.get(e).push(...t):this.map.set(e,Array.from(t)),this}forEach(e){this.map.forEach((t,n)=>t.forEach(t=>e(t,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return yR(this.map.entries()).flatMap(([e,t])=>t.map(t=>[e,t]))}keys(){return yR(this.map.keys())}values(){return yR(this.map.values()).flat()}entriesGroupedByKey(){return yR(this.map.entries())}},cQ=class{static{Q(this,`BiMap`)}get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(let[t,n]of e)this.set(t,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,t){return this.map.set(e,t),this.inverse.set(t,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){let t=this.map.get(e);return t!==void 0&&(this.map.delete(e),this.inverse.delete(t),!0)}},lQ=class{static{Q(this,`DefaultScopeComputation`)}constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,t=UZ.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,t)}async collectExportedSymbolsForNode(e,t,n=TR,r=UZ.CancellationToken.None){let i=[];this.addExportedSymbol(e,i,t);for(let a of n(e))await pH(r),this.addExportedSymbol(a,i,t);return i}addExportedSymbol(e,t,n){let r=this.nameProvider.getName(e);r&&t.push(this.descriptions.createDescription(e,r,n))}async collectLocalSymbols(e,t=UZ.CancellationToken.None){let n=e.parseResult.value,r=new sQ;for(let i of ER(n))await pH(t),this.addLocalSymbol(i,e,r);return r}addLocalSymbol(e,t,n){let r=e.$container;if(r){let i=this.nameProvider.getName(e);i&&n.add(r,this.descriptions.createDescription(e,i,t))}}},uQ=class{static{Q(this,`StreamScope`)}constructor(e,t,n){this.elements=e,this.outerScope=t,this.caseInsensitive=n?.caseInsensitive??!1,this.concatOuterScope=n?.concatOuterScope??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){let t=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.find(e=>e.name.toLowerCase()===t):this.elements.find(t=>t.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){let t=this.caseInsensitive?e.toLowerCase():e,n=this.caseInsensitive?this.elements.filter(e=>e.name.toLowerCase()===t):this.elements.filter(t=>t.name===e);return(this.concatOuterScope||n.isEmpty())&&this.outerScope?n.concat(this.outerScope.getElements(e)):n}},Y9e=class{static{Q(this,`MapScope`)}constructor(e,t,n){this.elements=new Map,this.caseInsensitive=n?.caseInsensitive??!1,this.concatOuterScope=n?.concatOuterScope??!0;for(let t of e){let e=this.caseInsensitive?t.name.toLowerCase():t.name;this.elements.set(e,t)}this.outerScope=t}getElement(e){let t=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(t);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){let t=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(t),r=n?[n]:[];return(this.concatOuterScope||r.length>0)&&this.outerScope?yR(r).concat(this.outerScope.getElements(e)):yR(r)}getAllElements(){let e=yR(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},dQ=class{static{Q(this,`MultiMapScope`)}constructor(e,t,n){this.elements=new sQ,this.caseInsensitive=n?.caseInsensitive??!1,this.concatOuterScope=n?.concatOuterScope??!0;for(let t of e){let e=this.caseInsensitive?t.name.toLowerCase():t.name;this.elements.add(e,t)}this.outerScope=t}getElement(e){let t=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(t)[0];if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){let t=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(t);return(this.concatOuterScope||n.length===0)&&this.outerScope?yR(n).concat(this.outerScope.getElements(e)):yR(n)}getAllElements(){let e=yR(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},X9e={getElement(){},getElements(){return KU},getAllElements(){return KU}},fQ=class{static{Q(this,`DisposableCache`)}constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw Error(`This cache has already been disposed`)}},pQ=class extends fQ{static{Q(this,`SimpleCache`)}constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,t){this.throwIfDisposed(),this.cache.set(e,t)}get(e,t){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(t){let n=t();return this.cache.set(e,n),n}}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}},mQ=class extends fQ{static{Q(this,`ContextCache`)}constructor(e){super(),this.cache=new Map,this.converter=e??(e=>e)}has(e,t){return this.throwIfDisposed(),this.cacheForContext(e).has(t)}set(e,t,n){this.throwIfDisposed(),this.cacheForContext(e).set(t,n)}get(e,t,n){this.throwIfDisposed();let r=this.cacheForContext(e);if(r.has(t))return r.get(t);if(n){let e=n();return r.set(t,e),e}}delete(e,t){return this.throwIfDisposed(),this.cacheForContext(e).delete(t)}clear(e){if(this.throwIfDisposed(),e){let t=this.converter(e);this.cache.delete(t)}else this.cache.clear()}cacheForContext(e){let t=this.converter(e),n=this.cache.get(t);return n||(n=new Map,this.cache.set(t,n)),n}},hQ=class extends mQ{static{Q(this,`DocumentCache`)}constructor(e,t){super(e=>e.toString()),t?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(t,e=>{this.clear(e.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((e,t)=>{for(let e of t)this.clear(e)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((e,t)=>{let n=e.concat(t);for(let e of n)this.clear(e)}))}},gQ=class extends pQ{static{Q(this,`WorkspaceCache`)}constructor(e,t){super(),t?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(t,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((e,t)=>{t.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}},_Q=class{static{Q(this,`DefaultScopeProvider`)}constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new gQ(e.shared)}getScope(e){let t=[],n=this.reflection.getReferenceType(e),r=SR(e.container).localSymbols;if(r){let i=e.container;do r.has(i)&&t.push(r.getStream(i).filter(e=>this.reflection.isSubtype(e.type,n))),i=i.$container;while(i)}let i=this.getGlobalScope(n,e);for(let e=t.length-1;e>=0;e--)i=this.createScope(t[e],i);return i}createScope(e,t,n){return new uQ(yR(e),t,n)}createScopeForNodes(e,t,n){return new uQ(yR(e).map(e=>{let t=this.nameProvider.getName(e);if(t)return this.descriptions.createDescription(e,t)}).nonNullable(),t,n)}getGlobalScope(e,t){return this.globalScopeCache.get(e,()=>new dQ(this.indexManager.allElements(e)))}},Q(yH,`isAstNodeWithComment`),Q(bH,`isIntermediateReference`),vQ=class{static{Q(this,`DefaultJsonSerializer`)}constructor(e){this.ignoreProperties=new Set([`$container`,`$containerProperty`,`$containerIndex`,`$document`,`$cstNode`]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,t){let n=t??{},r=t?.replacer,i=Q((e,t)=>this.replacer(e,t,n),`defaultReplacer`),a=r?(e,t)=>r(e,t,i):i;try{return this.currentDocument=SR(e),JSON.stringify(e,a,t?.space)}finally{this.currentDocument=void 0}}deserialize(e,t){let n=t??{},r=JSON.parse(e);return this.linkNode(r,r,n),r}replacer(e,t,{refText:n,sourceText:r,textRegions:i,comments:a,uriConverter:o}){if(!this.ignoreProperties.has(e)){if(dR(t)){let e=t.ref,r=n?t.$refText:void 0;if(e){let t=SR(e),n=``;this.currentDocument&&this.currentDocument!==t&&(n=o?o(t.uri,e):t.uri.toString());let i=this.astNodeLocator.getAstNodePath(e);return{$ref:`${n}#${i}`,$refText:r}}return{$error:t.error?.message??`Could not resolve reference`,$refText:r}}if(fR(t)){let e=n?t.$refText:void 0,r=[];for(let e of t.items){let t=e.ref,n=SR(e.ref),i=``;this.currentDocument&&this.currentDocument!==n&&(i=o?o(n.uri,t):n.uri.toString());let a=this.astNodeLocator.getAstNodePath(t);r.push(`${i}#${a}`)}return{$refs:r,$refText:e}}if(uR(t)){let n;if(i&&(n=this.addAstNodeRegionWithAssignmentsTo({...t}),(!e||t.$document)&&n?.$textRegion&&(n.$textRegion.documentURI=this.currentDocument?.uri.toString())),r&&!e&&(n??={...t},n.$sourceText=t.$cstNode?.text),a){n??={...t};let e=this.commentProvider.getComment(t);e&&(n.$comment=e.replace(/\r/g,``))}return n??t}return t}}addAstNodeRegionWithAssignmentsTo(e){let t=Q(e=>({offset:e.offset,end:e.end,length:e.length,range:e.range}),`createDocumentSegment`);if(e.$cstNode){let n=e.$textRegion=t(e.$cstNode),r=n.assignments={};return Object.keys(e).filter(e=>!e.startsWith(`$`)).forEach(n=>{let i=Kz(e.$cstNode,n).map(t);i.length!==0&&(r[n]=i)}),e}}linkNode(e,t,n,r,i,a){for(let[r,i]of Object.entries(e))if(Array.isArray(i))for(let a=0;a<i.length;a++){let o=i[a];bH(o)?i[a]=this.reviveReference(e,r,t,o,n):uR(o)&&this.linkNode(o,t,n,e,r,a)}else bH(i)?e[r]=this.reviveReference(e,r,t,i,n):uR(i)&&this.linkNode(i,t,n,e,r);let o=e;o.$container=r,o.$containerProperty=i,o.$containerIndex=a}reviveReference(e,t,n,r,i){let a=r.$refText,o=r.$error,s;if(r.$ref){let e=this.getRefNode(n,r.$ref,i.uriConverter);if(uR(e))return a||=this.nameProvider.getName(e),{$refText:a??``,ref:e};o=e}else if(r.$refs){let e=[];for(let t of r.$refs){let r=this.getRefNode(n,t,i.uriConverter);uR(r)&&e.push({ref:r})}if(e.length===0)s={$refText:a??``,items:e},o??=`Could not resolve multi-reference`;else return{$refText:a??``,items:e}}if(o)return s??={$refText:a??``,ref:void 0},s.error={info:{container:e,property:t,reference:s},message:o},s}getRefNode(e,t,n){try{let r=t.indexOf(`#`);if(r===0)return this.astNodeLocator.getAstNode(e,t.substring(1))||`Could not resolve path: `+t;if(r<0){let e=n?n(t):XZ.parse(t),r=this.langiumDocuments.getDocument(e);return r?r.parseResult.value:`Could not find document for URI: `+t}let i=n?n(t.substring(0,r)):XZ.parse(t.substring(0,r)),a=this.langiumDocuments.getDocument(i);return a?r===t.length-1?a.parseResult.value:this.astNodeLocator.getAstNode(a.parseResult.value,t.substring(r+1))||`Could not resolve URI: `+t:`Could not find document for URI: `+t}catch(e){return String(e)}}},yQ=class{static{Q(this,`DefaultServiceRegistry`)}get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.fileNameMap=new Map,this.textDocuments=e?.workspace.TextDocuments}register(e){let t=e.LanguageMetaData;for(let n of t.fileExtensions)this.fileExtensionMap.has(n)&&console.warn(`The file extension ${n} is used by multiple languages. It is now assigned to '${t.languageId}'.`),this.fileExtensionMap.set(n,e);if(t.fileNames)for(let n of t.fileNames)this.fileNameMap.has(n)&&console.warn(`The file name ${n} is used by multiple languages. It is now assigned to '${t.languageId}'.`),this.fileNameMap.set(n,e);this.languageIdMap.set(t.languageId,e)}getServices(e){if(this.languageIdMap.size===0)throw Error("The service registry is empty. Use `register` to register the services of a language.");let t=this.textDocuments?.get(e)?.languageId;if(t!==void 0){let e=this.languageIdMap.get(t);if(e)return e}let n=QZ.extname(e),r=QZ.basename(e),i=this.fileNameMap.get(r)??this.fileExtensionMap.get(n);if(!i)throw Error(t?`The service registry contains no services for the extension '${n}' for language '${t}'.`:`The service registry contains no services for the extension '${n}'.`);return i}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}},Q(xH,`diagnosticData`),(function(e){e.defaults=[`fast`,`slow`,`built-in`],e.all=e.defaults})(bQ||={}),xQ=class{static{Q(this,`ValidationRegistry`)}constructor(e){this.entries=new sQ,this.knownCategories=new Set(bQ.defaults),this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,t=this,n=`fast`){if(n===`built-in`)throw Error(`The 'built-in' category is reserved for lexer, parser, and linker errors.`);this.knownCategories.add(n);for(let[r,i]of Object.entries(e)){let e=i;if(Array.isArray(e))for(let i of e){let e={check:this.wrapValidationException(i,t),category:n};this.addEntry(r,e)}else if(typeof e==`function`){let i={check:this.wrapValidationException(e,t),category:n};this.addEntry(r,i)}else Dz(e)}}wrapValidationException(e,t){return async(n,r,i)=>{await this.handleException(()=>e.call(t,n,r,i),`An error occurred during validation`,r,n)}}async handleException(e,t,n,r){try{await e()}catch(e){if(fH(e))throw e;console.error(`${t}:`,e),e instanceof Error&&e.stack&&console.error(e.stack),n(`error`,`${t}: ${e instanceof Error?e.message:String(e)}`,{node:r})}}addEntry(e,t){if(e===`AstNode`){this.entries.add(`AstNode`,t);return}for(let n of this.reflection.getAllSubTypes(e))this.entries.add(n,t)}getChecks(e,t){let n=yR(this.entries.get(e)).concat(this.entries.get(`AstNode`));return t&&(n=n.filter(e=>t.includes(e.category))),n.map(e=>e.check)}registerBeforeDocument(e,t=this){this.entriesBefore.push(this.wrapPreparationException(e,`An error occurred during set-up of the validation`,t))}registerAfterDocument(e,t=this){this.entriesAfter.push(this.wrapPreparationException(e,`An error occurred during tear-down of the validation`,t))}wrapPreparationException(e,t,n){return async(r,i,a,o)=>{await this.handleException(()=>e.call(n,r,i,a,o),t,i,r)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},SQ=Object.freeze({validateNode:!0,validateChildren:!0}),CQ=class{static{Q(this,`DefaultDocumentValidator`)}constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,t={},n=UZ.CancellationToken.None){let r=e.parseResult,i=[];if(await pH(n),(!t.categories||t.categories.includes(`built-in`))&&(this.processLexingErrors(r,i,t),t.stopAfterLexingErrors&&i.some(e=>e.data?.code===wQ.LexingError)||(this.processParsingErrors(r,i,t),t.stopAfterParsingErrors&&i.some(e=>e.data?.code===wQ.ParsingError))||(this.processLinkingErrors(e,i,t),t.stopAfterLinkingErrors&&i.some(e=>e.data?.code===wQ.LinkingError))))return i;try{i.push(...await this.validateAst(r.value,t,n))}catch(e){if(fH(e))throw e;console.error(`An error occurred during validation:`,e)}return await pH(n),i}processLexingErrors(e,t,n){let r=[...e.lexerErrors,...e.lexerReport?.diagnostics??[]];for(let e of r){let n=e.severity??`error`,r={severity:CH(n),range:{start:{line:e.line-1,character:e.column-1},end:{line:e.line-1,character:e.column+e.length-1}},message:e.message,data:wH(n),source:this.getSource()};t.push(r)}}processParsingErrors(e,t,n){for(let n of e.parserErrors){let e;if(isNaN(n.token.startOffset)){if(`previousToken`in n){let t=n.previousToken;if(isNaN(t.startOffset)){let t={line:0,character:0};e={start:t,end:t}}else{let n={line:t.endLine-1,character:t.endColumn};e={start:n,end:n}}}}else e=gz(n.token);if(e){let r={severity:CH(`error`),range:e,message:n.message,data:xH(wQ.ParsingError),source:this.getSource()};t.push(r)}}}processLinkingErrors(e,t,n){for(let n of e.references){let e=n.error;if(e){let r={node:e.info.container,range:n.$refNode?.range,property:e.info.property,index:e.info.index,data:{code:wQ.LinkingError,containerType:e.info.container.$type,property:e.info.property,refText:e.info.reference.$refText}};t.push(this.toDiagnostic(`error`,e.message,r))}}}async validateAst(e,t,n=UZ.CancellationToken.None){let r=[],i=Q((e,t,n)=>{r.push(this.toDiagnostic(e,t,n))},`acceptor`);return await this.validateAstBefore(e,t,i,n),await this.validateAstNodes(e,t,i,n),await this.validateAstAfter(e,t,i,n),r}async validateAstBefore(e,t,n,r=UZ.CancellationToken.None){let i=this.validationRegistry.checksBefore;for(let a of i)await pH(r),await a(e,n,t.categories??[],r)}async validateAstNodes(e,t,n,r=UZ.CancellationToken.None){if(this.profiler?.isActive(`validating`)){let i=this.profiler.createTask(`validating`,this.languageId);i.start();try{let a=DR(e).iterator();for(let e of a){i.startSubTask(e.$type);let o=this.validateSingleNodeOptions(e,t);if(o.validateNode)try{let i=this.validationRegistry.getChecks(e.$type,t.categories);for(let t of i)await t(e,n,r)}finally{i.stopSubTask(e.$type)}o.validateChildren||a.prune()}}finally{i.stop()}}else{let i=DR(e).iterator();for(let e of i){await pH(r);let a=this.validateSingleNodeOptions(e,t);if(a.validateNode){let i=this.validationRegistry.getChecks(e.$type,t.categories);for(let t of i)await t(e,n,r)}a.validateChildren||i.prune()}}}validateSingleNodeOptions(e,t){return SQ}async validateAstAfter(e,t,n,r=UZ.CancellationToken.None){let i=this.validationRegistry.checksAfter;for(let a of i)await pH(r),await a(e,n,t.categories??[],r)}toDiagnostic(e,t,n){return{message:t,range:SH(n),severity:CH(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}},Q(SH,`getDiagnosticRange`),Q(CH,`toDiagnosticSeverity`),Q(wH,`toDiagnosticData`),(function(e){e.LexingError=`lexing-error`,e.LexingWarning=`lexing-warning`,e.LexingInfo=`lexing-info`,e.LexingHint=`lexing-hint`,e.ParsingError=`parsing-error`,e.LinkingError=`linking-error`})(wQ||={}),TQ=class{static{Q(this,`DefaultAstNodeDescriptionProvider`)}constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,t,n){let r=n??SR(e);t??=this.nameProvider.getName(e);let i=this.astNodeLocator.getAstNodePath(e);if(!t)throw Error(`Node at path ${i} has no name.`);let a,o=Q(()=>a??=_z(this.nameProvider.getNameNode(e)??e.$cstNode),`nameSegmentGetter`);return{node:e,name:t,get nameSegment(){return o()},selectionSegment:_z(e.$cstNode),type:e.$type,documentUri:r.uri,path:i}}},EQ=class{static{Q(this,`DefaultReferenceDescriptionProvider`)}constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,t=UZ.CancellationToken.None){let n=[],r=e.parseResult.value;for(let e of DR(r))await pH(t),kR(e).forEach(e=>{e.reference.error||n.push(...this.createInfoDescriptions(e))});return n}createInfoDescriptions(e){let t=e.reference;if(t.error||!t.$refNode)return[];let n=[];dR(t)&&t.$nodeDescription?n=[t.$nodeDescription]:fR(t)&&(n=t.items.map(e=>e.$nodeDescription).filter(e=>e!==void 0));let r=SR(e.container).uri,i=this.nodeLocator.getAstNodePath(e.container),a=[],o=_z(t.$refNode);for(let e of n)a.push({sourceUri:r,sourcePath:i,targetUri:e.documentUri,targetPath:e.path,segment:o,local:QZ.equals(e.documentUri,r)});return a}},DQ=class{static{Q(this,`DefaultAstNodeLocator`)}constructor(){this.segmentSeparator=`/`,this.indexSeparator=`@`}getAstNodePath(e){if(e.$container){let t=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return t+this.segmentSeparator+n}return``}getPathSegment({$containerProperty:e,$containerIndex:t}){if(!e)throw Error(`Missing '$containerProperty' in AST node.`);return t===void 0?e:e+this.indexSeparator+t}getAstNode(e,t){return t.split(this.segmentSeparator).reduce((e,t)=>{if(!e||t.length===0)return e;let n=t.indexOf(this.indexSeparator);if(n>0){let r=t.substring(0,n),i=parseInt(t.substring(n+1));return e[r]?.[i]}return e[t]},e)}},OQ={},ZH(OQ,QH(MU(),1)),kQ=class{static{Q(this,`DefaultConfigurationProvider`)}constructor(e){this._ready=new qZ,this.onConfigurationSectionUpdateEmitter=new OQ.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){this.workspaceConfig=e.capabilities.workspace?.configuration??!1}async initialized(e){if(this.workspaceConfig){if(e.register){let t=this.serviceRegistry.all;e.register({section:t.map(e=>this.toSectionName(e.LanguageMetaData.languageId))})}if(e.fetchConfiguration){let t=this.serviceRegistry.all.map(e=>({section:this.toSectionName(e.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(t);t.forEach((e,t)=>{this.updateSectionConfiguration(e.section,n[t])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings==`object`&&e.settings!==null&&Object.entries(e.settings).forEach(([e,t])=>{this.updateSectionConfiguration(e,t),this.onConfigurationSectionUpdateEmitter.fire({section:e,configuration:t})})}updateSectionConfiguration(e,t){this.settings[e]=t}async getConfiguration(e,t){await this.ready;let n=this.toSectionName(e);if(this.settings[n])return this.settings[n][t]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}},AQ=QH(v1e(),1),(function(e){function t(e){return{dispose:Q(async()=>await e(),`dispose`)}}Q(t,`create`),e.create=t})(jQ||={}),MQ=class{static{Q(this,`DefaultDocumentBuilder`)}constructor(e){this.updateBuildOptions={validation:{categories:[`built-in`,`fast`]}},this.updateListeners=[],this.buildPhaseListeners=new sQ,this.documentPhaseListeners=new sQ,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=eQ.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,t={},n=UZ.CancellationToken.None){for(let n of e){let e=n.uri.toString();if(n.state===eQ.Validated){if(typeof t.validation==`boolean`&&t.validation)this.resetToState(n,eQ.IndexedReferences);else if(typeof t.validation==`object`){let r=this.findMissingValidationCategories(n,t);r.length>0&&(this.buildState.set(e,{completed:!1,options:{validation:{categories:r}},result:this.buildState.get(e)?.result}),n.state=eQ.IndexedReferences)}}else this.buildState.delete(e)}this.currentState=eQ.Changed,await this.emitUpdate(e.map(e=>e.uri),[]),await this.buildDocuments(e,t,n)}async update(e,t,n=UZ.CancellationToken.None){this.currentState=eQ.Changed;let r=[];for(let e of t){let t=this.langiumDocuments.deleteDocuments(e);for(let e of t)r.push(e.uri),this.cleanUpDeleted(e)}let i=(await Promise.all(e.map(e=>this.findChangedUris(e)))).flat();for(let e of i){let t=this.langiumDocuments.getDocument(e);t===void 0&&(t=this.langiumDocumentFactory.fromModel({$type:`INVALID`},e),t.state=eQ.Changed,this.langiumDocuments.addDocument(t)),this.resetToState(t,eQ.Changed)}let a=yR(i).concat(r).map(e=>e.toString()).toSet();this.langiumDocuments.all.filter(e=>!a.has(e.uri.toString())&&this.shouldRelink(e,a)).forEach(e=>this.resetToState(e,eQ.ComputedScopes)),await this.emitUpdate(i,r),await pH(n);let o=this.sortDocuments(this.langiumDocuments.all.filter(e=>e.state<eQ.Validated||!this.buildState.get(e.uri.toString())?.completed||this.resultsAreIncomplete(e,this.updateBuildOptions)).toArray());await this.buildDocuments(o,this.updateBuildOptions,n)}resultsAreIncomplete(e,t){return this.findMissingValidationCategories(e,t).length>=1}findMissingValidationCategories(e,t){let n=this.buildState.get(e.uri.toString()),r=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),i=n?.result?.validationChecks?new Set(n?.result?.validationChecks):n?.completed?r:new Set;return yR(t===void 0||t.validation===!0?r:typeof t.validation==`object`?t.validation.categories??r:[]).filter(e=>!i.has(e)).toArray()}async findChangedUris(e){if(this.langiumDocuments.getDocument(e)??this.textDocuments?.get(e))return[e];try{let t=await this.fileSystemProvider.stat(e);if(t.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(t))return[e]}catch{}return[]}async emitUpdate(e,t){await Promise.all(this.updateListeners.map(n=>n(e,t)))}sortDocuments(e){let t=0,n=e.length-1;for(;t<n;){for(;t<e.length&&this.hasTextDocument(e[t]);)t++;for(;n>=0&&!this.hasTextDocument(e[n]);)n--;t<n&&([e[t],e[n]]=[e[n],e[t]])}return e}hasTextDocument(e){return!!this.textDocuments?.get(e.uri)}shouldRelink(e,t){return e.references.some(e=>e.error!==void 0)?!0:this.indexManager.isAffected(e,t)}onUpdate(e){return this.updateListeners.push(e),jQ.create(()=>{let t=this.updateListeners.indexOf(e);t>=0&&this.updateListeners.splice(t,1)})}resetToState(e,t){switch(t){case eQ.Changed:case eQ.Parsed:this.indexManager.removeContent(e.uri);case eQ.IndexedContent:e.localSymbols=void 0;case eQ.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case eQ.Linked:this.indexManager.removeReferences(e.uri);case eQ.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case eQ.Validated:}e.state>t&&(e.state=t)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=eQ.Changed}async buildDocuments(e,t,n){this.prepareBuild(e,t),await this.runCancelable(e,eQ.Parsed,n,e=>this.langiumDocumentFactory.update(e,n)),await this.runCancelable(e,eQ.IndexedContent,n,e=>this.indexManager.updateContent(e,n)),await this.runCancelable(e,eQ.ComputedScopes,n,async e=>{e.localSymbols=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectLocalSymbols(e,n)});let r=e.filter(e=>this.shouldLink(e));await this.runCancelable(r,eQ.Linked,n,e=>this.serviceRegistry.getServices(e.uri).references.Linker.link(e,n)),await this.runCancelable(r,eQ.IndexedReferences,n,e=>this.indexManager.updateReferences(e,n));let i=e.filter(e=>this.shouldValidate(e)?!0:(this.markAsCompleted(e),!1));await this.runCancelable(i,eQ.Validated,n,async e=>{await this.validate(e,n),this.markAsCompleted(e)})}markAsCompleted(e){let t=this.buildState.get(e.uri.toString());t&&(t.completed=!0)}prepareBuild(e,t){for(let n of e){let e=n.uri.toString(),r=this.buildState.get(e);(!r||r.completed)&&this.buildState.set(e,{completed:!1,options:t,result:r?.result})}}async runCancelable(e,t,n,r){for(let i of e)i.state<t&&(await pH(n),await r(i),i.state=t,await this.notifyDocumentPhase(i,t,n));let i=e.filter(e=>e.state===t);await this.notifyBuildPhase(i,t,n),this.currentState=t}onBuildPhase(e,t){return this.buildPhaseListeners.add(e,t),jQ.create(()=>{this.buildPhaseListeners.delete(e,t)})}onDocumentPhase(e,t){return this.documentPhaseListeners.add(e,t),jQ.create(()=>{this.documentPhaseListeners.delete(e,t)})}waitUntil(e,t,n){let r;return t&&`path`in t?r=t:n=t,n??=UZ.CancellationToken.None,r?this.awaitDocumentState(e,r,n):this.awaitBuilderState(e,n)}awaitDocumentState(e,t,n){let r=this.langiumDocuments.getDocument(t);return r?r.state>=e?Promise.resolve(t):n.isCancellationRequested?Promise.reject(KZ):this.currentState>=e&&e>r.state?Promise.reject(new AQ.ResponseError(AQ.LSPErrorCodes.RequestFailed,`Document state of ${t.toString()} is ${eQ[r.state]}, requiring ${eQ[e]}, but workspace state is already ${eQ[this.currentState]}. Returning undefined.`)):new Promise((r,i)=>{let a=this.onDocumentPhase(e,e=>{QZ.equals(e.uri,t)&&(a.dispose(),o.dispose(),r(e.uri))}),o=n.onCancellationRequested(()=>{a.dispose(),o.dispose(),i(KZ)})}):Promise.reject(new AQ.ResponseError(AQ.LSPErrorCodes.ServerCancelled,`No document found for URI: ${t.toString()}`))}awaitBuilderState(e,t){return this.currentState>=e?Promise.resolve():t.isCancellationRequested?Promise.reject(KZ):new Promise((n,r)=>{let i=this.onBuildPhase(e,()=>{i.dispose(),a.dispose(),n()}),a=t.onCancellationRequested(()=>{i.dispose(),a.dispose(),r(KZ)})})}async notifyDocumentPhase(e,t,n){let r=this.documentPhaseListeners.get(t).slice();for(let t of r)try{await pH(n),await t(e,n)}catch(e){if(!fH(e))throw e}}async notifyBuildPhase(e,t,n){if(e.length===0)return;let r=this.buildPhaseListeners.get(t).slice();for(let t of r)await pH(n),await t(e,n)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,t){let n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,r=this.getBuildOptions(e),i=typeof r.validation==`object`?{...r.validation}:{};i.categories=this.findMissingValidationCategories(e,r);let a=await n.validateDocument(e,i,t);e.diagnostics?e.diagnostics.push(...a):e.diagnostics=a;let o=this.buildState.get(e.uri.toString());o&&(o.result??={},o.result.validationChecks?o.result.validationChecks=yR(o.result.validationChecks).concat(i.categories).distinct().toArray():o.result.validationChecks=[...i.categories])}getBuildOptions(e){return this.buildState.get(e.uri.toString())?.options??{}}},NQ=class{static{Q(this,`DefaultIndexManager`)}constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new mQ,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,t){let n=SR(e).uri,r=[];return this.referenceIndex.forEach(e=>{e.forEach(e=>{QZ.equals(e.targetUri,n)&&e.targetPath===t&&r.push(e)})}),yR(r)}allElements(e,t){let n=yR(this.symbolIndex.keys());return t&&(n=n.filter(e=>!t||t.has(e))),n.map(t=>this.getFileDescriptions(t,e)).flat()}getFileDescriptions(e,t){return t?this.symbolByTypeIndex.get(e,t,()=>(this.symbolIndex.get(e)??[]).filter(e=>this.astReflection.isSubtype(e.type,t))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){let t=e.toString();this.symbolIndex.delete(t),this.symbolByTypeIndex.clear(t)}removeReferences(e){let t=e.toString();this.referenceIndex.delete(t)}async updateContent(e,t=UZ.CancellationToken.None){let n=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,t),r=e.uri.toString();this.symbolIndex.set(r,n),this.symbolByTypeIndex.clear(r)}async updateReferences(e,t=UZ.CancellationToken.None){let n=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,t);this.referenceIndex.set(e.uri.toString(),n)}isAffected(e,t){let n=this.referenceIndex.get(e.uri.toString());return n?n.some(e=>!e.local&&t.has(e.targetUri.toString())):!1}},PQ=class{static{Q(this,`DefaultWorkspaceManager`)}constructor(e){this.initialBuildOptions={},this._ready=new qZ,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(e=>this.initializeWorkspace(this.folders??[],e))}async initializeWorkspace(e,t=UZ.CancellationToken.None){let n=await this.performStartup(e);await pH(t),await this.documentBuilder.build(n,this.initialBuildOptions,t)}async performStartup(e){let t=[],n=Q(e=>{t.push(e),this.langiumDocuments.hasDocument(e.uri)||this.langiumDocuments.addDocument(e)},`collector`);await this.loadAdditionalDocuments(e,n);let r=[];await Promise.all(e.map(e=>this.getRootFolder(e)).map(async e=>this.traverseFolder(e,r)));let i=yR(r).distinct(e=>e.toString()).filter(e=>!this.langiumDocuments.hasDocument(e));return await this.loadWorkspaceDocuments(i,n),this._ready.resolve(),t}async loadWorkspaceDocuments(e,t){await Promise.all(e.map(async e=>{t(await this.langiumDocuments.getOrCreateDocument(e))}))}loadAdditionalDocuments(e,t){return Promise.resolve()}getRootFolder(e){return XZ.parse(e.uri)}async traverseFolder(e,t){try{let n=await this.fileSystemProvider.readDirectory(e);await Promise.all(n.map(async e=>{this.shouldIncludeEntry(e)&&(e.isDirectory?await this.traverseFolder(e.uri,t):e.isFile&&t.push(e.uri))}))}catch(t){console.error(`Failure to read directory content of `+e.toString(!0),t)}}async searchFolder(e){let t=[];return await this.traverseFolder(e,t),t}shouldIncludeEntry(e){let t=QZ.basename(e.uri);return t.startsWith(`.`)?!1:e.isDirectory?t!==`node_modules`&&t!==`out`:e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},FQ=class{static{Q(this,`DefaultLexerErrorMessageProvider`)}buildUnexpectedCharactersMessage(e,t,n,r,i){return LJ.buildUnexpectedCharactersMessage(e,t,n,r,i)}buildUnableToPopLexerModeMessage(e){return LJ.buildUnableToPopLexerModeMessage(e)}},IQ={mode:`full`},LQ=class{static{Q(this,`DefaultLexer`)}constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;let t=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(t);let n=DH(t)?Object.values(t):t,r=e.LanguageMetaData.mode===`production`;this.chevrotainLexer=new BJ(n,{positionTracking:`full`,skipValidations:r,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,t=IQ){let n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:this.tokenBuilder.flushLexingReport?.(e)}}toTokenTypeDictionary(e){if(DH(e))return e;let t=EH(e)?Object.values(e.modes).flat():e,n={};return t.forEach(e=>n[e.name]=e),n}},Q(TH,`isTokenTypeArray`),Q(EH,`isIMultiModeLexerDefinition`),Q(DH,`isTokenTypeDictionary`),kU(),Q(OH,`parseJSDoc`),Q(kH,`isJSDoc`),Q(AH,`getLines`),RQ=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,Z9e=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu,Q(tQe,`tokenize`),Q(nQe,`buildInlineTokens`),Q9e=/\S/,$9e=/\s*$/,Q(jH,`skipWhitespace`),Q(rQe,`lastCharacter`),Q(iQe,`parseJSDocComment`),Q(aQe,`parseJSDocElement`),Q(oQe,`appendEmptyLine`),Q(MH,`parseJSDocText`),Q(sQe,`parseJSDocInline`),Q(NH,`parseJSDocTag`),Q(PH,`parseJSDocLine`),Q(FH,`normalizeOptions`),Q(IH,`normalizeOption`),zQ=class{static{Q(this,`JSDocCommentImpl`)}constructor(e,t){this.elements=e,this.range=t}getTag(e){return this.getAllTags().find(t=>t.name===e)}getTags(e){return this.getAllTags().filter(t=>t.name===e)}getAllTags(){return this.elements.filter(e=>`name`in e)}toString(){let e=``;for(let t of this.elements)if(e.length===0)e=t.toString();else{let n=t.toString();e+=LH(e)+n}return e.trim()}toMarkdown(e){let t=``;for(let n of this.elements)if(t.length===0)t=n.toMarkdown(e);else{let r=n.toMarkdown(e);t+=LH(t)+r}return t.trim()}},BQ=class{static{Q(this,`JSDocTagImpl`)}constructor(e,t,n,r){this.name=e,this.content=t,this.inline=n,this.range=r}toString(){let e=`@${this.name}`,t=this.content.toString();return this.content.inlines.length===1?e=`${e} ${t}`:this.content.inlines.length>1&&(e=`${e}1359+${t}`),this.inline?`{${e}}`:e}toMarkdown(e){return e?.renderTag?.(this)??this.toMarkdownDefault(e)}toMarkdownDefault(e){let t=this.content.toMarkdown(e);if(this.inline){let n=cQe(this.name,t,e??{});if(typeof n==`string`)return n}let n=``;e?.tag===`italic`||e?.tag===void 0?n=`*`:e?.tag===`bold`?n=`**`:e?.tag===`bold-italic`&&(n=`***`);let r=`${n}@${this.name}${n}`;return this.content.inlines.length===1?r=`${r} \u2014 ${t}`:this.content.inlines.length>1&&(r=`${r}1360+${t}`),this.inline?`{${r}}`:r}},Q(cQe,`renderInlineTag`),Q(lQe,`renderLinkDefault`),VQ=class{static{Q(this,`JSDocTextImpl`)}constructor(e,t){this.inlines=e,this.range=t}toString(){let e=``;for(let t=0;t<this.inlines.length;t++){let n=this.inlines[t],r=this.inlines[t+1];e+=n.toString(),r&&r.range.start.line>n.range.start.line&&(e+=`1361+`)}return e}toMarkdown(e){let t=``;for(let n=0;n<this.inlines.length;n++){let r=this.inlines[n],i=this.inlines[n+1];t+=r.toMarkdown(e),i&&i.range.start.line>r.range.start.line&&(t+=`1362+`)}return t}},HQ=class{static{Q(this,`JSDocLineImpl`)}constructor(e,t){this.text=e,this.range=t}toString(){return this.text}toMarkdown(){return this.text}},Q(LH,`fillNewlines`),UQ=class{static{Q(this,`JSDocDocumentationProvider`)}constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){let t=this.commentProvider.getComment(e);if(t&&kH(t))return OH(t).toMarkdown({renderLink:Q((t,n)=>this.documentationLinkRenderer(e,t,n),`renderLink`),renderTag:Q(t=>this.documentationTagRenderer(e,t),`renderTag`)})}documentationLinkRenderer(e,t,n){let r=this.findNameInLocalSymbols(e,t)??this.findNameInGlobalScope(e,t);if(r&&r.nameSegment){let e=r.nameSegment.range.start.line+1,t=r.nameSegment.range.start.character+1;return`[${n}](${r.documentUri.with({fragment:`L${e},${t}`}).toString()})`}}documentationTagRenderer(e,t){}findNameInLocalSymbols(e,t){let n=SR(e).localSymbols;if(!n)return;let r=e;do{let e=n.getStream(r).find(e=>e.name===t);if(e)return e;r=r.$container}while(r)}findNameInGlobalScope(e,t){return this.indexManager.allElements().find(e=>e.name===t)}},WQ=class{static{Q(this,`DefaultCommentProvider`)}constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){return yH(e)?e.$comment:bz(e.$cstNode,this.grammarConfig().multilineCommentRules)?.text}},GQ=class{static{Q(this,`DefaultAsyncParser`)}constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,t){return Promise.resolve(this.syncParser.parse(e))}},eet=class{static{Q(this,`AbstractThreadedAsyncParser`)}constructor(e){this.threadCount=8,this.terminationDelay=200,this.workerPool=[],this.queue=[],this.hydrator=e.serializer.Hydrator}initializeWorkers(){for(;this.workerPool.length<this.threadCount;){let e=this.createWorker();e.onReady(()=>{if(this.queue.length>0){let t=this.queue.shift();t&&(e.lock(),t.resolve(e))}}),this.workerPool.push(e)}}async parse(e,t){let n=await this.acquireParserWorker(t),r=new qZ,i,a=t.onCancellationRequested(()=>{i=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(e=>{let t=this.hydrator.hydrate(e);r.resolve(t)}).catch(e=>{r.reject(e)}).finally(()=>{a.dispose(),clearTimeout(i)}),r.promise}terminateWorker(e){e.terminate();let t=this.workerPool.indexOf(e);t>=0&&this.workerPool.splice(t,1)}async acquireParserWorker(e){this.initializeWorkers();for(let e of this.workerPool)if(e.ready)return e.lock(),e;let t=new qZ;return e.onCancellationRequested(()=>{let e=this.queue.indexOf(t);e>=0&&this.queue.splice(e,1),t.reject(KZ)}),this.queue.push(t),t.promise}},tet=class{static{Q(this,`ParserWorker`)}get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,t,n,r){this.onReadyEmitter=new OQ.Emitter,this.deferred=new qZ,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=r,t(e=>{let t=e;this.deferred.resolve(t),this.unlock()}),n(e=>{this.deferred.reject(e),this.unlock()})}terminate(){this.deferred.reject(KZ),this._terminate()}lock(){this._ready=!1}unlock(){this._parsing=!1,this._ready=!0,this.onReadyEmitter.fire()}parse(e){if(this._parsing)throw Error(`Parser worker is busy`);return this._parsing=!0,this.deferred=new qZ,this.sendMessage(e),this.deferred.promise}},KQ=class{static{Q(this,`DefaultWorkspaceLock`)}constructor(){this.previousTokenSource=new UZ.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();let t=uH();return this.previousTokenSource=t,this.enqueue(this.writeQueue,e,t.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,t,n=UZ.CancellationToken.None){let r=new qZ,i={action:t,deferred:r,cancellationToken:n};return e.push(i),this.performNextOperation(),r.promise}async performNextOperation(){if(!this.done)return;let e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:e,deferred:t,cancellationToken:n})=>{try{let r=await Promise.resolve().then(()=>e(n));t.resolve(r)}catch(e){fH(e)?t.resolve(void 0):t.reject(e)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},qQ=class{static{Q(this,`DefaultHydrator`)}constructor(e){this.grammarElementIdMap=new cQ,this.tokenTypeIdMap=new cQ,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(e=>({...e,message:e.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){let t=new Map,n=new Map;for(let n of DR(e))t.set(n,{});if(e.$cstNode)for(let t of mz(e.$cstNode))n.set(t,{});return{astNodes:t,cstNodes:n}}dehydrateAstNode(e,t){let n=t.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,t));for(let[r,i]of Object.entries(e))if(!r.startsWith(`$`)){if(Array.isArray(i)){let e=[];n[r]=e;for(let n of i)uR(n)?e.push(this.dehydrateAstNode(n,t)):dR(n)?e.push(this.dehydrateReference(n,t)):e.push(n)}else uR(i)?n[r]=this.dehydrateAstNode(i,t):dR(i)?n[r]=this.dehydrateReference(i,t):i!==void 0&&(n[r]=i)}return n}dehydrateReference(e,t){let n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=t.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,t){let n=t.cstNodes.get(e);return _R(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=t.astNodes.get(e.astNode),hR(e)?n.content=e.content.map(e=>this.dehydrateCstNode(e,t)):gR(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){let t=e.value,n=this.createHydrationContext(t);return`$cstNode`in t&&this.hydrateCstNode(t.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(t,n)}}createHydrationContext(e){let t=new Map,n=new Map;for(let n of DR(e))t.set(n,{});let r;if(e.$cstNode)for(let t of mz(e.$cstNode)){let e;`fullText`in t?(e=new AZ(t.fullText),r=e):`content`in t?e=new kZ:`tokenType`in t&&(e=this.hydrateCstLeafNode(t)),e&&(n.set(t,e),e.root=r)}return{astNodes:t,cstNodes:n}}hydrateAstNode(e,t){let n=t.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=t.cstNodes.get(e.$cstNode));for(let[r,i]of Object.entries(e))if(!r.startsWith(`$`)){if(Array.isArray(i)){let e=[];n[r]=e;for(let a of i)uR(a)?e.push(this.setParent(this.hydrateAstNode(a,t),n)):dR(a)?e.push(this.hydrateReference(a,n,r,t)):e.push(a)}else uR(i)?n[r]=this.setParent(this.hydrateAstNode(i,t),n):dR(i)?n[r]=this.hydrateReference(i,n,r,t):i!==void 0&&(n[r]=i)}return n}setParent(e,t){return e.$container=t,e}hydrateReference(e,t,n,r){return this.linker.buildReference(t,n,r.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,t,n=0){let r=t.cstNodes.get(e);if(typeof e.grammarSource==`number`&&(r.grammarSource=this.getGrammarElement(e.grammarSource)),r.astNode=t.astNodes.get(e.astNode),hR(r))for(let i of e.content){let e=this.hydrateCstNode(i,t,n++);r.content.push(e)}return r}hydrateCstLeafNode(e){let t=this.getTokenType(e.tokenType),n=e.offset,r=e.length,i=e.startLine,a=e.startColumn,o=e.endLine,s=e.endColumn,l=e.hidden;return new OZ(n,r,{start:{line:i,character:a},end:{line:o,character:s}},t,l)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(let t of DR(this.grammar))NR(t)&&this.grammarElementIdMap.set(t,e++)}},Q(RH,`createDefaultCoreModule`),Q(zH,`createDefaultSharedCoreModule`),(function(e){e.merge=(e,t)=>WH(WH({},e),t)})(net||={}),Q(BH,`inject`),JQ=Symbol(`isProxy`),Q(VH,`eagerLoad`),Q(HH,`_inject`),YQ=Symbol(),Q(UH,`_resolve`),Q(WH,`_merge`),XQ={indentTokenName:`INDENT`,dedentTokenName:`DEDENT`,whitespaceTokenName:`WS`,ignoreIndentationDelimiters:[]},(function(e){e.REGULAR=`indentation-sensitive`,e.IGNORE_INDENTATION=`ignore-indentation`})(ZQ||={}),QQ=class extends BZ{static{Q(this,`IndentationAwareTokenBuilder`)}constructor(e=XQ){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...XQ,...e},this.indentTokenType=QB({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=QB({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,t){let n=super.buildTokens(e,t);if(!TH(n))throw Error(`Invalid tokens built by default builder`);let{indentTokenName:r,dedentTokenName:i,whitespaceTokenName:a,ignoreIndentationDelimiters:o}=this.options,s,l,u,d=[];for(let e of n){for(let[t,n]of o)e.name===t?e.PUSH_MODE=ZQ.IGNORE_INDENTATION:e.name===n&&(e.POP_MODE=!0);e.name===i?s=e:e.name===r?l=e:e.name===a?u=e:d.push(e)}if(!s||!l||!u)throw Error(`Some indentation/whitespace tokens not found!`);return o.length>0?{modes:{[ZQ.REGULAR]:[s,l,...d,u],[ZQ.IGNORE_INDENTATION]:[...d,u]},defaultMode:ZQ.REGULAR}:[s,l,u,...d]}flushLexingReport(e){return{...super.flushLexingReport(e),remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,t){return t===0||`\r1363+`.includes(e[t-1])}matchWhitespace(e,t,n,r){this.whitespaceRegExp.lastIndex=t;let i=this.whitespaceRegExp.exec(e);return{currIndentLevel:i?.[0].length??0,prevIndentLevel:this.indentationStack.at(-1),match:i}}createIndentationTokenInstance(e,t,n,r){let i=this.getLineNumber(t,r);return $B(e,n,r,r+n.length,i,i,1,n.length)}getLineNumber(e,t){return e.substring(0,t).split(/\r\n|\r|\n/).length}indentMatcher(e,t,n,r){if(!this.isStartOfLine(e,t))return null;let{currIndentLevel:i,prevIndentLevel:a,match:o}=this.matchWhitespace(e,t,n,r);return i<=a?null:(this.indentationStack.push(i),o)}dedentMatcher(e,t,n,r){if(!this.isStartOfLine(e,t))return null;let{currIndentLevel:i,prevIndentLevel:a,match:o}=this.matchWhitespace(e,t,n,r);if(i>=a)return null;let s=this.indentationStack.lastIndexOf(i);if(s===-1)return this.diagnostics.push({severity:`error`,message:`Invalid dedent level ${i} at offset: ${t}. Current indentation stack: ${this.indentationStack}`,offset:t,length:o?.[0]?.length??0,line:this.getLineNumber(e,t),column:1}),null;let l=this.indentationStack.length-s-1,u=e.substring(0,t).match(/[\r\n]+$/)?.[0].length??1;for(let r=0;r<l;r++){let r=this.createIndentationTokenInstance(this.dedentTokenType,e,``,t-(u-1));n.push(r),this.indentationStack.pop()}return null}buildTerminalToken(e){let t=super.buildTerminalToken(e),{indentTokenName:n,dedentTokenName:r,whitespaceTokenName:i}=this.options;return t.name===n?this.indentTokenType:t.name===r?this.dedentTokenType:t.name===i?QB({name:i,pattern:this.whitespaceRegExp,group:BJ.SKIPPED}):t}flushRemainingDedents(e){let t=[];for(;this.indentationStack.length>1;)t.push(this.createIndentationTokenInstance(this.dedentTokenType,e,``,e.length)),this.indentationStack.pop();return this.indentationStack=[0],t}},ret=class extends LQ{static{Q(this,`IndentationAwareLexer`)}constructor(e){if(super(e),e.parser.TokenBuilder instanceof QQ)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw Error(`IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder`)}tokenize(e,t=IQ){let n=super.tokenize(e),r=n.report;t?.mode===`full`&&n.tokens.push(...r.remainingDedents),r.remainingDedents=[];let{indentTokenType:i,dedentTokenType:a}=this.indentationTokenBuilder,o=i.tokenTypeIdx,s=a.tokenTypeIdx,l=[],u=n.tokens.length-1;for(let e=0;e<u;e++){let t=n.tokens[e],r=n.tokens[e+1];if(t.tokenTypeIdx===o&&r.tokenTypeIdx===s){e++;continue}l.push(t)}return u>=0&&l.push(n.tokens[u]),n.tokens=l,n}},$Q={},YH($Q,{AstUtils:()=>XU,BiMap:()=>cQ,Cancellation:()=>UZ,ContextCache:()=>mQ,CstUtils:()=>UU,DONE_RESULT:()=>qU,Deferred:()=>qZ,Disposable:()=>jQ,DisposableCache:()=>fQ,DocumentCache:()=>hQ,EMPTY_STREAM:()=>KU,ErrorWithLocation:()=>eG,GrammarUtils:()=>$W,MultiMap:()=>sQ,OperationCancelled:()=>KZ,Reduction:()=>YU,RegExpUtils:()=>tG,SimpleCache:()=>pQ,StreamImpl:()=>GU,TreeStreamImpl:()=>JU,URI:()=>XZ,UriTrie:()=>$Z,UriUtils:()=>QZ,WorkspaceCache:()=>gQ,assertCondition:()=>Oz,assertUnreachable:()=>Dz,delayNextTick:()=>lH,interruptAndCheck:()=>pH,isOperationCancelled:()=>fH,loadGrammarFromJson:()=>GH,setInterruptionPeriod:()=>dH,startCancelableOperation:()=>uH,stream:()=>yR}),ZH($Q,OQ),e$=class{static{Q(this,`EmptyFileSystemProvider`)}stat(e){throw Error(`No file system is available.`)}statSync(e){throw Error(`No file system is available.`)}async exists(){return!1}existsSync(){return!1}readBinary(){throw Error(`No file system is available.`)}readBinarySync(){throw Error(`No file system is available.`)}readFile(){throw Error(`No file system is available.`)}readFileSync(){throw Error(`No file system is available.`)}async readDirectory(){return[]}readDirectorySync(){return[]}},t$={fileSystemProvider:Q(()=>new e$,`fileSystemProvider`)},iet={Grammar:Q(()=>void 0,`Grammar`),LanguageMetaData:Q(()=>({caseInsensitive:!1,fileExtensions:[`.langium`],languageId:`langium`}),`LanguageMetaData`)},aet={AstReflection:Q(()=>new YW,`AstReflection`)},Q(uQe,`createMinimalGrammarServices`),Q(GH,`loadGrammarFromJson`),ZH(HU,$Q),oet=class{static{Q(this,`DefaultLangiumProfiler`)}constructor(e){this.activeCategories=new Set,this.allCategories=new Set([`validating`,`parsing`,`linking`]),this.activeCategories=e??new Set(this.allCategories),this.records=new sQ}isActive(e){return this.activeCategories.has(e)}start(...e){e?e.forEach(e=>this.activeCategories.add(e)):this.activeCategories=new Set(this.allCategories)}stop(...e){e?e.forEach(e=>this.activeCategories.delete(e)):this.activeCategories.clear()}createTask(e,t){if(!this.isActive(e))throw Error(`Category "${e}" is not active.`);return console.log(`Creating profiling task for '${e}.${t}'.`),new n$(t=>this.records.add(e,this.dumpRecord(e,t)),t)}dumpRecord(e,t){console.info(`Task ${e}.${t.identifier} executed in ${t.duration.toFixed(2)}ms and ended at ${t.date.toISOString()}`);let n=[];for(let e of t.entries.keys()){let r=t.entries.get(e),i=r.reduce((e,t)=>e+t);n.push({name:`${t.identifier}.${e}`,count:r.length,duration:i})}let r=t.duration-n.map(e=>e.duration).reduce((e,t)=>e+t,0);n.push({name:t.identifier,count:1,duration:r}),n.sort((e,t)=>t.duration-e.duration);function i(e){return Math.round(100*e)/100}return Q(i,`Round`),console.table(n.map(e=>({Element:e.name,Count:e.count,"Self %":i(100*e.duration/t.duration),"Time (ms)":i(e.duration)}))),t}getRecords(...e){return e.length===0?this.records.values():this.records.entries().filter(t=>e.some(e=>e===t[0])).flatMap(e=>e[1])}},n$=class{static{Q(this,`ProfilingTask`)}constructor(e,t){this.stack=[],this.entries=new sQ,this.addRecord=e,this.identifier=t}start(){if(this.startTime!==void 0)throw Error(`Task "${this.identifier}" is already started.`);this.startTime=performance.now()}stop(){if(this.startTime===void 0)throw Error(`Task "${this.identifier}" was not started.`);if(this.stack.length!==0)throw Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(e=>e.id).join(`, `)}.`);let e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e),this.startTime=void 0,this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){let t=this.stack.pop();if(!t)throw Error(`Task "${this.identifier}.${e}" was not started.`);if(t.id!==e)throw Error(`Sub-Task "${t.id}" is not already stopped.`);let n=performance.now()-t.start;this.stack.at(-1)!==void 0&&(this.stack[this.stack.length-1].content+=n);let r=n-t.content;this.entries.add(e,r)}},(e=>{e.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[^\[\]\r\n]+)\]/}})(set||={}),(e=>{e.Terminals={DOMAIN_NAME:/complex|complicated|clear|chaotic|confusion/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(cet||={}),(e=>{e.Terminals={EM_ID:/[_a-zA-Z][\w_]*/,EM_FID:/\d{1,3}/,EM_DATA_INLINE:/\{(.*)\}|"(.*)"|'(.*)'/,EM_DATA_BLOCK:/\{[\t ]*\r?\n(?:[\S\s]*?\r?\n)?\}(?:\r?\n|(?!\S))/,EM_ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EM_ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,EM_TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,EM_WS:/\s+/,EM_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EM_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EM_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EM_ML_COMMENT:/\/\*[\s\S]*?\*\//,EM_SL_COMMENT:/\/\/[^\n\r]*/}})(uet||={}),(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(det||={}),(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(fet||={}),(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(pet||={}),(e=>{e.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(met||={}),(e=>{e.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(het||={}),(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ABNF_RULENAME:/[A-Za-z][A-Za-z0-9-]*/,ABNF_STRING:/"[^"]*"/,ABNF_NUMVAL:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/,ABNF_REPEAT:/[0-9]*\*[0-9]*/,ABNF_EXACT_REPEAT:/[0-9]+/,ABNF_WHITESPACE:/[\t \r\n]+/,ABNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,ABNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,ABNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ABNF_COMMENT:/;[^\n\r]*/}})(get||={}),(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EBNF_ID:/[A-Z_a-z][\w-]*/,EBNF_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,EBNF_SPECIAL_SEQUENCE:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/,EBNF_WHITESPACE:/[\t \r\n]+/,EBNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EBNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EBNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EBNF_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//,EBNF_ISO_COMMENT:/\(\*[\s\S]*?\*\)/}})(_et||={}),(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,RR_ID:/[A-Z_a-z][\w-]*/,RR_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,RR_WHITESPACE:/[\t \r\n]+/,RR_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,RR_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,RR_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,RR_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//}})(vet||={}),(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,PEG_ID:/[A-Z_a-z][\w-]*/,PEG_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,PEG_WHITESPACE:/[\t \r\n]+/,PEG_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,PEG_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,PEG_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,PEG_LINE_COMMENT:/#[^\n\r]*/}})(yet||={}),(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(bet||={}),(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,CLASS_ANNOTATION:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/,ICON_ANNOTATION:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/,DESC_ANNOTATION:/[ \t]+##[^\n\r]*/,INDENTATION:/[ \t]{1,}/,QUOTED_NAME:/"[^"]*"|'[^']*'/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,BARE_NAME:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/}})(xet||={}),(e=>{e.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+</,LINK_ARROW:/-->|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Cet||={}),{...set.Terminals,...cet.Terminals,...uet.Terminals,...det.Terminals,...fet.Terminals,...pet.Terminals,...met.Terminals,...het.Terminals,...get.Terminals,..._et.Terminals,...vet.Terminals,...yet.Terminals,...xet.Terminals,...bet.Terminals,...Cet.Terminals},r$={$type:`AbnfAlternation`,alternatives:`alternatives`},i$={$type:`AbnfConcatenation`,elements:`elements`},a$={$type:`AbnfElement`,primary:`primary`,repeat:`repeat`},o$={$type:`AbnfGroup`,element:`element`},s$={$type:`AbnfNumVal`,value:`value`},c$={$type:`AbnfOptionalGroup`,element:`element`},l$={$type:`AbnfPrimary`},u$={$type:`AbnfRule`,definition:`definition`,name:`name`},d$={$type:`AbnfRuleName`,name:`name`},f$={$type:`AbnfStringLiteral`,value:`value`},p$={$type:`Accelerator`,name:`name`,x:`x`,y:`y`},m$={$type:`Alignment`,direction:`direction`,members:`members`},h$={$type:`Anchor`,evolution:`evolution`,name:`name`,visibility:`visibility`},g$={$type:`Annotation`,number:`number`,text:`text`,x:`x`,y:`y`},_$={$type:`Annotations`,x:`x`,y:`y`},v$={$type:`Architecture`,accDescr:`accDescr`,accTitle:`accTitle`,alignments:`alignments`,edges:`edges`,groups:`groups`,junctions:`junctions`,services:`services`,title:`title`},Q(dQe,`isArchitecture`),y$={$type:`Axis`,label:`label`,name:`name`},b$={$type:`Branch`,name:`name`,order:`order`},Q(fQe,`isBranch`),x$={$type:`Checkout`,branch:`branch`},S$={$type:`CherryPicking`,id:`id`,parent:`parent`,tags:`tags`},C$={$type:`ClassDefStatement`,className:`className`,styleText:`styleText`},w$={$type:`Commit`,id:`id`,message:`message`,tags:`tags`,type:`type`},Q(pQe,`isCommit`),T$={$type:`Common`,accDescr:`accDescr`,accTitle:`accTitle`,title:`title`},E$={$type:`Component`,decorator:`decorator`,evolution:`evolution`,inertia:`inertia`,label:`label`,name:`name`,visibility:`visibility`},D$={$type:`Curve`,entries:`entries`,label:`label`,name:`name`},O$={$type:`Cynefin`,accDescr:`accDescr`,accTitle:`accTitle`,domains:`domains`,title:`title`,transitions:`transitions`},Q(mQe,`isCynefin`),k$={$type:`Deaccelerator`,name:`name`,x:`x`,y:`y`},A$={$type:`Decorator`,strategy:`strategy`},j$={$type:`Direction`,accDescr:`accDescr`,accTitle:`accTitle`,dir:`dir`,statements:`statements`,title:`title`},M$={$type:`DomainBlock`,domain:`domain`,items:`items`},Q(hQe,`isDomainBlock`),N$={$type:`DomainItem`,label:`label`},Q(gQe,`isDomainItem`),P$={$type:`EbnfChoice`,alternatives:`alternatives`},F$={$type:`EbnfExceptionPostfix`,except:`except`},I$={$type:`EbnfGroup`,element:`element`},L$={$type:`EbnfNonTerminal`,name:`name`},R$={$type:`EbnfOneOrMorePostfix`,operator:`operator`},z$={$type:`EbnfOptional`,element:`element`},B$={$type:`EbnfOptionalPostfix`,operator:`operator`},V$={$type:`EbnfPostfix`},H$={$type:`EbnfPrimary`},U$={$type:`EbnfRepetition`,element:`element`},W$={$type:`EbnfRule`,definition:`definition`,name:`name`},G$={$type:`EbnfSequence`,elements:`elements`},K$={$type:`EbnfSpecial`,text:`text`},q$={$type:`EbnfTerm`,base:`base`,postfixes:`postfixes`},J$={$type:`EbnfTerminal`,value:`value`},Y$={$type:`EbnfZeroOrMorePostfix`,operator:`operator`},X$={$type:`Edge`,lhsDir:`lhsDir`,lhsGroup:`lhsGroup`,lhsId:`lhsId`,lhsInto:`lhsInto`,rhsDir:`rhsDir`,rhsGroup:`rhsGroup`,rhsId:`rhsId`,rhsInto:`rhsInto`,title:`title`},Z$={$type:`EmDataEntity`,dataBlockValue:`dataBlockValue`,dataType:`dataType`,name:`name`},Q$={$type:`EmFrame`},$$={$type:`EmGwt`,givenStatements:`givenStatements`,sourceFrame:`sourceFrame`,thenStatements:`thenStatements`,whenStatements:`whenStatements`},e1={$type:`EmGwtStatement`,entityIdentifier:`entityIdentifier`},t1={$type:`EmModelEntity`,name:`name`},Q(_Qe,`isEmModelEntityType`),n1={$type:`EmNoteEntity`,dataBlockValue:`dataBlockValue`,dataType:`dataType`,sourceFrame:`sourceFrame`},r1={$type:`EmResetFrame`,dataInlineValue:`dataInlineValue`,dataReference:`dataReference`,dataType:`dataType`,entityIdentifier:`entityIdentifier`,modelEntityType:`modelEntityType`,name:`name`,sourceFrames:`sourceFrames`},Q(vQe,`isEmResetFrame`),i1={$type:`EmTimeFrame`,dataInlineValue:`dataInlineValue`,dataReference:`dataReference`,dataType:`dataType`,entityIdentifier:`entityIdentifier`,modelEntityType:`modelEntityType`,name:`name`,sourceFrames:`sourceFrames`},a1={$type:`Entry`,axis:`axis`,value:`value`},o1={$type:`EventModel`,accDescr:`accDescr`,accTitle:`accTitle`,dataEntities:`dataEntities`,frames:`frames`,gwtEntities:`gwtEntities`,modelEntities:`modelEntities`,noteEntities:`noteEntities`,title:`title`},s1={$type:`Evolution`,stages:`stages`},c1={$type:`EvolutionStage`,boundary:`boundary`,name:`name`,secondName:`secondName`},l1={$type:`Evolve`,component:`component`,target:`target`},u1={$type:`GitGraph`,accDescr:`accDescr`,accTitle:`accTitle`,statements:`statements`,title:`title`},Q(yQe,`isGitGraph`),d1={$type:`Group`,icon:`icon`,id:`id`,in:`in`,title:`title`},f1={$type:`Info`,accDescr:`accDescr`,accTitle:`accTitle`,title:`title`},Q(bQe,`isInfo`),p1={$type:`Item`,classSelector:`classSelector`,name:`name`},m1={$type:`Junction`,id:`id`,in:`in`},h1={$type:`Label`,negX:`negX`,negY:`negY`,offsetX:`offsetX`,offsetY:`offsetY`},g1={$type:`Leaf`,classSelector:`classSelector`,name:`name`,value:`value`},_1={$type:`Link`,arrow:`arrow`,from:`from`,fromPort:`fromPort`,linkLabel:`linkLabel`,to:`to`,toPort:`toPort`},v1={$type:`Merge`,branch:`branch`,id:`id`,tags:`tags`,type:`type`},Q(xQe,`isMerge`),y1={$type:`Note`,evolution:`evolution`,text:`text`,visibility:`visibility`},b1={$type:`Option`,name:`name`,value:`value`},x1={$type:`Packet`,accDescr:`accDescr`,accTitle:`accTitle`,blocks:`blocks`,title:`title`},Q(SQe,`isPacket`),S1={$type:`PacketBlock`,bits:`bits`,end:`end`,label:`label`,start:`start`},Q(CQe,`isPacketBlock`),C1={$type:`PegAny`,dot:`dot`},w1={$type:`PegGroup`,element:`element`},T1={$type:`PegIdentifier`,name:`name`},E1={$type:`PegLiteral`,value:`value`},D1={$type:`PegOrderedChoice`,alternatives:`alternatives`},O1={$type:`PegPrefix`,operator:`operator`,suffix:`suffix`},k1={$type:`PegPrimary`},A1={$type:`PegRule`,definition:`definition`,name:`name`},j1={$type:`PegSequence`,elements:`elements`},M1={$type:`PegSuffix`,operator:`operator`,primary:`primary`},N1={$type:`Pie`,accDescr:`accDescr`,accTitle:`accTitle`,sections:`sections`,showData:`showData`,title:`title`},Q(wQe,`isPie`),P1={$type:`PieSection`,label:`label`,value:`value`},Q(TQe,`isPieSection`),F1={$type:`Pipeline`,components:`components`,parent:`parent`},I1={$type:`PipelineComponent`,evolution:`evolution`,label:`label`,name:`name`},L1={$type:`Radar`,accDescr:`accDescr`,accTitle:`accTitle`,axes:`axes`,curves:`curves`,options:`options`,title:`title`},R1={$type:`Railroad`,accDescr:`accDescr`,accTitle:`accTitle`,rules:`rules`,title:`title`},Q(EQe,`isRailroad`),z1={$type:`RailroadAbnf`,accDescr:`accDescr`,accTitle:`accTitle`,rules:`rules`,title:`title`},Q(DQe,`isRailroadAbnf`),B1={$type:`RailroadChoiceExpr`,alternatives:`alternatives`},V1={$type:`RailroadEbnf`,accDescr:`accDescr`,accTitle:`accTitle`,rules:`rules`,title:`title`},Q(OQe,`isRailroadEbnf`),H1={$type:`RailroadExpression`},U1={$type:`RailroadNonTerminalExpr`,name:`name`},W1={$type:`RailroadOneOrMoreExpr`,element:`element`},G1={$type:`RailroadOptionalExpr`,element:`element`},K1={$type:`RailroadPeg`,accDescr:`accDescr`,accTitle:`accTitle`,rules:`rules`,title:`title`},Q(kQe,`isRailroadPeg`),q1={$type:`RailroadRule`,definition:`definition`,name:`name`},J1={$type:`RailroadSequenceExpr`,elements:`elements`},Y1={$type:`RailroadSpecialExpr`,text:`text`},X1={$type:`RailroadTerminalExpr`,value:`value`},Z1={$type:`RailroadZeroOrMoreExpr`,element:`element`},Q1={$type:`Section`,classSelector:`classSelector`,name:`name`},$1={$type:`Service`,icon:`icon`,iconText:`iconText`,id:`id`,in:`in`,title:`title`},e0={$type:`Size`,height:`height`,width:`width`},t0={$type:`Statement`},n0={$type:`Transition`,from:`from`,label:`label`,to:`to`},Q(AQe,`isTransition`),r0={$type:`Treemap`,accDescr:`accDescr`,accTitle:`accTitle`,title:`title`,TreemapRows:`TreemapRows`},Q(jQe,`isTreemap`),i0={$type:`TreemapRow`,indent:`indent`,item:`item`},a0={$type:`TreeNode`,classAnnotation:`classAnnotation`,descAnnotation:`descAnnotation`,iconAnnotation:`iconAnnotation`,indent:`indent`,name:`name`},o0={$type:`TreeView`,accDescr:`accDescr`,accTitle:`accTitle`,nodes:`nodes`,title:`title`},s0={$type:`Wardley`,accDescr:`accDescr`,accelerators:`accelerators`,accTitle:`accTitle`,anchors:`anchors`,annotation:`annotation`,annotations:`annotations`,components:`components`,deaccelerators:`deaccelerators`,evolution:`evolution`,evolves:`evolves`,links:`links`,notes:`notes`,pipelines:`pipelines`,size:`size`,title:`title`},Q(MQe,`isWardley`),c0=class extends WU{constructor(){super(...arguments),this.types={AbnfAlternation:{name:r$.$type,properties:{alternatives:{name:r$.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:i$.$type,properties:{elements:{name:i$.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:a$.$type,properties:{primary:{name:a$.primary},repeat:{name:a$.repeat}},superTypes:[]},AbnfGroup:{name:o$.$type,properties:{element:{name:o$.element}},superTypes:[l$.$type]},AbnfNumVal:{name:s$.$type,properties:{value:{name:s$.value}},superTypes:[l$.$type]},AbnfOptionalGroup:{name:c$.$type,properties:{element:{name:c$.element}},superTypes:[l$.$type]},AbnfPrimary:{name:l$.$type,properties:{},superTypes:[]},AbnfRule:{name:u$.$type,properties:{definition:{name:u$.definition},name:{name:u$.name}},superTypes:[]},AbnfRuleName:{name:d$.$type,properties:{name:{name:d$.name}},superTypes:[l$.$type]},AbnfStringLiteral:{name:f$.$type,properties:{value:{name:f$.value}},superTypes:[l$.$type]},Accelerator:{name:p$.$type,properties:{name:{name:p$.name},x:{name:p$.x},y:{name:p$.y}},superTypes:[]},Alignment:{name:m$.$type,properties:{direction:{name:m$.direction},members:{name:m$.members,defaultValue:[]}},superTypes:[]},Anchor:{name:h$.$type,properties:{evolution:{name:h$.evolution},name:{name:h$.name},visibility:{name:h$.visibility}},superTypes:[]},Annotation:{name:g$.$type,properties:{number:{name:g$.number},text:{name:g$.text},x:{name:g$.x},y:{name:g$.y}},superTypes:[]},Annotations:{name:_$.$type,properties:{x:{name:_$.x},y:{name:_$.y}},superTypes:[]},Architecture:{name:v$.$type,properties:{accDescr:{name:v$.accDescr},accTitle:{name:v$.accTitle},alignments:{name:v$.alignments,defaultValue:[]},edges:{name:v$.edges,defaultValue:[]},groups:{name:v$.groups,defaultValue:[]},junctions:{name:v$.junctions,defaultValue:[]},services:{name:v$.services,defaultValue:[]},title:{name:v$.title}},superTypes:[]},Axis:{name:y$.$type,properties:{label:{name:y$.label},name:{name:y$.name}},superTypes:[]},Branch:{name:b$.$type,properties:{name:{name:b$.name},order:{name:b$.order}},superTypes:[t0.$type]},Checkout:{name:x$.$type,properties:{branch:{name:x$.branch}},superTypes:[t0.$type]},CherryPicking:{name:S$.$type,properties:{id:{name:S$.id},parent:{name:S$.parent},tags:{name:S$.tags,defaultValue:[]}},superTypes:[t0.$type]},ClassDefStatement:{name:C$.$type,properties:{className:{name:C$.className},styleText:{name:C$.styleText}},superTypes:[]},Commit:{name:w$.$type,properties:{id:{name:w$.id},message:{name:w$.message},tags:{name:w$.tags,defaultValue:[]},type:{name:w$.type}},superTypes:[t0.$type]},Common:{name:T$.$type,properties:{accDescr:{name:T$.accDescr},accTitle:{name:T$.accTitle},title:{name:T$.title}},superTypes:[]},Component:{name:E$.$type,properties:{decorator:{name:E$.decorator},evolution:{name:E$.evolution},inertia:{name:E$.inertia,defaultValue:!1},label:{name:E$.label},name:{name:E$.name},visibility:{name:E$.visibility}},superTypes:[]},Curve:{name:D$.$type,properties:{entries:{name:D$.entries,defaultValue:[]},label:{name:D$.label},name:{name:D$.name}},superTypes:[]},Cynefin:{name:O$.$type,properties:{accDescr:{name:O$.accDescr},accTitle:{name:O$.accTitle},domains:{name:O$.domains,defaultValue:[]},title:{name:O$.title},transitions:{name:O$.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:k$.$type,properties:{name:{name:k$.name},x:{name:k$.x},y:{name:k$.y}},superTypes:[]},Decorator:{name:A$.$type,properties:{strategy:{name:A$.strategy}},superTypes:[]},Direction:{name:j$.$type,properties:{accDescr:{name:j$.accDescr},accTitle:{name:j$.accTitle},dir:{name:j$.dir},statements:{name:j$.statements,defaultValue:[]},title:{name:j$.title}},superTypes:[u1.$type]},DomainBlock:{name:M$.$type,properties:{domain:{name:M$.domain},items:{name:M$.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:N$.$type,properties:{label:{name:N$.label}},superTypes:[]},EbnfChoice:{name:P$.$type,properties:{alternatives:{name:P$.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:F$.$type,properties:{except:{name:F$.except}},superTypes:[V$.$type]},EbnfGroup:{name:I$.$type,properties:{element:{name:I$.element}},superTypes:[H$.$type]},EbnfNonTerminal:{name:L$.$type,properties:{name:{name:L$.name}},superTypes:[H$.$type]},EbnfOneOrMorePostfix:{name:R$.$type,properties:{operator:{name:R$.operator}},superTypes:[V$.$type]},EbnfOptional:{name:z$.$type,properties:{element:{name:z$.element}},superTypes:[H$.$type]},EbnfOptionalPostfix:{name:B$.$type,properties:{operator:{name:B$.operator}},superTypes:[V$.$type]},EbnfPostfix:{name:V$.$type,properties:{},superTypes:[]},EbnfPrimary:{name:H$.$type,properties:{},superTypes:[]},EbnfRepetition:{name:U$.$type,properties:{element:{name:U$.element}},superTypes:[H$.$type]},EbnfRule:{name:W$.$type,properties:{definition:{name:W$.definition},name:{name:W$.name}},superTypes:[]},EbnfSequence:{name:G$.$type,properties:{elements:{name:G$.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:K$.$type,properties:{text:{name:K$.text}},superTypes:[H$.$type]},EbnfTerm:{name:q$.$type,properties:{base:{name:q$.base},postfixes:{name:q$.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:J$.$type,properties:{value:{name:J$.value}},superTypes:[H$.$type]},EbnfZeroOrMorePostfix:{name:Y$.$type,properties:{operator:{name:Y$.operator}},superTypes:[V$.$type]},Edge:{name:X$.$type,properties:{lhsDir:{name:X$.lhsDir},lhsGroup:{name:X$.lhsGroup,defaultValue:!1},lhsId:{name:X$.lhsId},lhsInto:{name:X$.lhsInto,defaultValue:!1},rhsDir:{name:X$.rhsDir},rhsGroup:{name:X$.rhsGroup,defaultValue:!1},rhsId:{name:X$.rhsId},rhsInto:{name:X$.rhsInto,defaultValue:!1},title:{name:X$.title}},superTypes:[]},EmDataEntity:{name:Z$.$type,properties:{dataBlockValue:{name:Z$.dataBlockValue},dataType:{name:Z$.dataType},name:{name:Z$.name}},superTypes:[]},EmFrame:{name:Q$.$type,properties:{},superTypes:[]},EmGwt:{name:$$.$type,properties:{givenStatements:{name:$$.givenStatements,defaultValue:[]},sourceFrame:{name:$$.sourceFrame,referenceType:Q$.$type},thenStatements:{name:$$.thenStatements,defaultValue:[]},whenStatements:{name:$$.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:e1.$type,properties:{entityIdentifier:{name:e1.entityIdentifier,referenceType:t1.$type}},superTypes:[]},EmModelEntity:{name:t1.$type,properties:{name:{name:t1.name}},superTypes:[]},EmNoteEntity:{name:n1.$type,properties:{dataBlockValue:{name:n1.dataBlockValue},dataType:{name:n1.dataType},sourceFrame:{name:n1.sourceFrame,referenceType:Q$.$type}},superTypes:[]},EmResetFrame:{name:r1.$type,properties:{dataInlineValue:{name:r1.dataInlineValue},dataReference:{name:r1.dataReference,referenceType:Z$.$type},dataType:{name:r1.dataType},entityIdentifier:{name:r1.entityIdentifier},modelEntityType:{name:r1.modelEntityType},name:{name:r1.name},sourceFrames:{name:r1.sourceFrames,defaultValue:[],referenceType:Q$.$type}},superTypes:[Q$.$type]},EmTimeFrame:{name:i1.$type,properties:{dataInlineValue:{name:i1.dataInlineValue},dataReference:{name:i1.dataReference,referenceType:Z$.$type},dataType:{name:i1.dataType},entityIdentifier:{name:i1.entityIdentifier},modelEntityType:{name:i1.modelEntityType},name:{name:i1.name},sourceFrames:{name:i1.sourceFrames,defaultValue:[],referenceType:Q$.$type}},superTypes:[Q$.$type]},Entry:{name:a1.$type,properties:{axis:{name:a1.axis,referenceType:y$.$type},value:{name:a1.value}},superTypes:[]},EventModel:{name:o1.$type,properties:{accDescr:{name:o1.accDescr},accTitle:{name:o1.accTitle},dataEntities:{name:o1.dataEntities,defaultValue:[]},frames:{name:o1.frames,defaultValue:[]},gwtEntities:{name:o1.gwtEntities,defaultValue:[]},modelEntities:{name:o1.modelEntities,defaultValue:[]},noteEntities:{name:o1.noteEntities,defaultValue:[]},title:{name:o1.title}},superTypes:[]},Evolution:{name:s1.$type,properties:{stages:{name:s1.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:c1.$type,properties:{boundary:{name:c1.boundary},name:{name:c1.name},secondName:{name:c1.secondName}},superTypes:[]},Evolve:{name:l1.$type,properties:{component:{name:l1.component},target:{name:l1.target}},superTypes:[]},GitGraph:{name:u1.$type,properties:{accDescr:{name:u1.accDescr},accTitle:{name:u1.accTitle},statements:{name:u1.statements,defaultValue:[]},title:{name:u1.title}},superTypes:[]},Group:{name:d1.$type,properties:{icon:{name:d1.icon},id:{name:d1.id},in:{name:d1.in},title:{name:d1.title}},superTypes:[]},Info:{name:f1.$type,properties:{accDescr:{name:f1.accDescr},accTitle:{name:f1.accTitle},title:{name:f1.title}},superTypes:[]},Item:{name:p1.$type,properties:{classSelector:{name:p1.classSelector},name:{name:p1.name}},superTypes:[]},Junction:{name:m1.$type,properties:{id:{name:m1.id},in:{name:m1.in}},superTypes:[]},Label:{name:h1.$type,properties:{negX:{name:h1.negX,defaultValue:!1},negY:{name:h1.negY,defaultValue:!1},offsetX:{name:h1.offsetX},offsetY:{name:h1.offsetY}},superTypes:[]},Leaf:{name:g1.$type,properties:{classSelector:{name:g1.classSelector},name:{name:g1.name},value:{name:g1.value}},superTypes:[p1.$type]},Link:{name:_1.$type,properties:{arrow:{name:_1.arrow},from:{name:_1.from},fromPort:{name:_1.fromPort},linkLabel:{name:_1.linkLabel},to:{name:_1.to},toPort:{name:_1.toPort}},superTypes:[]},Merge:{name:v1.$type,properties:{branch:{name:v1.branch},id:{name:v1.id},tags:{name:v1.tags,defaultValue:[]},type:{name:v1.type}},superTypes:[t0.$type]},Note:{name:y1.$type,properties:{evolution:{name:y1.evolution},text:{name:y1.text},visibility:{name:y1.visibility}},superTypes:[]},Option:{name:b1.$type,properties:{name:{name:b1.name},value:{name:b1.value,defaultValue:!1}},superTypes:[]},Packet:{name:x1.$type,properties:{accDescr:{name:x1.accDescr},accTitle:{name:x1.accTitle},blocks:{name:x1.blocks,defaultValue:[]},title:{name:x1.title}},superTypes:[]},PacketBlock:{name:S1.$type,properties:{bits:{name:S1.bits},end:{name:S1.end},label:{name:S1.label},start:{name:S1.start}},superTypes:[]},PegAny:{name:C1.$type,properties:{dot:{name:C1.dot}},superTypes:[k1.$type]},PegGroup:{name:w1.$type,properties:{element:{name:w1.element}},superTypes:[k1.$type]},PegIdentifier:{name:T1.$type,properties:{name:{name:T1.name}},superTypes:[k1.$type]},PegLiteral:{name:E1.$type,properties:{value:{name:E1.value}},superTypes:[k1.$type]},PegOrderedChoice:{name:D1.$type,properties:{alternatives:{name:D1.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:O1.$type,properties:{operator:{name:O1.operator},suffix:{name:O1.suffix}},superTypes:[]},PegPrimary:{name:k1.$type,properties:{},superTypes:[]},PegRule:{name:A1.$type,properties:{definition:{name:A1.definition},name:{name:A1.name}},superTypes:[]},PegSequence:{name:j1.$type,properties:{elements:{name:j1.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:M1.$type,properties:{operator:{name:M1.operator},primary:{name:M1.primary}},superTypes:[]},Pie:{name:N1.$type,properties:{accDescr:{name:N1.accDescr},accTitle:{name:N1.accTitle},sections:{name:N1.sections,defaultValue:[]},showData:{name:N1.showData,defaultValue:!1},title:{name:N1.title}},superTypes:[]},PieSection:{name:P1.$type,properties:{label:{name:P1.label},value:{name:P1.value}},superTypes:[]},Pipeline:{name:F1.$type,properties:{components:{name:F1.components,defaultValue:[]},parent:{name:F1.parent}},superTypes:[]},PipelineComponent:{name:I1.$type,properties:{evolution:{name:I1.evolution},label:{name:I1.label},name:{name:I1.name}},superTypes:[]},Radar:{name:L1.$type,properties:{accDescr:{name:L1.accDescr},accTitle:{name:L1.accTitle},axes:{name:L1.axes,defaultValue:[]},curves:{name:L1.curves,defaultValue:[]},options:{name:L1.options,defaultValue:[]},title:{name:L1.title}},superTypes:[]},Railroad:{name:R1.$type,properties:{accDescr:{name:R1.accDescr},accTitle:{name:R1.accTitle},rules:{name:R1.rules,defaultValue:[]},title:{name:R1.title}},superTypes:[]},RailroadAbnf:{name:z1.$type,properties:{accDescr:{name:z1.accDescr},accTitle:{name:z1.accTitle},rules:{name:z1.rules,defaultValue:[]},title:{name:z1.title}},superTypes:[]},RailroadChoiceExpr:{name:B1.$type,properties:{alternatives:{name:B1.alternatives,defaultValue:[]}},superTypes:[H1.$type]},RailroadEbnf:{name:V1.$type,properties:{accDescr:{name:V1.accDescr},accTitle:{name:V1.accTitle},rules:{name:V1.rules,defaultValue:[]},title:{name:V1.title}},superTypes:[]},RailroadExpression:{name:H1.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:U1.$type,properties:{name:{name:U1.name}},superTypes:[H1.$type]},RailroadOneOrMoreExpr:{name:W1.$type,properties:{element:{name:W1.element}},superTypes:[H1.$type]},RailroadOptionalExpr:{name:G1.$type,properties:{element:{name:G1.element}},superTypes:[H1.$type]},RailroadPeg:{name:K1.$type,properties:{accDescr:{name:K1.accDescr},accTitle:{name:K1.accTitle},rules:{name:K1.rules,defaultValue:[]},title:{name:K1.title}},superTypes:[]},RailroadRule:{name:q1.$type,properties:{definition:{name:q1.definition},name:{name:q1.name}},superTypes:[]},RailroadSequenceExpr:{name:J1.$type,properties:{elements:{name:J1.elements,defaultValue:[]}},superTypes:[H1.$type]},RailroadSpecialExpr:{name:Y1.$type,properties:{text:{name:Y1.text}},superTypes:[H1.$type]},RailroadTerminalExpr:{name:X1.$type,properties:{value:{name:X1.value}},superTypes:[H1.$type]},RailroadZeroOrMoreExpr:{name:Z1.$type,properties:{element:{name:Z1.element}},superTypes:[H1.$type]},Section:{name:Q1.$type,properties:{classSelector:{name:Q1.classSelector},name:{name:Q1.name}},superTypes:[p1.$type]},Service:{name:$1.$type,properties:{icon:{name:$1.icon},iconText:{name:$1.iconText},id:{name:$1.id},in:{name:$1.in},title:{name:$1.title}},superTypes:[]},Size:{name:e0.$type,properties:{height:{name:e0.height},width:{name:e0.width}},superTypes:[]},Statement:{name:t0.$type,properties:{},superTypes:[]},Transition:{name:n0.$type,properties:{from:{name:n0.from},label:{name:n0.label},to:{name:n0.to}},superTypes:[]},TreeNode:{name:a0.$type,properties:{classAnnotation:{name:a0.classAnnotation},descAnnotation:{name:a0.descAnnotation},iconAnnotation:{name:a0.iconAnnotation},indent:{name:a0.indent},name:{name:a0.name}},superTypes:[]},TreeView:{name:o0.$type,properties:{accDescr:{name:o0.accDescr},accTitle:{name:o0.accTitle},nodes:{name:o0.nodes,defaultValue:[]},title:{name:o0.title}},superTypes:[]},Treemap:{name:r0.$type,properties:{accDescr:{name:r0.accDescr},accTitle:{name:r0.accTitle},title:{name:r0.title},TreemapRows:{name:r0.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:i0.$type,properties:{indent:{name:i0.indent},item:{name:i0.item}},superTypes:[]},Wardley:{name:s0.$type,properties:{accDescr:{name:s0.accDescr},accelerators:{name:s0.accelerators,defaultValue:[]},accTitle:{name:s0.accTitle},anchors:{name:s0.anchors,defaultValue:[]},annotation:{name:s0.annotation,defaultValue:[]},annotations:{name:s0.annotations,defaultValue:[]},components:{name:s0.components,defaultValue:[]},deaccelerators:{name:s0.deaccelerators,defaultValue:[]},evolution:{name:s0.evolution},evolves:{name:s0.evolves,defaultValue:[]},links:{name:s0.links,defaultValue:[]},notes:{name:s0.notes,defaultValue:[]},pipelines:{name:s0.pipelines,defaultValue:[]},size:{name:s0.size},title:{name:s0.title}},superTypes:[]}}}static{Q(this,`MermaidAstReflection`)}},l0=new c0,Tet=Q(()=>wet??=GH(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"alignments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Alignment","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"align"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"row"},{"$type":"Keyword","value":"column"}]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@20"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[^\\\\[\\\\]\\\\r\\\\n]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`),`ArchitectureGrammarGrammar`),Det=Q(()=>Eet??=GH(`{"$type":"Grammar","isDeclared":true,"name":"CynefinGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Cynefin","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"cynefin-beta"},{"$type":"Keyword","value":"cynefin-beta:"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"domains","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"transitions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"domain","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainItem","definition":{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Transition","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":"-->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"DOMAIN_NAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complex"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complicated"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"clear"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"chaotic"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"confusion"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`),`CynefinGrammarGrammar`),ket=Q(()=>Oet??=GH('{"$type":"Grammar","isDeclared":true,"name":"EventModeling","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","entry":true,"name":"EventModel","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"eventmodeling"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"frames","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"dataEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"noteEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"gwtEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntityType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rmo"},{"$type":"Keyword","value":"readmodel"},{"$type":"Keyword","value":"ui"},{"$type":"Keyword","value":"cmd"},{"$type":"Keyword","value":"command"},{"$type":"Keyword","value":"evt"},{"$type":"Keyword","value":"event"},{"$type":"Keyword","value":"pcr"},{"$type":"Keyword","value":"processor"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"json"},{"$type":"Keyword","value":"jsobj"},{"$type":"Keyword","value":"figma"},{"$type":"Keyword","value":"salt"},{"$type":"Keyword","value":"uri"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"html"},{"$type":"Keyword","value":"text"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataInline","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataInlineValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataBlock","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataBlockValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmTimeFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"tf"},{"$type":"Keyword","value":"timeframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmResetFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rf"},{"$type":"Keyword","value":"resetframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmFrame","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"entity"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"data"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmNoteEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"note"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwt","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"gwt"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"given"},{"$type":"Assignment","feature":"givenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Keyword","value":"when"},{"$type":"Assignment","feature":"whenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"then"},{"$type":"Assignment","feature":"thenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwtStatement","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@9"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_EID","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_FI","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"EM_ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_FID","definition":{"$type":"RegexToken","regex":"/\\\\d{1,3}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_INLINE","definition":{"$type":"RegexToken","regex":"/\\\\{(.*)\\\\}|\\"(.*)\\"|\'(.*)\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_BLOCK","definition":{"$type":"RegexToken","regex":"/\\\\{[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?\\\\}(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EM_WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"imports":[],"types":[]}'),`EventModelingGrammar`),jet=Q(()=>Aet??=GH(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`),`GitGraphGrammarGrammar`),Net=Q(()=>Met??=GH(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`),`InfoGrammarGrammar`),Fet=Q(()=>Pet??=GH(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`),`PacketGrammarGrammar`),Let=Q(()=>Iet??=GH(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`),`PieGrammarGrammar`),zet=Q(()=>Ret??=GH(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`),`RadarGrammarGrammar`),Vet=Q(()=>Bet??=GH(`{"$type":"Grammar","isDeclared":true,"name":"RailroadAbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_RULENAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Za-z][A-Za-z0-9-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_NUMVAL","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\\\\.[0-9A-Fa-f]+)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]*\\\\*[0-9]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_EXACT_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_COMMENT","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadAbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-abnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfAlternation","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfConcatenation","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfElement","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfStringLiteral","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfNumVal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRuleName","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfOptionalGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadAbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfAlternation","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfConcatenation","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfElement","attributes":[{"$type":"TypeAttribute","name":"repeat","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"AbnfStringLiteral","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfNumVal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfRuleName","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"AbnfOptionalGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]}],"imports":[],"types":[]}`),`RailroadAbnfGrammarGrammar`),Uet=Q(()=>Het??=GH(`{"$type":"Grammar","isDeclared":true,"name":"RailroadEbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_SPECIAL_SEQUENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\?(?=[^?;]*[^?\\\\s;][^?;]*\\\\?)[^?;]*\\\\?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_ISO_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\(\\\\*[\\\\s\\\\S]*?\\\\*\\\\)/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadEbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-ebnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"::="}]},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":",","cardinality":"?"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerm","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"base","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"postfixes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerminal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfNonTerminal","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSpecial","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptional","returnType":{"$ref":"#/interfaces@11"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRepetition","returnType":{"$ref":"#/interfaces@12"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPostfix","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptionalPostfix","returnType":{"$ref":"#/interfaces@13"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfZeroOrMorePostfix","returnType":{"$ref":"#/interfaces@14"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOneOrMorePostfix","returnType":{"$ref":"#/interfaces@15"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfExceptionPostfix","returnType":{"$ref":"#/interfaces@16"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"except","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadEbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfTerm","attributes":[{"$type":"TypeAttribute","name":"base","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false},{"$type":"TypeAttribute","name":"postfixes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfPostfix","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfNonTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfSpecial","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptional","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfRepetition","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptionalPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfZeroOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfOneOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfExceptionPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"except","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}]}],"imports":[],"types":[]}`),`RailroadEbnfGrammarGrammar`),Get=Q(()=>Wet??=GH(`{"$type":"Grammar","isDeclared":true,"name":"RailroadGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"RR_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Railroad","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadExpression","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSequenceExpr","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"sequence"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadChoiceExpr","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"choice"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOptionalExpr","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"optional"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOneOrMoreExpr","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"oneOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadZeroOrMoreExpr","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"zeroOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadTerminalExpr","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"terminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadNonTerminalExpr","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"nonterminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSpecialExpr","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"special"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"Railroad","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadExpression","attributes":[],"superTypes":[]},{"$type":"Interface","name":"RailroadSequenceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadChoiceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOptionalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOneOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadZeroOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadNonTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadSpecialExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`),`RailroadGrammarGrammar`),qet=Q(()=>Ket??=GH(`{"$type":"Grammar","isDeclared":true,"name":"RailroadPegGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/#[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadPeg","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-peg-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"<-"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegOrderedChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrefix","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"&"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"!"}}],"cardinality":"?"},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSuffix","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrimary","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegLiteral","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegIdentifier","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegAny","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Assignment","feature":"dot","operator":"=","terminal":{"$type":"Keyword","value":"."}},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadPeg","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegOrderedChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegPrefix","attributes":[{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"suffix","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSuffix","attributes":[{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}},"isOptional":false},{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"PegPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"PegLiteral","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegIdentifier","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegGroup","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"PegAny","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"dot","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`),`RailroadPegGrammarGrammar`),Yet=Q(()=>Jet??=GH(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`),`TreemapGrammarGrammar`),Zet=Q(()=>Xet??=GH(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"CLASS_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+:::[ \\\\t]*[A-Za-z_][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ICON_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+icon\\\\([\\\\w-]*(?::[\\\\w-]+)?\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DESC_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+##[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"QUOTED_NAME","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"BARE_NAME","definition":{"$type":"RegexToken","regex":"/(?!:::|icon\\\\(|##)[^ \\\\t\\\\n\\\\r\\"'](?:(?![ \\\\t]+:::[ \\\\t]*[A-Za-z_]|[ \\\\t]+icon\\\\(|[ \\\\t]+##)[^\\\\n\\\\r])*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"classAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"iconAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"descAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n *\\n * Supports both quoted labels (\\"my file\\") and bare labels (index.js).\\n * Annotations (:::class, icon(), ## description) are parsed directly into\\n * AST fields by the grammar. Value conversion for stripping quotes, extracting\\n * class names, icon names, and description text happens in valueConverter.ts.\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treeView keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`),`TreeViewGrammarGrammar`),$et=Q(()=>Qet??=GH(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'</","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'>/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \\\\t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`),`WardleyGrammarGrammar`),ett={languageId:`architecture`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},ttt={languageId:`cynefin`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},ntt={languageId:`eventmodeling`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},rtt={languageId:`gitGraph`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},itt={languageId:`info`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},att={languageId:`packet`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},ott={languageId:`pie`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},stt={languageId:`radar`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},ctt={languageId:`railroadAbnf`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},ltt={languageId:`railroadEbnf`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},utt={languageId:`railroad`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},dtt={languageId:`railroadPeg`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},ftt={languageId:`treemap`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},ptt={languageId:`treeView`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},mtt={languageId:`wardley`,fileExtensions:[`.mmd`,`.mermaid`],caseInsensitive:!1,mode:`production`},u0={AstReflection:Q(()=>new c0,`AstReflection`)},htt={Grammar:Q(()=>Tet(),`Grammar`),LanguageMetaData:Q(()=>ett,`LanguageMetaData`),parser:{}},gtt={Grammar:Q(()=>Det(),`Grammar`),LanguageMetaData:Q(()=>ttt,`LanguageMetaData`),parser:{}},_tt={Grammar:Q(()=>ket(),`Grammar`),LanguageMetaData:Q(()=>ntt,`LanguageMetaData`),parser:{}},vtt={Grammar:Q(()=>jet(),`Grammar`),LanguageMetaData:Q(()=>rtt,`LanguageMetaData`),parser:{}},ytt={Grammar:Q(()=>Net(),`Grammar`),LanguageMetaData:Q(()=>itt,`LanguageMetaData`),parser:{}},btt={Grammar:Q(()=>Fet(),`Grammar`),LanguageMetaData:Q(()=>att,`LanguageMetaData`),parser:{}},xtt={Grammar:Q(()=>Let(),`Grammar`),LanguageMetaData:Q(()=>ott,`LanguageMetaData`),parser:{}},Stt={Grammar:Q(()=>zet(),`Grammar`),LanguageMetaData:Q(()=>stt,`LanguageMetaData`),parser:{}},Ctt={Grammar:Q(()=>Vet(),`Grammar`),LanguageMetaData:Q(()=>ctt,`LanguageMetaData`),parser:{}},wtt={Grammar:Q(()=>Uet(),`Grammar`),LanguageMetaData:Q(()=>ltt,`LanguageMetaData`),parser:{}},Ttt={Grammar:Q(()=>Get(),`Grammar`),LanguageMetaData:Q(()=>utt,`LanguageMetaData`),parser:{}},Ett={Grammar:Q(()=>qet(),`Grammar`),LanguageMetaData:Q(()=>dtt,`LanguageMetaData`),parser:{}},Dtt={Grammar:Q(()=>Yet(),`Grammar`),LanguageMetaData:Q(()=>ftt,`LanguageMetaData`),parser:{}},Ott={Grammar:Q(()=>Zet(),`Grammar`),LanguageMetaData:Q(()=>ptt,`LanguageMetaData`),parser:{}},ktt={Grammar:Q(()=>$et(),`Grammar`),LanguageMetaData:Q(()=>mtt,`LanguageMetaData`),parser:{}},Att={ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/accTitle[\t ]*:([^\n\r]*)/,TITLE:/title([\t ][^\n\r]*|)/},d0=class extends VZ{static{Q(this,`AbstractMermaidValueConverter`)}runConverter(e,t,n){let r=this.runCommonConverter(e,t,n);return r===void 0&&(r=this.runCustomConverter(e,t,n)),r===void 0?super.runConverter(e,t,n):r}runCommonConverter(e,t,n){let r=Att[e.name];if(r===void 0)return;let i=r.exec(t);if(i!==null){if(i[1]!==void 0)return i[1].trim().replace(/[\t ]{2,}/gm,` `);if(i[2]!==void 0)return i[2].replace(/^\s*/gm,``).replace(/\s+$/gm,``).replace(/[\t ]{2,}/gm,` `).replace(/[\n\r]{2,}/gm,`1364+`)}}},f0=class extends d0{static{Q(this,`CommonValueConverter`)}runCustomConverter(e,t,n){}},p0=class extends BZ{static{Q(this,`AbstractMermaidTokenBuilder`)}constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,t,n){let r=super.buildKeywordTokens(e,t,n);return r.forEach(e=>{this.keywords.has(e.name)&&e.PATTERN!==void 0&&(e.PATTERN=RegExp(e.PATTERN.toString()+`(?:(?=%%)|(?!\\S))`))}),r}},class extends p0{static{Q(this,`CommonTokenBuilder`)}}}));function jtt(e=t$){let t=BH(zH(e),u0),n=BH(RH({shared:t}),Stt,h0);return t.ServiceRegistry.register(n),{shared:t,Radar:n}}var Mtt,h0,Ntt=o((()=>{m0(),Mtt=class extends p0{static{Q(this,`RadarTokenBuilder`)}constructor(){super([`radar-beta`])}},h0={parser:{TokenBuilder:Q(()=>new Mtt,`TokenBuilder`),ValueConverter:Q(()=>new f0,`ValueConverter`)}},Q(jtt,`createRadarServices`)}));function g0(e=t$){let t=BH(zH(e),u0),n=BH(RH({shared:t}),Ttt,v0);return t.ServiceRegistry.register(n),{shared:t,Railroad:n}}var Ptt,_0,Ftt,v0,Itt=o((()=>{m0(),Ptt=class extends p0{static{Q(this,`RailroadTokenBuilder`)}constructor(){super([`railroad-beta`])}},_0=Q(e=>{let t=e.slice(1,-1),n=``;for(let e=0;e<t.length;e++){let r=t[e];if(r===`\\`&&e+1<t.length){e++;let r=t[e];switch(r){case`n`:n+=`1365+`;break;case`r`:n+=`\r`;break;case`t`:n+=` `;break;default:n+=r}continue}n+=r}return n},`decodeEscapedString`),Ftt=class extends d0{static{Q(this,`RailroadValueConverter`)}runConverter(e,t,n){let r=super.runConverter(e,t,n);if(e.name===`TITLE`&&typeof r==`string`){let e=r.trim();if(e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`))return _0(e)}return r}runCustomConverter(e,t,n){if(e.name===`RR_STRING`)return _0(t)}},v0={parser:{TokenBuilder:Q(()=>new Ptt,`TokenBuilder`),ValueConverter:Q(()=>new Ftt,`ValueConverter`)}},Q(g0,`createRailroadServices`)}));function y0(e=t$){let t=BH(zH(e),u0),n=BH(RH({shared:t}),wtt,x0);return t.ServiceRegistry.register(n),{shared:t,RailroadEbnf:n}}var Ltt,b0,Rtt,x0,ztt=o((()=>{m0(),Ltt=class extends p0{static{Q(this,`RailroadEbnfTokenBuilder`)}constructor(){super([`railroad-ebnf-beta`])}},b0=Q(e=>{let t=e.slice(1,-1),n=``;for(let e=0;e<t.length;e++){let r=t[e];if(r===`\\`&&e+1<t.length){e++;let r=t[e];switch(r){case`n`:n+=`1366+`;break;case`r`:n+=`\r`;break;case`t`:n+=` `;break;default:n+=r}continue}n+=r}return n},`decodeEscapedString`),Rtt=class extends d0{static{Q(this,`RailroadEbnfValueConverter`)}runConverter(e,t,n){let r=super.runConverter(e,t,n);if(e.name===`TITLE`&&typeof r==`string`){let e=r.trim();if(e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`))return b0(e)}return r}runCustomConverter(e,t,n){if(e.name===`EBNF_STRING`)return b0(t);if(e.name===`EBNF_SPECIAL_SEQUENCE`)return t.slice(1,-1).trim()}},x0={parser:{TokenBuilder:Q(()=>new Ltt,`TokenBuilder`),ValueConverter:Q(()=>new Rtt,`ValueConverter`)}},Q(y0,`createRailroadEbnfServices`)}));function S0(e=t$){let t=BH(zH(e),u0),n=BH(RH({shared:t}),Ctt,C0);return t.ServiceRegistry.register(n),{shared:t,RailroadAbnf:n}}var Btt,Vtt,C0,Htt=o((()=>{m0(),Btt=class extends p0{static{Q(this,`RailroadAbnfTokenBuilder`)}constructor(){super([`railroad-abnf-beta`])}},Vtt=class extends d0{static{Q(this,`RailroadAbnfValueConverter`)}runConverter(e,t,n){let r=super.runConverter(e,t,n);if(e.name===`TITLE`&&typeof r==`string`){let e=r.trim();if(e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`))return e.slice(1,-1)}return r}runCustomConverter(e,t,n){if(e.name===`ABNF_STRING`)return t.slice(1,-1)}},C0={parser:{TokenBuilder:Q(()=>new Btt,`TokenBuilder`),ValueConverter:Q(()=>new Vtt,`ValueConverter`)}},Q(S0,`createRailroadAbnfServices`)}));function w0(e=t$){let t=BH(zH(e),u0),n=BH(RH({shared:t}),Ett,E0);return t.ServiceRegistry.register(n),{shared:t,RailroadPeg:n}}var Utt,T0,Wtt,E0,Gtt=o((()=>{m0(),Utt=class extends p0{static{Q(this,`RailroadPegTokenBuilder`)}constructor(){super([`railroad-peg-beta`])}},T0=Q(e=>{let t=e.slice(1,-1),n=``;for(let e=0;e<t.length;e++){let r=t[e];if(r===`\\`&&e+1<t.length){e++;let r=t[e];switch(r){case`n`:n+=`1367+`;break;case`r`:n+=`\r`;break;case`t`:n+=` `;break;default:n+=r}continue}n+=r}return n},`decodeEscapedString`),Wtt=class extends d0{static{Q(this,`RailroadPegValueConverter`)}runConverter(e,t,n){let r=super.runConverter(e,t,n);if(e.name===`TITLE`&&typeof r==`string`){let e=r.trim();if(e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`))return T0(e)}return r}runCustomConverter(e,t,n){if(e.name===`PEG_STRING`)return T0(t)}},E0={parser:{TokenBuilder:Q(()=>new Utt,`TokenBuilder`),ValueConverter:Q(()=>new Wtt,`ValueConverter`)}},Q(w0,`createRailroadPegServices`)}));function Ktt(e){let t=e.validation.TreemapValidator,n=e.validation.ValidationRegistry;if(n){let e={Treemap:t.checkSingleRoot.bind(t)};n.register(e,t)}}function qtt(e=t$){let t=BH(zH(e),u0),n=BH(RH({shared:t}),Dtt,D0);return t.ServiceRegistry.register(n),Ktt(n),{shared:t,Treemap:n}}var Jtt,Ytt,Xtt,Ztt,D0,Qtt=o((()=>{m0(),Jtt=class extends p0{static{Q(this,`TreemapTokenBuilder`)}constructor(){super([`treemap`])}},Ytt=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,Xtt=class extends d0{static{Q(this,`TreemapValueConverter`)}runCustomConverter(e,t,n){if(e.name===`NUMBER2`)return parseFloat(t.replace(/,/g,``));if(e.name===`SEPARATOR`||e.name===`STRING2`)return t.substring(1,t.length-1);if(e.name===`INDENTATION`)return t.length;if(e.name===`ClassDef`){if(typeof t!=`string`)return t;let e=Ytt.exec(t);if(e)return{$type:`ClassDefStatement`,className:e[1],styleText:e[2]||void 0}}}},Q(Ktt,`registerValidationChecks`),Ztt=class{static{Q(this,`TreemapValidator`)}checkSingleRoot(e,t){let n;for(let r of e.TreemapRows)r.item&&(n===void 0&&r.indent===void 0?n=0:(r.indent===void 0||n!==void 0&&n>=parseInt(r.indent,10))&&t(`error`,`Multiple root nodes are not allowed in a treemap.`,{node:r,property:`item`}))}},D0={parser:{TokenBuilder:Q(()=>new Jtt,`TokenBuilder`),ValueConverter:Q(()=>new Xtt,`ValueConverter`)},validation:{TreemapValidator:Q(()=>new Ztt,`TreemapValidator`)}},Q(qtt,`createTreemapServices`)}));function $tt(e=t$){let t=BH(zH(e),u0),n=BH(RH({shared:t}),ktt,O0);return t.ServiceRegistry.register(n),{shared:t,Wardley:n}}var ent,O0,tnt=o((()=>{m0(),ent=class extends d0{static{Q(this,`WardleyValueConverter`)}runCustomConverter(e,t,n){switch(e.name.toUpperCase()){case`LINK_LABEL`:return t.substring(1).trim();default:return}}},O0={parser:{ValueConverter:Q(()=>new ent,`ValueConverter`)}},Q($tt,`createWardleyServices`)}));function nnt(e=t$){let t=BH(zH(e),u0),n=BH(RH({shared:t}),gtt,k0);return t.ServiceRegistry.register(n),{shared:t,Cynefin:n}}var rnt,k0,int=o((()=>{m0(),rnt=class extends p0{static{Q(this,`CynefinTokenBuilder`)}constructor(){super([`cynefin-beta`])}},k0={parser:{TokenBuilder:Q(()=>new rnt,`TokenBuilder`),ValueConverter:Q(()=>new f0,`ValueConverter`)}},Q(nnt,`createCynefinServices`)}));function ant(e=t$){let t=BH(zH(e),u0),n=BH(RH({shared:t}),vtt,A0);return t.ServiceRegistry.register(n),{shared:t,GitGraph:n}}var ont,A0,snt=o((()=>{m0(),ont=class extends p0{static{Q(this,`GitGraphTokenBuilder`)}constructor(){super([`gitGraph`])}},A0={parser:{TokenBuilder:Q(()=>new ont,`TokenBuilder`),ValueConverter:Q(()=>new f0,`ValueConverter`)}},Q(ant,`createGitGraphServices`)}));function cnt(e=t$){let t=BH(zH(e),u0),n=BH(RH({shared:t}),ytt,j0);return t.ServiceRegistry.register(n),{shared:t,Info:n}}var lnt,j0,unt=o((()=>{m0(),lnt=class extends p0{static{Q(this,`InfoTokenBuilder`)}constructor(){super([`info`,`showInfo`])}},j0={parser:{TokenBuilder:Q(()=>new lnt,`TokenBuilder`),ValueConverter:Q(()=>new f0,`ValueConverter`)}},Q(cnt,`createInfoServices`)}));function dnt(e=t$){let t=BH(zH(e),u0),n=BH(RH({shared:t}),btt,M0);return t.ServiceRegistry.register(n),{shared:t,Packet:n}}var fnt,M0,pnt=o((()=>{m0(),fnt=class extends p0{static{Q(this,`PacketTokenBuilder`)}constructor(){super([`packet`])}},M0={parser:{TokenBuilder:Q(()=>new fnt,`TokenBuilder`),ValueConverter:Q(()=>new f0,`ValueConverter`)}},Q(dnt,`createPacketServices`)}));function mnt(e=t$){let t=BH(zH(e),u0),n=BH(RH({shared:t}),xtt,N0);return t.ServiceRegistry.register(n),{shared:t,Pie:n}}var hnt,gnt,N0,_nt=o((()=>{m0(),hnt=class extends p0{static{Q(this,`PieTokenBuilder`)}constructor(){super([`pie`,`showData`])}},gnt=class extends d0{static{Q(this,`PieValueConverter`)}runCustomConverter(e,t,n){if(e.name===`PIE_SECTION_LABEL`)return t.replace(/"/g,``).trim()}},N0={parser:{TokenBuilder:Q(()=>new hnt,`TokenBuilder`),ValueConverter:Q(()=>new gnt,`ValueConverter`)}},Q(mnt,`createPieServices`)}));function vnt(e=t$){let t=BH(zH(e),u0),n=BH(RH({shared:t}),Ott,P0);return t.ServiceRegistry.register(n),{shared:t,TreeView:n}}var ynt,bnt,P0,xnt=o((()=>{m0(),ynt=class extends d0{static{Q(this,`TreeViewValueConverter`)}runCustomConverter(e,t,n){if(e.name===`INDENTATION`)return t?.length||0;if(e.name===`QUOTED_NAME`)return t.substring(1,t.length-1);if(e.name===`BARE_NAME`)return t.replace(/[\t ]+$/,``);if(e.name===`CLASS_ANNOTATION`)return t.trim().substring(3).trim();if(e.name===`ICON_ANNOTATION`){let e=t.trim();return e.substring(5,e.length-1)}if(e.name===`DESC_ANNOTATION`)return t.trim().substring(2).trim()}},bnt=class extends p0{static{Q(this,`TreeViewTokenBuilder`)}constructor(){super([`treeView-beta`])}},P0={parser:{TokenBuilder:Q(()=>new bnt,`TokenBuilder`),ValueConverter:Q(()=>new ynt,`ValueConverter`)}},Q(vnt,`createTreeViewServices`)}));function Snt(e=t$){let t=BH(zH(e),u0),n=BH(RH({shared:t}),htt,F0);return t.ServiceRegistry.register(n),{shared:t,Architecture:n}}var Cnt,wnt,F0,Tnt=o((()=>{m0(),Cnt=class extends p0{static{Q(this,`ArchitectureTokenBuilder`)}constructor(){super([`architecture`])}},wnt=class extends d0{static{Q(this,`ArchitectureValueConverter`)}runCustomConverter(e,t,n){if(e.name===`ARCH_ICON`)return t.replace(/[()]/g,``).trim();if(e.name===`ARCH_TEXT_ICON`)return t.replace(/["()]/g,``);if(e.name===`ARCH_TITLE`){let e=t.replace(/^\[|]$/g,``).trim();return(e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`))&&(e=e.slice(1,-1),e=e.replace(/\\"/g,`"`).replace(/\\'/g,`'`)),e.trim()}}},F0={parser:{TokenBuilder:Q(()=>new Cnt,`TokenBuilder`),ValueConverter:Q(()=>new wnt,`ValueConverter`)}},Q(Snt,`createArchitectureServices`)}));function Ent(e){let t=e.validation.EventModelingValidator,n=e.validation.ValidationRegistry;if(n){let e={EmTimeFrame:t.checkSourceFrameTypes.bind(t),EmResetFrame:t.checkSourceFrameTypes.bind(t)};n.register(e,t)}}function Dnt(e=t$){let t=BH(zH(e),u0),n=BH(RH({shared:t}),_tt,V0);return t.ServiceRegistry.register(n),Ent(n),{shared:t,EventModel:n}}var Ont,I0,L0,R0,z0,B0,knt,V0,Ant=o((()=>{m0(),Ont=class extends p0{static{Q(this,`EventModelingTokenBuilder`)}constructor(){super([`eventmodeling`])}},I0=new Set([`cmd`,`command`]),L0=new Set([`evt`,`event`]),R0=new Set([`rmo`,`readmodel`]),z0=new Set([`pcr`,`processor`]),B0=new Set([`ui`]),Q(Ent,`registerValidationChecks`),knt=class{static{Q(this,`EventModelingValidator`)}checkSourceFrameTypes(e,t){e.sourceFrames.length!==0&&(I0.has(e.modelEntityType)?this.validateSources(e,new Set([...B0,...z0]),`command`,`ui or processor`,t):L0.has(e.modelEntityType)?this.validateSources(e,I0,`event`,`command`,t):R0.has(e.modelEntityType)?this.validateSources(e,L0,`read model`,`event`,t):z0.has(e.modelEntityType)?this.validateSources(e,R0,`processor`,`read model`,t):B0.has(e.modelEntityType)&&this.validateSources(e,R0,`ui`,`read model`,t))}validateSources(e,t,n,r,i){for(let a of e.sourceFrames){let o=a.ref;o!==void 0&&!t.has(o.modelEntityType)&&i(`error`,`A ${n} can only receive input from a ${r}, not from '${o.modelEntityType}'.`,{node:e,property:`sourceFrames`})}}},V0={parser:{TokenBuilder:Q(()=>new Ont,`TokenBuilder`),ValueConverter:Q(()=>new f0,`ValueConverter`)},validation:{EventModelingValidator:Q(()=>new knt,`EventModelingValidator`)}},Q(Dnt,`createEventModelingServices`)})),jnt=l({InfoModule:()=>j0,createInfoServices:()=>cnt}),Mnt=o((()=>{unt(),m0()})),Nnt=l({PacketModule:()=>M0,createPacketServices:()=>dnt}),Pnt=o((()=>{pnt(),m0()})),Fnt=l({PieModule:()=>N0,createPieServices:()=>mnt}),Int=o((()=>{_nt(),m0()})),Lnt=l({TreeViewModule:()=>P0,createTreeViewServices:()=>vnt}),Rnt=o((()=>{xnt(),m0()})),znt=l({ArchitectureModule:()=>F0,createArchitectureServices:()=>Snt}),Bnt=o((()=>{Tnt(),m0()})),Vnt=l({GitGraphModule:()=>A0,createGitGraphServices:()=>ant}),Hnt=o((()=>{snt(),m0()})),Unt=l({EventModelingModule:()=>V0,createEventModelingServices:()=>Dnt}),Wnt=o((()=>{Ant(),m0()})),Gnt=l({RadarModule:()=>h0,createRadarServices:()=>jtt}),Knt=o((()=>{Ntt(),m0()})),qnt=l({RailroadModule:()=>v0,createRailroadServices:()=>g0}),Jnt=o((()=>{Itt(),m0()})),Ynt=l({RailroadEbnfModule:()=>x0,createRailroadEbnfServices:()=>y0}),Xnt=o((()=>{ztt(),m0()})),Znt=l({RailroadAbnfModule:()=>C0,createRailroadAbnfServices:()=>S0}),Qnt=o((()=>{Htt(),m0()})),$nt=l({RailroadPegModule:()=>E0,createRailroadPegServices:()=>w0}),ert=o((()=>{Gtt(),m0()})),trt=l({TreemapModule:()=>D0,createTreemapServices:()=>qtt}),nrt=o((()=>{Qtt(),m0()})),rrt=l({WardleyModule:()=>O0,createWardleyServices:()=>$tt}),irt=o((()=>{tnt(),m0()})),art=l({CynefinModule:()=>k0,createCynefinServices:()=>nnt}),ort=o((()=>{int(),m0()}));async function H0(e,t){let n=srt[e];if(!n)throw Error(`Unknown diagram type: ${e}`);U0[e]||await n();let r=U0[e].parse(t);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new W0(r);return r.value}var U0,srt,W0,G0=o((()=>{Ntt(),Itt(),ztt(),Htt(),Gtt(),Qtt(),tnt(),int(),snt(),unt(),pnt(),_nt(),xnt(),Tnt(),Ant(),m0(),U0={},srt={info:Q(async()=>{let{createInfoServices:e}=await Promise.resolve().then(()=>(Mnt(),jnt));U0.info=e().Info.parser.LangiumParser},`info`),packet:Q(async()=>{let{createPacketServices:e}=await Promise.resolve().then(()=>(Pnt(),Nnt));U0.packet=e().Packet.parser.LangiumParser},`packet`),pie:Q(async()=>{let{createPieServices:e}=await Promise.resolve().then(()=>(Int(),Fnt));U0.pie=e().Pie.parser.LangiumParser},`pie`),treeView:Q(async()=>{let{createTreeViewServices:e}=await Promise.resolve().then(()=>(Rnt(),Lnt));U0.treeView=e().TreeView.parser.LangiumParser},`treeView`),architecture:Q(async()=>{let{createArchitectureServices:e}=await Promise.resolve().then(()=>(Bnt(),znt));U0.architecture=e().Architecture.parser.LangiumParser},`architecture`),gitGraph:Q(async()=>{let{createGitGraphServices:e}=await Promise.resolve().then(()=>(Hnt(),Vnt));U0.gitGraph=e().GitGraph.parser.LangiumParser},`gitGraph`),eventmodeling:Q(async()=>{let{createEventModelingServices:e}=await Promise.resolve().then(()=>(Wnt(),Unt));U0.eventmodeling=e().EventModel.parser.LangiumParser},`eventmodeling`),radar:Q(async()=>{let{createRadarServices:e}=await Promise.resolve().then(()=>(Knt(),Gnt));U0.radar=e().Radar.parser.LangiumParser},`radar`),railroad:Q(async()=>{let{createRailroadServices:e}=await Promise.resolve().then(()=>(Jnt(),qnt));U0.railroad=e().Railroad.parser.LangiumParser},`railroad`),railroadEbnf:Q(async()=>{let{createRailroadEbnfServices:e}=await Promise.resolve().then(()=>(Xnt(),Ynt));U0.railroadEbnf=e().RailroadEbnf.parser.LangiumParser},`railroadEbnf`),railroadAbnf:Q(async()=>{let{createRailroadAbnfServices:e}=await Promise.resolve().then(()=>(Qnt(),Znt));U0.railroadAbnf=e().RailroadAbnf.parser.LangiumParser},`railroadAbnf`),railroadPeg:Q(async()=>{let{createRailroadPegServices:e}=await Promise.resolve().then(()=>(ert(),$nt));U0.railroadPeg=e().RailroadPeg.parser.LangiumParser},`railroadPeg`),treemap:Q(async()=>{let{createTreemapServices:e}=await Promise.resolve().then(()=>(nrt(),trt));U0.treemap=e().Treemap.parser.LangiumParser},`treemap`),wardley:Q(async()=>{let{createWardleyServices:e}=await Promise.resolve().then(()=>(irt(),rrt));U0.wardley=e().Wardley.parser.LangiumParser},`wardley`),cynefin:Q(async()=>{let{createCynefinServices:e}=await Promise.resolve().then(()=>(ort(),art));U0.cynefin=e().Cynefin.parser.LangiumParser},`cynefin`)},Q(H0,`parse`),W0=class extends Error{constructor(e){let t=e.lexerErrors.map(e=>`Lexer error on line ${e.line!==void 0&&!isNaN(e.line)?e.line:`?`}, column ${e.column!==void 0&&!isNaN(e.column)?e.column:`?`}: ${e.message}`).join(`1368+`),n=e.parserErrors.map(e=>`Parse error on line ${e.token.startLine!==void 0&&!isNaN(e.token.startLine)?e.token.startLine:`?`}, column ${e.token.startColumn!==void 0&&!isNaN(e.token.startColumn)?e.token.startColumn:`?`}: ${e.message}`).join(`1369+`);super(`Parsing failed: ${t} ${n}`),this.result=e}static{Q(this,`MermaidParseError`)}}})),crt=l({diagram:()=>iit});function K0(){return Ym({length:7})}function lrt(e,t){let n=Object.create(null);return e.reduce((e,r)=>{let i=t(r);return n[i]||(n[i]=!0,e.push(r)),e},[])}function q0(e,t,n){let r=e.indexOf(t);r===-1?e.push(n):e.splice(r,1,n)}function J0(e){let t=e.reduce((e,t)=>e.seq>t.seq?e:t,e[0]),n=``;e.forEach(function(e){n+=e===t?` *`:` |`});let r=[n,t.id,t.seq];for(let e in Z0.records.branches)Z0.records.branches.get(e)===t.id&&r.push(e);if(y.debug(r.join(` `)),t.parents&&t.parents.length==2&&t.parents[0]&&t.parents[1]){let n=Z0.records.commits.get(t.parents[0]);q0(e,t,n),t.parents[1]&&e.push(Z0.records.commits.get(t.parents[1]))}else if(t.parents.length==0)return;else if(t.parents[0]){let n=Z0.records.commits.get(t.parents[0]);q0(e,t,n)}e=lrt(e,e=>e.id),J0(e)}var Y0,urt,X0,Z0,drt,frt,prt,mrt,hrt,grt,_rt,Q0,vrt,yrt,brt,xrt,Srt,$0,e2,Crt,wrt,Trt,Ert,Drt,Ort,krt,Art,t2,n2,r2,i2,a2,o2,s2,c2,jrt,l2,u2,d2,f2,p2,m2,h2,g2,Mrt,_2,v2,Nrt,Prt,Frt,Irt,Lrt,Rrt,zrt,Brt,Vrt,Hrt,Urt,Wrt,y2,Grt,b2,Krt,qrt,Jrt,Yrt,Xrt,x2,S2,Zrt,Qrt,$rt,eit,tit,nit,rit,iit,ait=o((()=>{sR(),lR(),rh(),dc(),S(),h(),G0(),_p(),Y0={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},urt=ns.gitGraph,X0=p(()=>Hm({...urt,...ms().gitGraph}),`getConfig`),Z0=new oR(()=>{let e=X0(),t=e.mainBranchName,n=e.mainBranchOrder;return{mainBranchName:t,commits:new Map,head:null,branchConfig:new Map([[t,{name:t,order:n}]]),branches:new Map([[t,null]]),currBranch:t,direction:`LR`,seq:0,options:{}}}),p(K0,`getID`),p(lrt,`uniqBy`),drt=p(function(e){Z0.records.direction=e},`setDirection`),frt=p(function(e){y.debug(`options str`,e),e=e?.trim(),e||=`{}`;try{Z0.records.options=JSON.parse(e)}catch(e){y.error(`error while parsing gitGraph options`,e.message)}},`setOptions`),prt=p(function(){return Z0.records.options},`getOptions`),mrt=p(function(e){let t=e.msg,n=e.id,r=e.type,i=e.tags;y.info(`commit`,t,n,r,i),y.debug(`Entering commit:`,t,n,r,i);let a=X0();n=Vs.sanitizeText(n,a),t=Vs.sanitizeText(t,a),i=i?.map(e=>Vs.sanitizeText(e,a));let o={id:n||Z0.records.seq+`-`+K0(),message:t,seq:Z0.records.seq++,type:r??Y0.NORMAL,tags:i??[],parents:Z0.records.head==null?[]:[Z0.records.head.id],branch:Z0.records.currBranch};Z0.records.head=o,y.info(`main branch`,a.mainBranchName),Z0.records.commits.has(o.id)&&y.warn(`Commit ID ${o.id} already exists`),Z0.records.commits.set(o.id,o),Z0.records.branches.set(Z0.records.currBranch,o.id),y.debug(`in pushCommit `+o.id)},`commit`),hrt=p(function(e){let t=e.name,n=e.order;if(t=Vs.sanitizeText(t,X0()),Z0.records.branches.has(t))throw Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${t}")`);Z0.records.branches.set(t,Z0.records.head==null?null:Z0.records.head.id),Z0.records.branchConfig.set(t,{name:t,order:n}),Q0(t),y.debug(`in createBranch`)},`branch`),grt=p(e=>{let t=e.branch,n=e.id,r=e.type,i=e.tags,a=X0();t=Vs.sanitizeText(t,a),n&&=Vs.sanitizeText(n,a);let o=Z0.records.branches.get(Z0.records.currBranch),s=Z0.records.branches.get(t),l=o?Z0.records.commits.get(o):void 0,u=s?Z0.records.commits.get(s):void 0;if(l&&u&&l.branch===t)throw Error(`Cannot merge branch '${t}' into itself.`);if(Z0.records.currBranch===t){let e=Error(`Incorrect usage of "merge". Cannot merge a branch to itself`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch abc`]},e}if(l===void 0||!l){let e=Error(`Incorrect usage of "merge". Current branch (${Z0.records.currBranch})has no commits`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`commit`]},e}if(!Z0.records.branches.has(t)){let e=Error(`Incorrect usage of "merge". Branch to be merged (`+t+`) does not exist`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch ${t}`]},e}if(u===void 0||!u){let e=Error(`Incorrect usage of "merge". Branch to be merged (`+t+`) has no commits`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`"commit"`]},e}if(l===u){let e=Error(`Incorrect usage of "merge". Both branches have same head`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch abc`]},e}if(n&&Z0.records.commits.has(n)){let e=Error(`Incorrect usage of "merge". Commit with id:`+n+` already exists, use different custom id`);throw e.hash={text:`merge ${t} ${n} ${r} ${i?.join(` `)}`,token:`merge ${t} ${n} ${r} ${i?.join(` `)}`,expected:[`merge ${t} ${n}_UNIQUE ${r} ${i?.join(` `)}`]},e}let d=s||``,f={id:n||`${Z0.records.seq}-${K0()}`,message:`merged branch ${t} into ${Z0.records.currBranch}`,seq:Z0.records.seq++,parents:Z0.records.head==null?[]:[Z0.records.head.id,d],branch:Z0.records.currBranch,type:Y0.MERGE,customType:r,customId:!!n,tags:i??[]};Z0.records.head=f,Z0.records.commits.set(f.id,f),Z0.records.branches.set(Z0.records.currBranch,f.id),y.debug(Z0.records.branches),y.debug(`in mergeBranch`)},`merge`),_rt=p(function(e){let t=e.id,n=e.targetId,r=e.tags,i=e.parent;y.debug(`Entering cherryPick:`,t,n,r);let a=X0();if(t=Vs.sanitizeText(t,a),n=Vs.sanitizeText(n,a),r=r?.map(e=>Vs.sanitizeText(e,a)),i=Vs.sanitizeText(i,a),!t||!Z0.records.commits.has(t)){let e=Error(`Incorrect usage of "cherryPick". Source commit id should exist and provided`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:[`cherry-pick abc`]},e}let o=Z0.records.commits.get(t);if(o===void 0||!o)throw Error(`Incorrect usage of "cherryPick". Source commit id should exist and provided`);if(i&&!(Array.isArray(o.parents)&&o.parents.includes(i)))throw Error(`Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.`);let s=o.branch;if(o.type===Y0.MERGE&&!i)throw Error(`Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.`);if(!n||!Z0.records.commits.has(n)){if(s===Z0.records.currBranch){let e=Error(`Incorrect usage of "cherryPick". Source commit is already on current branch`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:[`cherry-pick abc`]},e}let e=Z0.records.branches.get(Z0.records.currBranch);if(e===void 0||!e){let e=Error(`Incorrect usage of "cherry-pick". Current branch (${Z0.records.currBranch})has no commits`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:[`cherry-pick abc`]},e}let a=Z0.records.commits.get(e);if(a===void 0||!a){let e=Error(`Incorrect usage of "cherry-pick". Current branch (${Z0.records.currBranch})has no commits`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:[`cherry-pick abc`]},e}let l={id:Z0.records.seq+`-`+K0(),message:`cherry-picked ${o?.message} into ${Z0.records.currBranch}`,seq:Z0.records.seq++,parents:Z0.records.head==null?[]:[Z0.records.head.id,o.id],branch:Z0.records.currBranch,type:Y0.CHERRY_PICK,tags:r?r.filter(Boolean):[`cherry-pick:${o.id}${o.type===Y0.MERGE?`|parent:${i}`:``}`]};Z0.records.head=l,Z0.records.commits.set(l.id,l),Z0.records.branches.set(Z0.records.currBranch,l.id),y.debug(Z0.records.branches),y.debug(`in cherryPick`)}},`cherryPick`),Q0=p(function(e){if(e=Vs.sanitizeText(e,X0()),Z0.records.branches.has(e)){Z0.records.currBranch=e;let t=Z0.records.branches.get(Z0.records.currBranch);t===void 0||!t?Z0.records.head=null:Z0.records.head=Z0.records.commits.get(t)??null}else{let t=Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw t.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},t}},`checkout`),p(q0,`upsert`),p(J0,`prettyPrintCommitHistory`),vrt=p(function(){y.debug(Z0.records.commits);let e=$0()[0];J0([e])},`prettyPrint`),yrt=p(function(){Z0.reset(),Xs()},`clear`),brt=p(function(){return[...Z0.records.branchConfig.values()].map((e,t)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${t}`)}).sort((e,t)=>(e.order??0)-(t.order??0)).map(({name:e})=>({name:e}))},`getBranchesAsObjArray`),xrt=p(function(){return Z0.records.branches},`getBranches`),Srt=p(function(){return Z0.records.commits},`getCommits`),$0=p(function(){let e=[...Z0.records.commits.values()];return e.forEach(function(e){y.debug(e.id)}),e.sort((e,t)=>e.seq-t.seq),e},`getCommitsArray`),e2={commitType:Y0,getConfig:X0,setDirection:drt,setOptions:frt,getOptions:prt,commit:mrt,branch:hrt,merge:grt,cherryPick:_rt,checkout:Q0,prettyPrint:vrt,clear:yrt,getBranchesAsObjArray:brt,getBranches:xrt,getCommits:Srt,getCommitsArray:$0,getCurrentBranch:p(function(){return Z0.records.currBranch},`getCurrentBranch`),getDirection:p(function(){return Z0.records.direction},`getDirection`),getHead:p(function(){return Z0.records.head},`getHead`),setAccTitle:Zs,getAccTitle:Qs,getAccDescription:ec,setAccDescription:$s,setDiagramTitle:tc,getDiagramTitle:nc},Crt=p((e,t)=>{cR(e,t),e.dir&&t.setDirection(e.dir);for(let n of e.statements)wrt(n,t)},`populate`),wrt=p((e,t)=>{let n={Commit:p(e=>t.commit(Trt(e)),`Commit`),Branch:p(e=>t.branch(Ert(e)),`Branch`),Merge:p(e=>t.merge(Drt(e)),`Merge`),Checkout:p(e=>t.checkout(Ort(e)),`Checkout`),CherryPicking:p(e=>t.cherryPick(krt(e)),`CherryPicking`)}[e.$type];n?n(e):y.error(`Unknown statement type: ${e.$type}`)},`parseStatement`),Trt=p(e=>({id:e.id,msg:e.message??``,type:e.type===void 0?Y0.NORMAL:Y0[e.type],tags:e.tags??void 0}),`parseCommit`),Ert=p(e=>({name:e.name,order:e.order??0}),`parseBranch`),Drt=p(e=>({branch:e.branch,id:e.id??``,type:e.type===void 0?void 0:Y0[e.type],tags:e.tags??void 0}),`parseMerge`),Ort=p(e=>e.branch,`parseCheckout`),krt=p(e=>({id:e.id,targetId:``,tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),`parseCherryPicking`),Art={parse:p(async e=>{let t=await H0(`gitGraph`,e);y.debug(t),Crt(t,e2)},`parse`)},t2=10,n2=40,r2=4,i2=2,a2=8,o2=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]),s2=12,c2=new Set([`redux-color`,`redux-dark-color`]),jrt=new Set([`dark`,`redux-dark`,`redux-dark-color`,`neo-dark`]),l2=p((e,t,n=!1)=>n&&e>0?(e-1)%(t-1)+1:e%t,`calcColorIndex`),u2=new Map,d2=new Map,f2=30,p2=new Map,m2=[],h2=0,g2=`LR`,Mrt=p(()=>{u2.clear(),d2.clear(),p2.clear(),h2=0,m2=[],g2=`LR`},`clear`),_2=p(e=>{let t=document.createElementNS(`http://www.w3.org/2000/svg`,`text`);return(typeof e==`string`?e.split(/\\n|\n|<br\s*\/?>/gi):e).forEach(e=>{let n=document.createElementNS(`http://www.w3.org/2000/svg`,`tspan`);n.setAttributeNS(`http://www.w3.org/XML/1998/namespace`,`xml:space`,`preserve`),n.setAttribute(`dy`,`1em`),n.setAttribute(`x`,`0`),n.setAttribute(`class`,`row`),n.textContent=e.trim(),t.appendChild(n)}),t},`drawText`),v2=p(e=>{let t,n,r;return g2===`BT`?(n=p((e,t)=>e<=t,`comparisonFunc`),r=1/0):(n=p((e,t)=>e>=t,`comparisonFunc`),r=0),e.forEach(e=>{let i=g2===`TB`||g2==`BT`?d2.get(e)?.y:d2.get(e)?.x;i!==void 0&&n(i,r)&&(t=e,r=i)}),t},`findClosestParent`),Nrt=p(e=>{let t=``,n=1/0;return e.forEach(e=>{let r=d2.get(e).y;r<=n&&(t=e,n=r)}),t||void 0},`findClosestParentBT`),Prt=p((e,t,n)=>{let r=n,i=n,a=[];e.forEach(e=>{let n=t.get(e);if(!n)throw Error(`Commit not found for key ${e}`);n.parents.length?(r=Irt(n),i=Math.max(r,i)):a.push(n),Lrt(n,r)}),r=i,a.forEach(e=>{Rrt(e,r,n)}),e.forEach(e=>{let n=t.get(e);if(n?.parents.length){let e=Nrt(n.parents);r=d2.get(e).y-n2,r<=i&&(i=r);let t=u2.get(n.branch).pos,a=r-t2;d2.set(n.id,{x:t,y:a})}})},`setParallelBTPos`),Frt=p(e=>{let t=v2(e.parents.filter(e=>e!==null));if(!t)throw Error(`Closest parent not found for commit ${e.id}`);let n=d2.get(t)?.y;if(n===void 0)throw Error(`Closest parent position not found for commit ${e.id}`);return n},`findClosestParentPos`),Irt=p(e=>Frt(e)+n2,`calculateCommitPosition`),Lrt=p((e,t)=>{let n=u2.get(e.branch);if(!n)throw Error(`Branch not found for commit ${e.id}`);let r=n.pos,i=t+t2;return d2.set(e.id,{x:r,y:i}),{x:r,y:i}},`setCommitPosition`),Rrt=p((e,t,n)=>{let r=u2.get(e.branch);if(!r)throw Error(`Branch not found for commit ${e.id}`);let i=t+n,a=r.pos;d2.set(e.id,{x:a,y:i})},`setRootPosition`),zrt=p((e,t,n,r,i,a)=>{let{theme:o}=Z(),s=o2.has(o??``),l=c2.has(o??``),u=jrt.has(o??``);if(a===Y0.HIGHLIGHT)e.append(`rect`).attr(`x`,n.x-10+(s?3:0)).attr(`y`,n.y-10+(s?3:0)).attr(`width`,s?14:20).attr(`height`,s?14:20).attr(`class`,`commit ${t.id} commit-highlight${l2(i,a2,l)} ${r}-outer`),e.append(`rect`).attr(`x`,n.x-6+(s?2:0)).attr(`y`,n.y-6+(s?2:0)).attr(`width`,s?8:12).attr(`height`,s?8:12).attr(`class`,`commit ${t.id} commit${l2(i,a2,l)} ${r}-inner`);else if(a===Y0.CHERRY_PICK)e.append(`circle`).attr(`cx`,n.x).attr(`cy`,n.y).attr(`r`,s?7:10).attr(`class`,`commit ${t.id} ${r}`),e.append(`circle`).attr(`cx`,n.x-3).attr(`cy`,n.y+2).attr(`r`,s?2.5:2.75).attr(`fill`,u?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`circle`).attr(`cx`,n.x+3).attr(`cy`,n.y+2).attr(`r`,s?2.5:2.75).attr(`fill`,u?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`line`).attr(`x1`,n.x+3).attr(`y1`,n.y+1).attr(`x2`,n.x).attr(`y2`,n.y-5).attr(`stroke`,u?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`line`).attr(`x1`,n.x-3).attr(`y1`,n.y+1).attr(`x2`,n.x).attr(`y2`,n.y-5).attr(`stroke`,u?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`);else{let o=e.append(`circle`);if(o.attr(`cx`,n.x),o.attr(`cy`,n.y),o.attr(`r`,s?7:10),o.attr(`class`,`commit ${t.id} commit${l2(i,a2,l)}`),a===Y0.MERGE){let a=e.append(`circle`);a.attr(`cx`,n.x),a.attr(`cy`,n.y),a.attr(`r`,s?5:6),a.attr(`class`,`commit ${r} ${t.id} commit${l2(i,a2,l)}`)}if(a===Y0.REVERSE){let a=e.append(`path`),o=s?4:5;a.attr(`d`,`M ${n.x-o},${n.y-o}L${n.x+o},${n.y+o}M${n.x-o},${n.y+o}L${n.x+o},${n.y-o}`).attr(`class`,`commit ${r} ${t.id} commit${l2(i,a2,l)}`)}}},`drawCommitBullet`),Brt=p((e,t,n,r,i)=>{if(t.type!==Y0.CHERRY_PICK&&(t.customId&&t.type===Y0.MERGE||t.type!==Y0.MERGE)&&i.showCommitLabel){let a=e.append(`g`),o=a.insert(`rect`).attr(`class`,`commit-label-bkg`),s=a.append(`text`).attr(`x`,r).attr(`y`,n.y+25).attr(`class`,`commit-label`).text(t.id),l=s.node()?.getBBox();if(l&&(o.attr(`x`,n.posWithOffset-l.width/2-i2).attr(`y`,n.y+13.5).attr(`width`,l.width+2*i2).attr(`height`,l.height+2*i2),g2===`TB`||g2===`BT`?(o.attr(`x`,n.x-(l.width+4*r2+5)).attr(`y`,n.y-12),s.attr(`x`,n.x-(l.width+4*r2)).attr(`y`,n.y+l.height-12)):s.attr(`x`,n.posWithOffset-l.width/2),i.rotateCommitLabel)){if(g2===`TB`||g2===`BT`)s.attr(`transform`,`rotate(-45, `+n.x+`, `+n.y+`)`),o.attr(`transform`,`rotate(-45, `+n.x+`, `+n.y+`)`);else{let e=-7.5-(l.width+10)/25*9.5,t=10+l.width/25*8.5;a.attr(`transform`,`translate(`+e+`, `+t+`) rotate(-45, `+r+`, `+n.y+`)`)}}}},`drawCommitLabel`),Vrt=p((e,t,n,r)=>{if(t.tags.length>0){let i=0,a=0,o=0,s=[];for(let r of t.tags.reverse()){let t=e.insert(`polygon`),l=e.append(`circle`),u=e.append(`text`).attr(`y`,n.y-16-i).attr(`class`,`tag-label`).text(r),d=u.node()?.getBBox();if(!d)throw Error(`Tag bbox not found`);a=Math.max(a,d.width),o=Math.max(o,d.height),u.attr(`x`,n.posWithOffset-d.width/2),s.push({tag:u,hole:l,rect:t,yOffset:i}),i+=20}for(let{tag:e,hole:t,rect:i,yOffset:l}of s){let s=o/2,u=n.y-19.2-l;if(i.attr(`class`,`tag-label-bkg`).attr(`points`,`1370+ ${r-a/2-r2/2},${u+i2} 1371+ ${r-a/2-r2/2},${u-i2}1372+ ${n.posWithOffset-a/2-r2},${u-s-i2}1373+ ${n.posWithOffset+a/2+r2},${u-s-i2}1374+ ${n.posWithOffset+a/2+r2},${u+s+i2}1375+ ${n.posWithOffset-a/2-r2},${u+s+i2}`),t.attr(`cy`,u).attr(`cx`,r-a/2+r2/2).attr(`r`,1.5).attr(`class`,`tag-hole`),g2===`TB`||g2===`BT`){let o=r+l;i.attr(`class`,`tag-label-bkg`).attr(`points`,`1376+ ${n.x},${o+2}1377+ ${n.x},${o-2}1378+ ${n.x+t2},${o-s-2}1379+ ${n.x+t2+a+4},${o-s-2}1380+ ${n.x+t2+a+4},${o+s+2}1381+ ${n.x+t2},${o+s+2}`).attr(`transform`,`translate(12,12) rotate(45, `+n.x+`,`+r+`)`),t.attr(`cx`,n.x+r2/2).attr(`cy`,o).attr(`transform`,`translate(12,12) rotate(45, `+n.x+`,`+r+`)`),e.attr(`x`,n.x+5).attr(`y`,o+3).attr(`transform`,`translate(14,14) rotate(45, `+n.x+`,`+r+`)`)}}}},`drawCommitTags`),Hrt=p(e=>{switch(e.customType??e.type){case Y0.NORMAL:return`commit-normal`;case Y0.REVERSE:return`commit-reverse`;case Y0.HIGHLIGHT:return`commit-highlight`;case Y0.MERGE:return`commit-merge`;case Y0.CHERRY_PICK:return`commit-cherry-pick`;default:return`commit-normal`}},`getCommitClassType`),Urt=p((e,t,n,r)=>{let i={x:0,y:0};if(e.parents.length>0){let n=v2(e.parents);if(n){let a=r.get(n)??i;return t===`TB`?a.y+n2:t===`BT`?(r.get(e.id)??i).y-n2:a.x+n2}}else if(t===`TB`)return f2;else if(t===`BT`)return(r.get(e.id)??i).y-n2;else return 0;return 0},`calculatePosition`),Wrt=p((e,t,n)=>{let r=g2===`BT`&&n?t:t+t2,i=u2.get(e.branch)?.pos,a=g2===`TB`||g2===`BT`?u2.get(e.branch)?.pos:r;if(a===void 0||i===void 0)throw Error(`Position were undefined for commit ${e.id}`);let o=o2.has(Z().theme??``);return{x:a,y:g2===`TB`||g2===`BT`?r:i+(o?s2/2+1:-2),posWithOffset:r}},`getCommitPosition`),y2=p((e,t,n,r)=>{let i=e.append(`g`).attr(`class`,`commit-bullets`),a=e.append(`g`).attr(`class`,`commit-labels`),o=g2===`TB`||g2===`BT`?f2:0,s=[...t.keys()],l=r.parallelCommits??!1,u=p((e,n)=>{let r=t.get(e)?.seq,i=t.get(n)?.seq;return r!==void 0&&i!==void 0?r-i:0},`sortKeys`),d=s.sort(u);g2===`BT`&&(l&&Prt(d,t,o),d=d.reverse()),d.forEach(e=>{let s=t.get(e);if(!s)throw Error(`Commit not found for key ${e}`);l&&(o=Urt(s,g2,o,d2));let u=Wrt(s,o,l);if(n){let e=Hrt(s),t=s.customType??s.type,n=u2.get(s.branch)?.index??0;zrt(i,s,u,e,n,t),Brt(a,s,u,o,r),Vrt(a,s,u,o)}g2===`TB`||g2===`BT`?d2.set(s.id,{x:u.x,y:u.posWithOffset}):d2.set(s.id,{x:u.posWithOffset,y:u.y}),o=g2===`BT`&&l?o+n2:o+n2+t2,o>h2&&(h2=o)})},`drawCommits`),Grt=p((e,t,n,r,i)=>{let a=(g2===`TB`||g2===`BT`?n.x<r.x:n.y<r.y)?t.branch:e.branch,o=p(e=>e.branch===a,`isOnBranchToGetCurve`),s=p(n=>n.seq>e.seq&&n.seq<t.seq,`isBetweenCommits`);return[...i.values()].some(e=>s(e)&&o(e))},`shouldRerouteArrow`),b2=p((e,t,n=0)=>{let r=e+Math.abs(e-t)/2;return n>5?r:m2.every(e=>Math.abs(e-r)>=10)?(m2.push(r),r):b2(e,t-Math.abs(e-t)/5,n+1)},`findLane`),Krt=p((e,t,n,r)=>{let{theme:i}=Z(),a=c2.has(i??``),o=d2.get(t.id),s=d2.get(n.id);if(o===void 0||s===void 0)throw Error(`Commit positions not found for commits ${t.id} and ${n.id}`);let l=Grt(t,n,o,s,r),u=``,d=``,f=0,p=0,m=u2.get(n.branch)?.index;n.type===Y0.MERGE&&t.id!==n.parents[0]&&(m=u2.get(t.branch)?.index);let h;if(l){u=`A 10 10, 0, 0, 0,`,d=`A 10 10, 0, 0, 1,`,f=10,p=10;let e=o.y<s.y?b2(o.y,s.y):b2(s.y,o.y),n=o.x<s.x?b2(o.x,s.x):b2(s.x,o.x);g2===`TB`?o.x<s.x?h=`M ${o.x} ${o.y} L ${n-f} ${o.y} ${d} ${n} ${o.y+p} L ${n} ${s.y-f} ${u} ${n+p} ${s.y} L ${s.x} ${s.y}`:(m=u2.get(t.branch)?.index,h=`M ${o.x} ${o.y} L ${n+f} ${o.y} ${u} ${n} ${o.y+p} L ${n} ${s.y-f} ${d} ${n-p} ${s.y} L ${s.x} ${s.y}`):g2===`BT`?o.x<s.x?h=`M ${o.x} ${o.y} L ${n-f} ${o.y} ${u} ${n} ${o.y-p} L ${n} ${s.y+f} ${d} ${n+p} ${s.y} L ${s.x} ${s.y}`:(m=u2.get(t.branch)?.index,h=`M ${o.x} ${o.y} L ${n+f} ${o.y} ${d} ${n} ${o.y-p} L ${n} ${s.y+f} ${u} ${n-p} ${s.y} L ${s.x} ${s.y}`):o.y<s.y?h=`M ${o.x} ${o.y} L ${o.x} ${e-f} ${u} ${o.x+p} ${e} L ${s.x-f} ${e} ${d} ${s.x} ${e+p} L ${s.x} ${s.y}`:(m=u2.get(t.branch)?.index,h=`M ${o.x} ${o.y} L ${o.x} ${e+f} ${d} ${o.x+p} ${e} L ${s.x-f} ${e} ${u} ${s.x} ${e-p} L ${s.x} ${s.y}`)}else u=`A 20 20, 0, 0, 0,`,d=`A 20 20, 0, 0, 1,`,f=20,p=20,g2===`TB`?(o.x<s.x&&(h=n.type===Y0.MERGE&&t.id!==n.parents[0]?`M ${o.x} ${o.y} L ${o.x} ${s.y-f} ${u} ${o.x+p} ${s.y} L ${s.x} ${s.y}`:`M ${o.x} ${o.y} L ${s.x-f} ${o.y} ${d} ${s.x} ${o.y+p} L ${s.x} ${s.y}`),o.x>s.x&&(u=`A 20 20, 0, 0, 0,`,d=`A 20 20, 0, 0, 1,`,f=20,p=20,h=n.type===Y0.MERGE&&t.id!==n.parents[0]?`M ${o.x} ${o.y} L ${o.x} ${s.y-f} ${d} ${o.x-p} ${s.y} L ${s.x} ${s.y}`:`M ${o.x} ${o.y} L ${s.x+f} ${o.y} ${u} ${s.x} ${o.y+p} L ${s.x} ${s.y}`),o.x===s.x&&(h=`M ${o.x} ${o.y} L ${s.x} ${s.y}`)):g2===`BT`?(o.x<s.x&&(h=n.type===Y0.MERGE&&t.id!==n.parents[0]?`M ${o.x} ${o.y} L ${o.x} ${s.y+f} ${d} ${o.x+p} ${s.y} L ${s.x} ${s.y}`:`M ${o.x} ${o.y} L ${s.x-f} ${o.y} ${u} ${s.x} ${o.y-p} L ${s.x} ${s.y}`),o.x>s.x&&(u=`A 20 20, 0, 0, 0,`,d=`A 20 20, 0, 0, 1,`,f=20,p=20,h=n.type===Y0.MERGE&&t.id!==n.parents[0]?`M ${o.x} ${o.y} L ${o.x} ${s.y+f} ${u} ${o.x-p} ${s.y} L ${s.x} ${s.y}`:`M ${o.x} ${o.y} L ${s.x+f} ${o.y} ${d} ${s.x} ${o.y-p} L ${s.x} ${s.y}`),o.x===s.x&&(h=`M ${o.x} ${o.y} L ${s.x} ${s.y}`)):(o.y<s.y&&(h=n.type===Y0.MERGE&&t.id!==n.parents[0]?`M ${o.x} ${o.y} L ${s.x-f} ${o.y} ${d} ${s.x} ${o.y+p} L ${s.x} ${s.y}`:`M ${o.x} ${o.y} L ${o.x} ${s.y-f} ${u} ${o.x+p} ${s.y} L ${s.x} ${s.y}`),o.y>s.y&&(h=n.type===Y0.MERGE&&t.id!==n.parents[0]?`M ${o.x} ${o.y} L ${s.x-f} ${o.y} ${u} ${s.x} ${o.y-p} L ${s.x} ${s.y}`:`M ${o.x} ${o.y} L ${o.x} ${s.y+f} ${d} ${o.x+p} ${s.y} L ${s.x} ${s.y}`),o.y===s.y&&(h=`M ${o.x} ${o.y} L ${s.x} ${s.y}`));if(h===void 0)throw Error(`Line definition not found`);e.append(`path`).attr(`d`,h).attr(`class`,`arrow arrow`+l2(m,a2,a))},`drawArrow`),qrt=p((e,t)=>{let n=e.append(`g`).attr(`class`,`commit-arrows`);[...t.keys()].forEach(e=>{let r=t.get(e);r.parents&&r.parents.length>0&&r.parents.forEach(e=>{Krt(n,t.get(e),r,t)})})},`drawArrows`),Jrt=p((e,t,n,r)=>{let{look:i,theme:a,themeVariables:o}=Z(),{dropShadow:s,THEME_COLOR_LIMIT:l}=o,u=o2.has(a??``),d=c2.has(a??``),f=e.append(`g`);t.forEach((e,t)=>{let a=l2(t,u?l:a2,d),o=u2.get(e.name)?.pos;if(o===void 0)throw Error(`Position not found for branch ${e.name}`);let p=g2===`TB`||g2===`BT`?o:u?o+s2/2+1:o-2,m=f.append(`line`);m.attr(`x1`,0),m.attr(`y1`,p),m.attr(`x2`,h2),m.attr(`y2`,p),m.attr(`class`,`branch branch`+a),g2===`TB`?(m.attr(`y1`,f2),m.attr(`x1`,o),m.attr(`y2`,h2),m.attr(`x2`,o)):g2===`BT`&&(m.attr(`y1`,h2),m.attr(`x1`,o),m.attr(`y2`,f2),m.attr(`x2`,o)),m2.push(p);let h=e.name,g=_2(h),_=f.insert(`rect`),v=f.insert(`g`).attr(`class`,`branchLabel`).insert(`g`).attr(`class`,`label branch-label`+a);v.node().appendChild(g);let y=g.getBBox(),b=u?0:4,x=u?16:0,S=u?s2:0;i===`neo`&&_.attr(`data-look`,`neo`),_.attr(`class`,`branchLabelBkg label`+a).attr(`style`,i===`neo`?`filter:${u?`url(#${r}-drop-shadow)`:s}`:``).attr(`rx`,b).attr(`ry`,b).attr(`x`,-y.width-4-(n.rotateCommitLabel===!0?30:0)).attr(`y`,-y.height/2+10).attr(`width`,y.width+18+x).attr(`height`,y.height+4+S),v.attr(`transform`,`translate(`+(-y.width-14-(n.rotateCommitLabel===!0?30:0)+x/2)+`, `+(p-y.height/2-2)+`)`),g2===`TB`?(_.attr(`x`,o-y.width/2-10).attr(`y`,0),v.attr(`transform`,`translate(`+(o-y.width/2-5)+`, 0)`),u&&(_.attr(`transform`,`translate(${-x/2-3}, ${-S-10})`),v.attr(`transform`,`translate(`+(o-y.width/2-5)+`, `+(-S*2+7)+`)`))):g2===`BT`?(_.attr(`x`,o-y.width/2-10).attr(`y`,h2),v.attr(`transform`,`translate(`+(o-y.width/2-5)+`, `+h2+`)`),u&&(_.attr(`transform`,`translate(${-x/2-3}, ${S+10})`),v.attr(`transform`,`translate(`+(o-y.width/2-5)+`, `+(h2+S*2+4)+`)`))):_.attr(`transform`,`translate(-19, `+(p-12-S/2)+`)`)})},`drawBranches`),Yrt=p(function(e,t,n,r,i){return u2.set(e,{pos:t,index:n}),t+=50+(i?40:0)+(g2===`TB`||g2===`BT`?r.width/2:0),t},`setBranchPosition`),Xrt={draw:p(function(e,t,n,r){Mrt(),y.debug(`in gitgraph renderer`,e+`1382+`,`id:`,t,n);let i=r.db;if(!i.getConfig){y.error(`getConfig method is not available on db`);return}let a=i.getConfig(),o=a.rotateCommitLabel??!1;p2=i.getCommits();let s=i.getBranchesAsObjArray();g2=i.getDirection();let l=$c(`[id="${t}"]`),{look:u,theme:d,themeVariables:f}=Z(),{useGradient:p,gradientStart:m,gradientStop:h,filterColor:g}=f;if(p){let e=l.append(`defs`).append(`linearGradient`).attr(`id`,t+`-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);e.append(`stop`).attr(`offset`,`0%`).attr(`stop-color`,m).attr(`stop-opacity`,1),e.append(`stop`).attr(`offset`,`100%`).attr(`stop-color`,h).attr(`stop-opacity`,1)}u===`neo`&&o2.has(d??``)&&l.append(`defs`).append(`filter`).attr(`id`,t+`-drop-shadow`).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,g);let _=0;s.forEach((e,t)=>{let n=_2(e.name),r=l.append(`g`),i=r.insert(`g`).attr(`class`,`branchLabel`),a=i.insert(`g`).attr(`class`,`label branch-label`);a.node()?.appendChild(n);let s=n.getBBox();_=Yrt(e.name,_,t,s,o),a.remove(),i.remove(),r.remove()}),y2(l,p2,!1,a),a.showBranches&&Jrt(l,s,a,t),qrt(l,p2),y2(l,p2,!0,a),eh.insertTitle(l,`gitTitleText`,a.titleTopMargin??0,i.getDiagramTitle()),sc(void 0,l,a.diagramPadding,a.useMaxWidth)},`draw`)},x2=8,S2=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]),Zrt=new Set([`redux-color`,`redux-dark-color`]),Qrt=new Set([`neo`,`neo-dark`]),$rt=new Set([`dark`,`redux-dark`,`redux-dark-color`,`neo-dark`]),eit=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`,`neo`,`neo-dark`]),tit=p(e=>{let{svgId:t}=e,n=``;if(e.useGradient&&t)for(let r=0;r<e.THEME_COLOR_LIMIT;r++)n+=`1383+ .label${r} { fill: ${e.mainBkg}; stroke: url(${t}-gradient); stroke-width: ${e.strokeWidth};}1384+ `;return n},`genGitGraphGradient`),nit=p(e=>{let{theme:t,themeVariables:n}=ms(),{borderColorArray:r}=n,i=S2.has(t);if(Qrt.has(t)){let t=``;for(let n=0;n<e.THEME_COLOR_LIMIT;n++)if(n===0)t+=`1385+ .branch-label${n} { fill: ${e.nodeBorder};}1386+ .commit${n} { stroke: ${e.nodeBorder}; }1387+ .commit-highlight${n} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }1388+ .arrow${n} { stroke: ${e.nodeBorder}; }1389+ .commit-bullets { fill: ${e.nodeBorder}; }1390+ .commit-cherry-pick${n} { stroke: ${e.nodeBorder}; }1391+ ${tit(e)}`;else{let r=n%x2;t+=`1392+ .branch-label${n} { fill: ${e[`gitBranchLabel`+r]}; }1393+ .commit${n} { stroke: ${e[`git`+r]}; fill: ${e[`git`+r]}; }1394+ .commit-highlight${n} { stroke: ${e[`gitInv`+r]}; fill: ${e[`gitInv`+r]}; }1395+ .arrow${n} { stroke: ${e[`git`+r]}; }1396+ `}return t}if(Zrt.has(t)){let n=``;for(let a=0;a<e.THEME_COLOR_LIMIT;a++)if(a===0)n+=`1397+ .branch-label${a} { fill: ${e.nodeBorder}; ${i?`font-weight:${e.noteFontWeight}`:``} }1398+ .commit${a} { stroke: ${e.nodeBorder}; }1399+ .commit-highlight${a} { stroke: ${e.nodeBorder}; fill: ${e.mainBkg}; }1400+ .label${a} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${i?`font-weight:${e.noteFontWeight}`:``} }1401+ .arrow${a} { stroke: ${e.nodeBorder}; }1402+ .commit-bullets { fill: ${e.nodeBorder}; }1403+ `;else{let o=a%r.length;n+=`1404+ .branch-label${a} { fill: ${e.nodeBorder}; ${i?`font-weight:${e.noteFontWeight}`:``} }1405+ .commit${a} { stroke: ${r[o]}; fill: ${r[o]}; }1406+ .commit-highlight${a} { stroke: ${r[o]}; fill: ${r[o]}; }1407+ .label${a} { fill: ${$rt.has(t)?e.mainBkg:r[o]}; stroke: ${r[o]}; stroke-width: ${e.strokeWidth}; }1408+ .arrow${a} { stroke: ${r[o]}; }1409+ `}return n}{let t=``;for(let n=0;n<e.THEME_COLOR_LIMIT;n++)t+=`1410+ .branch-label${n} { fill: ${e.nodeBorder}; ${i?`font-weight:${e.noteFontWeight}`:``} }1411+ .commit${n} { stroke: ${e.nodeBorder}; }1412+ .commit-highlight${n} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }1413+ .label${n} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${i?`font-weight:${e.noteFontWeight}`:``}}1414+ .arrow${n} { stroke: ${e.nodeBorder}; }1415+ .commit-bullets { fill: ${e.nodeBorder}; }1416+ .commit-cherry-pick${n} { stroke: ${e.nodeBorder}; }1417+ `;return t}},`genColor`),rit=p(e=>`${Array.from({length:e.THEME_COLOR_LIMIT},(e,t)=>t).map(t=>{let n=t%x2;return`1418+ .branch-label${t} { fill: ${e[`gitBranchLabel`+n]}; }1419+ .commit${t} { stroke: ${e[`git`+n]}; fill: ${e[`git`+n]}; }1420+ .commit-highlight${t} { stroke: ${e[`gitInv`+n]}; fill: ${e[`gitInv`+n]}; }1421+ .label${t} { fill: ${e[`git`+n]}; }1422+ .arrow${t} { stroke: ${e[`git`+n]}; }1423+ `}).join(`1424+`)}`,`normalTheme`),iit={parser:Art,db:e2,renderer:Xrt,styles:p(e=>{let{theme:t}=ms(),n=eit.has(t);return`1425+ .commit-id,1426+ .commit-msg,1427+ .branch-label {1428+ fill: lightgrey;1429+ color: lightgrey;1430+ font-family: 'trebuchet ms', verdana, arial, sans-serif;1431+ font-family: var(--mermaid-font-family);1432+ }1433+ 1434+ ${n?nit(e):rit(e)}1435+1436+ .branch {1437+ stroke-width: ${e.strokeWidth};1438+ stroke: ${e.commitLineColor??e.lineColor};1439+ stroke-dasharray: ${n?`4 2`:`2`};1440+ }1441+ .commit-label { font-size: ${e.commitLabelFontSize}; fill: ${n?e.nodeBorder:e.commitLabelColor}; ${n?`font-weight:${e.noteFontWeight};`:``}}1442+ .commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${n?`transparent`:e.commitLabelBackground}; opacity: ${n?``:.5}; }1443+ .tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};}1444+ .tag-label-bkg { fill: ${n?e.mainBkg:e.tagLabelBackground}; stroke: ${n?e.nodeBorder:e.tagLabelBorder}; ${n?`filter:${e.dropShadow}`:``} }1445+ .tag-hole { fill: ${e.textColor}; }1446+1447+ .commit-merge {1448+ stroke: ${n?e.mainBkg:e.primaryColor};1449+ fill: ${n?e.mainBkg:e.primaryColor};1450+ }1451+ .commit-reverse {1452+ stroke: ${n?e.mainBkg:e.primaryColor};1453+ fill: ${n?e.mainBkg:e.primaryColor};1454+ stroke-width: ${n?e.strokeWidth:3};1455+ }1456+ .commit-highlight-outer {1457+ }1458+ .commit-highlight-inner {1459+ stroke: ${n?e.mainBkg:e.primaryColor};1460+ fill: ${n?e.mainBkg:e.primaryColor};1461+ }1462+1463+ .arrow {1464+ /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */1465+ stroke-width: ${S2.has(t)?e.strokeWidth:8};1466+ stroke-linecap: round;1467+ fill: none1468+ }1469+ .gitTitleText {1470+ text-anchor: middle;1471+ font-size: 18px;1472+ fill: ${e.textColor};1473+ }1474+`},`getStyles`)}})),oit=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_isoWeek=r()})(e,(function(){"use strict";return function(e,t,n){var r=function(e){return e.add(4-e.isoWeekday(),`day`)},i=t.prototype;i.isoWeekYear=function(){return r(this).year()},i.isoWeek=function(e){if(!this.$utils().u(e))return this.add(7*(e-this.isoWeek()),`day`);var t,i,a,o,s=r(this),l=(t=this.isoWeekYear(),i=this.$u,a=(i?n.utc:n)().year(t).startOf(`year`),o=4-a.isoWeekday(),a.isoWeekday()>4&&(o+=7),a.add(o,`day`));return s.diff(l,`week`)+1},i.isoWeekday=function(e){return this.$utils().u(e)?this.day()||7:this.day(this.day()%7?e:e-7)};var a=i.startOf;i.startOf=function(e,t){var n=this.$utils(),r=!!n.u(t)||t;return n.p(e)===`isoweek`?r?this.date(this.date()-(this.isoWeekday()-1)).startOf(`day`):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf(`day`):a.bind(this)(e,t)}}}))})),sit=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_customParseFormat=r()})(e,(function(){"use strict";var e={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},l=function(e){return function(t){this[e]=+t}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||={}).offset=function(e){if(!e||e===`Z`)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return n===0?0:t[0]===`+`?-n:n}(e)}],d=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},f=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?`pm`:`PM`);return n},p={A:[a,function(e){this.afternoon=f(e,!1)}],a:[a,function(e){this.afternoon=f(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*e}],SS:[r,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,l(`seconds`)],ss:[i,l(`seconds`)],m:[i,l(`minutes`)],mm:[i,l(`minutes`)],H:[i,l(`hours`)],h:[i,l(`hours`)],HH:[i,l(`hours`)],hh:[i,l(`hours`)],D:[i,l(`day`)],DD:[r,l(`day`)],Do:[a,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,``)===e&&(this.day=r)}],w:[i,l(`week`)],ww:[r,l(`week`)],M:[i,l(`month`)],MM:[r,l(`month`)],MMM:[a,function(e){var t=d(`months`),n=(d(`monthsShort`)||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw Error();this.month=n%12||n}],MMMM:[a,function(e){var t=d(`months`).indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,l(`year`)],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,l(`year`)],Z:u,ZZ:u};function m(n){for(var r=n,i=o&&o.formats,a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,l=0;l<s;l+=1){var u=a[l],d=p[u],f=d&&d[0],m=d&&d[1];a[l]=m?{regex:f,parser:m}:u.replace(/^\[|\]$/g,``)}return function(e){for(var t={},n=0,r=0;n<s;n+=1){var i=a[n];if(typeof i==`string`)r+=i.length;else{var o=i.regex,l=i.parser,u=e.slice(r),d=o.exec(u)[0];l.call(t,d),e=e.replace(d,``)}}return function(e){var t=e.afternoon;if(t!==void 0){var n=e.hours;t?n<12&&(e.hours+=12):n===12&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,a=e.args;this.$u=r;var s=a[1];if(typeof s==`string`){var l=!0===a[2],u=!0===a[3],d=l||u,f=a[2];u&&(f=a[2]),o=this.$locale(),!l&&f&&(o=n.Ls[f]),this.$d=function(e,t,n,r){try{if([`x`,`X`].indexOf(t)>-1)return new Date((t===`X`?1e3:1)*e);var i=m(t)(e),a=i.year,o=i.month,s=i.day,l=i.hours,u=i.minutes,d=i.seconds,f=i.milliseconds,p=i.zone,h=i.week,g=new Date,_=s||(a||o?1:g.getDate()),v=a||g.getFullYear(),y=0;a&&!o||(y=o>0?o-1:g.getMonth());var b,x=l||0,S=u||0,C=d||0,w=f||0;return p?new Date(Date.UTC(v,y,_,x,S,C,w+60*p.offset*1e3)):n?new Date(Date.UTC(v,y,_,x,S,C,w)):(b=new Date(v,y,_,x,S,C,w),h&&(b=r(b).week(h).toDate()),b)}catch{return new Date(``)}}(t,s,r,n),this.init(),f&&!0!==f&&(this.$L=this.locale(f).$L),d&&t!=this.format(s)&&(this.$d=new Date(``)),o={}}else if(s instanceof Array)for(var p=s.length,h=1;h<=p;h+=1){a[1]=s[h-1];var g=n.apply(this,a);if(g.isValid()){this.$d=g.$d,this.$L=g.$L,this.init();break}h===p&&(this.$d=new Date(``))}else i.call(this,e)}}}))})),cit=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_advancedFormat=r()})(e,(function(){"use strict";return function(e,t){var n=t.prototype,r=n.format;n.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return r.bind(this)(e);var i=this.$utils(),a=(e||`YYYY-MM-DDTHH:mm:ssZ`).replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(e){switch(e){case`Q`:return Math.ceil((t.$M+1)/3);case`Do`:return n.ordinal(t.$D);case`gggg`:return t.weekYear();case`GGGG`:return t.isoWeekYear();case`wo`:return n.ordinal(t.week(),`W`);case`w`:case`ww`:return i.s(t.week(),e===`w`?1:2,`0`);case`W`:case`WW`:return i.s(t.isoWeek(),e===`W`?1:2,`0`);case`k`:case`kk`:return i.s(String(t.$H===0?24:t.$H),e===`k`?1:2,`0`);case`X`:return Math.floor(t.$d.getTime()/1e3);case`x`:return t.$d.getTime();case`z`:return`[`+t.offsetName()+`]`;case`zzz`:return`[`+t.offsetName(`long`)+`]`;default:return e}}));return r.bind(this)(a)}}}))})),lit=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_duration=r()})(e,(function(){"use strict";var e,t,n=1e3,r=6e4,i=36e5,a=864e5,o=31536e6,s=2628e6,l=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,u=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,d={years:o,months:s,days:a,hours:i,minutes:r,seconds:n,milliseconds:1,weeks:6048e5},f=function(e){return e instanceof y},p=function(e,t,n){return new y(e,n,t.$l)},m=function(e){return t.p(e)+`s`},h=function(e){return e<0},g=function(e){return h(e)?Math.ceil(e):Math.floor(e)},_=function(e){return Math.abs(e)},v=function(e,t){return e?h(e)?{negative:!0,format:``+_(e)+t}:{negative:!1,format:``+e+t}:{negative:!1,format:``}},y=function(){function h(e,t,n){var r=this;if(this.$d={},this.$l=n,e===void 0&&(this.$ms=0,this.parseFromMilliseconds()),t)return p(e*d[m(t)],this);if(typeof e==`number`)return this.$ms=e,this.parseFromMilliseconds(),this;if(typeof e==`object`)return Object.keys(e).forEach((function(t){r.$d[m(t)]=e[t]})),this.calMilliseconds(),this;if(typeof e==`string`){var i=e.match(l);if(i){var a=i.slice(2).map((function(e){return e==null?0:Number(e)}));return this.$d.years=a[0],this.$d.months=a[1],this.$d.weeks=a[2],this.$d.days=a[3],this.$d.hours=a[4],this.$d.minutes=a[5],this.$d.seconds=a[6],this.calMilliseconds(),this}}return this}var _=h.prototype;return _.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,n){return t+(e.$d[n]||0)*d[n]}),0)},_.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=g(e/o),e%=o,this.$d.months=g(e/s),e%=s,this.$d.days=g(e/a),e%=a,this.$d.hours=g(e/i),e%=i,this.$d.minutes=g(e/r),e%=r,this.$d.seconds=g(e/n),e%=n,this.$d.milliseconds=e},_.toISOString=function(){var e=v(this.$d.years,`Y`),t=v(this.$d.months,`M`),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var r=v(n,`D`),i=v(this.$d.hours,`H`),a=v(this.$d.minutes,`M`),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var s=v(o,`S`),l=e.negative||t.negative||r.negative||i.negative||a.negative||s.negative,u=i.format||a.format||s.format?`T`:``,d=(l?`-`:``)+`P`+e.format+t.format+r.format+u+i.format+a.format+s.format;return d===`P`||d===`-P`?`P0D`:d},_.toJSON=function(){return this.toISOString()},_.format=function(e){var n=e||`YYYY-MM-DDTHH:mm:ss`,r={Y:this.$d.years,YY:t.s(this.$d.years,2,`0`),YYYY:t.s(this.$d.years,4,`0`),M:this.$d.months,MM:t.s(this.$d.months,2,`0`),D:this.$d.days,DD:t.s(this.$d.days,2,`0`),H:this.$d.hours,HH:t.s(this.$d.hours,2,`0`),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,`0`),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,`0`),SSS:t.s(this.$d.milliseconds,3,`0`)};return n.replace(u,(function(e,t){return t||String(r[e])}))},_.as=function(e){return this.$ms/d[m(e)]},_.get=function(e){var t=this.$ms,n=m(e);return n===`milliseconds`?t%=1e3:t=n===`weeks`?g(t/d[n]):this.$d[n],t||0},_.add=function(e,t,n){var r;return r=t?e*d[m(t)]:f(e)?e.$ms:p(e,this).$ms,p(this.$ms+r*(n?-1:1),this)},_.subtract=function(e,t){return this.add(e,t,!0)},_.locale=function(e){var t=this.clone();return t.$l=e,t},_.clone=function(){return p(this.$ms,this)},_.humanize=function(t){return e().add(this.$ms,`ms`).locale(this.$l).fromNow(!t)},_.valueOf=function(){return this.asMilliseconds()},_.milliseconds=function(){return this.get(`milliseconds`)},_.asMilliseconds=function(){return this.as(`milliseconds`)},_.seconds=function(){return this.get(`seconds`)},_.asSeconds=function(){return this.as(`seconds`)},_.minutes=function(){return this.get(`minutes`)},_.asMinutes=function(){return this.as(`minutes`)},_.hours=function(){return this.get(`hours`)},_.asHours=function(){return this.as(`hours`)},_.days=function(){return this.get(`days`)},_.asDays=function(){return this.as(`days`)},_.weeks=function(){return this.get(`weeks`)},_.asWeeks=function(){return this.as(`weeks`)},_.months=function(){return this.get(`months`)},_.asMonths=function(){return this.as(`months`)},_.years=function(){return this.get(`years`)},_.asYears=function(){return this.as(`years`)},h}(),b=function(e,t,n){return e.add(t.years()*n,`y`).add(t.months()*n,`M`).add(t.days()*n,`d`).add(t.hours()*n,`h`).add(t.minutes()*n,`m`).add(t.seconds()*n,`s`).add(t.milliseconds()*n,`ms`)};return function(n,r,i){e=i,t=i().$utils(),i.duration=function(e,t){return p(e,{$l:i.locale()},t)},i.isDuration=f;var a=r.prototype.add,o=r.prototype.subtract;r.prototype.add=function(e,t){return f(e)?b(this,e,1):a.bind(this)(e,t)},r.prototype.subtract=function(e,t){return f(e)?b(this,e,-1):o.bind(this)(e,t)}}}))})),uit=l({diagram:()=>eat});function C2(e,t,n){let r=!0;for(;r;)r=!1,n.forEach(function(n){let i=`^\\s*`+n+`\\s*$`,a=new RegExp(i);e[0].match(a)&&(t[n]=!0,e.shift(1),r=!0)})}var dit,w2,fit,pit,mit,T2,hit,E2,git,D2,O2,k2,A2,j2,M2,N2,P2,F2,I2,L2,R2,z2,B2,V2,H2,U2,W2,G2,K2,_it,vit,yit,bit,xit,Sit,Cit,wit,Tit,Eit,Dit,Oit,kit,Ait,jit,Mit,q2,Nit,Pit,Fit,Iit,Lit,Rit,zit,Bit,J2,Vit,Hit,Uit,Y2,Wit,X2,Z2,Q2,$2,e4,Git,Kit,t4,n4,r4,i4,qit,a4,Jit,o4,Yit,s4,Xit,c4,Zit,Qit,l4,$it,u4,d4,eat,tat=o((()=>{rh(),dc(),S(),h(),dit=Kp(),w2=d(g(),1),fit=d(oit(),1),pit=d(sit(),1),mit=d(cit(),1),T2=d(g(),1),hit=d(lit(),1),_p(),E2=(function(){var e=p(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],a=[1,29],o=[1,30],s=[1,31],l=[1,32],u=[1,33],d=[1,34],f=[1,9],m=[1,10],h=[1,11],g=[1,12],_=[1,13],v=[1,14],y=[1,15],b=[1,16],x=[1,19],S=[1,20],C=[1,21],w=[1,22],T=[1,23],E=[1,25],D=[1,35],O={trace:p(function(){},`trace`),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:`error`,4:`gantt`,6:`EOF`,8:`SPACE`,10:`NL`,12:`weekday_monday`,13:`weekday_tuesday`,14:`weekday_wednesday`,15:`weekday_thursday`,16:`weekday_friday`,17:`weekday_saturday`,18:`weekday_sunday`,20:`weekend_friday`,21:`weekend_saturday`,22:`dateFormat`,23:`inclusiveEndDates`,24:`topAxis`,25:`axisFormat`,26:`tickInterval`,27:`excludes`,28:`includes`,29:`todayMarker`,30:`title`,31:`acc_title`,32:`acc_title_value`,33:`acc_descr`,34:`acc_descr_value`,35:`acc_descr_multiline_value`,36:`section`,38:`taskTxt`,39:`taskData`,40:`click`,41:`callbackname`,42:`callbackargs`,43:`href`},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:p(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 2:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 6:case 7:this.$=[];break;case 8:r.setWeekday(`monday`);break;case 9:r.setWeekday(`tuesday`);break;case 10:r.setWeekday(`wednesday`);break;case 11:r.setWeekday(`thursday`);break;case 12:r.setWeekday(`friday`);break;case 13:r.setWeekday(`saturday`);break;case 14:r.setWeekday(`sunday`);break;case 15:r.setWeekend(`friday`);break;case 16:r.setWeekend(`saturday`);break;case 17:r.setDateFormat(a[s].substr(11)),this.$=a[s].substr(11);break;case 18:r.enableInclusiveEndDates(),this.$=a[s].substr(18);break;case 19:r.TopAxis(),this.$=a[s].substr(8);break;case 20:r.setAxisFormat(a[s].substr(11)),this.$=a[s].substr(11);break;case 21:r.setTickInterval(a[s].substr(13)),this.$=a[s].substr(13);break;case 22:r.setExcludes(a[s].substr(9)),this.$=a[s].substr(9);break;case 23:r.setIncludes(a[s].substr(9)),this.$=a[s].substr(9);break;case 24:r.setTodayMarker(a[s].substr(12)),this.$=a[s].substr(12);break;case 27:r.setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 28:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 29:case 30:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 31:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 33:r.addTask(a[s-1],a[s]),this.$=`task`;break;case 34:this.$=a[s-1],r.setClickEvent(a[s-1],a[s],null);break;case 35:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 36:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],null),r.setLink(a[s-2],a[s]);break;case 37:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-2],a[s-1]),r.setLink(a[s-3],a[s]);break;case 38:this.$=a[s-2],r.setClickEvent(a[s-2],a[s],null),r.setLink(a[s-2],a[s-1]);break;case 39:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-1],a[s]),r.setLink(a[s-3],a[s-2]);break;case 40:this.$=a[s-1],r.setLink(a[s-1],a[s]);break;case 41:case 47:this.$=a[s-1]+` `+a[s];break;case 42:case 43:case 45:this.$=a[s-2]+` `+a[s-1]+` `+a[s];break;case 44:case 46:this.$=a[s-3]+` `+a[s-2]+` `+a[s-1]+` `+a[s]}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},e(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:a,16:o,17:s,18:l,19:18,20:u,21:d,22:f,23:m,24:h,25:g,26:_,27:v,28:y,29:b,30:x,31:S,33:C,35:w,36:T,37:24,38:E,40:D},e(t,[2,7],{1:[2,1]}),e(t,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:a,16:o,17:s,18:l,19:18,20:u,21:d,22:f,23:m,24:h,25:g,26:_,27:v,28:y,29:b,30:x,31:S,33:C,35:w,36:T,37:24,38:E,40:D},e(t,[2,5]),e(t,[2,6]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,20]),e(t,[2,21]),e(t,[2,22]),e(t,[2,23]),e(t,[2,24]),e(t,[2,25]),e(t,[2,26]),e(t,[2,27]),{32:[1,37]},{34:[1,38]},e(t,[2,30]),e(t,[2,31]),e(t,[2,32]),{39:[1,39]},e(t,[2,8]),e(t,[2,9]),e(t,[2,10]),e(t,[2,11]),e(t,[2,12]),e(t,[2,13]),e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),{41:[1,40],43:[1,41]},e(t,[2,4]),e(t,[2,28]),e(t,[2,29]),e(t,[2,33]),e(t,[2,34],{42:[1,42],43:[1,43]}),e(t,[2,40],{41:[1,44]}),e(t,[2,35],{43:[1,45]}),e(t,[2,36]),e(t,[2,38],{42:[1,46]}),e(t,[2,37]),e(t,[2,39])],defaultActions:{},parseError:p(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:p(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,l=0,u=0,d=0,f=2,m=1,h=a.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(_.yy[v]=this.yy[v]);g.setInput(e,_.yy),_.yy.lexer=g,_.yy.parser=this,g.yylloc===void 0&&(g.yylloc={});var y=g.yylloc;a.push(y);var b=g.options&&g.options.ranges;this.parseError=typeof _.yy.parseError==`function`?_.yy.parseError:Object.getPrototypeOf(this).parseError;function x(e){n.length-=2*e,i.length-=e,a.length-=e}p(x,`popStack`);function S(){var e=r.pop()||g.lex()||m;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}p(S,`lex`);for(var C,w,T,E,D,O={},k,A,j,M;;){if(T=n[n.length-1],this.defaultActions[T]?E=this.defaultActions[T]:(C??=S(),E=o[T]&&o[T][C]),E===void 0||!E.length||!E[0]){var N=``;for(k in M=[],o[T])this.terminals_[k]&&k>f&&M.push(`'`+this.terminals_[k]+`'`);N=g.showPosition?`Parse error on line `+(l+1)+`:1475+`+g.showPosition()+`1476+Expecting `+M.join(`, `)+`, got '`+(this.terminals_[C]||C)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(C==m?`end of input`:`'`+(this.terminals_[C]||C)+`'`),this.parseError(N,{text:g.match,token:this.terminals_[C]||C,line:g.yylineno,loc:y,expected:M})}if(E[0]instanceof Array&&E.length>1)throw Error(`Parse Error: multiple actions possible at state: `+T+`, token: `+C);switch(E[0]){case 1:n.push(C),i.push(g.yytext),a.push(g.yylloc),n.push(E[1]),C=null,w?(C=w,w=null):(u=g.yyleng,s=g.yytext,l=g.yylineno,y=g.yylloc,d>0&&d--);break;case 2:if(A=this.productions_[E[1]][1],O.$=i[i.length-A],O._$={first_line:a[a.length-(A||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(A||1)].first_column,last_column:a[a.length-1].last_column},b&&(O._$.range=[a[a.length-(A||1)].range[0],a[a.length-1].range[1]]),D=this.performAction.apply(O,[s,u,l,_.yy,E[1],i,a].concat(h)),D!==void 0)return D;A&&(n=n.slice(0,-1*A*2),i=i.slice(0,-1*A),a=a.slice(0,-1*A)),n.push(this.productions_[E[1]][0]),i.push(O.$),a.push(O._$),j=o[n[n.length-2]][n[n.length-1]],n.push(j);break;case 3:return!0}}return!0},`parse`)};O.lexer=(function(){return{EOF:1,parseError:p(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:p(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:p(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:p(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:p(function(){return this._more=!0,this},`more`),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).1477+`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:p(function(e){this.unput(this.match.slice(e))},`less`),pastInput:p(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:p(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:p(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`1478+`+t+`^`},`showPosition`),test_match:p(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.1479+`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:p(function(){return this.next()||this.lex()},`lex`),begin:p(function(e){this.conditionStack.push(e)},`begin`),popState:p(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:p(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:p(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:p(function(e){this.begin(e)},`pushState`),stateStackSize:p(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:p(function(e,t,n,r){switch(n){case 0:return this.begin(`open_directive`),`open_directive`;case 1:return this.begin(`acc_title`),31;case 2:return this.popState(),`acc_title_value`;case 3:return this.begin(`acc_descr`),33;case 4:return this.popState(),`acc_descr_value`;case 5:this.begin(`acc_descr_multiline`);break;case 6:this.popState();break;case 7:return`acc_descr_multiline_value`;case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin(`href`);break;case 15:this.popState();break;case 16:return 43;case 17:this.begin(`callbackname`);break;case 18:this.popState();break;case 19:this.popState(),this.begin(`callbackargs`);break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin(`click`);break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return`date`;case 45:return 30;case 46:return`accDescription`;case 47:return 36;case 48:return 38;case 49:return 39;case 50:return`:`;case 51:return 6;case 52:return`INVALID`}},`anonymous`),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}}})();function k(){this.yy={}}return p(k,`Parser`),k.prototype=O,O.Parser=k,new k})(),E2.parser=E2,git=E2,w2.default.extend(fit.default),w2.default.extend(pit.default),w2.default.extend(mit.default),D2={friday:5,saturday:6},O2=``,k2=``,A2=void 0,j2=``,M2=[],N2=[],P2=new Map,F2=[],I2=[],L2=``,R2=``,z2=[`active`,`done`,`crit`,`milestone`,`vert`],B2=[],V2=``,H2=!1,U2=!1,W2=`sunday`,G2=`saturday`,K2=0,_it=p(function(){F2=[],I2=[],L2=``,B2=[],$2=0,t4=void 0,n4=void 0,r4=[],O2=``,k2=``,R2=``,A2=void 0,j2=``,M2=[],N2=[],H2=!1,U2=!1,K2=0,P2=new Map,V2=``,Xs(),W2=`sunday`,G2=`saturday`},`clear`),vit=p(function(e){V2=e},`setDiagramId`),yit=p(function(e){k2=e},`setAxisFormat`),bit=p(function(){return k2},`getAxisFormat`),xit=p(function(e){A2=e},`setTickInterval`),Sit=p(function(){return A2},`getTickInterval`),Cit=p(function(e){j2=e},`setTodayMarker`),wit=p(function(){return j2},`getTodayMarker`),Tit=p(function(e){O2=e},`setDateFormat`),Eit=p(function(){H2=!0},`enableInclusiveEndDates`),Dit=p(function(){return H2},`endDatesAreInclusive`),Oit=p(function(){U2=!0},`enableTopAxis`),kit=p(function(){return U2},`topAxisEnabled`),Ait=p(function(e){R2=e},`setDisplayMode`),jit=p(function(){return R2},`getDisplayMode`),Mit=p(function(){return O2},`getDateFormat`),q2=p((e,t)=>{let n=t.toLowerCase().split(/[\s,]+/).filter(e=>e!==``);return[...new Set([...e,...n])]},`mergeTokens`),Nit=p(function(e){M2=q2(M2,e)},`setIncludes`),Pit=p(function(){return M2},`getIncludes`),Fit=p(function(e){N2=q2(N2,e)},`setExcludes`),Iit=p(function(){return N2},`getExcludes`),Lit=p(function(){return P2},`getLinks`),Rit=p(function(e){L2=e,F2.push(e)},`addSection`),zit=p(function(){return F2},`getSections`),Bit=p(function(){let e=o4(),t=0;for(;!e&&t<10;)e=o4(),t++;return I2=r4,I2},`getTasks`),J2=p(function(e,t,n,r){let i=e.format(t.trim()),a=e.format(`YYYY-MM-DD`);return r.includes(i)||r.includes(a)?!1:n.includes(`weekends`)&&(e.isoWeekday()===D2[G2]||e.isoWeekday()===D2[G2]+1)||n.includes(e.format(`dddd`).toLowerCase())?!0:n.includes(i)||n.includes(a)},`isInvalidDate`),Vit=p(function(e){W2=e},`setWeekday`),Hit=p(function(){return W2},`getWeekday`),Uit=p(function(e){G2=e},`setWeekend`),Y2=p(function(e,t,n,r){if(!n.length||e.manualEndTime)return;let i;i=e.startTime instanceof Date?(0,w2.default)(e.startTime):(0,w2.default)(e.startTime,t,!0),i=i.add(1,`d`);let a;a=e.endTime instanceof Date?(0,w2.default)(e.endTime):(0,w2.default)(e.endTime,t,!0);let[o,s]=Wit(i,a,t,n,r);e.endTime=o.toDate(),e.renderEndTime=s},`checkTaskDates`),Wit=p(function(e,t,n,r,i){let a=!1,o=null,s=t.add(1e4,`d`);for(;e<=t;){if(a||(o=t.toDate()),a=J2(e,n,r,i),a&&(t=t.add(1,`d`),t>s))throw Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.");e=e.add(1,`d`)}return[t,o]},`fixTaskDates`),X2=p(function(e,t,n){if(n=n.trim(),p(e=>{let t=e.trim();return t===`x`||t===`X`},`isTimestampFormat`)(t)&&/^\d+$/.test(n))return new Date(Number(n));let r=/^after\s+(?<ids>[\d\w- ]+)/.exec(n);if(r!==null){let e=null;for(let t of r.groups.ids.split(` `)){let n=a4(t);n!==void 0&&(!e||n.endTime>e.endTime)&&(e=n)}if(e)return e.endTime;let t=new Date;return t.setHours(0,0,0,0),t}let i=(0,w2.default)(n,t.trim(),!0);if(i.isValid())return i.toDate();{y.debug(`Invalid date:`+n),y.debug(`With date format:`+t.trim());let e=new Date(n);if(e===void 0||isNaN(e.getTime())||e.getFullYear()<-1e4||e.getFullYear()>1e4)throw Error(`Invalid date:`+n);return e}},`getStartDate`),Z2=p(function(e){let t=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(e.trim());return t===null?[NaN,`ms`]:[Number.parseFloat(t[1]),t[2]]},`parseDuration`),Q2=p(function(e,t,n,r=!1){n=n.trim();let i=/^until\s+(?<ids>[\d\w- ]+)/.exec(n);if(i!==null){let e=null;for(let t of i.groups.ids.split(` `)){let n=a4(t);n!==void 0&&(!e||n.startTime<e.startTime)&&(e=n)}if(e)return e.startTime;let t=new Date;return t.setHours(0,0,0,0),t}let a=(0,w2.default)(n,t.trim(),!0);if(a.isValid())return r&&(a=a.add(1,`d`)),a.toDate();let o=(0,w2.default)(e),[s,l]=Z2(n);if(!Number.isNaN(s)){let e=o.add(s,l);e.isValid()&&(o=e)}return o.toDate()},`getEndDate`),$2=0,e4=p(function(e){return e===void 0?($2+=1,`task`+$2):e},`parseId`),Git=p(function(e,t){let n;n=t.substr(0,1)===`:`?t.substr(1,t.length):t;let r=n.split(`,`),i={};C2(r,i,z2);for(let e=0;e<r.length;e++)r[e]=r[e].trim();let a=``;switch(r.length){case 1:i.id=e4(),i.startTime=e.endTime,a=r[0];break;case 2:i.id=e4(),i.startTime=X2(void 0,O2,r[0]),a=r[1];break;case 3:i.id=e4(r[0]),i.startTime=X2(void 0,O2,r[1]),a=r[2]}return a&&(i.endTime=Q2(i.startTime,O2,a,H2),i.manualEndTime=(0,w2.default)(a,`YYYY-MM-DD`,!0).isValid(),Y2(i,O2,N2,M2)),i},`compileData`),Kit=p(function(e,t){let n;n=t.substr(0,1)===`:`?t.substr(1,t.length):t;let r=n.split(`,`),i={};C2(r,i,z2);for(let e=0;e<r.length;e++)r[e]=r[e].trim();switch(r.length){case 1:i.id=e4(),i.startTime={type:`prevTaskEnd`,id:e},i.endTime={data:r[0]};break;case 2:i.id=e4(),i.startTime={type:`getStartDate`,startData:r[0]},i.endTime={data:r[1]};break;case 3:i.id=e4(r[0]),i.startTime={type:`getStartDate`,startData:r[1]},i.endTime={data:r[2]}}return i},`parseData`),r4=[],i4={},qit=p(function(e,t){let n={section:L2,type:L2,processed:!1,manualEndTime:!1,renderEndTime:null,raw:{data:t},task:e,classes:[]},r=Kit(n4,t);n.raw.startTime=r.startTime,n.raw.endTime=r.endTime,n.id=r.id,n.prevTaskId=n4,n.active=r.active,n.done=r.done,n.crit=r.crit,n.milestone=r.milestone,n.vert=r.vert,n.vert?n.order=-1:(n.order=K2,K2++);let i=r4.push(n);n4=n.id,i4[n.id]=i-1},`addTask`),a4=p(function(e){let t=i4[e];return r4[t]},`findTaskById`),Jit=p(function(e,t){let n={section:L2,type:L2,description:e,task:e,classes:[]},r=Git(t4,t);n.startTime=r.startTime,n.endTime=r.endTime,n.id=r.id,n.active=r.active,n.done=r.done,n.crit=r.crit,n.milestone=r.milestone,n.vert=r.vert,t4=n,I2.push(n)},`addTaskOrg`),o4=p(function(){let e=p(function(e){let t=r4[e],n=``;switch(r4[e].raw.startTime.type){case`prevTaskEnd`:t.startTime=a4(t.prevTaskId).endTime;break;case`getStartDate`:n=X2(void 0,O2,r4[e].raw.startTime.startData),n&&(r4[e].startTime=n)}return r4[e].startTime&&(r4[e].endTime=Q2(r4[e].startTime,O2,r4[e].raw.endTime.data,H2),r4[e].endTime&&(r4[e].processed=!0,r4[e].manualEndTime=(0,w2.default)(r4[e].raw.endTime.data,`YYYY-MM-DD`,!0).isValid(),Y2(r4[e],O2,N2,M2))),r4[e].processed},`compileTask`),t=!0;for(let[n,r]of r4.entries())e(n),t&&=r.processed;return t},`compileTasks`),Yit=p(function(e,t){let n=t;Z().securityLevel!==`loose`&&(n=(0,dit.sanitizeUrl)(t)),e.split(`,`).forEach(function(e){a4(e)!==void 0&&(c4(e,()=>{window.open(n,`_self`)}),P2.set(e,n))}),s4(e,`clickable`)},`setLink`),s4=p(function(e,t){e.split(`,`).forEach(function(e){let n=a4(e);n!==void 0&&n.classes.push(t)})},`setClass`),Xit=p(function(e,t,n){if(Z().securityLevel!==`loose`||t===void 0)return;let r=[];if(typeof n==`string`){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e<r.length;e++){let t=r[e].trim();t.startsWith(`"`)&&t.endsWith(`"`)&&(t=t.substr(1,t.length-2)),r[e]=t}}r.length===0&&r.push(e),a4(e)!==void 0&&c4(e,()=>{eh.runFunc(t,...r)})},`setClickFun`),c4=p(function(e,t){B2.push(function(){let n=V2?`${V2}-${e}`:e,r=document.querySelector(`[id="${n}"]`);r!==null&&r.addEventListener(`click`,function(){t()})},function(){let n=V2?`${V2}-${e}`:e,r=document.querySelector(`[id="${n}-text"]`);r!==null&&r.addEventListener(`click`,function(){t()})})},`pushFun`),Zit={getConfig:p(()=>Z().gantt,`getConfig`),clear:_it,setDateFormat:Tit,getDateFormat:Mit,enableInclusiveEndDates:Eit,endDatesAreInclusive:Dit,enableTopAxis:Oit,topAxisEnabled:kit,setAxisFormat:yit,getAxisFormat:bit,setTickInterval:xit,getTickInterval:Sit,setTodayMarker:Cit,getTodayMarker:wit,setAccTitle:Zs,getAccTitle:Qs,setDiagramTitle:tc,getDiagramTitle:nc,setDiagramId:vit,setDisplayMode:Ait,getDisplayMode:jit,setAccDescription:$s,getAccDescription:ec,addSection:Rit,getSections:zit,getTasks:Bit,addTask:qit,findTaskById:a4,addTaskOrg:Jit,setIncludes:Nit,getIncludes:Pit,setExcludes:Fit,getExcludes:Iit,setClickEvent:p(function(e,t,n){e.split(`,`).forEach(function(e){Xit(e,t,n)}),s4(e,`clickable`)},`setClickEvent`),setLink:Yit,getLinks:Lit,bindFunctions:p(function(e){B2.forEach(function(t){t(e)})},`bindFunctions`),parseDuration:Z2,isInvalidDate:J2,setWeekday:Vit,getWeekday:Hit,setWeekend:Uit},p(C2,`getTaskTags`),T2.default.extend(hit.default),Qit=p(function(){y.debug(`Something is calling, setConf, remove the call`)},`setConf`),l4={monday:Ed,tuesday:Dd,wednesday:Od,thursday:kd,friday:Ad,saturday:jd,sunday:Td},$it=p((e,t)=>{let n=[...e].map(()=>-1/0),r=[...e].sort((e,t)=>e.startTime-t.startTime||e.order-t.order),i=0;for(let e of r)for(let r=0;r<n.length;r++)if(e.startTime>=n[r]){n[r]=e.endTime,e.order=r+t,r>i&&(i=r);break}return i},`getMaxIntersections`),d4=1e4,eat={parser:git,db:Zit,renderer:{setConf:Qit,draw:p(function(e,t,n,r){let i=Z().gantt;r.db.setDiagramId(t);let a=Z().securityLevel,o;a===`sandbox`&&(o=$c(`#i`+t));let s=$c(a===`sandbox`?o.nodes()[0].contentDocument.body:`body`),l=a===`sandbox`?o.nodes()[0].contentDocument:document,u=l.getElementById(t);u4=u.parentElement.offsetWidth,u4===void 0&&(u4=1200),i.useWidth!==void 0&&(u4=i.useWidth);let d=r.db.getTasks(),f=d.filter(e=>!e.vert),m=[];for(let e of f)m.push(e.type);m=O(m);let h={},g=2*i.topPadding;if(r.db.getDisplayMode()===`compact`||i.displayMode===`compact`){let e={};for(let t of f)e[t.section]===void 0?e[t.section]=[t]:e[t.section].push(t);let t=0;for(let n of Object.keys(e)){let r=$it(e[n],t)+1;t+=r,g+=r*(i.barHeight+i.barGap),h[n]=r}}else{g+=f.length*(i.barHeight+i.barGap);for(let e of m)h[e]=f.filter(t=>t.type===e).length}u.setAttribute(`viewBox`,`0 0 `+u4+` `+g);let _=s.select(`[id="${t}"]`),v=Gfe().domain([cre(d,function(e){return e.startTime}),ore(d,function(e){return e.endTime})]).rangeRound([0,u4-i.leftPadding-i.rightPadding]);function b(e,t){let n=e.startTime,r=t.startTime,i=0;return n>r?i=1:n<r&&(i=-1),i}p(b,`taskCompare`),d.sort(b),x(d,u4,g),Hs(_,g,u4,i.useMaxWidth),_.append(`text`).text(r.db.getDiagramTitle()).attr(`x`,u4/2).attr(`y`,i.titleTopMargin).attr(`class`,`titleText`);function x(e,t,n){let a=i.barHeight,o=a+i.barGap,s=i.topPadding,l=i.leftPadding,u=td().domain([0,m.length]).range([`#00B9FA`,`#F95002`]).interpolate(ase);C(o,s,l,t,n,e,r.db.getExcludes(),r.db.getIncludes()),T(l,s,t,n),S(e,o,s,l,a,u,t,n),E(o,s,l,a,u),D(l,s,t,n)}p(x,`makeGantt`);function S(e,n,a,o,s,l,u){e.sort((e,t)=>e.vert===t.vert?0:e.vert?1:-1);let d=e.filter(e=>!e.vert),f=[...new Set(d.map(e=>e.order))].map(e=>d.find(t=>t.order===e));_.append(`g`).selectAll(`rect`).data(f).enter().append(`rect`).attr(`x`,0).attr(`y`,function(e,t){return t=e.order,t*n+a-2}).attr(`width`,function(){return u-i.rightPadding/2}).attr(`height`,n).attr(`class`,function(e){for(let[t,n]of m.entries())if(e.type===n)return`section section`+t%i.numberSectionStyles;return`section section0`}).enter();let p=_.append(`g`).selectAll(`rect`).data(e).enter(),h=r.db.getLinks();if(p.append(`rect`).attr(`id`,function(e){return t+`-`+e.id}).attr(`rx`,3).attr(`ry`,3).attr(`x`,function(e){return e.milestone?v(e.startTime)+o+.5*(v(e.endTime)-v(e.startTime))-.5*s:v(e.startTime)+o}).attr(`y`,function(e,t){return t=e.order,e.vert?i.gridLineStartPadding:t*n+a}).attr(`width`,function(e){return e.milestone?s:e.vert?.08*s:v(e.renderEndTime||e.endTime)-v(e.startTime)}).attr(`height`,function(e){return e.vert?d.length*(i.barHeight+i.barGap)+i.barHeight*2:s}).attr(`transform-origin`,function(e,t){return t=e.order,(v(e.startTime)+o+.5*(v(e.endTime)-v(e.startTime))).toString()+`px `+(t*n+a+.5*s).toString()+`px`}).attr(`class`,function(e){let t=``;e.classes.length>0&&(t=e.classes.join(` `));let n=0;for(let[t,r]of m.entries())e.type===r&&(n=t%i.numberSectionStyles);let r=``;return e.active?e.crit?r+=` activeCrit`:r=` active`:e.done?r=e.crit?` doneCrit`:` done`:e.crit&&(r+=` crit`),r.length===0&&(r=` task`),e.milestone&&(r=` milestone `+r),e.vert&&(r=` vert `+r),r+=n,r+=` `+t,`task`+r}),p.append(`text`).attr(`id`,function(e){return t+`-`+e.id+`-text`}).text(function(e){return e.task}).attr(`font-size`,i.fontSize).attr(`x`,function(e){let t=v(e.startTime),n=v(e.renderEndTime||e.endTime);if(e.milestone&&(t+=.5*(v(e.endTime)-v(e.startTime))-.5*s,n=t+s),e.vert)return v(e.startTime)+o;let r=this.getBBox().width;return r>n-t?n+r+1.5*i.leftPadding>u?t+o-5:n+o+5:(n-t)/2+t+o}).attr(`y`,function(e,t){return e.vert?i.gridLineStartPadding+d.length*(i.barHeight+i.barGap)+60:(t=e.order,t*n+i.barHeight/2+(i.fontSize/2-2)+a)}).attr(`text-height`,s).attr(`class`,function(e){let t=v(e.startTime),n=v(e.endTime);e.milestone&&(n=t+s);let r=this.getBBox().width,a=``;e.classes.length>0&&(a=e.classes.join(` `));let o=0;for(let[t,n]of m.entries())e.type===n&&(o=t%i.numberSectionStyles);let l=``;return e.active&&(l=e.crit?`activeCritText`+o:`activeText`+o),e.done?l=e.crit?l+` doneCritText`+o:l+` doneText`+o:e.crit&&(l=l+` critText`+o),e.milestone&&(l+=` milestoneText`),e.vert&&(l+=` vertText`),r>n-t?n+r+1.5*i.leftPadding>u?a+` taskTextOutsideLeft taskTextOutside`+o+` `+l:a+` taskTextOutsideRight taskTextOutside`+o+` `+l+` width-`+r:a+` taskText taskText`+o+` `+l+` width-`+r}),Z().securityLevel===`sandbox`){let e;e=$c(`#i`+t);let n=e.nodes()[0].contentDocument;p.filter(function(e){return h.has(e.id)}).each(function(e){var r=n.querySelector(`#`+CSS.escape(t+`-`+e.id)),i=n.querySelector(`#`+CSS.escape(t+`-`+e.id+`-text`));let a=r.parentNode;var o=n.createElement(`a`);o.setAttribute(`xlink:href`,h.get(e.id)),o.setAttribute(`target`,`_top`),a.appendChild(o),o.appendChild(r),o.appendChild(i)})}}p(S,`drawRects`);function C(e,n,a,o,s,l,u,d){if(u.length===0&&d.length===0)return;let f,p;for(let{startTime:e,endTime:t}of l)(f===void 0||e<f)&&(f=e),(p===void 0||t>p)&&(p=t);if(!f||!p)return;if((0,T2.default)(p).diff((0,T2.default)(f),`year`)>5){y.warn(`The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.`);return}let m=r.db.getDateFormat(),h=[],g=null,b=(0,T2.default)(f);for(;b.valueOf()<=p;)r.db.isInvalidDate(b,m,u,d)?g?g.end=b:g={start:b,end:b}:g&&=(h.push(g),null),b=b.add(1,`d`);_.append(`g`).selectAll(`rect`).data(h).enter().append(`rect`).attr(`id`,e=>t+`-exclude-`+e.start.format(`YYYY-MM-DD`)).attr(`x`,e=>v(e.start.startOf(`day`))+a).attr(`y`,i.gridLineStartPadding).attr(`width`,e=>v(e.end.endOf(`day`))-v(e.start.startOf(`day`))).attr(`height`,s-n-i.gridLineStartPadding).attr(`transform-origin`,function(t,n){return(v(t.start)+a+.5*(v(t.end)-v(t.start))).toString()+`px `+(n*e+.5*s).toString()+`px`}).attr(`class`,`exclude-range`)}p(C,`drawExcludeDays`);function w(e,t,n,r){if(n<=0||e>t)return 1/0;let i=t-e,a=T2.default.duration({[r??`day`]:n}).asMilliseconds();return a<=0?1/0:Math.ceil(i/a)}p(w,`getEstimatedTickCount`);function T(e,t,n,a){let o=r.db.getDateFormat(),s=r.db.getAxisFormat(),l;l=s||(o===`D`?`%d`:i.axisFormat??`%Y-%m-%d`);let u=bre(v).tickSize(-a+t+i.gridLineStartPadding).tickFormat(Yd(l)),d=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(r.db.getTickInterval()||i.tickInterval);if(d!==null){let e=parseInt(d[1],10);if(isNaN(e)||e<=0)y.warn(`Invalid tick interval value: "${d[1]}". Skipping custom tick interval.`);else{let t=d[2],n=r.db.getWeekday()||i.weekday,a=v.domain(),o=a[0],s=a[1],l=w(o,s,e,t);if(l>d4)y.warn(`The tick interval "${e}${t}" would generate ${l} ticks, which exceeds the maximum allowed (${d4}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(t){case`millisecond`:u.ticks(od.every(e));break;case`second`:u.ticks(hd.every(e));break;case`minute`:u.ticks(gd.every(e));break;case`hour`:u.ticks(vd.every(e));break;case`day`:u.ticks(bd.every(e));break;case`week`:u.ticks(l4[n].every(e));break;case`month`:u.ticks(Fd.every(e))}}}if(_.append(`g`).attr(`class`,`grid`).attr(`transform`,`translate(`+e+`, `+(a-50)+`)`).call(u).selectAll(`text`).style(`text-anchor`,`middle`).attr(`fill`,`#000`).attr(`stroke`,`none`).attr(`font-size`,10).attr(`dy`,`1em`),r.db.topAxisEnabled()||i.topAxis){let n=yre(v).tickSize(-a+t+i.gridLineStartPadding).tickFormat(Yd(l));if(d!==null){let e=parseInt(d[1],10);if(isNaN(e)||e<=0)y.warn(`Invalid tick interval value: "${d[1]}". Skipping custom tick interval.`);else{let t=d[2],a=r.db.getWeekday()||i.weekday,o=v.domain(),s=o[0],l=o[1];if(w(s,l,e,t)<=d4)switch(t){case`millisecond`:n.ticks(od.every(e));break;case`second`:n.ticks(hd.every(e));break;case`minute`:n.ticks(gd.every(e));break;case`hour`:n.ticks(vd.every(e));break;case`day`:n.ticks(bd.every(e));break;case`week`:n.ticks(l4[a].every(e));break;case`month`:n.ticks(Fd.every(e))}}}_.append(`g`).attr(`class`,`grid`).attr(`transform`,`translate(`+e+`, `+t+`)`).call(n).selectAll(`text`).style(`text-anchor`,`middle`).attr(`fill`,`#000`).attr(`stroke`,`none`).attr(`font-size`,10)}}p(T,`makeGrid`);function E(e,t){let n=0,r=Object.keys(h).map(e=>[e,h[e]]);_.append(`g`).selectAll(`text`).data(r).enter().append(function(e){let t=e[0].split(Vs.lineBreakRegex),n=-(t.length-1)/2,r=l.createElementNS(`http://www.w3.org/2000/svg`,`text`);r.setAttribute(`dy`,n+`em`);for(let[e,n]of t.entries()){let t=l.createElementNS(`http://www.w3.org/2000/svg`,`tspan`);t.setAttribute(`alignment-baseline`,`central`),t.setAttribute(`x`,`10`),e>0&&t.setAttribute(`dy`,`1em`),t.textContent=n,r.appendChild(t)}return r}).attr(`x`,10).attr(`y`,function(i,a){if(a>0)for(let o=0;o<a;o++)return n+=r[a-1][1],i[1]*e/2+n*e+t;else return i[1]*e/2+t}).attr(`font-size`,i.sectionFontSize).attr(`class`,function(e){for(let[t,n]of m.entries())if(e[0]===n)return`sectionTitle sectionTitle`+t%i.numberSectionStyles;return`sectionTitle`})}p(E,`vertLabels`);function D(e,t,n,a){let o=r.db.getTodayMarker();if(o===`off`)return;let s=_.append(`g`).attr(`class`,`today`),l=new Date,u=s.append(`line`);u.attr(`x1`,v(l)+e).attr(`x2`,v(l)+e).attr(`y1`,i.titleTopMargin).attr(`y2`,a-i.titleTopMargin).attr(`class`,`today`),o!==``&&u.attr(`style`,o.replace(/,/g,`;`))}p(D,`drawToday`);function O(e){let t={},n=[];for(let r=0,i=e.length;r<i;++r)Object.prototype.hasOwnProperty.call(t,e[r])||(t[e[r]]=!0,n.push(e[r]));return n}p(O,`checkUnique`)},`draw`)},styles:p(e=>`1480+ .mermaid-main-font {1481+ font-family: ${e.fontFamily};1482+ }1483+1484+ .exclude-range {1485+ fill: ${e.excludeBkgColor};1486+ }1487+1488+ .section {1489+ stroke: none;1490+ opacity: 0.2;1491+ }1492+1493+ .section0 {1494+ fill: ${e.sectionBkgColor};1495+ }1496+1497+ .section2 {1498+ fill: ${e.sectionBkgColor2};1499+ }1500+1501+ .section1,1502+ .section3 {1503+ fill: ${e.altSectionBkgColor};1504+ opacity: 0.2;1505+ }1506+1507+ .sectionTitle0 {1508+ fill: ${e.titleColor};1509+ }1510+1511+ .sectionTitle1 {1512+ fill: ${e.titleColor};1513+ }1514+1515+ .sectionTitle2 {1516+ fill: ${e.titleColor};1517+ }1518+1519+ .sectionTitle3 {1520+ fill: ${e.titleColor};1521+ }1522+1523+ .sectionTitle {1524+ text-anchor: start;1525+ font-family: ${e.fontFamily};1526+ }1527+1528+1529+ /* Grid and axis */1530+1531+ .grid .tick {1532+ stroke: ${e.gridColor};1533+ opacity: 0.8;1534+ shape-rendering: crispEdges;1535+ }1536+1537+ .grid .tick text {1538+ font-family: ${e.fontFamily};1539+ fill: ${e.textColor};1540+ }1541+1542+ .grid path {1543+ stroke-width: 0;1544+ }1545+1546+1547+ /* Today line */1548+1549+ .today {1550+ fill: none;1551+ stroke: ${e.todayLineColor};1552+ stroke-width: 2px;1553+ }1554+1555+1556+ /* Task styling */1557+1558+ /* Default task */1559+1560+ .task {1561+ stroke-width: 2;1562+ }1563+1564+ .taskText {1565+ text-anchor: middle;1566+ font-family: ${e.fontFamily};1567+ }1568+1569+ .taskTextOutsideRight {1570+ fill: ${e.taskTextDarkColor};1571+ text-anchor: start;1572+ font-family: ${e.fontFamily};1573+ }1574+1575+ .taskTextOutsideLeft {1576+ fill: ${e.taskTextDarkColor};1577+ text-anchor: end;1578+ }1579+1580+1581+ /* Special case clickable */1582+1583+ .task.clickable {1584+ cursor: pointer;1585+ }1586+1587+ .taskText.clickable {1588+ cursor: pointer;1589+ fill: ${e.taskTextClickableColor} !important;1590+ font-weight: bold;1591+ }1592+1593+ .taskTextOutsideLeft.clickable {1594+ cursor: pointer;1595+ fill: ${e.taskTextClickableColor} !important;1596+ font-weight: bold;1597+ }1598+1599+ .taskTextOutsideRight.clickable {1600+ cursor: pointer;1601+ fill: ${e.taskTextClickableColor} !important;1602+ font-weight: bold;1603+ }1604+1605+1606+ /* Specific task settings for the sections*/1607+1608+ .taskText0,1609+ .taskText1,1610+ .taskText2,1611+ .taskText3 {1612+ fill: ${e.taskTextColor};1613+ }1614+1615+ .task0,1616+ .task1,1617+ .task2,1618+ .task3 {1619+ fill: ${e.taskBkgColor};1620+ stroke: ${e.taskBorderColor};1621+ }1622+1623+ .taskTextOutside0,1624+ .taskTextOutside21625+ {1626+ fill: ${e.taskTextOutsideColor};1627+ }1628+1629+ .taskTextOutside1,1630+ .taskTextOutside3 {1631+ fill: ${e.taskTextOutsideColor};1632+ }1633+1634+1635+ /* Active task */1636+1637+ .active0,1638+ .active1,1639+ .active2,1640+ .active3 {1641+ fill: ${e.activeTaskBkgColor};1642+ stroke: ${e.activeTaskBorderColor};1643+ }1644+1645+ .activeText0,1646+ .activeText1,1647+ .activeText2,1648+ .activeText3 {1649+ fill: ${e.taskTextDarkColor} !important;1650+ }1651+1652+1653+ /* Completed task */1654+1655+ .done0,1656+ .done1,1657+ .done2,1658+ .done3 {1659+ stroke: ${e.doneTaskBorderColor};1660+ fill: ${e.doneTaskBkgColor};1661+ stroke-width: 2;1662+ }1663+1664+ .doneText0,1665+ .doneText1,1666+ .doneText2,1667+ .doneText3 {1668+ fill: ${e.taskTextDarkColor} !important;1669+ }1670+1671+ /* Done task text displayed outside the bar sits against the diagram background,1672+ not against the done-task bar, so it must use the outside/contrast color. */1673+ .doneText0.taskTextOutsideLeft,1674+ .doneText0.taskTextOutsideRight,1675+ .doneText1.taskTextOutsideLeft,1676+ .doneText1.taskTextOutsideRight,1677+ .doneText2.taskTextOutsideLeft,1678+ .doneText2.taskTextOutsideRight,1679+ .doneText3.taskTextOutsideLeft,1680+ .doneText3.taskTextOutsideRight {1681+ fill: ${e.taskTextOutsideColor} !important;1682+ }1683+1684+1685+ /* Tasks on the critical line */1686+1687+ .crit0,1688+ .crit1,1689+ .crit2,1690+ .crit3 {1691+ stroke: ${e.critBorderColor};1692+ fill: ${e.critBkgColor};1693+ stroke-width: 2;1694+ }1695+1696+ .activeCrit0,1697+ .activeCrit1,1698+ .activeCrit2,1699+ .activeCrit3 {1700+ stroke: ${e.critBorderColor};1701+ fill: ${e.activeTaskBkgColor};1702+ stroke-width: 2;1703+ }1704+1705+ .doneCrit0,1706+ .doneCrit1,1707+ .doneCrit2,1708+ .doneCrit3 {1709+ stroke: ${e.critBorderColor};1710+ fill: ${e.doneTaskBkgColor};1711+ stroke-width: 2;1712+ cursor: pointer;1713+ shape-rendering: crispEdges;1714+ }1715+1716+ .milestone {1717+ transform: rotate(45deg) scale(0.8,0.8);1718+ }1719+1720+ .milestoneText {1721+ font-style: italic;1722+ }1723+ .doneCritText0,1724+ .doneCritText1,1725+ .doneCritText2,1726+ .doneCritText3 {1727+ fill: ${e.taskTextDarkColor} !important;1728+ }1729+1730+ /* Done-crit task text outside the bar \u2014 same reasoning as doneText above. */1731+ .doneCritText0.taskTextOutsideLeft,1732+ .doneCritText0.taskTextOutsideRight,1733+ .doneCritText1.taskTextOutsideLeft,1734+ .doneCritText1.taskTextOutsideRight,1735+ .doneCritText2.taskTextOutsideLeft,1736+ .doneCritText2.taskTextOutsideRight,1737+ .doneCritText3.taskTextOutsideLeft,1738+ .doneCritText3.taskTextOutsideRight {1739+ fill: ${e.taskTextOutsideColor} !important;1740+ }1741+1742+ .vert {1743+ stroke: ${e.vertLineColor};1744+ }1745+1746+ .vertText {1747+ font-size: 15px;1748+ text-anchor: middle;1749+ fill: ${e.vertLineColor} !important;1750+ }1751+1752+ .activeCritText0,1753+ .activeCritText1,1754+ .activeCritText2,1755+ .activeCritText3 {1756+ fill: ${e.taskTextDarkColor} !important;1757+ }1758+1759+ .titleText {1760+ text-anchor: middle;1761+ font-size: 18px;1762+ fill: ${e.titleColor||e.textColor};1763+ font-family: ${e.fontFamily};1764+ }1765+`,`getStyles`)}})),nat=l({diagram:()=>aat}),rat,iat,aat,oat=o((()=>{yp(),dc(),S(),h(),G0(),rat={parse:p(async e=>{let t=await H0(`info`,e);y.debug(t)},`parse`)},iat={version:`11.17.0`},aat={parser:rat,db:{getVersion:p(()=>iat.version,`getVersion`)},renderer:{draw:p((e,t,n)=>{y.debug(`rendering info diagram1766+`+e);let r=vp(t);Hs(r,100,400,!0),r.append(`g`).append(`text`).attr(`x`,100).attr(`y`,40).attr(`class`,`version`).attr(`font-size`,32).style(`text-anchor`,`middle`).text(`v${n}`)},`draw`)}}})),sat=l({diagram:()=>pat}),f4,p4,m4,h4,cat,g4,lat,uat,dat,fat,pat,mat=o((()=>{lR(),yp(),rh(),dc(),S(),h(),G0(),_p(),f4=ns.pie,p4={sections:new Map,showData:!1,config:f4},m4=p4.sections,h4=p4.showData,cat=structuredClone(f4),g4={getConfig:p(()=>structuredClone(cat),`getConfig`),clear:p(()=>{m4=new Map,h4=p4.showData,Xs()},`clear`),setDiagramTitle:tc,getDiagramTitle:nc,setAccTitle:Zs,getAccTitle:Qs,setAccDescription:$s,getAccDescription:ec,addSection:p(({label:e,value:t})=>{if(t<0)throw Error(`"${e}" has invalid value: ${t}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);m4.has(e)||(m4.set(e,t),y.debug(`added new section: ${e}, with value: ${t}`))},`addSection`),getSections:p(()=>m4,`getSections`),setShowData:p(e=>{h4=e},`setShowData`),getShowData:p(()=>h4,`getShowData`)},lat=p((e,t)=>{cR(e,t),t.setShowData(e.showData),e.sections.map(t.addSection)},`populateDb`),uat={parse:p(async e=>{let t=await H0(`pie`,e);y.debug(t),lat(t,g4)},`parse`)},dat=p(e=>`1767+ .pieCircle{1768+ stroke: ${e.pieStrokeColor};1769+ stroke-width : ${e.pieStrokeWidth};1770+ opacity : ${e.pieOpacity};1771+ }1772+ .pieCircle.highlighted{1773+ scale: 1.05;1774+ opacity: 1;1775+ }1776+ .pieCircle.highlightedOnHover:hover{1777+ transition-duration: 250ms;1778+ scale: 1.05;1779+ opacity: 1;1780+ }1781+ .pieOuterCircle{1782+ stroke: ${e.pieOuterStrokeColor};1783+ stroke-width: ${e.pieOuterStrokeWidth};1784+ fill: none;1785+ }1786+ .pieTitleText {1787+ text-anchor: middle;1788+ font-size: ${e.pieTitleTextSize};1789+ fill: ${e.pieTitleTextColor};1790+ font-family: ${e.fontFamily};1791+ }1792+ .slice {1793+ font-family: ${e.fontFamily};1794+ fill: ${e.pieSectionTextColor};1795+ font-size:${e.pieSectionTextSize};1796+ // fill: white;1797+ }1798+ .legend text {1799+ fill: ${e.pieLegendTextColor};1800+ font-family: ${e.fontFamily};1801+ font-size: ${e.pieLegendTextSize};1802+ }1803+`,`getStyles`),fat=p(e=>{let t=[...e.values()].reduce((e,t)=>e+t,0),n=[...e.entries()].map(([e,t])=>({label:e,value:t})).filter(e=>e.value/t*100>=1);return gpe().value(e=>e.value).sort(null)(n)},`createPieArcs`),pat={parser:uat,db:g4,renderer:{draw:p((e,t,n,r)=>{y.debug(`rendering pie chart1804+`+e);let i=r.db,a=Z(),o=Hm(i.getConfig(),a.pie),s=vp(t),l=s.append(`g`);l.attr(`transform`,`translate(225,225)`);let{themeVariables:u}=a,[d]=$m(u.pieOuterStrokeWidth);d??=2;let f=o.legendPosition,p=o.textPosition,m=o.donutHole>0&&o.donutHole<=.9?o.donutHole:0,h=mf().innerRadius(m*185).outerRadius(185),g=mf().innerRadius(185*p).outerRadius(185*p),_=l.append(`g`);_.append(`circle`).attr(`cx`,0).attr(`cy`,0).attr(`r`,185+d/2).attr(`class`,`pieOuterCircle`);let v=i.getSections(),b=fat(v),x=[u.pie1,u.pie2,u.pie3,u.pie4,u.pie5,u.pie6,u.pie7,u.pie8,u.pie9,u.pie10,u.pie11,u.pie12],S=0;v.forEach(e=>{S+=e});let C=b.filter(e=>(e.data.value/S*100).toFixed(0)!==`0`),w=Ju(x).domain([...v.keys()]);_.selectAll(`mySlices`).data(C).enter().append(`path`).attr(`d`,h).attr(`fill`,e=>w(e.data.label)).attr(`class`,e=>{let t=`pieCircle`;return o.highlightSlice===`hover`?t+=` highlightedOnHover`:o.highlightSlice===e.data.label&&(t+=` highlighted`),t}),_.selectAll(`mySlices`).data(C).enter().append(`text`).text(e=>(e.data.value/S*100).toFixed(0)+`%`).attr(`transform`,e=>`translate(`+g.centroid(e)+`)`).style(`text-anchor`,`middle`).attr(`class`,`slice`);let T=l.append(`text`).text(i.getDiagramTitle()).attr(`x`,0).attr(`y`,-200).attr(`class`,`pieTitleText`),E=[...v.entries()].map(([e,t])=>({label:e,value:t})),D=l.selectAll(`.legend`).data(E).enter().append(`g`).attr(`class`,`legend`);D.append(`rect`).attr(`width`,18).attr(`height`,18).style(`fill`,e=>w(e.label)).style(`stroke`,e=>w(e.label)),D.append(`text`).attr(`x`,22).attr(`y`,14).text(e=>i.getShowData()?`${e.label} [${e.value}]`:e.label);let O=Math.max(...D.selectAll(`text`).nodes().map(e=>e?.getBoundingClientRect().width??0)),k=450,A=490,j=E.length*22;switch(f){case`center`:D.attr(`transform`,(e,t)=>{let n=22*E.length/2,r=-O/2-22,i=t*22-n;return`translate(`+r+`,`+i+`)`});break;case`top`:k+=j,D.attr(`transform`,(e,t)=>`translate(${-O/2-22}, ${t*22-185})`),_.attr(`transform`,()=>`translate(0, ${j+22})`);break;case`bottom`:k+=j,D.attr(`transform`,(e,t)=>{let n=-O/2-22,r=t*22- -207;return`translate(`+n+`,`+r+`)`});break;case`left`:A+=22+O,D.attr(`transform`,(e,t)=>{let n=22*E.length/2;return`translate(-207,`+(t*22-n)+`)`}),_.attr(`transform`,()=>`translate(${O+18+4}, 0)`);break;default:A+=22+O,D.attr(`transform`,(e,t)=>{let n=22*E.length/2;return`translate(216,`+(t*22-n)+`)`})}let M=T.node()?.getBoundingClientRect().width??0,N=225-M/2,P=225+M/2,F=Math.min(0,N),I=Math.max(A,P)-F;s.attr(`viewBox`,`${F} 0 ${I} ${k}`),Hs(s,k,I,o.useMaxWidth)},`draw`)},styles:dat}})),hat=l({diagram:()=>Pat});function _4(e){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(e)}function gat(e){return!/^\d+$/.test(e)}function _at(e){return!/^\d+px$/.test(e)}function v4(e){return js(e.trim(),Z())}function vat(e){C4.setData({quadrant1Text:v4(e.text)})}function yat(e){C4.setData({quadrant2Text:v4(e.text)})}function bat(e){C4.setData({quadrant3Text:v4(e.text)})}function xat(e){C4.setData({quadrant4Text:v4(e.text)})}function Sat(e){C4.setData({xAxisLeftText:v4(e.text)})}function Cat(e){C4.setData({xAxisRightText:v4(e.text)})}function wat(e){C4.setData({yAxisTopText:v4(e.text)})}function Tat(e){C4.setData({yAxisBottomText:v4(e.text)})}function y4(e){let t={};for(let n of e){let[e,r]=n.trim().split(/\s*:\s*/);if(e===`radius`){if(gat(r))throw new S4(e,r,`number`);t.radius=parseInt(r)}else if(e===`color`){if(_4(r))throw new S4(e,r,`hex code`);t.color=r}else if(e===`stroke-color`){if(_4(r))throw new S4(e,r,`hex code`);t.strokeColor=r}else if(e===`stroke-width`){if(_at(r))throw new S4(e,r,`number of pixels (eg. 10px)`);t.strokeWidth=r}else throw Error(`style named ${e} is not supported.`)}return t}function Eat(e,t,n,r,i){let a=y4(i);C4.addPoints([{x:n,y:r,text:v4(e.text),className:t,...a}])}function Dat(e,t){C4.addClass(e,y4(t))}function Oat(e){C4.setConfig({chartWidth:e})}function kat(e){C4.setConfig({chartHeight:e})}function Aat(){let{themeVariables:e,quadrantChart:t}=Z();return t&&C4.setConfig(t),C4.setThemeConfig({quadrant1Fill:e.quadrant1Fill,quadrant2Fill:e.quadrant2Fill,quadrant3Fill:e.quadrant3Fill,quadrant4Fill:e.quadrant4Fill,quadrant1TextFill:e.quadrant1TextFill,quadrant2TextFill:e.quadrant2TextFill,quadrant3TextFill:e.quadrant3TextFill,quadrant4TextFill:e.quadrant4TextFill,quadrantPointFill:e.quadrantPointFill,quadrantPointTextFill:e.quadrantPointTextFill,quadrantXAxisTextFill:e.quadrantXAxisTextFill,quadrantYAxisTextFill:e.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:e.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:e.quadrantInternalBorderStrokeFill,quadrantTitleFill:e.quadrantTitleFill}),C4.setData({titleText:nc()}),C4.build()}var b4,jat,x4,Mat,S4,C4,Nat,Pat,Fat=o((()=>{dc(),S(),h(),_p(),b4=(function(){var e=p(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,3],n=[1,4],r=[1,5],i=[1,6],a=[1,7],o=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],s=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],u=[2,36],d=[1,37],f=[1,36],m=[1,38],h=[1,35],g=[1,43],_=[1,41],v=[1,45],y=[1,14],b=[1,23],x=[1,18],S=[1,19],C=[1,20],w=[1,21],T=[1,22],E=[1,24],D=[1,25],O=[1,26],k=[1,27],A=[1,28],j=[1,29],M=[1,32],N=[1,33],P=[1,34],F=[1,39],I=[1,40],L=[1,42],R=[1,44],ee=[1,63],z=[1,62],B=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],te=[1,66],ne=[1,67],re=[1,68],ie=[1,69],ae=[1,70],oe=[1,71],se=[1,72],ce=[1,73],le=[1,74],ue=[1,75],de=[1,76],fe=[1,77],pe=[4,5,6,7,8,9,10,11,12,13,14,15,18],me=[1,91],he=[1,92],ge=[1,93],_e=[1,100],ve=[1,94],ye=[1,97],be=[1,95],xe=[1,96],Se=[1,98],V=[1,99],Ce=[1,103],we=[10,55,56,57],Te=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],Ee={trace:p(function(){},`trace`),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:`error`,4:`ALPHA`,5:`NUM`,6:`NODE_STRING`,7:`DOWN`,8:`MINUS`,9:`DEFAULT`,10:`COMMA`,11:`COLON`,12:`AMP`,13:`BRKT`,14:`MULT`,15:`UNICODE_TEXT`,17:`UNIT`,18:`SPACE`,19:`STYLE`,20:`PCT`,25:`CLASSDEF`,28:`QUADRANT`,35:`title`,36:`title_value`,37:`acc_title`,38:`acc_title_value`,39:`acc_descr`,40:`acc_descr_value`,41:`acc_descr_multiline_value`,42:`section`,44:`point_start`,45:`point_x`,46:`point_y`,47:`class_name`,48:`X-AXIS`,49:`AXIS-TEXT-DELIMITER`,50:`Y-AXIS`,51:`QUADRANT_1`,52:`QUADRANT_2`,53:`QUADRANT_3`,54:`QUADRANT_4`,55:`NEWLINE`,56:`SEMI`,57:`EOF`,60:`STR`,61:`MD_STR`,63:`PUNCTUATION`,64:`PLUS`,65:`EQUALS`,66:`DOT`,67:`UNDERSCORE`},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:p(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 23:this.$=a[s];break;case 24:this.$=a[s-1]+``+a[s];break;case 26:this.$=a[s-1]+a[s];break;case 27:this.$=[a[s].trim()];break;case 28:a[s-2].push(a[s].trim()),this.$=a[s-2];break;case 29:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 37:this.$=[];break;case 42:this.$=a[s].trim(),r.setDiagramTitle(this.$);break;case 43:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 44:case 45:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 46:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 47:r.addPoint(a[s-3],``,a[s-1],a[s],[]);break;case 48:r.addPoint(a[s-4],a[s-3],a[s-1],a[s],[]);break;case 49:r.addPoint(a[s-4],``,a[s-2],a[s-1],a[s]);break;case 50:r.addPoint(a[s-5],a[s-4],a[s-2],a[s-1],a[s]);break;case 51:r.setXAxisLeftText(a[s-2]),r.setXAxisRightText(a[s]);break;case 52:a[s-1].text+=` ⟶ `,r.setXAxisLeftText(a[s-1]);break;case 53:r.setXAxisLeftText(a[s]);break;case 54:r.setYAxisBottomText(a[s-2]),r.setYAxisTopText(a[s]);break;case 55:a[s-1].text+=` ⟶ `,r.setYAxisBottomText(a[s-1]);break;case 56:r.setYAxisBottomText(a[s]);break;case 57:r.setQuadrant1Text(a[s]);break;case 58:r.setQuadrant2Text(a[s]);break;case 59:r.setQuadrant3Text(a[s]);break;case 60:r.setQuadrant4Text(a[s]);break;case 64:this.$={text:a[s],type:`text`};break;case 65:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 66:this.$={text:a[s],type:`text`};break;case 67:this.$={text:a[s],type:`markdown`};break;case 68:this.$=a[s];break;case 69:this.$=a[s-1]+``+a[s]}},`anonymous`),table:[{18:t,26:1,27:2,28:n,55:r,56:i,57:a},{1:[3]},{18:t,26:8,27:2,28:n,55:r,56:i,57:a},{18:t,26:9,27:2,28:n,55:r,56:i,57:a},e(o,[2,33],{29:10}),e(s,[2,61]),e(s,[2,62]),e(s,[2,63]),{1:[2,30]},{1:[2,31]},e(l,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:d,5:f,10:m,12:h,13:g,14:_,15:v,18:y,25:b,35:x,37:S,39:C,41:w,42:T,48:E,50:D,51:O,52:k,53:A,54:j,60:M,61:N,63:P,64:F,65:I,66:L,67:R}),e(o,[2,34]),{27:46,55:r,56:i,57:a},e(l,[2,37]),e(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:d,5:f,10:m,12:h,13:g,14:_,15:v,18:y,25:b,35:x,37:S,39:C,41:w,42:T,48:E,50:D,51:O,52:k,53:A,54:j,60:M,61:N,63:P,64:F,65:I,66:L,67:R}),e(l,[2,39]),e(l,[2,40]),e(l,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},e(l,[2,45]),e(l,[2,46]),{18:[1,51]},{4:d,5:f,10:m,12:h,13:g,14:_,15:v,43:52,58:31,60:M,61:N,63:P,64:F,65:I,66:L,67:R},{4:d,5:f,10:m,12:h,13:g,14:_,15:v,43:53,58:31,60:M,61:N,63:P,64:F,65:I,66:L,67:R},{4:d,5:f,10:m,12:h,13:g,14:_,15:v,43:54,58:31,60:M,61:N,63:P,64:F,65:I,66:L,67:R},{4:d,5:f,10:m,12:h,13:g,14:_,15:v,43:55,58:31,60:M,61:N,63:P,64:F,65:I,66:L,67:R},{4:d,5:f,10:m,12:h,13:g,14:_,15:v,43:56,58:31,60:M,61:N,63:P,64:F,65:I,66:L,67:R},{4:d,5:f,10:m,12:h,13:g,14:_,15:v,43:57,58:31,60:M,61:N,63:P,64:F,65:I,66:L,67:R},{4:d,5:f,8:ee,10:m,12:h,13:g,14:_,15:v,18:z,44:[1,58],47:[1,59],58:61,59:60,63:P,64:F,65:I,66:L,67:R},e(B,[2,64]),e(B,[2,66]),e(B,[2,67]),e(B,[2,70]),e(B,[2,71]),e(B,[2,72]),e(B,[2,73]),e(B,[2,74]),e(B,[2,75]),e(B,[2,76]),e(B,[2,77]),e(B,[2,78]),e(B,[2,79]),e(B,[2,80]),e(B,[2,81]),e(o,[2,35]),e(l,[2,38]),e(l,[2,42]),e(l,[2,43]),e(l,[2,44]),{3:65,4:te,5:ne,6:re,7:ie,8:ae,9:oe,10:se,11:ce,12:le,13:ue,14:de,15:fe,21:64},e(l,[2,53],{59:60,58:61,4:d,5:f,8:ee,10:m,12:h,13:g,14:_,15:v,18:z,49:[1,78],63:P,64:F,65:I,66:L,67:R}),e(l,[2,56],{59:60,58:61,4:d,5:f,8:ee,10:m,12:h,13:g,14:_,15:v,18:z,49:[1,79],63:P,64:F,65:I,66:L,67:R}),e(l,[2,57],{59:60,58:61,4:d,5:f,8:ee,10:m,12:h,13:g,14:_,15:v,18:z,63:P,64:F,65:I,66:L,67:R}),e(l,[2,58],{59:60,58:61,4:d,5:f,8:ee,10:m,12:h,13:g,14:_,15:v,18:z,63:P,64:F,65:I,66:L,67:R}),e(l,[2,59],{59:60,58:61,4:d,5:f,8:ee,10:m,12:h,13:g,14:_,15:v,18:z,63:P,64:F,65:I,66:L,67:R}),e(l,[2,60],{59:60,58:61,4:d,5:f,8:ee,10:m,12:h,13:g,14:_,15:v,18:z,63:P,64:F,65:I,66:L,67:R}),{45:[1,80]},{44:[1,81]},e(B,[2,65]),e(B,[2,82]),e(B,[2,83]),e(B,[2,84]),{3:83,4:te,5:ne,6:re,7:ie,8:ae,9:oe,10:se,11:ce,12:le,13:ue,14:de,15:fe,18:[1,82]},e(pe,[2,23]),e(pe,[2,1]),e(pe,[2,2]),e(pe,[2,3]),e(pe,[2,4]),e(pe,[2,5]),e(pe,[2,6]),e(pe,[2,7]),e(pe,[2,8]),e(pe,[2,9]),e(pe,[2,10]),e(pe,[2,11]),e(pe,[2,12]),e(l,[2,52],{58:31,43:84,4:d,5:f,10:m,12:h,13:g,14:_,15:v,60:M,61:N,63:P,64:F,65:I,66:L,67:R}),e(l,[2,55],{58:31,43:85,4:d,5:f,10:m,12:h,13:g,14:_,15:v,60:M,61:N,63:P,64:F,65:I,66:L,67:R}),{46:[1,86]},{45:[1,87]},{4:me,5:he,6:ge,8:_e,11:ve,13:ye,16:90,17:be,18:xe,19:Se,20:V,22:89,23:88},e(pe,[2,24]),e(l,[2,51],{59:60,58:61,4:d,5:f,8:ee,10:m,12:h,13:g,14:_,15:v,18:z,63:P,64:F,65:I,66:L,67:R}),e(l,[2,54],{59:60,58:61,4:d,5:f,8:ee,10:m,12:h,13:g,14:_,15:v,18:z,63:P,64:F,65:I,66:L,67:R}),e(l,[2,47],{22:89,16:90,23:101,4:me,5:he,6:ge,8:_e,11:ve,13:ye,17:be,18:xe,19:Se,20:V}),{46:[1,102]},e(l,[2,29],{10:Ce}),e(we,[2,27],{16:104,4:me,5:he,6:ge,8:_e,11:ve,13:ye,17:be,18:xe,19:Se,20:V}),e(Te,[2,25]),e(Te,[2,13]),e(Te,[2,14]),e(Te,[2,15]),e(Te,[2,16]),e(Te,[2,17]),e(Te,[2,18]),e(Te,[2,19]),e(Te,[2,20]),e(Te,[2,21]),e(Te,[2,22]),e(l,[2,49],{10:Ce}),e(l,[2,48],{22:89,16:90,23:105,4:me,5:he,6:ge,8:_e,11:ve,13:ye,17:be,18:xe,19:Se,20:V}),{4:me,5:he,6:ge,8:_e,11:ve,13:ye,16:90,17:be,18:xe,19:Se,20:V,22:106},e(Te,[2,26]),e(l,[2,50],{10:Ce}),e(we,[2,28],{16:104,4:me,5:he,6:ge,8:_e,11:ve,13:ye,17:be,18:xe,19:Se,20:V})],defaultActions:{8:[2,30],9:[2,31]},parseError:p(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:p(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,l=0,u=0,d=0,f=2,m=1,h=a.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(_.yy[v]=this.yy[v]);g.setInput(e,_.yy),_.yy.lexer=g,_.yy.parser=this,g.yylloc===void 0&&(g.yylloc={});var y=g.yylloc;a.push(y);var b=g.options&&g.options.ranges;this.parseError=typeof _.yy.parseError==`function`?_.yy.parseError:Object.getPrototypeOf(this).parseError;function x(e){n.length-=2*e,i.length-=e,a.length-=e}p(x,`popStack`);function S(){var e=r.pop()||g.lex()||m;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}p(S,`lex`);for(var C,w,T,E,D,O={},k,A,j,M;;){if(T=n[n.length-1],this.defaultActions[T]?E=this.defaultActions[T]:(C??=S(),E=o[T]&&o[T][C]),E===void 0||!E.length||!E[0]){var N=``;for(k in M=[],o[T])this.terminals_[k]&&k>f&&M.push(`'`+this.terminals_[k]+`'`);N=g.showPosition?`Parse error on line `+(l+1)+`:1805+`+g.showPosition()+`1806+Expecting `+M.join(`, `)+`, got '`+(this.terminals_[C]||C)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(C==m?`end of input`:`'`+(this.terminals_[C]||C)+`'`),this.parseError(N,{text:g.match,token:this.terminals_[C]||C,line:g.yylineno,loc:y,expected:M})}if(E[0]instanceof Array&&E.length>1)throw Error(`Parse Error: multiple actions possible at state: `+T+`, token: `+C);switch(E[0]){case 1:n.push(C),i.push(g.yytext),a.push(g.yylloc),n.push(E[1]),C=null,w?(C=w,w=null):(u=g.yyleng,s=g.yytext,l=g.yylineno,y=g.yylloc,d>0&&d--);break;case 2:if(A=this.productions_[E[1]][1],O.$=i[i.length-A],O._$={first_line:a[a.length-(A||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(A||1)].first_column,last_column:a[a.length-1].last_column},b&&(O._$.range=[a[a.length-(A||1)].range[0],a[a.length-1].range[1]]),D=this.performAction.apply(O,[s,u,l,_.yy,E[1],i,a].concat(h)),D!==void 0)return D;A&&(n=n.slice(0,-1*A*2),i=i.slice(0,-1*A),a=a.slice(0,-1*A)),n.push(this.productions_[E[1]][0]),i.push(O.$),a.push(O._$),j=o[n[n.length-2]][n[n.length-1]],n.push(j);break;case 3:return!0}}return!0},`parse`)};Ee.lexer=(function(){return{EOF:1,parseError:p(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:p(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:p(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:p(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:p(function(){return this._more=!0,this},`more`),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).1807+`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:p(function(e){this.unput(this.match.slice(e))},`less`),pastInput:p(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:p(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:p(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`1808+`+t+`^`},`showPosition`),test_match:p(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.1809+`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:p(function(){return this.next()||this.lex()},`lex`),begin:p(function(e){this.conditionStack.push(e)},`begin`),popState:p(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:p(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:p(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:p(function(e){this.begin(e)},`pushState`),stateStackSize:p(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:p(function(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin(`title`),35;case 5:return this.popState(),`title_value`;case 6:return this.begin(`acc_title`),37;case 7:return this.popState(),`acc_title_value`;case 8:return this.begin(`acc_descr`),39;case 9:return this.popState(),`acc_descr_value`;case 10:this.begin(`acc_descr_multiline`);break;case 11:this.popState();break;case 12:return`acc_descr_multiline_value`;case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin(`md_string`);break;case 22:return`MD_STR`;case 23:this.popState();break;case 24:this.begin(`string`);break;case 25:this.popState();break;case 26:return`STR`;case 27:this.begin(`class_name`);break;case 28:return this.popState(),47;case 29:return this.begin(`point_start`),44;case 30:return this.begin(`point_x`),45;case 31:this.popState();break;case 32:this.popState(),this.begin(`point_y`);break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52:return 57}},`anonymous`),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?:[^\x00-\x7F]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}}})();function De(){this.yy={}}return p(De,`Parser`),De.prototype=Ee,Ee.Parser=De,new De})(),b4.parser=b4,jat=b4,x4=Zo(),Mat=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}static{p(this,`QuadrantBuilder`)}getDefaultData(){return{titleText:``,quadrant1Text:``,quadrant2Text:``,quadrant3Text:``,quadrant4Text:``,xAxisLeftText:``,xAxisRightText:``,yAxisBottomText:``,yAxisTopText:``,points:[]}}getDefaultConfig(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:ns.quadrantChart?.chartWidth||500,chartWidth:ns.quadrantChart?.chartHeight||500,titlePadding:ns.quadrantChart?.titlePadding||10,titleFontSize:ns.quadrantChart?.titleFontSize||20,quadrantPadding:ns.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:ns.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:ns.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:ns.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:ns.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:ns.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:ns.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:ns.quadrantChart?.pointTextPadding||5,pointLabelFontSize:ns.quadrantChart?.pointLabelFontSize||12,pointRadius:ns.quadrantChart?.pointRadius||5,xAxisPosition:ns.quadrantChart?.xAxisPosition||`top`,yAxisPosition:ns.quadrantChart?.yAxisPosition||`left`,quadrantInternalBorderStrokeWidth:ns.quadrantChart?.quadrantInternalBorderStrokeWidth||1,quadrantExternalBorderStrokeWidth:ns.quadrantChart?.quadrantExternalBorderStrokeWidth||2}}getDefaultThemeConfig(){return{quadrant1Fill:x4.quadrant1Fill,quadrant2Fill:x4.quadrant2Fill,quadrant3Fill:x4.quadrant3Fill,quadrant4Fill:x4.quadrant4Fill,quadrant1TextFill:x4.quadrant1TextFill,quadrant2TextFill:x4.quadrant2TextFill,quadrant3TextFill:x4.quadrant3TextFill,quadrant4TextFill:x4.quadrant4TextFill,quadrantPointFill:x4.quadrantPointFill,quadrantPointTextFill:x4.quadrantPointTextFill,quadrantXAxisTextFill:x4.quadrantXAxisTextFill,quadrantYAxisTextFill:x4.quadrantYAxisTextFill,quadrantTitleFill:x4.quadrantTitleFill,quadrantInternalBorderStrokeFill:x4.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:x4.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,y.info(`clear called`)}setData(e){this.data={...this.data,...e}}addPoints(e){this.data.points=[...e,...this.data.points]}addClass(e,t){this.classes.set(e,t)}setConfig(e){y.trace(`setConfig called with: `,e),this.config={...this.config,...e}}setThemeConfig(e){y.trace(`setThemeConfig called with: `,e),this.themeConfig={...this.themeConfig,...e}}calculateSpace(e,t,n,r){let i=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,a={top:e===`top`&&t?i:0,bottom:e===`bottom`&&t?i:0},o=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,s={left:this.config.yAxisPosition===`left`&&n?o:0,right:this.config.yAxisPosition===`right`&&n?o:0},l=this.config.titleFontSize+this.config.titlePadding*2,u={top:r?l:0},d=this.config.quadrantPadding+s.left,f=this.config.quadrantPadding+a.top+u.top,p=this.config.chartWidth-this.config.quadrantPadding*2-s.left-s.right,m=this.config.chartHeight-this.config.quadrantPadding*2-a.top-a.bottom-u.top;return{xAxisSpace:a,yAxisSpace:s,titleSpace:u,quadrantSpace:{quadrantLeft:d,quadrantTop:f,quadrantWidth:p,quadrantHalfWidth:p/2,quadrantHeight:m,quadrantHalfHeight:m/2}}}getAxisLabels(e,t,n,r){let{quadrantSpace:i,titleSpace:a}=r,{quadrantHalfHeight:o,quadrantHeight:s,quadrantLeft:l,quadrantHalfWidth:u,quadrantTop:d,quadrantWidth:f}=i,p=!!this.data.xAxisRightText,m=!!this.data.yAxisTopText,h=[];return this.data.xAxisLeftText&&t&&h.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:l+(p?u/2:0),y:e===`top`?this.config.xAxisLabelPadding+a.top:this.config.xAxisLabelPadding+d+s+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?`center`:`left`,horizontalPos:`top`,rotation:0}),this.data.xAxisRightText&&t&&h.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:l+u+(p?u/2:0),y:e===`top`?this.config.xAxisLabelPadding+a.top:this.config.xAxisLabelPadding+d+s+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:p?`center`:`left`,horizontalPos:`top`,rotation:0}),this.data.yAxisBottomText&&n&&h.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition===`left`?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+l+f+this.config.quadrantPadding,y:d+s-(m?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:m?`center`:`left`,horizontalPos:`top`,rotation:-90}),this.data.yAxisTopText&&n&&h.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition===`left`?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+l+f+this.config.quadrantPadding,y:d+o-(m?o/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:m?`center`:`left`,horizontalPos:`top`,rotation:-90}),h}getQuadrants(e){let{quadrantSpace:t}=e,{quadrantHalfHeight:n,quadrantLeft:r,quadrantHalfWidth:i,quadrantTop:a}=t,o=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:`center`,horizontalPos:`middle`,rotation:0},x:r+i,y:a,width:i,height:n,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:`center`,horizontalPos:`middle`,rotation:0},x:r,y:a,width:i,height:n,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:`center`,horizontalPos:`middle`,rotation:0},x:r,y:a+n,width:i,height:n,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:`center`,horizontalPos:`middle`,rotation:0},x:r+i,y:a+n,width:i,height:n,fill:this.themeConfig.quadrant4Fill}];for(let e of o)e.text.x=e.x+e.width/2,this.data.points.length===0?(e.text.y=e.y+e.height/2,e.text.horizontalPos=`middle`):(e.text.y=e.y+this.config.quadrantTextTopPadding,e.text.horizontalPos=`top`);return o}getQuadrantPoints(e){let{quadrantSpace:t}=e,{quadrantHeight:n,quadrantLeft:r,quadrantTop:i,quadrantWidth:a}=t,o=td().domain([0,1]).range([r,a+r]),s=td().domain([0,1]).range([n+i,i]);return this.data.points.map(e=>{let t=this.classes.get(e.className);return t&&(e={...t,...e}),{x:o(e.x),y:s(e.y),fill:e.color??this.themeConfig.quadrantPointFill,radius:e.radius??this.config.pointRadius,text:{text:e.text,fill:this.themeConfig.quadrantPointTextFill,x:o(e.x),y:s(e.y)+this.config.pointTextPadding,verticalPos:`center`,horizontalPos:`top`,fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:e.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:e.strokeWidth??`0px`}})}getBorders(e){let t=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:n}=e,{quadrantHalfHeight:r,quadrantHeight:i,quadrantLeft:a,quadrantHalfWidth:o,quadrantTop:s,quadrantWidth:l}=n;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a-t,y1:s,x2:a+l+t,y2:s},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a+l,y1:s+t,x2:a+l,y2:s+i-t},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a-t,y1:s+i,x2:a+l+t,y2:s+i},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:a,y1:s+t,x2:a,y2:s+i-t},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:a+o,y1:s+t,x2:a+o,y2:s+i-t},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:a+t,y1:s+r,x2:a+l-t,y2:s+r}]}getTitle(e){if(e)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:`top`,verticalPos:`center`,rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){let e=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),t=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),n=this.config.showTitle&&!!this.data.titleText,r=this.data.points.length>0?`bottom`:this.config.xAxisPosition,i=this.calculateSpace(r,e,t,n);return{points:this.getQuadrantPoints(i),quadrants:this.getQuadrants(i),axisLabels:this.getAxisLabels(r,e,t,i),borderLines:this.getBorders(i),title:this.getTitle(n)}}},S4=class extends Error{static{p(this,`InvalidStyleError`)}constructor(e,t,n){super(`value for ${e} ${t} is invalid, please use a valid ${n}`),this.name=`InvalidStyleError`}},p(_4,`validateHexCode`),p(gat,`validateNumber`),p(_at,`validateSizeInPixels`),p(v4,`textSanitizer`),C4=new Mat,p(vat,`setQuadrant1Text`),p(yat,`setQuadrant2Text`),p(bat,`setQuadrant3Text`),p(xat,`setQuadrant4Text`),p(Sat,`setXAxisLeftText`),p(Cat,`setXAxisRightText`),p(wat,`setYAxisTopText`),p(Tat,`setYAxisBottomText`),p(y4,`parseStyles`),p(Eat,`addPoint`),p(Dat,`addClass`),p(Oat,`setWidth`),p(kat,`setHeight`),p(Aat,`getQuadrantData`),Nat={setWidth:Oat,setHeight:kat,setQuadrant1Text:vat,setQuadrant2Text:yat,setQuadrant3Text:bat,setQuadrant4Text:xat,setXAxisLeftText:Sat,setXAxisRightText:Cat,setYAxisTopText:wat,setYAxisBottomText:Tat,parseStyles:y4,addPoint:Eat,addClass:Dat,getQuadrantData:Aat,clear:p(function(){C4.clear(),Xs()},`clear`),setAccTitle:Zs,getAccTitle:Qs,setDiagramTitle:tc,getDiagramTitle:nc,getAccDescription:ec,setAccDescription:$s},Pat={parser:jat,db:Nat,renderer:{draw:p((e,t,n,r)=>{function i(e){return e===`top`?`hanging`:`middle`}p(i,`getDominantBaseLine`);function a(e){return e===`left`?`start`:`middle`}p(a,`getTextAnchor`);function o(e){return`translate(${e.x}, ${e.y}) rotate(${e.rotation||0})`}p(o,`getTransformation`);let s=Z();y.debug(`Rendering quadrant chart1810+`+e);let l=s.securityLevel,u;l===`sandbox`&&(u=$c(`#i`+t));let d=$c(l===`sandbox`?u.nodes()[0].contentDocument.body:`body`).select(`[id="${t}"]`),f=d.append(`g`).attr(`class`,`main`),m=s.quadrantChart?.chartWidth??500,h=s.quadrantChart?.chartHeight??500;Hs(d,h,m,s.quadrantChart?.useMaxWidth??!0),d.attr(`viewBox`,`0 0 `+m+` `+h),r.db.setHeight(h),r.db.setWidth(m);let g=r.db.getQuadrantData(),_=f.append(`g`).attr(`class`,`quadrants`),v=f.append(`g`).attr(`class`,`border`),b=f.append(`g`).attr(`class`,`data-points`),x=f.append(`g`).attr(`class`,`labels`),S=f.append(`g`).attr(`class`,`title`);g.title&&S.append(`text`).attr(`x`,0).attr(`y`,0).attr(`fill`,g.title.fill).attr(`font-size`,g.title.fontSize).attr(`dominant-baseline`,i(g.title.horizontalPos)).attr(`text-anchor`,a(g.title.verticalPos)).attr(`transform`,o(g.title)).text(g.title.text),g.borderLines&&v.selectAll(`line`).data(g.borderLines).enter().append(`line`).attr(`x1`,e=>e.x1).attr(`y1`,e=>e.y1).attr(`x2`,e=>e.x2).attr(`y2`,e=>e.y2).style(`stroke`,e=>e.strokeFill).style(`stroke-width`,e=>e.strokeWidth);let C=_.selectAll(`g.quadrant`).data(g.quadrants).enter().append(`g`).attr(`class`,`quadrant`);C.append(`rect`).attr(`x`,e=>e.x).attr(`y`,e=>e.y).attr(`width`,e=>e.width).attr(`height`,e=>e.height).attr(`fill`,e=>e.fill),C.append(`text`).attr(`x`,0).attr(`y`,0).attr(`fill`,e=>e.text.fill).attr(`font-size`,e=>e.text.fontSize).attr(`dominant-baseline`,e=>i(e.text.horizontalPos)).attr(`text-anchor`,e=>a(e.text.verticalPos)).attr(`transform`,e=>o(e.text)).text(e=>e.text.text),x.selectAll(`g.label`).data(g.axisLabels).enter().append(`g`).attr(`class`,`label`).append(`text`).attr(`x`,0).attr(`y`,0).text(e=>e.text).attr(`fill`,e=>e.fill).attr(`font-size`,e=>e.fontSize).attr(`dominant-baseline`,e=>i(e.horizontalPos)).attr(`text-anchor`,e=>a(e.verticalPos)).attr(`transform`,e=>o(e));let w=b.selectAll(`g.data-point`).data(g.points).enter().append(`g`).attr(`class`,`data-point`);w.append(`circle`).attr(`cx`,e=>e.x).attr(`cy`,e=>e.y).attr(`r`,e=>e.radius).attr(`fill`,e=>e.fill).attr(`stroke`,e=>e.strokeColor).attr(`stroke-width`,e=>e.strokeWidth),w.append(`text`).attr(`x`,0).attr(`y`,0).text(e=>e.text.text).attr(`fill`,e=>e.text.fill).attr(`font-size`,e=>e.text.fontSize).attr(`dominant-baseline`,e=>i(e.text.horizontalPos)).attr(`text-anchor`,e=>a(e.text.verticalPos)).attr(`transform`,e=>o(e.text))},`draw`)},styles:p(()=>``,`styles`)}})),Iat=l({diagram:()=>pot});function w4(e){return e.type===`bar`}function T4(e){return e.type===`band`}function E4(e){return e.type===`linear`}function D4(e,t,n,r){let i=new L4(r);return T4(e)?new eot(t,n,e.categories,e.title,i):new tot(t,n,[e.min,e.max],e.title,i)}function Lat(e,t,n,r){return new not(new L4(r),e,t,n)}function O4(e){return{fontSize:e,markerSize:e*rot,markerSpacing:e*aot,itemSpacing:e*iot}}function Rat(e,t,n,r){return new oot(new L4(r),e,t,n)}function zat(e,t,n){return new lot(e,t,n)}function k4(){let e=Zo(),t=ms();return Hm(e.xyChart,t.themeVariables.xyChart)}function A4(){let e=ms();return Hm(ns.xyChart,e.xyChart)}function j4(){return{yAxis:{type:`linear`,title:``,min:1/0,max:-1/0},xAxis:{type:`band`,title:``,categories:[]},title:``,plots:[]}}function M4(e){let t=ms();return js(e.trim(),t)}function Bat(e){fot=e}function Vat(e){e===`horizontal`?H4.chartOrientation=`horizontal`:H4.chartOrientation=`vertical`}function Hat(e){W4.xAxis.title=M4(e.text)}function N4(e,t){W4.xAxis={type:`linear`,title:W4.xAxis.title,min:e,max:t},K4=!0}function Uat(e){W4.xAxis={type:`band`,title:W4.xAxis.title,categories:e.map(e=>M4(e.text))},K4=!0}function Wat(e){W4.yAxis.title=M4(e.text)}function Gat(e,t){W4.yAxis={type:`linear`,title:W4.yAxis.title,min:e,max:t},q4=!0}function Kat(e){let t=Math.min(...e),n=Math.max(...e),r=E4(W4.yAxis)?W4.yAxis.min:1/0,i=E4(W4.yAxis)?W4.yAxis.max:-1/0;W4.yAxis={type:`linear`,title:W4.yAxis.title,min:Math.min(r,t),max:Math.max(i,n)}}function P4(e){let t=[];if(e.length===0)return t;if(!K4){let t=E4(W4.xAxis)?W4.xAxis.min:1/0,n=E4(W4.xAxis)?W4.xAxis.max:-1/0;N4(Math.min(t,1),Math.max(n,e.length))}if(T4(W4.xAxis)&&e.length>W4.xAxis.categories.length&&(e=e.slice(0,W4.xAxis.categories.length)),q4||Kat(e),T4(W4.xAxis)&&(t=W4.xAxis.categories.map((t,n)=>[t,e[n]])),E4(W4.xAxis)){let n=W4.xAxis.min,r=W4.xAxis.max;if(e.length===1)t=[[`${n}`,e[0]]];else{let i=(r-n)/(e.length-1);t=e.map((e,t)=>[`${n+t*i}`,e])}}return t}function F4(e){return G4[e===0?0:e%G4.length]}function qat(e,t){let n=t.map(e=>e.value),r=t.map(e=>e.label?M4(e.label):``),i=P4(n),a=r.some(e=>e!==``);W4.plots.push({type:`line`,title:M4(e.text),strokeFill:F4(V4),strokeWidth:2,data:i,...a?{pointLabels:r}:{}}),V4++}function Jat(e,t){let n=P4(t.map(e=>e.value));W4.plots.push({type:`bar`,title:M4(e.text),fill:F4(V4),data:n}),V4++}function Yat(){if(W4.plots.length===0)throw Error(`No Plot to render, please provide a plot with some data`);return W4.title=nc(),dot.build(H4,W4,U4,fot)}function Xat(){return U4}function Zat(){return H4}function Qat(){return W4}var I4,$at,L4,R4,z4,B4,eot,tot,not,rot,iot,aot,oot,sot,cot,lot,uot,dot,V4,fot,H4,U4,W4,G4,K4,q4,pot,mot=o((()=>{yp(),ig(),Gp(),rh(),dc(),S(),h(),_p(),I4=(function(){var e=p(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,10,12,14,16,18,19,21,23],n=[2,6],r=[1,3],i=[1,5],a=[1,6],o=[1,7],s=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],d=[1,28],f=[1,29],m=[1,30],h=[1,31],g=[1,32],_=[1,33],v=[1,34],y=[1,35],b=[1,36],x=[1,37],S=[1,43],C=[1,42],w=[1,47],T=[1,50],E=[1,10,12,14,16,18,19,21,23,36,37,38],D=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],O=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],k=[1,65],A=[26,28],j={trace:p(function(){},`trace`),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:`error`,5:`XYCHART`,8:`CHART_ORIENTATION`,10:`title`,12:`X_AXIS`,14:`Y_AXIS`,16:`LINE`,18:`BAR`,19:`acc_title`,20:`acc_title_value`,21:`acc_descr`,22:`acc_descr_value`,23:`acc_descr_multiline_value`,24:`SQUARE_BRACES_START`,26:`SQUARE_BRACES_END`,28:`COMMA`,29:`NUMBER_WITH_DECIMAL`,30:`STR`,33:`ARROW_DELIMITER`,36:`NEWLINE`,37:`SEMI`,38:`EOF`,40:`MD_STR`,42:`AMP`,43:`NUM`,44:`ALPHA`,45:`PLUS`,46:`EQUALS`,47:`MULT`,48:`DOT`,49:`BRKT`,50:`MINUS`,51:`UNDERSCORE`},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:p(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setOrientation(a[s]);break;case 9:r.setDiagramTitle(a[s].text.trim());break;case 12:r.setLineData({text:``,type:`text`},a[s]);break;case 13:r.setLineData(a[s-1],a[s]);break;case 14:r.setBarData({text:``,type:`text`},a[s]);break;case 15:r.setBarData(a[s-1],a[s]);break;case 16:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 19:this.$=a[s-1];break;case 20:case 30:this.$=[a[s-2],...a[s]];break;case 21:case 31:this.$=[a[s]];break;case 22:this.$={value:Number(a[s-1]),label:a[s]};break;case 23:this.$={value:Number(a[s]),label:``};break;case 24:r.setXAxisTitle(a[s]);break;case 25:r.setXAxisTitle(a[s-1]);break;case 26:r.setXAxisTitle({type:`text`,text:``});break;case 27:r.setXAxisBand(a[s]);break;case 28:r.setXAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 29:this.$=a[s-1];break;case 32:r.setYAxisTitle(a[s]);break;case 33:r.setYAxisTitle(a[s-1]);break;case 34:r.setYAxisTitle({type:`text`,text:``});break;case 35:r.setYAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 39:this.$={text:a[s],type:`text`};break;case 40:this.$={text:a[s],type:`text`};break;case 41:this.$={text:a[s],type:`markdown`};break;case 42:this.$=a[s];break;case 43:this.$=a[s-1]+``+a[s]}},`anonymous`),table:[e(t,n,{3:1,4:2,7:4,5:r,36:i,37:a,38:o}),{1:[3]},e(t,n,{4:2,7:4,3:8,5:r,36:i,37:a,38:o}),e(t,n,{4:2,7:4,6:9,3:10,5:r,8:[1,11],36:i,37:a,38:o}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(s,[2,36]),e(s,[2,37]),e(s,[2,38]),{1:[2,1]},e(t,n,{4:2,7:4,3:21,5:r,36:i,37:a,38:o}),{1:[2,3]},e(s,[2,5]),e(t,[2,7],{4:22,36:i,37:a,38:o}),{11:23,30:l,39:24,40:u,41:27,42:d,43:f,44:m,45:h,46:g,47:_,48:v,49:y,50:b,51:x},{11:39,13:38,24:S,29:C,30:l,31:40,32:41,39:24,40:u,41:27,42:d,43:f,44:m,45:h,46:g,47:_,48:v,49:y,50:b,51:x},{11:45,15:44,29:w,30:l,35:46,39:24,40:u,41:27,42:d,43:f,44:m,45:h,46:g,47:_,48:v,49:y,50:b,51:x},{11:49,17:48,24:T,30:l,39:24,40:u,41:27,42:d,43:f,44:m,45:h,46:g,47:_,48:v,49:y,50:b,51:x},{11:52,17:51,24:T,30:l,39:24,40:u,41:27,42:d,43:f,44:m,45:h,46:g,47:_,48:v,49:y,50:b,51:x},{20:[1,53]},{22:[1,54]},e(E,[2,18]),{1:[2,2]},e(E,[2,8]),e(E,[2,9]),e(D,[2,39],{41:55,42:d,43:f,44:m,45:h,46:g,47:_,48:v,49:y,50:b,51:x}),e(D,[2,40]),e(D,[2,41]),e(O,[2,42]),e(O,[2,44]),e(O,[2,45]),e(O,[2,46]),e(O,[2,47]),e(O,[2,48]),e(O,[2,49]),e(O,[2,50]),e(O,[2,51]),e(O,[2,52]),e(O,[2,53]),e(E,[2,10]),e(E,[2,24],{32:41,31:56,24:S,29:C}),e(E,[2,26]),e(E,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:d,43:f,44:m,45:h,46:g,47:_,48:v,49:y,50:b,51:x},e(E,[2,11]),e(E,[2,32],{35:60,29:w}),e(E,[2,34]),{33:[1,61]},e(E,[2,12]),{17:62,24:T},{25:63,27:64,29:k},e(E,[2,14]),{17:66,24:T},e(E,[2,16]),e(E,[2,17]),e(O,[2,43]),e(E,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(E,[2,33]),{29:[1,70]},e(E,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(A,[2,23],{30:[1,73]}),e(E,[2,15]),e(E,[2,28]),e(E,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:d,43:f,44:m,45:h,46:g,47:_,48:v,49:y,50:b,51:x},e(E,[2,35]),e(E,[2,19]),{25:75,27:64,29:k},e(A,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:p(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:p(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,l=0,u=0,d=0,f=2,m=1,h=a.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(_.yy[v]=this.yy[v]);g.setInput(e,_.yy),_.yy.lexer=g,_.yy.parser=this,g.yylloc===void 0&&(g.yylloc={});var y=g.yylloc;a.push(y);var b=g.options&&g.options.ranges;this.parseError=typeof _.yy.parseError==`function`?_.yy.parseError:Object.getPrototypeOf(this).parseError;function x(e){n.length-=2*e,i.length-=e,a.length-=e}p(x,`popStack`);function S(){var e=r.pop()||g.lex()||m;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}p(S,`lex`);for(var C,w,T,E,D,O={},k,A,j,M;;){if(T=n[n.length-1],this.defaultActions[T]?E=this.defaultActions[T]:(C??=S(),E=o[T]&&o[T][C]),E===void 0||!E.length||!E[0]){var N=``;for(k in M=[],o[T])this.terminals_[k]&&k>f&&M.push(`'`+this.terminals_[k]+`'`);N=g.showPosition?`Parse error on line `+(l+1)+`:1811+`+g.showPosition()+`1812+Expecting `+M.join(`, `)+`, got '`+(this.terminals_[C]||C)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(C==m?`end of input`:`'`+(this.terminals_[C]||C)+`'`),this.parseError(N,{text:g.match,token:this.terminals_[C]||C,line:g.yylineno,loc:y,expected:M})}if(E[0]instanceof Array&&E.length>1)throw Error(`Parse Error: multiple actions possible at state: `+T+`, token: `+C);switch(E[0]){case 1:n.push(C),i.push(g.yytext),a.push(g.yylloc),n.push(E[1]),C=null,w?(C=w,w=null):(u=g.yyleng,s=g.yytext,l=g.yylineno,y=g.yylloc,d>0&&d--);break;case 2:if(A=this.productions_[E[1]][1],O.$=i[i.length-A],O._$={first_line:a[a.length-(A||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(A||1)].first_column,last_column:a[a.length-1].last_column},b&&(O._$.range=[a[a.length-(A||1)].range[0],a[a.length-1].range[1]]),D=this.performAction.apply(O,[s,u,l,_.yy,E[1],i,a].concat(h)),D!==void 0)return D;A&&(n=n.slice(0,-1*A*2),i=i.slice(0,-1*A),a=a.slice(0,-1*A)),n.push(this.productions_[E[1]][0]),i.push(O.$),a.push(O._$),j=o[n[n.length-2]][n[n.length-1]],n.push(j);break;case 3:return!0}}return!0},`parse`)};j.lexer=(function(){return{EOF:1,parseError:p(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:p(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:p(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:p(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:p(function(){return this._more=!0,this},`more`),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).1813+`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:p(function(e){this.unput(this.match.slice(e))},`less`),pastInput:p(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:p(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:p(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`1814+`+t+`^`},`showPosition`),test_match:p(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.1815+`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:p(function(){return this.next()||this.lex()},`lex`),begin:p(function(e){this.conditionStack.push(e)},`begin`),popState:p(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:p(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:p(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:p(function(e){this.begin(e)},`pushState`),stateStackSize:p(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:p(function(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState(`acc_title`),19;case 8:return this.popState(),`acc_title_value`;case 9:return this.pushState(`acc_descr`),21;case 10:return this.popState(),`acc_descr_value`;case 11:this.pushState(`acc_descr_multiline`);break;case 12:this.popState();break;case 13:return`acc_descr_multiline_value`;case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState(`axis_data`),`X_AXIS`;case 18:return this.pushState(`axis_data`),`Y_AXIS`;case 19:return this.pushState(`axis_band_data`),24;case 20:return 33;case 21:return this.pushState(`data`),16;case 22:return this.pushState(`data`),18;case 23:return this.pushState(`data_inner`),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState(`string`);break;case 28:this.popState();break;case 29:return`STR`;case 30:return 24;case 31:return 26;case 32:return 44;case 33:return`COLON`;case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},`anonymous`),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}}})();function M(){this.yy={}}return p(M,`Parser`),M.prototype=j,j.Parser=M,new M})(),I4.parser=I4,$at=I4,p(w4,`isBarPlot`),p(T4,`isBandAxisData`),p(E4,`isLinearAxisData`),L4=class{constructor(e){this.parentGroup=e}static{p(this,`TextDimensionCalculatorWithFont`)}getMaxDimension(e,t){if(!this.parentGroup)return{width:e.reduce((e,t)=>Math.max(t.length,e),0)*t,height:t};let n={width:0,height:0},r=this.parentGroup.append(`g`).attr(`visibility`,`hidden`).attr(`font-size`,t);for(let i of e){let e=xge(r,1,i),a=e?e.width:i.length*t,o=e?e.height:t;n.width=Math.max(n.width,a),n.height=Math.max(n.height,o)}return r.remove(),n}},R4=.7,z4=.2,B4=class{constructor(e,t,n,r){this.axisConfig=e,this.title=t,this.textDimensionCalculator=n,this.axisThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition=`left`,this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition=`left`,this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{p(this,`BaseAxis`)}setRange(e){this.range=e,this.axisPosition===`left`||this.axisPosition===`right`?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){let e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){R4*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(R4*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let t=e.height;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let n=this.getLabelDimension(),r=z4*e.width;this.outerPadding=Math.min(n.width/2,r);let i=n.height;this.axisPosition===`bottom`&&this.normalizedLabelRotationInRad!==0&&(i=Math.max(i,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*n.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*n.height))),i+=this.axisConfig.labelPadding*2,this.labelTextHeight=n.height,i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-t}calculateSpaceIfDrawnVertical(e){let t=e.width;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let n=this.getLabelDimension(),r=z4*e.height;this.outerPadding=Math.min(n.height/2,r);let i=n.width+this.axisConfig.labelPadding*2;i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width-t,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition===`left`||this.axisPosition===`right`?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){let t=this.normalizedLabelRotationInRad;return t===0?0:Math.sin(t)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`left-axis`,`axisl-line`],data:[{path:`M ${t},${this.boundingRect.y} L ${t},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`left-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(e),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:`middle`,horizontalPos:`right`}))}),this.showTick){let t=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:`path`,groupTexts:[`left-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${t},${this.getScaleValue(e)} L ${t-this.axisConfig.tickLength},${this.getScaleValue(e)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`left-axis`,`title`],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElementsForBottomAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`bottom-axis`,`axis-line`],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`bottom-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e)+this.calculateOffsetByRotation(`height`),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation(`width`)),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:`top`,horizontalPos:`center`}))}),this.showTick){let t=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:`path`,groupTexts:[`bottom-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t} L ${this.getScaleValue(e)},${t+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`bottom-axis`,`title`],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElementsForTopAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`top-axis`,`axis-line`],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`top-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}))}),this.showTick){let t=this.boundingRect.y;e.push({type:`path`,groupTexts:[`top-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(e)},${t+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`top-axis`,`title`],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElements(){if(this.axisPosition===`left`)return this.getDrawableElementsForLeftAxis();if(this.axisPosition===`right`)throw Error(`Drawing of right axis is not implemented`);return this.axisPosition===`bottom`?this.getDrawableElementsForBottomAxis():this.axisPosition===`top`?this.getDrawableElementsForTopAxis():[]}},eot=class extends B4{static{p(this,`BandAxis`)}constructor(e,t,n,r,i){super(e,r,i,t),this.categories=n,this.scale=Xu().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=Xu().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),y.trace(`BandAxis axis final categories, range: `,this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},tot=class extends B4{static{p(this,`LinearAxis`)}constructor(e,t,n,r,i){super(e,r,i,t),this.domain=n,this.scale=td().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];this.axisPosition===`left`&&e.reverse(),this.scale=td().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},p(D4,`getAxis`),not=class{constructor(e,t,n,r){this.textDimensionCalculator=e,this.chartConfig=t,this.chartData=n,this.chartThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{p(this,`ChartTitle`)}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){let t=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(t.width,e.width),r=t.height+2*this.chartConfig.titlePadding;return t.width<=n&&t.height<=r&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=r,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let e=[];return this.showChartTitle&&e.push({groupTexts:[`chart-title`],type:`text`,data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:`middle`,horizontalPos:`center`,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),e}},p(Lat,`getChartTitleComponent`),rot=.75,iot=.5,aot=.35,p(O4,`getLegendLayout`),oot=class{constructor(e,t,n,r){this.textDimensionCalculator=e,this.chartConfig=t,this.chartData=n,this.chartThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}static{p(this,`ChartLegend`)}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter(e=>e.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};let{fontSize:t,markerSize:n,markerSpacing:r,itemSpacing:i}=O4(this.chartConfig.legendFontSize),a=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map(e=>e.title),t),o=this.chartConfig.legendPadding*2+n+r+a.width,s=this.chartConfig.legendPadding*2+this.visiblePlots.length*t+(this.visiblePlots.length-1)*i;return o<=e.width&&s<=e.height?(this.boundingRect.width=o,this.boundingRect.height=s):(this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];let{fontSize:e,markerSize:t,markerSpacing:n,itemSpacing:r}=O4(this.chartConfig.legendFontSize),i=e+r,a=this.boundingRect.x+this.chartConfig.legendPadding,o=this.boundingRect.y+this.chartConfig.legendPadding,s=[],l=[];for(let[e,n]of this.visiblePlots.entries())if(w4(n))s.push({x:a,y:o+e*i,width:t,height:t,fill:n.fill,strokeFill:n.fill,strokeWidth:0});else{let r=o+e*i+t/2;l.push({path:`M ${a},${r} L ${a+t},${r}`,strokeFill:n.strokeFill,strokeWidth:n.strokeWidth})}return[{groupTexts:[`legend`,`markers`],type:`rect`,data:s},{groupTexts:[`legend`,`markers`],type:`path`,data:l},{groupTexts:[`legend`,`label`],type:`text`,data:this.visiblePlots.map((r,s)=>({text:r.title,x:a+t+n,y:o+s*i+t/2,fill:this.chartThemeConfig.legendTextColor,fontSize:e,rotation:0,verticalPos:`middle`,horizontalPos:`left`}))}]}},p(Rat,`getChartLegendComponent`),sot=class{constructor(e,t,n,r,i){this.plotData=e,this.xAxis=t,this.yAxis=n,this.orientation=r,this.plotIndex=i}static{p(this,`LinePlot`)}getDrawableElement(){let e=this.plotData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]),t;if(t=this.orientation===`horizontal`?bf().y(e=>e[0]).x(e=>e[1])(e):bf().x(e=>e[0]).y(e=>e[1])(e),!t)return[];let n=[{groupTexts:[`plot`,`line-plot-${this.plotIndex}`],type:`path`,data:[{path:t,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){let t=[];for(let[n,[r,i]]of e.entries()){let e=this.plotData.pointLabels[n];e&&(this.orientation===`horizontal`?t.push({x:i+10,y:r,text:e,fill:this.plotData.strokeFill,verticalPos:`middle`,horizontalPos:`left`,fontSize:12,rotation:0}):t.push({x:r,y:i-10,text:e,fill:this.plotData.strokeFill,verticalPos:`middle`,horizontalPos:`center`,fontSize:12,rotation:0}))}t.length>0&&n.push({groupTexts:[`plot`,`line-plot-${this.plotIndex}`,`labels`],type:`text`,data:t})}return n}},cot=class{constructor(e,t,n,r,i,a){this.barData=e,this.boundingRect=t,this.xAxis=n,this.yAxis=r,this.orientation=i,this.plotIndex=a}static{p(this,`BarPlot`)}getDrawableElement(){let e=this.barData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]),t=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*.95,n=t/2;return this.orientation===`horizontal`?[{groupTexts:[`plot`,`bar-plot-${this.plotIndex}`],type:`rect`,data:e.map(e=>({x:this.boundingRect.x,y:e[0]-n,height:t,width:e[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:[`plot`,`bar-plot-${this.plotIndex}`],type:`rect`,data:e.map(e=>({x:e[0]-n,y:e[1],width:t,height:this.boundingRect.y+this.boundingRect.height-e[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},lot=class{constructor(e,t,n){this.chartConfig=e,this.chartData=t,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}static{p(this,`BasePlot`)}setAxes(e,t){this.xAxis=e,this.yAxis=t}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error(`Axes must be passed to render Plots`);let e=[];for(let[t,n]of this.chartData.plots.entries())switch(n.type){case`line`:{let r=new sot(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}break;case`bar`:{let r=new cot(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}}return e}},p(zat,`getPlotComponent`),uot=class{constructor(e,t,n,r){this.chartConfig=e,this.chartData=t,this.componentStore={title:Lat(e,t,n,r),plot:zat(e,t,n),legend:Rat(e,t,n,r),xAxis:D4(t.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},r),yAxis:D4(t.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},r)}}static{p(this,`Orchestrator`)}calculateVerticalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i={width:0,height:0},a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),s=this.componentStore.plot.calculateSpace({width:a,height:o});e-=s.width,t-=s.height,s=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),r=s.height,t-=s.height,this.componentStore.xAxis.setAxisPosition(`bottom`),s=this.componentStore.xAxis.calculateSpace({width:e,height:t}),t-=s.height,this.componentStore.yAxis.setAxisPosition(`left`),s=this.componentStore.yAxis.calculateSpace({width:e,height:t}),n=s.width,e-=s.width,i=this.componentStore.legend.calculateSpace({width:e,height:o}),e-=i.width,e>0&&(a+=e,e=0),t>0&&(o+=t,t=0),this.componentStore.plot.calculateSpace({width:a,height:o}),this.componentStore.plot.setBoundingBoxXY({x:n,y:r}),this.componentStore.legend.setBoundingBoxXY({x:n+a,y:r+Math.max((o-i.height)/2,0)}),this.componentStore.xAxis.setRange([n,n+a]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:r+o}),this.componentStore.yAxis.setRange([r,r+o]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:r}),this.chartData.plots.some(e=>w4(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i=0,a={width:0,height:0},o=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),s=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),l=this.componentStore.plot.calculateSpace({width:o,height:s});e-=l.width,t-=l.height,l=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),n=l.height,t-=l.height,this.componentStore.xAxis.setAxisPosition(`left`),l=this.componentStore.xAxis.calculateSpace({width:e,height:t}),e-=l.width,r=l.width,this.componentStore.yAxis.setAxisPosition(`top`),l=this.componentStore.yAxis.calculateSpace({width:e,height:t}),t-=l.height,i=n+l.height,a=this.componentStore.legend.calculateSpace({width:e,height:s}),e-=a.width,e>0&&(o+=e,e=0),t>0&&(s+=t,t=0),this.componentStore.plot.calculateSpace({width:o,height:s}),this.componentStore.plot.setBoundingBoxXY({x:r,y:i}),this.componentStore.legend.setBoundingBoxXY({x:r+o,y:i+Math.max((s-a.height)/2,0)}),this.componentStore.yAxis.setRange([r,r+o]),this.componentStore.yAxis.setBoundingBoxXY({x:r,y:n}),this.componentStore.xAxis.setRange([i,i+s]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(e=>w4(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation===`horizontal`?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let t of Object.values(this.componentStore))e.push(...t.getDrawableElements());return e}},dot=class{static{p(this,`XYChartBuilder`)}static build(e,t,n,r){return new uot(e,t,n,r).getDrawableElement()}},V4=0,H4=A4(),U4=k4(),W4=j4(),G4=U4.plotColorPalette.split(`,`).map(e=>e.trim()),K4=!1,q4=!1,p(k4,`getChartDefaultThemeConfig`),p(A4,`getChartDefaultConfig`),p(j4,`getChartDefaultData`),p(M4,`textSanitizer`),p(Bat,`setTmpSVGG`),p(Vat,`setOrientation`),p(Hat,`setXAxisTitle`),p(N4,`setXAxisRangeData`),p(Uat,`setXAxisBand`),p(Wat,`setYAxisTitle`),p(Gat,`setYAxisRangeData`),p(Kat,`setYAxisRangeFromPlotData`),p(P4,`transformDataWithoutCategory`),p(F4,`getPlotColorFromPalette`),p(qat,`setLineData`),p(Jat,`setBarData`),p(Yat,`getDrawableElem`),p(Xat,`getChartThemeConfig`),p(Zat,`getChartConfig`),p(Qat,`getXYChartData`),pot={parser:$at,db:{getDrawableElem:Yat,clear:p(function(){Xs(),V4=0,H4=A4(),W4=j4(),U4=k4(),G4=U4.plotColorPalette.split(`,`).map(e=>e.trim()),K4=!1,q4=!1},`clear`),setAccTitle:Zs,getAccTitle:Qs,setDiagramTitle:tc,getDiagramTitle:nc,getAccDescription:ec,setAccDescription:$s,setOrientation:Vat,setXAxisTitle:Hat,setXAxisRangeData:N4,setXAxisBand:Uat,setYAxisTitle:Wat,setYAxisRangeData:Gat,setLineData:qat,setBarData:Jat,setTmpSVGG:Bat,getChartThemeConfig:Xat,getChartConfig:Zat,getXYChartData:Qat},renderer:{draw:p((e,t,n,r)=>{let i=r.db,a=i.getChartThemeConfig(),o=i.getChartConfig(),s=i.getXYChartData().plots[0].data.map(e=>e[1]);function l(e){return e===`top`?`text-before-edge`:`middle`}p(l,`getDominantBaseLine`);function u(e){return e===`left`?`start`:e===`right`?`end`:`middle`}p(u,`getTextAnchor`);function d(e){return`translate(${e.x}, ${e.y}) rotate(${e.rotation||0})`}p(d,`getTextTransformation`),y.debug(`Rendering xychart chart1816+`+e);let f=vp(t),m=f.append(`g`).attr(`class`,`main`),h=m.append(`rect`).attr(`width`,o.width).attr(`height`,o.height).attr(`class`,`background`);Hs(f,o.height,o.width,!0),f.attr(`viewBox`,`0 0 ${o.width} ${o.height}`),h.attr(`fill`,a.backgroundColor),i.setTmpSVGG(f.append(`g`).attr(`class`,`mermaid-tmp-group`));let g=i.getDrawableElem(),_={};function v(e){let t=m,n=``;for(let[r]of e.entries()){let i=m;r>0&&_[n]&&(i=_[n]),n+=e[r],t=_[n],t||=_[n]=i.append(`g`).attr(`class`,e[r])}return t}p(v,`getGroup`);for(let e of g){if(e.data.length===0)continue;let t=v(e.groupTexts);switch(e.type){case`rect`:if(t.selectAll(`rect`).data(e.data).enter().append(`rect`).attr(`x`,e=>e.x).attr(`y`,e=>e.y).attr(`width`,e=>e.width).attr(`height`,e=>e.height).attr(`fill`,e=>e.fill).attr(`stroke`,e=>e.strokeFill).attr(`stroke-width`,e=>e.strokeWidth),o.showDataLabel){let n=o.showDataLabelOutsideBar;if(o.chartOrientation===`horizontal`){let r=function(e,t){let{data:n,label:r}=e;return t*r.length*i<=n.width-o};p(r,`fitsHorizontally`);let i=.7,o=10,l=e.data.map((e,t)=>({data:e,label:s[t].toString()})).filter(e=>e.data.width>0&&e.data.height>0),u=l.map(e=>{let{data:t}=e,n=t.height*.7;for(;!r(e,n)&&n>0;)--n;return n}),d=Math.floor(Math.min(...u)),f=p(e=>n?e.data.x+e.data.width+10:e.data.x+e.data.width-10,`determineLabelXPosition`);t.selectAll(`text`).data(l).enter().append(`text`).attr(`x`,f).attr(`y`,e=>e.data.y+e.data.height/2).attr(`text-anchor`,n?`start`:`end`).attr(`dominant-baseline`,`middle`).attr(`fill`,a.dataLabelColor).attr(`font-size`,`${d}px`).text(e=>e.label)}else{let r=function(e,t,n){let{data:r,label:i}=e,a=t*i.length*.7,o=r.x+r.width/2,s=o-a/2,l=o+a/2,u=s>=r.x&&l<=r.x+r.width,d=r.y+n+t<=r.y+r.height;return u&&d};p(r,`fitsInBar`);let i=e.data.map((e,t)=>({data:e,label:s[t].toString()})).filter(e=>e.data.width>0&&e.data.height>0),o=i.map(e=>{let{data:t,label:n}=e,i=t.width/(n.length*.7);for(;!r(e,i,10)&&i>0;)--i;return i}),l=Math.floor(Math.min(...o)),u=p(e=>n?e.data.y-10:e.data.y+10,`determineLabelYPosition`);t.selectAll(`text`).data(i).enter().append(`text`).attr(`x`,e=>e.data.x+e.data.width/2).attr(`y`,u).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,n?`auto`:`hanging`).attr(`fill`,a.dataLabelColor).attr(`font-size`,`${l}px`).text(e=>e.label)}}break;case`text`:t.selectAll(`text`).data(e.data).enter().append(`text`).attr(`x`,0).attr(`y`,0).attr(`fill`,e=>e.fill).attr(`font-size`,e=>e.fontSize).attr(`dominant-baseline`,e=>l(e.verticalPos)).attr(`text-anchor`,e=>u(e.horizontalPos)).attr(`transform`,e=>d(e)).text(e=>e.text);break;case`path`:t.selectAll(`path`).data(e.data).enter().append(`path`).attr(`d`,e=>e.path).attr(`fill`,e=>e.fill?e.fill:`none`).attr(`stroke`,e=>e.strokeFill).attr(`stroke-width`,e=>e.strokeWidth)}}},`draw`)}}})),hot=l({diagram:()=>xot}),J4,got,_ot,vot,yot,Y4,bot,xot,Sot=o((()=>{KL(),JL(),EI(),U_(),cv(),z_(),P_(),Op(),ig(),Gp(),rh(),dc(),S(),h(),J4=(function(){var e=p(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,3],n=[1,4],r=[1,5],i=[1,6],a=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],o=[1,22],s=[2,7],l=[1,26],u=[1,27],d=[1,28],f=[1,29],m=[1,33],h=[1,34],g=[1,35],_=[1,36],v=[1,37],y=[1,38],b=[1,24],x=[1,31],S=[1,32],C=[1,30],w=[1,39],T=[1,40],E=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],D=[1,61],O=[89,90],k=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],A=[27,29],j=[1,70],M=[1,71],N=[1,72],P=[1,73],F=[1,74],I=[1,75],L=[1,76],R=[1,83],ee=[1,80],z=[1,84],B=[1,85],te=[1,86],ne=[1,87],re=[1,88],ie=[1,89],ae=[1,90],oe=[1,91],se=[1,92],ce=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],le=[63,64],ue=[1,101],de=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],fe=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],pe=[1,110],me=[1,106],he=[1,107],ge=[1,108],_e=[1,109],ve=[1,111],ye=[1,116],be=[1,117],xe=[1,114],Se=[1,115],V={trace:p(function(){},`trace`),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:`error`,5:`NEWLINE`,6:`RD`,8:`EOF`,9:`acc_title`,10:`acc_title_value`,11:`acc_descr`,12:`acc_descr_value`,13:`acc_descr_multiline_value`,21:`direction_tb`,22:`direction_bt`,23:`direction_rl`,24:`direction_lr`,27:`STRUCT_START`,29:`STYLE_SEPARATOR`,31:`ID`,32:`COLONSEP`,34:`TEXT`,36:`RISK`,38:`VERIFYMTHD`,40:`STRUCT_STOP`,41:`REQUIREMENT`,42:`FUNCTIONAL_REQUIREMENT`,43:`INTERFACE_REQUIREMENT`,44:`PERFORMANCE_REQUIREMENT`,45:`PHYSICAL_REQUIREMENT`,46:`DESIGN_CONSTRAINT`,47:`LOW_RISK`,48:`MED_RISK`,49:`HIGH_RISK`,50:`VERIFY_ANALYSIS`,51:`VERIFY_DEMONSTRATION`,52:`VERIFY_INSPECTION`,53:`VERIFY_TEST`,54:`ELEMENT`,57:`TYPE`,59:`DOCREF`,61:`END_ARROW_L`,63:`LINE`,64:`END_ARROW_R`,65:`CONTAINS`,66:`COPIES`,67:`DERIVES`,68:`SATISFIES`,69:`VERIFIES`,70:`REFINES`,71:`TRACES`,72:`CLASSDEF`,74:`CLASS`,75:`ALPHA`,76:`COMMA`,77:`STYLE`,80:`NUM`,81:`COLON`,82:`UNIT`,83:`SPACE`,84:`BRKT`,85:`PCT`,86:`MINUS`,87:`LABEL`,88:`SEMICOLON`,89:`unqString`,90:`qString`},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:p(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 5:case 6:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:r.setDirection(`TB`);break;case 18:r.setDirection(`BT`);break;case 19:r.setDirection(`RL`);break;case 20:r.setDirection(`LR`);break;case 21:r.addRequirement(a[s-3],a[s-4]);break;case 22:r.addRequirement(a[s-5],a[s-6]),r.setClass([a[s-5]],a[s-3]);break;case 23:r.setNewReqId(a[s-2]);break;case 24:r.setNewReqText(a[s-2]);break;case 25:r.setNewReqRisk(a[s-2]);break;case 26:r.setNewReqVerifyMethod(a[s-2]);break;case 29:this.$=r.RequirementType.REQUIREMENT;break;case 30:this.$=r.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=r.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=r.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=r.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=r.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=r.RiskLevel.LOW_RISK;break;case 36:this.$=r.RiskLevel.MED_RISK;break;case 37:this.$=r.RiskLevel.HIGH_RISK;break;case 38:this.$=r.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=r.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=r.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=r.VerifyType.VERIFY_TEST;break;case 42:r.addElement(a[s-3]);break;case 43:r.addElement(a[s-5]),r.setClass([a[s-5]],a[s-3]);break;case 44:r.setNewElementType(a[s-2]);break;case 45:r.setNewElementDocRef(a[s-2]);break;case 48:r.addRelationship(a[s-2],a[s],a[s-4]);break;case 49:r.addRelationship(a[s-2],a[s-4],a[s]);break;case 50:this.$=r.Relationships.CONTAINS;break;case 51:this.$=r.Relationships.COPIES;break;case 52:this.$=r.Relationships.DERIVES;break;case 53:this.$=r.Relationships.SATISFIES;break;case 54:this.$=r.Relationships.VERIFIES;break;case 55:this.$=r.Relationships.REFINES;break;case 56:this.$=r.Relationships.TRACES;break;case 57:this.$=a[s-2],r.defineClass(a[s-1],a[s]);break;case 58:r.setClass(a[s-1],a[s]);break;case 59:r.setClass([a[s-2]],a[s]);break;case 60:case 62:this.$=[a[s]];break;case 61:case 63:this.$=a[s-2].concat([a[s]]);break;case 64:this.$=a[s-2],r.setCssStyle(a[s-1],a[s]);break;case 65:this.$=[a[s]];break;case 66:a[s-2].push(a[s]),this.$=a[s-2];break;case 68:this.$=a[s-1]+a[s]}},`anonymous`),table:[{3:1,4:2,6:t,9:n,11:r,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:t,9:n,11:r,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(a,[2,6]),{3:12,4:2,6:t,9:n,11:r,13:i},{1:[2,2]},{4:17,5:o,7:13,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:m,42:h,43:g,44:_,45:v,46:y,54:b,72:x,74:S,77:C,89:w,90:T},e(a,[2,4]),e(a,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:o,7:42,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:m,42:h,43:g,44:_,45:v,46:y,54:b,72:x,74:S,77:C,89:w,90:T},{4:17,5:o,7:43,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:m,42:h,43:g,44:_,45:v,46:y,54:b,72:x,74:S,77:C,89:w,90:T},{4:17,5:o,7:44,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:m,42:h,43:g,44:_,45:v,46:y,54:b,72:x,74:S,77:C,89:w,90:T},{4:17,5:o,7:45,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:m,42:h,43:g,44:_,45:v,46:y,54:b,72:x,74:S,77:C,89:w,90:T},{4:17,5:o,7:46,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:m,42:h,43:g,44:_,45:v,46:y,54:b,72:x,74:S,77:C,89:w,90:T},{4:17,5:o,7:47,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:m,42:h,43:g,44:_,45:v,46:y,54:b,72:x,74:S,77:C,89:w,90:T},{4:17,5:o,7:48,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:m,42:h,43:g,44:_,45:v,46:y,54:b,72:x,74:S,77:C,89:w,90:T},{4:17,5:o,7:49,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:m,42:h,43:g,44:_,45:v,46:y,54:b,72:x,74:S,77:C,89:w,90:T},{4:17,5:o,7:50,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:m,42:h,43:g,44:_,45:v,46:y,54:b,72:x,74:S,77:C,89:w,90:T},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(E,[2,17]),e(E,[2,18]),e(E,[2,19]),e(E,[2,20]),{30:60,33:62,75:D,89:w,90:T},{30:63,33:62,75:D,89:w,90:T},{30:64,33:62,75:D,89:w,90:T},e(O,[2,29]),e(O,[2,30]),e(O,[2,31]),e(O,[2,32]),e(O,[2,33]),e(O,[2,34]),e(k,[2,81]),e(k,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(A,[2,79]),e(A,[2,80]),{27:[1,67],29:[1,68]},e(A,[2,85]),e(A,[2,86]),{62:69,65:j,66:M,67:N,68:P,69:F,70:I,71:L},{62:77,65:j,66:M,67:N,68:P,69:F,70:I,71:L},{30:78,33:62,75:D,89:w,90:T},{73:79,75:R,76:ee,78:81,79:82,80:z,81:B,82:te,83:ne,84:re,85:ie,86:ae,87:oe,88:se},e(ce,[2,60]),e(ce,[2,62]),{73:93,75:R,76:ee,78:81,79:82,80:z,81:B,82:te,83:ne,84:re,85:ie,86:ae,87:oe,88:se},{30:94,33:62,75:D,76:ee,89:w,90:T},{5:[1,95]},{30:96,33:62,75:D,89:w,90:T},{5:[1,97]},{30:98,33:62,75:D,89:w,90:T},{63:[1,99]},e(le,[2,50]),e(le,[2,51]),e(le,[2,52]),e(le,[2,53]),e(le,[2,54]),e(le,[2,55]),e(le,[2,56]),{64:[1,100]},e(E,[2,59],{76:ee}),e(E,[2,64],{76:ue}),{33:103,75:[1,102],89:w,90:T},e(de,[2,65],{79:104,75:R,80:z,81:B,82:te,83:ne,84:re,85:ie,86:ae,87:oe,88:se}),e(fe,[2,67]),e(fe,[2,69]),e(fe,[2,70]),e(fe,[2,71]),e(fe,[2,72]),e(fe,[2,73]),e(fe,[2,74]),e(fe,[2,75]),e(fe,[2,76]),e(fe,[2,77]),e(fe,[2,78]),e(E,[2,57],{76:ue}),e(E,[2,58],{76:ee}),{5:pe,28:105,31:me,34:he,36:ge,38:_e,40:ve},{27:[1,112],76:ee},{5:ye,40:be,56:113,57:xe,59:Se},{27:[1,118],76:ee},{33:119,89:w,90:T},{33:120,89:w,90:T},{75:R,78:121,79:82,80:z,81:B,82:te,83:ne,84:re,85:ie,86:ae,87:oe,88:se},e(ce,[2,61]),e(ce,[2,63]),e(fe,[2,68]),e(E,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:pe,28:126,31:me,34:he,36:ge,38:_e,40:ve},e(E,[2,28]),{5:[1,127]},e(E,[2,42]),{32:[1,128]},{32:[1,129]},{5:ye,40:be,56:130,57:xe,59:Se},e(E,[2,47]),{5:[1,131]},e(E,[2,48]),e(E,[2,49]),e(de,[2,66],{79:104,75:R,80:z,81:B,82:te,83:ne,84:re,85:ie,86:ae,87:oe,88:se}),{33:132,89:w,90:T},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(E,[2,27]),{5:pe,28:145,31:me,34:he,36:ge,38:_e,40:ve},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(E,[2,46]),{5:ye,40:be,56:152,57:xe,59:Se},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(E,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(E,[2,43]),{5:pe,28:159,31:me,34:he,36:ge,38:_e,40:ve},{5:pe,28:160,31:me,34:he,36:ge,38:_e,40:ve},{5:pe,28:161,31:me,34:he,36:ge,38:_e,40:ve},{5:pe,28:162,31:me,34:he,36:ge,38:_e,40:ve},{5:ye,40:be,56:163,57:xe,59:Se},{5:ye,40:be,56:164,57:xe,59:Se},e(E,[2,23]),e(E,[2,24]),e(E,[2,25]),e(E,[2,26]),e(E,[2,44]),e(E,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:p(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:p(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,l=0,u=0,d=0,f=2,m=1,h=a.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(_.yy[v]=this.yy[v]);g.setInput(e,_.yy),_.yy.lexer=g,_.yy.parser=this,g.yylloc===void 0&&(g.yylloc={});var y=g.yylloc;a.push(y);var b=g.options&&g.options.ranges;this.parseError=typeof _.yy.parseError==`function`?_.yy.parseError:Object.getPrototypeOf(this).parseError;function x(e){n.length-=2*e,i.length-=e,a.length-=e}p(x,`popStack`);function S(){var e=r.pop()||g.lex()||m;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}p(S,`lex`);for(var C,w,T,E,D,O={},k,A,j,M;;){if(T=n[n.length-1],this.defaultActions[T]?E=this.defaultActions[T]:(C??=S(),E=o[T]&&o[T][C]),E===void 0||!E.length||!E[0]){var N=``;for(k in M=[],o[T])this.terminals_[k]&&k>f&&M.push(`'`+this.terminals_[k]+`'`);N=g.showPosition?`Parse error on line `+(l+1)+`:1817+`+g.showPosition()+`1818+Expecting `+M.join(`, `)+`, got '`+(this.terminals_[C]||C)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(C==m?`end of input`:`'`+(this.terminals_[C]||C)+`'`),this.parseError(N,{text:g.match,token:this.terminals_[C]||C,line:g.yylineno,loc:y,expected:M})}if(E[0]instanceof Array&&E.length>1)throw Error(`Parse Error: multiple actions possible at state: `+T+`, token: `+C);switch(E[0]){case 1:n.push(C),i.push(g.yytext),a.push(g.yylloc),n.push(E[1]),C=null,w?(C=w,w=null):(u=g.yyleng,s=g.yytext,l=g.yylineno,y=g.yylloc,d>0&&d--);break;case 2:if(A=this.productions_[E[1]][1],O.$=i[i.length-A],O._$={first_line:a[a.length-(A||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(A||1)].first_column,last_column:a[a.length-1].last_column},b&&(O._$.range=[a[a.length-(A||1)].range[0],a[a.length-1].range[1]]),D=this.performAction.apply(O,[s,u,l,_.yy,E[1],i,a].concat(h)),D!==void 0)return D;A&&(n=n.slice(0,-1*A*2),i=i.slice(0,-1*A),a=a.slice(0,-1*A)),n.push(this.productions_[E[1]][0]),i.push(O.$),a.push(O._$),j=o[n[n.length-2]][n[n.length-1]],n.push(j);break;case 3:return!0}}return!0},`parse`)};V.lexer=(function(){return{EOF:1,parseError:p(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:p(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:p(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:p(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:p(function(){return this._more=!0,this},`more`),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).1819+`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:p(function(e){this.unput(this.match.slice(e))},`less`),pastInput:p(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:p(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:p(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`1820+`+t+`^`},`showPosition`),test_match:p(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.1821+`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:p(function(){return this.next()||this.lex()},`lex`),begin:p(function(e){this.conditionStack.push(e)},`begin`),popState:p(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:p(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:p(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:p(function(e){this.begin(e)},`pushState`),stateStackSize:p(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:p(function(e,t,n,r){switch(n){case 0:return`title`;case 1:return this.begin(`acc_title`),9;case 2:return this.popState(),`acc_title_value`;case 3:return this.begin(`acc_descr`),11;case 4:return this.popState(),`acc_descr_value`;case 5:this.begin(`acc_descr_multiline`);break;case 6:this.popState();break;case 7:return`acc_descr_multiline_value`;case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin(`style`),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return`PERCENT`;case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin(`string`);break;case 58:this.popState();break;case 59:return this.begin(`style`),72;case 60:return this.begin(`style`),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin(`string`);break;case 65:this.popState();break;case 66:return`qString`;case 67:return t.yytext=t.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},`anonymous`),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}}})();function Ce(){this.yy={}}return p(Ce,`Parser`),Ce.prototype=V,V.Parser=Ce,new Ce})(),J4.parser=J4,got=J4,_ot=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction=`TB`,this.RequirementType={REQUIREMENT:`Requirement`,FUNCTIONAL_REQUIREMENT:`Functional Requirement`,INTERFACE_REQUIREMENT:`Interface Requirement`,PERFORMANCE_REQUIREMENT:`Performance Requirement`,PHYSICAL_REQUIREMENT:`Physical Requirement`,DESIGN_CONSTRAINT:`Design Constraint`},this.RiskLevel={LOW_RISK:`Low`,MED_RISK:`Medium`,HIGH_RISK:`High`},this.VerifyType={VERIFY_ANALYSIS:`Analysis`,VERIFY_DEMONSTRATION:`Demonstration`,VERIFY_INSPECTION:`Inspection`,VERIFY_TEST:`Test`},this.Relationships={CONTAINS:`contains`,COPIES:`copies`,DERIVES:`derives`,SATISFIES:`satisfies`,VERIFIES:`verifies`,REFINES:`refines`,TRACES:`traces`},this.setAccTitle=Zs,this.getAccTitle=Qs,this.setAccDescription=$s,this.getAccDescription=ec,this.setDiagramTitle=tc,this.getDiagramTitle=nc,this.getConfig=p(()=>Z().requirement,`getConfig`),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{p(this,`RequirementDB`)}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:``,text:``,risk:``,verifyMethod:``,name:``,type:``,cssStyles:[],classes:[`default`]}}getInitialElement(){return{name:``,type:``,docRef:``,cssStyles:[],classes:[`default`]}}addRequirement(e,t){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:t,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:[`default`]}),this.resetLatestRequirement(),this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=e)}setNewReqText(e){this.latestRequirement!==void 0&&(this.latestRequirement.text=e)}setNewReqRisk(e){this.latestRequirement!==void 0&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=e)}addElement(e){return this.elements.has(e)||(this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:[`default`]}),y.info(`Added new element: `,e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){this.latestElement!==void 0&&(this.latestElement.type=e)}setNewElementDocRef(e){this.latestElement!==void 0&&(this.latestElement.docRef=e)}addRelationship(e,t,n){this.relations.push({type:e,src:t,dst:n})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,Xs()}setCssStyle(e,t){for(let n of e){let e=this.requirements.get(n)??this.elements.get(n);if(!t||!e)return;for(let n of t)n.includes(`,`)?e.cssStyles.push(...n.split(`,`)):e.cssStyles.push(n)}}setClass(e,t){for(let n of e){let e=this.requirements.get(n)??this.elements.get(n);if(e)for(let n of t){e.classes.push(n);let t=this.classes.get(n)?.styles;t&&e.cssStyles.push(...t)}}}defineClass(e,t){for(let n of e){let e=this.classes.get(n);e===void 0&&(e={id:n,styles:[],textStyles:[]},this.classes.set(n,e)),t&&t.forEach(function(t){if(/color/.exec(t)){let n=t.replace(`fill`,`bgFill`);e.textStyles.push(n)}e.styles.push(t)}),this.requirements.forEach(e=>{e.classes.includes(n)&&e.cssStyles.push(...t.flatMap(e=>e.split(`,`)))}),this.elements.forEach(e=>{e.classes.includes(n)&&e.cssStyles.push(...t.flatMap(e=>e.split(`,`)))})}}getClasses(){return this.classes}getData(){let e=Z(),t=[],n=[];for(let n of this.requirements.values()){let r=n;r.id=n.name,r.cssStyles=n.cssStyles,r.cssClasses=n.classes.join(` `),r.shape=`requirementBox`,r.look=e.look,r.colorIndex=t.length,t.push(r)}for(let n of this.elements.values()){let r=n;r.shape=`requirementBox`,r.look=e.look,r.id=n.name,r.cssStyles=n.cssStyles,r.cssClasses=n.classes.join(` `),r.colorIndex=t.length,t.push(r)}let r=0;for(let t of this.relations){let i=t.type===this.Relationships.CONTAINS,a={id:`${t.src}-${t.dst}-${r++}`,start:this.requirements.get(t.src)?.name??this.elements.get(t.src)?.name,end:this.requirements.get(t.dst)?.name??this.elements.get(t.dst)?.name,label:`<<${t.type}>>`,classes:`relationshipLine`,style:[`fill:none`,i?``:`stroke-dasharray: 10,7`],labelpos:`c`,thickness:`normal`,type:`normal`,pattern:i?`normal`:`dashed`,arrowTypeStart:i?`requirement_contains`:``,arrowTypeEnd:i?``:`requirement_arrow`,look:e.look,labelType:`markdown`};n.push(a)}return{nodes:t,edges:n,other:{},config:e,direction:this.getDirection()}}},vot=p(e=>{let{themeVariables:t,look:n}=ms(),{bkgColorArray:r,borderColorArray:i}=t;if(!i?.length)return``;let a=``;for(let t=0;t<e.THEME_COLOR_LIMIT;t++)a+=`1822+1823+ [data-look="${n}"][data-color-id="color-${t}"].node path {1824+ stroke: ${i[t]};1825+ fill: ${r?.length?r[t]:``};1826+ }1827+1828+ [data-look="${n}"][data-color-id="color-${t}"].node rect {1829+ stroke: ${i[t]};1830+ fill: ${r?.length?r[t]:``};1831+ }1832+ `;return a},`genColor`),yot=p(e=>{let{look:t,themeVariables:n}=ms(),{requirementEdgeLabelBackground:r}=n;return`1833+ ${vot(e)}1834+ marker {1835+ fill: ${e.relationColor};1836+ stroke: ${e.relationColor};1837+ }1838+1839+ marker.cross {1840+ stroke: ${e.lineColor};1841+ }1842+1843+ svg {1844+ font-family: ${e.fontFamily};1845+ font-size: ${e.fontSize};1846+ }1847+1848+ .reqBox {1849+ fill: ${e.requirementBackground};1850+ fill-opacity: 1.0;1851+ stroke: ${e.requirementBorderColor};1852+ stroke-width: ${e.requirementBorderSize};1853+ }1854+ 1855+ .reqTitle, .reqLabel{1856+ fill: ${e.requirementTextColor};1857+ }1858+ .reqLabelBox {1859+ fill: ${e.relationLabelBackground};1860+ fill-opacity: 1.0;1861+ }1862+1863+ .req-title-line {1864+ stroke: ${e.requirementBorderColor};1865+ stroke-width: ${e.requirementBorderSize};1866+ }1867+ .relationshipLine {1868+ stroke: ${e.relationColor};1869+ stroke-width: ${t===`neo`?e.strokeWidth:`1px`};1870+ }1871+ .relationshipLabel {1872+ fill: ${e.relationLabelColor};1873+ }1874+ .edgeLabel {1875+ background-color: ${e.edgeLabelBackground};1876+ }1877+ .edgeLabel .label rect {1878+ fill: ${e.edgeLabelBackground};1879+ }1880+ .edgeLabel .label text {1881+ fill: ${e.relationLabelColor};1882+ }1883+ .divider {1884+ stroke: ${e.nodeBorder};1885+ stroke-width: 1;1886+ }1887+ .label {1888+ font-family: ${e.fontFamily};1889+ color: ${e.nodeTextColor||e.textColor};1890+ }1891+ .label text,span {1892+ fill: ${e.nodeTextColor||e.textColor};1893+ color: ${e.nodeTextColor||e.textColor};1894+ }1895+ .labelBkg {1896+ background-color: ${r??e.edgeLabelBackground};1897+ }1898+1899+`},`getStyles`),Y4={},m(Y4,{draw:()=>bot}),bot=p(async function(e,t,n,r){y.info(`REF0:`),y.info(`Drawing requirement diagram (unified)`,t);let{securityLevel:i,state:a,layout:o,look:s}=Z(),l=r.db.getData(),u=GL(t,i);l.type=r.type,l.layoutAlgorithm=TI(o),l.nodeSpacing=a?.nodeSpacing??50,l.rankSpacing=a?.rankSpacing??50,l.markers=s===`neo`?[`requirement_contains_neo`,`requirement_arrow_neo`]:[`requirement_contains`,`requirement_arrow`],l.diagramId=t,await wI(l,u),eh.insertTitle(u,`requirementDiagramTitleText`,a?.titleTopMargin??25,r.db.getDiagramTitle()),qL(u,8,`requirementDiagram`,a?.useMaxWidth??!0)},`draw`),xot={parser:got,get db(){return new _ot},renderer:Y4,styles:yot}})),Cot=l({diagram:()=>gst});async function wot(e,t){_3.bumpVerticalPos(10);let{startx:n,stopx:r,message:i}=t,a=Vs.splitBreaks(i).length,o=Rs(i),s=o?await zs(i,Z()):eh.calculateTextDimensions(i,y3($));if(!o){let e=s.height/a;t.height+=e,_3.bumpVerticalPos(e)}let l,u=s.height-10,d=s.width;if(n===r){l=_3.getVerticalPos()+u,$.rightAngles||(u+=$.boxMargin,l=_3.getVerticalPos()+u),u+=30;let e=Vs.getMax(d/2,$.width/2);_3.insert(n-e,_3.getVerticalPos()-10+u,r+e,_3.getVerticalPos()+30+u)}else u+=$.boxMargin,l=_3.getVerticalPos()+u,_3.insert(n,l-10,r,l);return _3.bumpVerticalPos(u),t.height+=u,t.stopy=t.starty+t.height,_3.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),l}function X4(e,t,n,r,i){_3.bumpVerticalPos(n);let a=r;if(t.id&&t.message&&e[t.id]){let n=e[t.id].width,i=y3($);t.message=eh.wrapLabel(`[${t.message}]`,n-2*$.wrapPadding,i),t.width=n,t.wrap=!0;let o=eh.calculateTextDimensions(t.message,i),s=Vs.getMax(o.height,$.labelBoxHeight);a=r+s,y.debug(`${s} - ${t.message}`)}i(t),_3.bumpVerticalPos(a)}function Tot(e,t,n,r,i,a,o){function s(n,r){n.x<i.get(e.from).x?(_3.insert(t.stopx-r,t.starty,t.startx,t.stopy+n.height/2+$.noteMargin),t.stopx+=r):(_3.insert(t.startx,t.starty,t.stopx+r,t.stopy+n.height/2+$.noteMargin),t.stopx-=r)}p(s,`receiverAdjustment`);function l(n,r){n.x<i.get(e.to).x?(_3.insert(t.startx-r,t.starty,t.stopx,t.stopy+n.height/2+$.noteMargin),t.startx+=r):(_3.insert(t.stopx,t.starty,t.startx+r,t.stopy+n.height/2+$.noteMargin),t.startx-=r)}p(l,`senderAdjustment`);let u=[$4.ACTOR,$4.CONTROL,$4.ENTITY,$4.DATABASE];if(a.get(e.to)==r){let t=i.get(e.to);s(t,u.includes(t.type)?e3/2+3:t.width/2+3),t.starty=n-t.height/2,_3.bumpVerticalPos(t.height/2)}else if(o.get(e.from)==r){let t=i.get(e.from);$.mirrorActors&&l(t,u.includes(t.type)?e3/2:t.width/2),t.stopy=n-t.height/2,_3.bumpVerticalPos(t.height/2)}else if(o.get(e.to)==r){let t=i.get(e.to);$.mirrorActors&&s(t,u.includes(t.type)?e3/2+3:t.width/2+3),t.stopy=n-t.height/2,_3.bumpVerticalPos(t.height/2)}}async function Eot(e,t,n){let r={};for(let i of t)if(e.get(i.to)&&e.get(i.from)){let t=e.get(i.to);if(i.placement===n.db.PLACEMENT.LEFTOF&&!t.prevActor||i.placement===n.db.PLACEMENT.RIGHTOF&&!t.nextActor)continue;let a=i.placement!==void 0,o=!a,s=a?b3($):y3($),l=i.wrap?eh.wrapLabel(i.message,$.width-2*$.wrapPadding,s):i.message,u=(Rs(l)?await zs(i.message,Z()):eh.calculateTextDimensions(l,s)).width+2*$.wrapPadding;o&&i.from===t.nextActor?r[i.to]=Vs.getMax(r[i.to]||0,u):o&&i.from===t.prevActor?r[i.from]=Vs.getMax(r[i.from]||0,u):o&&i.from===i.to?(r[i.from]=Vs.getMax(r[i.from]||0,u/2),r[i.to]=Vs.getMax(r[i.to]||0,u/2)):i.placement===n.db.PLACEMENT.RIGHTOF?r[i.from]=Vs.getMax(r[i.from]||0,u):i.placement===n.db.PLACEMENT.LEFTOF?r[t.prevActor]=Vs.getMax(r[t.prevActor]||0,u):i.placement===n.db.PLACEMENT.OVER&&(t.prevActor&&(r[t.prevActor]=Vs.getMax(r[t.prevActor]||0,u/2)),t.nextActor&&(r[i.from]=Vs.getMax(r[i.from]||0,u/2)))}return y.debug(`maxMessageWidthPerActor:`,r),r}async function Dot(e,t,n){let r=0;for(let t of e.keys()){let n=e.get(t);n.wrap&&(n.description=eh.wrapLabel(n.description,$.width-2*$.wrapPadding,x3($)));let i=Rs(n.description)?await zs(n.description,Z()):eh.calculateTextDimensions(n.description,x3($));n.width=n.wrap?$.width:Vs.getMax($.width,i.width+2*$.wrapPadding),n.height=n.wrap?Vs.getMax(i.height,$.height):$.height,r=Vs.getMax(r,n.height)}for(let n in t){let r=e.get(n);if(!r)continue;let i=e.get(r.nextActor);if(!i){let e=t[n]+$.actorMargin-r.width/2;r.margin=Vs.getMax(e,$.actorMargin);continue}let a=t[n]+$.actorMargin-r.width/2-i.width/2;r.margin=Vs.getMax(a,$.actorMargin)}let i=0;return n.forEach(t=>{let n=y3($),r=t.actorKeys.reduce((t,n)=>t+=e.get(n).width+(e.get(n).margin||0),0),a=$.boxMargin*8;r+=a,r-=2*$.boxTextMargin,t.wrap&&(t.name=eh.wrapLabel(t.name,r-2*$.wrapPadding,n));let o=eh.calculateTextDimensions(t.name,n);i=Vs.getMax(o.height,i);let s=Vs.getMax(r,o.width+2*$.wrapPadding);if(t.margin=$.boxTextMargin,r<s){let e=(s-r)/2;t.margin+=e}}),n.forEach(e=>e.textMaxHeight=i),Vs.getMax(r,$.height)}var Z4,Q4,Oot,kot,Aot,jot,$4,Mot,Not,e3,t3,n3,r3,i3,a3,o3,Pot,s3,c3,l3,u3,d3,f3,Fot,Iot,Lot,Rot,zot,Bot,Vot,Hot,Uot,Wot,Got,Kot,qot,p3,Jot,Yot,Xot,Zot,Qot,$ot,est,tst,m3,nst,h3,rst,g3,$,_3,ist,v3,y3,b3,x3,ast,ost,S3,C3,w3,T3,E3,sst,cst,lst,ust,dst,D3,fst,O3,pst,mst,hst,gst,_st=o((()=>{sR(),DC(),rL(),rh(),dc(),S(),h(),_p(),Z4=Kp(),Q4=(function(){var e=p(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,2],n=[1,3],r=[1,4],i=[2,4],a=[1,9],o=[1,11],s=[1,12],l=[1,14],u=[1,15],d=[1,17],f=[1,18],m=[1,19],h=[1,25],g=[1,26],_=[1,27],v=[1,28],y=[1,29],b=[1,30],x=[1,31],S=[1,32],C=[1,33],w=[1,34],T=[1,35],E=[1,36],D=[1,37],O=[1,38],k=[1,39],A=[1,40],j=[1,42],M=[1,43],N=[1,44],P=[1,45],F=[1,46],I=[1,47],L=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],R=[1,74],ee=[1,80],z=[1,81],B=[1,82],te=[1,83],ne=[1,84],re=[1,85],ie=[1,86],ae=[1,87],oe=[1,88],se=[1,89],ce=[1,90],le=[1,91],ue=[1,92],de=[1,93],fe=[1,94],pe=[1,95],me=[1,96],he=[1,97],ge=[1,98],_e=[1,99],ve=[1,100],ye=[1,101],be=[1,102],xe=[1,103],Se=[1,104],V=[1,105],Ce=[2,78],we=[4,5,17,51,53,54],Te=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],Ee=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],De=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],H=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Oe=[5,52],ke=[70,71,72,73],Ae=[1,151],U={trace:p(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NEWLINE`,6:`SD`,10:`INVALID`,14:`create`,15:`box`,16:`restOfLine`,17:`end`,19:`autonumber`,20:`NUM`,21:`off`,22:`activate`,24:`deactivate`,30:`title`,31:`legacy_title`,32:`acc_title`,33:`acc_title_value`,34:`acc_descr`,35:`acc_descr_value`,36:`acc_descr_multiline_value`,37:`loop`,38:`rect`,39:`opt`,40:`alt`,42:`par`,44:`par_over`,45:`critical`,47:`break`,48:`option`,49:`and`,50:`else`,51:`participant`,52:`AS`,53:`participant_actor`,54:`destroy`,56:`note`,59:`over`,61:`links`,62:`link`,63:`properties`,64:`details`,66:`,`,67:`left_of`,68:`right_of`,70:`+`,71:`-`,72:`()`,73:`ACTOR`,75:`CONFIG_START`,76:`CONFIG_CONTENT`,77:`CONFIG_END`,78:`SOLID_OPEN_ARROW`,79:`DOTTED_OPEN_ARROW`,80:`SOLID_ARROW`,81:`SOLID_ARROW_TOP`,82:`SOLID_ARROW_BOTTOM`,83:`STICK_ARROW_TOP`,84:`STICK_ARROW_BOTTOM`,85:`SOLID_ARROW_TOP_DOTTED`,86:`SOLID_ARROW_BOTTOM_DOTTED`,87:`STICK_ARROW_TOP_DOTTED`,88:`STICK_ARROW_BOTTOM_DOTTED`,89:`SOLID_ARROW_TOP_REVERSE`,90:`SOLID_ARROW_BOTTOM_REVERSE`,91:`STICK_ARROW_TOP_REVERSE`,92:`STICK_ARROW_BOTTOM_REVERSE`,93:`SOLID_ARROW_TOP_REVERSE_DOTTED`,94:`SOLID_ARROW_BOTTOM_REVERSE_DOTTED`,95:`STICK_ARROW_TOP_REVERSE_DOTTED`,96:`STICK_ARROW_BOTTOM_REVERSE_DOTTED`,97:`BIDIRECTIONAL_SOLID_ARROW`,98:`DOTTED_ARROW`,99:`BIDIRECTIONAL_DOTTED_ARROW`,100:`SOLID_CROSS`,101:`DOTTED_CROSS`,102:`SOLID_POINT`,103:`DOTTED_POINT`,104:`TXT`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:p(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.apply(a[s]),a[s];case 4:case 10:this.$=[];break;case 5:case 11:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:case 7:case 12:case 13:this.$=a[s];break;case 8:case 9:case 14:this.$=[];break;case 16:a[s].type=`createParticipant`,this.$=a[s];break;case 17:a[s-1].unshift({type:`boxStart`,boxData:r.parseBoxData(a[s-2])}),a[s-1].push({type:`boxEnd`,boxText:a[s-2]}),this.$=a[s-1];break;case 19:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-2]),sequenceIndexStep:Number(a[s-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:`sequenceIndex`,sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:`sequenceIndex`,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 23:this.$={type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor};break;case 24:this.$={type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-1].actor};break;case 30:r.setDiagramTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 31:r.setDiagramTitle(a[s].substring(7)),this.$=a[s].substring(7);break;case 32:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 33:case 34:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 35:a[s-1].unshift({type:`loopStart`,loopText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:`loopEnd`,loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 36:a[s-1].unshift({type:`rectStart`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_START}),a[s-1].push({type:`rectEnd`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[s-1];break;case 37:a[s-1].unshift({type:`optStart`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:`optEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 38:a[s-1].unshift({type:`altStart`,altText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.ALT_START}),a[s-1].push({type:`altEnd`,signalType:r.LINETYPE.ALT_END}),this.$=a[s-1];break;case 39:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 40:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_OVER_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 41:a[s-1].unshift({type:`criticalStart`,criticalText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.CRITICAL_START}),a[s-1].push({type:`criticalEnd`,signalType:r.LINETYPE.CRITICAL_END}),this.$=a[s-1];break;case 42:a[s-1].unshift({type:`breakStart`,breakText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_START}),a[s-1].push({type:`breakEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[s-1];break;case 44:this.$=a[s-3].concat([{type:`option`,optionText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[s]]);break;case 46:this.$=a[s-3].concat([{type:`and`,parText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.PAR_AND},a[s]]);break;case 48:this.$=a[s-3].concat([{type:`else`,altText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.ALT_ELSE},a[s]]);break;case 49:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 50:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 51:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 52:case 57:a[s-1].draw=`actor`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 53:a[s-1].type=`destroyParticipant`,this.$=a[s-1];break;case 54:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 55:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 56:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 58:this.$=[a[s-1],{type:`addNote`,placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 59:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:`addNote`,placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 60:this.$=[a[s-1],{type:`addLinks`,actor:a[s-1].actor,text:a[s]}];break;case 61:this.$=[a[s-1],{type:`addALink`,actor:a[s-1].actor,text:a[s]}];break;case 62:this.$=[a[s-1],{type:`addProperties`,actor:a[s-1].actor,text:a[s]}];break;case 63:this.$=[a[s-1],{type:`addDetails`,actor:a[s-1].actor,text:a[s]}];break;case 66:this.$=[a[s-2],a[s]];break;case 67:this.$=a[s];break;case 68:this.$=r.PLACEMENT.LEFTOF;break;case 69:this.$=r.PLACEMENT.RIGHTOF;break;case 70:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0},{type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor}];break;case 71:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-4].actor}];break;case 72:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor}];break;case 73:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s],activate:!1,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-4].actor}];break;case 74:this.$=[a[s-5],a[s-1],{type:`addMessage`,from:a[s-5].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-5].actor}];break;case 75:this.$=[a[s-3],a[s-1],{type:`addMessage`,from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 76:this.$={type:`addParticipant`,actor:a[s-1],config:a[s]};break;case 77:this.$=a[s-1].trim();break;case 78:this.$={type:`addParticipant`,actor:a[s]};break;case 79:this.$=r.LINETYPE.SOLID_OPEN;break;case 80:this.$=r.LINETYPE.DOTTED_OPEN;break;case 81:this.$=r.LINETYPE.SOLID;break;case 82:this.$=r.LINETYPE.SOLID_TOP;break;case 83:this.$=r.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=r.LINETYPE.STICK_TOP;break;case 85:this.$=r.LINETYPE.STICK_BOTTOM;break;case 86:this.$=r.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=r.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=r.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=r.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=r.LINETYPE.DOTTED;break;case 100:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=r.LINETYPE.SOLID_CROSS;break;case 102:this.$=r.LINETYPE.DOTTED_CROSS;break;case 103:this.$=r.LINETYPE.SOLID_POINT;break;case 104:this.$=r.LINETYPE.DOTTED_POINT;break;case 105:this.$=r.parseMessage(a[s].trim().substring(1))}},`anonymous`),table:[{3:1,4:t,5:n,6:r},{1:[3]},{3:5,4:t,5:n,6:r},{3:6,4:t,5:n,6:r},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:o,8:8,9:10,10:s,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:m,25:20,26:21,27:22,28:23,29:24,30:h,31:g,32:_,34:v,36:y,37:b,38:x,39:S,40:C,42:w,44:T,45:E,47:D,51:O,53:k,54:A,56:j,61:M,62:N,63:P,64:F,73:I},e(L,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:m,25:20,26:21,27:22,28:23,29:24,30:h,31:g,32:_,34:v,36:y,37:b,38:x,39:S,40:C,42:w,44:T,45:E,47:D,51:O,53:k,54:A,56:j,61:M,62:N,63:P,64:F,73:I},e(L,[2,7]),e(L,[2,8]),e(L,[2,9]),e(L,[2,15]),{13:49,51:O,53:k,54:A},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:I},{23:56,73:I},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(L,[2,30]),e(L,[2,31]),{33:[1,62]},{35:[1,63]},e(L,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:R},{23:75,55:76,73:R},{23:77,73:I},{69:78,72:[1,79],78:ee,79:z,80:B,81:te,82:ne,83:re,84:ie,85:ae,86:oe,87:se,88:ce,89:le,90:ue,91:de,92:fe,93:pe,94:me,95:he,96:ge,97:_e,98:ve,99:ye,100:be,101:xe,102:Se,103:V},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:I},{23:111,73:I},{23:112,73:I},{23:113,73:I},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],Ce),e(L,[2,6]),e(L,[2,16]),e(we,[2,10],{11:114}),e(L,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(L,[2,22]),{5:[1,118]},{5:[1,119]},e(L,[2,25]),e(L,[2,26]),e(L,[2,27]),e(L,[2,28]),e(L,[2,29]),e(L,[2,32]),e(L,[2,33]),e(Te,i,{7:120}),e(Te,i,{7:121}),e(Te,i,{7:122}),e(Ee,i,{41:123,7:124}),e(De,i,{43:125,7:126}),e(De,i,{7:126,43:127}),e(H,i,{46:128,7:129}),e(Te,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Oe,Ce,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:I},{69:146,78:ee,79:z,80:B,81:te,82:ne,83:re,84:ie,85:ae,86:oe,87:se,88:ce,89:le,90:ue,91:de,92:fe,93:pe,94:me,95:he,96:ge,97:_e,98:ve,99:ye,100:be,101:xe,102:Se,103:V},e(ke,[2,79]),e(ke,[2,80]),e(ke,[2,81]),e(ke,[2,82]),e(ke,[2,83]),e(ke,[2,84]),e(ke,[2,85]),e(ke,[2,86]),e(ke,[2,87]),e(ke,[2,88]),e(ke,[2,89]),e(ke,[2,90]),e(ke,[2,91]),e(ke,[2,92]),e(ke,[2,93]),e(ke,[2,94]),e(ke,[2,95]),e(ke,[2,96]),e(ke,[2,97]),e(ke,[2,98]),e(ke,[2,99]),e(ke,[2,100]),e(ke,[2,101]),e(ke,[2,102]),e(ke,[2,103]),e(ke,[2,104]),{23:147,73:I},{23:149,60:148,73:I},{73:[2,68]},{73:[2,69]},{58:150,104:Ae},{58:152,104:Ae},{58:153,104:Ae},{58:154,104:Ae},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:O,53:k,54:A},{5:[1,160]},e(L,[2,20]),e(L,[2,21]),e(L,[2,23]),e(L,[2,24]),{4:a,5:o,8:8,9:10,10:s,13:13,14:l,15:u,17:[1,161],18:16,19:d,22:f,23:41,24:m,25:20,26:21,27:22,28:23,29:24,30:h,31:g,32:_,34:v,36:y,37:b,38:x,39:S,40:C,42:w,44:T,45:E,47:D,51:O,53:k,54:A,56:j,61:M,62:N,63:P,64:F,73:I},{4:a,5:o,8:8,9:10,10:s,13:13,14:l,15:u,17:[1,162],18:16,19:d,22:f,23:41,24:m,25:20,26:21,27:22,28:23,29:24,30:h,31:g,32:_,34:v,36:y,37:b,38:x,39:S,40:C,42:w,44:T,45:E,47:D,51:O,53:k,54:A,56:j,61:M,62:N,63:P,64:F,73:I},{4:a,5:o,8:8,9:10,10:s,13:13,14:l,15:u,17:[1,163],18:16,19:d,22:f,23:41,24:m,25:20,26:21,27:22,28:23,29:24,30:h,31:g,32:_,34:v,36:y,37:b,38:x,39:S,40:C,42:w,44:T,45:E,47:D,51:O,53:k,54:A,56:j,61:M,62:N,63:P,64:F,73:I},{17:[1,164]},{4:a,5:o,8:8,9:10,10:s,13:13,14:l,15:u,17:[2,47],18:16,19:d,22:f,23:41,24:m,25:20,26:21,27:22,28:23,29:24,30:h,31:g,32:_,34:v,36:y,37:b,38:x,39:S,40:C,42:w,44:T,45:E,47:D,50:[1,165],51:O,53:k,54:A,56:j,61:M,62:N,63:P,64:F,73:I},{17:[1,166]},{4:a,5:o,8:8,9:10,10:s,13:13,14:l,15:u,17:[2,45],18:16,19:d,22:f,23:41,24:m,25:20,26:21,27:22,28:23,29:24,30:h,31:g,32:_,34:v,36:y,37:b,38:x,39:S,40:C,42:w,44:T,45:E,47:D,49:[1,167],51:O,53:k,54:A,56:j,61:M,62:N,63:P,64:F,73:I},{17:[1,168]},{17:[1,169]},{4:a,5:o,8:8,9:10,10:s,13:13,14:l,15:u,17:[2,43],18:16,19:d,22:f,23:41,24:m,25:20,26:21,27:22,28:23,29:24,30:h,31:g,32:_,34:v,36:y,37:b,38:x,39:S,40:C,42:w,44:T,45:E,47:D,48:[1,170],51:O,53:k,54:A,56:j,61:M,62:N,63:P,64:F,73:I},{4:a,5:o,8:8,9:10,10:s,13:13,14:l,15:u,17:[1,171],18:16,19:d,22:f,23:41,24:m,25:20,26:21,27:22,28:23,29:24,30:h,31:g,32:_,34:v,36:y,37:b,38:x,39:S,40:C,42:w,44:T,45:E,47:D,51:O,53:k,54:A,56:j,61:M,62:N,63:P,64:F,73:I},{16:[1,172]},e(L,[2,50]),{16:[1,173]},e(L,[2,55]),e(Oe,[2,76]),{76:[1,174]},{16:[1,175]},e(L,[2,52]),{16:[1,176]},e(L,[2,57]),e(L,[2,53]),{23:177,73:I},{23:178,73:I},{23:179,73:I},{58:180,104:Ae},{23:181,72:[1,182],73:I},{58:183,104:Ae},{58:184,104:Ae},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(L,[2,17]),e(we,[2,11]),{13:186,51:O,53:k,54:A},e(we,[2,13]),e(we,[2,14]),e(L,[2,19]),e(L,[2,35]),e(L,[2,36]),e(L,[2,37]),e(L,[2,38]),{16:[1,187]},e(L,[2,39]),{16:[1,188]},e(L,[2,40]),e(L,[2,41]),{16:[1,189]},e(L,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:Ae},{58:196,104:Ae},{58:197,104:Ae},{5:[2,75]},{58:198,104:Ae},{23:199,73:I},{5:[2,58]},{5:[2,59]},{23:200,73:I},e(we,[2,12]),e(Ee,i,{7:124,41:201}),e(De,i,{7:126,43:202}),e(H,i,{7:129,46:203}),e(L,[2,49]),e(L,[2,54]),e(Oe,[2,77]),e(L,[2,51]),e(L,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:Ae},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:p(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:p(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,l=0,u=0,d=0,f=2,m=1,h=a.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(_.yy[v]=this.yy[v]);g.setInput(e,_.yy),_.yy.lexer=g,_.yy.parser=this,g.yylloc===void 0&&(g.yylloc={});var y=g.yylloc;a.push(y);var b=g.options&&g.options.ranges;this.parseError=typeof _.yy.parseError==`function`?_.yy.parseError:Object.getPrototypeOf(this).parseError;function x(e){n.length-=2*e,i.length-=e,a.length-=e}p(x,`popStack`);function S(){var e=r.pop()||g.lex()||m;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}p(S,`lex`);for(var C,w,T,E,D,O={},k,A,j,M;;){if(T=n[n.length-1],this.defaultActions[T]?E=this.defaultActions[T]:(C??=S(),E=o[T]&&o[T][C]),E===void 0||!E.length||!E[0]){var N=``;for(k in M=[],o[T])this.terminals_[k]&&k>f&&M.push(`'`+this.terminals_[k]+`'`);N=g.showPosition?`Parse error on line `+(l+1)+`:1900+`+g.showPosition()+`1901+Expecting `+M.join(`, `)+`, got '`+(this.terminals_[C]||C)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(C==m?`end of input`:`'`+(this.terminals_[C]||C)+`'`),this.parseError(N,{text:g.match,token:this.terminals_[C]||C,line:g.yylineno,loc:y,expected:M})}if(E[0]instanceof Array&&E.length>1)throw Error(`Parse Error: multiple actions possible at state: `+T+`, token: `+C);switch(E[0]){case 1:n.push(C),i.push(g.yytext),a.push(g.yylloc),n.push(E[1]),C=null,w?(C=w,w=null):(u=g.yyleng,s=g.yytext,l=g.yylineno,y=g.yylloc,d>0&&d--);break;case 2:if(A=this.productions_[E[1]][1],O.$=i[i.length-A],O._$={first_line:a[a.length-(A||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(A||1)].first_column,last_column:a[a.length-1].last_column},b&&(O._$.range=[a[a.length-(A||1)].range[0],a[a.length-1].range[1]]),D=this.performAction.apply(O,[s,u,l,_.yy,E[1],i,a].concat(h)),D!==void 0)return D;A&&(n=n.slice(0,-1*A*2),i=i.slice(0,-1*A),a=a.slice(0,-1*A)),n.push(this.productions_[E[1]][0]),i.push(O.$),a.push(O._$),j=o[n[n.length-2]][n[n.length-1]],n.push(j);break;case 3:return!0}}return!0},`parse`)};U.lexer=(function(){return{EOF:1,parseError:p(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:p(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:p(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:p(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:p(function(){return this._more=!0,this},`more`),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).1902+`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:p(function(e){this.unput(this.match.slice(e))},`less`),pastInput:p(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:p(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:p(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`1903+`+t+`^`},`showPosition`),test_match:p(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.1904+`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:p(function(){return this.next()||this.lex()},`lex`),begin:p(function(e){this.conditionStack.push(e)},`begin`),popState:p(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:p(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:p(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:p(function(e){this.begin(e)},`pushState`),stateStackSize:p(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:p(function(e,t,n,r){switch(n){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin(`CONFIG`),75;case 8:return 76;case 9:return this.popState(),this.begin(`ALIAS`),77;case 10:return this.popState(),this.popState(),77;case 11:return t.yytext=t.yytext.trim(),73;case 12:return t.yytext=t.yytext.trim(),this.begin(`ALIAS`),73;case 13:return t.yytext=t.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return t.yytext=t.yytext.trim(),this.popState(),10;case 16:return this.begin(`LINE`),15;case 17:return this.begin(`ID`),51;case 18:return this.begin(`ID`),53;case 19:return 14;case 20:return this.begin(`ID`),54;case 21:return this.popState(),this.popState(),this.begin(`LINE`),52;case 22:return this.popState(),this.popState(),5;case 23:return this.begin(`LINE`),37;case 24:return this.begin(`LINE`),38;case 25:return this.begin(`LINE`),39;case 26:return this.begin(`LINE`),40;case 27:return this.begin(`LINE`),50;case 28:return this.begin(`LINE`),42;case 29:return this.begin(`LINE`),44;case 30:return this.begin(`LINE`),49;case 31:return this.begin(`LINE`),45;case 32:return this.begin(`LINE`),48;case 33:return this.begin(`LINE`),47;case 34:return this.popState(),16;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin(`ID`),22;case 45:return this.begin(`ID`),24;case 46:return 30;case 47:return 31;case 48:return this.begin(`acc_title`),32;case 49:return this.popState(),`acc_title_value`;case 50:return this.begin(`acc_descr`),34;case 51:return this.popState(),`acc_descr_value`;case 52:this.begin(`acc_descr_multiline`);break;case 53:this.popState();break;case 54:return`acc_descr_multiline_value`;case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 59:return 5;case 60:return t.yytext=t.yytext.trim(),73;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},`anonymous`),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}}})();function je(){this.yy={}}return p(je,`Parser`),je.prototype=U,U.Parser=je,new je})(),Q4.parser=Q4,Oot=Q4,kot={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},Aot={FILLED:0,OPEN:1},jot={LEFTOF:0,RIGHTOF:1,OVER:2},$4={ACTOR:`actor`,BOUNDARY:`boundary`,COLLECTIONS:`collections`,CONTROL:`control`,DATABASE:`database`,ENTITY:`entity`,PARTICIPANT:`participant`,QUEUE:`queue`},Mot=class{constructor(){this.state=new oR(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=Zs,this.setAccDescription=$s,this.setDiagramTitle=tc,this.getAccTitle=Qs,this.getAccDescription=ec,this.getDiagramTitle=nc,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(Z().wrap),this.LINETYPE=kot,this.ARROWTYPE=Aot,this.PLACEMENT=jot}static{p(this,`SequenceDB`)}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,t,n,r,i){let a=this.state.records.currentBox,o;if(i!==void 0){let e;e=i.includes(`1905+`)?i+`1906+`:`{1907+`+i+`1908+}`,o=EC(e,{schema:TC})}r=o?.type??r,o?.alias&&(!n||n.text===t)&&(n={text:o.alias,wrap:n?.wrap,type:r});let s=this.state.records.actors.get(e);if(s){if(this.state.records.currentBox&&s.box&&this.state.records.currentBox!==s.box)throw Error(`A same participant should only be defined in one Box: ${s.name} can't be in '${s.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(a=s.box?s.box:this.state.records.currentBox,s.box=a,s&&t===s.name&&n==null)return}if(n?.text??(n={text:t,type:r}),(r==null||n.text==null)&&(n={text:t,type:r}),this.state.records.actors.set(e,{box:a,name:t,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??`participant`}),this.state.records.prevActor){let t=this.state.records.actors.get(this.state.records.prevActor);t&&(t.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let t,n=0;if(!e)return 0;for(t=0;t<this.state.records.messages.length;t++)this.state.records.messages[t].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[t].from===e&&n++,this.state.records.messages[t].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[t].from===e&&n--;return n}addMessage(e,t,n,r){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:t,message:n.text,wrap:n.wrap??this.autoWrap(),answer:r})}addSignal(e,t,n,r,i=!1,a){if(r===this.LINETYPE.ACTIVE_END&&this.activationCount(e??``)<1){let t=Error(`Trying to inactivate an inactive participant (`+e+`)`);throw t.hash={text:`->>-`,token:`->>-`,line:`1`,loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:[`'ACTIVE_PARTICIPANT'`]},t}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:t,message:n?.text??``,wrap:n?.wrap??this.autoWrap(),type:r,activate:i,centralConnection:a??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();let t=/^:?wrap:/.exec(e)!==null||/^:?nowrap:/.exec(e)===null&&void 0;return{cleanedText:(t===void 0?e:e.replace(/^:?(?:no)?wrap:/,``)).trim(),wrap:t}}autoWrap(){return this.state.records.wrapEnabled===void 0?Z().sequence?.wrap??!1:this.state.records.wrapEnabled}clear(){this.state.reset(),Xs()}parseMessage(e){let t=e.trim(),{wrap:n,cleanedText:r}=this.extractWrap(t),i={text:r,wrap:n};return y.debug(`parseMessage: ${JSON.stringify(i)}`),i}parseBoxData(e){let t=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e),n=t?.[1]?t[1].trim():`transparent`,r=t?.[2]?t[2].trim():void 0;if(window?.CSS)window.CSS.supports(`color`,n)||(n=`transparent`,r=e.trim());else{let t=new Option().style;t.color=n,t.color!==n&&(n=`transparent`,r=e.trim())}let{wrap:i,cleanedText:a}=this.extractWrap(r);return{text:a?js(a,Z()):void 0,color:n,wrap:i}}addNote(e,t,n){let r={actor:e,placement:t,message:n.text,wrap:n.wrap??this.autoWrap()},i=[].concat(e,e);this.state.records.notes.push(r),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:i[0],to:i[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:t})}addLinks(e,t){let n=this.getActor(e);try{let e=js(t.text,Z());e=e.replace(/=/g,`=`),e=e.replace(/&/g,`&`);let r=JSON.parse(e);this.insertLinks(n,r)}catch(e){y.error(`error while parsing actor link text`,e)}}addALink(e,t){let n=this.getActor(e);try{let e={},r=js(t.text,Z()),i=r.indexOf(`@`);r=r.replace(/=/g,`=`),r=r.replace(/&/g,`&`);let a=r.slice(0,i-1).trim();e[a]=r.slice(i+1).trim(),this.insertLinks(n,e)}catch(e){y.error(`error while parsing actor link text`,e)}}insertLinks(e,t){if(e.links==null)e.links=t;else for(let n in t)e.links[n]=t[n]}addProperties(e,t){let n=this.getActor(e);try{let e=js(t.text,Z()),r=JSON.parse(e);this.insertProperties(n,r)}catch(e){y.error(`error while parsing actor properties text`,e)}}insertProperties(e,t){if(e.properties==null)e.properties=t;else for(let n in t)e.properties[n]=t[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,t){let n=this.getActor(e),r=document.getElementById(t.text);try{let e=r.innerHTML,t=JSON.parse(e);t.properties&&this.insertProperties(n,t.properties),t.links&&this.insertLinks(n,t.links)}catch(e){y.error(`error while parsing actor details text`,e)}}getActorProperty(e,t){if(e?.properties!==void 0)return e.properties[t]}apply(e){if(Array.isArray(e))e.forEach(e=>{this.apply(e)});else switch(e.type){case`sequenceIndex`:this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case`addParticipant`:this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case`createParticipant`:if(this.state.records.actors.has(e.actor))throw Error(`It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior`);this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case`destroyParticipant`:this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case`activeStart`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`centralConnection`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`centralConnectionReverse`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`activeEnd`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`addNote`:this.addNote(e.actor,e.placement,e.text);break;case`addLinks`:this.addLinks(e.actor,e.text);break;case`addALink`:this.addALink(e.actor,e.text);break;case`addProperties`:this.addProperties(e.actor,e.text);break;case`addDetails`:this.addDetails(e.actor,e.text);break;case`addMessage`:if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw Error(`The created participant `+this.state.records.lastCreated.name+` does not have an associated creating message after its declaration. Please check the sequence diagram.`);this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw Error(`The destroyed participant `+this.state.records.lastDestroyed.name+` does not have an associated destroying message after its declaration. Please check the sequence diagram.`);this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case`boxStart`:this.addBox(e.boxData);break;case`boxEnd`:this.boxEnd();break;case`loopStart`:this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case`loopEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`rectStart`:this.addSignal(void 0,void 0,e.color,e.signalType);break;case`rectEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`optStart`:this.addSignal(void 0,void 0,e.optText,e.signalType);break;case`optEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`altStart`:this.addSignal(void 0,void 0,e.altText,e.signalType);break;case`else`:this.addSignal(void 0,void 0,e.altText,e.signalType);break;case`altEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`setAccTitle`:Zs(e.text);break;case`parStart`:this.addSignal(void 0,void 0,e.parText,e.signalType);break;case`and`:this.addSignal(void 0,void 0,e.parText,e.signalType);break;case`parEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`criticalStart`:this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case`option`:this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case`criticalEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`breakStart`:this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case`breakEnd`:this.addSignal(void 0,void 0,void 0,e.signalType)}}getConfig(){return Z().sequence}},Not=p(e=>{let t=e.dropShadow??`none`,{look:n}=Z();return`.actor {1909+ stroke: ${e.actorBorder};1910+ fill: ${e.actorBkg};1911+ stroke-width: ${e.strokeWidth??1};1912+ }1913+1914+ rect.actor.outer-path[data-look="neo"] {1915+ filter: ${t};1916+ }1917+1918+ rect.note[data-look="neo"] {1919+ stroke:${e.noteBorderColor};1920+ fill:${e.noteBkgColor};1921+ filter: ${t};1922+ }1923+1924+ text.actor > tspan {1925+ fill: ${e.actorTextColor};1926+ stroke: none;1927+ }1928+1929+ .actor-line {1930+ stroke: ${e.actorLineColor};1931+ }1932+1933+ .innerArc {1934+ stroke-width: 1.5;1935+ stroke-dasharray: none;1936+ }1937+1938+ .messageLine0 {1939+ stroke-width: 1.5;1940+ stroke-dasharray: none;1941+ stroke: ${e.signalColor};1942+ }1943+1944+ .messageLine1 {1945+ stroke-width: 1.5;1946+ stroke-dasharray: 2, 2;1947+ stroke: ${e.signalColor};1948+ }1949+1950+ [id$="-arrowhead"] path {1951+ fill: ${e.signalColor};1952+ stroke: ${e.signalColor};1953+ }1954+1955+ .sequenceNumber {1956+ fill: ${e.sequenceNumberColor};1957+ }1958+1959+ [id$="-sequencenumber"] {1960+ fill: ${e.signalColor};1961+ }1962+1963+ [id$="-crosshead"] path {1964+ fill: ${e.signalColor};1965+ stroke: ${e.signalColor};1966+ }1967+1968+ .messageText {1969+ fill: ${e.signalTextColor};1970+ stroke: none;1971+ }1972+1973+ .labelBox {1974+ stroke: ${e.labelBoxBorderColor};1975+ fill: ${e.labelBoxBkgColor};1976+ filter: ${n===`neo`?t:`none`};1977+ }1978+1979+ .labelText, .labelText > tspan {1980+ fill: ${e.labelTextColor};1981+ stroke: none;1982+ }1983+1984+ .loopText, .loopText > tspan {1985+ fill: ${e.loopTextColor};1986+ stroke: none;1987+ }1988+1989+ .sectionTitle, .sectionTitle > tspan {1990+ fill: ${e.loopTextColor};1991+ stroke: none;1992+ }1993+1994+ .loopLine {1995+ stroke-width: 2px;1996+ stroke-dasharray: 2, 2;1997+ stroke: ${e.labelBoxBorderColor};1998+ fill: ${e.labelBoxBorderColor};1999+ }2000+2001+ .note {2002+ //stroke: #decc93;2003+ stroke: ${e.noteBorderColor};2004+ fill: ${e.noteBkgColor};2005+ }2006+2007+ .noteText, .noteText > tspan {2008+ fill: ${e.noteTextColor};2009+ stroke: none;2010+ ${e.noteFontWeight?`font-weight: ${e.noteFontWeight};`:``}2011+ }2012+2013+ .activation0 {2014+ fill: ${e.activationBkgColor};2015+ stroke: ${e.activationBorderColor};2016+ }2017+2018+ .activation1 {2019+ fill: ${e.activationBkgColor};2020+ stroke: ${e.activationBorderColor};2021+ }2022+2023+ .activation2 {2024+ fill: ${e.activationBkgColor};2025+ stroke: ${e.activationBorderColor};2026+ }2027+2028+ .actorPopupMenu {2029+ position: absolute;2030+ }2031+2032+ .actorPopupMenuPanel {2033+ position: absolute;2034+ fill: ${e.actorBkg};2035+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);2036+ filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));2037+}2038+ .actor-man circle, line {2039+ fill: ${e.actorBkg};2040+ stroke-width: 2px;2041+ }2042+2043+ g rect.rect {2044+ filter: ${t};2045+ stroke: ${e.nodeBorder};2046+ }2047+`},`getStyles`),e3=36,t3=`actor-top`,n3=`actor-bottom`,r3=`actor-box`,i3=`actor-man`,a3=new Set([`redux-color`,`redux-dark-color`]),o3=p(function(e,t){let n=XI(e,t);return ms().look===`neo`&&n.attr(`data-look`,`neo`),n},`drawRect`),Pot=p(function(e,t,n,r,i){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};let a=t.links,o=t.actorCnt,s=t.rectData;var l=`none`;i&&(l=`block !important`);let u=e.append(`g`);u.attr(`id`,`actor`+o+`_popup`),u.attr(`class`,`actorPopupMenu`),u.attr(`display`,l);var d=``;s.class!==void 0&&(d=` `+s.class);let f=s.width>n?s.width:n,p=u.append(`rect`);if(p.attr(`class`,`actorPopupMenuPanel`+d),p.attr(`x`,s.x),p.attr(`y`,s.height),p.attr(`fill`,s.fill),p.attr(`stroke`,s.stroke),p.attr(`width`,f),p.attr(`height`,s.height),p.attr(`rx`,s.rx),p.attr(`ry`,s.ry),a!=null){var m=20;for(let e in a){var h=u.append(`a`),g=(0,Z4.sanitizeUrl)(a[e]);h.attr(`xlink:href`,g),h.attr(`target`,`_blank`),rst(r)(e,h,s.x+10,s.height+m,f,20,{class:`actor`},r),m+=30}}return p.attr(`height`,m),{height:s.height+m,width:f}},`drawPopup`),s3=p(function(e){return`var pu = document.getElementById('`+e+`'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }`},`popupMenuToggle`),c3=p(async function(e,t,n=null){let r=e.append(`foreignObject`),i=await Bs(t.text,ms()),a=r.append(`xhtml:div`).attr(`style`,`width: fit-content;`).attr(`xmlns`,`http://www.w3.org/1999/xhtml`).html(i).node().getBoundingClientRect();if(r.attr(`height`,Math.round(a.height)).attr(`width`,Math.round(a.width)),t.class===`noteText`){let n=e.node().firstChild;n.setAttribute(`height`,a.height+2*t.textMargin);let i=n.getBBox();r.attr(`x`,Math.round(i.x+i.width/2-a.width/2)).attr(`y`,Math.round(i.y+i.height/2-a.height/2))}else if(n){let{startx:e,stopx:i,starty:o}=n;if(e>i){let t=e;e=i,i=t}r.attr(`x`,Math.round(e+Math.abs(e-i)/2-a.width/2)),t.class===`loopText`?r.attr(`y`,Math.round(o)):r.attr(`y`,Math.round(o-a.height))}return[r]},`drawKatex`),l3=p(function(e,t){let n=0,r=0,i=t.text.split(Vs.lineBreakRegex),[a,o]=$m(t.fontSize),s=[],l=0,u=p(()=>t.y,`yfunc`);if(t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0)switch(t.valign){case`top`:case`start`:u=p(()=>Math.round(t.y+t.textMargin),`yfunc`);break;case`middle`:case`center`:u=p(()=>Math.round(t.y+(n+r+t.textMargin)/2),`yfunc`);break;case`bottom`:case`end`:u=p(()=>Math.round(t.y+(n+r+2*t.textMargin)-t.textMargin),`yfunc`)}if(t.anchor!==void 0&&t.textMargin!==void 0&&t.width!==void 0)switch(t.anchor){case`left`:case`start`:t.x=Math.round(t.x+t.textMargin),t.anchor=`start`,t.dominantBaseline=`middle`,t.alignmentBaseline=`middle`;break;case`middle`:case`center`:t.x=Math.round(t.x+t.width/2),t.anchor=`middle`,t.dominantBaseline=`middle`,t.alignmentBaseline=`middle`;break;case`right`:case`end`:t.x=Math.round(t.x+t.width-t.textMargin),t.anchor=`end`,t.dominantBaseline=`middle`,t.alignmentBaseline=`middle`}for(let[d,f]of i.entries()){t.textMargin!==void 0&&t.textMargin===0&&a!==void 0&&(l=d*a);let i=e.append(`text`);i.attr(`x`,t.x),i.attr(`y`,u()),t.anchor!==void 0&&i.attr(`text-anchor`,t.anchor).attr(`dominant-baseline`,t.dominantBaseline).attr(`alignment-baseline`,t.alignmentBaseline),t.fontFamily!==void 0&&i.style(`font-family`,t.fontFamily),o!==void 0&&i.style(`font-size`,o),t.fontWeight!==void 0&&i.style(`font-weight`,t.fontWeight),t.fill!==void 0&&i.attr(`fill`,t.fill),t.class!==void 0&&i.attr(`class`,t.class),t.dy===void 0?l!==0&&i.attr(`dy`,l):i.attr(`dy`,t.dy);let p=f||``;if(t.tspan){let e=i.append(`tspan`);e.attr(`x`,t.x),t.fill!==void 0&&e.attr(`fill`,t.fill),e.text(p)}else i.text(p);t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0&&(r+=(i._groups||i)[0][0].getBBox().height,n=r),s.push(i)}return s},`drawText`),u3=p(function(e,t){function n(e,t,n,r,i){return e+`,`+t+` `+(e+n)+`,`+t+` `+(e+n)+`,`+(t+r-i)+` `+(e+n-i*1.2)+`,`+(t+r)+` `+e+`,`+(t+r)}p(n,`genPoints`);let r=e.append(`polygon`);return r.attr(`points`,n(t.x,t.y,t.width,t.height,7)),r.attr(`class`,`labelBox`),t.y+=t.height/2,l3(e,t),r},`drawLabel`),d3=-1,f3=p((e,t,n,r)=>{e.select&&n.forEach(n=>{let i=t.get(n),a=e.select(`#actor`+i.actorCnt);!r.mirrorActors&&i.stopy?a.attr(`y2`,i.stopy+i.height/2):r.mirrorActors&&a.attr(`y2`,i.stopy)})},`fixLifeLineHeights`),Fot=p(function(e,t,n,r,i){let a=r?t.stopy:t.starty,o=t.x+t.width/2,s=a+t.height,{look:l,theme:u,themeVariables:d}=n,{bkgColorArray:f,borderColorArray:p}=d,m=e.append(`g`).lower();var h=m;r||(d3++,Object.keys(t.links||{}).length&&!n.forceMenus&&h.attr(`onclick`,s3(`actor${d3}_popup`)).attr(`cursor`,`pointer`),h.append(`line`).attr(`id`,`actor`+d3).attr(`x1`,o).attr(`y1`,s).attr(`x2`,o).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),h=m.append(`g`),t.actorCnt=d3,t.links!=null&&h.attr(`id`,`root-`+d3),l===`neo`&&h.attr(`data-look`,`neo`));let g=eL();var _=`actor`;t.properties?.class?_=t.properties.class:g.fill=`#eaeaea`,_+=r?` ${n3}`:` ${t3}`,g.x=t.x,g.y=a,g.width=t.width,g.height=t.height,g.class=_,g.rx=3,g.ry=3,g.name=t.name,l===`neo`&&(g.rx=6,g.ry=6);let v=o3(h,g),y=i.get(t.name)??0;if(a3.has(u)&&(v.style(`stroke`,p[y%p.length]),v.style(`fill`,f[y%p.length])),l===`neo`&&v.attr(`filter`,`url(#drop-shadow)`),t.rectData=g,t.properties?.icon){let e=t.properties.icon.trim();e.charAt(0)===`@`?$I(h,g.x+g.width-20,g.y+10,e.substr(1)):QI(h,g.x+g.width-20,g.y+10,e)}r||(h.attr(`data-et`,`participant`),h.attr(`data-type`,`participant`),h.attr(`data-id`,t.name)),h3(n,Rs(t.description))(t.description,h,g.x,g.y,g.width,g.height,{class:`actor ${r3}`},n);let b=t.height;if(v.node){let e=v.node().getBBox();t.height=e.height,b=e.height}return b},`drawActorTypeParticipant`),Iot=p(function(e,t,n,r,i){let a=r?t.stopy:t.starty,o=t.x+t.width/2,s=a+t.height,{look:l,theme:u,themeVariables:d}=n,{bkgColorArray:f,borderColorArray:p}=d,m=e.append(`g`).lower();var h=m;r||(d3++,Object.keys(t.links||{}).length&&!n.forceMenus&&h.attr(`onclick`,s3(`actor${d3}_popup`)).attr(`cursor`,`pointer`),h.append(`line`).attr(`id`,`actor`+d3).attr(`x1`,o).attr(`y1`,s).attr(`x2`,o).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),h=m.append(`g`),t.actorCnt=d3,t.links!=null&&h.attr(`id`,`root-`+d3),l===`neo`&&h.attr(`data-look`,`neo`));let g=eL();var _=`actor`;t.properties?.class?_=t.properties.class:g.fill=`#eaeaea`,_+=r?` ${n3}`:` ${t3}`,g.x=t.x,g.y=a,g.width=t.width,g.height=t.height,g.class=_,g.name=t.name;let v={...g,x:g.x+-6,y:g.y+6,class:`actor`},y=o3(h,g),b=o3(h,v);t.rectData=g,l===`neo`&&h.attr(`filter`,`url(#drop-shadow)`);let x=i.get(t.name)??0;if(a3.has(u)&&(y.style(`stroke`,p[x%p.length]),y.style(`fill`,f[x%p.length]),b.style(`stroke`,p[x%p.length]),b.style(`fill`,f[x%p.length])),t.properties?.icon){let e=t.properties.icon.trim();e.charAt(0)===`@`?$I(h,g.x+g.width-20,g.y+10,e.substr(1)):QI(h,g.x+g.width-20,g.y+10,e)}h3(n,Rs(t.description))(t.description,h,g.x-6,g.y+6,g.width,g.height,{class:`actor ${r3}`},n);let S=t.height;if(y.node){let e=y.node().getBBox();t.height=e.height,S=e.height}return r||(h.attr(`data-et`,`participant`),h.attr(`data-type`,`collections`),h.attr(`data-id`,t.name)),S},`drawActorTypeCollections`),Lot=p(function(e,t,n,r,i){let a=r?t.stopy:t.starty,o=t.x+t.width/2,s=a+t.height,{look:l,theme:u,themeVariables:d}=n,{bkgColorArray:f,borderColorArray:p}=d,m=e.append(`g`).lower(),h=m;r||(d3++,Object.keys(t.links||{}).length&&!n.forceMenus&&h.attr(`onclick`,s3(`actor${d3}_popup`)).attr(`cursor`,`pointer`),h.append(`line`).attr(`id`,`actor`+d3).attr(`x1`,o).attr(`y1`,s).attr(`x2`,o).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),h=m.append(`g`),t.actorCnt=d3,t.links!=null&&h.attr(`id`,`root-`+d3),l===`neo`&&h.attr(`data-look`,`neo`));let g=eL(),_=`actor`;t.properties?.class?_=t.properties.class:g.fill=`#eaeaea`,_+=r?` ${n3}`:` ${t3}`,h.attr(`class`,_),g.x=t.x,g.y=a,g.width=t.width,g.height=t.height,g.name=t.name;let v=g.height/2,y=v/(2.5+g.height/50),b=h.append(`g`),x=h.append(`g`),S=`M ${g.x},${g.y+v}2048+ a ${y},${v} 0 0 0 0,${g.height}2049+ h ${g.width-2*y}2050+ a ${y},${v} 0 0 0 0,-${g.height}2051+ Z2052+ `;b.append(`path`).attr(`d`,S),x.append(`path`).attr(`d`,`M ${g.x},${g.y+v}2053+ a ${y},${v} 0 0 0 0,${g.height}`),b.attr(`transform`,`translate(${y}, ${-(g.height/2)})`),x.attr(`transform`,`translate(${g.width-y}, ${-g.height/2})`),t.rectData=g,l===`neo`&&b.attr(`filter`,`url(#drop-shadow)`);let C=i.get(t.name)??0;if(a3.has(u)&&(b.style(`stroke`,p[C%p.length]),b.style(`fill`,f[C%p.length]),x.style(`stroke`,p[C%p.length]),x.style(`fill`,f[C%p.length])),t.properties?.icon){let e=t.properties.icon.trim(),n=g.x+g.width-20,r=g.y+10;e.charAt(0)===`@`?$I(h,n,r,e.substr(1)):QI(h,n,r,e)}h3(n,Rs(t.description))(t.description,h,g.x,g.y,g.width,g.height,{class:`actor ${r3}`},n);let w=t.height,T=b.select(`path:last-child`);if(T.node()){let e=T.node().getBBox();t.height=e.height,w=e.height}return r||(h.attr(`data-et`,`participant`),h.attr(`data-type`,`queue`),h.attr(`data-id`,t.name)),w},`drawActorTypeQueue`),Rot=p(function(e,t,n,r,i,a){let o=r?t.stopy:t.starty,s=t.x+t.width/2,l=o+75,{look:u,theme:d,themeVariables:f}=n,{bkgColorArray:p,borderColorArray:m,actorBorder:h,actorBkg:g}=f,_=e.append(`g`).lower();r||(d3++,_.append(`line`).attr(`id`,`actor`+d3).attr(`x1`,s).attr(`y1`,l).attr(`x2`,s).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),t.actorCnt=d3);let v=e.append(`g`),y=i3;y+=r?` ${n3}`:` ${t3}`,v.attr(`class`,y),v.attr(`name`,t.name);let b=eL();b.x=t.x,b.y=o,b.fill=`#eaeaea`,b.width=t.width,b.height=t.height,b.class=`actor`;let x=t.x+t.width/2,S=o+32;v.append(`defs`).append(`marker`).attr(`id`,i+`-filled-head-control`).attr(`refX`,11).attr(`refY`,5.8).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`172.5`).attr(`stroke-width`,1.2).append(`path`).attr(`d`,`M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z`),v.append(`circle`).attr(`cx`,x).attr(`cy`,S).attr(`r`,22).attr(`filter`,`${u===`neo`?`url(#drop-shadow)`:``}`),v.append(`line`).attr(`marker-end`,`url(#`+i+`-filled-head-control)`).attr(`transform`,`translate(${x}, ${S-22})`);let C=a.get(t.name)??0;return a3.has(d)?(v.style(`stroke`,m[C%m.length]),v.style(`fill`,p[C%m.length])):(v.style(`stroke`,h),v.style(`fill`,g)),t.height=v.node().getBBox().height+2*(n?.sequence?.labelBoxHeight??0),h3(n,Rs(t.description))(t.description,v,b.x,b.y+22+(r?5:12),b.width,b.height,{class:`actor ${i3}`},n),r||(v.attr(`data-et`,`participant`),v.attr(`data-type`,`control`),v.attr(`data-id`,t.name)),t.height},`drawActorTypeControl`),zot=p(function(e,t,n,r,i){let a=r?t.stopy:t.starty,o=t.x+t.width/2,s=a+75,{look:l,theme:u,themeVariables:d}=n,{bkgColorArray:f,borderColorArray:p}=d,m=e.append(`g`).lower(),h=e.append(`g`),g=`actor`;g+=r?` ${n3}`:` ${t3}`,h.attr(`class`,g),h.attr(`name`,t.name);let _=eL();_.x=t.x,_.y=a,_.fill=`#eaeaea`,_.width=t.width,_.height=t.height,_.class=`actor`;let v=t.x+t.width/2,y=a+(r?10:25);h.append(`circle`).attr(`cx`,v).attr(`cy`,y).attr(`r`,22).attr(`width`,t.width).attr(`height`,t.height),h.append(`line`).attr(`x1`,v-22).attr(`x2`,v+22).attr(`y1`,y+22).attr(`y2`,y+22).attr(`stroke-width`,2),l===`neo`&&h.attr(`filter`,`url(#drop-shadow)`);let b=i.get(t.name)??0;return a3.has(u)&&(h.style(`stroke`,p[b%p.length]),h.style(`fill`,f[b%p.length])),t.height=h.node().getBBox().height+(n?.sequence?.labelBoxHeight??0),r||(d3++,m.append(`line`).attr(`id`,`actor`+d3).attr(`x1`,o).attr(`y1`,s).attr(`x2`,o).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),t.actorCnt=d3),h3(n,Rs(t.description))(t.description,h,_.x,_.y+(r?15:30),_.width,_.height,{class:`actor ${i3}`},n),r?h.attr(`transform`,`translate(0, 22)`):(h.attr(`transform`,`translate(0, 6)`),h.attr(`data-et`,`participant`),h.attr(`data-type`,`entity`),h.attr(`data-id`,t.name)),t.height},`drawActorTypeEntity`),Bot=p(function(e,t,n,r,i){let a=r?t.stopy:t.starty,o=t.x+t.width/2,s=a+t.height+2*n.boxTextMargin,{theme:l,themeVariables:u,look:d}=n,{bkgColorArray:f,borderColorArray:p,actorBorder:m}=u,h=e.append(`g`).lower(),g=h;r||(d3++,Object.keys(t.links||{}).length&&!n.forceMenus&&g.attr(`onclick`,s3(`actor${d3}_popup`)).attr(`cursor`,`pointer`),g.append(`line`).attr(`id`,`actor`+d3).attr(`x1`,o).attr(`y1`,s).attr(`x2`,o).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),g=h.append(`g`),t.actorCnt=d3,t.links!=null&&g.attr(`id`,`root-`+d3),d===`neo`&&g.attr(`data-look`,`neo`));let _=eL(),v=`actor`;t.properties?.class?v=t.properties.class:_.fill=`#eaeaea`,v+=r?` ${n3}`:` ${t3}`,_.x=t.x,_.y=a,_.width=t.width,_.height=t.height,_.class=v,_.name=t.name,_.x=t.x,_.y=a;let y=_.width/3,b=_.width/3,x=y/2,S=x/(2.5+y/50),C=g.append(`g`);C.attr(`class`,v);let w=`2054+ M ${_.x},${_.y+S}2055+ a ${x},${S} 0 0 0 ${y},02056+ a ${x},${S} 0 0 0 -${y},02057+ l 0,${b-2*S}2058+ a ${x},${S} 0 0 0 ${y},02059+ l 0,-${b-2*S}2060+`;C.append(`path`).attr(`d`,w),d===`neo`&&C.attr(`filter`,`url(#drop-shadow)`);let T=i.get(t.name)??0;a3.has(l)?(C.style(`stroke`,p[T%p.length]),C.style(`fill`,f[T%p.length])):C.style(`stroke`,m),C.attr(`transform`,`translate(${y}, ${S})`),t.rectData=_,h3(n,Rs(t.description))(t.description,g,_.x,_.y+35,_.width,_.height,{class:`actor ${r3}`},n);let E=C.select(`path:last-child`);return E.node()&&(t.height=E.node().getBBox().height+(n.sequence.labelBoxHeight??0)),r||(g.attr(`data-et`,`participant`),g.attr(`data-type`,`database`),g.attr(`data-id`,t.name)),t.height},`drawActorTypeDatabase`),Vot=p(function(e,t,n,r,i){let a=r?t.stopy:t.starty,o=t.x+t.width/2,s=a+80,l=e.append(`g`).lower(),{look:u,theme:d,themeVariables:f}=n,{bkgColorArray:p,borderColorArray:m,actorBorder:h}=f;r||(d3++,l.append(`line`).attr(`id`,`actor`+d3).attr(`x1`,o).attr(`y1`,s).attr(`x2`,o).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),t.actorCnt=d3);let g=e.append(`g`),_=i3;_+=r?` ${n3}`:` ${t3}`,g.attr(`class`,_),g.attr(`name`,t.name);let v=eL();v.x=t.x,v.y=a,v.fill=`#eaeaea`,v.width=t.width,v.height=t.height,v.class=`actor`,g.append(`line`).attr(`id`,`actor-man-torso`+d3).attr(`x1`,t.x+t.width/2-55).attr(`y1`,a+12).attr(`x2`,t.x+t.width/2-15).attr(`y2`,a+12),g.append(`line`).attr(`id`,`actor-man-arms`+d3).attr(`x1`,t.x+t.width/2-55).attr(`y1`,a+2).attr(`x2`,t.x+t.width/2-55).attr(`y2`,a+22),g.append(`circle`).attr(`cx`,t.x+t.width/2).attr(`cy`,a+12).attr(`r`,22),u===`neo`&&g.attr(`filter`,`url(#drop-shadow)`);let y=i.get(t.name)??0;return a3.has(d)?(g.style(`stroke`,m[y%m.length]),g.style(`fill`,p[y%m.length])):g.style(`stroke`,h),t.height=g.node().getBBox().height+(n.sequence.labelBoxHeight??0),h3(n,Rs(t.description))(t.description,g,v.x,v.y+15,v.width,v.height,{class:`actor ${i3}`},n),g.attr(`transform`,`translate(0,21)`),r||(g.attr(`data-et`,`participant`),g.attr(`data-type`,`boundary`),g.attr(`data-id`,t.name)),t.height},`drawActorTypeBoundary`),Hot=p(function(e,t,n,r,i){let a=r?t.stopy:t.starty,o=t.x+t.width/2,s=a+80,{look:l,theme:u,themeVariables:d}=n,{bkgColorArray:f,borderColorArray:p,actorBorder:m}=d,h=e.append(`g`).lower();r||(d3++,h.append(`line`).attr(`id`,`actor`+d3).attr(`x1`,o).attr(`y1`,s).attr(`x2`,o).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),t.actorCnt=d3);let g=e.append(`g`),_=i3;_+=r?` ${n3}`:` ${t3}`,g.attr(`class`,_),g.attr(`name`,t.name),r||g.attr(`data-et`,`participant`).attr(`data-type`,`actor`).attr(`data-id`,t.name);let v=l===`neo`?.5:1,y=l===`neo`?a+(1-v)*30:a;g.append(`line`).attr(`id`,`actor-man-torso`+d3).attr(`x1`,o).attr(`y1`,y+25*v).attr(`x2`,o).attr(`y2`,y+45*v),g.append(`line`).attr(`id`,`actor-man-arms`+d3).attr(`x1`,o-e3/2*v).attr(`y1`,y+33*v).attr(`x2`,o+e3/2*v).attr(`y2`,y+33*v),g.append(`line`).attr(`x1`,o-e3/2*v).attr(`y1`,y+60*v).attr(`x2`,o).attr(`y2`,y+45*v),g.append(`line`).attr(`x1`,o).attr(`y1`,y+45*v).attr(`x2`,o+(e3/2-2)*v).attr(`y2`,y+60*v);let b=g.append(`circle`);b.attr(`cx`,t.x+t.width/2),b.attr(`cy`,y+10*v),b.attr(`r`,15*v),b.attr(`width`,t.width*v),b.attr(`height`,t.height*v),t.height=g.node().getBBox().height;let x=eL();x.x=t.x,x.y=y,x.fill=`#eaeaea`,x.width=t.width,x.height=t.height/v,x.class=`actor`,x.rx=3,x.ry=3;let S=i.get(t.name)??0;return a3.has(u)?(g.style(`stroke`,p[S%p.length]),g.style(`fill`,f[S%p.length])):g.style(`stroke`,m),h3(n,Rs(t.description))(t.description,g,x.x,y+35*v-(l===`neo`?10:0),x.width,x.height,{class:`actor ${i3}`},n),t.height},`drawActorTypeActor`),Uot=p(async function(e,t,n,r,i,a,o){let s=o??new Map([...a.db.getActors().values()].map((e,t)=>[e.name,t]));switch(t.type){case`actor`:return await Hot(e,t,n,r,s);case`participant`:return await Fot(e,t,n,r,s);case`boundary`:return await Vot(e,t,n,r,s);case`control`:return await Rot(e,t,n,r,i,s);case`entity`:return await zot(e,t,n,r,s);case`database`:return await Bot(e,t,n,r,s);case`collections`:return await Iot(e,t,n,r,s);case`queue`:return await Lot(e,t,n,r,s)}},`drawActor`),Wot=p(function(e,t,n){let r=e.append(`g`);p3(r,t),t.name&&h3(n)(t.name,r,t.x,t.y+n.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:`text`},n),r.lower()},`drawBox`),Got=p(function(e){return e.append(`g`)},`anchorElement`),Kot=p(function(e,t,n,r,i,a,o){let{theme:s,themeVariables:l}=r,{bkgColorArray:u,borderColorArray:d,mainBkg:f}=l,p=eL(),m=t.anchored,h=t.actor;p.x=t.startx,p.y=t.starty,p.class=`activation`+i%3,p.width=t.stopx-t.startx,p.height=n-t.starty;let g=o3(m,p),_=(o??new Map([...a.db.getActors().values()].map((e,t)=>[e.name,t]))).get(h)??0;a3.has(s)&&(g.style(`stroke`,d[_%d.length]),g.style(`fill`,u[_%d.length]??f))},`drawActivation`),qot=p(async function(e,t,n,r,i){let{boxMargin:a,boxTextMargin:o,labelBoxHeight:s,labelBoxWidth:l,messageFontFamily:u,messageFontSize:d,messageFontWeight:f}=r,m=e.append(`g`).attr(`data-et`,`control-structure`).attr(`data-id`,`i`+i.id),h=p(function(e,t,n,r){return m.append(`line`).attr(`x1`,e).attr(`y1`,t).attr(`x2`,n).attr(`y2`,r).attr(`class`,`loopLine`)},`drawLoopLine`);h(t.startx,t.starty,t.stopx,t.starty),h(t.stopx,t.starty,t.stopx,t.stopy),h(t.startx,t.stopy,t.stopx,t.stopy),h(t.startx,t.starty,t.startx,t.stopy),t.sections!==void 0&&t.sections.forEach(function(e){h(t.startx,e.y,t.stopx,e.y).style(`stroke-dasharray`,`3, 3`)});let g=tL();g.text=n,g.x=t.startx,g.y=t.starty,g.fontFamily=u,g.fontSize=d,g.fontWeight=f,g.anchor=`middle`,g.valign=`middle`,g.tspan=!1,g.width=Math.max(l??0,50),g.height=s+(r.look===`neo`?15:0)||20,g.textMargin=o,g.class=`labelText`,u3(m,g),g=m3(),g.text=t.title,g.x=t.startx+l/2+(t.stopx-t.startx)/2,g.y=t.starty+a+o,g.anchor=`middle`,g.valign=`middle`,g.textMargin=o,g.class=`loopText`,g.fontFamily=u,g.fontSize=d,g.fontWeight=f,g.wrap=!0;let _=Rs(g.text)?await c3(m,g,t):l3(m,g);if(t.sectionTitles!==void 0){for(let[e,n]of Object.entries(t.sectionTitles))if(n.message){g.text=n.message,g.x=t.startx+(t.stopx-t.startx)/2,g.y=t.sections[e].y+a+o,g.class=`sectionTitle`,g.anchor=`middle`,g.valign=`middle`,g.tspan=!1,g.fontFamily=u,g.fontSize=d,g.fontWeight=f,g.wrap=t.wrap,Rs(g.text)?(t.starty=t.sections[e].y,await c3(m,g,t)):l3(m,g);let r=Math.round(_.map(e=>(e._groups||e)[0][0].getBBox().height).reduce((e,t)=>e+t));t.sections[e].height+=r-(a+o)}}return t.height=Math.round(t.stopy-t.starty),m},`drawLoop`),p3=p(function(e,t){ZI(e,t)},`drawBackgroundRect`),Jot=p(function(e,t){e.append(`defs`).append(`symbol`).attr(`id`,t+`-database`).attr(`fill-rule`,`evenodd`).attr(`clip-rule`,`evenodd`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z`)},`insertDatabaseIcon`),Yot=p(function(e,t){e.append(`defs`).append(`symbol`).attr(`id`,t+`-computer`).attr(`width`,`24`).attr(`height`,`24`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z`)},`insertComputerIcon`),Xot=p(function(e,t){e.append(`defs`).append(`symbol`).attr(`id`,t+`-clock`).attr(`width`,`24`).attr(`height`,`24`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z`)},`insertClockIcon`),Zot=p(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-arrowhead`).attr(`refX`,7.9).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M -1 0 L 10 5 L 0 10 z`)},`insertArrowHead`),Qot=p(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-filled-head`).attr(`refX`,15.5).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`)},`insertArrowFilledHead`),$ot=p(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-sequencenumber`).attr(`refX`,15).attr(`refY`,15).attr(`markerWidth`,60).attr(`markerHeight`,40).attr(`orient`,`auto`).append(`circle`).attr(`cx`,15).attr(`cy`,15).attr(`r`,6)},`insertSequenceNumber`),est=p(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-crosshead`).attr(`markerWidth`,15).attr(`markerHeight`,8).attr(`orient`,`auto`).attr(`refX`,4).attr(`refY`,4.5).append(`path`).attr(`fill`,`none`).attr(`stroke`,`#000000`).style(`stroke-dasharray`,`0, 0`).attr(`stroke-width`,`1pt`).attr(`d`,`M 1,2 L 6,7 M 6,2 L 1,7`)},`insertArrowCrossHead`),tst=p(function(e,t){let{theme:n}=t;e.append(`defs`).append(`filter`).attr(`id`,`drop-shadow`).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${n===`redux`||n===`redux-color`?`#000000`:`#FFFFFF`}`)},`insertDropShadow`),m3=p(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:`#666`,width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},`getTextObj`),nst=p(function(){return{x:0,y:0,fill:`#EDF2AE`,stroke:`#666`,width:100,anchor:`start`,height:100,rx:0,ry:0}},`getNoteRect`),h3=(function(){function e(e,t,n,r,a,o,s){i(t.append(`text`).attr(`x`,n+a/2).attr(`y`,r+o/2+5).style(`text-anchor`,`middle`).text(e),s)}p(e,`byText`);function t(e,t,n,r,a,o,s,l){let{actorFontSize:u,actorFontFamily:d,actorFontWeight:f}=l,[p,m]=$m(u),h=e.split(Vs.lineBreakRegex);for(let e=0;e<h.length;e++){let l=e*p-p*(h.length-1)/2,u=t.append(`text`).attr(`x`,n+a/2).attr(`y`,r).style(`text-anchor`,`middle`).style(`font-size`,m).style(`font-weight`,f).style(`font-family`,d);u.append(`tspan`).attr(`x`,n+a/2).attr(`dy`,l).text(h[e]),u.attr(`y`,r+o/2).attr(`dominant-baseline`,`central`).attr(`alignment-baseline`,`central`),i(u,s)}}p(t,`byTspan`);function n(e,n,r,a,o,s,l,u){let d=n.append(`switch`),f=d.append(`foreignObject`).attr(`x`,r).attr(`y`,a).attr(`width`,o).attr(`height`,s).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`);f.append(`div`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).text(e),t(e,d,r,a,o,s,l,u),i(f,l)}p(n,`byFo`);async function r(e,n,r,a,o,s,l,u){let d=await zs(e,ms()),f=n.append(`switch`),p=f.append(`foreignObject`).attr(`x`,r+o/2-d.width/2).attr(`y`,a+s/2-d.height/2).attr(`width`,d.width).attr(`height`,d.height).append(`xhtml:div`).style(`height`,`100%`).style(`width`,`100%`);p.append(`div`).style(`text-align`,`center`).style(`vertical-align`,`middle`).html(await Bs(e,ms())),t(e,f,r,a,o,s,l,u),i(p,l)}p(r,`byKatex`);function i(e,t){for(let n in t)t.hasOwnProperty(n)&&e.attr(n,t[n])}return p(i,`_setTextAttrs`),function(i,a=!1){return a?r:i.textPlacement===`fo`?n:i.textPlacement===`old`?e:t}})(),rst=(function(){function e(e,t,n,i,a,o,s){r(t.append(`text`).attr(`x`,n).attr(`y`,i).style(`text-anchor`,`start`).text(e),s)}p(e,`byText`);function t(e,t,n,i,a,o,s,l){let{actorFontSize:u,actorFontFamily:d,actorFontWeight:f}=l,p=e.split(Vs.lineBreakRegex);for(let e=0;e<p.length;e++){let a=e*u-u*(p.length-1)/2,l=t.append(`text`).attr(`x`,n).attr(`y`,i).style(`text-anchor`,`start`).style(`font-size`,u).style(`font-weight`,f).style(`font-family`,d);l.append(`tspan`).attr(`x`,n).attr(`dy`,a).text(p[e]),l.attr(`y`,i+o/2).attr(`dominant-baseline`,`central`).attr(`alignment-baseline`,`central`),r(l,s)}}p(t,`byTspan`);function n(e,n,i,a,o,s,l,u){let d=n.append(`switch`),f=d.append(`foreignObject`).attr(`x`,i).attr(`y`,a).attr(`width`,o).attr(`height`,s).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`);f.append(`div`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).text(e),t(e,d,i,a,o,s,l,u),r(f,l)}p(n,`byFo`);function r(e,t){for(let n in t)t.hasOwnProperty(n)&&e.attr(n,t[n])}return p(r,`_setTextAttrs`),function(r){return r.textPlacement===`fo`?n:r.textPlacement===`old`?e:t}})(),g3={drawRect:o3,drawText:l3,drawLabel:u3,drawActor:Uot,drawBox:Wot,drawPopup:Pot,anchorElement:Got,drawActivation:Kot,drawLoop:qot,drawBackgroundRect:p3,insertArrowHead:Zot,insertArrowFilledHead:Qot,insertSequenceNumber:$ot,insertArrowCrossHead:est,insertDatabaseIcon:Jot,insertComputerIcon:Yot,insertClockIcon:Xot,getTextObj:m3,getNoteRect:nst,fixLifeLineHeights:f3,sanitizeUrl:Z4.sanitizeUrl,insertDropShadow:tst,insertSolidTopArrowHead:p(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-solidTopArrowHead`).attr(`refX`,7.9).attr(`refY`,7.25).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M 0 0 L 10 8 L 0 8 z`)},`insertSolidTopArrowHead`),insertSolidBottomArrowHead:p(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-solidBottomArrowHead`).attr(`refX`,7.9).attr(`refY`,.75).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M 0 0 L 10 0 L 0 8 z`)},`insertSolidBottomArrowHead`),insertStickTopArrowHead:p(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-stickTopArrowHead`).attr(`refX`,7.5).attr(`refY`,7).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M 0 0 L 7 7`).attr(`stroke`,`black`).attr(`stroke-width`,1.5).attr(`fill`,`none`)},`insertStickTopArrowHead`),insertStickBottomArrowHead:p(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-stickBottomArrowHead`).attr(`refX`,7.5).attr(`refY`,0).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M 0 7 L 7 0`).attr(`stroke`,`black`).attr(`stroke-width`,1.5).attr(`fill`,`none`)},`insertStickBottomArrowHead`)},$={},_3={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:p(function(){return Math.max.apply(null,this.actors.length===0?[0]:this.actors.map(e=>e.height||0))+(this.loops.length===0?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.messages.length===0?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.notes.length===0?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},`getHeight`),clear:p(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},`clear`),addBox:p(function(e){this.boxes.push(e)},`addBox`),addActor:p(function(e){this.actors.push(e)},`addActor`),addLoop:p(function(e){this.loops.push(e)},`addLoop`),addMessage:p(function(e){this.messages.push(e)},`addMessage`),addNote:p(function(e){this.notes.push(e)},`addNote`),lastActor:p(function(){return this.actors[this.actors.length-1]},`lastActor`),lastLoop:p(function(){return this.loops[this.loops.length-1]},`lastLoop`),lastMessage:p(function(){return this.messages[this.messages.length-1]},`lastMessage`),lastNote:p(function(){return this.notes[this.notes.length-1]},`lastNote`),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:p(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,w3(Z())},`init`),updateVal:p(function(e,t,n,r){e[t]=e[t]===void 0?n:r(n,e[t])},`updateVal`),updateBounds:p(function(e,t,n,r){let i=this,a=0;function o(o){return p(function(s){a++;let l=i.sequenceItems.length-a+1;i.updateVal(s,`starty`,t-l*$.boxMargin,Math.min),i.updateVal(s,`stopy`,r+l*$.boxMargin,Math.max),i.updateVal(_3.data,`startx`,e-l*$.boxMargin,Math.min),i.updateVal(_3.data,`stopx`,n+l*$.boxMargin,Math.max),o!==`activation`&&(i.updateVal(s,`startx`,e-l*$.boxMargin,Math.min),i.updateVal(s,`stopx`,n+l*$.boxMargin,Math.max),i.updateVal(_3.data,`starty`,t-l*$.boxMargin,Math.min),i.updateVal(_3.data,`stopy`,r+l*$.boxMargin,Math.max))},`updateItemBounds`)}p(o,`updateFn`),this.sequenceItems.forEach(o()),this.activations.forEach(o(`activation`))},`updateBounds`),insert:p(function(e,t,n,r){let i=Vs.getMin(e,n),a=Vs.getMax(e,n),o=Vs.getMin(t,r),s=Vs.getMax(t,r);this.updateVal(_3.data,`startx`,i,Math.min),this.updateVal(_3.data,`starty`,o,Math.min),this.updateVal(_3.data,`stopx`,a,Math.max),this.updateVal(_3.data,`stopy`,s,Math.max),this.updateBounds(i,o,a,s)},`insert`),newActivation:p(function(e,t,n){let r=n.get(e.from),i=T3(e.from).length||0,a=r.x+r.width/2+(i-1)*$.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+$.activationWidth,stopy:void 0,actor:e.from,anchored:g3.anchorElement(t)})},`newActivation`),endActivation:p(function(e){let t=this.activations.map(function(e){return e.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},`endActivation`),createLoop:p(function(e={message:void 0,wrap:!1,width:void 0},t){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e.message,wrap:e.wrap,width:e.width,height:0,fill:t}},`createLoop`),newLoop:p(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},`newLoop`),endLoop:p(function(){return this.sequenceItems.pop()},`endLoop`),isLoopOverlap:p(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},`isLoopOverlap`),addSectionToLoop:p(function(e){let t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:_3.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},`addSectionToLoop`),saveVerticalPos:p(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},`saveVerticalPos`),resetVerticalPos:p(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},`resetVerticalPos`),bumpVerticalPos:p(function(e){this.verticalPos+=e,this.data.stopy=Vs.getMax(this.data.stopy,this.verticalPos)},`bumpVerticalPos`),getVerticalPos:p(function(){return this.verticalPos},`getVerticalPos`),getBounds:p(function(){return{bounds:this.data,models:this.models}},`getBounds`)},ist=p(async function(e,t,n){_3.bumpVerticalPos($.boxMargin),t.height=$.boxMargin,t.starty=_3.getVerticalPos();let r=eL();r.x=t.startx,r.y=t.starty,r.width=t.width||$.width,r.class=`note`;let i=e.append(`g`);i.attr(`data-et`,`note`),i.attr(`data-id`,`i`+n);let a=g3.drawRect(i,r),o=tL();o.x=t.startx,o.y=t.starty,o.width=r.width,o.dy=`1em`,o.text=t.message,o.class=`noteText`,o.fontFamily=$.noteFontFamily,o.fontSize=$.noteFontSize,o.fontWeight=$.noteFontWeight,o.anchor=$.noteAlign,o.textMargin=$.noteMargin,o.valign=`center`;let s=Rs(o.text)?await c3(i,o):l3(i,o),l=Math.round(s.map(e=>(e._groups||e)[0][0].getBBox().height).reduce((e,t)=>e+t));a.attr(`height`,l+2*$.noteMargin),t.height+=l+2*$.noteMargin,_3.bumpVerticalPos(l+2*$.noteMargin),t.stopy=t.starty+l+2*$.noteMargin,t.stopx=t.startx+r.width,_3.insert(t.startx,t.starty,t.stopx,t.stopy),_3.models.addNote(t)},`drawNote`),v3=p(function(e,t,n,r,i,a,o){let s=r.db.getActors(),l=s.get(t.from),u=s.get(t.to),d=n.sequenceVisible,f=l.x+l.width/2,m=u.x+u.width/2,h=f<=m,g=O3(t,r),_=e.append(`g`),v=p((e,t)=>{let n=e?16.5:-16.5;return t?-n:n},`getCircleOffset`),y=p(e=>{_.append(`circle`).attr(`cx`,e).attr(`cy`,o).attr(`r`,5).attr(`width`,10).attr(`height`,10)},`drawCircle`),{CENTRAL_CONNECTION:b,CENTRAL_CONNECTION_REVERSE:x,CENTRAL_CONNECTION_DUAL:S}=r.db.LINETYPE;if(d)switch(t.centralConnection){case b:g&&(m+=v(h,!0));break;case x:g||(f+=v(h,!1));break;case S:g?m+=v(h,!0):f+=v(h,!1)}switch(t.centralConnection){case b:y(m);break;case x:y(f);break;case S:y(f),y(m)}},`drawCentralConnection`),y3=p(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),`messageFont`),b3=p(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),`noteFont`),x3=p(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),`actorFont`),p(wot,`boundMessage`),ast=p(async function(e,t,n,r,i,a){let{startx:o,stopx:s,starty:l,message:u,type:d,sequenceIndex:f,sequenceVisible:p}=t,m=eh.calculateTextDimensions(u,y3($)),h=tL();h.x=Math.min(o,s),h.y=l+10,h.width=Math.abs(s-o),h.class=`messageText`,h.dy=`1em`,h.text=u,h.fontFamily=$.messageFontFamily,h.fontSize=$.messageFontSize,h.fontWeight=$.messageFontWeight,h.anchor=$.messageAlign,h.valign=`center`,h.textMargin=$.wrapPadding,h.tspan=!1,Rs(h.text)?await c3(e,h,{startx:o,stopx:s,starty:n}):l3(e,h);let g=m.width,_;if(o===s){let a=p||$.showSequenceNumbers,l=O3(i,r),u=pst(i,r),d=o+(a&&(l||u)?10:0);_=$.rightAngles?e.append(`path`).attr(`d`,`M ${d},${n} H ${o+Vs.getMax($.width/2,g/2)} V ${n+25} H ${o}`):e.append(`path`).attr(`d`,`M `+d+`,`+n+` C `+(d+60)+`,`+(n-10)+` `+(o+60)+`,`+(n+30)+` `+o+`,`+(n+20)),D3(i,r)&&v3(e,i,t,r,o,s,n)}else _=e.append(`line`),_.attr(`x1`,o),_.attr(`y1`,n),_.attr(`x2`,s),_.attr(`y2`,n),D3(i,r)&&v3(e,i,t,r,o,s,n);d===r.db.LINETYPE.DOTTED||d===r.db.LINETYPE.DOTTED_CROSS||d===r.db.LINETYPE.DOTTED_POINT||d===r.db.LINETYPE.DOTTED_OPEN||d===r.db.LINETYPE.BIDIRECTIONAL_DOTTED||d===r.db.LINETYPE.SOLID_TOP_DOTTED||d===r.db.LINETYPE.SOLID_BOTTOM_DOTTED||d===r.db.LINETYPE.STICK_TOP_DOTTED||d===r.db.LINETYPE.STICK_BOTTOM_DOTTED||d===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||d===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||d===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||d===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(_.style(`stroke-dasharray`,`3, 3`),_.attr(`class`,`messageLine1`)):_.attr(`class`,`messageLine0`),_.attr(`data-et`,`message`),_.attr(`data-id`,`i`+t.id),_.attr(`data-from`,t.from),_.attr(`data-to`,t.to);let v=``;if($.arrowMarkerAbsolute&&(v=Ns(!0)),_.attr(`stroke-width`,2),_.attr(`stroke`,`none`),_.style(`fill`,`none`),(d===r.db.LINETYPE.SOLID_TOP||d===r.db.LINETYPE.SOLID_TOP_DOTTED)&&_.attr(`marker-end`,`url(`+v+`#`+a+`-solidTopArrowHead)`),(d===r.db.LINETYPE.SOLID_BOTTOM||d===r.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&_.attr(`marker-end`,`url(`+v+`#`+a+`-solidBottomArrowHead)`),(d===r.db.LINETYPE.STICK_TOP||d===r.db.LINETYPE.STICK_TOP_DOTTED)&&_.attr(`marker-end`,`url(`+v+`#`+a+`-stickTopArrowHead)`),(d===r.db.LINETYPE.STICK_BOTTOM||d===r.db.LINETYPE.STICK_BOTTOM_DOTTED)&&_.attr(`marker-end`,`url(`+v+`#`+a+`-stickBottomArrowHead)`),(d===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||d===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&_.attr(`marker-start`,`url(`+v+`#`+a+`-solidBottomArrowHead)`),(d===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||d===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&_.attr(`marker-start`,`url(`+v+`#`+a+`-solidTopArrowHead)`),(d===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE||d===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&_.attr(`marker-start`,`url(`+v+`#`+a+`-stickBottomArrowHead)`),(d===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||d===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&_.attr(`marker-start`,`url(`+v+`#`+a+`-stickTopArrowHead)`),(d===r.db.LINETYPE.SOLID||d===r.db.LINETYPE.DOTTED)&&_.attr(`marker-end`,`url(`+v+`#`+a+`-arrowhead)`),(d===r.db.LINETYPE.BIDIRECTIONAL_SOLID||d===r.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(_.attr(`marker-start`,`url(`+v+`#`+a+`-arrowhead)`),_.attr(`marker-end`,`url(`+v+`#`+a+`-arrowhead)`)),(d===r.db.LINETYPE.SOLID_POINT||d===r.db.LINETYPE.DOTTED_POINT)&&_.attr(`marker-end`,`url(`+v+`#`+a+`-filled-head)`),(d===r.db.LINETYPE.SOLID_CROSS||d===r.db.LINETYPE.DOTTED_CROSS)&&_.attr(`marker-end`,`url(`+v+`#`+a+`-crosshead)`),p||$.showSequenceNumbers){let l=d===r.db.LINETYPE.BIDIRECTIONAL_SOLID||d===r.db.LINETYPE.BIDIRECTIONAL_DOTTED,u=d===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||d===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||d===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||d===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||d===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE||d===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||d===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||d===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,p=D3(i,r),m=o,h=s;l?(o<s?m=o+12:(m=o-6+(p?-5:0),m+=i?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_DUAL||i?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),_.attr(`x1`,m)):u?(s>o?h=s-12:(h=s-6,m+=i?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_DUAL||i?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),h+=p?15:0,_.attr(`x2`,h),_.attr(`x1`,m)):_.attr(`x1`,o+6);let g=0,y=o===s,b=o<=s;g=y?t.fromBounds+1:u?b?t.toBounds-1:t.fromBounds+1:b?t.fromBounds+1:t.toBounds-1;let x=`12px`,S=f.toString().length;S>5?x=`7px`:S>3&&(x=`9px`),e.append(`line`).attr(`x1`,g).attr(`y1`,n).attr(`x2`,g).attr(`y2`,n).attr(`stroke-width`,0).attr(`marker-start`,`url(`+v+`#`+a+`-sequencenumber)`),e.append(`text`).attr(`x`,g).attr(`y`,n+4).attr(`font-family`,`sans-serif`).attr(`font-size`,x).attr(`text-anchor`,`middle`).attr(`class`,`sequenceNumber`).text(f)}},`drawMessage`),ost=p(function(e,t,n,r,i,a,o){let s=0,l=0,u,d=0;for(let e of r){let r=t.get(e),a=r.box;u&&u!=a&&(o||_3.models.addBox(u),l+=$.boxMargin+u.margin),a&&a!=u&&(o||(a.x=s+l,a.y=i),l+=a.margin),r.width=Vs.getMax(r.width||$.width,$.width),r.height=Vs.getMax(r.height||$.height,$.height),r.margin=r.margin||$.actorMargin,d=Vs.getMax(d,r.height),n.get(r.name)&&(l+=r.width/2),r.x=s+l,r.starty=_3.getVerticalPos(),_3.insert(r.x,i,r.x+r.width,r.height),s+=r.width+l,r.box&&(r.box.width=s+a.margin-r.box.x),l=r.margin,u=r.box,_3.models.addActor(r)}u&&!o&&_3.models.addBox(u),_3.bumpVerticalPos(d)},`addActorRenderingData`),S3=p(async function(e,t,n,r,i,a,o){if(r){let r=0;_3.bumpVerticalPos($.boxMargin*2);for(let s of n){let n=t.get(s);n.stopy||=_3.getVerticalPos();let l=await g3.drawActor(e,n,$,!0,i,a,o);r=Vs.getMax(r,l)}_3.bumpVerticalPos(r+$.boxMargin)}else for(let r of n){let n=t.get(r);await g3.drawActor(e,n,$,!1,i,a,o)}},`drawActors`),C3=p(function(e,t,n,r){let i=0,a=0;for(let o of n){let n=t.get(o),s=cst(n),l=g3.drawPopup(e,n,s,$,$.forceMenus,r);l.height>i&&(i=l.height),l.width+n.x>a&&(a=l.width+n.x)}return{maxHeight:i,maxWidth:a}},`drawActorsPopup`),w3=p(function(e){qo($,e),e.fontFamily&&($.actorFontFamily=$.noteFontFamily=$.messageFontFamily=e.fontFamily),e.fontSize&&($.actorFontSize=$.noteFontSize=$.messageFontSize=e.fontSize),e.fontWeight&&($.actorFontWeight=$.noteFontWeight=$.messageFontWeight=e.fontWeight)},`setConf`),T3=p(function(e){return _3.activations.filter(function(t){return t.actor===e})},`actorActivations`),E3=p(function(e,t){let n=t.get(e),r=T3(e);return[r.reduce(function(e,t){return Vs.getMin(e,t.startx)},n.x+n.width/2-1),r.reduce(function(e,t){return Vs.getMax(e,t.stopx)},n.x+n.width/2+1)]},`activationBounds`),p(X4,`adjustLoopHeightForWrap`),p(Tot,`adjustCreatedDestroyedData`),sst=p(async function(e,t,n,r){let{securityLevel:i,sequence:a,look:o,themeVariables:s}=Z();$=a;let l;i===`sandbox`&&(l=$c(`#i`+t));let u=$c(i===`sandbox`?l.nodes()[0].contentDocument.body:`body`),d=i===`sandbox`?l.nodes()[0].contentDocument:document;_3.init(),y.debug(r.db);let f=i===`sandbox`?u.select(`[id="${t}"]`):$c(`[id="${t}"]`),m=r.db.getActors(),h=r.db.getCreatedActors(),g=r.db.getDestroyedActors(),_=r.db.getBoxes(),v=r.db.getActorKeys(),b=r.db.getMessages(),x=r.db.getDiagramTitle(),S=r.db.hasAtLeastOneBox(),C=r.db.hasAtLeastOneBoxWithTitle(),w=await Eot(m,b,r);if($.height=await Dot(m,w,_),g3.insertComputerIcon(f,t),g3.insertDatabaseIcon(f,t),g3.insertClockIcon(f,t),S&&(_3.bumpVerticalPos($.boxMargin),C&&_3.bumpVerticalPos(_[0].textMaxHeight)),$.hideUnusedParticipants===!0){let e=new Set;b.forEach(t=>{e.add(t.from),e.add(t.to)}),v=v.filter(t=>e.has(t))}let T=new Map(v.map((e,t)=>[m.get(e)?.name??e,t]));ost(f,m,h,v,0,b,!1);let E=await hst(b,m,w,r);g3.insertArrowHead(f,t),g3.insertArrowCrossHead(f,t),g3.insertArrowFilledHead(f,t),g3.insertSequenceNumber(f,t),g3.insertSolidTopArrowHead(f,t),g3.insertSolidBottomArrowHead(f,t),g3.insertStickTopArrowHead(f,t),g3.insertStickBottomArrowHead(f,t),o===`neo`&&g3.insertDropShadow(f,$);function D(e,t){let n=_3.endActivation(e);n.starty+18>t&&(n.starty=t-6,t+=12),g3.drawActivation(f,n,t,$,T3(e.from).length,r,T),_3.insert(n.startx,t-10,n.stopx,t)}p(D,`activeEnd`);let O=1,k=1,A=[],j=[],M=0;for(let e of b){let t,n,i;switch(e.type){case r.db.LINETYPE.NOTE:_3.resetVerticalPos(),n=e.noteModel,await ist(f,n,e.id);break;case r.db.LINETYPE.ACTIVE_START:_3.newActivation(e,f,m);break;case r.db.LINETYPE.CENTRAL_CONNECTION:_3.newActivation(e,f,m);break;case r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:_3.newActivation(e,f,m);break;case r.db.LINETYPE.ACTIVE_END:D(e,_3.getVerticalPos());break;case r.db.LINETYPE.LOOP_START:X4(E,e,$.boxMargin,$.boxMargin+$.boxTextMargin,e=>_3.newLoop(e));break;case r.db.LINETYPE.LOOP_END:t=_3.endLoop(),await g3.drawLoop(f,t,`loop`,$,e),_3.bumpVerticalPos(t.stopy-_3.getVerticalPos()),_3.models.addLoop(t);break;case r.db.LINETYPE.RECT_START:X4(E,e,$.boxMargin,$.boxMargin,e=>{let t=e.message;t||=s?.rectBkgColor||s?.actorBkg||`rgba(128, 128, 128, 0.5)`,_3.newLoop(void 0,t)});break;case r.db.LINETYPE.RECT_END:t=_3.endLoop(),j.push(t),_3.models.addLoop(t),_3.bumpVerticalPos(t.stopy-_3.getVerticalPos());break;case r.db.LINETYPE.OPT_START:X4(E,e,$.boxMargin,$.boxMargin+$.boxTextMargin,e=>_3.newLoop(e));break;case r.db.LINETYPE.OPT_END:t=_3.endLoop(),await g3.drawLoop(f,t,`opt`,$,e),_3.bumpVerticalPos(t.stopy-_3.getVerticalPos()),_3.models.addLoop(t);break;case r.db.LINETYPE.ALT_START:X4(E,e,$.boxMargin,$.boxMargin+$.boxTextMargin,e=>_3.newLoop(e));break;case r.db.LINETYPE.ALT_ELSE:X4(E,e,$.boxMargin+$.boxTextMargin,$.boxMargin,e=>_3.addSectionToLoop(e));break;case r.db.LINETYPE.ALT_END:t=_3.endLoop(),await g3.drawLoop(f,t,`alt`,$,e),_3.bumpVerticalPos(t.stopy-_3.getVerticalPos()),_3.models.addLoop(t);break;case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:X4(E,e,$.boxMargin,$.boxMargin+$.boxTextMargin,e=>_3.newLoop(e)),_3.saveVerticalPos();break;case r.db.LINETYPE.PAR_AND:X4(E,e,$.boxMargin+$.boxTextMargin,$.boxMargin,e=>_3.addSectionToLoop(e));break;case r.db.LINETYPE.PAR_END:t=_3.endLoop(),await g3.drawLoop(f,t,`par`,$,e),_3.bumpVerticalPos(t.stopy-_3.getVerticalPos()),_3.models.addLoop(t);break;case r.db.LINETYPE.AUTONUMBER:O=e.message.start||O,k=e.message.step||k,e.message.visible?r.db.enableSequenceNumbers():r.db.disableSequenceNumbers();break;case r.db.LINETYPE.CRITICAL_START:X4(E,e,$.boxMargin,$.boxMargin+$.boxTextMargin,e=>_3.newLoop(e));break;case r.db.LINETYPE.CRITICAL_OPTION:X4(E,e,$.boxMargin+$.boxTextMargin,$.boxMargin,e=>_3.addSectionToLoop(e));break;case r.db.LINETYPE.CRITICAL_END:t=_3.endLoop(),await g3.drawLoop(f,t,`critical`,$,e),_3.bumpVerticalPos(t.stopy-_3.getVerticalPos()),_3.models.addLoop(t);break;case r.db.LINETYPE.BREAK_START:X4(E,e,$.boxMargin,$.boxMargin+$.boxTextMargin,e=>_3.newLoop(e));break;case r.db.LINETYPE.BREAK_END:t=_3.endLoop(),await g3.drawLoop(f,t,`break`,$,e),_3.bumpVerticalPos(t.stopy-_3.getVerticalPos()),_3.models.addLoop(t);break;default:try{i=e.msgModel,i.starty=_3.getVerticalPos(),i.sequenceIndex=O,i.sequenceVisible=r.db.showSequenceNumbers(),i.id=e.id,i.from=e.from,i.to=e.to;let t=await wot(f,i);Tot(e,i,t,M,m,h,g),A.push({messageModel:i,lineStartY:t,msg:e}),_3.models.addMessage(i)}catch(e){y.error(`error while drawing message`,e)}}[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.SOLID_TOP,r.db.LINETYPE.SOLID_BOTTOM,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.SOLID_TOP_DOTTED,r.db.LINETYPE.SOLID_BOTTOM_DOTTED,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT,r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type)&&(O=Math.round((O+k)*100)/100),M++}y.debug(`createdActors`,h),y.debug(`destroyedActors`,g),await S3(f,m,v,!1,t,r,T);for(let e of A)await ast(f,e.messageModel,e.lineStartY,r,e.msg,t);$.mirrorActors&&await S3(f,m,v,!0,t,r,T),j.forEach(e=>g3.drawBackgroundRect(f,e)),f3(f,m,v,$);for(let e of _3.models.boxes){e.height=_3.getVerticalPos()-e.y,_3.insert(e.x,e.y,e.x+e.width,e.height);let t=$.boxMargin*2;e.startx=e.x-t,e.starty=e.y-t*.25,e.stopx=e.startx+e.width+2*t,e.stopy=e.starty+e.height+t*.75,e.stroke=`rgb(0,0,0, 0.5)`,g3.drawBox(f,e,$)}S&&_3.bumpVerticalPos($.boxMargin);let N=C3(f,m,v,d),{bounds:P}=_3.getBounds();P.startx===void 0&&(P.startx=0),P.starty===void 0&&(P.starty=0),P.stopx===void 0&&(P.stopx=0),P.stopy===void 0&&(P.stopy=0);let F=P.stopy-P.starty;F<N.maxHeight&&(F=N.maxHeight);let I=F+2*$.diagramMarginY;$.mirrorActors&&(I=I-$.boxMargin+$.bottomMarginAdj);let L=P.stopx-P.startx;L<N.maxWidth&&(L=N.maxWidth);let R=L+2*$.diagramMarginX;x&&f.append(`text`).text(x).attr(`x`,(P.stopx-P.startx)/2-2*$.diagramMarginX).attr(`y`,-25),Hs(f,I,R,$.useMaxWidth);let ee=x?40:0,z=m.size&&o===`neo`?30:0;f.attr(`viewBox`,P.startx-$.diagramMarginX+` -`+($.diagramMarginY+ee)+` `+R+` `+(I+ee+z)),y.debug(`models:`,_3.models)},`draw`),p(Eot,`getMaxMessageWidthPerActor`),cst=p(function(e){let t=0,n=x3($);for(let r in e.links){let e=eh.calculateTextDimensions(r,n).width+2*$.wrapPadding+2*$.boxMargin;t<e&&(t=e)}return t},`getRequiredPopupWidth`),p(Dot,`calculateActorMargins`),lst=p(async function(e,t,n){let r=t.get(e.from),i=t.get(e.to),a=r.x,o=i.x,s=e.wrap&&e.message,l=Rs(e.message)?await zs(e.message,Z()):eh.calculateTextDimensions(s?eh.wrapLabel(e.message,$.width,b3($)):e.message,b3($)),u={width:s?$.width:Vs.getMax($.width,l.width+2*$.noteMargin),height:0,startx:r.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===n.db.PLACEMENT.RIGHTOF?(u.width=s?Vs.getMax($.width,l.width):Vs.getMax(r.width/2+i.width/2,l.width+2*$.noteMargin),u.startx=a+(r.width+$.actorMargin)/2):e.placement===n.db.PLACEMENT.LEFTOF?(u.width=s?Vs.getMax($.width,l.width+2*$.noteMargin):Vs.getMax(r.width/2+i.width/2,l.width+2*$.noteMargin),u.startx=a-u.width+(r.width-$.actorMargin)/2):e.to===e.from?(l=eh.calculateTextDimensions(s?eh.wrapLabel(e.message,Vs.getMax($.width,r.width),b3($)):e.message,b3($)),u.width=s?Vs.getMax($.width,r.width):Vs.getMax(r.width,$.width,l.width+2*$.noteMargin),u.startx=a+(r.width-u.width)/2):(u.width=Math.abs(a+r.width/2-(o+i.width/2))+$.actorMargin,u.startx=a<o?a+r.width/2-$.actorMargin/2:o+i.width/2-$.actorMargin/2),s&&(u.message=eh.wrapLabel(e.message,u.width-2*$.wrapPadding,b3($))),y.debug(`NM:[${u.startx},${u.stopx},${u.starty},${u.stopy}:${u.width},${u.height}=${e.message}]`),u},`buildNoteModel`),ust=4,dst=6,D3=p(function(e,t){let{CENTRAL_CONNECTION:n,CENTRAL_CONNECTION_REVERSE:r,CENTRAL_CONNECTION_DUAL:i}=t.db.LINETYPE;return[n,r,i].includes(e.centralConnection)},`hasCentralConnection`),fst=p(function(e,t,n){let{CENTRAL_CONNECTION_REVERSE:r,CENTRAL_CONNECTION_DUAL:i,BIDIRECTIONAL_SOLID:a,BIDIRECTIONAL_DOTTED:o}=t.db.LINETYPE,s=0;return(e.centralConnection===r||e.centralConnection===i)&&(s+=ust),(e.centralConnection===r||e.centralConnection===i)&&(e.type===a||e.type===o)&&(s+=n?0:-dst),s},`calculateCentralConnectionOffset`),O3=p(function(e,t){let{SOLID_ARROW_TOP_REVERSE:n,SOLID_ARROW_TOP_REVERSE_DOTTED:r,SOLID_ARROW_BOTTOM_REVERSE:i,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:a,STICK_ARROW_TOP_REVERSE:o,STICK_ARROW_TOP_REVERSE_DOTTED:s,STICK_ARROW_BOTTOM_REVERSE:l,STICK_ARROW_BOTTOM_REVERSE_DOTTED:u}=t.db.LINETYPE;return[n,r,i,a,o,s,l,u].includes(e.type)},`isReverseArrowType`),pst=p(function(e,t){let{BIDIRECTIONAL_SOLID:n,BIDIRECTIONAL_DOTTED:r}=t.db.LINETYPE;return[n,r].includes(e.type)},`isBidirectionalArrowType`),mst=p(function(e,t,n){let{look:r}=Z();if(![n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.SOLID,n.db.LINETYPE.SOLID_TOP,n.db.LINETYPE.SOLID_BOTTOM,n.db.LINETYPE.STICK_TOP,n.db.LINETYPE.STICK_BOTTOM,n.db.LINETYPE.SOLID_TOP_DOTTED,n.db.LINETYPE.SOLID_BOTTOM_DOTTED,n.db.LINETYPE.STICK_TOP_DOTTED,n.db.LINETYPE.STICK_BOTTOM_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.DOTTED,n.db.LINETYPE.SOLID_CROSS,n.db.LINETYPE.DOTTED_CROSS,n.db.LINETYPE.SOLID_POINT,n.db.LINETYPE.DOTTED_POINT,n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type))return{};let[i,a]=E3(e.from,t),[o,s]=E3(e.to,t),l=i<=o,u=l?a:i,d=l?o:s;r===`neo`&&(e.type!==n.db.LINETYPE.SOLID_OPEN&&(d+=l?-3:3),(e.type===n.db.LINETYPE.BIDIRECTIONAL_SOLID||e.type===n.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(u+=l?3:-3)),u+=fst(e,n,l);let f=Math.abs(o-s)>2,m=p(e=>l?-e:e,`adjustValue`);e.from===e.to?d=u:(e.activate&&!f&&(d+=m($.activationWidth/2-1)),[n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.STICK_TOP,n.db.LINETYPE.STICK_BOTTOM,n.db.LINETYPE.STICK_TOP_DOTTED,n.db.LINETYPE.STICK_BOTTOM_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)||(d+=m(3)),[n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)&&(u-=m(3)));let h=[i,a,o,s],g=Math.abs(u-d);e.wrap&&e.message&&(e.message=eh.wrapLabel(e.message,Vs.getMax(g+2*$.wrapPadding,$.width),y3($)));let _=eh.calculateTextDimensions(e.message,y3($));return{width:Vs.getMax(e.wrap?0:_.width+2*$.wrapPadding,g+2*$.wrapPadding,$.width),height:0,startx:u,stopx:d,starty:0,stopy:0,message:e.message,type:e.type,wrap:e.wrap,fromBounds:Math.min.apply(null,h),toBounds:Math.max.apply(null,h)}},`buildMessageModel`),hst=p(async function(e,t,n,r){let i={},a=[],o,s,l;for(let n of e){switch(n.type){case r.db.LINETYPE.LOOP_START:case r.db.LINETYPE.ALT_START:case r.db.LINETYPE.OPT_START:case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:case r.db.LINETYPE.CRITICAL_START:case r.db.LINETYPE.BREAK_START:a.push({id:n.id,msg:n.message,from:2**53-1,to:-(2**53-1),width:0});break;case r.db.LINETYPE.ALT_ELSE:case r.db.LINETYPE.PAR_AND:case r.db.LINETYPE.CRITICAL_OPTION:n.message&&(o=a.pop(),i[o.id]=o,i[n.id]=o,a.push(o));break;case r.db.LINETYPE.LOOP_END:case r.db.LINETYPE.ALT_END:case r.db.LINETYPE.OPT_END:case r.db.LINETYPE.PAR_END:case r.db.LINETYPE.CRITICAL_END:case r.db.LINETYPE.BREAK_END:o=a.pop(),i[o.id]=o;break;case r.db.LINETYPE.ACTIVE_START:{let e=t.get(n.from?n.from:n.to.actor),r=T3(n.from?n.from:n.to.actor).length,i=e.x+e.width/2+(r-1)*$.activationWidth/2,a={startx:i,stopx:i+$.activationWidth,actor:n.from,enabled:!0};_3.activations.push(a)}break;case r.db.LINETYPE.ACTIVE_END:{let e=_3.activations.map(e=>e.actor).lastIndexOf(n.from);_3.activations.splice(e,1).splice(0,1)}}n.placement===void 0?(l=mst(n,t,r),n.msgModel=l,l.startx&&l.stopx&&a.length>0&&a.forEach(e=>{if(o=e,l.startx===l.stopx){let e=t.get(n.from),r=t.get(n.to);o.from=Vs.getMin(e.x-l.width/2,e.x-e.width/2,o.from),o.to=Vs.getMax(r.x+l.width/2,r.x+e.width/2,o.to),o.width=Vs.getMax(o.width,Math.abs(o.to-o.from))-$.labelBoxWidth}else o.from=Vs.getMin(l.startx,o.from),o.to=Vs.getMax(l.stopx,o.to),o.width=Vs.getMax(o.width,l.width)-$.labelBoxWidth})):(s=await lst(n,t,r),n.noteModel=s,a.forEach(e=>{o=e,o.from=Vs.getMin(o.from,s.startx),o.to=Vs.getMax(o.to,s.startx+s.width),o.width=Vs.getMax(o.width,Math.abs(o.from-o.to))-$.labelBoxWidth}))}return _3.activations=[],y.debug(`Loop type widths:`,i),i},`calculateLoopBounds`),gst={parser:Oot,get db(){return new Mot},renderer:{bounds:_3,drawActors:S3,drawActorsPopup:C3,setConf:w3,draw:sst},styles:Not,init:p(e=>{e.sequence||={},e.wrap&&(e.sequence.wrap=e.wrap,ic({sequence:{wrap:e.wrap}}))},`init`)}})),k3,A3,j3,M3,N3,P3,F3,I3,L3,R3,vst=o((()=>{WL(),KL(),JL(),EI(),rL(),rh(),dc(),S(),h(),_p(),qt(),k3=(function(){var e=p(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,18],n=[1,19],r=[1,20],i=[1,41],a=[1,26],o=[1,42],s=[1,24],l=[1,25],u=[1,32],d=[1,33],f=[1,34],m=[1,45],h=[1,35],g=[1,36],_=[1,37],v=[1,38],y=[1,27],b=[1,28],x=[1,29],S=[1,30],C=[1,31],w=[1,44],T=[1,46],E=[1,43],D=[1,47],O=[1,9],k=[1,8,9],A=[1,58],j=[1,59],M=[1,60],N=[1,61],P=[1,62],F=[1,63],I=[1,64],L=[1,8,9,41],R=[1,77],ee=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],z=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],B=[13,60,86,100,102,103],te=[13,60,73,74,86,100,102,103],ne=[13,60,68,69,70,71,72,86,100,102,103],re=[1,103],ie=[1,121],ae=[1,117],oe=[1,113],se=[1,119],ce=[1,114],le=[1,115],ue=[1,116],de=[1,118],fe=[1,120],pe=[22,50,60,61,82,86,87,88,89,90],me=[1,128],he=[12,39],ge=[1,8,9,39,41,44,46],_e=[1,8,9,22],ve=[1,153],ye=[1,8,9,61],be=[1,8,9,22,50,60,61,82,86,87,88,89,90],xe={trace:p(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:`error`,7:`CLASS_DIAGRAM`,8:`NEWLINE`,9:`EOF`,12:`SQS`,13:`STR`,14:`SQE`,18:`DOT`,20:`GENERICTYPE`,22:`LABEL`,33:`acc_title`,34:`acc_title_value`,35:`acc_descr`,36:`acc_descr_value`,37:`acc_descr_multiline_value`,39:`STRUCT_START`,41:`STRUCT_STOP`,42:`NAMESPACE`,44:`STYLE_SEPARATOR`,46:`ANNOTATION_START`,47:`ANNOTATION_END`,48:`CLASS`,50:`SPACE`,51:`MEMBER`,52:`SEPARATOR`,54:`NOTE_FOR`,56:`NOTE`,57:`CLASSDEF`,60:`ALPHA`,61:`COMMA`,62:`direction_tb`,63:`direction_bt`,64:`direction_rl`,65:`direction_lr`,68:`AGGREGATION`,69:`EXTENSION`,70:`COMPOSITION`,71:`DEPENDENCY`,72:`LOLLIPOP`,73:`LINE`,74:`DOTTED_LINE`,75:`CALLBACK`,76:`LINK`,77:`LINK_TARGET`,78:`CLICK`,79:`CALLBACK_NAME`,80:`CALLBACK_ARGS`,81:`HREF`,82:`STYLE`,83:`CSSCLASS`,86:`NUM`,87:`COLON`,88:`UNIT`,89:`BRKT`,90:`PCT`,93:`graphCodeTokens`,95:`TAGSTART`,96:`TAGEND`,97:`==`,98:`--`,99:`DEFAULT`,100:`MINUS`,101:`keywords`,102:`UNICODE_TEXT`,103:`BQUOTE_STR`},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:p(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 8:this.$=a[s-1];break;case 9:case 10:case 13:case 15:this.$=a[s];break;case 11:case 14:this.$=a[s-2]+`.`+a[s];break;case 12:case 16:this.$=a[s-1]+a[s];break;case 17:case 18:this.$=a[s-1]+`~`+a[s]+`~`;break;case 19:r.addRelation(a[s]);break;case 20:a[s-1].title=r.cleanupLabel(a[s]),r.addRelation(a[s-1]);break;case 31:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 32:case 33:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 34:r.addClassesToNamespace(a[s-3],a[s-1][0],a[s-1][1]),r.popNamespace();break;case 35:r.addClassesToNamespace(a[s-4],a[s-1][0],a[s-1][1]),r.popNamespace();break;case 36:this.$=r.addNamespace(a[s]);break;case 37:this.$=r.addNamespace(a[s-1],a[s]);break;case 38:this.$=[[a[s]],[]];break;case 39:this.$=[[a[s-1]],[]];break;case 40:a[s][0].unshift(a[s-2]),this.$=a[s];break;case 41:this.$=[[],[a[s]]];break;case 42:this.$=[[],[a[s-1]]];break;case 43:a[s][1].unshift(a[s-2]),this.$=a[s];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=a[s];break;case 48:r.setCssClass(a[s-2],a[s]);break;case 49:r.addMembers(a[s-3],a[s-1]);break;case 51:r.setCssClass(a[s-5],a[s-3]),r.addMembers(a[s-5],a[s-1]);break;case 52:r.addAnnotation(a[s-3],a[s-1]);break;case 53:r.addAnnotation(a[s-6],a[s-4]),r.addMembers(a[s-6],a[s-1]);break;case 54:r.addAnnotation(a[s-5],a[s-3]);break;case 55:this.$=a[s],r.addClass(a[s]);break;case 56:this.$=a[s-1],r.addClass(a[s-1]),r.setClassLabel(a[s-1],a[s]);break;case 60:r.addAnnotation(a[s],a[s-2]);break;case 61:case 74:this.$=[a[s]];break;case 62:a[s].push(a[s-1]),this.$=a[s];break;case 63:break;case 64:r.addMember(a[s-1],r.cleanupLabel(a[s]));break;case 65:break;case 66:break;case 67:this.$={id1:a[s-2],id2:a[s],relation:a[s-1],relationTitle1:`none`,relationTitle2:`none`};break;case 68:this.$={id1:a[s-3],id2:a[s],relation:a[s-1],relationTitle1:a[s-2],relationTitle2:`none`};break;case 69:this.$={id1:a[s-3],id2:a[s],relation:a[s-2],relationTitle1:`none`,relationTitle2:a[s-1]};break;case 70:this.$={id1:a[s-4],id2:a[s],relation:a[s-2],relationTitle1:a[s-3],relationTitle2:a[s-1]};break;case 71:this.$=r.addNote(a[s],a[s-1]);break;case 72:this.$=r.addNote(a[s]);break;case 73:this.$=a[s-2],r.defineClass(a[s-1],a[s]);break;case 75:this.$=a[s-2].concat([a[s]]);break;case 76:r.setDirection(`TB`);break;case 77:r.setDirection(`BT`);break;case 78:r.setDirection(`RL`);break;case 79:r.setDirection(`LR`);break;case 80:this.$={type1:a[s-2],type2:a[s],lineType:a[s-1]};break;case 81:this.$={type1:`none`,type2:a[s],lineType:a[s-1]};break;case 82:this.$={type1:a[s-1],type2:`none`,lineType:a[s]};break;case 83:this.$={type1:`none`,type2:`none`,lineType:a[s]};break;case 84:this.$=r.relationType.AGGREGATION;break;case 85:this.$=r.relationType.EXTENSION;break;case 86:this.$=r.relationType.COMPOSITION;break;case 87:this.$=r.relationType.DEPENDENCY;break;case 88:this.$=r.relationType.LOLLIPOP;break;case 89:this.$=r.lineType.LINE;break;case 90:this.$=r.lineType.DOTTED_LINE;break;case 91:case 97:this.$=a[s-2],r.setClickEvent(a[s-1],a[s]);break;case 92:case 98:this.$=a[s-3],r.setClickEvent(a[s-2],a[s-1]),r.setTooltip(a[s-2],a[s]);break;case 93:this.$=a[s-2],r.setLink(a[s-1],a[s]);break;case 94:this.$=a[s-3],r.setLink(a[s-2],a[s-1],a[s]);break;case 95:this.$=a[s-3],r.setLink(a[s-2],a[s-1]),r.setTooltip(a[s-2],a[s]);break;case 96:this.$=a[s-4],r.setLink(a[s-3],a[s-2],a[s]),r.setTooltip(a[s-3],a[s-1]);break;case 99:this.$=a[s-3],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 100:this.$=a[s-4],r.setClickEvent(a[s-3],a[s-2],a[s-1]),r.setTooltip(a[s-3],a[s]);break;case 101:this.$=a[s-3],r.setLink(a[s-2],a[s]);break;case 102:this.$=a[s-4],r.setLink(a[s-3],a[s-1],a[s]);break;case 103:this.$=a[s-4],r.setLink(a[s-3],a[s-1]),r.setTooltip(a[s-3],a[s]);break;case 104:this.$=a[s-5],r.setLink(a[s-4],a[s-2],a[s]),r.setTooltip(a[s-4],a[s-1]);break;case 105:this.$=a[s-2],r.setCssStyle(a[s-1],a[s]);break;case 106:r.setCssClass(a[s-1],a[s]);break;case 107:this.$=[a[s]];break;case 108:a[s-2].push(a[s]),this.$=a[s-2];break;case 110:this.$=a[s-1]+a[s]}},`anonymous`),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:t,35:n,37:r,38:22,42:i,43:23,46:a,48:o,51:s,52:l,54:u,56:d,57:f,60:m,62:h,63:g,64:_,65:v,75:y,76:b,78:x,82:S,83:C,86:w,100:T,102:E,103:D},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},e(O,[2,5],{8:[1,48]}),{8:[1,49]},e(k,[2,19],{22:[1,50]}),e(k,[2,21]),e(k,[2,22]),e(k,[2,23]),e(k,[2,24]),e(k,[2,25]),e(k,[2,26]),e(k,[2,27]),e(k,[2,28]),e(k,[2,29]),e(k,[2,30]),{34:[1,51]},{36:[1,52]},e(k,[2,33]),e(k,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:A,69:j,70:M,71:N,72:P,73:F,74:I}),{39:[1,65]},e(L,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),e(k,[2,65]),e(k,[2,66]),{16:69,60:m,86:w,100:T,102:E},{16:39,17:40,19:70,60:m,86:w,100:T,102:E,103:D},{16:39,17:40,19:71,60:m,86:w,100:T,102:E,103:D},{16:39,17:40,19:72,60:m,86:w,100:T,102:E,103:D},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:m,86:w,100:T,102:E,103:D},{13:R,55:76},{58:78,60:[1,79]},e(k,[2,76]),e(k,[2,77]),e(k,[2,78]),e(k,[2,79]),e(ee,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:m,86:w,100:T,102:E,103:D}),e(ee,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:m,86:w,100:T,102:E,103:D},{16:39,17:40,19:87,60:m,86:w,100:T,102:E,103:D},e(z,[2,133]),e(z,[2,134]),e(z,[2,135]),e(z,[2,136]),e([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),e(O,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:t,35:n,37:r,42:i,46:a,48:o,51:s,52:l,54:u,56:d,57:f,60:m,62:h,63:g,64:_,65:v,75:y,76:b,78:x,82:S,83:C,86:w,100:T,102:E,103:D}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:t,35:n,37:r,38:22,42:i,43:23,46:a,48:o,51:s,52:l,54:u,56:d,57:f,60:m,62:h,63:g,64:_,65:v,75:y,76:b,78:x,82:S,83:C,86:w,100:T,102:E,103:D},e(k,[2,20]),e(k,[2,31]),e(k,[2,32]),{13:[1,91],16:39,17:40,19:90,60:m,86:w,100:T,102:E,103:D},{53:92,66:56,67:57,68:A,69:j,70:M,71:N,72:P,73:F,74:I},e(k,[2,64]),{67:93,73:F,74:I},e(B,[2,83],{66:94,68:A,69:j,70:M,71:N,72:P}),e(te,[2,84]),e(te,[2,85]),e(te,[2,86]),e(te,[2,87]),e(te,[2,88]),e(ne,[2,89]),e(ne,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:i,43:23,48:o,54:u,56:d},{16:100,60:m,86:w,100:T,102:E},{41:[1,102],45:101,51:re},{16:104,60:m,86:w,100:T,102:E},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:ie,50:ae,59:110,60:oe,82:se,84:111,85:112,86:ce,87:le,88:ue,89:de,90:fe},{60:[1,122]},{13:R,55:123},e(L,[2,72]),e(L,[2,138]),{22:ie,50:ae,59:124,60:oe,61:[1,125],82:se,84:111,85:112,86:ce,87:le,88:ue,89:de,90:fe},e(pe,[2,74]),{16:39,17:40,19:126,60:m,86:w,100:T,102:E,103:D},e(ee,[2,16]),e(ee,[2,17]),e(ee,[2,18]),{11:127,12:me,39:[2,36]},e(he,[2,9],{16:85,17:86,15:130,18:[1,129],60:m,86:w,100:T,102:E,103:D}),e(he,[2,10]),e(ge,[2,55],{11:131,12:me}),e(O,[2,7]),{9:[1,132]},e(_e,[2,67]),{16:39,17:40,19:133,60:m,86:w,100:T,102:E,103:D},{13:[1,135],16:39,17:40,19:134,60:m,86:w,100:T,102:E,103:D},e(B,[2,82],{66:136,68:A,69:j,70:M,71:N,72:P}),e(B,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:i,43:23,48:o,54:u,56:d},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},e(L,[2,48],{39:[1,142]}),{41:[1,143]},e(L,[2,50]),{41:[2,61],45:144,51:re},{47:[1,145]},{16:39,17:40,19:146,60:m,86:w,100:T,102:E,103:D},e(k,[2,91],{13:[1,147]}),e(k,[2,93],{13:[1,149],77:[1,148]}),e(k,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},e(k,[2,105],{61:ve}),e(ye,[2,107],{85:154,22:ie,50:ae,60:oe,82:se,86:ce,87:le,88:ue,89:de,90:fe}),e(be,[2,109]),e(be,[2,111]),e(be,[2,112]),e(be,[2,113]),e(be,[2,114]),e(be,[2,115]),e(be,[2,116]),e(be,[2,117]),e(be,[2,118]),e(be,[2,119]),e(k,[2,106]),e(L,[2,71]),e(k,[2,73],{61:ve}),{60:[1,155]},e(ee,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:m,86:w,100:T,102:E,103:D},e(he,[2,12]),e(ge,[2,56]),{1:[2,4]},e(_e,[2,69]),e(_e,[2,68]),{16:39,17:40,19:158,60:m,86:w,100:T,102:E,103:D},e(B,[2,80]),e(L,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:i,43:23,48:o,54:u,56:d},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:i,43:23,48:o,54:u,56:d},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:i,43:23,48:o,54:u,56:d},{45:163,51:re},e(L,[2,49]),{41:[2,62]},e(L,[2,52],{39:[1,164]}),e(k,[2,60]),e(k,[2,92]),e(k,[2,94]),e(k,[2,95],{77:[1,165]}),e(k,[2,98]),e(k,[2,99],{13:[1,166]}),e(k,[2,101],{13:[1,168],77:[1,167]}),{22:ie,50:ae,60:oe,82:se,84:169,85:112,86:ce,87:le,88:ue,89:de,90:fe},e(be,[2,110]),e(pe,[2,75]),{14:[1,170]},e(he,[2,11]),e(_e,[2,70]),e(L,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:re},e(k,[2,96]),e(k,[2,100]),e(k,[2,102]),e(k,[2,103],{77:[1,174]}),e(ye,[2,108],{85:154,22:ie,50:ae,60:oe,82:se,86:ce,87:le,88:ue,89:de,90:fe}),e(ge,[2,8]),e(L,[2,51]),{41:[1,175]},e(L,[2,54]),e(k,[2,104]),e(L,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:p(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:p(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,l=0,u=0,d=0,f=2,m=1,h=a.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(_.yy[v]=this.yy[v]);g.setInput(e,_.yy),_.yy.lexer=g,_.yy.parser=this,g.yylloc===void 0&&(g.yylloc={});var y=g.yylloc;a.push(y);var b=g.options&&g.options.ranges;this.parseError=typeof _.yy.parseError==`function`?_.yy.parseError:Object.getPrototypeOf(this).parseError;function x(e){n.length-=2*e,i.length-=e,a.length-=e}p(x,`popStack`);function S(){var e=r.pop()||g.lex()||m;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}p(S,`lex`);for(var C,w,T,E,D,O={},k,A,j,M;;){if(T=n[n.length-1],this.defaultActions[T]?E=this.defaultActions[T]:(C??=S(),E=o[T]&&o[T][C]),E===void 0||!E.length||!E[0]){var N=``;for(k in M=[],o[T])this.terminals_[k]&&k>f&&M.push(`'`+this.terminals_[k]+`'`);N=g.showPosition?`Parse error on line `+(l+1)+`:2061+`+g.showPosition()+`2062+Expecting `+M.join(`, `)+`, got '`+(this.terminals_[C]||C)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(C==m?`end of input`:`'`+(this.terminals_[C]||C)+`'`),this.parseError(N,{text:g.match,token:this.terminals_[C]||C,line:g.yylineno,loc:y,expected:M})}if(E[0]instanceof Array&&E.length>1)throw Error(`Parse Error: multiple actions possible at state: `+T+`, token: `+C);switch(E[0]){case 1:n.push(C),i.push(g.yytext),a.push(g.yylloc),n.push(E[1]),C=null,w?(C=w,w=null):(u=g.yyleng,s=g.yytext,l=g.yylineno,y=g.yylloc,d>0&&d--);break;case 2:if(A=this.productions_[E[1]][1],O.$=i[i.length-A],O._$={first_line:a[a.length-(A||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(A||1)].first_column,last_column:a[a.length-1].last_column},b&&(O._$.range=[a[a.length-(A||1)].range[0],a[a.length-1].range[1]]),D=this.performAction.apply(O,[s,u,l,_.yy,E[1],i,a].concat(h)),D!==void 0)return D;A&&(n=n.slice(0,-1*A*2),i=i.slice(0,-1*A),a=a.slice(0,-1*A)),n.push(this.productions_[E[1]][0]),i.push(O.$),a.push(O._$),j=o[n[n.length-2]][n[n.length-1]],n.push(j);break;case 3:return!0}}return!0},`parse`)};xe.lexer=(function(){return{EOF:1,parseError:p(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:p(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:p(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:p(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:p(function(){return this._more=!0,this},`more`),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).2063+`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:p(function(e){this.unput(this.match.slice(e))},`less`),pastInput:p(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:p(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:p(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`2064+`+t+`^`},`showPosition`),test_match:p(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.2065+`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:p(function(){return this.next()||this.lex()},`lex`),begin:p(function(e){this.conditionStack.push(e)},`begin`),popState:p(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:p(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:p(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:p(function(e){this.begin(e)},`pushState`),stateStackSize:p(function(){return this.conditionStack.length},`stateStackSize`),options:{},performAction:p(function(e,t,n,r){switch(n){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin(`acc_title`),33;case 7:return this.popState(),`acc_title_value`;case 8:return this.begin(`acc_descr`),35;case 9:return this.popState(),`acc_descr_value`;case 10:this.begin(`acc_descr_multiline`);break;case 11:this.popState();break;case 12:return`acc_descr_multiline_value`;case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return`EDGE_STATE`;case 18:this.begin(`callback_name`);break;case 19:this.popState();break;case 20:this.popState(),this.begin(`callback_args`);break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return`STR`;case 26:this.begin(`string`);break;case 27:return 82;case 28:return 57;case 29:return this.begin(`namespace`),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin(`namespace-body`),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return`EOF_IN_STRUCT`;case 36:return 8;case 37:break;case 38:return`EDGE_STATE`;case 39:return this.begin(`class`),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin(`class-body`),39;case 44:return this.popState(),41;case 45:return`EOF_IN_STRUCT`;case 46:return`EDGE_STATE`;case 47:return`OPEN_IN_STRUCT`;case 48:break;case 49:return`MEMBER`;case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return`GENERICTYPE`;case 61:this.begin(`generic`);break;case 62:this.popState();break;case 63:return`BQUOTE_STR`;case 64:this.begin(`bqstring`);break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return`PLUS`;case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return`EQUALS`;case 89:return`EQUALS`;case 90:return 60;case 91:return 12;case 92:return 14;case 93:return`PUNCTUATION`;case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},`anonymous`),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}}})();function Se(){this.yy={}}return p(Se,`Parser`),Se.prototype=xe,xe.Parser=Se,new Se})(),k3.parser=k3,A3=k3,j3=[`#`,`+`,`~`,`-`,``],M3=class{static{p(this,`ClassMember`)}constructor(e,t){this.memberType=t,this.visibility=``,this.classifier=``,this.text=``;let n=js(e,Z());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+Ps(this.id);this.memberType===`method`&&(e+=`(${Ps(this.parameters.trim())})`,this.returnType&&(e+=` : `+Ps(this.returnType))),e=e.trim();let t=this.parseClassifier();return{displayText:e,cssStyle:t}}parseMember(e){let t=``;if(this.memberType===`method`){let n=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(n){let e=n[1]?n[1].trim():``;if(j3.includes(e)&&(this.visibility=e),this.id=n[2],this.parameters=n[3]?n[3].trim():``,t=n[4]?n[4].trim():``,this.returnType=n[5]?n[5].trim():``,t===``){let e=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(e)&&(t=e,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{let n=e.length,r=e.substring(0,1),i=e.substring(n-1);j3.includes(r)&&(this.visibility=r),/[$*]/.exec(i)&&(t=i),this.id=e.substring(this.visibility===``?0:1,t===``?n:n-1)}this.classifier=t,this.id=this.id.startsWith(` `)?` `+this.id.trim():this.id.trim();let n=`${this.visibility?`\\`+this.visibility:``}${Ps(this.id)}${this.memberType===`method`?`(${Ps(this.parameters)})${this.returnType?` : `+Ps(this.returnType):``}`:``}`;this.text=n.replaceAll(`<`,`<`).replaceAll(`>`,`>`),this.text.startsWith(`\\<`)&&(this.text=this.text.replace(`\\<`,`~`))}parseClassifier(){switch(this.classifier){case`*`:return`font-style:italic;`;case`$`:return`text-decoration:underline;`;default:return``}}},N3=`classId-`,P3=0,F3=p(e=>Vs.sanitizeText(e,Z()),`sanitizeText`),I3=class e{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId=``,this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=p(e=>{let t=nL();$c(e).select(`svg`).selectAll(`g`).filter(function(){return $c(this).attr(`title`)!==null}).on(`mouseover`,e=>{let n=$c(e.currentTarget),r=n.attr(`title`);if(!r)return;let i=e.currentTarget.getBoundingClientRect();t.transition().duration(200).style(`opacity`,`.9`),t.html(Kt.sanitize(r)).style(`left`,`${window.scrollX+i.left+i.width/2}px`).style(`top`,`${window.scrollY+i.bottom+4}px`),n.classed(`hover`,!0)}).on(`mouseout`,e=>{t.transition().duration(500).style(`opacity`,0),$c(e.currentTarget).classed(`hover`,!1)})},`setupToolTips`),this.direction=`TB`,this.setAccTitle=Zs,this.getAccTitle=Qs,this.setAccDescription=$s,this.getAccDescription=ec,this.setDiagramTitle=tc,this.getDiagramTitle=nc,this.getConfig=p(()=>Z().class,`getConfig`),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}static{p(this,`ClassDB`)}splitClassNameAndType(e){let t=Vs.sanitizeText(e,Z()),n=``,r=t;if(t.indexOf(`~`)>0){let e=t.split(`~`);r=F3(e[0]),n=F3(e[1])}return{className:r,type:n}}setClassLabel(e,t){let n=Vs.sanitizeText(e,Z());t&&=F3(t);let{className:r}=this.splitClassNameAndType(n);this.classes.get(r).label=t,this.classes.get(r).text=`${t}${this.classes.get(r).type?`<${this.classes.get(r).type}>`:``}`}addClass(e){let t=Vs.sanitizeText(e,Z()),{className:n,type:r}=this.splitClassNameAndType(t);if(this.classes.has(n))return;let i=Vs.sanitizeText(n,Z());this.classes.set(i,{id:i,type:r,label:i,text:`${i}${r?`<${r}>`:``}`,shape:`classBox`,cssClasses:`default`,methods:[],members:[],annotations:[],styles:[],domId:N3+i+`-`+P3}),P3++}addInterface(e,t){let n={id:`interface${this.interfaces.length}`,label:e,classId:t};this.interfaces.push(n)}setDiagramId(e){this.diagramId=e}lookUpDomId(e){let t=Vs.sanitizeText(e,Z());if(this.classes.has(t)){let e=this.classes.get(t).domId;return this.diagramId?`${this.diagramId}-${e}`:e}throw Error(`Class not found: `+t)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId=``,this.direction=`TB`,Xs()}getClass(e){return this.classes.get(e)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(e){let t=typeof e==`number`?`note${e}`:e;return this.notes.get(t)}getNotes(){return this.notes}addRelation(e){y.debug(`Adding relation: `+JSON.stringify(e));let t=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];e.relation.type1===this.relationType.LOLLIPOP&&!t.includes(e.relation.type2)?(this.addClass(e.id2),this.addInterface(e.id1,e.id2),e.id1=`interface${this.interfaces.length-1}`):e.relation.type2===this.relationType.LOLLIPOP&&!t.includes(e.relation.type1)?(this.addClass(e.id1),this.addInterface(e.id2,e.id1),e.id2=`interface${this.interfaces.length-1}`):(this.addClass(e.id1),this.addClass(e.id2)),e.id1=this.splitClassNameAndType(e.id1).className,e.id2=this.splitClassNameAndType(e.id2).className,e.relationTitle1=Vs.sanitizeText(e.relationTitle1.trim(),Z()),e.relationTitle2=Vs.sanitizeText(e.relationTitle2.trim(),Z()),this.relations.push(e)}addAnnotation(e,t){let n=this.splitClassNameAndType(e).className;this.classes.get(n).annotations.push(t)}addMember(e,t){this.addClass(e);let n=this.splitClassNameAndType(e).className,r=this.classes.get(n);if(typeof t==`string`){let e=t.trim();e.startsWith(`<<`)&&e.endsWith(`>>`)?r.annotations.push(F3(e.substring(2,e.length-2))):e.indexOf(`)`)>0?r.methods.push(new M3(e,`method`)):e&&r.members.push(new M3(e,`attribute`))}}addMembers(e,t){Array.isArray(t)&&(t.reverse(),t.forEach(t=>this.addMember(e,t)))}addNote(e,t){let n=this.notes.size,r={id:`note${n}`,class:t,text:e,index:n};return this.notes.set(r.id,r),r.id}cleanupLabel(e){return e.startsWith(`:`)&&(e=e.substring(1)),F3(e.trim())}setCssClass(e,t){e.split(`,`).forEach(e=>{let n=e;/\d/.exec(e[0])&&(n=N3+n),n=this.splitClassNameAndType(n).className;let r=this.classes.get(n);r&&(r.cssClasses+=` `+t)})}defineClass(e,t){for(let n of e){let e=this.styleClasses.get(n);e===void 0&&(e={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,e)),t&&t.forEach(t=>{if(/color/.exec(t)){let n=t.replace(`fill`,`bgFill`);e.textStyles.push(n)}e.styles.push(t)}),this.classes.forEach(e=>{e.cssClasses.includes(n)&&e.styles.push(...t.flatMap(e=>e.split(`,`)))})}}setTooltip(e,t){e.split(`,`).forEach(e=>{if(t!==void 0){let n=this.splitClassNameAndType(e).className,r=this.classes.get(n);r&&(r.tooltip=F3(t))}})}getTooltip(e,t){return t&&this.namespaces.has(t)?this.namespaces.get(t).classes.get(e).tooltip:this.classes.get(e).tooltip}setLink(e,t,n){let r=Z();e.split(`,`).forEach(e=>{let i=e;/\d/.exec(e[0])&&(i=N3+i),i=this.splitClassNameAndType(i).className;let a=this.classes.get(i);a&&(a.link=eh.formatUrl(t,r),a.linkTarget=r.securityLevel===`sandbox`?`_top`:typeof n==`string`?F3(n):`_blank`)}),this.setCssClass(e,`clickable`)}setClickEvent(e,t,n){e.split(`,`).forEach(e=>{this.setClickFunc(e,t,n);let r=this.splitClassNameAndType(e).className,i=this.classes.get(r);i&&(i.haveCallback=!0)}),this.setCssClass(e,`clickable`)}setClickFunc(e,t,n){let r=Vs.sanitizeText(e,Z());if(Z().securityLevel!==`loose`||t===void 0)return;let i=this.splitClassNameAndType(r).className;if(this.classes.has(i)){let e=[];if(typeof n==`string`){e=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t<e.length;t++){let n=e[t].trim();n.startsWith(`"`)&&n.endsWith(`"`)&&(n=n.substr(1,n.length-2)),e[t]=n}}e.length===0&&e.push(i),this.functions.push(()=>{let n=this.lookUpDomId(i),r=document.querySelector(`[id="${n}"]`);r!==null&&r.addEventListener(`click`,()=>{eh.runFunc(t,...e)},!1)})}}bindFunctions(e){this.functions.forEach(t=>{t(e)})}escapeHtml(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}getDirection(){return this.direction}setDirection(e){this.direction=e}static resolveQualifiedId(e,t){let n=t.at(-1);return n?`${n}.${e}`:e}static getAncestorIds(e){let t=e.split(`.`),n=Array(t.length);n[0]=t[0];for(let e=1;e<t.length;e++)n[e]=`${n[e-1]}.${t[e]}`;return n}createNamespaceNode(e,t,n,r=!1){return{id:e,label:t,classes:new Map,notes:new Map,children:new Map,domId:N3+e+`-`+this.namespaceCounter++,parent:n,explicit:r}}linkParentChild(e,t){let n=this.namespaces.get(e),r=this.namespaces.get(t);!n||!r||(n.children.has(t)||n.children.set(t,r),r.parent??=e)}addNamespace(t,n){let r=e.resolveQualifiedId(t,this.namespaceStack);if(this.namespaceStack.push(r),this.namespaces.has(r)){let e=this.namespaces.get(r);return e.explicit=!0,n&&(e.label=n),r}let i=r.split(`.`),a=e.getAncestorIds(r);for(let e=0;e<a.length;e++){let t=a[e],r=e>0?a[e-1]:void 0,o=e===a.length-1,s=o&&n?n:i[e];this.namespaces.has(t)?o&&(this.namespaces.get(t).explicit=!0):this.namespaces.set(t,this.createNamespaceNode(t,s,r,o)),r&&this.linkParentChild(r,t)}return r}popNamespace(){this.namespaceStack.pop()}getNamespace(e){return this.namespaces.get(e)}getNamespaces(){return this.namespaces}addClassesToNamespace(e,t,n){if(this.namespaces.has(e)){for(let n of t){let{className:t}=this.splitClassNameAndType(n),r=this.getClass(t);r.parent=e,this.namespaces.get(e).classes.set(t,r)}for(let t of n){let n=this.getNote(t);n.parent=e,this.namespaces.get(e).notes.set(t,n)}}}setCssStyle(e,t){let n=this.classes.get(e);if(!(!t||!n))for(let e of t)e.includes(`,`)?n.styles.push(...e.split(`,`)):n.styles.push(e)}getArrowMarker(e){let t;switch(e){case 0:t=`aggregation`;break;case 1:t=`extension`;break;case 2:t=`composition`;break;case 3:t=`dependency`;break;case 4:t=`lollipop`;break;default:t=`none`}return t}resolveExplicitAncestor(e){let t=e;for(;t;){let e=this.namespaces.get(t);if(!e)return;if(e.explicit)return t;t=e.parent}}getData(){let e=[],t=[],n=Z(),r=n.class?.hierarchicalNamespaces??!0;for(let t of this.namespaces.values()){if(!r&&!t.explicit)continue;let i={id:t.id,label:r?t.label:t.id,isGroup:!0,padding:n.class.padding??16,shape:`rect`,cssStyles:[],look:n.look,parentId:r?t.parent:void 0};e.push(i)}for(let t of this.classes.values()){let i=r?t.parent:this.resolveExplicitAncestor(t.parent),a={...t,type:void 0,isGroup:!1,parentId:i,look:n.look};e.push(a)}for(let i of this.notes.values()){let a=r?i.parent:this.resolveExplicitAncestor(i.parent),o={id:i.id,label:i.text,isGroup:!1,shape:`note`,padding:n.class.padding??6,cssStyles:[`text-align: left`,`white-space: nowrap`,`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look,parentId:a,labelType:`markdown`};e.push(o);let s=this.classes.get(i.class)?.id;if(s){let e={id:`edgeNote${i.index}`,start:i.id,end:s,type:`normal`,thickness:`normal`,classes:`relation`,arrowTypeStart:`none`,arrowTypeEnd:`none`,arrowheadStyle:``,labelStyle:[``],style:[`fill: none`],pattern:`dotted`,look:n.look};t.push(e)}}for(let t of this.interfaces){let r={id:t.id,label:t.label,isGroup:!1,shape:`rect`,cssStyles:[`opacity: 0;`],look:n.look};e.push(r)}let i=0;for(let e of this.relations){i++;let r={id:nh(e.id1,e.id2,{prefix:`id`,counter:i}),start:e.id1,end:e.id2,type:`normal`,label:e.title,labelpos:`c`,thickness:`normal`,classes:`relation`,arrowTypeStart:this.getArrowMarker(e.relation.type1),arrowTypeEnd:this.getArrowMarker(e.relation.type2),startLabelRight:e.relationTitle1===`none`?``:e.relationTitle1,endLabelLeft:e.relationTitle2===`none`?``:e.relationTitle2,arrowheadStyle:``,labelStyle:[`display: inline-block`],style:e.style||``,pattern:e.relation.lineType==1?`dashed`:`solid`,look:n.look,labelType:`markdown`};t.push(r)}return{nodes:e,edges:t,other:{},config:n,direction:this.getDirection()}}},L3=p(e=>`g.classGroup text {2066+ fill: ${e.nodeBorder||e.classText};2067+ stroke: none;2068+ font-family: ${e.fontFamily};2069+ font-size: 10px;2070+2071+ .title {2072+ font-weight: bolder;2073+ }2074+2075+}2076+2077+ .cluster-label text {2078+ fill: ${e.titleColor};2079+ }2080+ .cluster-label span {2081+ color: ${e.titleColor};2082+ }2083+ .cluster-label span p {2084+ background-color: transparent;2085+ }2086+2087+ .cluster rect {2088+ fill: ${e.clusterBkg};2089+ stroke: ${e.clusterBorder};2090+ stroke-width: 1px;2091+ }2092+2093+ .cluster text {2094+ fill: ${e.titleColor};2095+ }2096+2097+ .cluster span {2098+ color: ${e.titleColor};2099+ }2100+2101+.nodeLabel, .edgeLabel {2102+ color: ${e.classText};2103+}2104+2105+.noteLabel .nodeLabel, .noteLabel .edgeLabel {2106+ color: ${e.noteTextColor};2107+}2108+.edgeLabel .label rect {2109+ fill: ${e.mainBkg};2110+}2111+.label text {2112+ fill: ${e.classText};2113+}2114+2115+.labelBkg {2116+ background: ${e.mainBkg};2117+}2118+.edgeLabel .label span {2119+ background: ${e.mainBkg};2120+}2121+2122+.classTitle {2123+ font-weight: bolder;2124+}2125+.node rect,2126+ .node circle,2127+ .node ellipse,2128+ .node polygon,2129+ .node path {2130+ fill: ${e.mainBkg};2131+ stroke: ${e.nodeBorder};2132+ stroke-width: ${e.strokeWidth};2133+ }2134+2135+2136+.divider {2137+ stroke: ${e.nodeBorder};2138+ stroke-width: 1;2139+}2140+2141+g.clickable {2142+ cursor: pointer;2143+}2144+2145+g.classGroup rect {2146+ fill: ${e.mainBkg};2147+ stroke: ${e.nodeBorder};2148+}2149+2150+g.classGroup line {2151+ stroke: ${e.nodeBorder};2152+ stroke-width: 1;2153+}2154+2155+.classLabel .box {2156+ stroke: none;2157+ stroke-width: 0;2158+ fill: ${e.mainBkg};2159+ opacity: 0.5;2160+}2161+2162+.classLabel .label {2163+ fill: ${e.nodeBorder};2164+ font-size: 10px;2165+}2166+2167+.relation {2168+ stroke: ${e.lineColor};2169+ stroke-width: ${e.strokeWidth};2170+ fill: none;2171+}2172+2173+.dashed-line{2174+ stroke-dasharray: 3;2175+}2176+2177+.dotted-line{2178+ stroke-dasharray: 1 2;2179+}2180+2181+[id$="-compositionStart"], .composition {2182+ fill: ${e.lineColor} !important;2183+ stroke: ${e.lineColor} !important;2184+ stroke-width: 1;2185+}2186+2187+[id$="-compositionEnd"], .composition {2188+ fill: ${e.lineColor} !important;2189+ stroke: ${e.lineColor} !important;2190+ stroke-width: 1;2191+}2192+2193+[id$="-dependencyStart"], .dependency {2194+ fill: ${e.lineColor} !important;2195+ stroke: ${e.lineColor} !important;2196+ stroke-width: 1;2197+}2198+2199+[id$="-dependencyEnd"], .dependency {2200+ fill: ${e.lineColor} !important;2201+ stroke: ${e.lineColor} !important;2202+ stroke-width: 1;2203+}2204+2205+[id$="-extensionStart"], .extension {2206+ fill: transparent !important;2207+ stroke: ${e.lineColor} !important;2208+ stroke-width: 1;2209+}2210+2211+[id$="-extensionEnd"], .extension {2212+ fill: transparent !important;2213+ stroke: ${e.lineColor} !important;2214+ stroke-width: 1;2215+}2216+2217+[id$="-aggregationStart"], .aggregation {2218+ fill: transparent !important;2219+ stroke: ${e.lineColor} !important;2220+ stroke-width: 1;2221+}2222+2223+[id$="-aggregationEnd"], .aggregation {2224+ fill: transparent !important;2225+ stroke: ${e.lineColor} !important;2226+ stroke-width: 1;2227+}2228+2229+[id$="-lollipopStart"], .lollipop {2230+ fill: ${e.mainBkg} !important;2231+ stroke: ${e.lineColor} !important;2232+ stroke-width: 1;2233+}2234+2235+[id$="-lollipopEnd"], .lollipop {2236+ fill: ${e.mainBkg} !important;2237+ stroke: ${e.lineColor} !important;2238+ stroke-width: 1;2239+}2240+2241+.edgeTerminals {2242+ font-size: 11px;2243+ line-height: initial;2244+}2245+2246+.classTitleText {2247+ text-anchor: middle;2248+ font-size: 18px;2249+ fill: ${e.textColor};2250+}2251+2252+.edgeLabel[data-look="neo"] {2253+ background-color: ${e.edgeLabelBackground};2254+ p {2255+ background-color: ${e.edgeLabelBackground};2256+ }2257+ rect {2258+ opacity: 0.5;2259+ background-color: ${e.edgeLabelBackground};2260+ fill: ${e.edgeLabelBackground};2261+ }2262+ text-align: center;2263+}2264+ ${UL()}2265+`,`getStyles`),R3={getClasses:p(function(e,t){return t.db.getClasses()},`getClasses`),draw:p(async function(e,t,n,r){y.info(`REF0:`),y.info(`Drawing class diagram (v3)`,t);let{securityLevel:i,state:a,layout:o}=Z();r.db.setDiagramId(t);let s=r.db.getData(),l=GL(t,i);s.type=r.type,s.layoutAlgorithm=TI(o),s.nodeSpacing=a?.nodeSpacing||50,s.rankSpacing=a?.rankSpacing||50,s.markers=[`aggregation`,`extension`,`composition`,`dependency`,`lollipop`],s.diagramId=t,await wI(s,l),eh.insertTitle(l,`classDiagramTitleText`,a?.titleTopMargin??25,r.db.getDiagramTitle()),qL(l,8,`classDiagram`,a?.useMaxWidth??!0)},`draw`),getDir:p((e,t=`TB`)=>{if(!e.doc)return t;let n=t;for(let t of e.doc)t.stmt===`dir`&&(n=t.value);return n},`getDir`)}})),yst=l({diagram:()=>bst}),bst,xst=o((()=>{vst(),KL(),JL(),EI(),rL(),U_(),cv(),z_(),P_(),Op(),ig(),Gp(),rh(),dc(),S(),h(),bst={parser:A3,get db(){return new I3},renderer:R3,styles:L3,init:p(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)}})),Sst=l({diagram:()=>Cst}),Cst,wst=o((()=>{vst(),KL(),JL(),EI(),rL(),U_(),cv(),z_(),P_(),Op(),ig(),Gp(),rh(),dc(),S(),h(),Cst={parser:A3,get db(){return new I3},renderer:R3,styles:L3,init:p(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)}}));function z3(e=``,t=0,n=``,r=l6){return`${Vst}-${e}${n!==null&&n.length>0?`${r}${n}`:``}-${t}`}function B3(e,t,n){if(!t.id||t.id===`</join></fork>`||t.id===`</choice>`)return;t.cssClasses&&(Array.isArray(t.cssCompiledStyles)||(t.cssCompiledStyles=[]),t.cssClasses.split(` `).forEach(e=>{let r=n.get(e);r&&(t.cssCompiledStyles=[...t.cssCompiledStyles??[],...r.styles])}));let r=e.find(e=>e.id===t.id);r?Object.assign(r,t):e.push(t)}function Tst(e){return e?.classes?.join(` `)??``}function Est(e){return e?.styles??[]}var V3,H3,Dst,U3,W3,G3,K3,q3,Ost,kst,Ast,J3,Y3,X3,Z3,Q3,$3,e6,t6,n6,jst,Mst,r6,i6,Nst,Pst,a6,Fst,o6,Ist,Lst,Rst,zst,Bst,s6,c6,Vst,l6,Hst,u6,d6,Ust,f6,p6,Wst,m6,h6,Gst,g6,_6,v6,y6,b6,x6,Kst=o((()=>{KL(),JL(),EI(),rL(),rh(),dc(),S(),h(),_p(),qt(),V3=(function(){var e=p(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,2],n=[1,3],r=[1,4],i=[2,4],a=[1,9],o=[1,11],s=[1,16],l=[1,17],u=[1,18],d=[1,19],f=[1,33],m=[1,20],h=[1,21],g=[1,22],_=[1,23],v=[1,24],y=[1,26],b=[1,27],x=[1,28],S=[1,29],C=[1,30],w=[1,31],T=[1,32],E=[1,35],D=[1,36],O=[1,37],k=[1,38],A=[1,34],j=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],M=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],N=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],P={trace:p(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NL`,6:`SD`,14:`DESCR`,15:`-->`,16:`HIDE_EMPTY`,17:`scale`,18:`WIDTH`,19:`COMPOSIT_STATE`,20:`STRUCT_START`,21:`STRUCT_STOP`,22:`STATE_DESCR`,23:`AS`,24:`ID`,25:`FORK`,26:`JOIN`,27:`CHOICE`,28:`CONCURRENT`,29:`note`,31:`NOTE_TEXT`,33:`acc_title`,34:`acc_title_value`,35:`acc_descr`,36:`acc_descr_value`,37:`acc_descr_multiline_value`,38:`CLICK`,39:`STRING`,40:`HREF`,41:`classDef`,42:`CLASSDEF_ID`,43:`CLASSDEF_STYLEOPTS`,44:`DEFAULT`,45:`style`,46:`STYLE_IDS`,47:`STYLEDEF_STYLEOPTS`,48:`class`,49:`CLASSENTITY_IDS`,50:`STYLECLASS`,51:`direction_tb`,52:`direction_bt`,53:`direction_rl`,54:`direction_lr`,56:`;`,57:`EDGE_STATE`,58:`STYLE_SEPARATOR`,59:`left_of`,60:`right_of`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:p(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.setRootDoc(a[s]),a[s];case 4:this.$=[];break;case 5:a[s]!=`nl`&&(a[s-1].push(a[s]),this.$=a[s-1]);break;case 6:case 7:this.$=a[s];break;case 8:this.$=`nl`;break;case 12:this.$=a[s];break;case 13:let e=a[s-1];e.description=r.trimColon(a[s]),this.$=e;break;case 14:this.$={stmt:`relation`,state1:a[s-2],state2:a[s]};break;case 15:let t=r.trimColon(a[s]);this.$={stmt:`relation`,state1:a[s-3],state2:a[s-1],description:t};break;case 19:this.$={stmt:`state`,id:a[s-3],type:`default`,description:``,doc:a[s-1]};break;case 20:var l=a[s],u=a[s-2].trim();if(a[s].match(`:`)){var d=a[s].split(`:`);l=d[0],u=[u,d[1]]}this.$={stmt:`state`,id:l,type:`default`,description:u};break;case 21:this.$={stmt:`state`,id:a[s-3],type:`default`,description:a[s-5],doc:a[s-1]};break;case 22:this.$={stmt:`state`,id:a[s],type:`fork`};break;case 23:this.$={stmt:`state`,id:a[s],type:`join`};break;case 24:this.$={stmt:`state`,id:a[s],type:`choice`};break;case 25:this.$={stmt:`state`,id:r.getDividerId(),type:`divider`};break;case 26:this.$={stmt:`state`,id:a[s-1].trim(),note:{position:a[s-2].trim(),text:a[s].trim()}};break;case 29:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 30:case 31:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 32:this.$={stmt:`click`,id:a[s-3],url:a[s-2],tooltip:a[s-1]};break;case 33:this.$={stmt:`click`,id:a[s-3],url:a[s-1],tooltip:``};break;case 34:case 35:this.$={stmt:`classDef`,id:a[s-1].trim(),classes:a[s].trim()};break;case 36:this.$={stmt:`style`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 37:this.$={stmt:`applyClass`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:r.setDirection(`TB`),this.$={stmt:`dir`,value:`TB`};break;case 39:r.setDirection(`BT`),this.$={stmt:`dir`,value:`BT`};break;case 40:r.setDirection(`RL`),this.$={stmt:`dir`,value:`RL`};break;case 41:r.setDirection(`LR`),this.$={stmt:`dir`,value:`LR`};break;case 44:case 45:this.$={stmt:`state`,id:a[s].trim(),type:`default`,description:``};break;case 46:this.$={stmt:`state`,id:a[s-2].trim(),classes:[a[s].trim()],type:`default`,description:``};break;case 47:this.$={stmt:`state`,id:a[s-2].trim(),classes:[a[s].trim()],type:`default`,description:``}}},`anonymous`),table:[{3:1,4:t,5:n,6:r},{1:[3]},{3:5,4:t,5:n,6:r},{3:6,4:t,5:n,6:r},e([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:s,17:l,19:u,22:d,24:f,25:m,26:h,27:g,28:_,29:v,32:25,33:y,35:b,37:x,38:S,41:C,45:w,48:T,51:E,52:D,53:O,54:k,57:A},e(j,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:s,17:l,19:u,22:d,24:f,25:m,26:h,27:g,28:_,29:v,32:25,33:y,35:b,37:x,38:S,41:C,45:w,48:T,51:E,52:D,53:O,54:k,57:A},e(j,[2,7]),e(j,[2,8]),e(j,[2,9]),e(j,[2,10]),e(j,[2,11]),e(j,[2,12],{14:[1,40],15:[1,41]}),e(j,[2,16]),{18:[1,42]},e(j,[2,18],{20:[1,43]}),{23:[1,44]},e(j,[2,22]),e(j,[2,23]),e(j,[2,24]),e(j,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},e(j,[2,28]),{34:[1,49]},{36:[1,50]},e(j,[2,31]),{13:51,24:f,57:A},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},e(M,[2,44],{58:[1,56]}),e(M,[2,45],{58:[1,57]}),e(j,[2,38]),e(j,[2,39]),e(j,[2,40]),e(j,[2,41]),e(j,[2,6]),e(j,[2,13]),{13:58,24:f,57:A},e(j,[2,17]),e(N,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},e(j,[2,29]),e(j,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},e(j,[2,14],{14:[1,71]}),{4:a,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:s,17:l,19:u,21:[1,72],22:d,24:f,25:m,26:h,27:g,28:_,29:v,32:25,33:y,35:b,37:x,38:S,41:C,45:w,48:T,51:E,52:D,53:O,54:k,57:A},e(j,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},e(j,[2,34]),e(j,[2,35]),e(j,[2,36]),e(j,[2,37]),e(M,[2,46]),e(M,[2,47]),e(j,[2,15]),e(j,[2,19]),e(N,i,{7:78}),e(j,[2,26]),e(j,[2,27]),{5:[1,79]},{5:[1,80]},{4:a,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:s,17:l,19:u,21:[1,81],22:d,24:f,25:m,26:h,27:g,28:_,29:v,32:25,33:y,35:b,37:x,38:S,41:C,45:w,48:T,51:E,52:D,53:O,54:k,57:A},e(j,[2,32]),e(j,[2,33]),e(j,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:p(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:p(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,l=0,u=0,d=0,f=2,m=1,h=a.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(_.yy[v]=this.yy[v]);g.setInput(e,_.yy),_.yy.lexer=g,_.yy.parser=this,g.yylloc===void 0&&(g.yylloc={});var y=g.yylloc;a.push(y);var b=g.options&&g.options.ranges;this.parseError=typeof _.yy.parseError==`function`?_.yy.parseError:Object.getPrototypeOf(this).parseError;function x(e){n.length-=2*e,i.length-=e,a.length-=e}p(x,`popStack`);function S(){var e=r.pop()||g.lex()||m;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}p(S,`lex`);for(var C,w,T,E,D,O={},k,A,j,M;;){if(T=n[n.length-1],this.defaultActions[T]?E=this.defaultActions[T]:(C??=S(),E=o[T]&&o[T][C]),E===void 0||!E.length||!E[0]){var N=``;for(k in M=[],o[T])this.terminals_[k]&&k>f&&M.push(`'`+this.terminals_[k]+`'`);N=g.showPosition?`Parse error on line `+(l+1)+`:2266+`+g.showPosition()+`2267+Expecting `+M.join(`, `)+`, got '`+(this.terminals_[C]||C)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(C==m?`end of input`:`'`+(this.terminals_[C]||C)+`'`),this.parseError(N,{text:g.match,token:this.terminals_[C]||C,line:g.yylineno,loc:y,expected:M})}if(E[0]instanceof Array&&E.length>1)throw Error(`Parse Error: multiple actions possible at state: `+T+`, token: `+C);switch(E[0]){case 1:n.push(C),i.push(g.yytext),a.push(g.yylloc),n.push(E[1]),C=null,w?(C=w,w=null):(u=g.yyleng,s=g.yytext,l=g.yylineno,y=g.yylloc,d>0&&d--);break;case 2:if(A=this.productions_[E[1]][1],O.$=i[i.length-A],O._$={first_line:a[a.length-(A||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(A||1)].first_column,last_column:a[a.length-1].last_column},b&&(O._$.range=[a[a.length-(A||1)].range[0],a[a.length-1].range[1]]),D=this.performAction.apply(O,[s,u,l,_.yy,E[1],i,a].concat(h)),D!==void 0)return D;A&&(n=n.slice(0,-1*A*2),i=i.slice(0,-1*A),a=a.slice(0,-1*A)),n.push(this.productions_[E[1]][0]),i.push(O.$),a.push(O._$),j=o[n[n.length-2]][n[n.length-1]],n.push(j);break;case 3:return!0}}return!0},`parse`)};P.lexer=(function(){return{EOF:1,parseError:p(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:p(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:p(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:p(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:p(function(){return this._more=!0,this},`more`),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).2268+`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:p(function(e){this.unput(this.match.slice(e))},`less`),pastInput:p(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:p(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:p(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`2269+`+t+`^`},`showPosition`),test_match:p(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.2270+`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:p(function(){return this.next()||this.lex()},`lex`),begin:p(function(e){this.conditionStack.push(e)},`begin`),popState:p(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:p(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:p(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:p(function(e){this.begin(e)},`pushState`),stateStackSize:p(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:p(function(e,t,n,r){function i(){let n=t.yytext.indexOf(`%%`);if(n===0)return!1;if(n>0){let r=t.yytext.slice(0,n),i=t.yytext.slice(n);i&&e.lexer.unput(i),t.yytext=r}return!0}switch(p(i,`processId`),n){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState(`SCALE`),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin(`acc_title`),33;case 17:return this.popState(),`acc_title_value`;case 18:return this.begin(`acc_descr`),35;case 19:return this.popState(),`acc_descr_value`;case 20:this.begin(`acc_descr_multiline`);break;case 21:this.popState();break;case 22:return`acc_descr_multiline_value`;case 23:return this.pushState(`CLASSDEF`),41;case 24:return this.popState(),this.pushState(`CLASSDEFID`),`DEFAULT_CLASSDEF_ID`;case 25:return this.popState(),this.pushState(`CLASSDEFID`),42;case 26:return this.popState(),43;case 27:return this.pushState(`CLASS`),48;case 28:return this.popState(),this.pushState(`CLASS_STYLE`),49;case 29:return this.popState(),50;case 30:return this.pushState(`STYLE`),45;case 31:return this.popState(),this.pushState(`STYLEDEF_STYLES`),46;case 32:return this.popState(),47;case 33:return this.pushState(`SCALE`),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState(`STATE`);break;case 37:return this.popState(),t.yytext=t.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),t.yytext=t.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),t.yytext=t.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),t.yytext=t.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),t.yytext=t.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),t.yytext=t.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState(`STATE_STRING`);break;case 48:return this.pushState(`STATE_ID`),`AS`;case 49:return i()?(this.popState(),`ID`):void 0;case 50:this.popState();break;case 51:return`STATE_DESCR`;case 52:throw Error(`Error: State name must be a single word. Found: "`+t.yytext.trim()+`"`);case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState(`struct`),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin(`NOTE`),29;case 59:return this.popState(),this.pushState(`NOTE_ID`),59;case 60:return this.popState(),this.pushState(`NOTE_ID`),60;case 61:this.popState(),this.pushState(`FLOATING_NOTE`);break;case 62:return this.popState(),this.pushState(`FLOATING_NOTE_ID`),`AS`;case 63:break;case 64:return`NOTE_TEXT`;case 65:return i()?(this.popState(),`ID`):void 0;case 66:return i()?(this.popState(),this.pushState(`NOTE_TEXT`),24):void 0;case 67:return this.popState(),t.yytext=t.yytext.substr(2).trim(),31;case 68:return this.popState(),t.yytext=t.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return i()?24:void 0;case 74:return t.yytext=t.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return`INVALID`}},`anonymous`),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}}})();function F(){this.yy={}}return p(F,`Parser`),F.prototype=P,P.Parser=F,new F})(),V3.parser=V3,H3=V3,Dst=`TB`,U3=`TB`,W3=`dir`,G3=`state`,K3=`root`,q3=`relation`,Ost=`classDef`,kst=`style`,Ast=`applyClass`,J3=`default`,Y3=`divider`,X3=`fill:none`,Z3=`fill: #333`,Q3=`c`,$3=`markdown`,e6=`normal`,t6=`rect`,n6=`rectWithTitle`,jst=`stateStart`,Mst=`stateEnd`,r6=`divider`,i6=`roundedWithTitle`,Nst=`note`,Pst=`noteGroup`,a6=`statediagram`,Fst=`${a6}-state`,o6=`transition`,Ist=`note`,Lst=`${o6} note-edge`,Rst=`${a6}-${Ist}`,zst=`${a6}-cluster`,Bst=`${a6}-cluster-alt`,s6=`parent`,c6=`note`,Vst=`state`,l6=`----`,Hst=`${l6}${c6}`,u6=`${l6}${s6}`,d6=p((e,t=U3)=>{if(!e.doc)return t;let n=t;for(let t of e.doc)t.stmt===`dir`&&(n=t.value);return n},`getDir`),Ust={getClasses:p(function(e,t){return t.db.getClasses()},`getClasses`),draw:p(async function(e,t,n,r){y.info(`REF0:`),y.info(`Drawing state diagram (v2)`,t);let{securityLevel:i,state:a,layout:o}=Z();r.db.extract(r.db.getRootDocV2());let s=r.db.getData(),l=GL(t,i);s.type=r.type,s.layoutAlgorithm=o,s.nodeSpacing=a?.nodeSpacing||50,s.rankSpacing=a?.rankSpacing||50,s.markers=Z().look===`neo`?[`barbNeo`]:[`barb`],s.diagramId=t,await wI(s,l);try{(typeof r.db.getLinks==`function`?r.db.getLinks():new Map).forEach((e,t)=>{let n=typeof t==`string`?t:typeof t?.id==`string`?t.id:``,r=s.nodes.find(e=>e.id===n);if(!n){y.warn(`⚠️ Invalid or missing stateId from key:`,JSON.stringify(t));return}let i=l.node()?.querySelectorAll(`g.node, g.rough-node`),a;if(i?.forEach(e=>{let t=e.textContent?.trim();(e.id===r?.domId||t===n)&&(a=e)}),!a){y.warn(`⚠️ Could not find node matching text:`,n);return}let o=a.parentNode;if(!o){y.warn(`⚠️ Node has no parent, cannot wrap:`,n);return}let u=document.createElementNS(`http://www.w3.org/2000/svg`,`a`),d=e.url.replace(/^"+|"+$/g,``);if(u.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,d),u.setAttribute(`target`,`_blank`),e.tooltip){let t=e.tooltip.replace(/^"+|"+$/g,``);u.setAttribute(`title`,t),a.setAttribute(`title`,t)}o.replaceChild(u,a),u.appendChild(a),y.info(`🔗 Wrapped node in <a> tag for:`,n,e.url)})}catch(e){y.error(`❌ Error injecting clickable links:`,e)}eh.insertTitle(l,`statediagramTitleText`,a?.titleTopMargin??25,r.db.getDiagramTitle()),qL(l,8,a6,a?.useMaxWidth??!0)},`draw`),getDir:d6},f6=new Map,p6=0,p(z3,`stateDomId`),Wst=p((e,t,n,r,i,a,o,s)=>{y.trace(`items`,t),t.forEach(t=>{switch(t.stmt){case G3:h6(e,t,n,r,i,a,o,s);break;case J3:h6(e,t,n,r,i,a,o,s);break;case q3:{h6(e,t.state1,n,r,i,a,o,s),h6(e,t.state2,n,r,i,a,o,s);let l=o===`neo`,u={id:`edge`+p6,start:t.state1.id,end:t.state2.id,arrowhead:`normal`,arrowTypeEnd:l?`arrow_barb_neo`:`arrow_barb`,style:X3,labelStyle:``,label:Vs.sanitizeText(t.description??``,Z()),arrowheadStyle:Z3,labelpos:Q3,labelType:$3,thickness:e6,classes:o6,look:o};i.push(u),p6++}}})},`setupDoc`),m6=p((e,t=U3)=>{let n=t;if(e.doc)for(let t of e.doc)t.stmt===`dir`&&(n=t.value);return n},`getDir`),p(B3,`insertOrUpdateNode`),p(Tst,`getClassesFromDbInfo`),p(Est,`getStylesFromDbInfo`),h6=p((e,t,n,r,i,a,o,s)=>{let l=t.id,u=n.get(l),d=Tst(u),f=Est(u),p=Z();if(y.info(`dataFetcher parsedItem`,t,u,f),l!==`root`){let n=t6;t.start===!0?n=jst:t.start===!1&&(n=Mst),t.type!==J3&&(n=t.type),f6.get(l)||f6.set(l,{id:l,shape:n,description:Vs.sanitizeText(l,p),cssClasses:`${d} ${Fst}`,cssStyles:f});let u=f6.get(l);t.description&&(Array.isArray(u.description)?(u.shape=n6,u.description.push(t.description)):u.description?.length&&u.description.length>0?(u.shape=n6,u.description=u.description===l?[t.description]:[u.description,t.description]):(u.shape=t6,u.description=t.description),u.description=Vs.sanitizeTextOrArray(u.description,p)),u.description?.length===1&&u.shape===n6&&(u.shape=u.type===`group`?i6:t6),!u.type&&t.doc&&(y.info(`Setting cluster for XCX`,l,m6(t)),u.type=`group`,u.isGroup=!0,u.dir=m6(t),u.shape=t.type===Y3?r6:i6,u.cssClasses=`${u.cssClasses} ${zst} ${a?Bst:``}`);let m={labelStyle:``,shape:u.shape,label:u.description,cssClasses:u.cssClasses,cssCompiledStyles:[],cssStyles:u.cssStyles,id:l,dir:u.dir,domId:z3(l,p6),type:u.type,isGroup:u.type===`group`,padding:8,rx:10,ry:10,look:o,labelType:`markdown`};if(m.shape===r6&&(m.label=``),e&&e.id!==`root`&&(y.trace(`Setting node `,l,` to be child of its parent `,e.id),m.parentId=e.id),m.centerLabel=!0,t.note){let e={labelStyle:``,shape:Nst,label:t.note.text,labelType:`markdown`,cssClasses:Rst,cssStyles:[],cssCompiledStyles:[],id:l+Hst+`-`+p6,domId:z3(l,p6,c6),type:u.type,isGroup:u.type===`group`,padding:p.flowchart?.padding,look:o,position:t.note.position},n=l+u6,a={labelStyle:``,shape:Pst,label:t.note.text,cssClasses:u.cssClasses,cssStyles:[],id:l+u6,domId:z3(l,p6,s6),type:`group`,isGroup:!0,padding:16,look:o,position:t.note.position};p6++,a.id=n,e.parentId=n,B3(r,a,s),B3(r,e,s),B3(r,m,s);let d=l,f=e.id;t.note.position===`left of`&&(d=e.id,f=l),i.push({id:d+`-`+f,start:d,end:f,arrowhead:`none`,arrowTypeEnd:``,style:X3,labelStyle:``,classes:Lst,arrowheadStyle:Z3,labelpos:Q3,labelType:$3,thickness:e6,look:o})}else B3(r,m,s)}t.doc&&(y.trace(`Adding nodes children `),Wst(t,t.doc,n,r,i,!a,o,s))},`dataFetcher`),Gst=p(()=>{f6.clear(),p6=0},`reset`),g6={START_NODE:`[*]`,START_TYPE:`start`,END_NODE:`[*]`,END_TYPE:`end`,COLOR_KEYWORD:`color`,FILL_KEYWORD:`fill`,BG_FILL:`bgFill`,STYLECLASS_SEP:`,`},_6=p(()=>new Map,`newClassesList`),v6=p(()=>({relations:[],states:new Map,documents:{}}),`newDoc`),y6=p(e=>JSON.parse(JSON.stringify(e)),`clone`),b6=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=_6(),this.documents={root:v6()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=Qs,this.setAccTitle=Zs,this.getAccDescription=ec,this.setAccDescription=$s,this.setDiagramTitle=tc,this.getDiagramTitle=nc,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}static{p(this,`StateDB`)}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(e){this.clear(!0);for(let t of Array.isArray(e)?e:e.doc)switch(t.stmt){case G3:this.addState(t.id.trim(),t.type,t.doc,t.description,t.note);break;case q3:this.addRelation(t.state1,t.state2,t.description);break;case Ost:this.addStyleClass(t.id.trim(),t.classes);break;case kst:this.handleStyleDef(t);break;case Ast:this.setCssClass(t.id.trim(),t.styleClass);break;case`click`:this.addLink(t.id,t.url,t.tooltip)}let t=this.getStates(),n=Z();Gst(),h6(void 0,this.getRootDocV2(),t,this.nodes,this.edges,!0,n.look,this.classes);for(let e of this.nodes)if(Array.isArray(e.label)){if(e.description=e.label.slice(1),e.isGroup&&e.description.length>0)throw Error(`Group nodes can only have label. Remove the additional description for node [${e.id}]`);e.label=e.label[0]}}handleStyleDef(e){let t=e.id.trim().split(`,`),n=e.styleClass.split(`,`);for(let e of t){let t=this.getState(e);if(!t){let n=e.trim();this.addState(n),t=this.getState(n)}t&&(t.styles=n.map(e=>e.replace(/;/g,``)?.trim()))}}setRootDoc(e){y.info(`Setting root doc`,e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,t,n){if(t.stmt===q3){this.docTranslator(e,t.state1,!0),this.docTranslator(e,t.state2,!1);return}if(t.stmt===G3&&(t.id===g6.START_NODE?(t.id=e.id+(n?`_start`:`_end`),t.start=n):t.id=t.id.trim()),t.stmt!==K3&&t.stmt!==G3||!t.doc)return;let r=[],i=[];for(let e of t.doc)if(e.type===Y3){let t=y6(e);t.doc=y6(i),r.push(t),i=[]}else i.push(e);if(r.length>0&&i.length>0){let e={stmt:G3,id:Jm(),type:`divider`,doc:y6(i)};r.push(y6(e)),t.doc=r}t.doc.forEach(e=>this.docTranslator(t,e,!0))}getRootDocV2(){return this.docTranslator({id:K3,stmt:K3},{id:K3,stmt:K3,doc:this.rootDoc},!0),{id:K3,doc:this.rootDoc}}addState(e,t=J3,n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0){let l=e?.trim();if(!this.currentDocument.states.has(l))y.info(`Adding state `,l,r),this.currentDocument.states.set(l,{stmt:G3,id:l,descriptions:[],type:t,doc:n,note:i,classes:[],styles:[],textStyles:[]});else{let e=this.currentDocument.states.get(l);if(!e)throw Error(`State not found: ${l}`);e.doc||=n,e.type||=t}if(r&&(y.info(`Setting state description`,l,r),(Array.isArray(r)?r:[r]).forEach(e=>this.addDescription(l,e.trim()))),i){let e=this.currentDocument.states.get(l);if(!e)throw Error(`State not found: ${l}`);e.note=i,e.note.text=Vs.sanitizeText(e.note.text,Z())}a&&(y.info(`Setting state classes`,l,a),(Array.isArray(a)?a:[a]).forEach(e=>this.setCssClass(l,e.trim()))),o&&(y.info(`Setting state styles`,l,o),(Array.isArray(o)?o:[o]).forEach(e=>this.setStyle(l,e.trim()))),s&&(y.info(`Setting state styles`,l,o),(Array.isArray(s)?s:[s]).forEach(e=>this.setTextStyle(l,e.trim())))}clear(e){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:v6()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=_6(),e||(this.links=new Map,Xs())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){y.info(`Documents = `,this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,t,n){this.links.set(e,{url:t,tooltip:n}),y.warn(`Adding link`,e,t,n)}getLinks(){return this.links}startIdIfNeeded(e=``){return e===g6.START_NODE?(this.startEndCount++,`${g6.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e=``,t=J3){return e===g6.START_NODE?g6.START_TYPE:t}endIdIfNeeded(e=``){return e===g6.END_NODE?(this.startEndCount++,`${g6.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e=``,t=J3){return e===g6.END_NODE?g6.END_TYPE:t}addRelationObjs(e,t,n=``){let r=this.startIdIfNeeded(e.id.trim()),i=this.startTypeIfNeeded(e.id.trim(),e.type),a=this.startIdIfNeeded(t.id.trim()),o=this.startTypeIfNeeded(t.id.trim(),t.type);this.addState(r,i,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(a,o,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.currentDocument.relations.push({id1:r,id2:a,relationTitle:Vs.sanitizeText(n,Z())})}addRelation(e,t,n){if(typeof e==`object`&&typeof t==`object`)this.addRelationObjs(e,t,n);else if(typeof e==`string`&&typeof t==`string`){let r=this.startIdIfNeeded(e.trim()),i=this.startTypeIfNeeded(e),a=this.endIdIfNeeded(t.trim()),o=this.endTypeIfNeeded(t);this.addState(r,i),this.addState(a,o),this.currentDocument.relations.push({id1:r,id2:a,relationTitle:n?Vs.sanitizeText(n,Z()):void 0})}}addDescription(e,t){let n=this.currentDocument.states.get(e),r=t.startsWith(`:`)?t.replace(`:`,``).trim():t;n?.descriptions?.push(Vs.sanitizeText(r,Z()))}cleanupLabel(e){return e.startsWith(`:`)?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,t=``){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});let n=this.classes.get(e);t&&n&&t.split(g6.STYLECLASS_SEP).forEach(e=>{let t=e.replace(/([^;]*);/,`$1`).trim();if(RegExp(g6.COLOR_KEYWORD).exec(e)){let e=t.replace(g6.FILL_KEYWORD,g6.BG_FILL).replace(g6.COLOR_KEYWORD,g6.FILL_KEYWORD);n.textStyles.push(e)}n.styles.push(t)})}getClasses(){return this.classes}setupToolTips(e){let t=nL();$c(e).select(`svg`).selectAll(`g.node, g.rough-node`).on(`mouseover`,e=>{let n=$c(e.currentTarget),r=n.attr(`title`);if(r===null)return;let i=e.currentTarget?.getBoundingClientRect();t.transition().duration(200).style(`opacity`,`.9`),t.style(`left`,window.scrollX+i.left+(i.right-i.left)/2+`px`).style(`top`,window.scrollY+i.bottom+`px`),t.html(Kt.sanitize(r)),n.classed(`hover`,!0)}).on(`mouseout`,e=>{t.transition().duration(500).style(`opacity`,0),$c(e.currentTarget).classed(`hover`,!1)})}setCssClass(e,t){e.split(`,`).forEach(e=>{let n=this.getState(e);if(!n){let t=e.trim();this.addState(t),n=this.getState(t)}n?.classes?.push(t)})}setStyle(e,t){this.getState(e)?.styles?.push(t)}setTextStyle(e,t){this.getState(e)?.textStyles?.push(t)}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===W3)}getDirection(){return this.getDirectionStatement()?.value??Dst}setDirection(e){let t=this.getDirectionStatement();t?t.value=e:this.rootDoc.unshift({stmt:W3,value:e})}trimColon(e){return e.startsWith(`:`)?e.slice(1).trim():e.trim()}getData(){let e=Z();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:d6(this.getRootDocV2())}}getConfig(){return Z().state}},x6=p(e=>`2271+defs [id$="-barbEnd"] {2272+ fill: ${e.transitionColor};2273+ stroke: ${e.transitionColor};2274+ }2275+g.stateGroup text {2276+ fill: ${e.nodeBorder};2277+ stroke: none;2278+ font-size: 10px;2279+}2280+g.stateGroup text {2281+ fill: ${e.textColor};2282+ stroke: none;2283+ font-size: 10px;2284+2285+}2286+g.stateGroup .state-title {2287+ font-weight: bolder;2288+ fill: ${e.stateLabelColor};2289+}2290+2291+g.stateGroup rect {2292+ fill: ${e.mainBkg};2293+ stroke: ${e.nodeBorder};2294+}2295+2296+g.stateGroup line {2297+ stroke: ${e.lineColor};2298+ stroke-width: ${e.strokeWidth||1};2299+}2300+2301+.transition {2302+ stroke: ${e.transitionColor};2303+ stroke-width: ${e.strokeWidth||1};2304+ fill: none;2305+}2306+2307+.stateGroup .composit {2308+ fill: ${e.background};2309+ border-bottom: 1px2310+}2311+2312+.stateGroup .alt-composit {2313+ fill: #e0e0e0;2314+ border-bottom: 1px2315+}2316+2317+.state-note {2318+ stroke: ${e.noteBorderColor};2319+ fill: ${e.noteBkgColor};2320+2321+ text {2322+ fill: ${e.noteTextColor};2323+ stroke: none;2324+ font-size: 10px;2325+ }2326+}2327+2328+.stateLabel .box {2329+ stroke: none;2330+ stroke-width: 0;2331+ fill: ${e.mainBkg};2332+ opacity: 0.5;2333+}2334+2335+.edgeLabel .label rect {2336+ fill: ${e.labelBackgroundColor};2337+ opacity: 0.5;2338+}2339+.edgeLabel {2340+ background-color: ${e.edgeLabelBackground};2341+ p {2342+ background-color: ${e.edgeLabelBackground};2343+ }2344+ rect {2345+ opacity: 0.5;2346+ background-color: ${e.edgeLabelBackground};2347+ fill: ${e.edgeLabelBackground};2348+ }2349+ text-align: center;2350+}2351+.edgeLabel .label text {2352+ fill: ${e.transitionLabelColor||e.tertiaryTextColor};2353+}2354+.label div .edgeLabel {2355+ color: ${e.transitionLabelColor||e.tertiaryTextColor};2356+}2357+2358+.stateLabel text {2359+ fill: ${e.stateLabelColor};2360+ font-size: 10px;2361+ font-weight: bold;2362+}2363+2364+.node circle.state-start {2365+ fill: ${e.specialStateColor};2366+ stroke: ${e.specialStateColor};2367+}2368+2369+.node .fork-join {2370+ fill: ${e.specialStateColor};2371+ stroke: ${e.specialStateColor};2372+}2373+2374+.node circle.state-end {2375+ fill: ${e.innerEndBackground};2376+ stroke: ${e.background};2377+ stroke-width: 1.52378+}2379+.end-state-inner {2380+ fill: ${e.compositeBackground||e.background};2381+ // stroke: ${e.background};2382+ stroke-width: 1.52383+}2384+2385+.node rect {2386+ fill: ${e.stateBkg||e.mainBkg};2387+ stroke: ${e.stateBorder||e.nodeBorder};2388+ stroke-width: ${e.strokeWidth||1}px;2389+}2390+.node polygon {2391+ fill: ${e.mainBkg};2392+ stroke: ${e.stateBorder||e.nodeBorder};;2393+ stroke-width: ${e.strokeWidth||1}px;2394+}2395+[id$="-barbEnd"] {2396+ fill: ${e.lineColor};2397+}2398+2399+.statediagram-cluster rect {2400+ fill: ${e.compositeTitleBackground};2401+ stroke: ${e.stateBorder||e.nodeBorder};2402+ stroke-width: ${e.strokeWidth||1}px;2403+}2404+2405+.cluster-label, .nodeLabel {2406+ color: ${e.stateLabelColor};2407+ // line-height: 1;2408+}2409+2410+.statediagram-cluster rect.outer {2411+ rx: 5px;2412+ ry: 5px;2413+}2414+.statediagram-state .divider {2415+ stroke: ${e.stateBorder||e.nodeBorder};2416+}2417+2418+.statediagram-state .title-state {2419+ rx: 5px;2420+ ry: 5px;2421+}2422+.statediagram-cluster.statediagram-cluster .inner {2423+ fill: ${e.compositeBackground||e.background};2424+}2425+.statediagram-cluster.statediagram-cluster-alt .inner {2426+ fill: ${e.altBackground?e.altBackground:`#efefef`};2427+}2428+2429+.statediagram-cluster .inner {2430+ rx:0;2431+ ry:0;2432+}2433+2434+.statediagram-state rect.basic {2435+ rx: 5px;2436+ ry: 5px;2437+}2438+.statediagram-state rect.divider {2439+ stroke-dasharray: 10,10;2440+ fill: ${e.altBackground?e.altBackground:`#efefef`};2441+}2442+2443+.note-edge {2444+ stroke-dasharray: 5;2445+}2446+2447+.statediagram-note rect {2448+ fill: ${e.noteBkgColor};2449+ stroke: ${e.noteBorderColor};2450+ stroke-width: 1px;2451+ rx: 0;2452+ ry: 0;2453+}2454+.statediagram-note rect {2455+ fill: ${e.noteBkgColor};2456+ stroke: ${e.noteBorderColor};2457+ stroke-width: 1px;2458+ rx: 0;2459+ ry: 0;2460+}2461+2462+.statediagram-note text {2463+ fill: ${e.noteTextColor};2464+}2465+2466+.statediagram-note .nodeLabel {2467+ color: ${e.noteTextColor};2468+}2469+.statediagram .edgeLabel {2470+ color: red; // ${e.noteTextColor};2471+}2472+2473+[id$="-dependencyStart"], [id$="-dependencyEnd"] {2474+ fill: ${e.lineColor};2475+ stroke: ${e.lineColor};2476+ stroke-width: ${e.strokeWidth||1};2477+}2478+2479+.statediagramTitleText {2480+ text-anchor: middle;2481+ font-size: 18px;2482+ fill: ${e.textColor};2483+}2484+2485+[data-look="neo"].statediagram-cluster rect {2486+ fill: ${e.mainBkg};2487+ stroke: ${e.useGradient?`url(`+e.svgId+`-gradient)`:e.stateBorder||e.nodeBorder};2488+ stroke-width: ${e.strokeWidth??1};2489+}2490+[data-look="neo"].statediagram-cluster rect.outer {2491+ rx: ${e.radius}px;2492+ ry: ${e.radius}px;2493+ filter: ${e.dropShadow?e.dropShadow.replace(`url(#drop-shadow)`,`url(${e.svgId}-drop-shadow)`):`none`}2494+}2495+`,`getStyles`)})),qst=l({diagram:()=>cct}),Jst,Yst,Xst,Zst,Qst,$st,ect,tct,nct,S6,C6,rct,w6,T6,ict,act,oct,sct,E6,cct,lct=o((()=>{Kst(),KL(),JL(),EI(),rL(),U_(),cv(),z_(),P_(),Op(),ig(),Gp(),rh(),dc(),S(),h(),_p(),RMe(),mS(),Jst=p(e=>e.append(`circle`).attr(`class`,`start-state`).attr(`r`,Z().state.sizeUnit).attr(`cx`,Z().state.padding+Z().state.sizeUnit).attr(`cy`,Z().state.padding+Z().state.sizeUnit),`drawStartState`),Yst=p(e=>e.append(`line`).style(`stroke`,`grey`).style(`stroke-dasharray`,`3`).attr(`x1`,Z().state.textHeight).attr(`class`,`divider`).attr(`x2`,Z().state.textHeight*2).attr(`y1`,0).attr(`y2`,0),`drawDivider`),Xst=p((e,t)=>{let n=e.append(`text`).attr(`x`,2*Z().state.padding).attr(`y`,Z().state.textHeight+2*Z().state.padding).attr(`font-size`,Z().state.fontSize).attr(`class`,`state-title`).text(t.id),r=n.node().getBBox();return e.insert(`rect`,`:first-child`).attr(`x`,Z().state.padding).attr(`y`,Z().state.padding).attr(`width`,r.width+2*Z().state.padding).attr(`height`,r.height+2*Z().state.padding).attr(`rx`,Z().state.radius),n},`drawSimpleState`),Zst=p((e,t)=>{let n=p(function(e,t,n){let r=e.append(`tspan`).attr(`x`,2*Z().state.padding).text(t);n||r.attr(`dy`,Z().state.textHeight)},`addTspan`),r=e.append(`text`).attr(`x`,2*Z().state.padding).attr(`y`,Z().state.textHeight+1.3*Z().state.padding).attr(`font-size`,Z().state.fontSize).attr(`class`,`state-title`).text(t.descriptions[0]).node().getBBox(),i=r.height,a=e.append(`text`).attr(`x`,Z().state.padding).attr(`y`,i+Z().state.padding*.4+Z().state.dividerMargin+Z().state.textHeight).attr(`class`,`state-description`),o=!0,s=!0;t.descriptions.forEach(function(e){o||(n(a,e,s),s=!1),o=!1});let l=e.append(`line`).attr(`x1`,Z().state.padding).attr(`y1`,Z().state.padding+i+Z().state.dividerMargin/2).attr(`y2`,Z().state.padding+i+Z().state.dividerMargin/2).attr(`class`,`descr-divider`),u=a.node().getBBox(),d=Math.max(u.width,r.width);return l.attr(`x2`,d+3*Z().state.padding),e.insert(`rect`,`:first-child`).attr(`x`,Z().state.padding).attr(`y`,Z().state.padding).attr(`width`,d+2*Z().state.padding).attr(`height`,u.height+i+2*Z().state.padding).attr(`rx`,Z().state.radius),e},`drawDescrState`),Qst=p((e,t,n)=>{let r=Z().state.padding,i=2*Z().state.padding,a=e.node().getBBox(),o=a.width,s=a.x,l=e.append(`text`).attr(`x`,0).attr(`y`,Z().state.titleShift).attr(`font-size`,Z().state.fontSize).attr(`class`,`state-title`).text(t.id),u=l.node().getBBox().width+i,d=Math.max(u,o);d===o&&(d+=i);let f,p=e.node().getBBox();t.doc,f=s-r,u>o&&(f=(o-d)/2+r),Math.abs(s-p.x)<r&&u>o&&(f=s-(u-o)/2);let m=1-Z().state.textHeight;return e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,m).attr(`class`,n?`alt-composit`:`composit`).attr(`width`,d).attr(`height`,p.height+Z().state.textHeight+Z().state.titleShift+1).attr(`rx`,`0`),l.attr(`x`,f+r),u<=o&&l.attr(`x`,s+(d-i)/2-u/2+r),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,Z().state.titleShift-Z().state.textHeight-Z().state.padding).attr(`width`,d).attr(`height`,Z().state.textHeight*3).attr(`rx`,Z().state.radius),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,Z().state.titleShift-Z().state.textHeight-Z().state.padding).attr(`width`,d).attr(`height`,p.height+3+2*Z().state.textHeight).attr(`rx`,Z().state.radius),e},`addTitleAndBox`),$st=p(e=>(e.append(`circle`).attr(`class`,`end-state-outer`).attr(`r`,Z().state.sizeUnit+Z().state.miniPadding).attr(`cx`,Z().state.padding+Z().state.sizeUnit+Z().state.miniPadding).attr(`cy`,Z().state.padding+Z().state.sizeUnit+Z().state.miniPadding),e.append(`circle`).attr(`class`,`end-state-inner`).attr(`r`,Z().state.sizeUnit).attr(`cx`,Z().state.padding+Z().state.sizeUnit+2).attr(`cy`,Z().state.padding+Z().state.sizeUnit+2)),`drawEndState`),ect=p((e,t)=>{let n=Z().state.forkWidth,r=Z().state.forkHeight;if(t.parentId){let e=n;n=r,r=e}return e.append(`rect`).style(`stroke`,`black`).style(`fill`,`black`).attr(`width`,n).attr(`height`,r).attr(`x`,Z().state.padding).attr(`y`,Z().state.padding)},`drawForkJoinState`),tct=p((e,t,n,r)=>{let i=0,a=r.append(`text`);a.style(`text-anchor`,`start`),a.attr(`class`,`noteText`);let o=e.replace(/\r\n/g,`<br/>`);o=o.replace(/\n/g,`<br/>`);let s=o.split(Vs.lineBreakRegex),l=1.25*Z().state.noteMargin;for(let e of s){let r=e.trim();if(r.length>0){let e=a.append(`tspan`);if(e.text(r),l===0){let t=e.node().getBBox();l+=t.height}i+=l,e.attr(`x`,t+Z().state.noteMargin),e.attr(`y`,n+i+1.25*Z().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},`_drawLongText`),nct=p((e,t)=>{t.attr(`class`,`state-note`);let n=t.append(`rect`).attr(`x`,0).attr(`y`,Z().state.padding),{textWidth:r,textHeight:i}=tct(e,0,0,t.append(`g`));return n.attr(`height`,i+2*Z().state.noteMargin),n.attr(`width`,r+Z().state.noteMargin*2),n},`drawNote`),S6=p(function(e,t){let n=t.id,r={id:n,label:t.id,width:0,height:0},i=e.append(`g`).attr(`id`,n).attr(`class`,`stateGroup`);t.type===`start`&&Jst(i),t.type===`end`&&$st(i),(t.type===`fork`||t.type===`join`)&&ect(i,t),t.type===`note`&&nct(t.note.text,i),t.type===`divider`&&Yst(i),t.type==="default"&&t.descriptions.length===0&&Xst(i,t),t.type==="default"&&t.descriptions.length>0&&Zst(i,t);let a=i.node().getBBox();return r.width=a.width+2*Z().state.padding,r.height=a.height+2*Z().state.padding,r},`drawState`),C6=0,rct=p(function(e,t,n){let r=p(function(e){switch(e){case b6.relationType.AGGREGATION:return`aggregation`;case b6.relationType.EXTENSION:return`extension`;case b6.relationType.COMPOSITION:return`composition`;case b6.relationType.DEPENDENCY:return`dependency`}},`getRelationType`);t.points=t.points.filter(e=>!Number.isNaN(e.y));let i=t.points,a=bf().x(function(e){return e.x}).y(function(e){return e.y}).curve(Of),o=e.append(`path`).attr(`d`,a(i)).attr(`id`,`edge`+C6).attr(`class`,`transition`),s=``;if(Z().state.arrowMarkerAbsolute&&(s=Ns(!0)),o.attr(`marker-end`,`url(`+s+`#`+r(b6.relationType.DEPENDENCY)+`End)`),n.title!==void 0){let r=e.append(`g`).attr(`class`,`stateLabel`),{x:i,y:a}=eh.calcLabelPosition(t.points),o=Vs.getRows(n.title),s=0,l=[],u=0,d=0;for(let e=0;e<=o.length;e++){let t=r.append(`text`).attr(`text-anchor`,`middle`).text(o[e]).attr(`x`,i).attr(`y`,a+s),n=t.node().getBBox();u=Math.max(u,n.width),d=Math.min(d,n.x),y.info(n.x,i,a+s),s===0&&(s=t.node().getBBox().height,y.info(`Title height`,s,a)),l.push(t)}let f=s*o.length;if(o.length>1){let e=(o.length-1)*s*.5;l.forEach((t,n)=>t.attr(`y`,a+n*s-e)),f=s*o.length}let p=r.node().getBBox();r.insert(`rect`,`:first-child`).attr(`class`,`box`).attr(`x`,i-u/2-Z().state.padding/2).attr(`y`,a-f/2-Z().state.padding/2-3.5).attr(`width`,u+Z().state.padding).attr(`height`,f+Z().state.padding),y.info(p)}C6++},`drawEdge`),T6={},ict=p(function(){},`setConf`),act=p(function(e){e.append(`defs`).append(`marker`).attr(`id`,`dependencyEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`insertMarkers`),oct=p(function(e,t,n,r){w6=Z().state;let i=Z().securityLevel,a;i===`sandbox`&&(a=$c(`#i`+t));let o=$c(i===`sandbox`?a.nodes()[0].contentDocument.body:`body`),s=i===`sandbox`?a.nodes()[0].contentDocument:document;y.debug(`Rendering diagram `+e);let l=o.select(`[id='${t}']`);act(l),E6(r.db.getRootDoc(),l.append(`g`).attr(`id`,t+`-root`),void 0,!1,o,s,r);let u=w6.padding,d=l.node().getBBox(),f=d.width+u*2,p=d.height+u*2,m=f*1.75;Hs(l,p,m,w6.useMaxWidth),l.attr(`viewBox`,`${d.x-w6.padding} ${d.y-w6.padding} `+f+` `+p)},`draw`),sct=p(e=>e?e.length*w6.fontSizeFactor:1,`getLabelWidth`),E6=p((e,t,n,r,i,a,o)=>{let s=new pS({compound:!0,multigraph:!0}),l,u=!0;for(l=0;l<e.length;l++)if(e[l].stmt===`relation`){u=!1;break}n?s.setGraph({rankdir:`LR`,multigraph:!0,compound:!0,ranker:`tight-tree`,ranksep:u?1:w6.edgeLengthFactor,nodeSep:u?1:50,isMultiGraph:!0}):s.setGraph({rankdir:`TB`,multigraph:!0,compound:!0,ranksep:u?1:w6.edgeLengthFactor,nodeSep:u?1:50,ranker:`tight-tree`,isMultiGraph:!0}),s.setDefaultEdgeLabel(function(){return{}});let d=o.db.getStates(),f=o.db.getRelations(),p=Object.keys(d);for(let e of p){let l=d[e];n&&(l.parentId=n);let u;if(l.doc){let e=t.append(`g`).attr(`id`,l.id).attr(`class`,`stateGroup`);u=E6(l.doc,e,l.id,!r,i,a,o);{e=Qst(e,l,r);let t=e.node().getBBox();u.width=t.width,u.height=t.height+w6.padding/2,T6[l.id]={y:w6.compositTitleSize}}}else u=S6(t,l,s);if(l.note){let e=S6(t,{descriptions:[],id:l.id+`-note`,note:l.note,type:`note`},s);l.note.position===`left of`?(s.setNode(u.id+`-note`,e),s.setNode(u.id,u)):(s.setNode(u.id,u),s.setNode(u.id+`-note`,e)),s.setParent(u.id,u.id+`-group`),s.setParent(u.id+`-note`,u.id+`-group`)}else s.setNode(u.id,u)}y.debug(`Count=`,s.nodeCount(),s);let m=0;f.forEach(function(e){m++,y.debug(`Setting edge`,e),s.setEdge(e.id1,e.id2,{relation:e,width:sct(e.title),height:w6.labelHeight*Vs.getRows(e.title).length,labelpos:`c`},`id`+m)}),pMe(s),y.debug(`Graph after layout`,s.nodes());let h=t.node();s.nodes().forEach(function(e){e!==void 0&&s.node(e)!==void 0?(y.warn(`Node `+e+`: `+JSON.stringify(s.node(e))),i.select(`#`+h.id+` #`+e).attr(`transform`,`translate(`+(s.node(e).x-s.node(e).width/2)+`,`+(s.node(e).y+(T6[e]?T6[e].y:0)-s.node(e).height/2)+` )`),i.select(`#`+h.id+` #`+e).attr(`data-x-shift`,s.node(e).x-s.node(e).width/2),a.querySelectorAll(`#`+h.id+` #`+e+` .divider`).forEach(e=>{let t=e.parentElement,n=0,r=0;t&&(t.parentElement&&(n=t.parentElement.getBBox().width),r=parseInt(t.getAttribute(`data-x-shift`),10),Number.isNaN(r)&&(r=0)),e.setAttribute(`x1`,0-r+8),e.setAttribute(`x2`,n-r-8)})):y.debug(`No Node `+e+`: `+JSON.stringify(s.node(e)))});let g=h.getBBox();s.edges().forEach(function(e){e!==void 0&&s.edge(e)!==void 0&&(y.debug(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(s.edge(e))),rct(t,s.edge(e),s.edge(e).relation))}),g=h.getBBox();let _={id:n||`root`,label:n||`root`,width:0,height:0};return _.width=g.width+2*w6.padding,_.height=g.height+2*w6.padding,y.debug(`Doc rendered`,_,s),_},`renderDoc`),cct={parser:H3,get db(){return new b6(1)},renderer:{setConf:ict,draw:oct},styles:x6,init:p(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)}})),uct=l({diagram:()=>dct}),dct,fct=o((()=>{Kst(),KL(),JL(),EI(),rL(),U_(),cv(),z_(),P_(),Op(),ig(),Gp(),rh(),dc(),S(),h(),dct={parser:H3,get db(){return new b6(2)},renderer:Ust,styles:x6,init:p(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)}})),pct=l({diagram:()=>Mct});function mct(e){let t=Z().journey,n=t.maxLabelWidth;V6=0;let r=60;Object.keys(B6).forEach(i=>{let a=B6[i].color,o={cx:20,cy:r,r:7,fill:a,stroke:`#000`,pos:B6[i].position};z6.drawCircle(e,o);let s=e.append(`text`).attr(`visibility`,`hidden`).text(i),l=s.node().getBoundingClientRect().width;s.remove();let u=[];if(l<=n)u=[i];else{let t=i.split(` `),r=``;s=e.append(`text`).attr(`visibility`,`hidden`),t.forEach(e=>{let t=r?`${r} ${e}`:e;if(s.text(t),s.node().getBoundingClientRect().width>n){if(r&&u.push(r),r=e,s.text(e),s.node().getBoundingClientRect().width>n){let t=``;for(let r of e)t+=r,s.text(t+`-`),s.node().getBoundingClientRect().width>n&&(u.push(t.slice(0,-1)+`-`),t=r);r=t}}else r=t}),r&&u.push(r),s.remove()}u.forEach((n,i)=>{let a={x:40,y:r+7+i*20,fill:`#666`,text:n,textMargin:t.boxTextMargin??5},o=z6.drawText(e,a).node().getBoundingClientRect().width;o>V6&&o>t.leftMargin-o&&(V6=o)}),r+=Math.max(20,u.length*20)})}var D6,hct,O6,k6,A6,j6,gct,_ct,vct,yct,bct,xct,Sct,M6,N6,Cct,P6,wct,F6,I6,Tct,Ect,L6,Dct,Oct,R6,z6,kct,B6,V6,H6,U6,Act,W6,G6,K6,jct,q6,Mct,Nct=o((()=>{WL(),rL(),dc(),S(),h(),_p(),D6=(function(){var e=p(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[6,8,10,11,12,14,16,17,18],n=[1,9],r=[1,10],i=[1,11],a=[1,12],o=[1,13],s=[1,14],l={trace:p(function(){},`trace`),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:`error`,4:`journey`,6:`EOF`,8:`SPACE`,10:`NEWLINE`,11:`title`,12:`acc_title`,13:`acc_title_value`,14:`acc_descr`,15:`acc_descr_value`,16:`acc_descr_multiline_value`,17:`section`,18:`taskName`,19:`taskData`},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:p(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 2:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 6:case 7:this.$=[];break;case 8:r.setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 9:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 10:case 11:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 12:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 13:r.addTask(a[s-1],a[s]),this.$=`task`}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},e(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:n,12:r,14:i,16:a,17:o,18:s},e(t,[2,7],{1:[2,1]}),e(t,[2,3]),{9:15,11:n,12:r,14:i,16:a,17:o,18:s},e(t,[2,5]),e(t,[2,6]),e(t,[2,8]),{13:[1,16]},{15:[1,17]},e(t,[2,11]),e(t,[2,12]),{19:[1,18]},e(t,[2,4]),e(t,[2,9]),e(t,[2,10]),e(t,[2,13])],defaultActions:{},parseError:p(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:p(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,l=0,u=0,d=0,f=2,m=1,h=a.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(_.yy[v]=this.yy[v]);g.setInput(e,_.yy),_.yy.lexer=g,_.yy.parser=this,g.yylloc===void 0&&(g.yylloc={});var y=g.yylloc;a.push(y);var b=g.options&&g.options.ranges;this.parseError=typeof _.yy.parseError==`function`?_.yy.parseError:Object.getPrototypeOf(this).parseError;function x(e){n.length-=2*e,i.length-=e,a.length-=e}p(x,`popStack`);function S(){var e=r.pop()||g.lex()||m;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}p(S,`lex`);for(var C,w,T,E,D,O={},k,A,j,M;;){if(T=n[n.length-1],this.defaultActions[T]?E=this.defaultActions[T]:(C??=S(),E=o[T]&&o[T][C]),E===void 0||!E.length||!E[0]){var N=``;for(k in M=[],o[T])this.terminals_[k]&&k>f&&M.push(`'`+this.terminals_[k]+`'`);N=g.showPosition?`Parse error on line `+(l+1)+`:2496+`+g.showPosition()+`2497+Expecting `+M.join(`, `)+`, got '`+(this.terminals_[C]||C)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(C==m?`end of input`:`'`+(this.terminals_[C]||C)+`'`),this.parseError(N,{text:g.match,token:this.terminals_[C]||C,line:g.yylineno,loc:y,expected:M})}if(E[0]instanceof Array&&E.length>1)throw Error(`Parse Error: multiple actions possible at state: `+T+`, token: `+C);switch(E[0]){case 1:n.push(C),i.push(g.yytext),a.push(g.yylloc),n.push(E[1]),C=null,w?(C=w,w=null):(u=g.yyleng,s=g.yytext,l=g.yylineno,y=g.yylloc,d>0&&d--);break;case 2:if(A=this.productions_[E[1]][1],O.$=i[i.length-A],O._$={first_line:a[a.length-(A||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(A||1)].first_column,last_column:a[a.length-1].last_column},b&&(O._$.range=[a[a.length-(A||1)].range[0],a[a.length-1].range[1]]),D=this.performAction.apply(O,[s,u,l,_.yy,E[1],i,a].concat(h)),D!==void 0)return D;A&&(n=n.slice(0,-1*A*2),i=i.slice(0,-1*A),a=a.slice(0,-1*A)),n.push(this.productions_[E[1]][0]),i.push(O.$),a.push(O._$),j=o[n[n.length-2]][n[n.length-1]],n.push(j);break;case 3:return!0}}return!0},`parse`)};l.lexer=(function(){return{EOF:1,parseError:p(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:p(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:p(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:p(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:p(function(){return this._more=!0,this},`more`),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).2498+`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:p(function(e){this.unput(this.match.slice(e))},`less`),pastInput:p(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:p(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:p(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`2499+`+t+`^`},`showPosition`),test_match:p(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.2500+`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:p(function(){return this.next()||this.lex()},`lex`),begin:p(function(e){this.conditionStack.push(e)},`begin`),popState:p(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:p(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:p(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:p(function(e){this.begin(e)},`pushState`),stateStackSize:p(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:p(function(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin(`acc_title`),12;case 8:return this.popState(),`acc_title_value`;case 9:return this.begin(`acc_descr`),14;case 10:return this.popState(),`acc_descr_value`;case 11:this.begin(`acc_descr_multiline`);break;case 12:this.popState();break;case 13:return`acc_descr_multiline_value`;case 14:return 17;case 15:return 18;case 16:return 19;case 17:return`:`;case 18:return 6;case 19:return`INVALID`}},`anonymous`),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}}})();function u(){this.yy={}}return p(u,`Parser`),u.prototype=l,l.Parser=u,new u})(),D6.parser=D6,hct=D6,O6=``,k6=[],A6=[],j6=[],gct=p(function(){k6.length=0,A6.length=0,O6=``,j6.length=0,Xs()},`clear`),_ct=p(function(e){O6=e,k6.push(e)},`addSection`),vct=p(function(){return k6},`getSections`),yct=p(function(){let e=M6(),t=0;for(;!e&&t<100;)e=M6(),t++;return A6.push(...j6),A6},`getTasks`),bct=p(function(){let e=[];return A6.forEach(t=>{t.people&&e.push(...t.people)}),[...new Set(e)].sort()},`updateActors`),xct=p(function(e,t){let n=t.substr(1).split(`:`),r=0,i=[];n.length===1?(r=Number(n[0]),i=[]):(r=Number(n[0]),i=n[1].split(`,`));let a=i.map(e=>e.trim()),o={section:O6,type:O6,people:a,task:e,score:r};j6.push(o)},`addTask`),Sct=p(function(e){let t={section:O6,type:O6,description:e,task:e,classes:[]};A6.push(t)},`addTaskOrg`),M6=p(function(){let e=p(function(e){return j6[e].processed},`compileTask`),t=!0;for(let[n,r]of j6.entries())e(n),t&&=r.processed;return t},`compileTasks`),N6={getConfig:p(()=>Z().journey,`getConfig`),clear:gct,setDiagramTitle:tc,getDiagramTitle:nc,setAccTitle:Zs,getAccTitle:Qs,setAccDescription:$s,getAccDescription:ec,addSection:_ct,getSections:vct,getTasks:yct,addTask:xct,addTaskOrg:Sct,getActors:p(function(){return bct()},`getActors`)},Cct=p(e=>`.label {2501+ font-family: ${e.fontFamily};2502+ color: ${e.textColor};2503+ }2504+ .mouth {2505+ stroke: #666;2506+ }2507+2508+ line {2509+ stroke: ${e.textColor}2510+ }2511+2512+ .legend {2513+ fill: ${e.textColor};2514+ font-family: ${e.fontFamily};2515+ }2516+2517+ .label text {2518+ fill: #333;2519+ }2520+ .label {2521+ color: ${e.textColor}2522+ }2523+2524+ .face {2525+ ${e.faceColor?`fill: ${e.faceColor}`:`fill: #FFF8DC`};2526+ stroke: #999;2527+ }2528+2529+ .node rect,2530+ .node circle,2531+ .node ellipse,2532+ .node polygon,2533+ .node path {2534+ fill: ${e.mainBkg};2535+ stroke: ${e.nodeBorder};2536+ stroke-width: 1px;2537+ }2538+2539+ .node .label {2540+ text-align: center;2541+ }2542+ .node.clickable {2543+ cursor: pointer;2544+ }2545+2546+ .arrowheadPath {2547+ fill: ${e.arrowheadColor};2548+ }2549+2550+ .edgePath .path {2551+ stroke: ${e.lineColor};2552+ stroke-width: 1.5px;2553+ }2554+2555+ .flowchart-link {2556+ stroke: ${e.lineColor};2557+ fill: none;2558+ }2559+2560+ .edgeLabel {2561+ background-color: ${e.edgeLabelBackground};2562+ rect {2563+ opacity: 0.5;2564+ }2565+ text-align: center;2566+ }2567+2568+ .cluster rect {2569+ }2570+2571+ .cluster text {2572+ fill: ${e.titleColor};2573+ }2574+2575+ div.mermaidTooltip {2576+ position: absolute;2577+ text-align: center;2578+ max-width: 200px;2579+ padding: 2px;2580+ font-family: ${e.fontFamily};2581+ font-size: 12px;2582+ background: ${e.tertiaryColor};2583+ border: 1px solid ${e.border2};2584+ border-radius: 2px;2585+ pointer-events: none;2586+ z-index: 100;2587+ }2588+2589+ .task-type-0, .section-type-0 {2590+ ${e.fillType0?`fill: ${e.fillType0}`:``};2591+ }2592+ .task-type-1, .section-type-1 {2593+ ${e.fillType0?`fill: ${e.fillType1}`:``};2594+ }2595+ .task-type-2, .section-type-2 {2596+ ${e.fillType0?`fill: ${e.fillType2}`:``};2597+ }2598+ .task-type-3, .section-type-3 {2599+ ${e.fillType0?`fill: ${e.fillType3}`:``};2600+ }2601+ .task-type-4, .section-type-4 {2602+ ${e.fillType0?`fill: ${e.fillType4}`:``};2603+ }2604+ .task-type-5, .section-type-5 {2605+ ${e.fillType0?`fill: ${e.fillType5}`:``};2606+ }2607+ .task-type-6, .section-type-6 {2608+ ${e.fillType0?`fill: ${e.fillType6}`:``};2609+ }2610+ .task-type-7, .section-type-7 {2611+ ${e.fillType0?`fill: ${e.fillType7}`:``};2612+ }2613+2614+ .actor-0 {2615+ ${e.actor0?`fill: ${e.actor0}`:``};2616+ }2617+ .actor-1 {2618+ ${e.actor1?`fill: ${e.actor1}`:``};2619+ }2620+ .actor-2 {2621+ ${e.actor2?`fill: ${e.actor2}`:``};2622+ }2623+ .actor-3 {2624+ ${e.actor3?`fill: ${e.actor3}`:``};2625+ }2626+ .actor-4 {2627+ ${e.actor4?`fill: ${e.actor4}`:``};2628+ }2629+ .actor-5 {2630+ ${e.actor5?`fill: ${e.actor5}`:``};2631+ }2632+ ${UL()}2633+`,`getStyles`),P6=p(function(e,t){return XI(e,t)},`drawRect`),wct=p(function(e,t){let n=e.append(`circle`).attr(`cx`,t.cx).attr(`cy`,t.cy).attr(`class`,`face`).attr(`r`,15).attr(`stroke-width`,2).attr(`overflow`,`visible`),r=e.append(`g`);r.append(`circle`).attr(`cx`,t.cx-5).attr(`cy`,t.cy-5).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`),r.append(`circle`).attr(`cx`,t.cx+5).attr(`cy`,t.cy-5).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`);function i(e){let n=mf().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(15/2).outerRadius(15/2.2);e.append(`path`).attr(`class`,`mouth`).attr(`d`,n).attr(`transform`,`translate(`+t.cx+`,`+(t.cy+2)+`)`)}p(i,`smile`);function a(e){let n=mf().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(15/2).outerRadius(15/2.2);e.append(`path`).attr(`class`,`mouth`).attr(`d`,n).attr(`transform`,`translate(`+t.cx+`,`+(t.cy+7)+`)`)}p(a,`sad`);function o(e){e.append(`line`).attr(`class`,`mouth`).attr(`stroke`,2).attr(`x1`,t.cx-5).attr(`y1`,t.cy+7).attr(`x2`,t.cx+5).attr(`y2`,t.cy+7).attr(`class`,`mouth`).attr(`stroke-width`,`1px`).attr(`stroke`,`#666`)}return p(o,`ambivalent`),t.score>3?i(r):t.score<3?a(r):o(r),n},`drawFace`),F6=p(function(e,t){let n=e.append(`circle`);return n.attr(`cx`,t.cx),n.attr(`cy`,t.cy),n.attr(`class`,`actor-`+t.pos),n.attr(`fill`,t.fill),n.attr(`stroke`,t.stroke),n.attr(`r`,t.r),n.class!==void 0&&n.attr(`class`,n.class),t.title!==void 0&&n.append(`title`).text(t.title),n},`drawCircle`),I6=p(function(e,t){return pHe(e,t)},`drawText`),Tct=p(function(e,t){function n(e,t,n,r,i){return e+`,`+t+` `+(e+n)+`,`+t+` `+(e+n)+`,`+(t+r-i)+` `+(e+n-i*1.2)+`,`+(t+r)+` `+e+`,`+(t+r)}p(n,`genPoints`);let r=e.append(`polygon`);r.attr(`points`,n(t.x,t.y,50,20,7)),r.attr(`class`,`labelBox`),t.y+=t.labelMargin,t.x+=.5*t.labelMargin,I6(e,t)},`drawLabel`),Ect=p(function(e,t,n){let r=e.append(`g`),i=eL();i.x=t.x,i.y=t.y,i.fill=t.fill,i.width=n.width*t.taskCount+n.diagramMarginX*(t.taskCount-1),i.height=n.height,i.class=`journey-section section-type-`+t.num,i.rx=3,i.ry=3,P6(r,i),R6(n)(t.text,r,i.x,i.y,i.width,i.height,{class:`journey-section section-type-`+t.num},n,t.colour)},`drawSection`),L6=-1,Dct=p(function(e,t,n,r){let i=t.x+n.width/2,a=e.append(`g`);L6++,a.append(`line`).attr(`id`,r+`-task`+L6).attr(`x1`,i).attr(`y1`,t.y).attr(`x2`,i).attr(`y2`,450).attr(`class`,`task-line`).attr(`stroke-width`,`1px`).attr(`stroke-dasharray`,`4 2`).attr(`stroke`,`#666`),wct(a,{cx:i,cy:300+(5-t.score)*30,score:t.score});let o=eL();o.x=t.x,o.y=t.y,o.fill=t.fill,o.width=n.width,o.height=n.height,o.class=`task task-type-`+t.num,o.rx=3,o.ry=3,P6(a,o);let s=t.x+14;t.people.forEach(e=>{let n=t.actors[e].color,r={cx:s,cy:t.y,r:7,fill:n,stroke:`#000`,title:e,pos:t.actors[e].position};F6(a,r),s+=10}),R6(n)(t.task,a,o.x,o.y,o.width,o.height,{class:`task`},n,t.colour)},`drawTask`),Oct=p(function(e,t){ZI(e,t)},`drawBackgroundRect`),R6=(function(){function e(e,t,n,i,a,o,s,l){r(t.append(`text`).attr(`x`,n+a/2).attr(`y`,i+o/2+5).style(`font-color`,l).style(`text-anchor`,`middle`).text(e),s)}p(e,`byText`);function t(e,t,n,i,a,o,s,l,u){let{taskFontSize:d,taskFontFamily:f}=l,p=e.split(/<br\s*\/?>/gi);for(let e=0;e<p.length;e++){let l=e*d-d*(p.length-1)/2,m=t.append(`text`).attr(`x`,n+a/2).attr(`y`,i).attr(`fill`,u).style(`text-anchor`,`middle`).style(`font-size`,d).style(`font-family`,f);m.append(`tspan`).attr(`x`,n+a/2).attr(`dy`,l).text(p[e]),m.attr(`y`,i+o/2).attr(`dominant-baseline`,`central`).attr(`alignment-baseline`,`central`),r(m,s)}}p(t,`byTspan`);function n(e,n,i,a,o,s,l,u){let d=n.append(`switch`),f=d.append(`foreignObject`).attr(`x`,i).attr(`y`,a).attr(`width`,o).attr(`height`,s).attr(`position`,`fixed`).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`);f.append(`div`).attr(`class`,`label`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).text(e),t(e,d,i,a,o,s,l,u),r(f,l)}p(n,`byFo`);function r(e,t){for(let n in t)n in t&&e.attr(n,t[n])}return p(r,`_setTextAttrs`),function(r){return r.textPlacement===`fo`?n:r.textPlacement===`old`?e:t}})(),z6={drawRect:P6,drawCircle:F6,drawSection:Ect,drawText:I6,drawLabel:Tct,drawTask:Dct,drawBackgroundRect:Oct,initGraphics:p(function(e,t){L6=-1,e.append(`defs`).append(`marker`).attr(`id`,t+`-arrowhead`).attr(`refX`,5).attr(`refY`,2).attr(`markerWidth`,6).attr(`markerHeight`,4).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0,0 V 4 L6,2 Z`)},`initGraphics`)},kct=p(function(e){Object.keys(e).forEach(function(t){H6[t]=e[t]})},`setConf`),B6={},V6=0,p(mct,`drawActorLegend`),H6=Z().journey,U6=0,Act=p(function(e,t,n,r){let i=Z(),a=i.journey.titleColor,o=i.journey.titleFontSize,s=i.journey.titleFontFamily,l=i.securityLevel,u;l===`sandbox`&&(u=$c(`#i`+t));let d=$c(l===`sandbox`?u.nodes()[0].contentDocument.body:`body`);W6.init();let f=d.select(`#`+t);z6.initGraphics(f,t);let p=r.db.getTasks(),m=r.db.getDiagramTitle(),h=r.db.getActors();for(let e in B6)delete B6[e];let g=0;h.forEach(e=>{B6[e]={color:H6.actorColours[g%H6.actorColours.length],position:g},g++}),mct(f),U6=H6.leftMargin+V6,W6.insert(0,0,U6,Object.keys(B6).length*50),jct(f,p,0,t);let _=W6.getBounds();m&&f.append(`text`).text(m).attr(`x`,U6).attr(`font-size`,o).attr(`font-weight`,`bold`).attr(`y`,25).attr(`fill`,a).attr(`font-family`,s);let v=_.stopy-_.starty+2*H6.diagramMarginY,y=U6+_.stopx+2*H6.diagramMarginX;Hs(f,v,y,H6.useMaxWidth),f.append(`line`).attr(`x1`,U6).attr(`y1`,H6.height*4).attr(`x2`,y-U6-4).attr(`y2`,H6.height*4).attr(`stroke-width`,4).attr(`stroke`,`black`).attr(`marker-end`,`url(#`+t+`-arrowhead)`);let b=m?70:0;f.attr(`viewBox`,`${_.startx} -25 ${y} ${v+b}`),f.attr(`preserveAspectRatio`,`xMinYMin meet`),f.attr(`height`,v+b+25)},`draw`),W6={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:p(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},`init`),updateVal:p(function(e,t,n,r){e[t]=e[t]===void 0?n:r(n,e[t])},`updateVal`),updateBounds:p(function(e,t,n,r){let i=Z().journey,a=this,o=0;function s(s){return p(function(l){o++;let u=a.sequenceItems.length-o+1;a.updateVal(l,`starty`,t-u*i.boxMargin,Math.min),a.updateVal(l,`stopy`,r+u*i.boxMargin,Math.max),a.updateVal(W6.data,`startx`,e-u*i.boxMargin,Math.min),a.updateVal(W6.data,`stopx`,n+u*i.boxMargin,Math.max),s!==`activation`&&(a.updateVal(l,`startx`,e-u*i.boxMargin,Math.min),a.updateVal(l,`stopx`,n+u*i.boxMargin,Math.max),a.updateVal(W6.data,`starty`,t-u*i.boxMargin,Math.min),a.updateVal(W6.data,`stopy`,r+u*i.boxMargin,Math.max))},`updateItemBounds`)}p(s,`updateFn`),this.sequenceItems.forEach(s())},`updateBounds`),insert:p(function(e,t,n,r){let i=Math.min(e,n),a=Math.max(e,n),o=Math.min(t,r),s=Math.max(t,r);this.updateVal(W6.data,`startx`,i,Math.min),this.updateVal(W6.data,`starty`,o,Math.min),this.updateVal(W6.data,`stopx`,a,Math.max),this.updateVal(W6.data,`stopy`,s,Math.max),this.updateBounds(i,o,a,s)},`insert`),bumpVerticalPos:p(function(e){this.verticalPos+=e,this.data.stopy=this.verticalPos},`bumpVerticalPos`),getVerticalPos:p(function(){return this.verticalPos},`getVerticalPos`),getBounds:p(function(){return this.data},`getBounds`)},G6=H6.sectionFills,K6=H6.sectionColours,jct=p(function(e,t,n,r){let i=Z().journey,a=``,o=n+(i.height*2+i.diagramMarginY),s=0,l=`#CCC`,u=`black`,d=0;for(let[n,f]of t.entries()){if(a!==f.section){l=G6[s%G6.length],d=s%G6.length,u=K6[s%K6.length];let r=0,o=f.section;for(let e=n;e<t.length&&t[e].section==o;e++)r+=1;let p={x:n*i.taskMargin+n*i.width+U6,y:50,text:f.section,fill:l,num:d,colour:u,taskCount:r};z6.drawSection(e,p,i),a=f.section,s++}let p=f.people.reduce((e,t)=>(B6[t]&&(e[t]=B6[t]),e),{});f.x=n*i.taskMargin+n*i.width+U6,f.y=o,f.width=i.diagramMarginX,f.height=i.diagramMarginY,f.colour=u,f.fill=l,f.num=d,f.actors=p,z6.drawTask(e,f,i,r),W6.insert(f.x,f.y,f.x+f.width+i.taskMargin,450)}},`drawTasks`),q6={setConf:kct,draw:Act},Mct={parser:hct,db:N6,renderer:q6,styles:Cct,init:p(e=>{q6.setConf(e.journey),N6.clear()},`init`)}})),Pct=l({diagram:()=>alt});function J6(e,t){e.each(function(){var e=$c(this),n=e.text().split(/(\s+|<br>)/).reverse(),r,i=[],a=1.1,o=e.attr(`y`),s=parseFloat(e.attr(`dy`)),l=e.text(null).append(`tspan`).attr(`x`,0).attr(`y`,o).attr(`dy`,s+`em`);for(let s=0;s<n.length;s++)r=n[n.length-1-s],i.push(r),l.text(i.join(` `).trim()),(l.node().getComputedTextLength()>t||r===`<br>`)&&(i.pop(),l.text(i.join(` `).trim()),i=r===`<br>`?[``]:[r],l=e.append(`tspan`).attr(`x`,0).attr(`y`,o).attr(`dy`,a+`em`).text(r))})}var Y6,Fct,X6,Z6,Q6,$6,e8,t8,n8,r8,i8,a8,o8,s8,c8,l8,u8,d8,f8,p8,Ict,m8,h8,Lct,Rct,g8,zct,Bct,_8,Vct,Hct,Uct,v8,y8,Wct,Gct,Kct,qct,b8,Jct,x8,Yct,Xct,S8,C8,Zct,w8,Qct,T8,$ct,E8,D8,O8,k8,elt,A8,tlt,nlt,rlt,ilt,alt,olt=o((()=>{yp(),rh(),dc(),S(),h(),_p(),Ne(),Y6=(function(){var e=p(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],r=[1,13],i=[1,14],a=[1,15],o=[1,16],s=[1,19],l=[1,20],u={trace:p(function(){},`trace`),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:`error`,6:`EOF`,7:`timeline`,8:`timeline_lr`,9:`timeline_td`,11:`SPACE`,13:`NEWLINE`,14:`title`,15:`acc_title`,16:`acc_title_value`,17:`acc_descr`,18:`acc_descr_value`,19:`acc_descr_multiline_value`,20:`section`,23:`period`,24:`event`},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:p(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 3:r.setDirection(`LR`);break;case 4:r.setDirection(`TD`);break;case 5:this.$=[];break;case 6:a[s-1].push(a[s]),this.$=a[s-1];break;case 7:case 8:this.$=a[s];break;case 9:case 10:this.$=[];break;case 11:r.getCommonDb().setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 12:this.$=a[s].trim(),r.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=a[s].trim(),r.getCommonDb().setAccDescription(this.$);break;case 15:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 18:r.addTask(a[s],0,``),this.$=a[s];break;case 19:r.addEvent(a[s].substr(2)),this.$=a[s]}},`anonymous`),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:r,17:i,19:a,20:o,21:17,22:18,23:s,24:l},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:r,17:i,19:a,20:o,21:17,22:18,23:s,24:l},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:p(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:p(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,l=0,u=0,d=0,f=2,m=1,h=a.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(_.yy[v]=this.yy[v]);g.setInput(e,_.yy),_.yy.lexer=g,_.yy.parser=this,g.yylloc===void 0&&(g.yylloc={});var y=g.yylloc;a.push(y);var b=g.options&&g.options.ranges;this.parseError=typeof _.yy.parseError==`function`?_.yy.parseError:Object.getPrototypeOf(this).parseError;function x(e){n.length-=2*e,i.length-=e,a.length-=e}p(x,`popStack`);function S(){var e=r.pop()||g.lex()||m;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}p(S,`lex`);for(var C,w,T,E,D,O={},k,A,j,M;;){if(T=n[n.length-1],this.defaultActions[T]?E=this.defaultActions[T]:(C??=S(),E=o[T]&&o[T][C]),E===void 0||!E.length||!E[0]){var N=``;for(k in M=[],o[T])this.terminals_[k]&&k>f&&M.push(`'`+this.terminals_[k]+`'`);N=g.showPosition?`Parse error on line `+(l+1)+`:2634+`+g.showPosition()+`2635+Expecting `+M.join(`, `)+`, got '`+(this.terminals_[C]||C)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(C==m?`end of input`:`'`+(this.terminals_[C]||C)+`'`),this.parseError(N,{text:g.match,token:this.terminals_[C]||C,line:g.yylineno,loc:y,expected:M})}if(E[0]instanceof Array&&E.length>1)throw Error(`Parse Error: multiple actions possible at state: `+T+`, token: `+C);switch(E[0]){case 1:n.push(C),i.push(g.yytext),a.push(g.yylloc),n.push(E[1]),C=null,w?(C=w,w=null):(u=g.yyleng,s=g.yytext,l=g.yylineno,y=g.yylloc,d>0&&d--);break;case 2:if(A=this.productions_[E[1]][1],O.$=i[i.length-A],O._$={first_line:a[a.length-(A||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(A||1)].first_column,last_column:a[a.length-1].last_column},b&&(O._$.range=[a[a.length-(A||1)].range[0],a[a.length-1].range[1]]),D=this.performAction.apply(O,[s,u,l,_.yy,E[1],i,a].concat(h)),D!==void 0)return D;A&&(n=n.slice(0,-1*A*2),i=i.slice(0,-1*A),a=a.slice(0,-1*A)),n.push(this.productions_[E[1]][0]),i.push(O.$),a.push(O._$),j=o[n[n.length-2]][n[n.length-1]],n.push(j);break;case 3:return!0}}return!0},`parse`)};u.lexer=(function(){return{EOF:1,parseError:p(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:p(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:p(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:p(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:p(function(){return this._more=!0,this},`more`),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).2636+`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:p(function(e){this.unput(this.match.slice(e))},`less`),pastInput:p(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:p(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:p(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`2637+`+t+`^`},`showPosition`),test_match:p(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.2638+`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:p(function(){return this.next()||this.lex()},`lex`),begin:p(function(e){this.conditionStack.push(e)},`begin`),popState:p(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:p(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:p(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:p(function(e){this.begin(e)},`pushState`),stateStackSize:p(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:p(function(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin(`acc_title`),15;case 10:return this.popState(),`acc_title_value`;case 11:return this.begin(`acc_descr`),17;case 12:return this.popState(),`acc_descr_value`;case 13:this.begin(`acc_descr_multiline`);break;case 14:this.popState();break;case 15:return`acc_descr_multiline_value`;case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return`INVALID`}},`anonymous`),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}}})();function d(){this.yy={}}return p(d,`Parser`),d.prototype=u,u.Parser=d,new d})(),Y6.parser=Y6,Fct=Y6,X6={},m(X6,{addEvent:()=>d8,addSection:()=>s8,addTask:()=>u8,addTaskOrg:()=>f8,clear:()=>i8,default:()=>Ict,getCommonDb:()=>r8,getDirection:()=>o8,getSections:()=>c8,getTasks:()=>l8,setDirection:()=>a8}),Z6=``,Q6=0,$6=`LR`,e8=[],t8=[],n8=[],r8=p(()=>Gs,`getCommonDb`),i8=p(function(){e8.length=0,t8.length=0,Z6=``,n8.length=0,$6=`LR`,Xs()},`clear`),a8=p(function(e){$6=e},`setDirection`),o8=p(function(){return $6},`getDirection`),s8=p(function(e){Z6=e,e8.push(e)},`addSection`),c8=p(function(){return e8},`getSections`),l8=p(function(){let e=p8(),t=0;for(;!e&&t<100;)e=p8(),t++;return t8.push(...n8),t8},`getTasks`),u8=p(function(e,t,n){let r={id:Q6++,section:Z6,type:Z6,task:e,score:t||0,events:n?[n]:[]};n8.push(r)},`addTask`),d8=p(function(e){n8.find(e=>e.id===Q6-1).events.push(e)},`addEvent`),f8=p(function(e){let t={section:Z6,type:Z6,description:e,task:e,classes:[]};t8.push(t)},`addTaskOrg`),p8=p(function(){let e=p(function(e){return n8[e].processed},`compileTask`),t=!0;for(let[n,r]of n8.entries())e(n),t&&=r.processed;return t},`compileTasks`),Ict={clear:i8,getCommonDb:r8,getDirection:o8,setDirection:a8,addSection:s8,getSections:c8,getTasks:l8,addTask:u8,addTaskOrg:f8,addEvent:d8},m8=0,h8=p(function(e,t){let n=e.append(`rect`);return n.attr(`x`,t.x),n.attr(`y`,t.y),n.attr(`fill`,t.fill),n.attr(`stroke`,t.stroke),n.attr(`width`,t.width),n.attr(`height`,t.height),n.attr(`rx`,t.rx),n.attr(`ry`,t.ry),t.class!==void 0&&n.attr(`class`,t.class),n},`drawRect`),Lct=p(function(e,t){let n=e.append(`circle`).attr(`cx`,t.cx).attr(`cy`,t.cy).attr(`class`,`face`).attr(`r`,15).attr(`stroke-width`,2).attr(`overflow`,`visible`),r=e.append(`g`);r.append(`circle`).attr(`cx`,t.cx-5).attr(`cy`,t.cy-5).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`),r.append(`circle`).attr(`cx`,t.cx+5).attr(`cy`,t.cy-5).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`);function i(e){let n=mf().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(15/2).outerRadius(15/2.2);e.append(`path`).attr(`class`,`mouth`).attr(`d`,n).attr(`transform`,`translate(`+t.cx+`,`+(t.cy+2)+`)`)}p(i,`smile`);function a(e){let n=mf().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(15/2).outerRadius(15/2.2);e.append(`path`).attr(`class`,`mouth`).attr(`d`,n).attr(`transform`,`translate(`+t.cx+`,`+(t.cy+7)+`)`)}p(a,`sad`);function o(e){e.append(`line`).attr(`class`,`mouth`).attr(`stroke`,2).attr(`x1`,t.cx-5).attr(`y1`,t.cy+7).attr(`x2`,t.cx+5).attr(`y2`,t.cy+7).attr(`class`,`mouth`).attr(`stroke-width`,`1px`).attr(`stroke`,`#666`)}return p(o,`ambivalent`),t.score>3?i(r):t.score<3?a(r):o(r),n},`drawFace`),Rct=p(function(e,t){let n=e.append(`circle`);return n.attr(`cx`,t.cx),n.attr(`cy`,t.cy),n.attr(`class`,`actor-`+t.pos),n.attr(`fill`,t.fill),n.attr(`stroke`,t.stroke),n.attr(`r`,t.r),n.class!==void 0&&n.attr(`class`,n.class),t.title!==void 0&&n.append(`title`).text(t.title),n},`drawCircle`),g8=p(function(e,t){let n=t.text.replace(/<br\s*\/?>/gi,` `),r=e.append(`text`);r.attr(`x`,t.x),r.attr(`y`,t.y),r.attr(`class`,`legend`),r.style(`text-anchor`,t.anchor),t.class!==void 0&&r.attr(`class`,t.class);let i=r.append(`tspan`);return i.attr(`x`,t.x+t.textMargin*2),i.text(n),r},`drawText`),zct=p(function(e,t){function n(e,t,n,r,i){return e+`,`+t+` `+(e+n)+`,`+t+` `+(e+n)+`,`+(t+r-i)+` `+(e+n-i*1.2)+`,`+(t+r)+` `+e+`,`+(t+r)}p(n,`genPoints`);let r=e.append(`polygon`);r.attr(`points`,n(t.x,t.y,50,20,7)),r.attr(`class`,`labelBox`),t.y+=t.labelMargin,t.x+=.5*t.labelMargin,g8(e,t)},`drawLabel`),Bct=p(function(e,t,n){let r=e.append(`g`),i=v8();i.x=t.x,i.y=t.y,i.fill=t.fill,i.width=n.width,i.height=n.height,i.class=`journey-section section-type-`+t.num,i.rx=3,i.ry=3,h8(r,i),y8(n)(t.text,r,i.x,i.y,i.width,i.height,{class:`journey-section section-type-`+t.num},n,t.colour)},`drawSection`),_8=-1,Vct=p(function(e,t,n,r){let i=t.x+n.width/2,a=e.append(`g`);_8++,a.append(`line`).attr(`id`,r+`-task`+_8).attr(`x1`,i).attr(`y1`,t.y).attr(`x2`,i).attr(`y2`,450).attr(`class`,`task-line`).attr(`stroke-width`,`1px`).attr(`stroke-dasharray`,`4 2`).attr(`stroke`,`#666`),Lct(a,{cx:i,cy:300+(5-t.score)*30,score:t.score});let o=v8();o.x=t.x,o.y=t.y,o.fill=t.fill,o.width=n.width,o.height=n.height,o.class=`task task-type-`+t.num,o.rx=3,o.ry=3,h8(a,o),y8(n)(t.task,a,o.x,o.y,o.width,o.height,{class:`task`},n,t.colour)},`drawTask`),Hct=p(function(e,t){h8(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:`rect`}).lower()},`drawBackgroundRect`),Uct=p(function(){return{x:0,y:0,fill:void 0,"text-anchor":`start`,width:100,height:100,textMargin:0,rx:0,ry:0}},`getTextObj`),v8=p(function(){return{x:0,y:0,width:100,anchor:`start`,height:100,rx:0,ry:0}},`getNoteRect`),y8=(function(){function e(e,t,n,i,a,o,s,l){r(t.append(`text`).attr(`x`,n+a/2).attr(`y`,i+o/2+5).style(`font-color`,l).style(`text-anchor`,`middle`).text(e),s)}p(e,`byText`);function t(e,t,n,i,a,o,s,l,u){let{taskFontSize:d,taskFontFamily:f}=l,p=e.split(/<br\s*\/?>/gi);for(let e=0;e<p.length;e++){let l=e*d-d*(p.length-1)/2,m=t.append(`text`).attr(`x`,n+a/2).attr(`y`,i).attr(`fill`,u).style(`text-anchor`,`middle`).style(`font-size`,d).style(`font-family`,f);m.append(`tspan`).attr(`x`,n+a/2).attr(`dy`,l).text(p[e]),m.attr(`y`,i+o/2).attr(`dominant-baseline`,`central`).attr(`alignment-baseline`,`central`),r(m,s)}}p(t,`byTspan`);function n(e,n,i,a,o,s,l,u){let d=n.append(`switch`),f=d.append(`foreignObject`).attr(`x`,i).attr(`y`,a).attr(`width`,o).attr(`height`,s).attr(`position`,`fixed`).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`);f.append(`div`).attr(`class`,`label`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).text(e),t(e,d,i,a,o,s,l,u),r(f,l)}p(n,`byFo`);function r(e,t){for(let n in t)n in t&&e.attr(n,t[n])}return p(r,`_setTextAttrs`),function(r){return r.textPlacement===`fo`?n:r.textPlacement===`old`?e:t}})(),Wct=p(function(e,t){m8=0,_8=-1,e.append(`defs`).append(`marker`).attr(`id`,t+`-arrowhead`).attr(`refX`,5).attr(`refY`,2).attr(`markerWidth`,6).attr(`markerHeight`,4).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0,0 V 4 L6,2 Z`)},`initGraphics`),p(J6,`wrap`),Gct=p(function(e,t,n,r,i,a=!1){let{theme:o,look:s}=r,l=o?.includes(`redux`),u=n%(r?.themeVariables?.THEME_COLOR_LIMIT??12)-1,d=e.append(`g`);t.section=u,d.attr(`class`,(t.class?t.class+` `:``)+`timeline-node `+(`section-`+u));let f=d.append(`g`),p=d.append(`g`),m=p.append(`text`).text(t.descr).attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).call(J6,t.width).node().getBBox(),h=r.fontSize?.replace?r.fontSize.replace(`px`,``):r.fontSize;if(t.height=m.height+h*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width+=2*t.padding,p.attr(`transform`,`translate(`+t.width/2+`, `+t.padding/2+`)`),l&&p.attr(`transform`,`translate(${t.width/2}, ${a?t.padding/2+3:t.padding})`),qct(f,t,u,i,r),s===`neo`&&(d.attr(`data-look`,`neo`),l)){let t=o.includes(`dark`),n=$c(e.node()?.ownerSVGElement??e.node()),r=n.attr(`id`)??``,i=r?`${r}-drop-shadow`:`drop-shadow`;if(n.select(`#${i}`).empty()){let e=n.select(`defs`);(e.empty()?n.append(`defs`):e).append(`filter`).attr(`id`,i).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,t?`0.2`:`0.06`).attr(`flood-color`,t?`#FFFFFF`:`#000000`)}}return t},`drawNode`),Kct=p(function(e,t,n){let r=e.append(`g`),i=r.append(`text`).text(t.descr).attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).call(J6,t.width).node().getBBox(),a=n.fontSize?.replace?n.fontSize.replace(`px`,``):n.fontSize;return r.remove(),i.height+a*1.1*.5+t.padding},`getVirtualNodeHeight`),qct=p(function(e,t,n,r,i){let{theme:a}=i,o=a?.includes(`redux`)?0:5,s=o>0?`M0 ${t.height-5} v${-t.height+10} q0,-${o},${o},-${o} h${t.width-10} q${o},0,${o},${o} v${t.height-5} H0 Z`:`M0 ${t.height-5} v${-(t.height-5)} h${t.width} v${t.height} H0 Z`;e.append(`path`).attr(`id`,r+`-node-`+m8++).attr(`class`,`node-bkg node-`+t.type).attr(`d`,s),a?.includes(`redux`)||e.append(`line`).attr(`class`,`node-line-`+n).attr(`x1`,0).attr(`y1`,t.height).attr(`x2`,t.width).attr(`y2`,t.height)},`defaultBkg`),b8={drawRect:h8,drawCircle:Rct,drawSection:Bct,drawText:g8,drawLabel:zct,drawTask:Vct,drawBackgroundRect:Hct,getTextObj:Uct,getNoteRect:v8,initGraphics:Wct,drawNode:Gct,getVirtualNodeHeight:Kct},Jct=p(function(e,t,n,r){let i=Z(),{look:a,theme:o,themeVariables:s}=i,{useGradient:l,gradientStart:u,gradientStop:d}=s,f=i.timeline?.leftMargin??50;y.debug(`timeline`,r.db);let p=i.securityLevel,m;p===`sandbox`&&(m=$c(`#i`+t));let h=$c(p===`sandbox`?m.nodes()[0].contentDocument.body:`body`).select(`#`+t);h.append(`g`);let g=r.db.getTasks(),_=r.db.getCommonDb().getDiagramTitle();y.debug(`task`,g),b8.initGraphics(h,t);let v=r.db.getSections();y.debug(`sections`,v);let b=0,x=0,S=0,C=0,w=50+f,T=50;C=50;let E=0,D=!0;v.forEach(function(e){let t={number:E,descr:e,section:E,width:150,padding:20,maxHeight:b},n=b8.getVirtualNodeHeight(h,t,i);y.debug(`sectionHeight before draw`,n),b=Math.max(b,n+20)});let O=0,k=0;y.debug(`tasks.length`,g.length);for(let[e,t]of g.entries()){let n={number:e,descr:t,section:t.section,width:150,padding:20,maxHeight:x},r=b8.getVirtualNodeHeight(h,n,i);y.debug(`taskHeight before draw`,r),x=Math.max(x,r+20),O=Math.max(O,t.events.length);let a=0;for(let e of t.events){let n={descr:e,section:t.section,number:t.section,width:150,padding:20,maxHeight:50};a+=b8.getVirtualNodeHeight(h,n,i)}t.events.length>0&&(a+=(t.events.length-1)*10),k=Math.max(k,a)}y.debug(`maxSectionHeight before draw`,b),y.debug(`maxTaskHeight before draw`,x),v&&v.length>0?v.forEach(e=>{let n=g.filter(t=>t.section===e),r={number:E,descr:e,section:E,width:200*Math.max(n.length,1)-50,padding:20,maxHeight:b};y.debug(`sectionNode`,r);let a=h.append(`g`),o=b8.drawNode(a,r,E,i,t);y.debug(`sectionNode output`,o),a.attr(`transform`,`translate(${w}, ${C})`),T+=b+50,n.length>0&&x8(h,n,E,w,T,x,i,O,k,b,!1,t),w+=200*Math.max(n.length,1),T=C,E++}):(D=!1,x8(h,g,E,w,T,x,i,O,k,b,!0,t));let A=h.node().getBBox();if(y.debug(`bounds`,A),_&&h.append(`text`).text(_).attr(`x`,a===`neo`?A.x*2+f:A.width/2-f).attr(`font-size`,`4ex`).attr(`font-weight`,`bold`).attr(`y`,20),S=D?b+x+150:x+100,h.append(`g`).attr(`class`,`lineWrapper`).append(`line`).attr(`x1`,f).attr(`y1`,S).attr(`x2`,A.width+3*f).attr(`y2`,S).attr(`stroke-width`,4).attr(`stroke`,`black`).attr(`marker-end`,`url(#${t}-arrowhead)`),a===`neo`&&l&&o!==`neutral`){let e=h.select(`defs`),t=(e.empty()?h.append(`defs`):e).append(`linearGradient`).attr(`id`,h.attr(`id`)+`-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);t.append(`stop`).attr(`offset`,`0%`).attr(`stop-color`,u).attr(`stop-opacity`,1),t.append(`stop`).attr(`offset`,`100%`).attr(`stop-color`,d).attr(`stop-opacity`,1)}Us(void 0,h,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)},`draw`),x8=p(function(e,t,n,r,i,a,o,s,l,u,d,f){for(let s of t){let t={descr:s.task,section:n,number:n,width:150,padding:20,maxHeight:a};y.debug(`taskNode`,t);let u=e.append(`g`).attr(`class`,`taskWrapper`),p=b8.drawNode(u,t,n,o,f).height;if(y.debug(`taskHeight after draw`,p),u.attr(`transform`,`translate(${r}, ${i})`),a=Math.max(a,p),s.events){let t=e.append(`g`).attr(`class`,`lineWrapper`),u=a;i+=100,u+=Yct(e,s.events,n,r,i,o,f),i-=100,t.append(`line`).attr(`x1`,r+95).attr(`y1`,i+a).attr(`x2`,r+95).attr(`y2`,i+a+100+l+100).attr(`stroke-width`,2).attr(`stroke`,`black`).attr(`marker-end`,`url(#${f}-arrowhead)`).attr(`stroke-dasharray`,`5,5`)}r+=200,d&&!o.timeline?.disableMulticolor&&n++}i-=10},`drawTasks`),Yct=p(function(e,t,n,r,i,a,o){let s=0,l=i;i+=100;for(let l of t){let t={descr:l,section:n,number:n,width:150,padding:20,maxHeight:50};y.debug(`eventNode`,t);let u=e.append(`g`).attr(`class`,`eventWrapper`),d=b8.drawNode(u,t,n,a,o,!0).height;s+=d,u.attr(`transform`,`translate(${r}, ${i})`),i=i+10+d}return i=l,s},`drawEvents`),Xct={setConf:p(()=>{},`setConf`),draw:Jct},S8=200,C8=5,Zct=S8+C8*2,w8=S8+100,Qct=w8+C8*2,T8=10,$ct=0,E8=20,D8=20,O8=30,k8=50,elt=p(function(e,t,n,r){let i=Z(),a=i.timeline?.leftMargin??50;y.debug(`timeline`,r.db);let o=vp(t);o.append(`g`);let s=r.db.getTasks(),l=r.db.getCommonDb().getDiagramTitle();y.debug(`task`,s),b8.initGraphics(o);let u=r.db.getSections();y.debug(`sections`,u);let d=0,f=0,p=50+a,m=50,h=m,g=p,_=Zct+D8,v=Qct+k8,b=g+_,x=0,S=u&&u.length>0,C=S?b:p+_,w=Math.max(50,_+v-C8*2);u.forEach(function(e){let t={number:x,descr:e,section:x,width:w,padding:C8,maxHeight:d},n=b8.getVirtualNodeHeight(o,t,i);y.debug(`sectionHeight before draw`,n),d=Math.max(d,n)});let T=0;y.debug(`tasks.length`,s.length);for(let[e,t]of s.entries()){let n={number:e,descr:t,section:t.section,width:S8,padding:C8,maxHeight:f},r=b8.getVirtualNodeHeight(o,n,i);y.debug(`taskHeight before draw`,r),f=Math.max(f,r);let a=0;for(let e of t.events){let n={descr:e,section:t.section,number:t.section,width:w8,padding:C8,maxHeight:50};a+=b8.getVirtualNodeHeight(o,n,i)}t.events.length>0&&(a+=(t.events.length-1)*T8),T=Math.max(T,a)+$ct}y.debug(`maxSectionHeight before draw`,d),y.debug(`maxTaskHeight before draw`,f);let E=Math.max(f,T)+O8;S?u.forEach(e=>{let t=s.filter(t=>t.section===e),n={number:x,descr:e,section:x,width:w,padding:C8,maxHeight:d};y.debug(`sectionNode`,n);let r=o.append(`g`),a=b8.drawNode(r,n,x,i);y.debug(`sectionNode output`,a);let l=C-_;r.attr(`transform`,`translate(${l}, ${m})`);let u=m+a.height+E8;t.length>0&&A8(o,t,x,C,u,f,i,E,!1);let p=t.length,h=a.height+E8+E*Math.max(p,1)-(p>0?O8*2:0);m+=h,x++}):A8(o,s,x,C,m,f,i,E,!0);let D=o.node()?.getBBox();if(!D)throw Error(`bbox not found`);if(y.debug(`bounds`,D),l){if(o.append(`text`).text(l).attr(`x`,D.width/2-a).attr(`font-size`,`4ex`).attr(`font-weight`,`bold`).attr(`y`,20),D=o.node()?.getBBox(),!D)throw Error(`bbox not found`);y.debug(`bounds after title`,D)}let[O]=$m(i.fontSize),k=(O??16)*2,A=(O??16)*.5+20,j=o.append(`g`).attr(`class`,`lineWrapper`);j.append(`line`).attr(`x1`,C).attr(`y1`,h-k).attr(`x2`,C).attr(`y2`,D.y+D.height+A).attr(`stroke-width`,4).attr(`stroke`,`black`).attr(`marker-end`,`url(#arrowhead)`),j.lower(),Us(void 0,o,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)},`draw`),A8=p(function(e,t,n,r,i,a,o,s,l){for(let u of t){let t={descr:u.task,section:n,number:n,width:S8,padding:C8,maxHeight:a};y.debug(`taskNode`,t);let d=e.append(`g`).attr(`class`,`taskWrapper`),f=b8.drawNode(d,t,n,o),p=f.height;y.debug(`taskHeight after draw`,p);let m=r-D8-f.width;if(d.attr(`transform`,`translate(${m}, ${i})`),a=Math.max(a,p),u.events&&u.events.length>0){let t=i,a=r+k8;tlt(e,u.events,n,r,a,t,o)}i+=s,l&&!o.timeline?.disableMulticolor&&n++}},`drawTasks`),tlt=p(function(e,t,n,r,i,a,o){let s=a;for(let a of t){let t={descr:a,section:n,number:n,width:w8,padding:C8,maxHeight:0};y.debug(`eventNode`,t);let l=e.append(`g`).attr(`class`,`eventWrapper`),u=b8.drawNode(l,t,n,o).height;l.attr(`transform`,`translate(${i}, ${s})`);let d=e.append(`g`).attr(`class`,`lineWrapper`),f=s+u/2;d.append(`line`).attr(`x1`,r).attr(`y1`,f).attr(`x2`,i).attr(`y2`,f).attr(`stroke-width`,2).attr(`stroke`,`black`).attr(`marker-end`,`url(#arrowhead)`).attr(`stroke-dasharray`,`5,5`),s=s+u+T8}return s-a},`drawEvents`),nlt={setConf:p(()=>{},`setConf`),draw:elt},rlt=p(e=>{let{theme:t}=ms(),n=t?.includes(`dark`),r=t?.includes(`color`),i=e.svgId?.replace(/^#/,``)??``,a=i?`url(#${i}-drop-shadow)`:e.dropShadow??`none`,o=``;for(let t=0;t<e.THEME_COLOR_LIMIT;t++){let i=`${17-3*t}`,s=r?e.borderColorArray[t]:e.mainBkg,l=r?e.borderColorArray[t]:e.nodeBorder;o+=`2639+ .section-${t-1} rect,2640+ .section-${t-1} path,2641+ .section-${t-1} circle {2642+ fill: ${n&&r?e.mainBkg:s};2643+ stroke: ${l};2644+ stroke-width: ${e.strokeWidth};2645+ filter: ${a};2646+ }2647+2648+ .section-${t-1} text {2649+ fill: ${e.nodeBorder};2650+ font-weight: ${e.fontWeight}2651+ }2652+2653+ .node-icon-${t-1} {2654+ font-size: 40px;2655+ color: ${e[`cScaleLabel`+t]};2656+ }2657+2658+ .section-edge-${t-1} {2659+ stroke: ${e[`cScale`+t]};2660+ }2661+2662+ .edge-depth-${t-1} {2663+ stroke-width: ${i};2664+ }2665+2666+ .section-${t-1} line {2667+ stroke: ${e[`cScaleInv`+t]};2668+ stroke-width: 3;2669+ }2670+2671+ .lineWrapper line {2672+ stroke: ${e.nodeBorder};2673+ stroke-width:${e.strokeWidth}2674+ }2675+2676+ .disabled,2677+ .disabled circle,2678+ .disabled text {2679+ fill: ${e.tertiaryColor??`lightgray`};2680+ }2681+2682+ .disabled text {2683+ fill: ${e.clusterBorder??`#efefef`};2684+ }2685+ `}return o},`genReduxSections`),ilt=p(e=>{let t=``;for(let t=0;t<e.THEME_COLOR_LIMIT;t++)e[`lineColor`+t]=e[`lineColor`+t]||e[`cScaleInv`+t],ye(e[`lineColor`+t])?e[`lineColor`+t]=V(e[`lineColor`+t],20):e[`lineColor`+t]=we(e[`lineColor`+t],20);for(let n=0;n<e.THEME_COLOR_LIMIT;n++){let r=``+(17-3*n);t+=`2686+ .section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} path {2687+ fill: ${e[`cScale`+n]};2688+ }2689+ .section-${n-1} text {2690+ fill: ${e[`cScaleLabel`+n]};2691+ }2692+ .node-icon-${n-1} {2693+ font-size: 40px;2694+ color: ${e[`cScaleLabel`+n]};2695+ }2696+ .section-edge-${n-1}{2697+ stroke: ${e[`cScale`+n]};2698+ }2699+ .edge-depth-${n-1}{2700+ stroke-width: ${r};2701+ }2702+ .section-${n-1} line {2703+ stroke: ${e[`cScaleInv`+n]} ;2704+ stroke-width: 3;2705+ }2706+2707+ .lineWrapper line{2708+ stroke: ${e[`cScaleLabel`+n]} ;2709+ }2710+2711+ .disabled, .disabled circle, .disabled text {2712+ fill: ${e.tertiaryColor??`lightgray`};2713+ }2714+ .disabled text {2715+ fill: ${e.clusterBorder??`#efefef`};2716+ }2717+ `}return t},`genSections`),alt={db:X6,renderer:{setConf:p(()=>{},`setConf`),draw:p((e,t,n,r)=>(r?.db?.getDirection?.()??`LR`)===`TD`?nlt.draw(e,t,n,r):Xct.draw(e,t,n,r),`draw`)},parser:Fct,styles:p(e=>{let{theme:t}=ms(),n=t?.includes(`redux`),r=t===`neutral`,i=e.svgId?.replace(/^#/,``)??``,a=``;if(e.useGradient&&i&&e.THEME_COLOR_LIMIT&&!r)for(let t=0;t<e.THEME_COLOR_LIMIT;t++)a+=`2718+ .section-${t-1}[data-look="neo"] rect,2719+ .section-${t-1}[data-look="neo"] path,2720+ .section-${t-1}[data-look="neo"] circle {2721+ fill: ${e.mainBkg};2722+ stroke: url(#${i}-gradient);2723+ stroke-width: 2;2724+ }2725+ .section-${t-1}[data-look="neo"] line {2726+ stroke: url(#${i}-gradient);2727+ stroke-width: 2;2728+ }`;return`2729+ .edge {2730+ stroke-width: 3;2731+ }2732+ ${n?rlt(e):ilt(e)}2733+ ${a}2734+ .section-root rect, .section-root path, .section-root circle {2735+ fill: ${e.git0};2736+ }2737+ .section-root text {2738+ fill: ${e.gitBranchLabel0};2739+ }2740+ .icon-container {2741+ height:100%;2742+ display: flex;2743+ justify-content: center;2744+ align-items: center;2745+ }2746+ .edge {2747+ fill: none;2748+ }2749+ .eventWrapper {2750+ filter: brightness(120%);2751+ }2752+`},`getStyles`)}}));function slt(e,t=0){return(j8[e[t+0]]+j8[e[t+1]]+j8[e[t+2]]+j8[e[t+3]]+`-`+j8[e[t+4]]+j8[e[t+5]]+`-`+j8[e[t+6]]+j8[e[t+7]]+`-`+j8[e[t+8]]+j8[e[t+9]]+`-`+j8[e[t+10]]+j8[e[t+11]]+j8[e[t+12]]+j8[e[t+13]]+j8[e[t+14]]+j8[e[t+15]]).toLowerCase()}var j8,clt=o((()=>{j8=[];for(let e=0;e<256;++e)j8.push((e+256).toString(16).slice(1))}));function llt(){return crypto.getRandomValues(ult)}var ult,dlt=o((()=>{ult=new Uint8Array(16)}));function flt(e,t,n){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():plt(e,t,n)}function plt(e,t,n){e||={};let r=e.random??e.rng?.()??llt();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return slt(r)}var mlt=o((()=>{dlt(),clt()})),hlt=o((()=>{clt(),dlt(),mlt()})),glt=l({diagram:()=>Clt}),M8,_lt,vlt,N8,ylt,blt,xlt,Slt,Clt,wlt=o((()=>{KL(),JL(),EI(),U_(),cv(),z_(),P_(),Op(),ig(),Gp(),rh(),dc(),S(),h(),hlt(),Ne(),M8=(function(){var e=p(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,4],n=[1,13],r=[1,12],i=[1,15],a=[1,16],o=[1,20],s=[1,19],l=[6,7,8],u=[1,26],d=[1,24],f=[1,25],m=[6,7,11],h=[1,6,13,15,16,19,22],g=[1,33],_=[1,34],v=[1,6,7,11,13,15,16,19,22],y={trace:p(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:`error`,6:`SPACELINE`,7:`NL`,8:`MINDMAP`,11:`EOF`,13:`SPACELIST`,15:`ICON`,16:`CLASS`,19:`NODE_DSTART`,20:`NODE_DESCR`,21:`NODE_DEND`,22:`NODE_ID`},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:p(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 8:r.getLogger().trace(`Stop NL `);break;case 9:r.getLogger().trace(`Stop EOF `);break;case 11:r.getLogger().trace(`Stop NL2 `);break;case 12:r.getLogger().trace(`Stop EOF2 `);break;case 15:r.getLogger().info(`Node: `,a[s].id),r.addNode(a[s-1].length,a[s].id,a[s].descr,a[s].type);break;case 16:r.getLogger().trace(`Icon: `,a[s]),r.decorateNode({icon:a[s]});break;case 17:case 21:r.decorateNode({class:a[s]});break;case 18:r.getLogger().trace(`SPACELIST`);break;case 19:r.getLogger().trace(`Node: `,a[s].id),r.addNode(0,a[s].id,a[s].descr,a[s].type);break;case 20:r.decorateNode({icon:a[s]});break;case 25:r.getLogger().trace(`node found ..`,a[s-2]),this.$={id:a[s-1],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 26:this.$={id:a[s],descr:a[s],type:r.nodeType.DEFAULT};break;case 27:r.getLogger().trace(`node found ..`,a[s-3]),this.$={id:a[s-3],descr:a[s-1],type:r.getType(a[s-2],a[s])}}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],8:t},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:t},{6:n,7:[1,10],9:9,12:11,13:r,14:14,15:i,16:a,17:17,18:18,19:o,22:s},e(l,[2,3]),{1:[2,2]},e(l,[2,4]),e(l,[2,5]),{1:[2,6],6:n,12:21,13:r,14:14,15:i,16:a,17:17,18:18,19:o,22:s},{6:n,9:22,12:11,13:r,14:14,15:i,16:a,17:17,18:18,19:o,22:s},{6:u,7:d,10:23,11:f},e(m,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:o,22:s}),e(m,[2,18]),e(m,[2,19]),e(m,[2,20]),e(m,[2,21]),e(m,[2,23]),e(m,[2,24]),e(m,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:d,10:32,11:f},{1:[2,7],6:n,12:21,13:r,14:14,15:i,16:a,17:17,18:18,19:o,22:s},e(h,[2,14],{7:g,11:_}),e(v,[2,8]),e(v,[2,9]),e(v,[2,10]),e(m,[2,15]),e(m,[2,16]),e(m,[2,17]),{20:[1,35]},{21:[1,36]},e(h,[2,13],{7:g,11:_}),e(v,[2,11]),e(v,[2,12]),{21:[1,37]},e(m,[2,25]),e(m,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:p(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:p(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,l=0,u=0,d=0,f=2,m=1,h=a.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(_.yy[v]=this.yy[v]);g.setInput(e,_.yy),_.yy.lexer=g,_.yy.parser=this,g.yylloc===void 0&&(g.yylloc={});var y=g.yylloc;a.push(y);var b=g.options&&g.options.ranges;this.parseError=typeof _.yy.parseError==`function`?_.yy.parseError:Object.getPrototypeOf(this).parseError;function x(e){n.length-=2*e,i.length-=e,a.length-=e}p(x,`popStack`);function S(){var e=r.pop()||g.lex()||m;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}p(S,`lex`);for(var C,w,T,E,D,O={},k,A,j,M;;){if(T=n[n.length-1],this.defaultActions[T]?E=this.defaultActions[T]:(C??=S(),E=o[T]&&o[T][C]),E===void 0||!E.length||!E[0]){var N=``;for(k in M=[],o[T])this.terminals_[k]&&k>f&&M.push(`'`+this.terminals_[k]+`'`);N=g.showPosition?`Parse error on line `+(l+1)+`:2753+`+g.showPosition()+`2754+Expecting `+M.join(`, `)+`, got '`+(this.terminals_[C]||C)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(C==m?`end of input`:`'`+(this.terminals_[C]||C)+`'`),this.parseError(N,{text:g.match,token:this.terminals_[C]||C,line:g.yylineno,loc:y,expected:M})}if(E[0]instanceof Array&&E.length>1)throw Error(`Parse Error: multiple actions possible at state: `+T+`, token: `+C);switch(E[0]){case 1:n.push(C),i.push(g.yytext),a.push(g.yylloc),n.push(E[1]),C=null,w?(C=w,w=null):(u=g.yyleng,s=g.yytext,l=g.yylineno,y=g.yylloc,d>0&&d--);break;case 2:if(A=this.productions_[E[1]][1],O.$=i[i.length-A],O._$={first_line:a[a.length-(A||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(A||1)].first_column,last_column:a[a.length-1].last_column},b&&(O._$.range=[a[a.length-(A||1)].range[0],a[a.length-1].range[1]]),D=this.performAction.apply(O,[s,u,l,_.yy,E[1],i,a].concat(h)),D!==void 0)return D;A&&(n=n.slice(0,-1*A*2),i=i.slice(0,-1*A),a=a.slice(0,-1*A)),n.push(this.productions_[E[1]][0]),i.push(O.$),a.push(O._$),j=o[n[n.length-2]][n[n.length-1]],n.push(j);break;case 3:return!0}}return!0},`parse`)};y.lexer=(function(){return{EOF:1,parseError:p(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:p(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:p(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:p(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:p(function(){return this._more=!0,this},`more`),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).2755+`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:p(function(e){this.unput(this.match.slice(e))},`less`),pastInput:p(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:p(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:p(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`2756+`+t+`^`},`showPosition`),test_match:p(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.2757+`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:p(function(){return this.next()||this.lex()},`lex`),begin:p(function(e){this.conditionStack.push(e)},`begin`),popState:p(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:p(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:p(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:p(function(e){this.begin(e)},`pushState`),stateStackSize:p(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:p(function(e,t,n,r){switch(n){case 0:return e.getLogger().trace(`Found comment`,t.yytext),6;case 1:return 8;case 2:this.begin(`CLASS`);break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:e.getLogger().trace(`Begin icon`),this.begin(`ICON`);break;case 6:return e.getLogger().trace(`SPACELINE`),6;case 7:return 7;case 8:return 15;case 9:e.getLogger().trace(`end icon`),this.popState();break;case 10:return e.getLogger().trace(`Exploding node`),this.begin(`NODE`),19;case 11:return e.getLogger().trace(`Cloud`),this.begin(`NODE`),19;case 12:return e.getLogger().trace(`Explosion Bang`),this.begin(`NODE`),19;case 13:return e.getLogger().trace(`Cloud Bang`),this.begin(`NODE`),19;case 14:return this.begin(`NODE`),19;case 15:return this.begin(`NODE`),19;case 16:return this.begin(`NODE`),19;case 17:return this.begin(`NODE`),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin(`NSTR2`);break;case 22:return`NODE_DESCR`;case 23:this.popState();break;case 24:e.getLogger().trace(`Starting NSTR`),this.begin(`NSTR`);break;case 25:return e.getLogger().trace(`description:`,t.yytext),`NODE_DESCR`;case 26:this.popState();break;case 27:return this.popState(),e.getLogger().trace(`node end ))`),`NODE_DEND`;case 28:return this.popState(),e.getLogger().trace(`node end )`),`NODE_DEND`;case 29:return this.popState(),e.getLogger().trace(`node end ...`,t.yytext),`NODE_DEND`;case 30:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 31:return this.popState(),e.getLogger().trace(`node end (-`),`NODE_DEND`;case 32:return this.popState(),e.getLogger().trace(`node end (-`),`NODE_DEND`;case 33:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 34:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 35:return e.getLogger().trace(`Long description:`,t.yytext),20;case 36:return e.getLogger().trace(`Long description:`,t.yytext),20}},`anonymous`),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}}})();function b(){this.yy={}}return p(b,`Parser`),b.prototype=y,y.Parser=b,new b})(),M8.parser=M8,_lt=M8,vlt=12,N8={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},ylt=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=N8,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}static{p(this,`MindmapDB`)}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let t=this.nodes.length-1;t>=0;t--)if(this.nodes[t].level<e)return this.nodes[t];return null}getMindmap(){return this.nodes.length>0?this.nodes[0]:null}addNode(e,t,n,r){y.info(`addNode`,e,t,n,r);let i=!1;this.nodes.length===0?(this.baseLevel=e,e=0,i=!0):this.baseLevel!==void 0&&(e-=this.baseLevel,i=!1);let a=Z(),o=a.mindmap?.padding??ns.mindmap.padding;switch(r){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:o*=2}let s={id:this.count++,nodeId:js(t,a),level:e,descr:js(n,a),type:r,children:[],width:a.mindmap?.maxNodeWidth??ns.mindmap.maxNodeWidth,padding:o,isRoot:i},l=this.getParent(e);if(l)l.children.push(s),this.nodes.push(s);else if(i)this.nodes.push(s);else throw Error(`There can be only one root. No parent could be found for ("${s.descr}")`)}getType(e,t){switch(y.debug(`In get type`,e,t),e){case`[`:return this.nodeType.RECT;case`(`:return t===`)`?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case`((`:return this.nodeType.CIRCLE;case`)`:return this.nodeType.CLOUD;case`))`:return this.nodeType.BANG;case`{{`:return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,t){this.elements[e]=t}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;let t=Z(),n=this.nodes[this.nodes.length-1];e.icon&&(n.icon=js(e.icon,t)),e.class&&(n.class=js(e.class,t))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return`no-border`;case this.nodeType.RECT:return`rect`;case this.nodeType.ROUNDED_RECT:return`rounded-rect`;case this.nodeType.CIRCLE:return`circle`;case this.nodeType.CLOUD:return`cloud`;case this.nodeType.BANG:return`bang`;case this.nodeType.HEXAGON:return`hexgon`;default:return`no-border`}}assignSections(e,t){if(e.section=e.level===0?void 0:t,e.children)for(let[n,r]of e.children.entries()){let i=e.level===0?n%(vlt-1):t;this.assignSections(r,i)}}flattenNodes(e,t){let n=Z(),r=[`mindmap-node`];e.isRoot===!0?r.push(`section-root`,`section--1`):e.section!==void 0&&r.push(`section-${e.section}`),e.class&&r.push(e.class);let i=r.join(` `),a=p(e=>{let t=(n.theme?.toLowerCase()??``).includes(`redux`);switch(e){case N8.CIRCLE:return`mindmapCircle`;case N8.RECT:return`rect`;case N8.ROUNDED_RECT:return`rounded`;case N8.CLOUD:return`cloud`;case N8.BANG:return`bang`;case N8.HEXAGON:return`hexagon`;case N8.DEFAULT:return t?`rounded`:`defaultMindmapNode`;case N8.NO_BORDER:default:return`rect`}},`getShapeFromType`),o={id:e.id.toString(),domId:`node_`+e.id.toString(),label:e.descr,labelType:`markdown`,isGroup:!1,shape:a(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:i,cssStyles:[],look:n.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(t.push(o),e.children)for(let n of e.children)this.flattenNodes(n,t)}generateEdges(e,t){if(!e.children)return;let n=Z();for(let r of e.children){let i=`edge`;r.section!==void 0&&(i+=` section-edge-${r.section}`);let a=e.level+1;i+=` edge-depth-${a}`;let o={id:`edge_${e.id}_${r.id}`,start:e.id.toString(),end:r.id.toString(),type:`normal`,curve:`basis`,thickness:`normal`,look:n.look,classes:i,depth:e.level,section:r.section};t.push(o),this.generateEdges(r,t)}}getData(){let e=this.getMindmap(),t=Z(),n=ys().layout!==void 0,r=t;if(n||(r.layout=`cose-bilkent`),!e)return{nodes:[],edges:[],config:r};y.debug(`getData: mindmapRoot`,e,t),this.assignSections(e);let i=[],a=[];this.flattenNodes(e,i),this.generateEdges(e,a),y.debug(`getData: processed ${i.length} nodes and ${a.length} edges`);let o=new Map;for(let e of i)o.set(e.id,{shape:e.shape,width:e.width,height:e.height,padding:e.padding});return{nodes:i,edges:a,config:r,rootNode:e,markers:[`point`],direction:`TB`,nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(o),type:`mindmap`,diagramId:`mindmap-`+flt()}}getLogger(){return y}},blt={draw:p(async(e,t,n,r)=>{y.debug(`Rendering mindmap diagram2758+`+e);let i=r.db,a=i.getData(),o=GL(t,a.config.securityLevel);if(a.type=r.type,a.layoutAlgorithm=TI(a.config.layout,{fallback:`cose-bilkent`}),a.diagramId=t,!i.getMindmap())return;a.nodes.forEach(e=>{e.shape===`rounded`?(e.radius=15,e.taper=15,e.stroke=`none`,e.width=0,e.padding=15):e.shape===`circle`?e.padding=10:e.shape===`rect`?(e.width=0,e.padding=10):e.shape===`hexagon`&&(e.width=0,e.height=0)}),await wI(a,o);let{themeVariables:s}=ms(),{useGradient:l,gradientStart:u,gradientStop:d}=s;if(l&&u&&d){let e=o.attr(`id`),t=o.append(`defs`).append(`linearGradient`).attr(`id`,`${e}-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);t.append(`stop`).attr(`offset`,`0%`).attr(`stop-color`,u).attr(`stop-opacity`,1),t.append(`stop`).attr(`offset`,`100%`).attr(`stop-color`,d).attr(`stop-opacity`,1)}qL(o,a.config.mindmap?.padding??ns.mindmap.padding,`mindmapDiagram`,a.config.mindmap?.useMaxWidth??ns.mindmap.useMaxWidth)},`draw`)},xlt=p(e=>{let{theme:t,look:n}=e,r=``;for(let t=0;t<e.THEME_COLOR_LIMIT;t++)e[`lineColor`+t]=e[`lineColor`+t]||e[`cScaleInv`+t],ye(e[`lineColor`+t])?e[`lineColor`+t]=V(e[`lineColor`+t],20):e[`lineColor`+t]=we(e[`lineColor`+t],20);for(let i=0;i<e.THEME_COLOR_LIMIT;i++){let a=``+(n===`neo`?Math.max(10-(i-1)*2,2):17-3*i);r+=`2759+ .section-${i-1} rect, .section-${i-1} path, .section-${i-1} circle, .section-${i-1} polygon, .section-${i-1} path {2760+ fill: ${e[`cScale`+i]};2761+ }2762+ .section-${i-1} text {2763+ fill: ${e[`cScaleLabel`+i]};2764+ }2765+ .section-${i-1} span {2766+ color: ${e[`cScaleLabel`+i]};2767+ }2768+ .node-icon-${i-1} {2769+ font-size: 40px;2770+ color: ${e[`cScaleLabel`+i]};2771+ }2772+ .section-edge-${i-1}{2773+ stroke: ${e[`cScale`+i]};2774+ }2775+ .edge-depth-${i-1}{2776+ stroke-width: ${a};2777+ }2778+ .section-${i-1} line {2779+ stroke: ${e[`cScaleInv`+i]} ;2780+ stroke-width: 3;2781+ }2782+2783+ .disabled, .disabled circle, .disabled text {2784+ fill: lightgray;2785+ }2786+ .disabled text {2787+ fill: #efefef;2788+ }2789+ [data-look="neo"].mindmap-node.section-${i-1} rect, [data-look="neo"].mindmap-node.section-${i-1} path, [data-look="neo"].mindmap-node.section-${i-1} circle, [data-look="neo"].mindmap-node.section-${i-1} polygon {2790+ fill: ${t===`redux`||t===`redux-dark`||t===`neutral`?e.mainBkg:e[`cScale`+i]};2791+ stroke: ${t===`redux`||t===`redux-dark`?e.nodeBorder:e[`cScale`+i]};2792+ stroke-width: ${e.strokeWidth??2}px;2793+ }2794+ [data-look="neo"].section-edge-${i-1}{2795+ stroke: ${t?.includes(`redux`)||t===`neo-dark`?e.nodeBorder:e[`cScale`+i]};2796+ }2797+ [data-look="neo"].mindmap-node.section-${i-1} text {2798+ fill: ${t===`redux`||t===`redux-dark`?e.nodeBorder:e[`cScaleLabel`+(t===`neutral`?1:i)]};2799+ }2800+ `}return r},`genSections`),Slt=p((e,t,n)=>{let r=``;for(let i=0;i<e;i++)r+=`2801+ [data-look="neo"].mindmap-node.section-${i-1} rect, [data-look="neo"].mindmap-node.section-${i-1} path, [data-look="neo"].mindmap-node.section-${i-1} circle, [data-look="neo"].mindmap-node.section-${i-1} polygon {2802+ stroke: url(${t}-gradient);2803+ fill: ${n};2804+ }2805+ .section-${i-1} line {2806+ stroke-width: 0;2807+ }`;return r},`genGradient`),Clt={get db(){return new ylt},renderer:blt,parser:_lt,styles:p(e=>{let{theme:t}=e,n=e.svgId,r=e.dropShadow?e.dropShadow.replace(`url(#drop-shadow)`,`url(${n}-drop-shadow)`):`none`;return`2808+ .edge {2809+ stroke-width: 3;2810+ }2811+ ${xlt(e)}2812+ .section-root rect, .section-root path, .section-root circle, .section-root polygon {2813+ fill: ${e.git0};2814+ }2815+ .section-root text {2816+ fill: ${e.gitBranchLabel0};2817+ }2818+ .section-root span {2819+ color: ${t?.includes(`redux`)?e.nodeBorder:e.gitBranchLabel0};2820+ }2821+ .icon-container {2822+ height:100%;2823+ display: flex;2824+ justify-content: center;2825+ align-items: center;2826+ }2827+ .edge {2828+ fill: none;2829+ }2830+ .mindmap-node-label {2831+ dy: 1em;2832+ alignment-baseline: middle;2833+ text-anchor: middle;2834+ dominant-baseline: middle;2835+ text-align: center;2836+ }2837+ [data-look="neo"].mindmap-node {2838+ filter: ${r};2839+ }2840+ [data-look="neo"].mindmap-node.section-root rect, [data-look="neo"].mindmap-node.section-root path, [data-look="neo"].mindmap-node.section-root circle, [data-look="neo"].mindmap-node.section-root polygon {2841+ fill: ${t?.includes(`redux`)?e.mainBkg:e.git0};2842+ }2843+ [data-look="neo"].mindmap-node.section-root .text-inner-tspan {2844+ fill: ${t?.includes(`redux`)?e.nodeBorder:e[`cScaleLabel`+ +(t===`neutral`)]};2845+ }2846+ ${e.useGradient&&n&&e.mainBkg?Slt(e.THEME_COLOR_LIMIT,n,e.mainBkg):``}2847+`},`getStyles`)}})),Tlt=l({diagram:()=>Plt}),P8,Elt,F8,I8,L8,R8,Dlt,Olt,z8,klt,Alt,B8,jlt,Mlt,Nlt,Plt,Flt=o((()=>{yp(),WL(),DC(),U_(),z_(),P_(),Op(),ig(),Gp(),rh(),dc(),S(),h(),Ne(),P8=(function(){var e=p(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,4],n=[1,13],r=[1,12],i=[1,15],a=[1,16],o=[1,20],s=[1,19],l=[6,7,8],u=[1,26],d=[1,24],f=[1,25],m=[6,7,11],h=[1,31],g=[6,7,11,24],_=[1,6,13,16,17,20,23],v=[1,35],y=[1,36],b=[1,6,7,11,13,16,17,20,23],x=[1,38],S={trace:p(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:`error`,6:`SPACELINE`,7:`NL`,8:`KANBAN`,11:`EOF`,13:`SPACELIST`,16:`ICON`,17:`CLASS`,20:`NODE_DSTART`,21:`NODE_DESCR`,22:`NODE_DEND`,23:`NODE_ID`,24:`SHAPE_DATA`},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:p(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 8:r.getLogger().trace(`Stop NL `);break;case 9:r.getLogger().trace(`Stop EOF `);break;case 11:r.getLogger().trace(`Stop NL2 `);break;case 12:r.getLogger().trace(`Stop EOF2 `);break;case 15:r.getLogger().info(`Node: `,a[s-1].id),r.addNode(a[s-2].length,a[s-1].id,a[s-1].descr,a[s-1].type,a[s]);break;case 16:r.getLogger().info(`Node: `,a[s].id),r.addNode(a[s-1].length,a[s].id,a[s].descr,a[s].type);break;case 17:r.getLogger().trace(`Icon: `,a[s]),r.decorateNode({icon:a[s]});break;case 18:case 23:r.decorateNode({class:a[s]});break;case 19:r.getLogger().trace(`SPACELIST`);break;case 20:r.getLogger().trace(`Node: `,a[s-1].id),r.addNode(0,a[s-1].id,a[s-1].descr,a[s-1].type,a[s]);break;case 21:r.getLogger().trace(`Node: `,a[s].id),r.addNode(0,a[s].id,a[s].descr,a[s].type);break;case 22:r.decorateNode({icon:a[s]});break;case 27:r.getLogger().trace(`node found ..`,a[s-2]),this.$={id:a[s-1],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 28:this.$={id:a[s],descr:a[s],type:0};break;case 29:r.getLogger().trace(`node found ..`,a[s-3]),this.$={id:a[s-3],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 30:this.$=a[s-1]+a[s];break;case 31:this.$=a[s]}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],8:t},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:t},{6:n,7:[1,10],9:9,12:11,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:s},e(l,[2,3]),{1:[2,2]},e(l,[2,4]),e(l,[2,5]),{1:[2,6],6:n,12:21,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:s},{6:n,9:22,12:11,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:s},{6:u,7:d,10:23,11:f},e(m,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:o,23:s}),e(m,[2,19]),e(m,[2,21],{15:30,24:h}),e(m,[2,22]),e(m,[2,23]),e(g,[2,25]),e(g,[2,26]),e(g,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:d,10:34,11:f},{1:[2,7],6:n,12:21,13:r,14:14,16:i,17:a,18:17,19:18,20:o,23:s},e(_,[2,14],{7:v,11:y}),e(b,[2,8]),e(b,[2,9]),e(b,[2,10]),e(m,[2,16],{15:37,24:h}),e(m,[2,17]),e(m,[2,18]),e(m,[2,20],{24:x}),e(g,[2,31]),{21:[1,39]},{22:[1,40]},e(_,[2,13],{7:v,11:y}),e(b,[2,11]),e(b,[2,12]),e(m,[2,15],{24:x}),e(g,[2,30]),{22:[1,41]},e(g,[2,27]),e(g,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:p(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:p(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,l=0,u=0,d=0,f=2,m=1,h=a.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(_.yy[v]=this.yy[v]);g.setInput(e,_.yy),_.yy.lexer=g,_.yy.parser=this,g.yylloc===void 0&&(g.yylloc={});var y=g.yylloc;a.push(y);var b=g.options&&g.options.ranges;this.parseError=typeof _.yy.parseError==`function`?_.yy.parseError:Object.getPrototypeOf(this).parseError;function x(e){n.length-=2*e,i.length-=e,a.length-=e}p(x,`popStack`);function S(){var e=r.pop()||g.lex()||m;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}p(S,`lex`);for(var C,w,T,E,D,O={},k,A,j,M;;){if(T=n[n.length-1],this.defaultActions[T]?E=this.defaultActions[T]:(C??=S(),E=o[T]&&o[T][C]),E===void 0||!E.length||!E[0]){var N=``;for(k in M=[],o[T])this.terminals_[k]&&k>f&&M.push(`'`+this.terminals_[k]+`'`);N=g.showPosition?`Parse error on line `+(l+1)+`:2848+`+g.showPosition()+`2849+Expecting `+M.join(`, `)+`, got '`+(this.terminals_[C]||C)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(C==m?`end of input`:`'`+(this.terminals_[C]||C)+`'`),this.parseError(N,{text:g.match,token:this.terminals_[C]||C,line:g.yylineno,loc:y,expected:M})}if(E[0]instanceof Array&&E.length>1)throw Error(`Parse Error: multiple actions possible at state: `+T+`, token: `+C);switch(E[0]){case 1:n.push(C),i.push(g.yytext),a.push(g.yylloc),n.push(E[1]),C=null,w?(C=w,w=null):(u=g.yyleng,s=g.yytext,l=g.yylineno,y=g.yylloc,d>0&&d--);break;case 2:if(A=this.productions_[E[1]][1],O.$=i[i.length-A],O._$={first_line:a[a.length-(A||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(A||1)].first_column,last_column:a[a.length-1].last_column},b&&(O._$.range=[a[a.length-(A||1)].range[0],a[a.length-1].range[1]]),D=this.performAction.apply(O,[s,u,l,_.yy,E[1],i,a].concat(h)),D!==void 0)return D;A&&(n=n.slice(0,-1*A*2),i=i.slice(0,-1*A),a=a.slice(0,-1*A)),n.push(this.productions_[E[1]][0]),i.push(O.$),a.push(O._$),j=o[n[n.length-2]][n[n.length-1]],n.push(j);break;case 3:return!0}}return!0},`parse`)};S.lexer=(function(){return{EOF:1,parseError:p(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:p(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:p(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:p(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:p(function(){return this._more=!0,this},`more`),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).2850+`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:p(function(e){this.unput(this.match.slice(e))},`less`),pastInput:p(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:p(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:p(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`2851+`+t+`^`},`showPosition`),test_match:p(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.2852+`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:p(function(){return this.next()||this.lex()},`lex`),begin:p(function(e){this.conditionStack.push(e)},`begin`),popState:p(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:p(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:p(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:p(function(e){this.begin(e)},`pushState`),stateStackSize:p(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:p(function(e,t,n,r){switch(n){case 0:return this.pushState(`shapeData`),t.yytext=``,24;case 1:return this.pushState(`shapeDataStr`),24;case 2:return this.popState(),24;case 3:return t.yytext=t.yytext.replace(/\n\s*/g,`<br/>`),24;case 4:return 24;case 5:this.popState();break;case 6:return e.getLogger().trace(`Found comment`,t.yytext),6;case 7:return 8;case 8:this.begin(`CLASS`);break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:e.getLogger().trace(`Begin icon`),this.begin(`ICON`);break;case 12:return e.getLogger().trace(`SPACELINE`),6;case 13:return 7;case 14:return 16;case 15:e.getLogger().trace(`end icon`),this.popState();break;case 16:return e.getLogger().trace(`Exploding node`),this.begin(`NODE`),20;case 17:return e.getLogger().trace(`Cloud`),this.begin(`NODE`),20;case 18:return e.getLogger().trace(`Explosion Bang`),this.begin(`NODE`),20;case 19:return e.getLogger().trace(`Cloud Bang`),this.begin(`NODE`),20;case 20:return this.begin(`NODE`),20;case 21:return this.begin(`NODE`),20;case 22:return this.begin(`NODE`),20;case 23:return this.begin(`NODE`),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin(`NSTR2`);break;case 28:return`NODE_DESCR`;case 29:this.popState();break;case 30:e.getLogger().trace(`Starting NSTR`),this.begin(`NSTR`);break;case 31:return e.getLogger().trace(`description:`,t.yytext),`NODE_DESCR`;case 32:this.popState();break;case 33:return this.popState(),e.getLogger().trace(`node end ))`),`NODE_DEND`;case 34:return this.popState(),e.getLogger().trace(`node end )`),`NODE_DEND`;case 35:return this.popState(),e.getLogger().trace(`node end ...`,t.yytext),`NODE_DEND`;case 36:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 37:return this.popState(),e.getLogger().trace(`node end (-`),`NODE_DEND`;case 38:return this.popState(),e.getLogger().trace(`node end (-`),`NODE_DEND`;case 39:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 40:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 41:return e.getLogger().trace(`Long description:`,t.yytext),21;case 42:return e.getLogger().trace(`Long description:`,t.yytext),21}},`anonymous`),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}}})();function C(){this.yy={}}return p(C,`Parser`),C.prototype=S,S.Parser=C,new C})(),P8.parser=P8,Elt=P8,F8=[],I8=[],L8=0,R8={},Dlt=p(()=>{F8=[],I8=[],L8=0,R8={}},`clear`),Olt=p(e=>{if(F8.length===0)return null;let t=F8[0].level,n=null;for(let e=F8.length-1;e>=0;e--)if(F8[e].level===t&&!n&&(n=F8[e]),F8[e].level<t)throw Error(`Items without section detected, found section ("`+F8[e].label+`")`);return e===n?.level?null:n},`getSection`),z8=p(function(){return I8},`getSections`),klt=p(function(){let e=[],t=[],n=z8(),r=Z();for(let e of n){let n={id:e.id,label:js(e.label??``,r),labelType:`markdown`,isGroup:!0,ticket:e.ticket,shape:`kanbanSection`,level:e.level,look:r.look};t.push(n);let i=F8.filter(t=>t.parentId===e.id);for(let n of i){let i={id:n.id,parentId:e.id,label:js(n.label??``,r),labelType:`markdown`,isGroup:!1,ticket:n?.ticket,priority:n?.priority,assigned:n?.assigned,icon:n?.icon,shape:`kanbanItem`,level:n.level,rx:5,ry:5,cssStyles:[`text-align: left`]};t.push(i)}}return{nodes:t,edges:e,other:{},config:Z()}},`getData`),Alt=p((e,t,n,r,i)=>{let a=Z(),o=a.mindmap?.padding??ns.mindmap.padding;switch(r){case B8.ROUNDED_RECT:case B8.RECT:case B8.HEXAGON:o*=2}let s={id:js(t,a)||`kbn`+L8++,level:e,label:js(n,a),width:a.mindmap?.maxNodeWidth??ns.mindmap.maxNodeWidth,padding:o,isGroup:!1};if(i!==void 0){let e;e=i.includes(`2853+`)?i+`2854+`:`{2855+`+i+`2856+}`;let t=EC(e,{schema:TC});if(t.shape&&(t.shape!==t.shape.toLowerCase()||t.shape.includes(`_`)))throw Error(`No such shape: ${t.shape}. Shape names should be lowercase.`);t?.shape&&t.shape===`kanbanItem`&&(s.shape=t?.shape),t?.label&&(s.label=t?.label),t?.icon&&(s.icon=t?.icon.toString()),t?.assigned&&(s.assigned=t?.assigned.toString()),t?.ticket&&(s.ticket=t?.ticket.toString()),t?.priority&&(s.priority=t?.priority)}let l=Olt(e);l?s.parentId=l.id||`kbn`+L8++:I8.push(s),F8.push(s)},`addNode`),B8={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},jlt={clear:Dlt,addNode:Alt,getSections:z8,getData:klt,nodeType:B8,getType:p((e,t)=>{switch(y.debug(`In get type`,e,t),e){case`[`:return B8.RECT;case`(`:return t===`)`?B8.ROUNDED_RECT:B8.CLOUD;case`((`:return B8.CIRCLE;case`)`:return B8.CLOUD;case`))`:return B8.BANG;case`{{`:return B8.HEXAGON;default:return B8.DEFAULT}},`getType`),setElementForId:p((e,t)=>{R8[e]=t},`setElementForId`),decorateNode:p(e=>{if(!e)return;let t=Z(),n=F8[F8.length-1];e.icon&&(n.icon=js(e.icon,t)),e.class&&(n.cssClasses=js(e.class,t))},`decorateNode`),type2Str:p(e=>{switch(e){case B8.DEFAULT:return`no-border`;case B8.RECT:return`rect`;case B8.ROUNDED_RECT:return`rounded-rect`;case B8.CIRCLE:return`circle`;case B8.CLOUD:return`cloud`;case B8.BANG:return`bang`;case B8.HEXAGON:return`hexgon`;default:return`no-border`}},`type2Str`),getLogger:p(()=>y,`getLogger`),getElementById:p(e=>R8[e],`getElementById`)},Mlt={draw:p(async(e,t,n,r)=>{y.debug(`Rendering kanban diagram2857+`+e);let i=r.db.getData(),a=Z();a.htmlLabels=!1;let o=vp(t);for(let e of i.nodes)e.domId=`${t}-${e.id}`;let s=o.append(`g`);s.attr(`class`,`sections`);let l=o.append(`g`);l.attr(`class`,`items`);let u=i.nodes.filter(e=>e.isGroup),d=0,f=[],p=25;for(let e of u){let t=a?.kanban?.sectionWidth||200;d+=1,e.x=t*d+(d-1)*10/2,e.width=t,e.y=0,e.height=t*3,e.rx=5,e.ry=5,e.cssClasses=e.cssClasses+` section-`+d;let n=await H_(s,e);p=Math.max(p,n?.labelBBox?.height),f.push(n)}let m=0;for(let e of u){let t=f[m];m+=1;let n=a?.kanban?.sectionWidth||200,r=-n*3/2+p,o=r,s=i.nodes.filter(t=>t.parentId===e.id);for(let t of s){if(t.isGroup)throw Error(`Groups within groups are not allowed in Kanban diagrams`);t.x=e.x,t.width=n-15;let r=(await F_(l,t,{config:a})).node().getBBox();t.y=o+r.height/2,await R_(t),o=t.y+r.height/2+5}let u=t.cluster.select(`rect`),d=Math.max(o-r+30,50)+(p-25);u.attr(`height`,d)}Us(void 0,o,a.mindmap?.padding??ns.kanban.padding,a.mindmap?.useMaxWidth??ns.kanban.useMaxWidth)},`draw`)},Nlt=p(e=>{let t=``;for(let t=0;t<e.THEME_COLOR_LIMIT;t++)e[`lineColor`+t]=e[`lineColor`+t]||e[`cScaleInv`+t],ye(e[`lineColor`+t])?e[`lineColor`+t]=V(e[`lineColor`+t],20):e[`lineColor`+t]=we(e[`lineColor`+t],20);let n=p((t,n)=>e.darkMode?we(t,n):V(t,n),`adjuster`);for(let r=0;r<e.THEME_COLOR_LIMIT;r++){let i=``+(17-3*r);t+=`2858+ .section-${r-1} rect, .section-${r-1} path, .section-${r-1} circle, .section-${r-1} polygon, .section-${r-1} path {2859+ fill: ${n(e[`cScale`+r],10)};2860+ stroke: ${n(e[`cScale`+r],10)};2861+2862+ }2863+ .section-${r-1} text {2864+ fill: ${e[`cScaleLabel`+r]};2865+ }2866+ .node-icon-${r-1} {2867+ font-size: 40px;2868+ color: ${e[`cScaleLabel`+r]};2869+ }2870+ .section-edge-${r-1}{2871+ stroke: ${e[`cScale`+r]};2872+ }2873+ .edge-depth-${r-1}{2874+ stroke-width: ${i};2875+ }2876+ .section-${r-1} line {2877+ stroke: ${e[`cScaleInv`+r]} ;2878+ stroke-width: 3;2879+ }2880+2881+ .disabled, .disabled circle, .disabled text {2882+ fill: lightgray;2883+ }2884+ .disabled text {2885+ fill: #efefef;2886+ }2887+2888+ .node rect,2889+ .node circle,2890+ .node ellipse,2891+ .node polygon,2892+ .node path {2893+ fill: ${e.background};2894+ stroke: ${e.nodeBorder};2895+ stroke-width: 1px;2896+ }2897+2898+ .kanban-ticket-link {2899+ fill: ${e.background};2900+ stroke: ${e.nodeBorder};2901+ text-decoration: underline;2902+ }2903+ `}return t},`genSections`),Plt={db:jlt,renderer:Mlt,parser:Elt,styles:p(e=>`2904+ .edge {2905+ stroke-width: 3;2906+ }2907+ ${Nlt(e)}2908+ .section-root rect, .section-root path, .section-root circle, .section-root polygon {2909+ fill: ${e.git0};2910+ }2911+ .section-root text {2912+ fill: ${e.gitBranchLabel0};2913+ }2914+ .icon-container {2915+ height:100%;2916+ display: flex;2917+ justify-content: center;2918+ align-items: center;2919+ }2920+ .edge {2921+ fill: none;2922+ }2923+ .cluster-label, .label {2924+ color: ${e.textColor};2925+ fill: ${e.textColor};2926+ }2927+ .kanban-label {2928+ dy: 1em;2929+ alignment-baseline: middle;2930+ text-anchor: middle;2931+ dominant-baseline: middle;2932+ text-align: center;2933+ }2934+ ${UL()}2935+`,`getStyles`)}}));function Ilt(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}var Llt=o((()=>{}));function Rlt(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}var zlt=o((()=>{}));function V8(e,t){let n=0;if(t===void 0)for(let t of e)(t=+t)&&(n+=t);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}var Blt=o((()=>{})),Vlt=o((()=>{Llt(),zlt(),Blt()}));function Hlt(e){return e.target.depth}function Ult(e){return e.depth}function Wlt(e,t){return t-1-e.height}function Glt(e,t){return e.sourceLinks.length?e.depth:t-1}function Klt(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?Rlt(e.sourceLinks,Hlt)-1:0}var qlt=o((()=>{Vlt()}));function H8(e){return function(){return e}}var Jlt=o((()=>{}));function Ylt(e,t){return U8(e.source,t.source)||e.index-t.index}function Xlt(e,t){return U8(e.target,t.target)||e.index-t.index}function U8(e,t){return e.y0-t.y0}function W8(e){return e.value}function Zlt(e){return e.index}function Qlt(e){return e.nodes}function $lt(e){return e.links}function eut(e,t){let n=e.get(t);if(!n)throw Error(`missing: `+t);return n}function tut({nodes:e}){for(let t of e){let e=t.y0,n=e;for(let n of t.sourceLinks)n.y0=e+n.width/2,e+=n.width;for(let e of t.targetLinks)e.y1=n+e.width/2,n+=e.width}}function nut(){let e=0,t=0,n=1,r=1,i=24,a=8,o,s=Zlt,l=Glt,u,d,f=Qlt,p=$lt,m=6;function h(){let e={nodes:f.apply(null,arguments),links:p.apply(null,arguments)};return g(e),_(e),v(e),y(e),S(e),tut(e),e}h.update=function(e){return tut(e),e},h.nodeId=function(e){return arguments.length?(s=typeof e==`function`?e:H8(e),h):s},h.nodeAlign=function(e){return arguments.length?(l=typeof e==`function`?e:H8(e),h):l},h.nodeSort=function(e){return arguments.length?(u=e,h):u},h.nodeWidth=function(e){return arguments.length?(i=+e,h):i},h.nodePadding=function(e){return arguments.length?(a=o=+e,h):a},h.nodes=function(e){return arguments.length?(f=typeof e==`function`?e:H8(e),h):f},h.links=function(e){return arguments.length?(p=typeof e==`function`?e:H8(e),h):p},h.linkSort=function(e){return arguments.length?(d=e,h):d},h.size=function(i){return arguments.length?(e=t=0,n=+i[0],r=+i[1],h):[n-e,r-t]},h.extent=function(i){return arguments.length?(e=+i[0][0],n=+i[1][0],t=+i[0][1],r=+i[1][1],h):[[e,t],[n,r]]},h.iterations=function(e){return arguments.length?(m=+e,h):m};function g({nodes:e,links:t}){for(let[t,n]of e.entries())n.index=t,n.sourceLinks=[],n.targetLinks=[];let n=new Map(e.map((t,n)=>[s(t,n,e),t]));for(let[e,r]of t.entries()){r.index=e;let{source:t,target:i}=r;typeof t!=`object`&&(t=r.source=eut(n,t)),typeof i!=`object`&&(i=r.target=eut(n,i)),t.sourceLinks.push(r),i.targetLinks.push(r)}if(d!=null)for(let{sourceLinks:t,targetLinks:n}of e)t.sort(d),n.sort(d)}function _({nodes:e}){for(let t of e)t.value=t.fixedValue===void 0?Math.max(V8(t.sourceLinks,W8),V8(t.targetLinks,W8)):t.fixedValue}function v({nodes:e}){let t=e.length,n=new Set(e),r=new Set,i=0;for(;n.size;){for(let e of n){e.depth=i;for(let{target:t}of e.sourceLinks)r.add(t)}if(++i>t)throw Error(`circular link`);n=r,r=new Set}}function y({nodes:e}){let t=e.length,n=new Set(e),r=new Set,i=0;for(;n.size;){for(let e of n){e.height=i;for(let{source:t}of e.targetLinks)r.add(t)}if(++i>t)throw Error(`circular link`);n=r,r=new Set}}function b({nodes:t}){let r=Ilt(t,e=>e.depth)+1,a=(n-e-i)/(r-1),o=Array(r);for(let n of t){let t=Math.max(0,Math.min(r-1,Math.floor(l.call(null,n,r))));n.layer=t,n.x0=e+t*a,n.x1=n.x0+i,o[t]?o[t].push(n):o[t]=[n]}if(u)for(let e of o)e.sort(u);return o}function x(e){let n=Rlt(e,e=>(r-t-(e.length-1)*o)/V8(e,W8));for(let i of e){let e=t;for(let t of i){t.y0=e,t.y1=e+t.value*n,e=t.y1+o;for(let e of t.sourceLinks)e.width=e.value*n}e=(r-e+o)/(i.length+1);for(let t=0;t<i.length;++t){let n=i[t];n.y0+=e*(t+1),n.y1+=e*(t+1)}k(i)}}function S(e){let n=b(e);o=Math.min(a,(r-t)/(Ilt(n,e=>e.length)-1)),x(n);for(let e=0;e<m;++e){let t=.99**e,r=Math.max(1-t,(e+1)/m);w(n,t,r),C(n,t,r)}}function C(e,t,n){for(let r=1,i=e.length;r<i;++r){let i=e[r];for(let e of i){let n=0,r=0;for(let{source:t,value:i}of e.targetLinks){let a=i*(e.layer-t.layer);n+=A(t,e)*a,r+=a}if(!(r>0))continue;let i=(n/r-e.y0)*t;e.y0+=i,e.y1+=i,O(e)}u===void 0&&i.sort(U8),T(i,n)}}function w(e,t,n){for(let r=e.length-2;r>=0;--r){let i=e[r];for(let e of i){let n=0,r=0;for(let{target:t,value:i}of e.sourceLinks){let a=i*(t.layer-e.layer);n+=j(e,t)*a,r+=a}if(!(r>0))continue;let i=(n/r-e.y0)*t;e.y0+=i,e.y1+=i,O(e)}u===void 0&&i.sort(U8),T(i,n)}}function T(e,n){let i=e.length>>1,a=e[i];D(e,a.y0-o,i-1,n),E(e,a.y1+o,i+1,n),D(e,r,e.length-1,n),E(e,t,0,n)}function E(e,t,n,r){for(;n<e.length;++n){let i=e[n],a=(t-i.y0)*r;a>1e-6&&(i.y0+=a,i.y1+=a),t=i.y1+o}}function D(e,t,n,r){for(;n>=0;--n){let i=e[n],a=(i.y1-t)*r;a>1e-6&&(i.y0-=a,i.y1-=a),t=i.y0-o}}function O({sourceLinks:e,targetLinks:t}){if(d===void 0){for(let{source:{sourceLinks:e}}of t)e.sort(Xlt);for(let{target:{targetLinks:t}}of e)t.sort(Ylt)}}function k(e){if(d===void 0)for(let{sourceLinks:t,targetLinks:n}of e)t.sort(Xlt),n.sort(Ylt)}function A(e,t){let n=e.y0-(e.sourceLinks.length-1)*o/2;for(let{target:r,width:i}of e.sourceLinks){if(r===t)break;n+=i+o}for(let{source:r,width:i}of t.targetLinks){if(r===e)break;n-=i}return n}function j(e,t){let n=t.y0-(t.targetLinks.length-1)*o/2;for(let{source:r,width:i}of t.targetLinks){if(r===e)break;n+=i+o}for(let{target:r,width:i}of e.sourceLinks){if(r===t)break;n-=i}return n}return h}var rut=o((()=>{Vlt(),qlt(),Jlt()}));function G8(){this._x0=this._y0=this._x1=this._y1=null,this._=``}function iut(){return new G8}var K8,q8,J8,aut,out=o((()=>{K8=Math.PI,q8=2*K8,J8=1e-6,aut=q8-J8,G8.prototype=iut.prototype={constructor:G8,moveTo:function(e,t){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+=`Z`)},lineTo:function(e,t){this._+=`L`+(this._x1=+e)+`,`+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+=`Q`+ +e+`,`+ +t+`,`+(this._x1=+n)+`,`+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,a){this._+=`C`+ +e+`,`+ +t+`,`+ +n+`,`+ +r+`,`+(this._x1=+i)+`,`+(this._y1=+a)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var a=this._x1,o=this._y1,s=n-e,l=r-t,u=a-e,d=o-t,f=u*u+d*d;if(i<0)throw Error(`negative radius: `+i);if(this._x1===null)this._+=`M`+(this._x1=e)+`,`+(this._y1=t);else if(f>J8){if(!(Math.abs(d*s-l*u)>J8)||!i)this._+=`L`+(this._x1=e)+`,`+(this._y1=t);else{var p=n-a,m=r-o,h=s*s+l*l,g=p*p+m*m,_=Math.sqrt(h),v=Math.sqrt(f),y=i*Math.tan((K8-Math.acos((h+f-g)/(2*_*v)))/2),b=y/v,x=y/_;Math.abs(b-1)>J8&&(this._+=`L`+(e+b*u)+`,`+(t+b*d)),this._+=`A`+i+`,`+i+`,0,0,`+ +(d*p>u*m)+`,`+(this._x1=e+x*s)+`,`+(this._y1=t+x*l)}}},arc:function(e,t,n,r,i,a){e=+e,t=+t,n=+n,a=!!a;var o=n*Math.cos(r),s=n*Math.sin(r),l=e+o,u=t+s,d=1^a,f=a?r-i:i-r;if(n<0)throw Error(`negative radius: `+n);this._x1===null?this._+=`M`+l+`,`+u:(Math.abs(this._x1-l)>J8||Math.abs(this._y1-u)>J8)&&(this._+=`L`+l+`,`+u),n&&(f<0&&(f=f%q8+q8),f>aut?this._+=`A`+n+`,`+n+`,0,1,`+d+`,`+(e-o)+`,`+(t-s)+`A`+n+`,`+n+`,0,1,`+d+`,`+(this._x1=l)+`,`+(this._y1=u):f>J8&&(this._+=`A`+n+`,`+n+`,0,`+ +(f>=K8)+`,`+d+`,`+(this._x1=e+n*Math.cos(i))+`,`+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)+`h`+ +n+`v`+ +r+`h`+-n+`Z`},toString:function(){return this._}}})),sut=o((()=>{out()}));function cut(e){return function(){return e}}var lut=o((()=>{}));function uut(e){return e[0]}function dut(e){return e[1]}var fut=o((()=>{})),put,mut=o((()=>{put=Array.prototype.slice}));function hut(e){return e.source}function gut(e){return e.target}function _ut(e){var t=hut,n=gut,r=uut,i=dut,a=null;function o(){var o,s=put.call(arguments),l=t.apply(this,s),u=n.apply(this,s);if(a||=o=iut(),e(a,+r.apply(this,(s[0]=l,s)),+i.apply(this,s),+r.apply(this,(s[0]=u,s)),+i.apply(this,s)),o)return a=null,o+``||null}return o.source=function(e){return arguments.length?(t=e,o):t},o.target=function(e){return arguments.length?(n=e,o):n},o.x=function(e){return arguments.length?(r=typeof e==`function`?e:cut(+e),o):r},o.y=function(e){return arguments.length?(i=typeof e==`function`?e:cut(+e),o):i},o.context=function(e){return arguments.length?(a=e??null,o):a},o}function vut(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function yut(){return _ut(vut)}var but=o((()=>{sut(),mut(),lut(),fut()})),xut=o((()=>{sut(),lut(),but(),mut()}));function Sut(e){return[e.source.x1,e.y0]}function Cut(e){return[e.target.x0,e.y1]}function wut(){return yut().source(Sut).target(Cut)}var Tut=o((()=>{xut()})),Eut=o((()=>{rut(),qlt(),Tut()})),Dut=l({diagram:()=>zut}),Y8,X8,Z8,Q8,$8,Out,kut,Aut,jut,Mut,e5,Nut,Put,Fut,Iut,Lut,Rut,zut,But=o((()=>{dc(),S(),h(),_p(),Eut(),Y8=(function(){var e=p(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,9],n=[1,10],r=[1,5,10,12],i={trace:p(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:`error`,4:`SANKEY`,5:`NEWLINE`,10:`EOF`,11:`field[source]`,12:`COMMA`,13:`field[target]`,14:`field[value]`,18:`DQUOTE`,19:`ESCAPED_TEXT`,20:`NON_ESCAPED_TEXT`},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:p(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 7:let e=r.findOrCreateNode(a[s-4].trim().replaceAll(`""`,`"`)),t=r.findOrCreateNode(a[s-2].trim().replaceAll(`""`,`"`)),n=parseFloat(a[s].trim());r.addLink(e,t,n);break;case 8:case 9:case 11:this.$=a[s];break;case 10:this.$=a[s-1]}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:t,20:n},{1:[2,6],7:11,10:[1,12]},e(n,[2,4],{9:13,5:[1,14]}),{12:[1,15]},e(r,[2,8]),e(r,[2,9]),{19:[1,16]},e(r,[2,11]),{1:[2,1]},{1:[2,5]},e(n,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:t,20:n},{15:18,16:7,17:8,18:t,20:n},{18:[1,19]},e(n,[2,3]),{12:[1,20]},e(r,[2,10]),{15:21,16:7,17:8,18:t,20:n},e([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:p(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:p(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,l=0,u=0,d=0,f=2,m=1,h=a.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(_.yy[v]=this.yy[v]);g.setInput(e,_.yy),_.yy.lexer=g,_.yy.parser=this,g.yylloc===void 0&&(g.yylloc={});var y=g.yylloc;a.push(y);var b=g.options&&g.options.ranges;this.parseError=typeof _.yy.parseError==`function`?_.yy.parseError:Object.getPrototypeOf(this).parseError;function x(e){n.length-=2*e,i.length-=e,a.length-=e}p(x,`popStack`);function S(){var e=r.pop()||g.lex()||m;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}p(S,`lex`);for(var C,w,T,E,D,O={},k,A,j,M;;){if(T=n[n.length-1],this.defaultActions[T]?E=this.defaultActions[T]:(C??=S(),E=o[T]&&o[T][C]),E===void 0||!E.length||!E[0]){var N=``;for(k in M=[],o[T])this.terminals_[k]&&k>f&&M.push(`'`+this.terminals_[k]+`'`);N=g.showPosition?`Parse error on line `+(l+1)+`:2936+`+g.showPosition()+`2937+Expecting `+M.join(`, `)+`, got '`+(this.terminals_[C]||C)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(C==m?`end of input`:`'`+(this.terminals_[C]||C)+`'`),this.parseError(N,{text:g.match,token:this.terminals_[C]||C,line:g.yylineno,loc:y,expected:M})}if(E[0]instanceof Array&&E.length>1)throw Error(`Parse Error: multiple actions possible at state: `+T+`, token: `+C);switch(E[0]){case 1:n.push(C),i.push(g.yytext),a.push(g.yylloc),n.push(E[1]),C=null,w?(C=w,w=null):(u=g.yyleng,s=g.yytext,l=g.yylineno,y=g.yylloc,d>0&&d--);break;case 2:if(A=this.productions_[E[1]][1],O.$=i[i.length-A],O._$={first_line:a[a.length-(A||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(A||1)].first_column,last_column:a[a.length-1].last_column},b&&(O._$.range=[a[a.length-(A||1)].range[0],a[a.length-1].range[1]]),D=this.performAction.apply(O,[s,u,l,_.yy,E[1],i,a].concat(h)),D!==void 0)return D;A&&(n=n.slice(0,-1*A*2),i=i.slice(0,-1*A),a=a.slice(0,-1*A)),n.push(this.productions_[E[1]][0]),i.push(O.$),a.push(O._$),j=o[n[n.length-2]][n[n.length-1]],n.push(j);break;case 3:return!0}}return!0},`parse`)};i.lexer=(function(){return{EOF:1,parseError:p(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:p(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:p(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:p(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:p(function(){return this._more=!0,this},`more`),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).2938+`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:p(function(e){this.unput(this.match.slice(e))},`less`),pastInput:p(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:p(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:p(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`2939+`+t+`^`},`showPosition`),test_match:p(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.2940+`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:p(function(){return this.next()||this.lex()},`lex`),begin:p(function(e){this.conditionStack.push(e)},`begin`),popState:p(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:p(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:p(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:p(function(e){this.begin(e)},`pushState`),stateStackSize:p(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:p(function(e,t,n,r){switch(n){case 0:return this.pushState(`csv`),4;case 1:return this.pushState(`csv`),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState(`escaped_text`),18;case 6:return 20;case 7:return this.popState(`escaped_text`),18;case 8:return 19}},`anonymous`),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}}})();function a(){this.yy={}}return p(a,`Parser`),a.prototype=i,i.Parser=a,new a})(),Y8.parser=Y8,X8=Y8,Z8=[],Q8=[],$8=new Map,Out=p(()=>{Z8=[],Q8=[],$8=new Map,Xs()},`clear`),kut=class{constructor(e,t,n=0){this.source=e,this.target=t,this.value=n}static{p(this,`SankeyLink`)}},Aut=p((e,t,n)=>{Z8.push(new kut(e,t,n))},`addLink`),jut=class{constructor(e){this.ID=e}static{p(this,`SankeyNode`)}},Mut={nodesMap:$8,getConfig:p(()=>Z().sankey,`getConfig`),getNodes:p(()=>Q8,`getNodes`),getLinks:p(()=>Z8,`getLinks`),getGraph:p(()=>({nodes:Q8.map(e=>({id:e.ID})),links:Z8.map(e=>({source:e.source.ID,target:e.target.ID,value:e.value}))}),`getGraph`),addLink:Aut,findOrCreateNode:p(e=>{e=Vs.sanitizeText(e,Z());let t=$8.get(e);return t===void 0&&(t=new jut(e),$8.set(e,t),Q8.push(t)),t},`findOrCreateNode`),getAccTitle:Qs,setAccTitle:Zs,getAccDescription:ec,setAccDescription:$s,getDiagramTitle:nc,setDiagramTitle:tc,clear:Out},e5=class e{static{p(this,`Uid`)}static{this.count=0}static next(t){return new e(t+ ++e.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return`url(`+this.href+`)`}},Nut={left:Ult,right:Wlt,center:Klt,justify:Glt},Put=p(e=>{let t=0,n=0;for(let r of e){let e=r.value??0;e>t&&(t=e,n=r.layer??0)}return n},`findCentralNodeLayer`),Fut={draw:p(function(e,t,n,r){let{securityLevel:i,sankey:a}=Z(),o=ac.sankey,s;i===`sandbox`&&(s=$c(`#i`+t));let l=$c(i===`sandbox`?s.nodes()[0].contentDocument.body:`body`),u=i===`sandbox`?l.select(`[id="${t}"]`):$c(`[id="${t}"]`),d=a?.width??o.width,f=a?.height??o.width,m=a?.useMaxWidth??o.useMaxWidth,h=a?.nodeAlignment??o.nodeAlignment,g=a?.prefix??o.prefix,_=a?.suffix??o.suffix,v=a?.showValues??o.showValues,y=a?.nodeWidth??o.nodeWidth??10,b=a?.nodePadding??o.nodePadding??12,x=a?.labelStyle??o.labelStyle??`legacy`,S=a?.nodeColors??{},C=r.db.getGraph(),w=Nut[h];nut().nodeId(e=>e.id).nodeWidth(y).nodePadding(b+(v?15:0)).nodeAlign(w).extent([[0,0],[d,f]])(C);let T=Put(C.nodes),E=Ju(Xfe),D=p(e=>S[e]??E(e),`getNodeColor`);u.append(`g`).attr(`class`,`nodes`).selectAll(`.node`).data(C.nodes).join(`g`).attr(`class`,`node`).attr(`id`,e=>(e.uid=e5.next(`node-`)).id).attr(`transform`,function(e){return`translate(`+e.x0+`,`+e.y0+`)`}).attr(`x`,e=>e.x0).attr(`y`,e=>e.y0).append(`rect`).attr(`height`,e=>e.y1-e.y0).attr(`width`,e=>e.x1-e.x0).attr(`fill`,e=>D(e.id));let O=p(({id:e,value:t})=>v?`${e}2941+${g}${Math.round(t*100)/100}${_}`:e,`getText`),k=p(e=>x===`outlined`?(e.layer??0)<T?{x:e.x0-6,anchor:`end`}:{x:e.x1+6,anchor:`start`}:e.x0<d/2?{x:e.x1+6,anchor:`start`}:{x:e.x0-6,anchor:`end`},`getLabelPosition`),A=u.append(`g`).attr(`class`,`node-labels`).attr(`font-size`,14),j=p(e=>A.selectAll(e?`.${e}`:`text`).data(C.nodes).join(`text`).attr(`class`,e??null).attr(`x`,e=>k(e).x).attr(`y`,e=>(e.y1+e.y0)/2).attr(`dy`,`${v?`0`:`0.35`}em`).attr(`text-anchor`,e=>k(e).anchor).text(O),`appendLabel`);x===`outlined`?(j(`sankey-label-bg`),j(`sankey-label-fg`)):j();let M=u.append(`g`).attr(`class`,`links`).attr(`fill`,`none`).attr(`stroke-opacity`,.5).selectAll(`.link`).data(C.links).join(`g`).attr(`class`,`link`).style(`mix-blend-mode`,`multiply`),N=a?.linkColor??`gradient`;if(N===`gradient`){let e=M.append(`linearGradient`).attr(`id`,e=>(e.uid=e5.next(`linearGradient-`)).id).attr(`gradientUnits`,`userSpaceOnUse`).attr(`x1`,e=>e.source.x1).attr(`x2`,e=>e.target.x0);e.append(`stop`).attr(`offset`,`0%`).attr(`stop-color`,e=>D(e.source.id)),e.append(`stop`).attr(`offset`,`100%`).attr(`stop-color`,e=>D(e.target.id))}let P;switch(N){case`gradient`:P=p(e=>e.uid,`coloring`);break;case`source`:P=p(e=>D(e.source.id),`coloring`);break;case`target`:P=p(e=>D(e.target.id),`coloring`);break;default:P=N}M.append(`path`).attr(`d`,wut()).attr(`stroke`,P).attr(`stroke-width`,e=>Math.max(1,e.width)),Us(void 0,u,0,m)},`draw`)},Iut=p(e=>e.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,``).replaceAll(/([\n\r])+/g,`2942+`).trim(),`prepareTextForParsing`),Lut=p(e=>`.label {2943+ font-family: ${e.fontFamily};2944+ }2945+2946+ .node-labels {2947+ font-family: ${e.fontFamily};2948+ }2949+2950+ /* Outlined label style - background stroke for better readability */2951+ .sankey-label-bg {2952+ stroke: ${e.mainBkg||e.background||`#fff`};2953+ stroke-width: 4px;2954+ stroke-linejoin: round;2955+ paint-order: stroke;2956+ }2957+2958+ /* Foreground label text */2959+ .sankey-label-fg {2960+ fill: ${e.textColor};2961+ }2962+2963+ /* Node styling */2964+ .node rect {2965+ shape-rendering: crispEdges;2966+ }2967+2968+ /* Link styling */2969+ .link {2970+ fill: none;2971+ stroke-opacity: 0.5;2972+ mix-blend-mode: multiply;2973+ }2974+`,`getStyles`),Rut=X8.parse.bind(X8),X8.parse=e=>Rut(Iut(e)),zut={styles:Lut,parser:X8,db:Mut,renderer:Fut}})),Vut=l({diagram:()=>Xut}),Hut,t5,Uut,Wut,Gut,n5,Kut,qut,Jut,Yut,Xut,Zut=o((()=>{lR(),yp(),rh(),dc(),S(),h(),G0(),Hut=ns.packet,t5=class{constructor(){this.packet=[],this.setAccTitle=Zs,this.getAccTitle=Qs,this.setDiagramTitle=tc,this.getDiagramTitle=nc,this.getAccDescription=ec,this.setAccDescription=$s}static{p(this,`PacketDB`)}getConfig(){let e=Hm({...Hut,...ms().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){Xs(),this.packet=[]}},Uut=1e4,Wut=p((e,t)=>{cR(e,t);let n=-1,r=[],i=1,{bitsPerRow:a}=t.getConfig();for(let{start:o,end:s,bits:l,label:u}of e.blocks){if(o!==void 0&&s!==void 0&&s<o)throw Error(`Packet block ${o} - ${s} is invalid. End must be greater than start.`);if(o??=n+1,o!==n+1)throw Error(`Packet block ${o} - ${s??o} is not contiguous. It should start from ${n+1}.`);if(l===0)throw Error(`Packet block ${o} is invalid. Cannot have a zero bit field.`);for(s??=o+(l??1)-1,l??=s-o+1,n=s,y.debug(`Packet block ${o} - ${n} with label ${u}`);r.length<=a+1&&t.getPacket().length<Uut;){let[e,n]=Gut({start:o,end:s,bits:l,label:u},i,a);if(r.push(e),e.end+1===i*a&&(t.pushWord(r),r=[],i++),!n)break;({start:o,end:s,bits:l,label:u}=n)}}t.pushWord(r)},`populate`),Gut=p((e,t,n)=>{if(e.start===void 0)throw Error(`start should have been set during first phase`);if(e.end===void 0)throw Error(`end should have been set during first phase`);if(e.start>e.end)throw Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*n)return[e,void 0];let r=t*n-1,i=t*n;return[{start:e.start,end:r,label:e.label,bits:r-e.start},{start:i,end:e.end,label:e.label,bits:e.end-i}]},`getNextFittingBlock`),n5={parser:{yy:void 0},parse:p(async e=>{let t=await H0(`packet`,e),n=n5.parser?.yy;if(!(n instanceof t5))throw Error(`parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);y.debug(t),Wut(t,n)},`parse`)},Kut=p((e,t,n,r)=>{let i=r.db,a=i.getConfig(),{rowHeight:o,paddingY:s,bitWidth:l,bitsPerRow:u}=a,d=i.getPacket(),f=i.getDiagramTitle(),p=o+s,m=p*(d.length+1)-(f?0:o),h=l*u+2,g=vp(t);g.attr(`viewBox`,`0 0 ${h} ${m}`),Hs(g,m,h,a.useMaxWidth);for(let[e,t]of d.entries())qut(g,t,e,a);g.append(`text`).text(f).attr(`x`,h/2).attr(`y`,m-p/2).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).attr(`class`,`packetTitle`)},`draw`),qut=p((e,t,n,{rowHeight:r,paddingX:i,paddingY:a,bitWidth:o,bitsPerRow:s,showBits:l})=>{let u=e.append(`g`),d=n*(r+a)+a;for(let e of t){let t=e.start%s*o+1,n=(e.end-e.start+1)*o-i;if(u.append(`rect`).attr(`x`,t).attr(`y`,d).attr(`width`,n).attr(`height`,r).attr(`class`,`packetBlock`),u.append(`text`).attr(`x`,t+n/2).attr(`y`,d+r/2).attr(`class`,`packetLabel`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).text(e.label),!l)continue;let a=e.end===e.start,f=d-2;u.append(`text`).attr(`x`,t+(a?n/2:0)).attr(`y`,f).attr(`class`,`packetByte start`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,a?`middle`:`start`).text(e.start),a||u.append(`text`).attr(`x`,t+n).attr(`y`,f).attr(`class`,`packetByte end`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,`end`).text(e.end)}},`drawWord`),Jut={draw:Kut},Yut={byteFontSize:`10px`,startByteColor:`black`,endByteColor:`black`,labelColor:`black`,labelFontSize:`12px`,titleColor:`black`,titleFontSize:`14px`,blockStrokeColor:`black`,blockStrokeWidth:`1`,blockFillColor:`#efefef`},Xut={parser:n5,get db(){return new t5},renderer:Jut,styles:p(({packet:e}={})=>{let t=Hm(Yut,e);return`2975+ .packetByte {2976+ font-size: ${t.byteFontSize};2977+ }2978+ .packetByte.start {2979+ fill: ${t.startByteColor};2980+ }2981+ .packetByte.end {2982+ fill: ${t.endByteColor};2983+ }2984+ .packetLabel {2985+ fill: ${t.labelColor};2986+ font-size: ${t.labelFontSize};2987+ }2988+ .packetTitle {2989+ fill: ${t.titleColor};2990+ font-size: ${t.titleFontSize};2991+ }2992+ .packetBlock {2993+ stroke: ${t.blockStrokeColor};2994+ stroke-width: ${t.blockStrokeWidth};2995+ fill: ${t.blockFillColor};2996+ }2997+ `},`styles`)}})),Qut=l({diagram:()=>ydt});function $ut(e,t,n,r,i,a,o){let s=t.length,l=Math.min(o.width,o.height)/2;n.forEach((t,n)=>{if(t.entries.length!==s)return;let u=t.entries.map((e,t)=>{let n=2*Math.PI*t/s-Math.PI/2,a=edt(e,r,i,l);return{x:a*Math.cos(n),y:a*Math.sin(n)}});a===`circle`?e.append(`path`).attr(`d`,tdt(u,o.curveTension)).attr(`class`,`radarCurve-${n}`):a===`polygon`&&e.append(`polygon`).attr(`points`,u.map(e=>`${e.x},${e.y}`).join(` `)).attr(`class`,`radarCurve-${n}`)})}function edt(e,t,n,r){return r*(Math.min(Math.max(e,t),n)-t)/(n-t)}function tdt(e,t){let n=e.length,r=`M${e[0].x},${e[0].y}`;for(let i=0;i<n;i++){let a=e[(i-1+n)%n],o=e[i],s=e[(i+1)%n],l=e[(i+2)%n],u={x:o.x+(s.x-a.x)*t,y:o.y+(s.y-a.y)*t},d={x:s.x-(l.x-o.x)*t,y:s.y-(l.y-o.y)*t};r+=` C${u.x},${u.y} ${d.x},${d.y} ${s.x},${s.y}`}return`${r} Z`}function ndt(e,t,n,r){if(!n)return;let i=(r.width/2+r.marginRight)*3/4,a=-(r.height/2+r.marginTop)*3/4;t.forEach((t,n)=>{let r=e.append(`g`).attr(`transform`,`translate(${i}, ${a+n*20})`);r.append(`rect`).attr(`width`,12).attr(`height`,12).attr(`class`,`radarLegendBox-${n}`),r.append(`text`).attr(`x`,16).attr(`y`,0).attr(`class`,`radarLegendText`).text(t.label)})}var r5,i5,a5,o5,rdt,idt,s5,adt,odt,sdt,cdt,ldt,c5,udt,ddt,fdt,pdt,mdt,hdt,gdt,_dt,vdt,ydt,bdt=o((()=>{lR(),yp(),rh(),dc(),S(),h(),G0(),r5={showLegend:!0,ticks:5,max:null,min:0,graticule:`circle`},i5=32,a5={axes:[],curves:[],options:r5},o5=structuredClone(a5),rdt=ns.radar,idt=p(()=>Hm({...rdt,...ms().radar}),`getConfig`),s5=p(()=>o5.axes,`getAxes`),adt=p(()=>o5.curves,`getCurves`),odt=p(()=>o5.options,`getOptions`),sdt=p(e=>{o5.axes=e.map(e=>({name:e.name,label:e.label??e.name}))},`setAxes`),cdt=p(e=>{o5.curves=e.map(e=>({name:e.name,label:e.label??e.name,entries:ldt(e.entries)}))},`setCurves`),ldt=p(e=>{if(e[0].axis==null)return e.map(e=>e.value);let t=s5();if(t.length===0)throw Error(`Axes must be populated before curves for reference entries`);return t.map(t=>{let n=e.find(e=>e.axis?.$refText===t.name);if(n===void 0)throw Error(`Missing entry for axis `+t.label);return n.value})},`computeCurveEntries`),c5={getAxes:s5,getCurves:adt,getOptions:odt,setAxes:sdt,setCurves:cdt,setOptions:p(e=>{let t=e.reduce((e,t)=>(e[t.name]=t,e),{});o5.options={showLegend:t.showLegend?.value??r5.showLegend,ticks:t.ticks?.value??r5.ticks,max:t.max?.value??r5.max,min:t.min?.value??r5.min,graticule:t.graticule?.value??r5.graticule},o5.options.ticks>i5&&(y.warn(`Radar diagram ticks (${o5.options.ticks}) exceeds maximum allowed (${i5}). Using ${i5} instead.`),o5.options.ticks=i5)},`setOptions`),getConfig:idt,clear:p(()=>{Xs(),o5=structuredClone(a5)},`clear`),setAccTitle:Zs,getAccTitle:Qs,setDiagramTitle:tc,getDiagramTitle:nc,getAccDescription:ec,setAccDescription:$s},udt=p(e=>{cR(e,c5);let{axes:t,curves:n,options:r}=e;c5.setAxes(t),c5.setCurves(n),c5.setOptions(r)},`populate`),ddt={parse:p(async e=>{let t=await H0(`radar`,e);y.debug(t),udt(t)},`parse`)},fdt=p((e,t,n,r)=>{let i=r.db,a=i.getAxes(),o=i.getCurves(),s=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),d=pdt(vp(t),l),f=s.max??Math.max(...o.map(e=>Math.max(...e.entries))),p=s.min,m=Math.min(l.width,l.height)/2;mdt(d,a,m,s.ticks,s.graticule),hdt(d,a,m,l),$ut(d,a,o,p,f,s.graticule,l),ndt(d,o,s.showLegend,l),d.append(`text`).attr(`class`,`radarTitle`).text(u).attr(`x`,0).attr(`y`,-l.height/2-l.marginTop)},`draw`),pdt=p((e,t)=>{let n=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,i={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return Hs(e,r,n,t.useMaxWidth??!0),e.attr(`viewBox`,`0 0 ${n} ${r}`).attr(`overflow`,`visible`),e.append(`g`).attr(`transform`,`translate(${i.x}, ${i.y})`)},`drawFrame`),mdt=p((e,t,n,r,i)=>{if(i===`circle`)for(let t=0;t<r;t++){let i=n*(t+1)/r;e.append(`circle`).attr(`r`,i).attr(`class`,`radarGraticule`)}else if(i===`polygon`){let i=t.length;for(let a=0;a<r;a++){let o=n*(a+1)/r,s=t.map((e,t)=>{let n=2*t*Math.PI/i-Math.PI/2;return`${o*Math.cos(n)},${o*Math.sin(n)}`}).join(` `);e.append(`polygon`).attr(`points`,s).attr(`class`,`radarGraticule`)}}},`drawGraticule`),hdt=p((e,t,n,r)=>{let i=t.length;for(let a=0;a<i;a++){let o=t[a].label,s=2*a*Math.PI/i-Math.PI/2,l=Math.cos(s),u=Math.sin(s);e.append(`line`).attr(`x1`,0).attr(`y1`,0).attr(`x2`,n*r.axisScaleFactor*l).attr(`y2`,n*r.axisScaleFactor*u).attr(`class`,`radarAxisLine`);let d=l>.01?`start`:l<-.01?`end`:`middle`,f=u>.01?`hanging`:u<-.01?`auto`:`central`;e.append(`text`).text(o).attr(`x`,n*r.axisLabelFactor*l+4*l).attr(`y`,n*r.axisLabelFactor*u+4*u).attr(`text-anchor`,d).attr(`dominant-baseline`,f).attr(`class`,`radarAxisLabel`)}},`drawAxes`),p($ut,`drawCurves`),p(edt,`relativeRadius`),p(tdt,`closedRoundCurve`),p(ndt,`drawLegend`),gdt={draw:fdt},_dt=p((e,t)=>{let n=``;for(let r=0;r<e.THEME_COLOR_LIMIT;r++){let i=e[`cScale${r}`];n+=`2998+ .radarCurve-${r} {2999+ color: ${i};3000+ fill: ${i};diff truncated