diff --git a/.gitignore b/.gitignore index e98cf131..c6e5d5b5 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,25 @@ playwright-report/ test-results/ .worktrees/ -native/ + +# native/ holds the macOS Tauri app and the iOS app, and both are tracked. A +# blanket `native/` ignore made git skip them during a worktree scan, so every +# commit touching them needed `git add -f` and `git add -A` silently missed +# them entirely. Ignore the build output instead. +native/**/target/ +native/ios/.build/ +native/ios/.derivedData/ +native/macos/psyche-build-tauri/src-tauri/gen/schemas/ +**/xcuserdata/ +**/DerivedData/ + +# The tauri app is a pnpm workspace member, so the root pnpm-lock.yaml is the +# one pnpm reads and the one that pins its dependencies. A lockfile inside the +# member is a leftover from running `pnpm install` in that directory: nothing +# consumes it, and tracking it would give a second, silently drifting answer to +# "which versions does the desktop app use?". +native/macos/psyche-build-tauri/pnpm-lock.yaml + .vercel/ /.superpowers /.opencode diff --git a/__tests__/tauriCovenLaunch.test.ts b/__tests__/tauriCovenLaunch.test.ts index acb6d53b..26bb872c 100644 --- a/__tests__/tauriCovenLaunch.test.ts +++ b/__tests__/tauriCovenLaunch.test.ts @@ -890,6 +890,7 @@ describe('native Coven launch routing', () => { }, ); const closeThread = compileFunction<(id: string) => boolean>(functionSource('closeThread'), { + forgetThreadInSets: () => undefined, findThread: () => thread, detachThreadPane: () => null, pendingDataBuffers: new Map(), @@ -921,6 +922,7 @@ describe('native Coven launch routing', () => { const state = { threads: [thread], activeThreadId: thread.id }; let stopCalls = 0; const closeThread = compileFunction<(id: string) => boolean>(functionSource('closeThread'), { + forgetThreadInSets: () => undefined, findThread: () => thread, detachThreadPane: () => null, pendingDataBuffers: new Map(), @@ -995,6 +997,7 @@ describe('native Coven launch routing', () => { }, ); const closeThread = compileFunction<(id: string) => boolean>(functionSource('closeThread'), { + forgetThreadInSets: () => undefined, findThread: () => state.threads.find((value) => value.id === thread.id) || null, detachThreadPane: () => null, pendingDataBuffers: new Map(), diff --git a/__tests__/tauriCovenSessionSiderail.test.ts b/__tests__/tauriCovenSessionSiderail.test.ts index eb91d94c..0671cf15 100644 --- a/__tests__/tauriCovenSessionSiderail.test.ts +++ b/__tests__/tauriCovenSessionSiderail.test.ts @@ -1,7 +1,7 @@ import { readFileSync } from 'node:fs'; import { join } from 'node:path'; import { pathToFileURL } from 'node:url'; -import { describe, expect, it, vi } from 'vitest'; +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; const repoRoot = process.cwd(); const mainJs = readFileSync( @@ -85,6 +85,7 @@ class FakeElement { autocomplete = ''; focused = false; selected = false; + hidden = false; private ownText = ''; private html = ''; @@ -135,11 +136,13 @@ class FakeElement { const title = /([\s\S]*?)<\/span>/.exec(this.html); const sub = /([\s\S]*?)<\/span>/.exec(this.html); if (!title || !sub) return; - const glyph = /([\s\S]*?)<\/span>/.exec(this.html); + // The glyph carries git-state classes, so keep the class list verbatim + // rather than flattening it back to the bare hook. + const glyph = /]*>([\s\S]*?)<\/span>/.exec(this.html); if (glyph) { const glyphElement = new FakeElement('span'); - glyphElement.className = 'session-glyph'; - glyphElement.textContent = decodeHtml(glyph[1]); + glyphElement.className = glyph[1]; + glyphElement.textContent = decodeHtml(glyph[2]); this.appendChild(glyphElement); } const text = new FakeElement('span'); @@ -155,6 +158,16 @@ class FakeElement { onCanvas.className = 'session-oncanvas'; titleRow.appendChild(onCanvas); } + // Focus-set membership swatches, one per set the pane belongs to. + for (const match of this.html.matchAll( + / { child.parentNode = null; }); this.children = []; @@ -316,6 +337,9 @@ function createRenderer(options: { openCovenSession?: (project: Project, session: RemoteSession) => unknown; realEdit?: boolean; canvasThreadIds?: string[]; + focusSets?: Array<{ id: string; index: number; name: string; key: string; threadIds: string[] }>; + scopingSet?: { id: string; name: string; threadIds: string[] } | null; + setPicking?: { key: string; picked: string[] } | null; } = {}) { const document = new FakeDocument(); const sessionListEl = new FakeElement('div'); @@ -358,14 +382,36 @@ function createRenderer(options: { const setStatus = vi.fn(); const onCanvasIds = options.canvasThreadIds ?? []; const canvasThreadIds = vi.fn(() => onCanvasIds); + // Focus sets: the membership model is real (setsForThread / isPicked run from + // main.js), while the actions that need a live pane layout are spied. + const focusSets = options.focusSets ?? []; + const scopingSet = options.scopingSet ?? null; + const removeFromFocusSet = vi.fn(); + const applySetScopeForThread = vi.fn(); + const activateFocusSet = vi.fn(); + const clearFocusSet = vi.fn(); const paneGlyphFor = (kind: string) => kind === 'shell' ? '❯_' : kind === 'web' ? '◍' : '✳'; const sources = [ + 'var SESSION_CLOSE_SECONDS = 3;', + 'var armedSessionClose = null;', + 'var focusSets = seedFocusSets;', + 'var setPicking = seedSetPicking;', + extractFunctionSource(mainJs, 'paneLayoutKey'), + extractFunctionSource(mainJs, 'findFocusSet'), + extractFunctionSource(mainJs, 'setsForThread'), + extractFunctionSource(mainJs, 'isPicked'), + extractFunctionSource(mainJs, 'toggleSetPick'), extractFunctionSource(mainJs, 'isDormantThread'), extractFunctionSource(mainJs, 'covenSessionsForProject'), extractFunctionSource(mainJs, 'covenInlineState'), extractFunctionSource(mainJs, 'covenToneClass'), + extractFunctionSource(mainJs, 'sessionGitState'), + extractFunctionSource(mainJs, 'sessionLaneLabel'), + extractFunctionSource(mainJs, 'sessionSetSwatches'), + extractFunctionSource(mainJs, 'disarmSessionClose'), + extractFunctionSource(mainJs, 'armSessionClose'), extractFunctionSource(mainJs, 'createCovenSessionRow'), extractFunctionSource(mainJs, 'renderSessionList'), ]; @@ -374,11 +420,17 @@ function createRenderer(options: { 'covenDiscovery', 'PsycheSessions', 'sessionStatusClass', 'shortenRoot', 'escapeHtml', 'setActiveProject', 'focusThread', 'closeThread', 'hideThread', 'renameThread', 'editLabelInline', 'openCovenSession', 'setStatus', - 'canvasThreadIds', 'paneGlyphFor', + 'canvasThreadIds', 'paneGlyphFor', 'setInterval', 'clearInterval', + 'seedFocusSets', 'seedSetPicking', 'refreshSidebar', 'activeFocusSet', + 'removeFromFocusSet', 'applySetScopeForThread', 'activateFocusSet', 'clearFocusSet', `"use strict"; ${sources.join('\n')}; return { render: renderSessionList, setFilter: function (value) { sessionFilter = value; }, - setDiscovery: function (value) { covenDiscovery = value; } + setDiscovery: function (value) { covenDiscovery = value; }, + armSessionClose: armSessionClose, + disarmSessionClose: disarmSessionClose, + toggleSetPick: toggleSetPick, + picked: function () { return setPicking ? setPicking.picked.slice() : null; } };`, )( document, @@ -410,10 +462,26 @@ function createRenderer(options: { setStatus, canvasThreadIds, paneGlyphFor, + setInterval, + clearInterval, + focusSets, + options.setPicking ?? null, + () => { harness.render(); }, + () => scopingSet, + removeFromFocusSet, + applySetScopeForThread, + activateFocusSet, + clearFocusSet, ) as { render: () => void; setFilter: (value: string) => void; setDiscovery: (value: typeof discovery) => void; + armSessionClose: ( + wrapper: FakeElement, close: FakeElement, thread: { id: string; name: string }, + ) => void; + disarmSessionClose: () => void; + toggleSetPick: (threadId: string) => void; + picked: () => string[] | null; }; return { @@ -422,6 +490,11 @@ function createRenderer(options: { sessionListEl, state, discovery, + focusSets, + removeFromFocusSet, + applySetScopeForThread, + activateFocusSet, + clearFocusSet, setActiveProject, focusThread, closeThread, @@ -847,6 +920,219 @@ describe('Tauri Coven session project rail', () => { expect(wrapper?.querySelector('.session-close')?.title).toBe('Hide session'); }); + it('leads each row with the lane\'s git state and names the branch in the meta line', () => { + const renderer = createRenderer({ + projects: [{ + id: 'alpha', name: 'Alpha', root: '/alpha', + worktrees: [{ path: '/alpha/wt', branch: 'feat/tiling', dirty: true }], + }] as never, + threads: [{ + id: 'local', projectId: 'alpha', name: 'Local', status: 'running', + worktreePath: '/alpha/wt', + }] as never, + }); + renderer.render(); + + const glyph = renderer.sessionListEl.querySelector('.session-glyph'); + expect(glyph?.textContent).toBe('±'); + expect(glyph?.className).toContain('git-dirty'); + // Colour is never the only carrier: the tooltip says the same thing. + const html = renderer.sessionListEl.querySelector('.session-row')?.innerHTML ?? ''; + expect(html).toContain('title="Uncommitted changes"'); + // The kind lives in the meta line now that the glyph carries git state. + expect(renderer.sessionListEl.querySelector('.session-sub')?.textContent) + .toBe('shell · feat/tiling'); + }); + + it('marks a clean lane without implying there is work in it', () => { + const renderer = createRenderer({ + projects: [{ + id: 'alpha', name: 'Alpha', root: '/alpha', + worktrees: [{ path: '/alpha/wt', branch: 'main', dirty: false }], + }] as never, + threads: [{ + id: 'local', projectId: 'alpha', name: 'Local', status: 'running', + worktreePath: '/alpha/wt', + }] as never, + }); + renderer.render(); + + const glyph = renderer.sessionListEl.querySelector('.session-glyph'); + expect(glyph?.textContent).toBe('⎇'); + expect(glyph?.className).toContain('git-clean'); + }); + + it('renders no set swatches for a pane that belongs to no focus set', () => { + const renderer = createRenderer({ + threads: [{ id: 'local', projectId: 'alpha', name: 'Local', status: 'running' }], + }); + renderer.render(); + + expect(renderer.sessionListEl.querySelector('.session-row')?.innerHTML ?? '') + .not.toContain('session-set-swatch'); + }); + + describe('focus sets', () => { + const threads = [ + { id: 'local', projectId: 'alpha', name: 'Local', status: 'running', worktreePath: '/alpha' }, + { id: 'other', projectId: 'alpha', name: 'Other', status: 'running', worktreePath: '/alpha' }, + ] as never; + // Sets are filed under the pane layout key, which paneLayoutKey builds as + // projectId + NUL + worktreePath. + const key = 'alpha/alpha'; + const memberSet = { + id: 'set-1', index: 2, name: 'Review', key, threadIds: ['local'], + }; + + it('marks membership with the set\'s coloured square and names it', () => { + const renderer = createRenderer({ threads, focusSets: [memberSet] }); + renderer.render(); + + const rows = renderer.sessionListEl.querySelectorAll('.session-row'); + const swatch = rows[0].querySelector('.session-set-swatch'); + expect(swatch?.dataset.set).toBe('2'); + // Colour is never the only carrier — the tooltip names the set. + expect(swatch?.title).toBe('In Review'); + expect(rows[1].querySelector('.session-set-swatch')).toBeNull(); + }); + + it('scopes the canvas to a member\'s set when the row is clicked', async () => { + const renderer = createRenderer({ threads, focusSets: [memberSet] }); + renderer.render(); + + await renderer.sessionListEl.querySelectorAll('.session-row')[0].emit('click'); + + expect(renderer.applySetScopeForThread).toHaveBeenCalled(); + expect(renderer.focusThread).toHaveBeenCalledWith('local'); + }); + + it('turns rows into checkboxes while picking, without focusing anything', async () => { + const renderer = createRenderer({ + threads, + setPicking: { key, picked: ['local'] }, + }); + renderer.render(); + + const rows = renderer.sessionListEl.querySelectorAll('.session-row'); + expect(rows[0].classList.contains('is-picked')).toBe(true); + expect(rows[0].getAttribute('aria-pressed')).toBe('true'); + expect(rows[1].classList.contains('is-picking')).toBe(true); + expect(rows[1].getAttribute('aria-pressed')).toBe('false'); + expect(rows[1].title).toBe('Include Other in the set'); + + await rows[1].emit('click'); + + // Picking must not drag the canvas around under the user. + expect(renderer.focusThread).not.toHaveBeenCalled(); + expect(renderer.picked()).toEqual(['local', 'other']); + }); + + it('turns × into "remove from set" while a set scopes the canvas', async () => { + const renderer = createRenderer({ + threads, + focusSets: [memberSet], + scopingSet: { id: 'set-1', name: 'Review', threadIds: ['local'] }, + }); + renderer.render(); + + const wrappers = renderer.sessionListEl.querySelectorAll('.session-row-wrap'); + const close = wrappers[0].querySelector('.session-close'); + expect(close?.title).toBe('Remove from Review — the pane stays open'); + + await close?.emit('click'); + + expect(renderer.removeFromFocusSet).toHaveBeenCalledWith('set-1', 'local'); + // The pane is not going anywhere — only its membership changed. + expect(renderer.hideThread).not.toHaveBeenCalled(); + expect(renderer.closeThread).not.toHaveBeenCalled(); + }); + + it('leaves × as hide for a pane the scoping set does not contain', async () => { + const renderer = createRenderer({ + threads, + focusSets: [memberSet], + scopingSet: { id: 'set-1', name: 'Review', threadIds: ['local'] }, + }); + renderer.render(); + + const wrappers = renderer.sessionListEl.querySelectorAll('.session-row-wrap'); + await wrappers[1].querySelector('.session-close')?.emit('click'); + + expect(renderer.hideThread).toHaveBeenCalledWith('other'); + expect(renderer.removeFromFocusSet).not.toHaveBeenCalled(); + }); + + it('returns to all panes when the project header is clicked', async () => { + const renderer = createRenderer({ threads, focusSets: [memberSet] }); + renderer.render(); + + await renderer.sessionListEl.querySelector('.session-group-head')?.emit('click'); + + expect(renderer.clearFocusSet).toHaveBeenCalled(); + }); + }); + + describe('timed close confirm', () => { + function armed() { + const renderer = createRenderer({ + threads: [{ id: 'local', projectId: 'alpha', name: 'Local', status: 'running' }], + }); + renderer.render(); + const wrapper = renderer.sessionListEl.querySelector('.session-row-wrap')!; + const close = wrapper.querySelector('.session-close')!; + renderer.armSessionClose(wrapper, close, { id: 'local', name: 'Local' }); + return { renderer, wrapper, close }; + } + + beforeEach(() => { vi.useFakeTimers(); }); + afterEach(() => { vi.useRealTimers(); }); + + it('replaces the × with a counting confirm instead of closing', () => { + const { renderer, wrapper, close } = armed(); + + const confirm = wrapper.querySelector('.session-close-confirm'); + expect(confirm?.textContent).toBe('Close · 3'); + expect(close.hidden).toBe(true); + expect(renderer.closeThread).not.toHaveBeenCalled(); + + vi.advanceTimersByTime(1000); + expect(confirm?.textContent).toBe('Close · 2'); + }); + + it('closes only on a second, deliberate click', async () => { + const { renderer, wrapper } = armed(); + + const confirm = wrapper.querySelector('.session-close-confirm')!; + const event = await confirm.emit('click'); + + expect(renderer.closeThread).toHaveBeenCalledWith('local'); + expect(event.propagationStopped).toBe(true); + expect(wrapper.querySelector('.session-close-confirm')).toBeNull(); + }); + + it('cancels itself when the countdown runs out', () => { + const { renderer, wrapper, close } = armed(); + + vi.advanceTimersByTime(3000); + + expect(wrapper.querySelector('.session-close-confirm')).toBeNull(); + expect(close.hidden).toBe(false); + expect(renderer.closeThread).not.toHaveBeenCalled(); + }); + + it('drops an armed confirm when the sidebar re-renders under it', () => { + const { renderer, wrapper } = armed(); + + renderer.render(); + + expect(wrapper.querySelector('.session-close-confirm')).toBeNull(); + expect(renderer.closeThread).not.toHaveBeenCalled(); + // The stale interval must not resurrect anything after the re-render. + vi.advanceTimersByTime(5000); + expect(renderer.closeThread).not.toHaveBeenCalled(); + }); + }); + it('mounts the real local rename input beside controls and restores activation after settle', async () => { const renderer = createRenderer({ activeThreadId: 'local', @@ -919,8 +1205,15 @@ describe('Tauri Coven session project rail', () => { expect(styles).toMatch(/\.session-row-wrap:hover\s+\.session-row:not\(\.active\)/); expect(styles).not.toMatch(/\.session-row-wrap:hover\s+\.session-row\s*\{/); expect(styles).toMatch( - /\.session-row,\s*\.session-coven-row\s*\{[^}]*padding:\s*6px 8px;[^}]*border-radius:\s*8px;/s, + /\.session-row,\s*\.session-coven-row\s*\{[^}]*padding:\s*6px 8px;[^}]*border-radius:\s*7px;/s, ); + // The 44px row is the sidebar's scanning rhythm. + expect(styles).toMatch(/\.session-row\s*\{\s*min-height:\s*var\(--session-row-h\);/); + // Selection is a neutral fill; only the focus bar is violet. + expect(styles).toMatch(/\.session-row\.active\s*\{[^}]*background:\s*var\(--surface-3\);/s); + expect(styles).toMatch(/\.session-glyph\.git-dirty\s*\{\s*color:\s*var\(--warn\);/); + expect(styles).toMatch(/\.session-set-swatch\s*\{[^}]*border-radius:\s*2px;/s); + expect(styles).toMatch(/\.session-close-confirm\s*\{[^}]*animation:\s*close-confirm-slide/s); expect(styles).toMatch(/\.session-row-wrap\s*\{[^}]*position:\s*relative;/s); expect(styles).toMatch(/\.session-row\.inline-edit-hidden\s*\{[^}]*visibility:\s*hidden;/s); expect(styles).toMatch(/\.session-row-wrap\s*>\s*\.inline-edit\s*\{[^}]*position:\s*absolute;/s); diff --git a/__tests__/tauriPaneTree.test.ts b/__tests__/tauriPaneTree.test.ts index 545103bb..9cd304b4 100644 --- a/__tests__/tauriPaneTree.test.ts +++ b/__tests__/tauriPaneTree.test.ts @@ -25,6 +25,8 @@ describe('Tauri physical pane tree', () => { 'moveLeaf', 'removeLeaf', 'resizeSplit', + 'retainThreads', + 'spanLayout', 'splitOrientation', ]); }); @@ -439,6 +441,135 @@ describe('Tauri pane tree 2D tiling', () => { expect(panes.moveLeaf(null, 'leaf-a', 'leaf-b', 'left', 's')).toBe(null); }); + describe('retainThreads', () => { + const trio = () => panes.insertBelow( + column(), 'leaf-b', panes.createLeaf('leaf-c', 'thread-c'), 'split-2', + ); + + test('keeps the named panes and collapses the splits left holding one child', () => { + const kept = panes.retainThreads(trio(), ['thread-a', 'thread-c']); + + expect(panes.leafIds(kept)).toEqual(['leaf-a', 'leaf-c']); + // split-2 lost leaf-b, so it collapses instead of leaving an empty slot. + expect(JSON.stringify(kept)).not.toContain('split-2'); + }); + + test('accepts a Set as readily as an array', () => { + const kept = panes.retainThreads(trio(), new Set(['thread-b'])); + + expect(kept).toMatchObject({ type: 'leaf', id: 'leaf-b' }); + }); + + test('returns null when nothing survives, so callers can tell empty from all', () => { + expect(panes.retainThreads(trio(), [])).toBeNull(); + expect(panes.retainThreads(trio(), ['thread-gone'])).toBeNull(); + expect(panes.retainThreads(null, ['thread-a'])).toBeNull(); + }); + + test('returns the same root when every pane is kept', () => { + const tree = trio(); + + expect(panes.retainThreads(tree, ['thread-a', 'thread-b', 'thread-c'])).toBe(tree); + }); + + test('leaves the tiled tree untouched', () => { + const tree = trio(); + const snapshot = JSON.stringify(tree); + + panes.retainThreads(tree, ['thread-a']); + + expect(JSON.stringify(tree)).toBe(snapshot); + }); + + test('produces a layout the rect maths can place', () => { + const kept = panes.retainThreads(trio(), ['thread-a', 'thread-c']); + const result = panes.layoutRects(kept, { x: 0, y: 0, width: 900, height: 600 }, minimums); + + expect(result.leaves).toHaveLength(2); + for (const geometry of result.leaves) { + expect(geometry.height).toBeGreaterThanOrEqual(minimums.height); + } + }); + }); + + describe('spanLayout', () => { + // Three panes, so there is a genuine "the others" to stack. + const trio = () => panes.insertBelow( + column(), 'leaf-b', panes.createLeaf('leaf-c', 'thread-c'), 'split-2', + ); + + test('gives the spanned pane a full column and stacks the rest beside it', () => { + const spanned = panes.spanLayout(trio(), 'leaf-b', 'row', 'span'); + + expect(spanned.orientation).toBe('row'); + expect(spanned.first).toMatchObject({ type: 'leaf', id: 'leaf-b' }); + // The others keep their order and stack along the opposite axis. + expect(spanned.second.orientation).toBe('column'); + expect(panes.leafIds(spanned.second)).toEqual(['leaf-a', 'leaf-c']); + expect(panes.leafIds(spanned)).toEqual(['leaf-b', 'leaf-a', 'leaf-c']); + }); + + test('gives the spanned pane a full row and lines the rest up below', () => { + const spanned = panes.spanLayout(trio(), 'leaf-a', 'column', 'span'); + + expect(spanned.orientation).toBe('column'); + expect(spanned.first).toMatchObject({ type: 'leaf', id: 'leaf-a' }); + expect(spanned.second.orientation).toBe('row'); + expect(panes.leafIds(spanned.second)).toEqual(['leaf-b', 'leaf-c']); + }); + + test('splits the remainder into equal shares rather than halving away', () => { + const four = panes.insertBelow( + trio(), 'leaf-c', panes.createLeaf('leaf-d', 'thread-d'), 'split-3', + ); + const spanned = panes.spanLayout(four, 'leaf-a', 'row', 'span'); + + // Three others: the first divider gives away 1/3, the next 1/2 of what + // is left — three equal shares. + expect(spanned.second.ratio).toBeCloseTo(1 / 3); + expect(spanned.second.second.ratio).toBeCloseTo(1 / 2); + }); + + test('is deterministic, so a rebuild keeps the ids its dividers resized', () => { + const first = panes.spanLayout(trio(), 'leaf-b', 'row', 'span'); + const second = panes.spanLayout(trio(), 'leaf-b', 'row', 'span'); + + expect(JSON.stringify(first)).toBe(JSON.stringify(second)); + expect(first.id).toBe('span-main'); + }); + + test('leaves the tiled tree untouched', () => { + const tree = trio(); + const snapshot = JSON.stringify(tree); + + panes.spanLayout(tree, 'leaf-b', 'row', 'span'); + + expect(JSON.stringify(tree)).toBe(snapshot); + }); + + test('returns the original root when there is nothing to span', () => { + const tree = trio(); + const lone = panes.createLeaf('leaf-a', 'thread-a'); + + expect(panes.spanLayout(tree, 'missing', 'row', 'span')).toBe(tree); + expect(panes.spanLayout(lone, 'leaf-a', 'row', 'span')).toBe(lone); + expect(panes.spanLayout(null, 'leaf-a', 'row', 'span')).toBe(null); + }); + + test('produces a layout the rect maths can place', () => { + const spanned = panes.spanLayout(trio(), 'leaf-b', 'row', 'span'); + const rect = { x: 0, y: 0, width: 1200, height: 700 }; + + const result = panes.layoutRects(spanned, rect, minimums); + + expect(result.leaves).toHaveLength(3); + for (const geometry of result.leaves) { + expect(geometry.width).toBeGreaterThanOrEqual(minimums.width); + expect(geometry.height).toBeGreaterThanOrEqual(minimums.height); + } + }); + }); + test('keeps mixed row-and-column layouts inside their rect', () => { const tree = panes.moveLeaf( panes.insertBelow(column(), 'leaf-b', panes.createLeaf('leaf-c', 'thread-c'), 'split-2'), diff --git a/__tests__/tauriPhysicalPanes.test.ts b/__tests__/tauriPhysicalPanes.test.ts index ea17fcf1..9f007496 100644 --- a/__tests__/tauriPhysicalPanes.test.ts +++ b/__tests__/tauriPhysicalPanes.test.ts @@ -269,6 +269,7 @@ describe('Tauri physical terminal panes', () => { 'requestAnimationFrame', 'terminalHost', 'activePaneLayout', + 'effectivePaneRoot', 'PsychePanes', 'measuredTerminalHost', 'PANE_MINIMUMS', @@ -283,6 +284,7 @@ describe('Tauri physical terminal panes', () => { raf: (callback: () => void) => number, host: typeof terminalHost, activeLayout: () => typeof layout, + effectiveRoot: (value: typeof layout) => unknown, panes: { layoutRects: () => { leaves: Array<{ threadId: string }> } }, measure: () => Record, minimums: Record, @@ -293,6 +295,7 @@ describe('Tauri physical terminal panes', () => { (callback) => { queued.push(callback); return queued.length; }, terminalHost, () => layout, + (value) => value && value.root, { layoutRects: () => ({ leaves: [ @@ -345,7 +348,7 @@ describe('Tauri physical terminal panes', () => { it('keeps pane topology process-local and keys it by project and worktree', () => { expect(mainJs).toMatch(/var paneLayouts = new Map\(\);/); expect(mainJs).toMatch(/var paneCounter = 0;/); - expect(mainJs).toMatch(/var PANE_MINIMUMS = \{ width: 320, height: 120, separator: 6 \};/); + expect(mainJs).toMatch(/var PANE_MINIMUMS = \{ width: 200, height: 110, separator: 6 \};/); expect(functionSource('paneLayoutKey')).toMatch(/projectId[\s\S]*worktreePath/); expect(functionSource('preparePanePlacement')).toMatch(/PsychePanes\.createLeaf/); expect(functionSource('preparePanePlacement')).toMatch(/PsychePanes\.insertBelow/); @@ -385,7 +388,10 @@ describe('Tauri physical terminal panes', () => { const thread = { id: 'thread-a' }; const bodyTarget = { id: 'body-target' }; const closeTarget = { id: 'close-target' }; - const headerTarget = { id: 'header-target' }; + const headerTarget = { id: 'header-target', closest: () => null }; + // Any other header button — focusing on its pointerdown would detach the + // pane before pointerup and swallow the click it was about to receive. + const spanTarget = { id: 'span-target', closest: (sel: string) => sel === 'button' ? spanTarget : null }; const body = { contains: (target: unknown) => target === bodyTarget }; const close = { contains: (target: unknown) => target === closeTarget }; const state = { activeThreadId: 'thread-b' }; @@ -402,6 +408,7 @@ describe('Tauri physical terminal panes', () => { handlePanePointerDown(thread, body, close, { target: bodyTarget }); handlePanePointerDown(thread, body, close, { target: closeTarget }); + handlePanePointerDown(thread, body, close, { target: spanTarget }); expect(focused).toEqual([]); handlePanePointerDown(thread, body, close, { target: headerTarget }); expect(focused).toEqual([thread.id]); @@ -519,7 +526,16 @@ describe('Tauri physical terminal panes', () => { ); const syncThreadPaneMetadata = compileFunction<(value: typeof thread) => void>( functionSource('syncThreadPaneMetadata'), - { applyPaneStatus }, + { + applyPaneStatus, + threadLaneLabel: () => 'main', + // No pane tree in this harness: the span/maximise controls have nothing + // to reflect, which is exactly the detached-pane case. + paneLayoutForThread: () => null, + PsychePanes: { findLeafByThreadId: () => null }, + syncPaneSpanControl: () => undefined, + syncPaneMaxControl: () => undefined, + }, ); // Running is shown as a dot, so the label moves to the class and aria-label // and the visible text goes away. @@ -630,6 +646,7 @@ describe('Tauri physical terminal panes', () => { const thread = createThread({ project, command: '/bin/zsh' }); pendingDataBuffers.set('thread-a', [new Uint8Array([1])]); const closeThread = compileFunction<(id: string) => boolean>(functionSource('closeThread'), { + forgetThreadInSets: () => undefined, findThread: () => thread, detachThreadPane: () => null, pendingDataBuffers, @@ -697,6 +714,7 @@ describe('Tauri physical terminal panes', () => { const starting = spawnPty(thread); expect(thread.startInFlight).toBe(true); const closeThread = compileFunction<(id: string) => boolean>(functionSource('closeThread'), { + forgetThreadInSets: () => undefined, findThread: () => thread, detachThreadPane: () => null, pendingDataBuffers, @@ -907,4 +925,259 @@ describe('Tauri physical terminal panes', () => { await expect(runNewPsycheCommand()).resolves.toBeNull(); expect(spawned).toBe(0); }); + + describe('span and focus modes', () => { + type Leaf = { type: 'leaf'; id: string; threadId: string }; + type Layout = { + root: Record; + focusedLeafId: string | null; + spanMode?: string | null; + spanRoot?: unknown; + spanSignature?: string | null; + maximizedLeafId?: string | null; + activeSetId?: string | null; + }; + + function tree(): Record { + return { + type: 'split', id: 'split-1', orientation: 'column', ratio: 0.5, + first: { type: 'leaf', id: 'leaf-a', threadId: 'thread-a' }, + second: { type: 'leaf', id: 'leaf-b', threadId: 'thread-b' }, + }; + } + + type FocusSet = { id: string; index: number; name: string; key: string; threadIds: string[] }; + + function compileModeHelpers( + layout: Layout, + extras: Record = {}, + sets: FocusSet[] = [], + ) { + const factory = Function( + 'PsychePanes', 'activePaneLayout', 'paneLayoutFor', 'state', + 'focusThread', 'renderPaneWorkspace', 'seedSets', + `"use strict"; + var SPAN_ORIENTATION = { column: "row", row: "column" }; + var focusSets = seedSets; + var findFocusSet = ${functionSource('findFocusSet')}; + var scopedPaneRoot = ${functionSource('scopedPaneRoot')}; + var spanSignature = ${functionSource('spanSignature')}; + var effectivePaneRoot = ${functionSource('effectivePaneRoot')}; + var paneLayoutForThread = ${functionSource('paneLayoutForThread')}; + var cyclePaneSpan = ${functionSource('cyclePaneSpan')}; + var togglePaneMaximize = ${functionSource('togglePaneMaximize')}; + var exitPaneMaximize = ${functionSource('exitPaneMaximize')}; + return { effectivePaneRoot, scopedPaneRoot, cyclePaneSpan, togglePaneMaximize, + exitPaneMaximize };`, + ); + return factory( + PsychePanes, + () => layout, + () => layout, + { activeThreadId: 'thread-a', ...(extras.state as object ?? {}) }, + extras.focusThread ?? (() => undefined), + extras.renderPaneWorkspace ?? (() => undefined), + sets, + ) as { + effectivePaneRoot: (value: Layout) => Record | null; + scopedPaneRoot: (value: Layout) => Record | null; + cyclePaneSpan: (thread: { id: string }) => void; + togglePaneMaximize: (thread: { id: string }) => void; + exitPaneMaximize: () => boolean; + }; + } + + it('cycles tiled → full column → full row → tiled without editing the tiled tree', () => { + const layout: Layout = { root: tree(), focusedLeafId: 'leaf-a' }; + const snapshot = JSON.stringify(layout.root); + const helpers = compileModeHelpers(layout); + + expect(helpers.effectivePaneRoot(layout)).toBe(layout.root); + + helpers.cyclePaneSpan({ id: 'thread-a' }); + expect(layout.spanMode).toBe('column'); + // Mode "column" means the pane gets a column, so the top split runs across. + expect(helpers.effectivePaneRoot(layout)).toMatchObject({ orientation: 'row' }); + + helpers.cyclePaneSpan({ id: 'thread-a' }); + expect(layout.spanMode).toBe('row'); + expect(helpers.effectivePaneRoot(layout)).toMatchObject({ orientation: 'column' }); + + helpers.cyclePaneSpan({ id: 'thread-a' }); + expect(layout.spanMode).toBeNull(); + expect(helpers.effectivePaneRoot(layout)).toBe(layout.root); + expect(JSON.stringify(layout.root)).toBe(snapshot); + }); + + it('restarts the cycle when a different pane is spanned', () => { + const layout: Layout = { root: tree(), focusedLeafId: 'leaf-a' }; + const helpers = compileModeHelpers(layout, { state: { activeThreadId: 'thread-a' } }); + + helpers.cyclePaneSpan({ id: 'thread-a' }); + helpers.cyclePaneSpan({ id: 'thread-a' }); + expect(layout.spanMode).toBe('row'); + + // Spanning a different pane starts from the first mode again rather than + // inheriting where the previous pane had got to — otherwise one click on + // a fresh pane could land it straight back in tiled. + helpers.cyclePaneSpan({ id: 'thread-b' }); + expect(layout.spanMode).toBe('column'); + expect(layout.focusedLeafId).toBe('leaf-b'); + }); + + it('caches the derived tree until membership or the spanned pane changes', () => { + const layout: Layout = { root: tree(), focusedLeafId: 'leaf-a', spanMode: 'column' }; + const helpers = compileModeHelpers(layout); + + const first = helpers.effectivePaneRoot(layout); + // Same inputs: the same object, so a divider drag on it survives a render. + expect(helpers.effectivePaneRoot(layout)).toBe(first); + + layout.focusedLeafId = 'leaf-b'; + expect(helpers.effectivePaneRoot(layout)).not.toBe(first); + }); + + it('renders only the maximised pane and restores the tiling on exit', () => { + const layout: Layout = { root: tree(), focusedLeafId: 'leaf-a' }; + const helpers = compileModeHelpers(layout); + + helpers.togglePaneMaximize({ id: 'thread-b' }); + expect(layout.maximizedLeafId).toBe('leaf-b'); + const maximized = helpers.effectivePaneRoot(layout) as unknown as Leaf; + expect(maximized.type).toBe('leaf'); + expect(maximized.threadId).toBe('thread-b'); + + expect(helpers.exitPaneMaximize()).toBe(true); + expect(layout.maximizedLeafId).toBeNull(); + expect(helpers.effectivePaneRoot(layout)).toBe(layout.root); + // Nothing to leave: esc must fall through to the next cascade step. + expect(helpers.exitPaneMaximize()).toBe(false); + }); + + it('drops a maximised pane that is no longer in the tree', () => { + const layout: Layout = { + root: tree(), focusedLeafId: 'leaf-a', maximizedLeafId: 'leaf-gone', + }; + const helpers = compileModeHelpers(layout); + + expect(helpers.effectivePaneRoot(layout)).toBe(layout.root); + expect(layout.maximizedLeafId).toBeNull(); + }); + + it('maximising wins over spanning, so focus mode is always one pane', () => { + const layout: Layout = { + root: tree(), focusedLeafId: 'leaf-a', spanMode: 'column', maximizedLeafId: 'leaf-a', + }; + const helpers = compileModeHelpers(layout); + + expect((helpers.effectivePaneRoot(layout) as unknown as Leaf).type).toBe('leaf'); + }); + + it('resizes the derived tree while spanning so visible dividers move', () => { + expect(functionSource('updateActiveSplit')) + .toMatch(/var spanning = Boolean\(layout\.spanMode\)[\s\S]*if \(spanning\) layout\.spanRoot = nextRoot;/); + }); + + describe('focus-set scoping', () => { + const set = (threadIds: string[]): FocusSet => ({ + id: 'set-1', index: 1, name: 'Set 1', key: 'k', threadIds, + }); + + it('draws only the set\'s panes without editing the tiling', () => { + const layout: Layout = { root: tree(), focusedLeafId: 'leaf-a', activeSetId: 'set-1' }; + const snapshot = JSON.stringify(layout.root); + const helpers = compileModeHelpers(layout, {}, [set(['thread-b'])]); + + const scoped = helpers.effectivePaneRoot(layout) as unknown as Leaf; + expect(scoped.type).toBe('leaf'); + expect(scoped.threadId).toBe('thread-b'); + expect(JSON.stringify(layout.root)).toBe(snapshot); + }); + + it('stops scoping when the set has lost every pane', () => { + const layout: Layout = { root: tree(), focusedLeafId: 'leaf-a', activeSetId: 'set-1' }; + const helpers = compileModeHelpers(layout, {}, [set([])]); + + expect(helpers.effectivePaneRoot(layout)).toBe(layout.root); + expect(layout.activeSetId).toBeNull(); + }); + + it('stops scoping when the set names panes that are no longer tiled', () => { + const layout: Layout = { root: tree(), focusedLeafId: 'leaf-a', activeSetId: 'set-1' }; + const helpers = compileModeHelpers(layout, {}, [set(['thread-gone'])]); + + expect(helpers.effectivePaneRoot(layout)).toBe(layout.root); + expect(layout.activeSetId).toBeNull(); + }); + + it('ignores an activeSetId that names no set at all', () => { + const layout: Layout = { root: tree(), focusedLeafId: 'leaf-a', activeSetId: 'ghost' }; + const helpers = compileModeHelpers(layout, {}, []); + + expect(helpers.effectivePaneRoot(layout)).toBe(layout.root); + expect(layout.activeSetId).toBeNull(); + }); + + it('spans within the set, not around it', () => { + // Three panes, two of them in the set: spanning inside the set must + // stack only the set's other member beside the spanned pane. + const root = PsychePanes.insertBelow( + tree(), 'leaf-b', PsychePanes.createLeaf('leaf-c', 'thread-c'), 'split-2', + ); + const layout: Layout = { + root, focusedLeafId: 'leaf-a', spanMode: 'column', activeSetId: 'set-1', + }; + const helpers = compileModeHelpers(layout, {}, [set(['thread-a', 'thread-c'])]); + + const spanned = helpers.effectivePaneRoot(layout); + expect(PsychePanes.leafIds(spanned)).toEqual(['leaf-a', 'leaf-c']); + }); + + it('keeps focus mode above scoping — one pane means one pane', () => { + const layout: Layout = { + root: tree(), focusedLeafId: 'leaf-a', activeSetId: 'set-1', maximizedLeafId: 'leaf-a', + }; + const helpers = compileModeHelpers(layout, {}, [set(['thread-b'])]); + + const shown = helpers.effectivePaneRoot(layout) as unknown as Leaf; + expect(shown.threadId).toBe('thread-a'); + }); + }); + }); + + describe('pane frame', () => { + it('gives the header six tracks so its buttons never clip', () => { + expect(stylesCss).toMatch( + /\.terminal-pane-header\s*\{[^}]*display:\s*grid;[^}]*grid-template-columns:\s*auto minmax\(0, 1fr\) auto auto auto auto;/s, + ); + expect(functionSource('mountTerminal')).toMatch( + /header\.appendChild\(glyph\);[\s\S]*header\.appendChild\(label\);[\s\S]*header\.appendChild\(status\);[\s\S]*header\.appendChild\(span\);[\s\S]*header\.appendChild\(maximize\);[\s\S]*header\.appendChild\(close\)/, + ); + }); + + it('degrades on its own width rather than the window\'s', () => { + expect(stylesCss).toMatch(/\.terminal-pane\s*\{[^}]*container-type:\s*inline-size;[^}]*container-name:\s*pane;/s); + expect(stylesCss).toMatch(/@container pane \(max-width: 460px\)\s*\{\s*\.terminal-pane-meta\s*\{\s*display:\s*none;/); + expect(stylesCss).toMatch(/@container pane \(max-width: 300px\)/); + }); + + it('keeps the CSS pane floor and the tree\'s minimums in agreement', () => { + expect(stylesCss).toMatch(/--pane-min-w:\s*200px;/); + expect(stylesCss).toMatch(/--pane-min-h:\s*110px;/); + expect(stylesCss).toMatch(/\.terminal-pane\s*\{[^}]*min-width:\s*var\(--pane-min-w\);[^}]*min-height:\s*var\(--pane-min-h\);/s); + }); + + it('words every status but running, which stays a static dot', () => { + expect(stylesCss).toMatch(/\.terminal-pane-status\s*\{[^}]*border-radius:\s*999px;/s); + expect(stylesCss).toMatch(/\.terminal-pane-status\.running\s*\{[^}]*border-radius:\s*50%;/s); + // Board 5 gives the only pulse to "needs you"; running is steady. + expect(stylesCss).not.toMatch(/\.terminal-pane-status\.running\s*\{[^}]*animation:/s); + }); + + it('double-clicking the header enters focus mode, but not on its buttons', () => { + expect(functionSource('mountTerminal')).toMatch( + /header\.addEventListener\("dblclick"[\s\S]*closest\("button"\)\) return;[\s\S]*togglePaneMaximize\(thread\)/, + ); + }); + }); }); diff --git a/__tests__/tauriWebBundles.test.ts b/__tests__/tauriWebBundles.test.ts new file mode 100644 index 00000000..8648505a --- /dev/null +++ b/__tests__/tauriWebBundles.test.ts @@ -0,0 +1,111 @@ +import { execFileSync } from 'node:child_process'; +import { existsSync, mkdtempSync, readFileSync, rmSync } from 'node:fs'; +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; +import { afterAll, describe, expect, it } from 'vitest'; + +/** + * The three web bundles are build output that is committed, so nothing but a + * test stops them drifting from the sources they were built from. This rebuilds + * each one with the *same* flags the build script uses -- parsed out of + * package.json rather than restated here, so changing the build cannot leave + * the check validating yesterday's command -- and compares the bytes. + */ +const packageRoot = join(process.cwd(), 'native/macos/psyche-build-tauri'); +const webRoot = join(packageRoot, 'web'); + +/** + * Where the esbuild binary lands depends on how the workspace was installed: + * a fresh clone gives the member its own node_modules, while an install that + * can dedupe against an existing one may only hoist it to the workspace root. + * Assuming a single location made this check fail with "esbuild is not + * installed" in a perfectly good tree, so try both before giving up. + */ +function resolveEsbuild(): string | null { + const candidates = [ + join(packageRoot, 'node_modules/.bin/esbuild'), + join(process.cwd(), 'node_modules/.bin/esbuild'), + ]; + return candidates.find((candidate) => existsSync(candidate)) ?? null; +} + +const buildScript = ( + JSON.parse(readFileSync(join(packageRoot, 'package.json'), 'utf8')) as { + scripts: Record; + } +).scripts['build:web']; + +/** One `esbuild --outfile=web/x.bundle.js` step of build:web. */ +type BundleStep = { argv: string[]; outfile: string }; + +function parseBuildScript(script: string): BundleStep[] { + return script.split('&&').map((command) => { + const argv = command.trim().split(/\s+/); + expect(argv[0]).toBe('esbuild'); + const outfileArg = argv.find((arg) => arg.startsWith('--outfile=')); + if (!outfileArg) throw new Error(`build:web step has no --outfile: ${command}`); + return { argv: argv.slice(1), outfile: outfileArg.slice('--outfile='.length) }; + }); +} + +const steps = parseBuildScript(buildScript); +const scratch = mkdtempSync(join(tmpdir(), 'psyche-bundles-')); +afterAll(() => rmSync(scratch, { recursive: true, force: true })); + +describe('committed web bundles', () => { + it('builds every bundle index.html loads', () => { + // If a bundle stops being produced, the freshness checks below would have + // nothing to compare and would quietly pass. + expect(steps.map((step) => step.outfile).sort()).toEqual([ + 'web/editor.bundle.js', + 'web/panes.bundle.js', + 'web/sessions.bundle.js', + ]); + }); + + it('ships every script index.html references', () => { + const html = readFileSync(join(webRoot, 'index.html'), 'utf8'); + const sources = [...html.matchAll(/src="\.\/([^"]+)"/g)].map((match) => match[1]); + expect(sources.length).toBeGreaterThan(0); + // The blanket `native/` ignore once let a referenced bundle be deleted with + // nothing in `git status` to show for it, leaving the app unable to boot. + const missing = sources.filter((source) => !existsSync(join(webRoot, source))); + expect(missing).toEqual([]); + }); + + for (const step of steps) { + it(`${step.outfile} matches its sources`, () => { + const committed = join(packageRoot, step.outfile); + expect(existsSync(committed), `${step.outfile} is missing — run pnpm build:web`).toBe(true); + + const esbuild = resolveEsbuild(); + if (!esbuild) { + throw new Error( + 'esbuild is not installed for psyche-build-tauri. Run `pnpm install` at the ' + + 'repo root — it is a workspace member, so a root install provides it.', + ); + } + + const rebuilt = join(scratch, step.outfile.replace(/\//g, '_')); + const argv = step.argv.map((arg) => + arg.startsWith('--outfile=') ? `--outfile=${rebuilt}` : arg, + ); + execFileSync(esbuild, argv, { cwd: packageRoot, stdio: 'pipe' }); + + // Byte comparison, not a hash, so a failure can point at the divergence. + // Equal-length drift is the common case -- an edited source usually + // rebuilds to the same size -- so length alone would be a poor message. + const fresh = readFileSync(rebuilt); + const onDisk = readFileSync(committed); + const at = onDisk.length === fresh.length + ? onDisk.findIndex((byte, index) => byte !== fresh[index]) + : Math.min(onDisk.length, fresh.length); + expect( + onDisk.equals(fresh), + `${step.outfile} is stale: committed ${onDisk.length} bytes, rebuild ` + + `${fresh.length}, first difference at byte ${at}. ` + + 'Run pnpm build:web and commit the result.', + ).toBe(true); + }); + } +}); diff --git a/native/macos/psyche-build-tauri/web/editor.bundle.js b/native/macos/psyche-build-tauri/web/editor.bundle.js new file mode 100644 index 00000000..e4a1a709 --- /dev/null +++ b/native/macos/psyche-build-tauri/web/editor.bundle.js @@ -0,0 +1,33 @@ +"use strict";var PsycheCodeEditor=(()=>{var Mo=Object.defineProperty;var uS=Object.getOwnPropertyDescriptor;var dS=Object.getOwnPropertyNames;var pS=Object.prototype.hasOwnProperty;var mS=(i,e)=>{for(var t in e)Mo(i,t,{get:e[t],enumerable:!0})},gS=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of dS(e))!pS.call(i,r)&&r!==t&&Mo(i,r,{get:()=>e[r],enumerable:!(n=uS(e,r))||n.enumerable});return i};var QS=i=>gS(Mo({},"__esModule",{value:!0}),i);var jv={};mS(jv,{createDiffViewer:()=>Av,createDiffViewerState:()=>dc,createFileBuffer:()=>sS,createFileEditor:()=>_v,createFileEditorState:()=>uc,createLruCache:()=>OS,createRequestGate:()=>aS,diffClass:()=>fS,languageForPath:()=>rS,markFileSaved:()=>fc,reconcileFileSave:()=>oS,shouldRenderFileSaveChrome:()=>lS,updateFileBuffer:()=>cc});var Go=[],Sc=[];(()=>{let i="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 e=0,t=0;e>1;if(i=Sc[n])e=n+1;else return!0;if(e==t)return!1}}function mc(i){return i>=127462&&i<=127487}var gc=8205;function Pc(i,e,t=!0,n=!0){return(t?$c:PS)(i,e,n)}function $c(i,e,t){if(e==i.length)return e;e&&bc(i.charCodeAt(e))&&yc(i.charCodeAt(e-1))&&e--;let n=Uo(i,e);for(e+=Qc(n);e=0&&mc(Uo(i,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function PS(i,e,t){for(;e>1;){let n=$c(i,e-2,t);if(n=56320&&i<57344}function yc(i){return i>=55296&&i<56320}function Qc(i){return i<65536?1:2}var j=class i{lineAt(e){if(e<0||e>this.length)throw new 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 new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=Ui(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),ji.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]=Ui(this,e,t);let n=[];return this.decompose(e,t,n,0),ji.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 pi(this),s=new pi(e);for(let o=t,l=t;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=n)return!0}}iter(e=1){return new pi(this,e)}iterRange(e,t=this.length){return new Yr(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(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 Vr(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?i.empty:e.length<=32?new je(e):ji.from(je.split(e,[]))}},je=class i extends j{constructor(e,t=$S(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 s=0;;s++){let o=this.text[s],l=r+o.length;if((t?n:l)>=e)return new Do(r,l,n,o);r=l+1,n++}}decompose(e,t,n,r){let s=e<=0&&t>=this.length?this:new i(xc(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let o=n.pop(),l=_r(s.text,o.text.slice(),0,s.length);if(l.length<=32)n.push(new i(l,o.length+s.length));else{let a=l.length>>1;n.push(new i(l.slice(0,a)),new i(l.slice(a)))}}else n.push(s)}replace(e,t,n){if(!(n instanceof i))return super.replace(e,t,n);[e,t]=Ui(this,e,t);let r=_r(this.text,_r(n.text,xc(this.text,0,e)),t),s=this.length+n.length-(t-e);return r.length<=32?new i(r,s):ji.from(i.split(r,[]),s)}sliceString(e,t=this.length,n=` +`){[e,t]=Ui(this,e,t);let r="";for(let s=0,o=0;s<=t&&oe&&o&&(r+=n),es&&(r+=l.slice(Math.max(0,e-s),t-s)),s=a+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let s of e)n.push(s),r+=s.length+1,n.length==32&&(t.push(new i(n,r)),n=[],r=-1);return r>-1&&t.push(new i(n,r)),t}},ji=class i extends j{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,a=n+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,n,r);r=l+1,n=a+1}}decompose(e,t,n,r){for(let s=0,o=0;o<=t&&s=o){let O=r&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!O?n.push(l):l.decompose(e-o,t-o,n,O)}o=a+1}}replace(e,t,n){if([e,t]=Ui(this,e,t),n.lines=s&&t<=l){let a=o.replace(e-s,t-s,n),O=this.lines-o.lines+a.lines;if(a.lines>4&&a.lines>O>>6){let h=this.children.slice();return h[r]=a,new i(h,this.length-(t-e)+n.length)}return super.replace(s,l,a)}s=l+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=` +`){[e,t]=Ui(this,e,t);let r="";for(let s=0,o=0;se&&s&&(r+=n),eo&&(r+=l.sliceString(e-o,t-o,n)),o=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof i))return 0;let n=0,[r,s,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==o||s==l)return n;let a=this.children[r],O=e.children[s];if(a!=O)return n+a.scanIdentical(O,t);n+=a.length+1}}static from(e,t=e.reduce((n,r)=>n+r.length+1,-1)){let n=0;for(let u of e)n+=u.lines;if(n<32){let u=[];for(let p of e)p.flatten(u);return new je(u,t)}let r=Math.max(32,n>>5),s=r<<1,o=r>>1,l=[],a=0,O=-1,h=[];function c(u){let p;if(u.lines>s&&u instanceof i)for(let m of u.children)c(m);else u.lines>o&&(a>o||!a)?(f(),l.push(u)):u instanceof je&&a&&(p=h[h.length-1])instanceof je&&u.lines+p.lines<=32?(a+=u.lines,O+=u.length+1,h[h.length-1]=new je(p.text.concat(u.text),p.length+1+u.length)):(a+u.lines>r&&f(),a+=u.lines,O+=u.length+1,h.push(u))}function f(){a!=0&&(l.push(h.length==1?h[0]:i.from(h,O)),O=-1,a=h.length=0)}for(let u of e)c(u);return f(),l.length==1?l[0]:new i(l,t)}};j.empty=new je([""],0);function $S(i){let e=-1;for(let t of i)e+=t.length+1;return e}function _r(i,e,t=0,n=1e9){for(let r=0,s=0,o=!0;s=t&&(a>n&&(l=l.slice(0,n-r)),r0?1:(e instanceof je?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],s=this.offsets[n],o=s>>1,l=r instanceof je?r.text.length:r.children.length;if(o==(t>0?l: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((s&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=` +`,this;e--}else if(r instanceof je){let a=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof je?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},Yr=class{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new pi(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!=""}},Vr=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"&&(j.prototype[Symbol.iterator]=function(){return this.iter()},pi.prototype[Symbol.iterator]=Yr.prototype[Symbol.iterator]=Vr.prototype[Symbol.iterator]=function(){return this});var Do=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 Ui(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}function ae(i,e,t=!0,n=!0){return Pc(i,e,t,n)}function bS(i){return i>=56320&&i<57344}function yS(i){return i>=55296&&i<56320}function Se(i,e){let t=i.charCodeAt(e);if(!yS(t)||e+1==i.length)return t;let n=i.charCodeAt(e+1);return bS(n)?(t-55296<<10)+(n-56320)+65536:t}function Xn(i){return i<=65535?String.fromCharCode(i):(i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320))}function Me(i){return i<65536?1:2}var Io=/\r\n?|\n/,pe=(function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i})(pe||(pe={})),wt=class i{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return s+(e-r);s+=l}else{if(n!=pe.Simple&&O>=e&&(n==pe.TrackDel&&re||n==pe.TrackBefore&&re))return null;if(O>e||O==e&&t<0&&!l)return e==r||t<0?s:s+a;s+=a}r=O}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let n=0,r=0;n=0&&r<=t&&l>=e)return rt?"cover":!0;r=l}return!1}toString(){let e="";for(let t=0;t=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new i(e)}static create(e){return new i(e)}},Xe=class i extends wt{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Bo(this,(t,n,r,s,o)=>e=e.replace(r,r+(n-t),o),!1),e}mapDesc(e,t=!1){return No(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let r=0,s=0;r=0){t[r]=l,t[r+1]=o;let a=r>>1;for(;n.length0&&Gt(n,t,s.text),s.forward(h),l+=h}let O=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,n){let r=[],s=[],o=0,l=null;function a(h=!1){if(!h&&!r.length)return;of||c<0||f>t)throw new RangeError(`Invalid change range ${c} to ${f} (in doc of length ${t})`);let p=u?typeof u=="string"?j.of(u.split(n||Io)):u:j.empty,m=p.length;if(c==f&&m==0)return;co&&be(r,c-o,-1),be(r,f-c,m),Gt(s,r,p),o=f}}return O(e),a(!l),l}static empty(e){return new i(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let r=0;rl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;n.length=0&&t<=0&&t==i[r+1]?i[r]+=e:r>=0&&e==0&&i[r]==0?i[r+1]+=t:n?(i[r]+=e,i[r+1]+=t):i.push(e,t)}function Gt(i,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n>1])),!(t||o==i.sections.length||i.sections[o+1]<0);)l=i.sections[o++],a=i.sections[o++];e(r,O,s,h,c),r=O,s=h}}}function No(i,e,t,n=!1){let r=[],s=n?[]:null,o=new mi(i),l=new mi(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let O=Math.min(o.len,l.len);be(r,O,-1),o.forward(O),l.forward(O)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let O=0,h=o.len;for(;h;)if(l.ins==-1){let c=Math.min(h,l.len);O+=c,h-=c,l.forward(c)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||n.length>O),s.forward2(a),o.forward(a)}}}}var mi=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?j.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?j.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)}},fi=class i{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(e,t=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new i(n,r,this.flags,this.goalColumn)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return P.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return P.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 new RangeError("Invalid JSON representation for SelectionRange");return P.range(e.anchor,e.head)}static create(e,t,n,r){return new i(e,t,n,r)}},P=class i{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:i.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;ne.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new i(e.ranges.map(t=>fi.fromJSON(t)),e.main)}static single(e,t=e){return new i([i.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,r=0;rr.from-s.from),t=e.indexOf(n);for(let r=1;rs.head?i.range(a,l):i.range(l,a))}}return new i(e,t)}};function Rc(i,e){for(let t of i.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}var sl=0,v=class i{constructor(e,t,n,r,s){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=sl++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new i(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:ol),!!e.static,e.enables)}of(e){return new Ei([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ei(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ei(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}};function ol(i,e){return i==e||i.length==e.length&&i.every((t,n)=>t===e[n])}var Ei=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=sl++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,a=!1,O=!1,h=[];for(let c of this.dependencies)c=="doc"?a=!0:c=="selection"?O=!0:(((t=e[c.id])!==null&&t!==void 0?t:1)&1)==0&&h.push(e[c.id]);return{create(c){return c.values[o]=n(c),1},update(c,f){if(a&&f.docChanged||O&&(f.docChanged||f.selection)||Fo(c,h)){let u=n(c);if(l?!wc(u,c.values[o],r):!r(u,c.values[o]))return c.values[o]=u,1}return 0},reconfigure:(c,f)=>{let u,p=f.config.address[s];if(p!=null){let m=Mr(f,p);if(this.dependencies.every(g=>g instanceof v?f.facet(g)===c.facet(g):g instanceof se?f.field(g,!1)==c.field(g,!1):!0)||(l?wc(u=n(c),m,r):r(u=n(c),m)))return c.values[o]=m,0}else u=n(c);return c.values[o]=u,1}}}get extension(){return this}};function wc(i,e,t){if(i.length!=e.length)return!1;for(let n=0;ni[a.id]),r=t.map(a=>a.type),s=n.filter(a=>!(a&1)),o=i[e.id]>>1;function l(a){let O=[];for(let h=0;hn===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(qr).find(n=>n.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,r)=>{let s=n.values[t],o=this.updateF(s,r);return this.compareF(s,o)?0:(n.values[t]=o,1)},reconfigure:(n,r)=>{let s=n.facet(qr),o=r.facet(qr),l;return(l=s.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(n.values[t]=l.create(n),1):r.config.address[this.id]!=null?(n.values[t]=r.field(this),0):(n.values[t]=this.create(n),1)}}}init(e){return[this,qr.of({field:this,create:e})]}get extension(){return this}},ui={lowest:4,low:3,default:2,high:1,highest:0};function bn(i){return e=>new Ar(e,i)}var ze={highest:bn(ui.highest),high:bn(ui.high),default:bn(ui.default),low:bn(ui.low),lowest:bn(ui.lowest)},Ar=class{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}},jr=class i{of(e){return new xn(this,e)}reconfigure(e){return i.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}},xn=class{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}},Er=class i{constructor(e,t,n,r,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let r=[],s=Object.create(null),o=new Map;for(let f of wS(e,t,o))f instanceof se?r.push(f):(s[f.facet.id]||(s[f.facet.id]=[])).push(f);let l=Object.create(null),a=[],O=[];for(let f of r)l[f.id]=O.length<<1,O.push(u=>f.slot(u));let h=n?.config.facets;for(let f in s){let u=s[f],p=u[0].facet,m=h&&h[f]||[];if(u.every(g=>g.type==0))if(l[p.id]=a.length<<1|1,ol(m,u))a.push(n.facet(p));else{let g=p.combine(u.map(Q=>Q.value));a.push(n&&p.compare(g,n.facet(p))?n.facet(p):g)}else{for(let g of u)g.type==0?(l[g.id]=a.length<<1|1,a.push(g.value)):(l[g.id]=O.length<<1,O.push(Q=>g.dynamicSlot(Q)));l[p.id]=O.length<<1,O.push(g=>xS(g,p,u))}}let c=O.map(f=>f(l));return new i(e,o,c,l,a,s)}};function wS(i,e,t){let n=[[],[],[],[],[]],r=new Map;function s(o,l){let a=r.get(o);if(a!=null){if(a<=l)return;let O=n[a].indexOf(o);O>-1&&n[a].splice(O,1),o instanceof xn&&t.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let O of o)s(O,l);else if(o instanceof xn){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let O=e.get(o.compartment)||o.inner;t.set(o.compartment,O),s(O,l)}else if(o instanceof Ar)s(o.inner,o.prec);else if(o instanceof se)n[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof Ei)n[l].push(o),o.facet.extensions&&s(o.facet.extensions,ui.default);else{let O=o.extension;if(!O)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(O==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(O,l)}}return s(i,ui.default),n.reduce((o,l)=>o.concat(l))}function yn(i,e){if(e&1)return 2;let t=e>>1,n=i.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;i.status[t]=4;let r=i.computeSlot(i,i.config.dynamicSlots[t]);return i.status[t]=2|r}function Mr(i,e){return e&1?i.config.staticValues[e>>1]:i.values[e>>1]}var Zc=v.define(),Ho=v.define({combine:i=>i.some(e=>e),static:!0}),Wc=v.define({combine:i=>i.length?i[0]:void 0,static:!0}),qc=v.define(),zc=v.define(),Cc=v.define(),_c=v.define({combine:i=>i.length?i[0]:!1}),qe=class{constructor(e,t){this.type=e,this.value=t}static define(){return new Ko}},Ko=class{of(e){return new qe(this,e)}},Jo=class{constructor(e){this.map=e}of(e){return new z(this,e)}},z=class i{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new i(this.type,t)}is(e){return this.type==e}static define(e={}){return new Jo(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let s=r.map(t);s&&n.push(s)}return n}};z.reconfigure=z.define();z.appendConfig=z.define();var he=class i{constructor(e,t,n,r,s,o){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,n&&Rc(n,t.newLength),s.some(l=>l.type==i.time)||(this.annotations=s.concat(i.time.of(Date.now())))}static create(e,t,n,r,s,o){return new i(e,t,n,r,s,o)}get newDoc(){return this._doc||(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(e){let t=this.annotation(i.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}};he.time=qe.define();he.userEvent=qe.define();he.addToHistory=qe.define();he.remote=qe.define();function kS(i,e){let t=[];for(let n=0,r=0;;){let s,o;if(n=i[n]))s=i[n++],o=i[n++];else if(r=0;r--){let s=n[r](i);s instanceof he?i=s:Array.isArray(s)&&s.length==1&&s[0]instanceof he?i=s[0]:i=Vc(e,Mi(s),!1)}return i}function vS(i){let e=i.startState,t=e.facet(Cc),n=i;for(let r=t.length-1;r>=0;r--){let s=t[r](i);s&&Object.keys(s).length&&(n=Yc(n,el(e,s,i.changes.newLength),!0))}return n==i?i:he.create(e,i.changes,i.selection,n.effects,n.annotations,n.scrollIntoView)}var TS=[];function Mi(i){return i==null?TS:Array.isArray(i)?i:[i]}var H=(function(i){return i[i.Word=0]="Word",i[i.Space=1]="Space",i[i.Other=2]="Other",i})(H||(H={})),RS=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,tl;try{tl=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function ZS(i){if(tl)return tl.test(i);for(let e=0;e"\x80"&&(t.toUpperCase()!=t.toLowerCase()||RS.test(t)))return!0}return!1}function WS(i){return e=>{if(!/\S/.test(e))return H.Space;if(ZS(e))return H.Word;for(let t=0;t-1)return H.Word;return H.Other}}var G=class i{constructor(e,t,n,r,s,o){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;lr.set(O,a)),t=null),r.set(l.value.compartment,l.value.extension)):l.is(z.reconfigure)?(t=null,n=l.value):l.is(z.appendConfig)&&(t=null,n=Mi(n).concat(l.value));let s;t?s=e.startState.values.slice():(t=Er.resolve(n,r,this),s=new i(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,O)=>O.reconfigure(a,this),null).values);let o=e.startState.facet(Ho)?e.newSelection:e.newSelection.asSingle();new i(t,e.newDoc,o,s,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:P.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),s=[n.range],o=Mi(n.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return i.create({doc:e.doc,selection:P.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=Er.resolve(e.extensions||[],new Map),n=e.doc instanceof j?e.doc:j.of((e.doc||"").split(t.staticFacet(i.lineSeparator)||Io)),r=e.selection?e.selection instanceof P?e.selection:P.single(e.selection.anchor,e.selection.head):P.single(0);return Rc(r,n.length),t.staticFacet(Ho)||(r=r.asSingle()),new i(t,n,r,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(i.tabSize)}get lineBreak(){return this.facet(i.lineSeparator)||` +`}get readOnly(){return this.facet(_c)}phrase(e,...t){for(let n of this.facet(i.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>t.length?n:t[s-1]})),e}languageDataAt(e,t,n=-1){let r=[];for(let s of this.facet(Zc))for(let o of s(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return WS(t.length?t[0]:"")}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-n,l=e-n;for(;o>0;){let a=ae(t,o,!1);if(s(t.slice(a,o))!=H.Word)break;o=a}for(;li.length?i[0]:4});G.lineSeparator=Wc;G.readOnly=_c;G.phrases=v.define({compare(i,e){let t=Object.keys(i),n=Object.keys(e);return t.length==n.length&&t.every(r=>i[r]==e[r])}});G.languageData=Zc;G.changeFilter=qc;G.transactionFilter=zc;G.transactionExtender=Cc;jr.reconfigure=z.define();function ye(i,e,t={}){let n={};for(let r of i)for(let s of Object.keys(r)){let o=r[s],l=n[s];if(l===void 0)n[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,s))n[s]=t[s](l,o);else throw new Error("Config merge conflict for field "+s)}for(let r in e)n[r]===void 0&&(n[r]=e[r]);return n}var Ke=class{eq(e){return this==e}range(e,t=e){return wn.create(e,t,this)}};Ke.prototype.startSide=Ke.prototype.endSide=0;Ke.prototype.point=!1;Ke.prototype.mapMode=pe.TrackDel;function ll(i,e){return i==e||i.constructor==e.constructor&&i.eq(e)}var wn=class i{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new i(e,t,n)}};function il(i,e){return i.from-e.from||i.value.startSide-e.value.startSide}var nl=class i{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 s=n?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let a=o+l>>1,O=s[a]-e||(n?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return O>=0?o:l;O>=0?l=a:o=a+1}}between(e,t,n,r){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,s);su||f==u&&O.startSide>0&&O.endSide<=0)continue;(u-f||O.endSide-O.startSide)<0||(o<0&&(o=f),O.point&&(l=Math.max(l,u-f)),n.push(O),r.push(f-o),s.push(u-o))}return{mapped:n.length?new i(r,s,n,l):null,pos:o}}},L=class i{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new i(e,t,n,r)}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(e){let{add:t=[],sort:n=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(n&&(t=t.slice().sort(il)),this.isEmpty)return t.length?i.of(t):this;let l=new Ur(this,null,-1).goto(0),a=0,O=[],h=new Ee;for(;l.value||a=0){let c=t[a++];h.addInner(c.from,c.to,c.value)||O.push(c)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||sl.to||s=s&&e<=s+o.length&&o.between(s,e-s,t-s,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return kn.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return kn.from(e).goto(t)}static compare(e,t,n,r,s=-1){let o=e.filter(c=>c.maxPoint>0||!c.isEmpty&&c.maxPoint>=s),l=t.filter(c=>c.maxPoint>0||!c.isEmpty&&c.maxPoint>=s),a=kc(o,l,n),O=new di(o,a,s),h=new di(l,a,s);n.iterGaps((c,f,u)=>Xc(O,c,h,f,u,r)),n.empty&&n.length==0&&Xc(O,0,h,0,0,r)}static eq(e,t,n=0,r){r==null&&(r=999999999);let s=e.filter(h=>!h.isEmpty&&t.indexOf(h)<0),o=t.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=kc(s,o),a=new di(s,l,0).goto(n),O=new di(o,l,0).goto(n);for(;;){if(a.to!=O.to||!rl(a.active,O.active)||a.point&&(!O.point||!ll(a.point,O.point)))return!1;if(a.to>r)return!0;a.next(),O.next()}}static spans(e,t,n,r,s=-1){let o=new di(e,null,s).goto(t),l=t,a=o.openStart;for(;;){let O=Math.min(o.to,n);if(o.point){let h=o.activeForPoint(o.to),c=o.pointFroml&&(r.span(l,O,o.active,a),a=o.openEnd(O));if(o.to>n)return a+(o.point&&o.to>n?1:0);l=o.to,o.next()}}static of(e,t=!1){let n=new Ee;for(let r of e instanceof wn?[e]:t?qS(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return i.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=i.empty;r=r.nextLayer)t=new i(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}};L.empty=new L([],[],null,-1);function qS(i){if(i.length>1)for(let e=i[0],t=1;t0)return i.slice().sort(il);e=n}return i}L.empty.nextLayer=L.empty;var Ee=class i{finishChunk(e){this.chunks.push(new nl(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(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new i)).add(e,t,n)}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 new 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(L.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=L.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function kc(i,e,t){let n=new Map;for(let s of i)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&r.push(new Ur(o,t,n,s));return r.length==1?r[0]:new i(r)}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 n=this.heap.length>>1;n>=0;n--)Lo(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)Lo(this.heap,n);(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(),Lo(this.heap,0)}}};function Lo(i,e){for(let t=i[e];;){let n=(e<<1)+1;if(n>=i.length)break;let r=i[n];if(n+1=0&&(r=i[n+1],n++),t.compare(r)<0)break;i[n]=t,i[e]=r,e=n}}var di=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=kn.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){zr(this.active,e),zr(this.activeTo,e),zr(this.activeRank,e),this.minActive=vc(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:s}=this.cursor;for(;t0;)t++;Cr(this.active,t,n),Cr(this.activeTo,t,r),Cr(this.activeRank,t,s),e&&Cr(e,t,this.cursor.from),this.minActive=vc(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&&zr(n,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&n[r]=0&&!(this.activeRank[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 Xc(i,e,t,n,r,s){i.goto(e),t.goto(n);let o=n+r,l=n,a=n-e,O=!!s.boundChange;for(let h=!1;;){let c=i.to+a-t.to,f=c||i.endSide-t.endSide,u=f<0?i.to+a:t.to,p=Math.min(u,o);if(i.point||t.point?(i.point&&t.point&&ll(i.point,t.point)&&rl(i.activeForPoint(i.to),t.activeForPoint(t.to))||s.comparePoint(l,p,i.point,t.point),h=!1):(h&&s.boundChange(l),p>l&&!rl(i.active,t.active)&&s.compareRange(l,p,i.active,t.active),O&&po)break;l=u,f<=0&&i.next(),f>=0&&t.next()}}function rl(i,e){if(i.length!=e.length)return!1;for(let t=0;t=e;n--)i[n+1]=i[n];i[e]=t}function vc(i,e){let t=-1,n=1e9;for(let r=0;r=e)return r;if(r==i.length)break;s+=i.charCodeAt(r)==9?t-s%t:1,r=ae(i,r)}return n===!0?-1:i.length}var Ac=typeof Symbol>"u"?"__\u037C":Symbol.for("\u037C"),al=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),jc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},Je=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,a,O){let h=[],c=/^@(\w+)\b/.exec(o[0]),f=c&&c[1]=="keyframes";if(c&&l==null)return a.push(o[0]+";");for(let u in l){let p=l[u];if(/&/.test(u))s(u.split(/,\s*/).map(m=>o.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),p,a);else if(p&&typeof p=="object"){if(!c)throw new RangeError("The value of a property ("+u+") should be a primitive value.");s(r(u),p,h,f)}else p!=null&&h.push(u.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(h.length||f)&&a.push((n&&!c&&!O?o.map(n):o).join(", ")+" {"+h.join(" ")+"}")}for(let o in e)s(r(o),e[o],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=jc[Ac]||1;return jc[Ac]=e+1,"\u037C"+e.toString(36)}static mount(e,t,n){let r=e[al],s=n&&n.nonce;r?s&&r.setNonce(s):r=new Ol(e,s),r.mount(Array.isArray(t)?t:[t],e)}},Ec=new Map,Ol=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=Ec.get(n);if(s)return e[al]=s;this.sheet=new r.CSSStyleSheet,Ec.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[al]=this}mount(e,t){let n=this.sheet,r=0,s=0;for(let o=0;o-1&&(this.modules.splice(a,1),s--,a=-1),a==-1){if(this.modules.splice(s++,0,l),n)for(let O=0;O",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},zS=typeof navigator<"u"&&/Mac/.test(navigator.platform),CS=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(ce=0;ce<10;ce++)kt[48+ce]=kt[96+ce]=String(ce);var ce;for(ce=1;ce<=24;ce++)kt[ce+111]="F"+ce;var ce;for(ce=65;ce<=90;ce++)kt[ce]=String.fromCharCode(ce+32),Gi[ce]=String.fromCharCode(ce);var ce;for(Lr in kt)Gi.hasOwnProperty(Lr)||(Gi[Lr]=kt[Lr]);var Lr;function Mc(i){var e=zS&&i.metaKey&&i.shiftKey&&!i.ctrlKey&&!i.altKey||CS&&i.shiftKey&&i.key&&i.key.length==1||i.key=="Unidentified",t=!e&&i.key||(i.shiftKey?Gi:kt)[i.keyCode]||i.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 I(){var i=arguments[0];typeof i=="string"&&(i=document.createElement(i));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];typeof r=="string"?i.setAttribute(n,r):r!=null&&(i[n]=r)}e++}for(;e2),R={mac:Dc||/Mac/.test(Te.platform),windows:/Win/.test(Te.platform),linux:/Linux|X11/.test(Te.platform),ie:xs,ie_version:Tf?Sl.documentMode||6:$l?+$l[1]:Pl?+Pl[1]:0,gecko:Gc,gecko_version:Gc?+(/Firefox\/(\d+)/.exec(Te.userAgent)||[0,0])[1]:0,chrome:!!hl,chrome_version:hl?+hl[1]:0,ios:Dc,android:/Android\b/.test(Te.userAgent),webkit:Lc,webkit_version:Lc?+(/\bAppleWebKit\/(\d+)/.exec(Te.userAgent)||[0,0])[1]:0,safari:bl,safari_version:bl?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Te.userAgent)||[0,0])[1]:0,tabSize:Sl.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function da(i,e){for(let t in i)t=="class"&&e.class?e.class+=" "+i.class:t=="style"&&e.style?e.style+=";"+i.style:e[t]=i[t];return e}var os=Object.create(null);function pa(i,e,t){if(i==e)return!0;i||(i=os),e||(e=os);let n=Object.keys(i),r=Object.keys(e);if(n.length-(t&&n.indexOf(t)>-1?1:0)!=r.length-(t&&r.indexOf(t)>-1?1:0))return!1;for(let s of n)if(s!=t&&(r.indexOf(s)==-1||i[s]!==e[s]))return!1;return!0}function _S(i,e){for(let t=i.attributes.length-1;t>=0;t--){let n=i.attributes[t].name;e[n]==null&&i.removeAttribute(n)}for(let t in e){let n=e[t];t=="style"?i.style.cssText=n:i.getAttribute(t)!=n&&i.setAttribute(t,n)}}function Ic(i,e,t){let n=!1;if(e)for(let r in e)t&&r in t||(n=!0,r=="style"?i.style.cssText="":i.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(n=!0,r=="style"?i.style.cssText=t[r]:i.setAttribute(r,t[r]));return n}function YS(i){let e=Object.create(null);for(let t=0;t0?3e8:-4e8:t>0?1e8:-1e8,new Pi(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:s,end:o}=Rf(e,t);n=(s?t?-3e8:-1:5e8)-1,r=(o?t?2e8:1:-6e8)+1}return new Pi(e,n,r,t,e.widget||null,!0)}static line(e){return new En(e)}static set(e,t=!1){return L.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};Z.none=L.empty;var jn=class i extends Z{constructor(e){let{start:t,end:n}=Rf(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?da(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||os}eq(e){return this==e||e instanceof i&&this.tagName==e.tagName&&pa(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}};jn.prototype.point=!1;var En=class i extends Z{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof i&&this.spec.class==e.spec.class&&pa(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}};En.prototype.mapMode=pe.TrackBefore;En.prototype.point=!0;var Pi=class i extends Z{constructor(e,t,n,r,s,o){super(t,n,s,e),this.block=r,this.isReplace=o,this.mapMode=r?t<=0?pe.TrackBefore:pe.TrackAfter:pe.TrackDel}get type(){return this.startSide!=this.endSide?$e.WidgetRange:this.startSide<=0?$e.WidgetBefore:$e.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof i&&VS(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}};Pi.prototype.point=!0;function Rf(i,e=!1){let{inclusiveStart:t,inclusiveEnd:n}=i;return t==null&&(t=i.inclusive),n==null&&(n=i.inclusive),{start:t??e,end:n??e}}function VS(i,e){return i==e||!!(i&&e&&i.compare(e))}function Fi(i,e,t,n=0){let r=t.length-1;r>=0&&t[r]+n>=i?t[r]=Math.max(t[r],e):t.push(i,e)}var ls=class i extends Ke{constructor(e,t,n){super(),this.tagName=e,this.attributes=t,this.rank=n}eq(e){return e==this||e instanceof i&&this.tagName==e.tagName&&pa(this.attributes,e.attributes)}static create(e){return new i(e.tagName,e.attributes||os,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,t=!1){return L.of(e,t)}};ls.prototype.startSide=ls.prototype.endSide=-1;function Mn(i){let e;return i.nodeType==11?e=i.getSelection?i:i.ownerDocument:e=i,e.getSelection()}function yl(i,e){return e?i==e||i.contains(e.nodeType!=1?e.parentNode:e):!1}function Zn(i,e){if(!e.anchorNode)return!1;try{return yl(i,e.anchorNode)}catch{return!1}}function ts(i){return i.nodeType==3?Un(i,0,i.nodeValue.length).getClientRects():i.nodeType==1?i.getClientRects():[]}function Wn(i,e,t,n){return t?Bc(i,e,t,n,-1)||Bc(i,e,t,n,1):!1}function It(i){for(var e=0;;e++)if(i=i.previousSibling,!i)return e}function as(i){return i.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(i.nodeName)}function Bc(i,e,t,n,r){for(;;){if(i==t&&e==n)return!0;if(e==(r<0?0:Tt(i))){if(i.nodeName=="DIV")return!1;let s=i.parentNode;if(!s||s.nodeType!=1)return!1;e=It(i)+(r<0?0:1),i=s}else if(i.nodeType==1){if(i=i.childNodes[e+(r<0?-1:0)],i.nodeType==1&&i.contentEditable=="false")return!1;e=r<0?Tt(i):0}else return!1}}function Tt(i){return i.nodeType==3?i.nodeValue.length:i.childNodes.length}function Os(i,e){let{left:t,right:n}=i;if(t==n)return i;let r=e?t:n;return{left:r,right:r,top:i.top,bottom:i.bottom}}function AS(i){let e=i.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:i.innerWidth,top:0,bottom:i.innerHeight}}function Zf(i,e){let t=e.width/i.offsetWidth,n=e.height/i.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-i.offsetWidth)<1)&&(t=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-i.offsetHeight)<1)&&(n=1),{scaleX:t,scaleY:n}}function jS(i,e,t,n,r,s,o,l){let a=i.ownerDocument,O=a.defaultView||window;for(let h=i,c=!1;h&&!c;)if(h.nodeType==1){let f,u=h==a.body,p=1,m=1;if(u)f=AS(O);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(c=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let S=h.getBoundingClientRect();({scaleX:p,scaleY:m}=Zf(h,S)),f={left:S.left,right:S.left+h.clientWidth*p,top:S.top,bottom:S.top+h.clientHeight*m}}let g=0,Q=0;if(r=="nearest")e.top0&&e.bottom>f.bottom+Q&&(Q=e.bottom-f.bottom+o)):e.bottom>f.bottom-o&&(Q=e.bottom-f.bottom+o,t<0&&e.top-Q0&&e.right>f.right+g&&(g=e.right-f.right+s)):e.right>f.right-s&&(g=e.right-f.right+s,t<0&&e.leftf.bottom||e.leftf.right)&&(e={left:Math.max(e.left,f.left),right:Math.min(e.right,f.right),top:Math.max(e.top,f.top),bottom:Math.min(e.bottom,f.bottom)}),h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function Wf(i,e=!0){let t=i.ownerDocument,n=null,r=null;for(let s=i.parentNode;s&&!(s==t.body||(!e||n)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),e&&!n&&s.scrollWidth>s.clientWidth&&(n=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:n,y:r}}var xl=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?Tt(t):0),n,Math.min(e.focusOffset,n?Tt(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}},gi=null;R.safari&&R.safari_version>=26&&(gi=!1);function qf(i){if(i.setActive)return i.setActive();if(gi)return i.focus(gi);let e=[];for(let t=i;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(i.focus(gi==null?{get preventScroll(){return gi={preventScroll:!0},!0}}:void 0),!gi){gi=!1;for(let t=0;tMath.max(0,i.document.documentElement.scrollHeight-i.innerHeight-4):i.scrollTop>Math.max(1,i.scrollHeight-i.clientHeight-4)}function Cf(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&n>0)return{node:t,offset:n};if(t.nodeType==1&&n>0){if(t.contentEditable=="false")return null;t=t.childNodes[n-1],n=Tt(t)}else if(t.parentNode&&!as(t))n=It(t),t=t.parentNode;else return null}}function _f(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&n=t){if(l.level==n)return o;(s<0||(r!=0?r<0?l.fromt:e[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}};function Af(i,e){if(i.length!=e.length)return!1;for(let t=0;t=0;m-=3)if(St[m+1]==-u){let g=St[m+2],Q=g&2?r:g&4?g&1?s:r:0;Q&&(J[c]=J[St[m]]=Q),l=m;break}}else{if(St.length==189)break;St[l++]=c,St[l++]=f,St[l++]=a}else if((p=J[c])==2||p==1){let m=p==r;a=m?0:1;for(let g=l-3;g>=0;g-=3){let Q=St[g+2];if(Q&2)break;if(m)St[g+2]|=2;else{if(Q&4)break;St[g+2]|=4}}}}}function BS(i,e,t,n){for(let r=0,s=n;r<=t.length;r++){let o=r?t[r-1].to:i,l=ra;)p==g&&(p=t[--m].from,g=m?t[m-1].to:i),J[--p]=u;a=h}else s=O,a++}}}function kl(i,e,t,n,r,s,o){let l=n%2?2:1;if(n%2==r%2)for(let a=e,O=0;aa&&o.push(new it(a,m.from,u));let g=m.direction==$i!=!(u%2);Xl(i,g?n+1:n,r,m.inner,m.from,m.to,o),a=m.to}p=m.to}else{if(p==t||(h?J[p]!=l:J[p]==l))break;p++}f?kl(i,a,p,n+1,r,f,o):ae;){let h=!0,c=!1;if(!O||a>s[O-1].to){let m=J[a-1];m!=l&&(h=!1,c=m==16)}let f=!h&&l==1?[]:null,u=h?n:n+1,p=a;e:for(;;)if(O&&p==s[O-1].to){if(c)break e;let m=s[--O];if(!h)for(let g=m.from,Q=O;;){if(g==e)break e;if(Q&&s[Q-1].to==g)g=s[--Q].from;else{if(J[g-1]==l)break e;break}}if(f)f.push(m);else{m.toJ.length;)J[J.length]=256;let n=[],r=e==$i?0:1;return Xl(i,r,r,t,0,i.length,n),n}function jf(i){return[new it(0,i,0)]}var Ef="";function FS(i,e,t,n,r){var s;let o=n.head-i.from,l=it.find(e,o,(s=n.bidiLevel)!==null&&s!==void 0?s:-1,n.assoc),a=e[l],O=a.side(r,t);if(o==O){let f=l+=r?1:-1;if(f<0||f>=e.length)return null;a=e[l=f],o=a.side(!r,t),O=a.side(r,t)}let h=ae(i.text,o,a.forward(r,t));(ha.to)&&(h=O),Ef=i.text.slice(Math.min(o,h),Math.max(o,h));let c=l==(r?e.length-1:0)?null:e[l+(r?1:-1)];return c&&h==O&&c.level+(r?0:1)i.some(e=>e)}),Nf=v.define({combine:i=>i.some(e=>e)}),Ff=v.define(),qn=class i{constructor(e,t,n,r,s,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new i(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new i(P.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},Dr=z.define({map:(i,e)=>i.map(e)}),Hf=z.define();function Pe(i,e,t){let n=i.facet(Lf);n.length?n[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}var Xt=v.define({combine:i=>i.length?i[0]:!0}),KS=0,Di=v.define({combine(i){return i.filter((e,t)=>{for(let n=0;n{let a=[];return o&&a.push(ws.of(O=>{let h=O.plugin(l);return h?o(h):Z.none})),s&&a.push(s(l)),a})}static fromClass(e,t){return i.define((n,r)=>new e(n,r),t)}},zn=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.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(n){if(Pe(t.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){Pe(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(n){Pe(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}},Kf=v.define(),Sa=v.define(),ws=v.define(),Jf=v.define(),Pa=v.define(),Gn=v.define(),eu=v.define();function Fc(i,e){let t=i.state.facet(eu);if(!t.length)return t;let n=t.map(s=>s instanceof Function?s(i):s),r=[];return L.spans(n,e.from,e.to,{point(){},span(s,o,l,a){let O=s-e.from,h=o-e.from,c=r;for(let f=l.length-1;f>=0;f--,a--){let u=l[f].spec.bidiIsolate,p;if(u==null&&(u=HS(e.text,O,h)),a>0&&c.length&&(p=c[c.length-1]).to==O&&p.direction==u)p.to=h,c=p.inner;else{let m={from:O,to:h,direction:u,inner:[]};c.push(m),c=m.inner}}}}),r}var tu=v.define();function $a(i){let e=0,t=0,n=0,r=0;for(let s of i.state.facet(tu)){let o=s(i);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(n=Math.max(n,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:e,right:t,top:n,bottom:r}}var vn=v.define(),ht=class i{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new i(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.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.toAr.push(new ht(s,o,l,a))),this.changedRanges=r}static create(e,t,n){return new i(e,t,n)}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}},JS=[],re=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 JS}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 t=this.domAttrs;t&&_S(this.dom,t)}}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 r of this.children){if(r==e)return n;n+=r.length+r.breakAfter}throw new 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=It(this.dom),r=this.length?e>0:t>0;return new Pt(this.parent.dom,n+(r?1:0),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 Ji)return e;return null}static get(e){return e.cmTile}},Ki=class extends re{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,s=e?.node==t?e:null,o=0;for(let l of this.children){if(l.sync(e),o+=l.length+l.breakAfter,r=n?n.nextSibling:t.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==t)for(;r&&r!=l.dom;)r=Hc(r);else t.insertBefore(l.dom,r);n=l.dom}for(r=n?n.nextSibling:t.firstChild,s&&r&&(s.written=!0);r;)r=Hc(r);this.length=o}};function Hc(i){let e=i.nextSibling;return i.parentNode.removeChild(i),e}var Ji=class extends Ki{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=re.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,s=0;;)if(r==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&s++,r=t.pop()}else{let o=n.children[r++];if(o instanceof vt)t.push(r),n=o,r=0;else{let l=s+o.length,a=e(o,s);if(a!==void 0)return a;s=l+o.breakAfter}}}resolveBlock(e,t){let n,r=-1,s,o=-1;if(this.blockTiles((l,a)=>{let O=a+l.length;if(e>=a&&e<=O){if(l.isWidget()&&t>=-1&&t<=1){if(l.flags&32)return!0;l.flags&16&&(n=void 0)}(ae||e==a&&(t>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,o=e-a)}}),!n&&!s)throw new Error("No tile at position "+e);return n&&t<0||!s?{tile:n,offset:r}:{tile:s,offset:o}}},vt=class i extends Ki{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(e,t){let n=new i(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}},en=class i extends Ki{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,n){let r=new i(t||document.createElement("div"),e);return(!t||!n)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,s=-1,o=null,l=-1;function a(h,c){for(let f=0,u=0;f=c&&(p.isComposite()?a(p,c-u):(!o||o.isHidden&&(t>0&&!(o.flags&32)||n&&t0(o,p)))&&(m>c||p.flags&32&&t<=1)?(o=p,l=c-u):(u=-1)&&(r=p,s=c-u)),u=m}}a(this,e);let O=(t<0?r:o)||r||o;return O?{tile:O,offset:O==r?s:l}:null}coordsIn(e,t,n){let r=this.resolveInline(e,t,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),t,n):e0(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:r,offset:s}=n;if(this.dom.contains(r.dom))return r.isText()?new Pt(r.dom,Math.min(r.dom.nodeValue.length,s)):r.domPosFor(s,r.flags&16?1:r.flags&32?-1:t);let o=n.tile.parent,l=!1;for(let a of o.children){if(l)return new Pt(a.dom,0);a==n.tile&&(l=!0)}}return new Pt(this.dom,0)}};function e0(i){let e=i.dom.lastChild;if(!e)return i.dom.getBoundingClientRect();let t=ts(e);return t[t.length-1]||null}function t0(i,e){let t=i.coordsIn(0,1),n=e.coordsIn(0,1);return t&&n&&n.topr&&(e=r);let s=e,o=e,l=0;e==0&&t<0||e==r&&t>=0?R.chrome||R.gecko||(e?(s--,l=1):o=0)?0:a.length-1];return R.safari&&!l&&O.width==0&&(O=Array.prototype.find.call(a,h=>h.width)||O),n==null?O:Os(O,(l?l>0:t<0)==n)}static of(e,t){let n=new i(t||document.createTextNode(e),e);return t||(n.flags|=2),n}},bi=class i extends re{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 Os(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let a=l?s.length-1:0;o=s[a],!(e>0?a==0:a==s.length-1||o.top0==n)}},Tl=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:s,beforeBreak:o,parents:l}=this;for(;e||t>0;)if(r.isComposite())if(o){if(!e)break;n&&n.break(),e--,o=!1}else if(s==r.children.length){if(!e&&!l.length)break;n&&n.leave(r),o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let a=r.children[s],O=a.breakAfter;(t>0?a.length<=e:a.length=0;l--){let a=t.marks[l],O=r.lastChild;if(O instanceof Ce&&O.mark.eq(a.mark))O.dom!=a.dom&&O.setDOM(cl(a.dom)),r=O;else{if(this.cache.reused.get(a)){let c=re.get(a.dom);c&&c.setDOM(cl(a.dom))}let h=Ce.of(a.mark,a.dom);r.append(h),r=h}this.cache.reused.set(a,2)}let s=re.get(e.text);s&&this.cache.reused.set(s,2);let o=new Qi(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,r.append(o)}addInlineWidget(e,t,n){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let s=this.ensureMarks(t,n);!r&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.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){var n;e||(e=iu);let r=en.start(e,t||((n=this.cache.find(en))===null||n===void 0?void 0:n.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=r)}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){var n;let r=this.curLine;for(let s=e.length-1;s>=0;s--){let o=e[s],l;if(t>0&&(l=r.lastChild)&&l instanceof Ce&&l.mark.eq(o))r=l,t--;else{let a=Ce.of(o,(n=this.cache.find(Ce,O=>O.mark.eq(o)))===null||n===void 0?void 0:n.dom);r.append(a),r=a,t=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!Kc(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(R.ios&&Kc(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(fl,0,32)||new bi(fl.toDOM(),0,fl,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){let t=e.rank*102+e.value.rank,n=new Rl(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(){var e;this.updateBlockWrappers();let t=this.root;for(let n of this.wrappers){let r=t.lastChild;if(n.fromo.wrapper.eq(n.wrapper)))===null||e===void 0?void 0:e.dom);t.append(s),t=s}}return t}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(tn,void 0,1);return n&&(n.flags=t),n||new tn(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},Wl=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:r,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=r;let l=this.textOff=Math.min(e,r.length);return s?null:r.slice(0,l)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}},cs=[bi,en,Qi,Ce,tn,vt,Ji];for(let i=0;i[]),this.index=cs.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,s=this.buckets[r],o=this.index[r];for(let l=0;l{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,s=0,o=0;;){let l=or){let O=a-r;this.preserve(O,!o,!l),r=a,s+=O}if(!l)break;t&&l.fromA<=t.range.fromA&&l.toA>=t.range.toA?(this.forward(l.fromA,t.range.fromA,t.range.fromA{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(a-l);else{let O=a>0||l{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof Ce&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=s=0):o instanceof Ce&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,s=-1,o=L.spans(this.decorations,e,t,{point:(l,a,O,h,c,f)=>{if(O instanceof Pi){if(this.disallowBlockEffectsFor[f]){if(O.block)throw new RangeError("Block decorations may not be specified via plugins");if(a>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=h.length,c>h.length)r.continueWidget(a-l);else{let u=O.widget||(O.block?Bt.block:Bt.inline),p=i0(O),m=this.cache.findWidget(u,a-l,p)||bi.of(u,this.view,a-l,p);O.block?(O.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(m)):(r.ensureLine(n),r.addInlineWidget(m,h,c))}n=null}else n=n0(n,O);a>l&&this.text.skip(a-l)},span:(l,a,O,h)=>{for(let c=l;c-1&&(this.openWidget=o>s),this.openWidget||r.addLineStartIfNotCovered(n),this.openMarks=o}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 s=re.get(r);if(r==this.view.contentDOM)break;s instanceof Ce?t.push(s):s?.isLine()?n=s:s instanceof vt||(r.nodeName=="DIV"&&!n&&r!=this.view.contentDOM?n=new en(r,iu):n||t.push(Ce.of(new jn({tagName:r.nodeName.toLowerCase(),attributes:YS(r)}),r)))}return{line:n,marks:t}}};function Kc(i,e){let t=n=>{for(let r of n.children)if((e?r.isText():r.length)||t(r))return!0;return!1};return t(i)}function i0(i){let e=i.isReplace?(i.startSide<0?64:0)|(i.endSide>0?128:0):i.startSide>0?32:16;return i.block&&(e|=256),e}var iu={class:"cm-line"};function n0(i,e){let t=e.spec.attributes,n=e.spec.class;return!t&&!n||(i||(i={class:"cm-line"}),t&&da(t,i),n&&(i.class+=" "+n)),i}function r0(i){let e=[];for(let t=i.parents.length;t>1;t--){let n=t==i.parents.length?i.tile:i.parents[t].tile;n instanceof Ce&&e.push(n.mark)}return e}function cl(i){let e=re.get(i);return e&&e.setDOM(i.cloneNode()),i}var Bt=class extends Re{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}};Bt.inline=new Bt("span");Bt.block=new Bt("div");var fl=new class extends Re{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}},fs=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Z.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 Ji(e,e.contentDOM),this.updateInner([new ht(0,0,0,e.state.doc.length)],null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:h,toA:c})=>cthis.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 r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?r=this.domChanged.newSel.head:!f0(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?o0(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:h,to:c}=this.hasComposition;n=new ht(h,c,e.changes.mapPos(h,-1),e.changes.mapPos(c,1)).addToSet(n.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(R.ie||R.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let a=O0(o,this.decorations,e.changes);a.length&&(n=ht.extendWithRanges(n,a));let O=h0(l,this.blockWrappers,e.changes);return O.length&&(n=ht.extendWithRanges(n,O)),s&&!n.some(h=>h.fromA<=s.range.fromA&&h.toA>=s.range.toA)&&(n=s.range.addToSet(n.slice())),this.tile.flags&2&&n.length==0?!1:(this.updateInner(n,s),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 o=this.tile,l=new zl(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&re.get(t.text)&&l.cache.reused.set(re.get(t.text),2),this.tile=l.run(e,t),Cl(o,l.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 s=R.chrome||R.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||n.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to-1)&&Zn(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(s||t||o))return;let l=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,O,h;if(a.empty?h=O=this.inlineDOMNearPos(a.anchor,a.assoc||1):(h=this.inlineDOMNearPos(a.head,a.head==a.from?1:-1),O=this.inlineDOMNearPos(a.anchor,a.anchor==a.from?1:-1)),R.gecko&&a.empty&&!this.hasComposition&&s0(O)){let f=document.createTextNode("");this.view.observer.ignore(()=>O.node.insertBefore(f,O.node.childNodes[O.offset]||null)),O=h=new Pt(f,0),l=!0}let c=this.view.observer.selectionRange;(l||!c.focusNode||(!Wn(O.node,O.offset,c.anchorNode,c.anchorOffset)||!Wn(h.node,h.offset,c.focusNode,c.focusOffset))&&!this.suppressWidgetCursorChange(c,a))&&(this.view.observer.ignore(()=>{R.android&&R.chrome&&n.contains(c.focusNode)&&c0(c.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let f=Mn(this.view.root);if(f)if(a.empty){if(R.gecko){let u=l0(O.node,O.offset);if(u&&u!=3){let p=(u==1?Cf:_f)(O.node,O.offset);p&&(O=new Pt(p.node,p.offset))}}f.collapse(O.node,O.offset),a.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=a.bidiLevel)}else if(f.extend){f.collapse(O.node,O.offset);try{f.extend(h.node,h.offset)}catch{}}else{let u=document.createRange();a.anchor>a.head&&([O,h]=[h,O]),u.setEnd(h.node,h.offset),u.setStart(O.node,O.offset),f.removeAllRanges(),f.addRange(u)}o&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(O,h)),this.impreciseAnchor=O.precise?null:new Pt(c.anchorNode,c.anchorOffset),this.impreciseHead=h.precise?null:new Pt(c.focusNode,c.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Wn(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=Mn(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let o=this.lineAt(t.head,t.assoc);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),O=this.coordsAt(t.head,1);if(!a||!O||a.bottom>O.top)return;let h=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(h.node,h.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let c=e.observer.selectionRange;e.docView.posFromDOM(c.anchorNode,c.anchorOffset)!=t.from&&n.collapse(r,s)}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 s;if(e==n.dom)s=n.dom.childNodes[t];else{let o=Tt(e)==0?0:t==0?-1:1;for(;;){let l=e.parentNode;if(l==n.dom)break;o==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?o=-1:o=1),e=l}o<0?s=e:s=e.nextSibling}if(s==n.dom.firstChild)return r;for(;s&&!re.get(s);)s=s.nextSibling;if(!s)return r+n.length;for(let o=0,l=r;;o++){let a=n.children[o];if(a.dom==s)return l;l+=a.length+a.breakAfter}}else return n.isText()?e==n.dom?r+t:r+(t?n.length:0):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,s=!1,o,l=-1,a=!1;return this.tile.blockTiles((O,h)=>{if(O.isWidget()){if(O.flags&32&&h>=e)return!0;O.flags&16&&(s=!0)}else{let c=h+O.length;if(h<=e&&(n=O,r=e-h,s=c=e&&!o&&(o=O,l=e-h,a=h>e),h>e&&o)return!0}}),!n&&!o?this.domAtPos(e,t):(s&&o?n=null:a&&n&&(o=null),n&&t<0||!o?n.domIn(r,t):o.domIn(l,t))}coordsAt(e,t,n){let{tile:r,offset:s}=this.tile.resolveBlock(e,t);return r.isWidget()?r.widget instanceof Cn?null:r.coordsInWidget(s,t,!0):r.coordsIn(s,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(s,o){if(s.isComposite())for(let l of s.children){if(l.length>=o){let a=r(l,o);if(a)return a}if(o-=l.length,o<0)break}else if(s.isText()&&oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==N.LTR,O=0,h=(c,f,u)=>{for(let p=0;pr);p++){let m=c.children[p],g=f+m.length,Q=m.dom.getBoundingClientRect(),{height:S}=Q;if(u&&!p&&(O+=Q.top-u.top),m instanceof vt)g>n&&h(m,f,Q);else if(f>=n&&(O>0&&t.push(-O),t.push(S+O),O=0,o)){let $=m.dom.lastChild,X=$?ts($):[];if(X.length){let b=X[X.length-1],w=a?b.right-Q.left:Q.right-b.left;w>l&&(l=w,this.minWidth=s,this.minWidthFrom=f,this.minWidthTo=g)}}u&&p==c.children.length-1&&(O+=u.bottom-Q.bottom),f=g+m.breakAfter}};return h(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction=="rtl"?N.RTL:N.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,a;for(let O of o.children){if(!O.isText()||/[^ -~]/.test(O.text))return;let h=ts(O.dom);if(h.length!=1)return;l+=h[0].width,a=h[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:a}}});if(e)return e;let t=document.createElement("div"),n,r,s;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 o=ts(t.firstChild)[0];n=t.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,s=o&&o.height?o.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:s}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let s=r==t.viewports.length?null:t.viewports[r],o=s?s.from-1:this.view.state.doc.length;if(o>n){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(Z.replace({widget:new Cn(l),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!s)break;n=s.to+1}return Z.set(e)}updateDeco(){let e=1,t=this.view.state.facet(ws).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),n=!1,r=this.view.state.facet(Pa).map((s,o)=>{let l=typeof s=="function";return l&&(n=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(L.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];etypeof s=="function"?s(this.view):s)}scrollIntoView(e){if(e.isSnapshot){let O=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=O.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let O of this.view.state.facet(Ff))try{if(O(this.view,e.range,e))return!0}catch(h){Pe(this.view.state,h,"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 s=$a(this.view),o={left:n.left-s.left,top:n.top-s.top,right:n.right+s.right,bottom:n.bottom+s.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;if(jS(this.view.scrollDOM,o,t.head1&&(n.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||n.bottomn.isWidget()||n.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){Cl(this.tile)}};function Cl(i,e){let t=e?.get(i);if(t!=1){t==null&&i.destroy();for(let n of i.children)Cl(n,e)}}function s0(i){return i.node.nodeType==1&&i.node.firstChild&&(i.offset==0||i.node.childNodes[i.offset-1].contentEditable=="false")&&(i.offset==i.node.childNodes.length||i.node.childNodes[i.offset].contentEditable=="false")}function nu(i,e){let t=i.observer.selectionRange;if(!t.focusNode)return null;let n=Cf(t.focusNode,t.focusOffset),r=_f(t.focusNode,t.focusOffset),s=n||r;if(r&&n&&r.node!=n.node){let l=re.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(i.docView.lastCompositionAfterCursor){let a=re.get(n.node);!a||a.isText()&&a.text!=n.node.nodeValue||(s=r)}}if(i.docView.lastCompositionAfterCursor=s!=n,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function o0(i,e,t){let n=nu(i,t);if(!n)return null;let{node:r,from:s,to:o}=n,l=r.nodeValue;if(/[\n\r]/.test(l)||i.state.doc.sliceString(n.from,n.to)!=l)return null;let a=e.invertedDesc;return{range:new ht(a.mapPos(s),a.mapPos(o),s,o),text:r}}function l0(i,e){return i.nodeType!=1?0:(e&&i.childNodes[e-1].contentEditable=="false"?1:0)|(e{ne.from&&(t=!0)}),t}var Cn=class extends Re{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 u0(i,e,t=1){let n=i.charCategorizer(e),r=i.doc.lineAt(e),s=e-r.from;if(r.length==0)return P.cursor(e);s==0?t=1:s==r.length&&(t=-1);let o=s,l=s;t<0?o=ae(r.text,s,!1):l=ae(r.text,s);let a=n(r.text.slice(o,l));for(;o>0;){let O=ae(r.text,o,!1);if(n(r.text.slice(O,o))!=a)break;o=O}for(;li.defaultLineHeight*1.5){let l=i.viewState.heightOracle.textHeight,a=Math.floor((r-t.top-(i.defaultLineHeight-l)*.5)/l);s+=a*i.viewState.heightOracle.lineLength}let o=i.state.sliceDoc(t.from,t.to);return t.from+Gr(o,s,i.state.tabSize)}function Yl(i,e,t){let n=i.lineBlockAt(e);if(Array.isArray(n.type)){let r;for(let s of n.type){if(s.from>e)break;if(!(s.toe)return s;(!r||s.type==$e.Text&&(r.type!=s.type||(t<0?s.frome)))&&(r=s)}}return r||n}return n}function p0(i,e,t,n){let r=Yl(i,e.head,e.assoc||-1),s=!n||r.type!=$e.Text||!(i.lineWrapping||r.widgetLineBreaks)?null:i.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let o=i.dom.getBoundingClientRect(),l=i.textDirectionAt(r.from),a=i.posAtCoords({x:t==(l==N.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(a!=null)return P.cursor(a,t?-1:1)}return P.cursor(t?r.to:r.from,t?-1:1)}function Jc(i,e,t,n){let r=i.state.doc.lineAt(e.head),s=i.bidiSpans(r),o=i.textDirectionAt(r.from);for(let l=e,a=null;;){let O=FS(r,s,o,l,t),h=Ef;if(!O){if(r.number==(t?i.state.doc.lines:1))return l;h=` +`,r=i.state.doc.line(r.number+(t?1:-1)),s=i.bidiSpans(r),O=i.visualLineSide(r,!t)}if(a){if(!a(h))return l}else{if(!n)return O;a=n(h)}l=O}}function m0(i,e,t){let n=i.state.charCategorizer(e),r=n(t);return s=>{let o=n(s);return r==H.Space&&(r=o),r==o}}function g0(i,e,t,n){let r=e.head,s=t?1:-1;if(r==(t?i.state.doc.length:0))return P.cursor(r,e.assoc);let o=e.goalColumn,l,a=i.contentDOM.getBoundingClientRect(),O=i.coordsAtPos(r,e.assoc||((e.empty?t:e.head==e.from)?1:-1)),h=i.documentTop;if(O)o==null&&(o=O.left-a.left),l=s<0?O.top:O.bottom;else{let p=i.viewState.lineBlockAt(r);o==null&&(o=Math.min(a.right-a.left,i.defaultCharacterWidth*(r-p.from))),l=(s<0?p.top:p.bottom)+h}let c=a.left+o,f=i.viewState.heightOracle.textHeight>>1,u=n??f;for(let p=0;;p+=f){let m=l+(u+p)*s,g=Vl(i,{x:c,y:m},!1,s);if(t?m>a.bottom:ml:S{if(e>s&&er(i)),t.from,e.head>t.from?-1:1);return n==t.from?t:P.cursor(n,ni.viewState.docHeight)return new tt(i.state.doc.length,-1);if(O=i.elementAtHeight(a),n==null)break;if(O.type==$e.Text){if(n<0?O.toi.viewport.to)break;let f=i.docView.coordsAt(n<0?O.from:O.to,n>0?-1:1);if(f&&(n<0?f.top<=a+s:f.bottom>=a+s))break}let c=i.viewState.heightOracle.textHeight/2;a=n>0?O.bottom+c:O.top-c}if(i.viewport.from>=O.to||i.viewport.to<=O.from){if(t)return null;if(O.type==$e.Text){let c=d0(i,r,O,o,l);return new tt(c,c==O.from?1:-1)}}if(O.type!=$e.Text)return a<(O.top+O.bottom)/2?new tt(O.from,1):new tt(O.to,-1);let h=i.docView.lineAt(O.from,2);return(!h||h.length!=O.length)&&(h=i.docView.lineAt(O.from,-2)),new Al(i,o,l,i.textDirectionAt(O.from)).scanTile(h,O.from)}var Al=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.to1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from>1;t:if(o.has(m)){let Q=r+Math.floor(Math.random()*p);for(let S=0;S1)){if(S.bottomthis.y)(!O||O.top>S.top)&&(O=S),$=-1;else{let X=S.left>this.x?this.x-S.left:S.right(p+p+m)/3)return this.y=a.bottom-1,this.scan(e,t,!0);if(O&&O.top<(p+m+m)/3)return this.y=O.top+1,this.scan(e,t,!0)}let u=(l?this.dirAt(e[h],1):this.baseDir)==N.LTR;return{i:h,after:this.x>(f.left+f.right)/2==u}}scanText(e,t){let n=[];for(let s=0;s{let o=n[s]-t,l=n[s+1]-t;return Un(e.dom,o,l).getClientRects()});return r.after?new tt(n[r.i+1],-1):new tt(n[r.i],1)}scanTile(e,t){if(!e.length)return new tt(t,1);if(e.children.length==1){let l=e.children[0];if(l.isText())return this.scanText(l,t);if(l.isComposite())return this.scanTile(l,t)}let n=[t];for(let l=0,a=t;l{let a=e.children[l];return a.flags&48?null:(a.dom.nodeType==1?a.dom:Un(a.dom,0,a.length)).getClientRects()}),s=e.children[r.i],o=n[r.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):r.after?new tt(n[r.i+1],-1):new tt(o,1)}},Li="\uFFFF",jl=class{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(G.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Li}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let s=this.text.length;this.readNode(r);let o=re.get(r),l=r.nextSibling;if(l==t){o?.breakAfter&&!l&&n!=this.view.contentDOM&&this.lineBreak();break}let a=re.get(l);(o&&a?o.breakAfter:(o?o.breakAfter:as(r))||as(l)&&(r.nodeName!="BR"||o?.isWidget())&&this.text.length>s)&&!S0(l,t)&&this.lineBreak(),r=l}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 s=-1,o=1,l;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(l=r.exec(t))&&(s=l.index,o=l[0].length),this.append(t.slice(n,s<0?t.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);n=s+o}}readNode(e){let t=re.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let r=n.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.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+(Q0(e,n.node,n.offset)?t:0))}};function Q0(i,e,t){for(;;){if(!e||t-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView,l=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=su(e.docView.tile,t,n,0))){let a=s||o?[]:$0(e),O=new jl(a,e);O.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=O.text,this.newSel=b0(a,this.bounds.from)}else{let a=e.observer.selectionRange,O=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!yl(e.contentDOM,a.focusNode)?l.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),h=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!yl(e.contentDOM,a.anchorNode)?l.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),c=e.viewport;if((R.ios||R.chrome)&&O!=h&&Math.min(O,h)<=l.main.from&&Math.max(O,h)>=l.main.to&&(c.from>0||c.to-1&&l.ranges.length>1)this.newSel=l.replaceRange(P.range(h,O));else if(e.lineWrapping&&h==O&&!(l.main.empty&&l.main.head==O)&&e.inputState.lastTouchTime>Date.now()-100){let f=e.coordsAtPos(O,-1),u=0;f&&(u=e.inputState.lastTouchY<=f.bottom?-1:1),this.newSel=P.create([P.cursor(O,u)])}else this.newSel=P.single(h,O)}}};function su(i,e,t,n){if(i.isComposite()){let r=-1,s=-1,o=-1,l=-1;for(let a=0,O=n,h=n;at)return su(c,e,t,O);if(f>=e&&r==-1&&(r=a,s=O),O>t&&c.dom.parentNode==i.dom){o=a,l=h;break}h=f,O=f+c.breakAfter}return{from:s,to:l<0?n+i.length:l,startDOM:(r?i.children[r-1].dom.nextSibling:null)||i.dom.firstChild,endDOM:o=0?i.children[o].dom:null}}else return i.isText()?{from:n,to:n+i.length,startDOM:i.dom,endDOM:i.dom.nextSibling}:null}function ou(i,e){let t,{newSel:n}=e,{state:r}=i,s=r.selection.main,o=i.inputState.lastKeyTime>Date.now()-100?i.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:a}=e.bounds,O=s.from,h=null;(o===8||R.android&&e.text.length=l&&s.to<=a&&(e.typeOver||c!=e.text)&&c.slice(0,s.from-l)==e.text.slice(0,s.from-l)&&c.slice(s.to-l)==e.text.slice(f=e.text.length-(c.length-(s.to-l)))?t={from:s.from,to:s.to,insert:j.of(e.text.slice(s.from-l,f).split(Li))}:(u=lu(c,e.text,O-l,h))&&(R.chrome&&o==13&&u.toB==u.from+2&&e.text.slice(u.from,u.toB)==Li+Li&&u.toB--,t={from:l+u.from,to:l+u.toA,insert:j.of(e.text.slice(u.from,u.toB).split(Li))})}else n&&(!i.hasFocus&&r.facet(Xt)||ds(n,s))&&(n=null);if(!t&&!n)return!1;if((R.mac||R.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&i.contentDOM.getAttribute("autocorrect")=="off"?(n&&t.insert.length==2&&(n=P.single(n.main.anchor-1,n.main.head-1)),t={from:t.from,to:t.to,insert:j.of([t.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).toDate.now()-50?t={from:s.from,to:s.to,insert:r.toText(i.inputState.insertingText)}:R.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==` + `&&i.lineWrapping&&(n&&(n=P.single(n.main.anchor-1,n.main.head-1)),t={from:s.from,to:s.to,insert:j.of([" "])}),t)return ba(i,t,n,o);if(n&&!ds(n,s)){let l=!1,a="select";return i.inputState.lastSelectionTime>Date.now()-50&&(i.inputState.lastSelectionOrigin=="select"&&(l=!0),a=i.inputState.lastSelectionOrigin,a=="select.pointer"&&(n=ru(r.facet(Gn).map(O=>O(i)),n))),i.dispatch({selection:n,scrollIntoView:l,userEvent:a}),!0}else return!1}function ba(i,e,t,n=-1){if(R.ios&&i.inputState.flushIOSKey(e))return!0;let r=i.state.selection.main;if(R.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&i.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Hi(i.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||n==8&&e.insert.lengthr.head)&&Hi(i.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&Hi(i.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();i.inputState.composing>=0&&i.inputState.composing++;let o,l=()=>o||(o=P0(i,e,t));return i.state.facet(Df).some(a=>a(i,e.from,e.to,s,l))||i.dispatch(l()),!0}function P0(i,e,t){let n,r=i.state,s=r.selection.main,o=-1;if(e.from==e.to&&e.froms.to){let a=e.fromc(i)),O,a);e.from==h&&(o=h)}if(o>-1)n={changes:e,selection:P.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&i.inputState.composing<0){let a=s.frome.to?r.sliceDoc(e.to,s.to):"";n=r.replaceSelection(i.state.toText(a+e.insert.sliceString(0,void 0,i.state.lineBreak)+O))}else{let a=r.changes(e),O=t&&t.main.to<=a.newLength?t.main:void 0;if(r.selection.ranges.length>1&&(i.inputState.composing>=0||i.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let h=i.state.sliceDoc(e.from,e.to),c,f=t&&nu(i,t.main.head);if(f){let p=e.insert.length-(e.to-e.from);c={from:f.from,to:f.to-p}}else c=i.state.doc.lineAt(s.head);let u=s.to-e.to;n=r.changeByRange(p=>{if(p.from==s.from&&p.to==s.to)return{changes:a,range:O||p.map(a)};let m=p.to-u,g=m-h.length;if(i.state.sliceDoc(g,m)!=h||m>=c.from&&g<=c.to)return{range:p};let Q=r.changes({from:g,to:m,insert:e.insert}),S=p.to-s.to;return{changes:Q,range:O?P.range(Math.max(0,O.anchor+S),Math.max(0,O.head+S)):p.map(Q)}})}else n={changes:a,selection:O&&r.selection.replaceRange(O)}}let l="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,l+=".compose",i.inputState.compositionFirstChange&&(l+=".start",i.inputState.compositionFirstChange=!1)),r.update(n,{userEvent:l,scrollIntoView:!0})}function lu(i,e,t,n){let r=Math.min(i.length,e.length),s=0;for(;s0&&l>0&&i.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(n=="end"){let a=Math.max(0,s-Math.min(o,l));t-=o+a-s}if(o=o?s-t:0;s-=a,l=s+(l-o),o=s}else if(l=l?s-t:0;s-=a,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function $0(i){let e=[];if(i.root.activeElement!=i.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:s}=i.observer.selectionRange;return t&&(e.push(new us(t,n)),(r!=t||s!=n)&&e.push(new us(r,s))),e}function b0(i,e){if(i.length==0)return null;let t=i[0].pos,n=i.length==2?i[1].pos:t;return t>-1&&n>-1?P.single(t+e,n+e):null}function ds(i,e){return e.head==i.main.head&&e.anchor==i.main.anchor}var Ml=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,R.safari&&e.contentDOM.addEventListener("input",()=>null),R.gecko&&Y0(e.contentDOM.ownerDocument)}handleEvent(e){!R0(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let r of n.observers)r(this.view,t);for(let r of n.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=x0(e),n=this.handlers,r=this.view.contentDOM;for(let s in t)if(s!="scroll"){let o=!t[s].handlers.length,l=n[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in n)s!="scroll"&&!t[s]&&r.removeEventListener(s,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&&Ou.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),R.android&&R.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(R.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(au.some(t=>t.keyCode==e.keyCode)&&!e.ctrlKey||w0.indexOf(e.key)>-1&&e.ctrlKey)){let t={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return t.shiftKey&&R.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&y0(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.from0?!0:R.safari&&!R.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 y0(i){return i.visualViewport?i.visualViewport.height*i.visualViewport.scale/i.document.documentElement.clientHeight<.85:!1}function ef(i,e){return(t,n)=>{try{return e.call(i,n,t)}catch(r){Pe(t.state,r)}}}function x0(i){let e=Object.create(null);function t(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of i){let r=n.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let a=s[l];a&&t(l).handlers.push(ef(n.value,a))}if(o)for(let l in o){let a=o[l];a&&t(l).observers.push(ef(n.value,a))}}for(let n in ct)t(n).handlers.push(ct[n]);for(let n in Ze)t(n).observers.push(Ze[n]);return e}var au=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],w0="dthko",Ou=[16,17,18,20,91,92,224,225],Ir=6;function Br(i){return Math.max(0,i)*.7+8}function k0(i,e){return Math.max(Math.abs(i.clientX-e.clientX),Math.abs(i.clientY-e.clientY))}var Ul=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=Wf(e.contentDOM),this.atoms=e.state.facet(Gn).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(G.allowMultipleSelections)&&X0(e,t),this.dragging=T0(e,t)&&fu(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&&k0(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=$a(this.view);e.clientX-a.left<=r+Ir?t=-Br(r-e.clientX):e.clientX+a.right>=o-Ir&&(t=Br(e.clientX-o)),e.clientY-a.top<=s+Ir?n=-Br(s-e.clientY):e.clientY+a.bottom>=l-Ir&&(n=Br(e.clientY-l)),this.setScrollSpeed(t,n)}up(e){this.dragging==null&&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=ru(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(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function X0(i,e){let t=i.state.facet(Mf);return t.length?t[0](e):R.mac?e.metaKey:e.ctrlKey}function v0(i,e){let t=i.state.facet(Uf);return t.length?t[0](e):R.mac?!e.altKey:!e.ctrlKey}function T0(i,e){let{main:t}=i.state.selection;if(t.empty)return!1;let n=Mn(i.root);if(!n||n.rangeCount==0)return!0;let r=n.getRangeAt(0).getClientRects();for(let s=0;s=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function R0(i,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,n;t!=i.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(n=re.get(t))&&n.isWidget()&&!n.isHidden&&n.widget.ignoreEvent(e))return!1;return!0}var ct=Object.create(null),Ze=Object.create(null),hu=R.ie&&R.ie_version<15||R.ios&&R.webkit_version<604;function Z0(i){let e=i.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{i.focus(),t.remove(),cu(i,t.value)},50)}function ks(i,e,t){for(let n of i.facet(e))t=n(t,i);return t}function cu(i,e){e=ks(i.state,ga,e);let{state:t}=i,n,r=1,s=t.toText(e),o=s.lines==t.selection.ranges.length;if(Gl!=null&&t.selection.ranges.every(a=>a.empty)&&Gl==s.toString()){let a=-1;n=t.changeByRange(O=>{let h=t.doc.lineAt(O.from);if(h.from==a)return{range:O};a=h.from;let c=t.toText((o?s.line(r++).text:e)+t.lineBreak);return{changes:{from:h.from,insert:c},range:P.cursor(O.from+c.length)}})}else o?n=t.changeByRange(a=>{let O=s.line(r++);return{changes:{from:a.from,to:a.to,insert:O.text},range:P.cursor(a.from+O.length)}}):n=t.replaceSelection(s);i.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}Ze.scroll=i=>{let e=i.inputState;e.lastScrollTop=i.scrollDOM.scrollTop,e.lastScrollLeft=i.scrollDOM.scrollLeft,R.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())};Ze.wheel=Ze.mousewheel=i=>{i.inputState.lastWheelEvent=Date.now()};ct.keydown=(i,e)=>(i.inputState.setSelectionOrigin("select"),e.keyCode==27&&i.inputState.tabFocusMode!=0&&(i.inputState.tabFocusMode=Date.now()+2e3),!1);Ze.touchstart=(i,e)=>{let t=i.inputState,n=e.targetTouches[0];t.touchActive=!0,t.lastTouchTime=Date.now(),n&&(t.lastTouchX=n.clientX,t.lastTouchY=n.clientY),t.setSelectionOrigin("select.pointer")};Ze.touchmove=i=>{i.inputState.setSelectionOrigin("select.pointer")};Ze.touchend=(i,e)=>{i.inputState.touchActive=!1};ct.mousedown=(i,e)=>{if(i.observer.flush(),i.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let n of i.state.facet(Gf))if(t=n(i,e),t)break;if(!t&&e.button==0&&(t=q0(i,e)),t){let n=!i.hasFocus;i.inputState.startMouseSelection(new Ul(i,e,t,n)),n&&i.observer.ignore(()=>{qf(i.contentDOM);let s=i.root.activeElement;s&&!s.contains(i.contentDOM)&&s.blur()});let r=i.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else i.inputState.setSelectionOrigin("select.pointer");return!1};function tf(i,e,t,n){if(n==1)return P.cursor(e,t);if(n==2)return u0(i.state,e,t);{let r=i.docView.lineAt(e,t),s=i.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return lDate.now()-400&&Math.abs(e.clientX-i.clientX)<2&&Math.abs(e.clientY-i.clientY)<2?(rf+1)%3:1}function q0(i,e){let t=i.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),n=fu(e),r=i.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),r=r.map(s.changes))},get(s,o,l){let a=i.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),O,h=tf(i,a.pos,a.assoc,n);if(t.pos!=a.pos&&!o){let c=tf(i,t.pos,t.assoc,n),f=Math.min(c.from,h.from),u=Math.max(c.to,h.to);h=f1&&(O=z0(r,a.pos))?O:l?r.addRange(h):P.create([h])}}}function z0(i,e){for(let t=0;t=e)return P.create(i.ranges.slice(0,t).concat(i.ranges.slice(t+1)),i.mainIndex==t?0:i.mainIndex-(i.mainIndex>t?1:0))}return null}ct.dragstart=(i,e)=>{let{selection:{main:t}}=i.state;if(e.target.draggable){let r=i.docView.tile.nearest(e.target);if(r&&r.isWidget()){let s=r.posAtStart,o=s+r.length;(s>=t.to||o<=t.from)&&(t=P.undirectionalRange(s,o))}}let{inputState:n}=i;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",ks(i.state,Qa,i.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};ct.dragend=i=>(i.inputState.draggedContent=null,!1);function of(i,e,t,n){if(t=ks(i.state,ga,t),!t)return;let r=i.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=i.inputState,o=n&&s&&v0(i,e)?{from:s.from,to:s.to}:null,l={from:r,insert:t},a=i.state.changes(o?[o,l]:l);i.focus(),i.dispatch({changes:a,selection:{anchor:a.mapPos(r,-1),head:a.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),i.inputState.draggedContent=null}ct.drop=(i,e)=>{if(!e.dataTransfer)return!1;if(i.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let n=Array(t.length),r=0,s=()=>{++r==t.length&&of(i,e,n.filter(o=>o!=null).join(i.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(n[o]=l.result),s()},l.readAsText(t[o])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return of(i,e,n,!0),!0}return!1};ct.paste=(i,e)=>{if(i.state.readOnly)return!0;i.observer.flush();let t=hu?null:e.clipboardData;return t?(cu(i,t.getData("text/plain")||t.getData("text/uri-list")),!0):(Z0(i),!1)};function C0(i,e){let t=i.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),i.focus()},50)}function _0(i){let e=[],t=[],n=!1;for(let r of i.selection.ranges)r.empty||(e.push(i.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:s}of i.selection.ranges){let o=i.doc.lineAt(s);o.number>r&&(e.push(o.text),t.push({from:o.from,to:Math.min(i.doc.length,o.to+1)})),r=o.number}n=!0}return{text:ks(i,Qa,e.join(i.lineBreak)),ranges:t,linewise:n}}var Gl=null;ct.copy=ct.cut=(i,e)=>{if(!Zn(i.contentDOM,i.observer.selectionRange))return!1;let{text:t,ranges:n,linewise:r}=_0(i.state);if(!t&&!r)return!1;Gl=r?t:null,e.type=="cut"&&!i.state.readOnly&&i.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let s=hu?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(C0(i,t),!1)};var uu=qe.define();function du(i,e){let t=[];for(let n of i.facet(If)){let r=n(i,e);r&&t.push(r)}return t.length?i.update({effects:t,annotations:uu.of(!0)}):null}function pu(i){setTimeout(()=>{let e=i.hasFocus;if(e!=i.inputState.notifiedFocused){let t=du(i.state,e);t?i.dispatch(t):i.update([])}},10)}Ze.focus=i=>{i.inputState.lastFocusTime=Date.now(),!i.scrollDOM.scrollTop&&(i.inputState.lastScrollTop||i.inputState.lastScrollLeft)&&(i.scrollDOM.scrollTop=i.inputState.lastScrollTop,i.scrollDOM.scrollLeft=i.inputState.lastScrollLeft),pu(i)};Ze.blur=i=>{i.observer.clearSelectionRange(),pu(i)};Ze.compositionstart=Ze.compositionupdate=i=>{i.observer.editContext||(i.inputState.compositionFirstChange==null&&(i.inputState.compositionFirstChange=!0),i.inputState.composing<0&&(i.inputState.composing=0))};Ze.compositionend=i=>{i.observer.editContext||(i.inputState.composing=-1,i.inputState.compositionEndedAt=Date.now(),i.inputState.compositionPendingKey=!0,i.inputState.compositionPendingChange=i.observer.pendingRecords().length>0,i.inputState.compositionFirstChange=null,R.chrome&&R.android?i.observer.flushSoon():i.inputState.compositionPendingChange?Promise.resolve().then(()=>i.observer.flush()):setTimeout(()=>{i.inputState.composing<0&&i.docView.hasComposition&&i.update([])},50))};Ze.contextmenu=i=>{i.inputState.lastContextMenu=Date.now()};ct.beforeinput=(i,e)=>{var t,n;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(i.inputState.insertingText=e.data,i.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&i.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let l=o[0],a=i.posAtDOM(l.startContainer,l.startOffset),O=i.posAtDOM(l.endContainer,l.endOffset);return ba(i,{from:a,to:O,insert:i.state.toText(s)},null),!0}}let r;if(R.chrome&&R.android&&(r=au.find(s=>s.inputType==e.inputType))&&(i.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&i.hasFocus&&(i.contentDOM.blur(),i.focus())},100)}return R.ios&&e.inputType=="deleteContentForward"&&i.observer.flushSoon(),R.safari&&e.inputType=="insertText"&&i.inputState.composing>=0&&setTimeout(()=>Ze.compositionend(i,e),20),!1};var lf=new Set;function Y0(i){lf.has(i)||(lf.add(i),i.addEventListener("copy",()=>{}),i.addEventListener("cut",()=>{}))}var af=["pre-wrap","normal","pre-line","break-spaces"],nn=!1;function Of(){nn=!1}var Ll=class{constructor(e){this.lineWrapping=e,this.doc=j.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 af.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n-1,a=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=s,a){this.heightSamples={};for(let O=0;O0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>is&&(nn=!0),this.height=e)}replace(e,t,n){return i.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let s=this,o=n.doc;for(let l=r.length-1;l>=0;l--){let{fromA:a,toA:O,fromB:h,toB:c}=r[l],f=s.lineAt(a,te.ByPosNoHeight,n.setDoc(t),0,0),u=f.to>=O?f:s.lineAt(O,te.ByPosNoHeight,n,0,0);for(c+=u.to-O,O=u.to;l>0&&f.from<=r[l-1].toA;)a=r[l-1].fromA,h=r[l-1].fromB,l--,as*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),n+=1+l.break,r-=l.size}else if(s>r*2){let l=e[n];l.break?e.splice(n,1,l.left,null,l.right):e.splice(n,1,l.left,l.right),n+=2+l.break,s-=l.size}else break;else if(r=s&&o(this.lineAt(0,te.ByPos,n,r,s))}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})`}},et=class i extends ms{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 Ot(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,n){let r=n[0];return n.length==1&&(r instanceof i||r instanceof Dt&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Dt?r=new i(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):Ue.of(n)}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:""})`}},Dt=class i extends Ue{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,s=r-n+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*s);o=a/s,this.length>s+1&&(l=(this.height-a)/(this.length-s-1))}else o=this.height/s;return{firstLine:n,lastLine:r,perLine:o,perChar:l}}blockAt(e,t,n,r){let{firstLine:s,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,r);if(t.lineWrapping){let O=r+(e0){let s=n[n.length-1];s instanceof i?n[n.length-1]=new i(s.length+r):n.push(null,new i(r-1))}if(e>0){let s=n[0];s instanceof i?n[0]=new i(e+s.length):n.unshift(new i(e-1),null)}return Ue.of(n)}decomposeLeft(e,t){t.push(new i(e-1),null)}decomposeRight(e,t){t.push(null,new i(this.length-e-1))}updateHeight(e,t=0,n=!1,r){let s=t+this.length;if(r&&r.from<=t+this.length&&r.more){let o=[],l=Math.max(t,r.from),a=-1;for(r.from>t&&o.push(new i(r.from-t-1).updateHeight(e,t));l<=s&&r.more;){let h=e.doc.lineAt(l).length;o.length&&o.push(null);let c=r.heights[r.index++],f=0;c<0&&(f=-c,c=r.heights[r.index++]),a==-1?a=c:Math.abs(c-a)>=is&&(a=-2);let u=new et(h,c,f);u.outdated=!1,o.push(u),l+=h+1}l<=s&&o.push(null,new i(s-l).updateHeight(e,l));let O=Ue.of(o);return(a<0||Math.abs(O.height-this.height)>=is||Math.abs(a-this.heightMetrics(e,t).perLine)>=is)&&(nn=!0),ps(this,O)}else(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},Il=class extends Ue{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 s=n+this.left.height;return el))return O;let h=t==te.ByPosNoHeight?te.ByPosNoHeight:te.ByPos;return a?O.join(this.right.lineAt(l,h,n,o,l)):this.left.lineAt(l,h,n,r,s).join(O)}forEachLine(e,t,n,r,s,o){let l=r+this.left.height,a=s+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,n,l,a,o);else{let O=this.lineAt(a,te.ByPos,n,r,s);e=e&&O.from<=t&&o(O),t>O.to&&this.right.forEachLine(O.to+1,t,n,l,a,o)}}replace(e,t,n){let r=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let l of n)s.push(l);if(e>0&&hf(s,o-1),t=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);e2*t.size||t.size>2*e.size?Ue.of(this.break?[e,null,t]:[e,t]):(this.left=ps(this.left,e),this.right=ps(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:s,right:o}=this,l=t+s.length+this.break,a=null;return r&&r.from<=t+s.length&&r.more?a=s=s.updateHeight(e,t,n,r):s.updateHeight(e,t,n),r&&r.from<=l+o.length&&r.more?a=o=o.updateHeight(e,l,n,r):o.updateHeight(e,l,n),a?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}};function hf(i,e){let t,n;i[e]==null&&(t=i[e-1])instanceof Dt&&(n=i[e+1])instanceof Dt&&i.splice(e-1,3,new Dt(t.length+1+n.length))}var A0=5,Bl=class i{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 n=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof et?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new et(n-this.pos,-1,0)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e=A0)&&this.addLineDeco(r,s,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new et(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new Dt(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 et)return e;let t=new et(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=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=this.pos+n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof et)&&!this.isCovered?this.nodes.push(new et(0,-1,0)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&c.overflow!="visible"){let f=h.getBoundingClientRect();s=Math.max(s,f.left),o=Math.min(o,f.right),l=Math.max(l,f.top),a=Math.min(O==i.parentNode?r.innerHeight:a,f.bottom)}O=c.position=="absolute"||c.position=="fixed"?h.offsetParent:h.parentNode}else if(O.nodeType==11)O=O.host;else break;return{left:s-t.left,right:Math.max(s,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function M0(i){let e=i.getBoundingClientRect(),t=i.ownerDocument.defaultView||window;return e.left0&&e.top0}function U0(i,e){let t=i.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}var Yn=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;ntypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new Ll(n),this.stateDeco=ff(t),this.heightMap=Ue.empty().applyChanges(this.stateDeco,j.empty,this.heightOracle.setDoc(t.doc),[new ht(0,0,0,t.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Z.set(this.lineGaps.map(r=>r.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:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);e.push(new Ii(s,o))}}return this.viewports=e.sort((n,r)=>n.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?cf:new Hl(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(Tn(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=ff(this.state);let r=e.changedRanges,s=ht.extendWithRanges(r,j0(n,this.stateDeco,e?e.changes:Xe.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Of(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||nn)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let a=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let O=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(O||!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(Nf)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,s=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?N.RTL:N.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let O=0,h=0;if(l.width&&l.height){let{scaleX:b,scaleY:w}=Zf(t,l);(b>.005&&Math.abs(this.scaleX-b)>.005||w>.005&&Math.abs(this.scaleY-w)>.005)&&(this.scaleX=b,this.scaleY=w,O|=16,o=a=!0)}let c=(parseInt(n.paddingTop)||0)*this.scaleY,f=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=c||this.paddingBottom!=f)&&(this.paddingTop=c,this.paddingBottom=f,O|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,O|=16);let u=Wf(this.view.contentDOM,!1).y;u!=this.scrollParent&&(this.scrollParent=u,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=zf(this.scrollParent||e.win);let m=(this.printing?U0:E0)(t,this.paddingTop),g=m.top-this.pixelViewport.top,Q=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let S=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(S!=this.inView&&(this.inView=S,S&&(a=!0)),!this.inView&&!this.scrollTarget&&!M0(e.dom))return 0;let $=l.width;if((this.contentDOMWidth!=$||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,O|=16),a){let b=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(b)&&(o=!0),o||r.lineWrapping&&Math.abs($-this.contentDOMWidth)>r.charWidth){let{lineHeight:w,charWidth:k,textHeight:_}=e.docView.measureTextSize();o=w>0&&r.refresh(s,w,k,_,Math.max(5,$/k),b),o&&(e.docView.minWidth=0,O|=16)}g>0&&Q>0?h=Math.max(g,Q):g<0&&Q<0&&(h=Math.min(g,Q)),Of();for(let w of this.viewports){let k=w.from==this.viewport.from?b:e.docView.measureVisibleLineHeights(w);this.heightMap=(o?Ue.empty().applyChanges(this.stateDeco,j.empty,this.heightOracle,[new ht(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new Dl(w.from,k))}nn&&(O|=2)}let X=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return X&&(O&2&&(O|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),O|=this.updateForViewport()),(O&2||X)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),O|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),O}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,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Ii(r.lineAt(o-n*1e3,te.ByHeight,s,0,0).from,r.lineAt(l+(1-n)*1e3,te.ByHeight,s,0,0).to);if(t){let{head:O}=t.range;if(Oa.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),c=r.lineAt(O,te.ByPos,s,0,0),f;t.y=="center"?f=(c.top+c.bottom)/2-h/2:t.y=="start"||t.y=="nearest"&&O=l+Math.max(10,Math.min(n,250)))&&r>o-2*1e3&&s>1,o=r<<1;if(this.defaultTextDirection!=N.LTR&&!n)return[];let l=[],a=(h,c,f,u)=>{if(c-hh&&QQ.from>=f.from&&Q.to<=f.to&&Math.abs(Q.from-h)Q.fromS));if(!g){if(c$.from<=c&&$.to>=c)){let $=t.moveToLineBoundary(P.cursor(c),!1,!0).head;$>h&&(c=$)}let Q=this.gapSize(f,h,c,u),S=n||Q<2e6?Q:2e6;g=new Yn(h,c,Q,S)}l.push(g)},O=h=>{if(h.length2e6)for(let w of e)w.from>=h.from&&w.fromh.from&&a(h.from,u,h,c),pt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];L.spans(t,this.viewport.from,this.viewport.to,{span(s,o){n.push({from:s,to:o})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let s=0;s=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Tn(this.heightMap.lineAt(e,te.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)||Tn(this.heightMap.lineAt(this.scaler.fromDOM(e),te.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 Tn(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}},Ii=class{constructor(e,t){this.from=e,this.to=t}};function G0(i,e,t){let n=[],r=i,s=0;return L.spans(t,i,e,{span(){},point(o,l){o>r&&(n.push({from:r,to:o}),s+=o-r),r=l}},20),r=1)return e[e.length-1].to;let n=Math.floor(i*t);for(let r=0;;r++){let{from:s,to:o}=e[r],l=o-s;if(n<=l)return s+n;n-=l}}function Fr(i,e){let t=0;for(let{from:n,to:r}of i.ranges){if(e<=r){t+=e-n;break}t+=r-n}return t/i.total}function L0(i,e){for(let t of i)if(e(t))return t}var cf={toDOM(i){return i},fromDOM(i){return i},scale:1,eq(i){return i==this}};function ff(i){let e=i.facet(ws).filter(n=>typeof n!="function"),t=i.facet(Pa).filter(n=>typeof n!="function");return t.length&&e.push(L.join(t)),e}var Hl=class i{constructor(e,t,n){let r=0,s=0,o=0;this.viewports=n.map(({from:l,to:a})=>{let O=t.lineAt(l,te.ByPos,e,0,0).top,h=t.lineAt(a,te.ByPos,e,0,0).bottom;return r+=h-O,{from:l,to:a,top:O,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let s=tt.from==e.viewports[n].from&&t.to==e.viewports[n].to):!1}};function Tn(i,e){if(e.scale==1)return i;let t=e.toDOM(i.top),n=e.toDOM(i.bottom);return new Ot(i.from,i.length,t,n-t,Array.isArray(i._content)?i._content.map(r=>Tn(r,e)):i._content)}var Hr=v.define({combine:i=>i.join(" ")}),Kl=v.define({combine:i=>i.indexOf(!0)>-1}),Jl=Je.newName(),mu=Je.newName(),gu=Je.newName(),Qu={"&light":"."+mu,"&dark":"."+gu};function ea(i,e,t){return new Je(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,r=>{if(r=="&")return i;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):i+" "+n}})}var D0=ea("."+Jl,{"&":{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,')`,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"}},Qu),I0={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},dl=R.ie&&R.ie_version<=11,ta=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new xl,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 n of t)this.queue.push(n);(R.ie&&R.ie_version<=11||R.ios&&e.composing)&&t.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&R.android&&e.constructor.EDIT_CONTEXT!==!1&&!(R.chrome&&R.chrome_version<126)&&(this.editContext=new ia(e),e.state.facet(Xt)&&(e.contentDOM.editContext=this.editContext.editContext)),dl&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.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(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.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(t=>{t.length>0&&t[t.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(Xt)?n.root.activeElement!=this.dom:!Zn(this.dom,r))return;let s=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(R.ie&&R.ie_version<=11||R.android&&R.chrome)&&!n.state.selection.main.empty&&r.focusNode&&Wn(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Mn(e.root);if(!t)return!1;let n=R.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&B0(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=Zn(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Hi(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{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 s of e){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),t==-1?{from:t,to:n}=o:(t=Math.min(o.from,t),n=Math.max(o.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&Zn(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 s=new El(this.view,e,t,n);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}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=ou(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!ds(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=uf(t,e.previousSibling||e.target.previousSibling,-1),r=uf(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else 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(Xt)!=e.state.facet(Xt)&&(e.view.contentDOM.editContext=e.state.facet(Xt)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let r of this.scrollTargets)r.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 uf(i,e,t){for(;e;){let n=re.get(e);if(n&&n.parent==i)return n;let r=e.parentNode;e=r!=i.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function df(i,e){let t=e.startContainer,n=e.startOffset,r=e.endContainer,s=e.endOffset,o=i.docView.domAtPos(i.state.selection.main.anchor,1);return Wn(o.node,o.offset,r,s)&&([t,n,r,s]=[r,s,t,n]),{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:s}}function B0(i,e){if(e.getComposedRanges){let r=e.getComposedRanges(i.root)[0];if(r)return df(i,r)}let t=null;function n(r){r.preventDefault(),r.stopImmediatePropagation(),t=r.getTargetRanges()[0]}return i.contentDOM.addEventListener("beforeinput",n,!0),i.dom.ownerDocument.execCommand("indent"),i.contentDOM.removeEventListener("beforeinput",n,!0),t?df(i,t):null}var ia=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:s,head:o}=r,l=this.toEditorPos(n.updateRangeStart),a=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:l,drifted:!1});let O=a-l>n.text.length;l==this.from&&sthis.to&&(a=s);let h=lu(e.state.sliceDoc(l,a),n.text,(O?r.from:r.to)-l,O?"end":null);if(!h){let f=P.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));ds(f,r)||e.dispatch({selection:f,userEvent:"select"});return}let c={from:h.from+l,to:h.toA+l,insert:j.of(n.text.slice(h.from,h.toB).split(` +`))};if((R.mac||R.android)&&c.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(c={from:l,to:a,insert:j.of([n.text.replace("."," ")])}),this.pendingContextChange=c,!e.state.readOnly){let f=this.to-this.from+(c.to-c.from+c.insert.length);ba(e,c,P.single(this.toEditorPos(n.selectionStart,f),this.toEditorPos(n.selectionEnd,f)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),c.from=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=[],s=null;for(let o=this.toEditorPos(n.rangeStart),l=this.toEditorPos(n.rangeEnd);o{let r=[];for(let s of n.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(s.rangeStart),O=this.toEditorPos(s.rangeEnd);if(a{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:n}=this.composing;this.composing=null,n&&this.reset(e.state)}};for(let n in this.handlers)t.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{let r=Mn(n.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,l,a,O)=>{if(n)return;let h=O.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(O)){r=this.pendingContextChange=null,t+=h,this.to+=h;return}else r=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=h,this.to+=h;else if(sthis.to||this.to-this.from+O.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),O.toString()),this.to+=h}t+=h}),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(r=>!r.isUserEvent("input.type")&&r.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.to1e4*3)}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])}},y=class i{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={}){var t;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:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(r=>r.forEach(s=>n(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||ES(e.parent)||document,this.viewState=new gs(this,e.state||G.create(e)),e.scrollTo&&e.scrollTo.is(Dr)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Di).map(r=>new zn(r));for(let r of this.plugins)r.update(this);this.observer=new ta(this),this.inputState=new Ml(this),this.inputState.ensureHandlers(this.plugins),this.docView=new fs(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof he?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,r,s=this.state;for(let f of e){if(f.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=f.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,a=null;e.some(f=>f.annotation(uu))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=du(s,o),a||(l=1));let O=this.observer.delayedAndroidKey,h=null;if(O?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(h=null)):this.observer.clear(),s.facet(G.phrases)!=this.state.facet(G.phrases))return this.setState(s);r=hs.create(this,s,e),r.flags|=l;let c=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(c&&(c=c.map(f.changes)),f.scrollIntoView){let{main:u}=f.state.selection,{x:p,y:m}=this.state.facet(i.cursorScrollMargin);c=new qn(u.empty?u:P.cursor(u.head,u.head>u.anchor?-1:1),"nearest","nearest",m,p)}for(let u of f.effects)u.is(Dr)&&(c=u.value.clip(this.state))}this.viewState.update(r,c),this.bidiCache=Qs.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(vn)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(Hr)!=r.state.facet(Hr)&&(this.viewState.mustMeasureContent=!0),(t||n||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let f of this.state.facet(vl))try{f(r)}catch(u){Pe(this.state,u,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!ou(this,h)&&O.force&&Hi(this.contentDOM,O.key,O.keyCode)})}setState(e){if(this.updateState!=0)throw new 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 n of this.plugins)n.destroy(this);this.viewState=new gs(this,e),this.plugins=e.facet(Di).map(n=>new zn(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new fs(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(Di),n=e.state.facet(Di);if(t!=n){let r=[];for(let s of n){let o=t.indexOf(s);if(o<0)r.push(new zn(s));else{let l=this.plugins[o];l.mustUpdate=e,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r-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:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(zf(n||this.win))s=-1,o=this.viewState.heightMap.height;else{let u=this.viewState.scrollAnchorAt(r);s=u.from,o=u.top}this.updateState=1;let a=this.viewState.measure();if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let O=[];a&4||([this.measureRequests,O]=[O,this.measureRequests]);let h=O.map(u=>{try{return u.read(this)}catch(p){return Pe(this.state,p),pf}}),c=hs.create(this,this.state,[]),f=!1;c.flags|=a,t?t.flags|=a:t=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c),this.updateAttrs(),f=this.docView.update(c),f&&this.docViewUpdate());for(let u=0;u1||p<-1)&&!(R.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+p,n?n.scrollTop+=p:this.win.scrollBy(0,p),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(vl))l(t)}get themeClasses(){return Jl+" "+(this.state.facet(Kl)?gu:mu)+" "+this.state.facet(Hr)}updateAttrs(){let e=mf(this,Kf,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Xt)?"true":"false",class:"cm-content",style:`${R.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),mf(this,Sa,t);let n=this.observer.ignore(()=>{let r=Ic(this.contentDOM,this.contentAttrs,t),s=Ic(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let r of n.effects)if(r.is(i.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(vn);let e=this.state.facet(i.cspNonce);Je.mount(this.root,this.styleModules.concat(D0).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new 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;tn.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 ul(this,e,Jc(this,e,t,n))}moveByGroup(e,t){return ul(this,e,Jc(this,e,t,n=>m0(this,e.head,n)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=n[t?n.length-1:0];return P.cursor(s.side(t,r)+e.from,s.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return p0(this,e,t,n)}moveVertically(e,t,n){return ul(this,e,g0(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=Vl(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),Vl(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.state.doc.lineAt(e),r=this.bidiSpans(n),s=r[it.find(r,e-n.from,-1,t)];return this.docView.coordsAt(e,t,s.dir==N.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(Bf)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>N0)return jf(e.length);let t=this.textDirectionAt(e.from),n;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||Af(s.isolates,n=Fc(this,e))))return s.order;n||(n=Fc(this,e));let r=NS(e.text,t,n);return this.bidiCache.push(new Qs(e.from,e.to,t,n,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||R.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{qf(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={}){var n,r,s,o;return Dr.of(new qn(typeof e=="number"?P.cursor(e):e,(n=t.y)!==null&&n!==void 0?n:"nearest",(r=t.x)!==null&&r!==void 0?r:"nearest",(s=t.yMargin)!==null&&s!==void 0?s:5,(o=t.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return Dr.of(new qn(P.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 ie.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return ie.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=Je.newName(),r=[Hr.of(n),vn.of(ea(`.${n}`,e))];return t&&t.dark&&r.push(Kl.of(!0)),r}static baseTheme(e){return ze.lowest(vn.of(ea("."+Jl,e,Qu)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&re.get(n)||re.get(e);return((t=r?.root)===null||t===void 0?void 0:t.view)||null}};y.styleModule=vn;y.inputHandler=Df;y.clipboardInputFilter=ga;y.clipboardOutputFilter=Qa;y.scrollHandler=Ff;y.focusChangeEffect=If;y.perLineTextDirection=Bf;y.exceptionSink=Lf;y.updateListener=vl;y.editable=Xt;y.mouseSelectionStyle=Gf;y.dragMovesSelection=Uf;y.clickAddsSelectionRange=Mf;y.decorations=ws;y.blockWrappers=Jf;y.outerDecorations=Pa;y.atomicRanges=Gn;y.bidiIsolatedRanges=eu;y.cursorScrollMargin=v.define({combine:i=>{let e=5,t=5;for(let n of i)typeof n=="number"?e=t=n:{x:e,y:t}=n;return{x:e,y:t}}});y.scrollMargins=tu;y.darkTheme=Kl;y.cspNonce=v.define({combine:i=>i.length?i[0]:""});y.contentAttributes=Sa;y.editorAttributes=Kf;y.lineWrapping=y.contentAttributes.of({class:"cm-lineWrapping"});y.announce=z.define();var N0=4096,pf={},Qs=class i{constructor(e,t,n,r,s,o){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=s,this.order=o}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let n=[],r=e.length?e[e.length-1].dir:N.LTR;for(let s=Math.max(0,e.length-10);s=0;r--){let s=n[r],o=typeof s=="function"?s(i):s;o&&da(o,t)}return t}var F0=R.mac?"mac":R.windows?"win":R.linux?"linux":"key";function H0(i,e){let t=i.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,s,o,l;for(let a=0;an.concat(r),[]))),t}function Pu(i,e,t){return $u(Su(i.state),e,i,t)}var Lt=null,J0=4e3;function eP(i,e=F0){let t=Object.create(null),n=Object.create(null),r=(o,l)=>{let a=n[o];if(a==null)n[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,a,O,h)=>{var c,f;let u=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(Q=>H0(Q,e));for(let Q=1;Q{let X=Lt={view:$,prefix:S,scope:o};return setTimeout(()=>{Lt==X&&(Lt=null)},J0),!0}]})}let m=p.join(" ");r(m,!1);let g=u[m]||(u[m]={preventDefault:!1,stopPropagation:!1,run:((f=(c=u._any)===null||c===void 0?void 0:c.run)===null||f===void 0?void 0:f.slice())||[]});a&&g.run.push(a),O&&(g.preventDefault=!0),h&&(g.stopPropagation=!0)};for(let o of i){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let O of l){let h=t[O]||(t[O]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:c}=o;for(let f in h)h[f].run.push(u=>c(u,na))}let a=o[e]||o.key;if(a)for(let O of l)s(O,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(O,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}var na=null;function $u(i,e,t,n){na=e;let r=Mc(e),s=Se(r,0),o=Me(s)==r.length&&r!=" ",l="",a=!1,O=!1,h=!1;Lt&&Lt.view==t&&Lt.scope==n&&(l=Lt.prefix+" ",Ou.indexOf(e.keyCode)<0&&(O=!0,Lt=null));let c=new Set,f=g=>{if(g){for(let Q of g.run)if(!c.has(Q)&&(c.add(Q),Q(t)))return g.stopPropagation&&(h=!0),!0;g.preventDefault&&(g.stopPropagation&&(h=!0),O=!0)}return!1},u=i[n],p,m;return u&&(f(u[l+Kr(r,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(R.windows&&e.ctrlKey&&e.altKey)&&!(R.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(p=kt[e.keyCode])&&p!=r?(f(u[l+Kr(p,e,!0)])||e.shiftKey&&(m=Gi[e.keyCode])!=r&&m!=p&&f(u[l+Kr(m,e,!1)]))&&(a=!0):o&&e.shiftKey&&f(u[l+Kr(r,e,!0)])&&(a=!0),!a&&f(u._any)&&(a=!0)),O&&(a=!0),a&&h&&e.stopPropagation(),na=null,a}var Si=class i{constructor(e,t,n,r,s){this.className=e,this.left=t,this.top=n,this.width=r,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(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(e,t,n){if(n.empty){let r=e.coordsAtPos(n.head,n.assoc||1);if(!r)return[];let s=bu(e);return[new i(t,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return tP(e,t,n)}};function bu(i){let e=i.scrollDOM.getBoundingClientRect();return{left:(i.textDirection==N.LTR?e.left:e.right-i.scrollDOM.clientWidth*i.scaleX)-i.scrollDOM.scrollLeft*i.scaleX,top:e.top-i.scrollDOM.scrollTop*i.scaleY}}function Qf(i,e,t,n){let r=i.coordsAtPos(e,t*2);if(!r)return n;let s=i.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,l=i.posAtCoords({x:s.left+1,y:o}),a=i.posAtCoords({x:s.right-1,y:o});return l==null||a==null?n:{from:Math.max(n.from,Math.min(l,a)),to:Math.min(n.to,Math.max(l,a))}}function tP(i,e,t){if(t.to<=i.viewport.from||t.from>=i.viewport.to)return[];let n=Math.max(t.from,i.viewport.from),r=Math.min(t.to,i.viewport.to),s=i.textDirection==N.LTR,o=i.contentDOM,l=o.getBoundingClientRect(),a=bu(i),O=o.querySelector(".cm-line"),h=O&&window.getComputedStyle(O),c=l.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),f=l.right-(h?parseInt(h.paddingRight):0),u=Yl(i,n,1),p=Yl(i,r,-1),m=u.type==$e.Text?u:null,g=p.type==$e.Text?p:null;if(m&&(i.lineWrapping||u.widgetLineBreaks)&&(m=Qf(i,n,1,m)),g&&(i.lineWrapping||p.widgetLineBreaks)&&(g=Qf(i,r,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)return S($(t.from,t.to,m));{let b=m?$(t.from,null,m):X(u,!1),w=g?$(null,t.to,g):X(p,!0),k=[];return(m||u).to<(g||p).from-(m&&g?1:0)||u.widgetLineBreaks>1&&b.bottom+i.defaultLineHeight/2C&&B.from=ke)break;Fe>ee&&A(Math.max(Qe,ee),b==null&&Qe<=C,Math.min(Fe,ke),w==null&&Fe>=F,gt.dir)}if(ee=Ae.to+1,ee>=ke)break}return K.length==0&&A(C,b==null,F,w==null,i.textDirection),{top:_,bottom:M,horizontal:K}}function X(b,w){let k=l.top+(w?b.top:b.bottom);return{top:k,bottom:k,horizontal:[]}}}function iP(i,e){return i.constructor==e.constructor&&i.eq(e)}var ra=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(ns)!=e.state.facet(ns)&&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(ns);for(;t!iP(t,this.drawn[n]))){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 r=t.nextSibling;t.remove(),t=r}this.drawn=e,R.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}},ns=v.define();function yu(i){return[ie.define(e=>new ra(e,i)),ns.of(i)]}var rn=v.define({combine(i){return ye(i,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function xu(i={}){return[rn.of(i),nP,rP,oP,Nf.of(!0)]}function wu(i){return i.startState.facet(rn)!=i.state.facet(rn)}var nP=yu({above:!0,markers(i){let{state:e}=i,t=e.facet(rn),n=[];for(let r of e.selection.ranges){let s=r==e.selection.main;if(r.empty||t.drawRangeCursor&&!(s&&R.ios&&t.iosSelectionHandles)){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:P.cursor(r.head,r.assoc);for(let a of Si.forRange(i,o,l))n.push(a)}}return n},update(i,e){i.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=wu(i);return t&&Sf(i.state,e),i.docChanged||i.selectionSet||t},mount(i,e){Sf(e.state,i)},class:"cm-cursorLayer"});function Sf(i,e){e.style.animationDuration=i.facet(rn).cursorBlinkRate+"ms"}var rP=yu({above:!1,markers(i){let e=[],{main:t,ranges:n}=i.state.selection;for(let r of n)if(!r.empty)for(let s of Si.forRange(i,"cm-selectionBackground",r))e.push(s);if(R.ios&&!t.empty&&i.state.facet(rn).iosSelectionHandles){for(let r of Si.forRange(i,"cm-selectionHandle cm-selectionHandle-start",P.cursor(t.from,1)))e.push(r);for(let r of Si.forRange(i,"cm-selectionHandle cm-selectionHandle-end",P.cursor(t.to,1)))e.push(r)}return e},update(i,e){return i.docChanged||i.selectionSet||i.viewportChanged||wu(i)},class:"cm-selectionLayer"}),sP=R.gecko&&R.gecko_version>=153?"#ffffff01":"transparent",oP=ze.highest(y.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:`${sP} !important`},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),ku=z.define({map(i,e){return i==null?null:e.mapPos(i)}}),Rn=se.define({create(){return null},update(i,e){return i!=null&&(i=e.changes.mapPos(i)),e.effects.reduce((t,n)=>n.is(ku)?n.value:t,i)}}),lP=ie.fromClass(class{constructor(i){this.view=i,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(i){var e;let t=i.state.field(Rn);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(i.startState.field(Rn)!=t||i.docChanged||i.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:i}=this,e=i.state.field(Rn),t=e!=null&&i.coordsAtPos(e);if(!t)return null;let n=i.scrollDOM.getBoundingClientRect();return{left:t.left-n.left+i.scrollDOM.scrollLeft*i.scaleX,top:t.top-n.top+i.scrollDOM.scrollTop*i.scaleY,height:t.bottom-t.top}}drawCursor(i){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;i?(this.cursor.style.left=i.left/e+"px",this.cursor.style.top=i.top/t+"px",this.cursor.style.height=i.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(i){this.view.state.field(Rn)!=i&&this.view.dispatch({effects:ku.of(i)})}},{eventObservers:{dragover(i){this.setDropPos(this.view.posAtCoords({x:i.clientX,y:i.clientY}))},dragleave(i){(i.target==this.view.contentDOM||!this.view.contentDOM.contains(i.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Xu(){return[Rn,lP]}function Pf(i,e,t,n,r){e.lastIndex=0;for(let s=i.iterRange(t,n),o=t,l;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;l=e.exec(s.value);)r(o+l.index,l)}function aP(i,e){let t=i.visibleRanges;if(t.length==1&&t[0].from==i.viewport.from&&t[0].to==i.viewport.to)return t;let n=[];for(let{from:r,to:s}of t)r=Math.max(i.state.doc.lineAt(r).from,r-e),s=Math.min(i.state.doc.lineAt(s).to,s+e),n.length&&n[n.length-1].to>=r?n[n.length-1].to=s:n.push({from:r,to:s});return n}var sa=class{constructor(e){let{regexp:t,decoration:n,decorate:r,boundary:s,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(l,a,O,h)=>r(h,O,O+l[0].length,l,a);else if(typeof n=="function")this.addMatch=(l,a,O,h)=>{let c=n(l,a,O);c&&h(O,O+l[0].length,c)};else if(n)this.addMatch=(l,a,O,h)=>h(O,O+l[0].length,n);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(e){let t=new Ee,n=t.add.bind(t);for(let{from:r,to:s}of aP(e,this.maxLength))Pf(e.state.doc,this.regexp,r,s,(o,l)=>this.addMatch(l,e,o,n));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((s,o,l,a)=>{a>=e.view.viewport.from&&l<=e.view.viewport.to&&(n=Math.min(l,n),r=Math.max(a,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 s of e.visibleRanges){let o=Math.max(s.from,n),l=Math.min(s.to,r);if(l>=o){let a=e.state.doc.lineAt(o),O=a.toa.from;o--)if(this.boundary.test(a.text[o-1-a.from])){h=o;break}for(;lf.push(Q.range(m,g));if(a==O)for(this.regexp.lastIndex=h-a.from;(u=this.regexp.exec(a.text))&&u.indexthis.addMatch(g,e,m,p));t=t.update({filterFrom:h,filterTo:c,filter:(m,g)=>mc,add:f})}}return t}},oa=/x/.unicode!=null?"gu":"g",OP=new RegExp(`[\0-\b +-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,oa),hP={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"},pl=null;function cP(){var i;if(pl==null&&typeof document<"u"&&document.body){let e=document.body.style;pl=((i=e.tabSize)!==null&&i!==void 0?i:e.MozTabSize)!=null}return pl||!1}var rs=v.define({combine(i){let e=ye(i,{render:null,specialChars:OP,addSpecialChars:null});return(e.replaceTabs=!cP())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,oa)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,oa)),e}});function vu(i={}){return[rs.of(i),fP()]}var $f=null;function fP(){return $f||($f=ie.fromClass(class{constructor(i){this.view=i,this.decorations=Z.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(i.state.facet(rs)),this.decorations=this.decorator.createDeco(i)}makeDecorator(i){return new sa({regexp:i.specialChars,decoration:(e,t,n)=>{let{doc:r}=t.state,s=Se(e[0],0);if(s==9){let o=r.lineAt(n),l=t.state.tabSize,a=ve(o.text,l,n-o.from);return Z.replace({widget:new aa((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=Z.replace({widget:new la(i,s)}))},boundary:i.replaceTabs?void 0:/[^]/})}update(i){let e=i.state.facet(rs);i.startState.facet(rs)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(i.view)):this.decorations=this.decorator.updateDeco(i,this.decorations)}},{decorations:i=>i.decorations}))}var uP="\u2022";function dP(i){return i>=32?uP:i==10?"\u2424":String.fromCharCode(9216+i)}var la=class extends Re{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=dP(this.code),n=e.state.phrase("Control character")+" "+(hP[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let s=document.createElement("span");return s.textContent=t,s.title=n,s.setAttribute("aria-label",n),s.className="cm-specialChar",s}ignoreEvent(){return!1}},aa=class extends Re{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 Tu(){return mP}var pP=Z.line({class:"cm-activeLine"}),mP=ie.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.docChanged||i.selectionSet)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=-1,t=[];for(let n of i.state.selection.ranges){let r=i.lineBlockAt(n.head);r.from>e&&(t.push(pP.range(r.from)),e=r.from)}return Z.set(t)}},{decorations:i=>i.decorations});var Oa=2e3;function gP(i,e,t){let n=Math.min(e.line,t.line),r=Math.max(e.line,t.line),s=[];if(e.off>Oa||t.off>Oa||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=n;a<=r;a++){let O=i.doc.line(a);O.length<=l&&s.push(P.range(O.from+o,O.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=n;a<=r;a++){let O=i.doc.line(a),h=Gr(O.text,o,i.tabSize,!0);if(h<0)s.push(P.cursor(O.to));else{let c=Gr(O.text,l,i.tabSize);s.push(P.range(O.from+h,O.from+c))}}}return s}function QP(i,e){let t=i.coordsAtPos(i.viewport.from);return t?Math.round(Math.abs((t.left-e)/i.defaultCharacterWidth)):-1}function bf(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1),n=i.state.doc.lineAt(t),r=t-n.from,s=r>Oa?-1:r==n.length?QP(i,e.clientX):ve(n.text,i.state.tabSize,t-n.from);return{line:n.number,col:s,off:r}}function SP(i,e){let t=bf(i,e),n=i.state.selection;return t?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(t.line).from),o=r.state.doc.lineAt(s);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},n=n.map(r.changes)}},get(r,s,o){let l=bf(i,r);if(!l)return n;let a=gP(i.state,t,l);return a.length?o?P.create(a.concat(n.ranges)):P.create(a):n}}:null}function Ru(i){let e=i?.eventFilter||(t=>t.altKey&&t.button==0);return y.mouseSelectionStyle.of((t,n)=>e(n)?SP(t,n):null)}var PP={Alt:[18,i=>!!i.altKey],Control:[17,i=>!!i.ctrlKey],Shift:[16,i=>!!i.shiftKey],Meta:[91,i=>!!i.metaKey]},$P={style:"cursor: crosshair"};function Zu(i={}){let[e,t]=PP[i.key||"Alt"],n=ie.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||t(r))},keyup(r){(r.keyCode==e||!t(r))&&this.set(!1)},mousemove(r){this.set(t(r))}}});return[n,y.contentAttributes.of(r=>{var s;return!((s=r.plugin(n))===null||s===void 0)&&s.isDown?$P:null})]}var Jr="-10000px",Ss=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(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=n(o,s))}update(e,t){var n;let r=e.state.facet(this.facet),s=r.filter(a=>a);if(r===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=t?[]:null;for(let a=0;at[O]=a),t.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}};function bP(i){let e=i.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}var ml=v.define({combine:i=>{var e,t,n;return{position:R.ios?"absolute":((e=i.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=i.find(r=>r.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((n=i.find(r=>r.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||bP}}}),yf=new WeakMap,ya=ie.fromClass(class{constructor(i){this.view=i,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=i.state.facet(ml);this.position=e.position,this.parent=e.parent,this.classes=i.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 Ss(i,Ln,(t,n)=>this.createTooltip(t,n),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),i.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 i of this.manager.tooltipViews)this.intersectionObserver.observe(i.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(i){i.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(i,this.above);e&&this.observeIntersection();let t=e||i.geometryChanged,n=i.state.facet(ml);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;t=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(i,e){let t=i.create(this.view),n=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),i.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",t.dom.appendChild(r)}return t.dom.style.position=this.position,t.dom.style.top=Jr,t.dom.style.left="0px",this.container.insertBefore(t.dom,n),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var i,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),(i=n.destroy)===null||i===void 0||i.call(n);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let i=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(R.safari){let o=s.getBoundingClientRect();t=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else t=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(t||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(i=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:i,scaleY:e}=this.view.viewState);let n=this.view.scrollDOM.getBoundingClientRect(),r=$a(this.view);return{visible:{left:n.left+r.left,top:n.top+r.top,right:n.right-r.right,bottom:n.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(ml).tooltipSpace(this.view),scaleX:i,scaleY:e,makeAbsolute:t}}writeMeasure(i){var e;if(i.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:t,space:n,scaleX:r,scaleY:s}=i,o=[];for(let l=0;l=Math.min(t.bottom,n.bottom)||c.rightMath.min(t.right,n.right)+.1)){h.style.top=Jr;continue}let u=a.arrow?O.dom.querySelector(".cm-tooltip-arrow"):null,p=u?7:0,m=f.right-f.left,g=(e=yf.get(O))!==null&&e!==void 0?e:f.bottom-f.top,Q=O.offset||xP,S=this.view.textDirection==N.LTR,$=f.width>n.right-n.left?S?n.left:n.right-f.width:S?Math.max(n.left,Math.min(c.left-(u?14:0)+Q.x,n.right-m)):Math.min(Math.max(n.left,c.left-m+(u?14:0)-Q.x),n.right-m),X=this.above[l];!a.strictSide&&(X?c.top-g-p-Q.yn.bottom)&&X==n.bottom-c.bottom>c.top-n.top&&(X=this.above[l]=!X);let b=(X?c.top-n.top:n.bottom-c.bottom)-p;if(b$&&_.topw&&(w=X?_.top-g-2-p:_.bottom+p+2);if(this.position=="absolute"?(h.style.top=(w-i.parent.top)/s+"px",xf(h,($-i.parent.left)/r)):(h.style.top=w/s+"px",xf(h,$/r)),u){let _=c.left+(S?Q.x:-Q.x)-($+14-7);u.style.left=_/r+"px"}O.overlap!==!0&&o.push({left:$,top:w,right:k,bottom:w+g}),h.classList.toggle("cm-tooltip-above",X),h.classList.toggle("cm-tooltip-below",!X),O.positioned&&O.positioned(i.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 i of this.manager.tooltipViews)i.dom.style.top=Jr}},{eventObservers:{scroll(){this.maybeMeasure()}}});function xf(i,e){let t=parseInt(i.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(i.style.left=e+"px")}var yP=y.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"}}}),xP={x:0,y:0},Ln=v.define({enables:[ya,yP]}),Ps=v.define({combine:i=>i.reduce((e,t)=>e.concat(t),[])}),$s=class i{static create(e){return new i(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Ss(e,Ps,(t,n)=>this.createHostedView(t,n),t=>t.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===void 0||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")}},wP=Ln.compute([Ps],i=>{let e=i.facet(Ps);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var n;return(n=t.end)!==null&&n!==void 0?n:t.pos})),create:$s.create,above:e[0].above,arrow:e.some(t=>t.arrow)}}),Wu=v.define(),ha=class{constructor(e,t,n,r,s,o){this.view=e,this.source=t,this.field=n,this.locked=r,this.setHover=s,this.hoverTime=o,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;eo.bottom||t.xo.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(r)).find(O=>O.from<=r&&O.to>=r),a=l&&l.dir==N.RTL?-1:1;s=t.x{if(l&&!(Array.isArray(l)&&!l.length)){let a=Array.isArray(l)?l:[l];r&&this.locked.set(a,r),e.dispatch({effects:this.setHover.of(a)})}};if(s&&"then"in s){let l=this.pending={pos:t};s.then(a=>{this.pending==l&&(this.pending=null,o(a))},a=>Pe(e.state,a,"hover tooltip"))}else o(s)}get tooltip(){let e=this.view.plugin(ya),t=e?e.manager.tooltips.findIndex(n=>n.create==$s.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;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:r,tooltip:s}=this;if(r.length&&!this.locked.has(r)&&s&&!kP(s.dom,e)||this.pending){let{pos:o}=r[0]||this.pending,l=(n=(t=r[0])===null||t===void 0?void 0:t.end)!==null&&n!==void 0?n:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!XP(this.view,o,l,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:n}=this;n&&n.dom.contains(e.relatedTarget)?this.watchTooltipLeave(n.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)}},es=4;function kP(i,e){let{left:t,right:n,top:r,bottom:s}=i.getBoundingClientRect(),o;if(o=i.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return e.clientX>=t-es&&e.clientX<=n+es&&e.clientY>=r-es&&e.clientY<=s+es}function XP(i,e,t,n,r,s){let o=i.scrollDOM.getBoundingClientRect(),l=i.documentTop+i.documentPadding.top+i.contentHeight;if(o.left>n||o.rightr||Math.min(o.bottom,l)=e&&a<=t}function qu(i,e={}){let t=z.define(),n=new WeakMap,r=se.define({create(){return[]},update(o,l){let a=n.get(o);if(o.length&&(e.hideOnChange&&(l.docChanged||l.selection)?o=[]:a&&a(l)?o=[]:e.hideOn&&(o=o.filter(O=>!e.hideOn(l,O)))),l.docChanged&&o.length){let O=[];for(let h of o){let c=l.changes.mapPos(h.pos,-1,pe.TrackDel);if(c!=null){let f=Object.assign(Object.create(null),h);f.pos=c,f.end!=null&&(f.end=l.changes.mapPos(f.end)),O.push(f)}}o=O}for(let O of l.effects)O.is(t)&&(o=O.value,a=void 0),(O.is(vP)&&!O.value||O.value==r)&&(o=[]);return o.length&&a&&n.set(o,a),o},provide:o=>Ps.from(o)}),s=ie.define(o=>new ha(o,i,r,n,t,e.hoverTime||300));return{active:r,extension:[r,s,Wu.of(s),wP]}}function zu(i,e,t,n={}){var r;let s=i.state.facet(Wu).map(o=>i.plugin(o)).filter(o=>!!o);if(n.tooltip&&n.tooltip.active){let o=s.find(l=>l.field==n.tooltip.active);o&&(s=[o])}for(let o of s)o.activateHover(i,e,t,(r=n.until)!==null&&r!==void 0?r:(()=>!1))}function xa(i,e){let t=i.plugin(ya);if(!t)return null;let n=t.manager.tooltips.indexOf(e);return n<0?null:t.manager.tooltipViews[n]}var vP=z.define();var wf=v.define({combine(i){let e,t;for(let n of i)e=e||n.topContainer,t=t||n.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Dn(i,e){let t=i.plugin(Cu),n=t?t.specs.indexOf(e):-1;return n>-1?t.panels[n]:null}var Cu=ie.fromClass(class{constructor(i){this.input=i.state.facet(yi),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(i));let e=i.state.facet(wf);this.top=new Bi(i,!0,e.topContainer),this.bottom=new Bi(i,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(i){let e=i.state.facet(wf);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Bi(i.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Bi(i.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=i.state.facet(yi);if(t!=this.input){let n=t.filter(a=>a),r=[],s=[],o=[],l=[];for(let a of n){let O=this.specs.indexOf(a),h;O<0?(h=a(i.view),l.push(h)):(h=this.panels[O],h.update&&h.update(i)),r.push(h),(h.top?s:o).push(h)}this.specs=n,this.panels=r,this.top.sync(s),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let n of this.panels)n.update&&n.update(i)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:i=>y.scrollMargins.of(e=>{let t=e.plugin(i);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})}),Bi=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(),this.dom=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 t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=kf(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=kf(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 kf(i){let e=i.nextSibling;return i.remove(),e}var yi=v.define({enables:Cu});function _u(i,e){let t,n=new Promise(o=>t=o),r=o=>TP(o,e,t);i.state.field(gl,!1)?i.dispatch({effects:Yu.of(r)}):i.dispatch({effects:z.appendConfig.of(gl.init(()=>[r]))});let s=Vu.of(r);return{close:s,result:n.then(o=>((i.win.queueMicrotask||(a=>i.win.setTimeout(a,10)))(()=>{i.state.field(gl).indexOf(r)>-1&&i.dispatch({effects:s})}),o))}}var gl=se.define({create(){return[]},update(i,e){for(let t of e.effects)t.is(Yu)?i=[t.value].concat(i):t.is(Vu)&&(i=i.filter(n=>n!=t.value));return i},provide:i=>yi.computeN([i],e=>e.field(i))}),Yu=z.define(),Vu=z.define();function TP(i,e,t){let n=e.content?e.content(i,()=>o(null)):null;if(!n){if(n=I("form"),e.input){let l=I("input",e.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),n.appendChild(I("label",(e.label||"")+": ",l))}else n.appendChild(document.createTextNode(e.label||""));n.appendChild(document.createTextNode(" ")),n.appendChild(I("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let r=n.nodeName=="FORM"?[n]:n.querySelectorAll("form");for(let l=0;l{O.keyCode==27?(O.preventDefault(),o(null)):O.keyCode==13&&(O.preventDefault(),o(a))}),a.addEventListener("submit",O=>{O.preventDefault(),o(a)})}let s=I("div",n,I("button",{onclick:()=>o(null),"aria-label":i.state.phrase("close"),class:"cm-dialog-close",type:"button"},["\xD7"]));e.class&&(s.className=e.class),s.classList.add("cm-dialog");function o(l){s.contains(s.ownerDocument.activeElement)&&i.focus(),t(l)}return{dom:s,top:e.top,mount:()=>{if(e.focus){let l;typeof e.focus=="string"?l=n.querySelector(e.focus):l=n.querySelector("input")||n.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}var Ge=class extends Ke{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};Ge.prototype.elementClass="";Ge.prototype.toDOM=void 0;Ge.prototype.mapMode=pe.TrackBefore;Ge.prototype.startSide=Ge.prototype.endSide=-1;Ge.prototype.point=!0;var ss=v.define(),RP=v.define(),ZP={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>L.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Vn=v.define();function wa(i){return[Au(),Vn.of({...ZP,...i})]}var ca=v.define({combine:i=>i.some(e=>e)});function Au(i){let e=[WP];return i&&i.fixed===!1&&e.push(ca.of(!0)),e}var WP=ie.fromClass(class{constructor(i){this.view=i,this.domAfter=null,this.prevViewport=i.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=i.state.facet(Vn).map(e=>new bs(i,e)),this.fixed=!i.state.facet(ca);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),i.scrollDOM.insertBefore(this.dom,i.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(i){if(this.updateGutters(i)){let e=this.prevViewport,t=i.view.viewport,n=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(n<(t.to-t.from)*.8)}if(i.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(ca)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=i.view.viewport}syncGutters(i){let e=this.dom.nextSibling;i&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=L.iter(this.view.state.facet(ss),this.view.viewport.from),n=[],r=this.gutters.map(s=>new ua(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(s.type)){let o=!0;for(let l of s.type)if(l.type==$e.Text&&o){fa(t,n,l.from);for(let a of r)a.line(this.view,l,n);o=!1}else if(l.widget)for(let a of r)a.widget(this.view,l)}else if(s.type==$e.Text){fa(t,n,s.from);for(let o of r)o.line(this.view,s,n)}else if(s.widget)for(let o of r)o.widget(this.view,s);for(let s of r)s.finish();i&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(i){let e=i.startState.facet(Vn),t=i.state.facet(Vn),n=i.docChanged||i.heightChanged||i.viewportChanged||!L.eq(i.startState.facet(ss),i.state.facet(ss),i.view.viewport.from,i.view.viewport.to);if(e==t)for(let r of this.gutters)r.update(i)&&(n=!0);else{n=!0;let r=[];for(let s of t){let o=e.indexOf(s);o<0?r.push(new bs(this.view,s)):(this.gutters[o].update(i),r.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return n}destroy(){for(let i of this.gutters)i.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:i=>y.scrollMargins.of(e=>{let t=e.plugin(i);if(!t||t.gutters.length==0||!t.fixed)return null;let n=t.dom.offsetWidth*e.scaleX,r=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==N.LTR?{left:n,right:r}:{right:n,left:r}})});function Xf(i){return Array.isArray(i)?i:[i]}function fa(i,e,t){for(;i.value&&i.from<=t;)i.from==t&&e.push(i.value),i.next()}var ua=class{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=L.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,s=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==r.elements.length){let l=new ys(e,o,s,n);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(e,o,s,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];fa(this.cursor,r,t.from),n.length&&(r=r.concat(n));let s=this.gutter.config.lineMarker(e,t,r);s&&r.unshift(s);let o=this.gutter;r.length==0&&!o.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 s of e.state.facet(RP)){let o=s(e,t.widget,t);o&&(r||(r=[])).push(o)}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()}}},bs=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 s=r.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let a=s.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=r.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[n](e,l,r)&&r.preventDefault()});this.markers=Xf(t.markers(e)),t.initialSpacer&&(this.spacer=new ys(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=Xf(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let n=e.view.viewport;return!L.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()}},ys=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":""),qP(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let l=o,a=ss(l,a,O)||o(l,a,O):o}return n}})}}),An=class extends Ge{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function Ql(i,e){return i.state.facet(Ni).formatNumber(e,i.state)}var _P=Vn.compute([Ni],i=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(zP)},lineMarker(e,t,n){return n.some(r=>r.toDOM)?null:new An(Ql(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let r of e.state.facet(CP)){let s=r(e,t,n);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(Ni)!=e.state.facet(Ni),initialSpacer(e){return new An(Ql(e,vf(e.state.doc.lines)))},updateSpacer(e,t){let n=Ql(t.view,vf(t.view.state.doc.lines));return n==e.number?e:new An(n)},domEventHandlers:i.facet(Ni).domEventHandlers,side:"before"}));function Xs(i={}){return[Ni.of(i),Au(),_P]}function vf(i){let e=9;for(;e{let e=[],t=-1;for(let n of i.selection.ranges){let r=i.doc.lineAt(n.head).from;r>t&&(t=r,e.push(YP.range(r)))}return L.of(e)});function ju(){return VP}var AP=0,_e=class{constructor(e,t){this.from=e,this.to=t}},q=class{constructor(e={}){this.id=AP++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=oe.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};q.closedBy=new q({deserialize:i=>i.split(" ")});q.openedBy=new q({deserialize:i=>i.split(" ")});q.group=new q({deserialize:i=>i.split(" ")});q.isolate=new q({deserialize:i=>{if(i&&i!="rtl"&&i!="ltr"&&i!="auto")throw new RangeError("Invalid value for isolate: "+i);return i||"auto"}});q.contextHash=new q({perNode:!0});q.lookAhead=new q({perNode:!0});q.mounted=new q({perNode:!0});var Ft=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[q.mounted.id]}},jP=Object.create(null),oe=class i{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):jP,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new i(e.name||"",t,e.id,n);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return r}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(q.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 n=>{for(let r=n.prop(q.group),s=-1;s<(r?r.length:0);s++){let o=t[s<0?n.name:r[s]];if(o)return o}}}};oe.none=new oe("",Object.create(null),0,8);var Rt=class i{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|E.IncludeAnonymous);;){let O=!1;if(a.from<=s&&a.to>=r&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;O=!0}for(;O&&n&&(l||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;O=!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(e={}){return this.children.length<=8?this:_a(oe.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new i(this.type,t,n,r,this.propValues),e.makeTree||((t,n,r)=>new i(oe.none,t,n,r)))}static build(e){return MP(e)}};Y.empty=new Y(oe.none,[],[],0);var ka=class i{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 i(this.buffer,this.index)}},Ht=class i{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return oe.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,n){let r=this.buffer,s=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function In(i,e,t,n){for(var r;i.from==i.to||(t<1?i.from>=e:i.from>e)||(t>-1?i.to<=e:i.to0?l.length:-1;e!=O;e+=t){let h=l[e],c=a[e]+o.from,f;if(!(!(s&E.EnterBracketed&&h instanceof Y&&(f=Ft.get(h))&&!f.overlay&&f.bracketed&&n>=c&&n<=c+h.length)&&!Bu(r,n,c,c+h.length))){if(h instanceof Ht){if(s&E.ExcludeBuffers)continue;let u=h.findChild(0,h.buffer.length,t,n-c,r);if(u>-1)return new xi(new va(o,h,e,c),null,u)}else if(s&E.IncludeAnonymous||!h.type.isAnonymous||Ca(h)){let u;if(!(s&E.IgnoreMounts)&&(u=Ft.get(h))&&!u.overlay)return new i(u.tree,c,e,o);let p=new i(h,c,e,o);return s&E.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(t<0?h.children.length-1:0,t,n,r,s)}}}if(s&E.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<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(e,t,n=0){let r;if(!(n&E.IgnoreOverlays)&&(r=Ft.get(this._tree))&&r.overlay){let s=e-this.from,o=n&E.EnterBracketed&&r.bracketed;for(let{from:l,to:a}of r.overlay)if((t>0||o?l<=s:l=s:a>s))return new i(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}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 Mu(i,e,t,n){let r=i.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=r.type.is(t),!r.nextSibling())return s}for(;;){if(n!=null&&r.type.is(n))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return n==null?s:[]}}function Xa(i,e,t=e.length-1){for(let n=i;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}var va=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},xi=class i extends Rs{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(e,t,n){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return s<0?null:new i(this.context,this,s)}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(e,t,n=0){if(n&E.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new i(this.context,this,s)}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:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new i(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new i(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,s=n.buffer[this.index+3];if(s>r){let o=n.buffer[this.index+1];e.push(n.slice(r,s,o)),t.push(0)}return new Y(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function Nu(i){if(!i.length)return null;let e=0,t=i[0];for(let s=1;st.from||o.to=e){let l=new Ye(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[n])).push(In(l,e,t,!1))}}return r?Nu(r):n}var sn=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&~E.EnterBracketed,e instanceof Ye)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.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 Ye?(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,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}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&E.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&E.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&E.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 r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(r)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}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-1)for(let s=t+e,o=e<0?-1:n._tree.children.length;s!=o;s+=e){let l=n._tree.children[s];if(this.mode&E.IncludeAnonymous||l instanceof Ht||!l.type.isAnonymous||Ca(l))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=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=s+1;break e}r=this.stack[--s]}for(let r=n;r=0;s--){if(s<0)return Xa(this._tree,e,r);let o=n[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}};function Ca(i){return i.children.some(e=>e instanceof Ht||!e.type.isAnonymous||Ca(e))}function MP(i){var e;let{buffer:t,nodeSet:n,maxBufferLength:r=1024,reused:s=[],minRepeatType:o=n.types.length}=i,l=Array.isArray(t)?new ka(t,t.length):t,a=n.types,O=0,h=0;function c(b,w,k,_,M,K){let{id:A,start:C,end:F,size:B}=l,ee=h,ke=O;if(B<0)if(l.next(),B==-1){let xt=s[A];k.push(xt),_.push(C-b);return}else if(B==-3){O=A;return}else if(B==-4){h=A;return}else throw new RangeError(`Unrecognized record size: ${B}`);let Ae=a[A],gt,Qe,Fe=C-b;if(F-C<=r&&(Qe=g(l.pos-w,M))){let xt=new Uint16Array(Qe.size-Qe.skip),He=l.pos-Qe.size,Qt=xt.length;for(;l.pos>He;)Qt=Q(Qe.start,xt,Qt);gt=new Ht(xt,F-Qe.start,n),Fe=Qe.start-b}else{let xt=l.pos-B;l.next();let He=[],Qt=[],ci=A>=o?A:-1,Ai=0,Wr=F;for(;l.pos>xt;)ci>=0&&l.id==ci&&l.size>=0?(l.end<=Wr-r&&(p(He,Qt,C,Ai,l.end,Wr,ci,ee,ke),Ai=He.length,Wr=l.end),l.next()):K>2500?f(C,xt,He,Qt):c(C,xt,He,Qt,ci,K+1);if(ci>=0&&Ai>0&&Ai-1&&Ai>0){let pc=u(Ae,ke);gt=_a(Ae,He,Qt,0,He.length,0,F-C,pc,pc)}else gt=m(Ae,He,Qt,F-C,ee-F,ke)}k.push(gt),_.push(Fe)}function f(b,w,k,_){let M=[],K=0,A=-1;for(;l.pos>w;){let{id:C,start:F,end:B,size:ee}=l;if(ee>4)l.next();else{if(A>-1&&F=0;B-=3)C[ee++]=M[B],C[ee++]=M[B+1]-F,C[ee++]=M[B+2]-F,C[ee++]=ee;k.push(new Ht(C,M[2]-F,n)),_.push(F-b)}}function u(b,w){return(k,_,M)=>{let K=0,A=k.length-1,C,F;if(A>=0&&(C=k[A])instanceof Y){if(!A&&C.type==b&&C.length==M)return C;(F=C.prop(q.lookAhead))&&(K=_[A]+C.length+F)}return m(b,k,_,M,K,w)}}function p(b,w,k,_,M,K,A,C,F){let B=[],ee=[];for(;b.length>_;)B.push(b.pop()),ee.push(w.pop()+k-M);b.push(m(n.types[A],B,ee,K-M,C-K,F)),w.push(M-k)}function m(b,w,k,_,M,K,A){if(K){let C=[q.contextHash,K];A=A?[C].concat(A):[C]}if(M>25){let C=[q.lookAhead,M];A=A?[C].concat(A):[C]}return new Y(b,w,k,_,A)}function g(b,w){let k=l.fork(),_=0,M=0,K=0,A=k.end-r,C={size:0,start:0,skip:0};e:for(let F=k.pos-b;k.pos>F;){let B=k.size;if(k.id==w&&B>=0){C.size=_,C.start=M,C.skip=K,K+=4,_+=4,k.next();continue}let ee=k.pos-B;if(B<0||ee=o?4:0,Ae=k.start;for(k.next();k.pos>ee;){if(k.size<0)if(k.size==-3||k.size==-4)ke+=4;else break e;else k.id>=o&&(ke+=4);k.next()}M=Ae,_+=B,K+=ke}return(w<0||_==b)&&(C.size=_,C.start=M,C.skip=K),C.size>4?C:void 0}function Q(b,w,k){let{id:_,start:M,end:K,size:A}=l;if(l.next(),A>=0&&_4){let F=l.pos-(A-4);for(;l.pos>F;)k=Q(b,w,k)}w[--k]=C,w[--k]=K-b,w[--k]=M-b,w[--k]=_}else A==-3?O=_:A==-4&&(h=_);return k}let S=[],$=[];for(;l.pos>0;)c(i.start||0,i.bufferStart||0,S,$,-1,0);let X=(e=i.length)!==null&&e!==void 0?e:S.length?$[0]+S[0].length:0;return new Y(a[i.topID],S.reverse(),$.reverse(),X)}var Uu=new WeakMap;function Ts(i,e){if(!i.isAnonymous||e instanceof Ht||e.type!=i)return 1;let t=Uu.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=i||!(n instanceof Y)){t=1;break}t+=Ts(i,n)}Uu.set(e,t)}return t}function _a(i,e,t,n,r,s,o,l,a){let O=0;for(let p=n;p=h)break;w+=k}if($==X+1){if(w>h){let k=p[X];u(k.children,k.positions,0,k.children.length,m[X]+S);continue}c.push(p[X])}else{let k=m[$-1]+p[$-1].length-b;c.push(_a(i,p,m,X,$,b,k,null,a))}f.push(b+S-s)}}return u(e,t,n,r,0),(l||a)(c,f,o)}var Kt=class{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof xi?this.setBuffer(e.context.buffer,e.index,t):e instanceof Ye&&this.map.set(e.tree,t)}get(e){return e instanceof xi?this.getBuffer(e.context.buffer,e.index):e instanceof Ye?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}},Zt=class i{constructor(e,t,n,r,s=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let r=[new i(0,e.length,e,0,!1,n)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,a=0,O=0;;l++){let h=l=n)for(;o&&o.from=f.from||c<=f.to||O){let u=Math.max(f.from,a)-O,p=Math.min(f.to,c)-O;f=u>=p?null:new i(u,p,f.tree,f.offset+O,l>0,!!h)}if(f&&r.push(f),o.to>c)break;o=snew _e(r.from,r.to)):[new _e(0,0)]:[new _e(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let s=r.advance();if(s)return s}}},Ra=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)}};function Bn(i){return(e,t,n,r)=>new qa(e,i,t,n,r)}var Zs=class{constructor(e,t,n,r,s,o){this.parser=e,this.parse=t,this.overlay=n,this.bracketed=r,this.target=s,this.from=o}};function Gu(i){if(!i.length||i.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(i))}var Za=class{constructor(e,t,n,r,s,o,l,a){this.parser=e,this.predicate=t,this.mounts=n,this.index=r,this.start=s,this.bracketed=o,this.target=l,this.prev=a,this.depth=0,this.ranges=[]}},Wa=new q({perNode:!0}),qa=class{constructor(e,t,n,r,s){this.nest=t,this.input=n,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new Y(n.type,n.children,n.positions,n.length,n.propValues.concat([[Wa,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[q.mounted.id]=new Ft(t,e.overlay,e.parser,e.bracketed),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)l=!1;else if(e.hasNode(r)){if(t){let O=t.mounts.find(h=>h.frag.from<=r.from&&h.frag.to>=r.to&&h.mount.overlay);if(O)for(let h of O.mount.overlay){let c=h.from+O.pos,f=h.to+O.pos;c>=r.from&&f<=r.to&&!t.ranges.some(u=>u.fromc)&&t.ranges.push({from:c,to:f})}}l=!1}else if(n&&(o=UP(n.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew _e(c.from-r.from,c.to-r.from)):null,!!s.bracketed,r.tree,h.length?h[0].from:r.from)),s.overlay?h.length&&(n={ranges:h,depth:0,prev:n}):l=!1}}else if(t&&(a=t.predicate(r))&&(a===!0&&(a=new _e(r.from,r.to)),a.from=0&&t.ranges[O].to==a.from?t.ranges[O]={from:t.ranges[O].from,to:a.to}:t.ranges.push(a)}if(l&&r.firstChild())t&&t.depth++,n&&n.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(t&&!--t.depth){let O=Du(this.ranges,t.ranges);O.length&&(Gu(O),this.inner.splice(t.index,0,new Zs(t.parser,t.parser.startParse(this.input,Iu(t.mounts,O),O),t.ranges.map(h=>new _e(h.from-t.start,h.to-t.start)),t.bracketed,t.target,O[0].from))),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}};function UP(i,e,t){for(let n of i){if(n.from>=t)break;if(n.to>e)return n.from<=e&&n.to>=t?2:1}return 0}function Lu(i,e,t,n,r,s){if(e=e&&t.enter(n,1,E.IgnoreOverlays|E.ExcludeBuffers)))if(t.to<=e)t.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof Y)t=t.children[0];else break}return!1}},za=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(t=n.tree.prop(Wa))!==null&&t!==void 0?t:n.to,this.inner=new Ws(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Wa))!==null&&e!==void 0?e:t.to,this.inner=new Ws(t.tree,-t.offset)}}findMounts(e,t){var n;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(n=s.tree)===null||n===void 0?void 0:n.prop(q.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=s.to)break;a.tree==this.curFrag.tree&&r.push({frag:a,pos:s.from-a.offset,mount:o})}}}return r}};function Du(i,e){let t=null,n=e;for(let r=1,s=0;r=l)break;a.to<=o||(t||(n=t=e.slice()),a.froml&&t.splice(s+1,0,new _e(l,a.to))):a.to>l?t[s--]=new _e(l,a.to):t.splice(s--,1))}}return n}function LP(i,e,t,n){let r=0,s=0,o=!1,l=!1,a=-1e9,O=[];for(;;){let h=r==i.length?1e9:o?i[r].to:i[r].from,c=s==e.length?1e9:l?e[s].to:e[s].from;if(o!=l){let f=Math.max(a,t),u=Math.min(h,c,n);fnew _e(f.from+n,f.to+n)),c=LP(e,h,a,O);for(let f=0,u=a;;f++){let p=f==c.length,m=p?O:c[f].from;if(m>u&&t.push(new Zt(u,m,r.tree,-o,s.from>=u||s.openStart,s.to<=m||s.openEnd)),p)break;u=c[f].to}}else t.push(new Zt(a,O,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return t}var DP=0,Le=class i{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=DP++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let n=typeof e=="string"?e:"?";if(e instanceof i&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let r=new i(n,[],null,[]);if(r.set.push(r),t)for(let s of t.set)r.set.push(s);return r}static defineModifier(e){let t=new _s(e);return n=>n.modified.indexOf(t)>-1?n:_s.get(n.base||n,n.modified.concat(t).sort((r,s)=>r.id-s.id))}},IP=0,_s=class i{constructor(e){this.name=e,this.instances=[],this.id=IP++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(l=>l.base==e&&BP(t,l.modified));if(n)return n;let r=[],s=new Le(e.name,r,e,t);for(let l of t)l.instances.push(s);let o=NP(t);for(let l of e.set)if(!l.modified.length)for(let a of o)r.push(i.get(l,a));return s}};function BP(i,e){return i.length==e.length&&i.every((t,n)=>t==e[n])}function NP(i){let e=[[]];for(let t=0;tn.length-t.length)}function le(i){let e=Object.create(null);for(let t in i){let n=i[t];Array.isArray(n)||(n=[n]);for(let r of t.split(" "))if(r){let s=[],o=2,l=r;for(let c=0;;){if(l=="..."&&c>0&&c+3==r.length){o=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!f)throw new RangeError("Invalid path: "+r);if(s.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),c+=f[0].length,c==r.length)break;let u=r[c++];if(c==r.length&&u=="!"){o=0;break}if(u!="/")throw new RangeError("Invalid path: "+r);l=r.slice(c)}let a=s.length-1,O=s[a];if(!O)throw new RangeError("Invalid path: "+r);let h=new ki(n,o,a>0?s.slice(0,a):null);e[O]=h.sort(e[O])}}return Ku.add(e)}var Ku=new q({combine(i,e){let t,n,r;for(;i||e;){if(!i||e&&i.depth>=e.depth?(r=e,e=e.next):(r=i,i=i.next),t&&t.mode==r.mode&&!r.context&&!t.context)continue;let s=new ki(r.tags,r.mode,r.context);t?t.next=s:n=s,t=s}return n}}),ki=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{let o=r;for(let l of s)for(let a of l.set){let O=t[a.id];if(O){o=o?o+" "+O:O;break}}return o},scope:n}}function FP(i,e){let t=null;for(let n of i){let r=n.style(e);r&&(t=t?t+" "+r:r)}return t}function Ju(i,e,t,n=0,r=i.length){let s=new Va(n,Array.isArray(e)?e:[e],t);s.highlightRange(i.cursor(),n,r,"",s.highlighters),s.flush(r)}var Va=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,s){let{type:o,from:l,to:a}=e;if(l>=n||a<=t)return;o.isTop&&(s=this.highlighters.filter(u=>!u.scope||u.scope(o)));let O=r,h=HP(e)||ki.empty,c=FP(s,h.tags);if(c&&(O&&(O+=" "),O+=c,h.mode==1&&(r+=(r?" ":"")+c)),this.startSpan(Math.max(t,l),O),h.opaque)return;let f=e.tree&&e.tree.prop(q.mounted);if(f&&f.overlay){let u=e.node.enter(f.overlay[0].from+l,1),p=this.highlighters.filter(g=>!g.scope||g.scope(f.tree.type)),m=e.firstChild();for(let g=0,Q=l;;g++){let S=g=$||!e.nextSibling())););if(!S||$>n)break;Q=S.to+l,Q>t&&(this.highlightRange(u.cursor(),Math.max(t,S.from+l),Math.min(n,Q),"",p),this.startSpan(Math.min(n,Q),O))}m&&e.parent()}else if(e.firstChild()){f&&(r="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,s),this.startSpan(Math.min(n,e.to),O)}while(e.nextSibling());e.parent()}}};function HP(i){let e=i.type.prop(Ku);for(;e&&e.context&&!i.matchContext(e.context);)e=e.next;return e||null}var T=Le.define,qs=T(),Jt=T(),Fu=T(Jt),Hu=T(Jt),ei=T(),zs=T(ei),Ya=T(ei),yt=T(),wi=T(yt),$t=T(),bt=T(),Aa=T(),Nn=T(Aa),Cs=T(),d={comment:qs,lineComment:T(qs),blockComment:T(qs),docComment:T(qs),name:Jt,variableName:T(Jt),typeName:Fu,tagName:T(Fu),propertyName:Hu,attributeName:T(Hu),className:T(Jt),labelName:T(Jt),namespace:T(Jt),macroName:T(Jt),literal:ei,string:zs,docString:T(zs),character:T(zs),attributeValue:T(zs),number:Ya,integer:T(Ya),float:T(Ya),bool:T(ei),regexp:T(ei),escape:T(ei),color:T(ei),url:T(ei),keyword:$t,self:T($t),null:T($t),atom:T($t),unit:T($t),modifier:T($t),operatorKeyword:T($t),controlKeyword:T($t),definitionKeyword:T($t),moduleKeyword:T($t),operator:bt,derefOperator:T(bt),arithmeticOperator:T(bt),logicOperator:T(bt),bitwiseOperator:T(bt),compareOperator:T(bt),updateOperator:T(bt),definitionOperator:T(bt),typeOperator:T(bt),controlOperator:T(bt),punctuation:Aa,separator:T(Aa),bracket:Nn,angleBracket:T(Nn),squareBracket:T(Nn),paren:T(Nn),brace:T(Nn),content:yt,heading:wi,heading1:T(wi),heading2:T(wi),heading3:T(wi),heading4:T(wi),heading5:T(wi),heading6:T(wi),contentSeparator:T(yt),list:T(yt),quote:T(yt),emphasis:T(yt),strong:T(yt),link:T(yt),monospace:T(yt),strikethrough:T(yt),inserted:T(),deleted:T(),changed:T(),invalid:T(),meta:Cs,documentMeta:T(Cs),annotation:T(Cs),processingInstruction:T(Cs),definition:Le.defineModifier("definition"),constant:Le.defineModifier("constant"),function:Le.defineModifier("function"),standard:Le.defineModifier("standard"),local:Le.defineModifier("local"),special:Le.defineModifier("special")};for(let i in d){let e=d[i];e instanceof Le&&(e.name=i)}var cT=ja([{tag:d.link,class:"tok-link"},{tag:d.heading,class:"tok-heading"},{tag:d.emphasis,class:"tok-emphasis"},{tag:d.strong,class:"tok-strong"},{tag:d.keyword,class:"tok-keyword"},{tag:d.atom,class:"tok-atom"},{tag:d.bool,class:"tok-bool"},{tag:d.url,class:"tok-url"},{tag:d.labelName,class:"tok-labelName"},{tag:d.inserted,class:"tok-inserted"},{tag:d.deleted,class:"tok-deleted"},{tag:d.literal,class:"tok-literal"},{tag:d.string,class:"tok-string"},{tag:d.number,class:"tok-number"},{tag:[d.regexp,d.escape,d.special(d.string)],class:"tok-string2"},{tag:d.variableName,class:"tok-variableName"},{tag:d.local(d.variableName),class:"tok-variableName tok-local"},{tag:d.definition(d.variableName),class:"tok-variableName tok-definition"},{tag:d.special(d.variableName),class:"tok-variableName2"},{tag:d.definition(d.propertyName),class:"tok-propertyName tok-definition"},{tag:d.typeName,class:"tok-typeName"},{tag:d.namespace,class:"tok-namespace"},{tag:d.className,class:"tok-className"},{tag:d.macroName,class:"tok-macroName"},{tag:d.propertyName,class:"tok-propertyName"},{tag:d.operator,class:"tok-operator"},{tag:d.comment,class:"tok-comment"},{tag:d.meta,class:"tok-meta"},{tag:d.invalid,class:"tok-invalid"},{tag:d.punctuation,class:"tok-punctuation"}]);var Ea,qt=new q;function ln(i){return v.define({combine:i?e=>e.concat(i):void 0})}var Es=new q,xe=class{constructor(e,t,n=[],r=""){this.data=e,this.name=r,G.prototype.hasOwnProperty("tree")||Object.defineProperty(G.prototype,"tree",{get(){return V(this)}}),this.parser=t,this.extension=[ti.of(this),G.languageData.of((s,o,l)=>{let a=ed(s,o,l),O=a.type.prop(qt);if(!O)return[];let h=s.facet(O),c=a.type.prop(Es);if(c){let f=a.resolve(o-a.from,l);for(let u of c)if(u.test(f,s)){let p=s.facet(u.facet);return u.type=="replace"?p:p.concat(h)}}return h})].concat(n)}isActiveAt(e,t,n=-1){return ed(e,t,n).type.prop(qt)==this.data}findRegions(e){let t=e.facet(ti);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(s,o)=>{if(s.prop(qt)==this.data){n.push({from:o,to:o+s.length});return}let l=s.prop(q.mounted);if(l){if(l.tree.prop(qt)==this.data){if(l.overlay)for(let a of l.overlay)n.push({from:a.from+o,to:a.to+o});else n.push({from:o,to:o+s.length});return}else if(l.overlay){let a=n.length;if(r(l.tree,l.overlay[0].from+o),n.length>a)return}}for(let a=0;an.isTop?t:void 0)]}),e.name)}configure(e,t){return new i(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function V(i){let e=i.field(xe.state,!1);return e?e.tree:Y.empty}var La=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=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},Fn=null,Xi=class i{constructor(e,t,n=[],r,s,o,l,a){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new i(e,t,[],Y.empty,0,n,[],null)}startParse(){return this.parser.startParse(new La(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Y.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=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(Zt.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Fn;Fn=this;try{return e()}finally{Fn=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=td(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((O,h,c,f)=>a.push({fromA:O,toA:h,fromB:c,toB:f})),n=Zt.applyChanges(n,a),r=Y.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let O of this.skipped){let h=e.mapPos(O.from,1),c=e.mapPos(O.to,-1);he.from&&(this.fragments=td(this.fragments,r,s),this.skipped.splice(n--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Wt{createParse(t,n,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let a=Fn;if(a){for(let O of r)a.tempSkipped.push(O);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new Y(oe.none,[],[],o-s)},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 Fn}};function td(i,e,t){return Zt.applyChanges(i,[{fromA:e,toA:t,fromB:e,toB:t}])}var Kn=class i{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new i(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=Xi.create(e.facet(ti).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new i(n)}};xe.state=se.define({create:Kn.init,update(i,e){for(let t of e.effects)if(t.is(xe.setState))return t.value;return e.startState.facet(ti)!=e.state.facet(ti)?Kn.init(e.state):i.apply(e)}});var Od=i=>{let e=setTimeout(()=>i(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Od=i=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(i,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});var Ma=typeof navigator<"u"&&(!((Ea=navigator.scheduling)===null||Ea===void 0)&&Ea.isInputPending)?()=>navigator.scheduling.isInputPending():null,KP=ie.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(xe.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(xe.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Od(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndr+1e3,a=s.context.work(()=>Ma&&Ma()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:xe.setState.of(new Kn(s.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Pe(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),ti=v.define({combine(i){return i.length?i[0]:null},enables:i=>[xe.state,KP,y.contentAttributes.compute([i],e=>{let t=e.facet(i);return t&&t.name?{"data-language":t.name}:{}})]}),Oe=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},Jn=class i{constructor(e,t,n,r,s,o=void 0){this.name=e,this.alias=t,this.extensions=n,this.filename=r,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:n}=e;if(!t){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(n)}return new i(e.name,(e.alias||[]).concat(e.name).map(r=>r.toLowerCase()),e.extensions||[],e.filename,t,n)}static matchFilename(e,t){for(let r of e)if(r.filename&&r.filename.test(t))return r;let n=/\.([^.]+)$/.exec(t);if(n){for(let r of e)if(r.extensions.indexOf(n[1])>-1)return r}return null}static matchLanguageName(e,t,n=!0){t=t.toLowerCase();for(let r of e)if(r.alias.some(s=>s==t))return r;if(n)for(let r of e)for(let s of r.alias){let o=t.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+s.length])))return r}return null}},JP=v.define(),ni=v.define({combine:i=>{if(!i.length)return" ";let e=i[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(i[0]));return e}});function ii(i){let e=i.facet(ni);return e.charCodeAt(0)==9?i.tabSize*e.length:e.length}function an(i,e){let t="",n=i.tabSize,r=i.facet(ni)[0];if(r==" "){for(;e>=n;)t+=" ",e-=n;r=" "}for(let s=0;s=e?e$(i,t,e):null}var vi=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=ii(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=n.from&&r<=n.to?s&&r==e?{text:"",from:e}:(t<0?r-1&&(s+=o-this.countColumn(n,n.search(/\S|$/))),s}countColumn(e,t=e.length){return ve(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},fe=new q;function e$(i,e,t){let n=e.resolveStack(t),r=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(r!=n.node){let s=[];for(let o=r;o&&!(o.fromn.node.to||o.from==n.node.from&&o.type==n.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)n={node:s[o],next:n}}return hd(n,i,t)}function hd(i,e,t){for(let n=i;n;n=n.next){let r=i$(n.node);if(r)return r(Da.create(e,t,n))}return 0}function t$(i){return i.pos==i.options.simulateBreak&&i.options.simulateDoubleBreak}function i$(i){let e=i.type.prop(fe);if(e)return e;let t=i.firstChild,n;if(t&&(n=t.type.prop(q.closedBy))){let r=i.lastChild,s=r&&n.indexOf(r.name)>-1;return o=>cd(o,!0,1,void 0,s&&!t$(o)?r.from:void 0)}return i.parent==null?n$:null}function n$(){return 0}var Da=class i extends vi{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(e,t,n){return new i(e,t,n)}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(r$(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return hd(this.context.next,this.base,this.pos)}};function r$(i,e){for(let t=e;t;t=t.parent)if(i==t)return!0;return!1}function s$(i){let e=i.node,t=e.childAfter(e.from),n=e.lastChild;if(!t)return null;let r=i.options.simulateBreak,s=i.state.doc.lineAt(t.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==n)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let O=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+O}}l=a.to}}function zt({closing:i,align:e=!0,units:t=1}){return n=>cd(n,e,t,i)}function cd(i,e,t,n,r){let s=i.textAfter,o=s.match(/^\s*/)[0].length,l=n&&s.slice(o,o+n.length)==n||r==i.pos+o,a=e?s$(i):null;return a?l?i.column(a.from):i.column(a.to):i.baseIndent+(l?0:i.unit*t)}var fd=i=>i.baseIndent;function nt({except:i,units:e=1}={}){return t=>{let n=i&&i.test(t.textAfter);return t.baseIndent+(n?0:e*t.unit)}}var o$=200;function ud(){return G.transactionFilter.of(i=>{if(!i.docChanged||!i.isUserEvent("input.type")&&!i.isUserEvent("input.complete"))return i;let e=i.startState.languageDataAt("indentOnInput",i.startState.selection.main.head);if(!e.length)return i;let t=i.newDoc,{head:n}=i.newSelection.main,r=t.lineAt(n);if(n>r.from+o$)return i;let s=t.sliceString(r.from,n);if(!e.some(O=>O.test(s)))return i;let{state:o}=i,l=-1,a=[];for(let{head:O}of o.selection.ranges){let h=o.doc.lineAt(O);if(h.from==l)continue;l=h.from;let c=Ms(o,h.from);if(c==null)continue;let f=/^\s*/.exec(h.text)[0],u=an(o,c);f!=u&&a.push({from:h.from,to:h.from+f.length,insert:u})}return a.length?[i,{changes:a,sequential:!0}]:i})}var Ja=v.define(),ue=new q;function rt(i){let e=i.firstChild,t=i.lastChild;return e&&e.tot)continue;if(s&&l.from=e&&O.to>t&&(s=O)}}return s}function a$(i){let e=i.lastChild;return e&&e.to==i.to&&e.type.isError}function Ys(i,e,t){for(let n of i.facet(Ja)){let r=n(i,e,t);if(r)return r}return l$(i,e,t)}function dd(i,e){let t=e.mapPos(i.from,1),n=e.mapPos(i.to,-1);return t>=n?void 0:{from:t,to:n}}var Us=z.define({map:dd}),ir=z.define({map:dd});function pd(i){let e=[];for(let{head:t}of i.state.selection.ranges)e.some(n=>n.from<=t&&n.to>=t)||e.push(i.lineBlockAt(t));return e}var Ti=se.define({create(){return Z.none},update(i,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,r)=>i=id(i,n,r)),i=i.map(e.changes);let t=[];for(let n of e.effects)n.is(Us)&&!O$(i,n.value.from,n.value.to)?t.push(n.value):n.is(ir)&&(i=i.update({filter:(r,s)=>n.value.from!=r||n.value.to!=s,filterFrom:n.value.from,filterTo:n.value.to}));if(t.length){let{preparePlaceholder:n}=e.state.facet(eO),r=t.map(s=>(n?Z.replace({widget:new Ia(n(e.state,s))}):nd).range(s.from,s.to));i=i.update({add:r})}return e.selection&&(i=id(i,e.selection.main.head)),i},provide:i=>y.decorations.from(i),toJSON(i,e){let t=[];return i.between(0,e.doc.length,(n,r)=>{t.push(n,r)}),t},fromJSON(i){if(!Array.isArray(i)||i.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{re&&(n=!0)}),n?i.update({filterFrom:e,filterTo:t,filter:(r,s)=>r>=t||s<=e}):i}function Vs(i,e,t){var n;let r=null;return(n=i.field(Ti,!1))===null||n===void 0||n.between(e,t,(s,o)=>{(!r||r.from>s)&&(r={from:s,to:o})}),r}function O$(i,e,t){let n=!1;return i.between(e,e,(r,s)=>{r==e&&s==t&&(n=!0)}),n}function md(i,e){return i.field(Ti,!1)?e:e.concat(z.appendConfig.of(Sd()))}var h$=i=>{for(let e of pd(i)){let t=Ys(i.state,e.from,e.to);if(t)return i.dispatch({effects:md(i.state,[Us.of(t),gd(i,t)])}),!0}return!1},c$=i=>{if(!i.state.field(Ti,!1))return!1;let e=[];for(let t of pd(i)){let n=Vs(i.state,t.from,t.to);n&&e.push(ir.of(n),gd(i,n,!1))}return e.length&&i.dispatch({effects:e}),e.length>0};function gd(i,e,t=!0){let n=i.state.doc.lineAt(e.from).number,r=i.state.doc.lineAt(e.to).number;return y.announce.of(`${i.state.phrase(t?"Folded lines":"Unfolded lines")} ${n} ${i.state.phrase("to")} ${r}.`)}var f$=i=>{let{state:e}=i,t=[];for(let n=0;n{let e=i.state.field(Ti,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,i.state.doc.length,(n,r)=>{t.push(ir.of({from:n,to:r}))}),i.dispatch({effects:t}),!0};var Qd=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:h$},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:c$},{key:"Ctrl-Alt-[",run:f$},{key:"Ctrl-Alt-]",run:u$}],d$={placeholderDOM:null,preparePlaceholder:null,placeholderText:"\u2026"},eO=v.define({combine(i){return ye(i,d$)}});function Sd(i){let e=[Ti,m$];return i&&e.push(eO.of(i)),e}function Pd(i,e){let{state:t}=i,n=t.facet(eO),r=o=>{let l=i.lineBlockAt(i.posAtDOM(o.target)),a=Vs(i.state,l.from,l.to);a&&i.dispatch({effects:ir.of(a)}),o.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(i,r,e);let s=document.createElement("span");return s.textContent=n.placeholderText,s.setAttribute("aria-label",t.phrase("folded code")),s.title=t.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}var nd=Z.replace({widget:new class extends Re{toDOM(i){return Pd(i,null)}}}),Ia=class extends Re{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Pd(e,this.value)}},p$={openText:"\u2304",closedText:"\u203A",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1},Hn=class extends Ge{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 $d(i={}){let e={...p$,...i},t=new Hn(e,!0),n=new Hn(e,!1),r=ie.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(ti)!=o.state.facet(ti)||o.startState.field(Ti,!1)!=o.state.field(Ti,!1)||V(o.startState)!=V(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new Ee;for(let a of o.viewportLineBlocks){let O=Vs(o.state,a.from,a.to)?n:Ys(o.state,a.from,a.to)?t:null;O&&l.add(a.from,a.from,O)}return l.finish()}}),{domEventHandlers:s}=e;return[r,wa({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(r))===null||l===void 0?void 0:l.markers)||L.empty},initialSpacer(){return new Hn(e,!1)},domEventHandlers:{...s,click:(o,l,a)=>{if(s.click&&s.click(o,l,a))return!0;let O=Vs(o.state,l.from,l.to);if(O)return o.dispatch({effects:ir.of(O)}),!0;let h=Ys(o.state,l.from,l.to);return h?(o.dispatch({effects:Us.of(h)}),!0):!1}}}),Sd()]}var m$=y.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"}}),on=class i{constructor(e,t){this.specs=e;let n;function r(l){let a=Je.newName();return(n||(n=Object.create(null)))["."+a]=l,a}let s=typeof t.all=="string"?t.all:t.all?r(t.all):void 0,o=t.scope;this.scope=o instanceof xe?l=>l.prop(qt)==o.data:o?l=>l==o:void 0,this.style=ja(e.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=n?new Je(n):null,this.themeType=t.themeType}static define(e,t){return new i(e,t||{})}},Ba=v.define(),bd=v.define({combine(i){return i.length?[i[0]]:null}});function Ua(i){let e=i.facet(Ba);return e.length?e:i.facet(bd)}function Gs(i,e){let t=[g$],n;return i instanceof on&&(i.module&&t.push(y.styleModule.of(i.module)),n=i.themeType),e?.fallback?t.push(bd.of(i)):n?t.push(Ba.computeN([y.darkTheme],r=>r.facet(y.darkTheme)==(n=="dark")?[i]:[])):t.push(Ba.of(i)),t}var Na=class{constructor(e){this.markCache=Object.create(null),this.tree=V(e.state),this.decorations=this.buildDeco(e,Ua(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=V(e.state),n=Ua(e.state),r=n!=Ua(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return Z.none;let n=new Ee;for(let{from:r,to:s}of e.visibleRanges)Ju(this.tree,t,(o,l,a)=>{n.add(o,l,this.markCache[a]||(this.markCache[a]=Z.mark({class:a})))},r,s);return n.finish()}},g$=ze.high(ie.fromClass(Na,{decorations:i=>i.decorations})),yd=on.define([{tag:d.meta,color:"#404740"},{tag:d.link,textDecoration:"underline"},{tag:d.heading,textDecoration:"underline",fontWeight:"bold"},{tag:d.emphasis,fontStyle:"italic"},{tag:d.strong,fontWeight:"bold"},{tag:d.strikethrough,textDecoration:"line-through"},{tag:d.keyword,color:"#708"},{tag:[d.atom,d.bool,d.url,d.contentSeparator,d.labelName],color:"#219"},{tag:[d.literal,d.inserted],color:"#164"},{tag:[d.string,d.deleted],color:"#a11"},{tag:[d.regexp,d.escape,d.special(d.string)],color:"#e40"},{tag:d.definition(d.variableName),color:"#00f"},{tag:d.local(d.variableName),color:"#30a"},{tag:[d.typeName,d.namespace],color:"#085"},{tag:d.className,color:"#167"},{tag:[d.special(d.variableName),d.macroName],color:"#256"},{tag:d.definition(d.propertyName),color:"#00c"},{tag:d.comment,color:"#940"},{tag:d.invalid,color:"#f00"}]),Q$=y.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),xd=1e4,wd="()[]{}",kd=v.define({combine(i){return ye(i,{afterCursor:!0,brackets:wd,maxScanDistance:xd,renderMatch:$$})}}),S$=Z.mark({class:"cm-matchingBracket"}),P$=Z.mark({class:"cm-nonmatchingBracket"});function $$(i){let e=[],t=i.matched?S$:P$;return e.push(t.range(i.start.from,i.start.to)),i.end&&e.push(t.range(i.end.from,i.end.to)),e}function rd(i){let e=[],t=i.facet(kd);for(let n of i.selection.ranges){if(!n.empty)continue;let r=ft(i,n.head,-1,t)||n.head>0&&ft(i,n.head-1,1,t)||t.afterCursor&&(ft(i,n.head,1,t)||n.headi.decorations}),y$=[b$,Q$];function Xd(i={}){return[kd.of(i),y$]}var nr=new q;function Fa(i,e,t){let n=i.prop(e<0?q.openedBy:q.closedBy);if(n)return n;if(i.name.length==1){let r=t.indexOf(i.name);if(r>-1&&r%2==(e<0?1:0))return[t[r+e]]}return null}function Ha(i){let e=i.type.prop(nr);return e?e(i.node):i}function ft(i,e,t,n={}){let r=n.maxScanDistance||xd,s=n.brackets||wd,o=V(i),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let O=Fa(a.type,t,s);if(O&&a.from0?e>=h.from&&eh.from&&e<=h.to))return x$(i,e,t,a,h,O,s)}}return w$(i,e,t,o,l.type,r,s)}function x$(i,e,t,n,r,s,o){let l=n.parent,a={from:r.from,to:r.to},O=0,h=l?.cursor();if(h&&(t<0?h.childBefore(n.from):h.childAfter(n.to)))do if(t<0?h.to<=n.from:h.from>=n.to){if(O==0&&s.indexOf(h.type.name)>-1&&h.from0)return null;let O={from:t<0?e-1:e,to:t>0?e+1:e},h=i.doc.iterRange(e,t>0?i.doc.length:0),c=0;for(let f=0;!h.next().done&&f<=s;){let u=h.value;t<0&&(f+=u.length);let p=e+f*t;for(let m=t>0?0:u.length-1,g=t>0?u.length:-1;m!=g;m+=t){let Q=o.indexOf(u[m]);if(!(Q<0||n.resolveInner(p+m,1).type!=r))if(Q%2==0==t>0)c++;else{if(c==1)return{start:O,end:{from:p+m,to:p+m+1},matched:Q>>1==a>>1};c--}}t>0&&(f+=u.length)}return h.done?{start:O,matched:!1}:null}function sd(i,e,t,n=0,r=0){e==null&&(e=i.search(/[^\s\u00a0]/),e==-1&&(e=i.length));let s=r;for(let o=n;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}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.lastColumnPosn?o.toLowerCase():o,s=this.string.substr(this.pos,e.length);return r(s)==r(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}};function k$(i){return{name:i.name||"",token:i.token,blankLine:i.blankLine||(()=>{}),startState:i.startState||(()=>!0),copyState:i.copyState||X$,indent:i.indent||(()=>null),languageData:i.languageData||{},tokenTable:i.tokenTable||iO,mergeTokens:i.mergeTokens!==!1}}function X$(i){if(typeof i!="object")return i;let e={};for(let t in i){let n=i[t];e[t]=n instanceof Array?n.slice():n}return e}var od=new WeakMap,er=class i extends xe{constructor(e){let t=ln(e.languageData),n=k$(e),r,s=new class extends Wt{createParse(o,l,a){return new Ka(r,o,l,a)}};super(t,s,[],e.name),this.topNode=Z$(t,this),r=this,this.streamParser=n,this.stateAfter=new q({perNode:!0}),this.tokenTable=e.tokenTable?new js(n.tokenTable):R$}static define(e){return new i(e)}getIndent(e){let t,{overrideIndentation:n}=e.options;n&&(t=od.get(e.state),t!=null&&t1e4)return null;for(;s=n&&t+e.length<=r&&e.prop(i.stateAfter);if(s)return{state:i.streamParser.copyState(s),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],O=l instanceof Y&&a=e.length)return e;!r&&t==0&&e.type==i.topNode&&(r=!0);for(let s=e.children.length-1;s>=0;s--){let o=e.positions[s],l=e.children[s],a;if(ot&&tO(i,s.tree,0-s.offset,t,l),O;if(a&&a.pos<=n&&(O=vd(i,s.tree,t+s.offset,a.pos+s.offset,!1)))return{state:a.state,tree:O}}return{state:i.streamParser.startState(r?ii(r):4),tree:Y.empty}}var Ka=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 s=Xi.get(),o=r[0].from,{state:l,tree:a}=v$(e,n,o,this.to,s?.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let O=0;OO.from<=s.viewport.from&&O.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(ii(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let e=Xi.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=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==` +`&&(t="");else{let n=t.indexOf(` +`);n>-1&&(t=t.slice(0,n))}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 r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=n||(t=t.slice(0,s-(n-t.length)),r++,r==this.ranges.length))break;let o=this.ranges[r].from,l=this.lineAfter(o);t+=l,n=o+l.length}return{line:t,end:n}}skipGapsTo(e,t,n){for(;;){let r=this.ranges[this.rangeIndex].to,s=e+t;if(n>0?r>s:r>=s)break;let o=this.ranges[++this.rangeIndex].from;t+=o-r}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(t,r,1),t+=r;let l=this.chunk.length;r=this.skipGapsTo(n,r,-1),n+=r,s+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=n:this.chunk.push(e,t,n,s),r}parseLine(e){let{line:t,end:n}=this.nextLine(),r=0,{streamParser:s}=this.lang,o=new As(t,e?e.state.tabSize:4,e?ii(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=Td(s.token,o,this.state);if(l&&(r=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,r)),o.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPose.start)return r}throw new Error("Stream parser failed to advance stream.")}var iO=Object.create(null),tr=[oe.none],T$=new Rt(tr),ld=[],ad=Object.create(null),Rd=Object.create(null);for(let[i,e]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"]])Rd[i]=Zd(iO,e);var js=class{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Rd)}resolve(e){return e?this.table[e]||(this.table[e]=Zd(this.extra,e)):0}},R$=new js(iO);function Ga(i,e){ld.indexOf(i)>-1||(ld.push(i),console.warn(e))}function Zd(i,e){let t=[];for(let l of e.split(" ")){let a=[];for(let O of l.split(".")){let h=i[O]||d[O];h?typeof h=="function"?a.length?a=a.map(h):Ga(O,`Modifier ${O} used at start of tag`):a.length?Ga(O,`Tag ${O} used as modifier`):a=Array.isArray(h)?h:[h]:Ga(O,`Unknown highlighting tag ${O}`)}for(let O of a)t.push(O)}if(!t.length)return 0;let n=e.replace(/ /g,"_"),r=n+" "+t.map(l=>l.id),s=ad[r];if(s)return s.id;let o=ad[r]=oe.define({id:tr.length,name:n,props:[le({[n]:t})]});return tr.push(o),o.id}function Z$(i,e){let t=oe.define({id:tr.length,name:"Document",props:[qt.add(()=>i),fe.add(()=>n=>e.getIndent(n))],top:!0});return tr.push(t),t}var ST={rtl:Z.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:N.RTL}),ltr:Z.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:N.LTR}),auto:Z.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var W$=i=>{let{state:e}=i,t=e.doc.lineAt(e.selection.main.from),n=OO(i.state,t.from);return n.line?q$(i):n.block?C$(i):!1};function aO(i,e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=i(e,t);return r?(n(t.update(r)),!0):!1}}var q$=aO(V$,0);var z$=aO(jd,0);var C$=aO((i,e)=>jd(i,e,Y$(e)),0);function OO(i,e){let t=i.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}var rr=50;function _$(i,{open:e,close:t},n,r){let s=i.sliceDoc(n-rr,n),o=i.sliceDoc(r,r+rr),l=/\s*$/.exec(s)[0].length,a=/^\s*/.exec(o)[0].length,O=s.length-l;if(s.slice(O-e.length,O)==e&&o.slice(a,a+t.length)==t)return{open:{pos:n-l,margin:l&&1},close:{pos:r+a,margin:a&&1}};let h,c;r-n<=2*rr?h=c=i.sliceDoc(n,r):(h=i.sliceDoc(n,n+rr),c=i.sliceDoc(r-rr,r));let f=/^\s*/.exec(h)[0].length,u=/\s*$/.exec(c)[0].length,p=c.length-u-t.length;return h.slice(f,f+e.length)==e&&c.slice(p,p+t.length)==t?{open:{pos:n+f+e.length,margin:/\s/.test(h.charAt(f+e.length))?1:0},close:{pos:r-u-t.length,margin:/\s/.test(c.charAt(p-1))?1:0}}:null}function Y$(i){let e=[];for(let t of i.selection.ranges){let n=i.doc.lineAt(t.from),r=t.to<=n.to?n:i.doc.lineAt(t.to);r.from>n.from&&r.from==t.to&&(r=t.to==n.to+1?n:i.doc.lineAt(t.to-1));let s=e.length-1;s>=0&&e[s].to>n.from?e[s].to=r.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:r.to})}return e}function jd(i,e,t=e.selection.ranges){let n=t.map(s=>OO(e,s.from).block);if(!n.every(s=>s))return null;let r=t.map((s,o)=>_$(e,n[o],s.from,s.to));if(i!=2&&!r.every(s=>s))return{changes:e.changes(t.map((s,o)=>r[o]?[]:[{from:s.from,insert:n[o].open+" "},{from:s.to,insert:" "+n[o].close}]))};if(i!=1&&r.some(s=>s)){let s=[];for(let o=0,l;or&&(s==o||o>c.from)){r=c.from;let f=/^\s*/.exec(c.text)[0].length,u=f==c.length,p=c.text.slice(f,f+O.length)==O?f:-1;fs.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:a,indent:O,empty:h,single:c}of n)(c||!h)&&s.push({from:l.from+O,insert:a+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(i!=1&&n.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:a}of n)if(l>=0){let O=o.from+l,h=O+a.length;o.text[h-o.from]==" "&&h++,s.push({from:O,to:h})}return{changes:s}}return null}var rO=qe.define(),A$=qe.define(),j$=v.define(),Ed=v.define({combine(i){return ye(i,{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)})}}),Md=se.define({create(){return Ri.empty},update(i,e){let t=e.state.facet(Ed),n=e.annotation(rO);if(n){let a=ut.fromTransaction(e,n.selection),O=n.side,h=O==0?i.undone:i.done;return a?h=Ds(h,h.length,t.minDepth,a):h=Dd(h,e.startState.selection),new Ri(O==0?n.rest:h,O==0?h:n.rest)}let r=e.annotation(A$);if((r=="full"||r=="before")&&(i=i.isolate()),e.annotation(he.addToHistory)===!1)return e.changes.empty?i:i.addMapping(e.changes.desc);let s=ut.fromTransaction(e),o=e.annotation(he.time),l=e.annotation(he.userEvent);return s?i=i.addChanges(s,o,l,t,e):e.selection&&(i=i.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(r=="full"||r=="after")&&(i=i.isolate()),i},toJSON(i){return{done:i.done.map(e=>e.toJSON()),undone:i.undone.map(e=>e.toJSON())}},fromJSON(i){return new Ri(i.done.map(ut.fromJSON),i.undone.map(ut.fromJSON))}});function Ud(i={}){return[Md,Ed.of(i),y.domEventHandlers({beforeinput(e,t){let n=e.inputType=="historyUndo"?Gd:e.inputType=="historyRedo"?sO:null;return n?(e.preventDefault(),n(t)):!1}})]}function Is(i,e){return function({state:t,dispatch:n}){if(!e&&t.readOnly)return!1;let r=t.field(Md,!1);if(!r)return!1;let s=r.pop(i,t,e);return s?(n(s),!0):!1}}var Gd=Is(0,!1),sO=Is(1,!1),E$=Is(0,!0),M$=Is(1,!0);var ut=class i{constructor(e,t,n,r,s){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new i(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new i(e.changes&&Xe.fromJSON(e.changes),[],e.mapped&&wt.fromJSON(e.mapped),e.startSelection&&P.fromJSON(e.startSelection),e.selectionsAfter.map(P.fromJSON))}static fromTransaction(e,t){let n=st;for(let r of e.startState.facet(j$)){let s=r(e);s.length&&(n=n.concat(s))}return!n.length&&e.changes.empty?null:new i(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,st)}static selection(e){return new i(void 0,st,void 0,void 0,e)}};function Ds(i,e,t,n){let r=e+1>t+20?e-t-1:0,s=i.slice(r,e);return s.push(n),s}function U$(i,e){let t=[],n=!1;return i.iterChangedRanges((r,s)=>t.push(r,s)),e.iterChangedRanges((r,s,o,l)=>{for(let a=0;a=O&&o<=h&&(n=!0)}}),n}function G$(i,e){return i.ranges.length==e.ranges.length&&i.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length===0}function Ld(i,e){return i.length?e.length?i.concat(e):i:e}var st=[],L$=200;function Dd(i,e){if(i.length){let t=i[i.length-1],n=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-L$));return n.length&&n[n.length-1].eq(e)?i:(n.push(e),Ds(i,i.length-1,1e9,t.setSelAfter(n)))}else return[ut.selection([e])]}function D$(i){let e=i[i.length-1],t=i.slice();return t[i.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function nO(i,e){if(!i.length)return i;let t=i.length,n=st;for(;t;){let r=I$(i[t-1],e,n);if(r.changes&&!r.changes.empty||r.effects.length){let s=i.slice(0,t);return s[t-1]=r,s}else e=r.mapped,t--,n=r.selectionsAfter}return n.length?[ut.selection(n)]:st}function I$(i,e,t){let n=Ld(i.selectionsAfter.length?i.selectionsAfter.map(l=>l.map(e)):st,t);if(!i.changes)return ut.selection(n);let r=i.changes.map(e),s=e.mapDesc(i.changes,!0),o=i.mapped?i.mapped.composeDesc(s):s;return new ut(r,z.mapEffects(i.effects,e),o,i.startSelection.map(s),n)}var B$=/^(input\.type|delete)($|\.)/,Ri=class i{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 i(this.done,this.undone):this}addChanges(e,t,n,r,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!n||B$.test(n))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?i.moveByChar(t,e):Bs(t,e))}function we(i){return i.textDirectionAt(i.state.selection.main.head)==N.LTR}var Nd=i=>Bd(i,!we(i)),Fd=i=>Bd(i,we(i));function Hd(i,e){return pt(i,t=>t.empty?i.moveByGroup(t,e):Bs(t,e))}var N$=i=>Hd(i,!we(i)),F$=i=>Hd(i,we(i));var RT=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function H$(i,e,t){if(e.type.prop(t))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(i.sliceDoc(e.from,e.to)))||e.firstChild}function Ns(i,e,t){let n=V(i).resolveInner(e.head),r=t?q.closedBy:q.openedBy;for(let a=e.head;;){let O=t?n.childAfter(a):n.childBefore(a);if(!O)break;H$(i,O,r)?n=O:a=t?O.to:O.from}let s=n.type.prop(r),o,l;return s&&(o=t?ft(i,n.from,1):ft(i,n.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?n.to:n.from,P.cursor(l,t?-1:1)}var K$=i=>pt(i,e=>Ns(i.state,e,!we(i))),J$=i=>pt(i,e=>Ns(i.state,e,we(i)));function Kd(i,e){return pt(i,t=>{if(!t.empty)return Bs(t,e);let n=i.moveVertically(t,e);return n.head!=t.head?n:i.moveToLineBoundary(t,e)})}var Jd=i=>Kd(i,!1),ep=i=>Kd(i,!0);function tp(i){let e=i.scrollDOM.clientHeighto.empty?i.moveVertically(o,e,t.height):Bs(o,e));if(r.eq(n.selection))return!1;let s;if(t.selfScroll){let o=i.coordsAtPos(n.selection.main.head),l=i.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,O=l.bottom-t.marginBottom;o&&o.top>a&&o.bottomip(i,!1),oO=i=>ip(i,!0);function ri(i,e,t){let n=i.lineBlockAt(e.head),r=i.moveToLineBoundary(e,t);if(r.head==e.head&&r.head!=(t?n.to:n.from)&&(r=i.moveToLineBoundary(e,t,!1)),!t&&r.head==n.from&&n.length){let s=/^\s*/.exec(i.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;s&&e.head!=n.from+s&&(r=P.cursor(n.from+s))}return r}var e1=i=>pt(i,e=>ri(i,e,!0)),t1=i=>pt(i,e=>ri(i,e,!1)),i1=i=>pt(i,e=>ri(i,e,!we(i))),n1=i=>pt(i,e=>ri(i,e,we(i))),r1=i=>pt(i,e=>P.cursor(i.lineBlockAt(e.head).from,1)),s1=i=>pt(i,e=>P.cursor(i.lineBlockAt(e.head).to,-1));function o1(i,e,t){let n=!1,r=On(i.selection,s=>{let o=ft(i,s.head,-1)||ft(i,s.head,1)||s.head>0&&ft(i,s.head-1,1)||s.heado1(i,e,!1);function ot(i,e,t){let n=On(i.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=e&&(r=P.range(r.head,r.anchor));let s=t(r);return P.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return n.eq(i.state.selection)?!1:(i.dispatch(dt(i.state,n)),!0)}function np(i,e){return ot(i,e,t=>i.moveByChar(t,e))}var rp=i=>np(i,!we(i)),sp=i=>np(i,we(i));function op(i,e){return ot(i,e,t=>i.moveByGroup(t,e))}var a1=i=>op(i,!we(i)),O1=i=>op(i,we(i));var h1=i=>{let e=!we(i);return ot(i,e,t=>Ns(i.state,t,e))},c1=i=>{let e=we(i);return ot(i,e,t=>Ns(i.state,t,e))};function lp(i,e){return ot(i,e,t=>i.moveVertically(t,e))}var ap=i=>lp(i,!1),Op=i=>lp(i,!0);function hp(i,e){return ot(i,e,t=>i.moveVertically(t,e,tp(i).height))}var qd=i=>hp(i,!1),zd=i=>hp(i,!0),f1=i=>ot(i,!0,e=>ri(i,e,!0)),u1=i=>ot(i,!1,e=>ri(i,e,!1)),d1=i=>{let e=!we(i);return ot(i,e,t=>ri(i,t,e))},p1=i=>{let e=we(i);return ot(i,e,t=>ri(i,t,e))},m1=i=>ot(i,!1,e=>P.cursor(i.lineBlockAt(e.head).from)),g1=i=>ot(i,!0,e=>P.cursor(i.lineBlockAt(e.head).to)),Cd=({state:i,dispatch:e})=>(e(dt(i,{anchor:0})),!0),_d=({state:i,dispatch:e})=>(e(dt(i,{anchor:i.doc.length})),!0),Yd=({state:i,dispatch:e})=>(e(dt(i,{anchor:i.selection.main.anchor,head:0})),!0),Vd=({state:i,dispatch:e})=>(e(dt(i,{anchor:i.selection.main.anchor,head:i.doc.length})),!0),Q1=({state:i,dispatch:e})=>(e(i.update({selection:{anchor:0,head:i.doc.length},userEvent:"select"})),!0),S1=({state:i,dispatch:e})=>{let t=Fs(i).map(({from:n,to:r})=>P.range(n,Math.min(r+1,i.doc.length)));return e(i.update({selection:P.create(t),userEvent:"select"})),!0},P1=({state:i,dispatch:e})=>{let t=On(i.selection,n=>{let r=V(i),s=r.resolveStack(n.from,1);if(n.empty){let o=r.resolveStack(n.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:l}=o;if((l.from=n.to||l.to>n.to&&l.from<=n.from)&&o.next)return P.range(l.to,l.from)}return n});return t.eq(i.selection)?!1:(e(dt(i,t)),!0)};function cp(i,e){let{state:t}=i,n=t.selection,r=t.selection.ranges.slice();for(let s of t.selection.ranges){let o=t.doc.lineAt(s.head);if(e?o.to0)for(let l=s;;){let a=i.moveVertically(l,e);if(a.heado.to){r.some(O=>O.head==a.head)||r.push(a);break}else{if(a.head==l.head)break;l=a}}}return r.length==n.ranges.length?!1:(i.dispatch(dt(t,P.create(r,r.length-1))),!0)}var $1=i=>cp(i,!1),b1=i=>cp(i,!0),y1=({state:i,dispatch:e})=>{let t=i.selection,n=null;return t.ranges.length>1?n=P.create([t.main]):t.main.empty||(n=P.create([P.cursor(t.main.head)])),n?(e(dt(i,n)),!0):!1};function sr(i,e){if(i.state.readOnly)return!1;let t="delete.selection",{state:n}=i,r=n.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let a=e(s);ao&&(t="delete.forward",a=Ls(i,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=Ls(i,o,!1),l=Ls(i,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:P.cursor(o,or(i)))n.between(e,e,(r,s)=>{re&&(e=t?s:r)});return e}var fp=(i,e,t)=>sr(i,n=>{let r=n.from,{state:s}=i,o=s.doc.lineAt(r),l,a;if(t&&!e&&r>o.from&&rfp(i,!1,!0);var up=i=>fp(i,!0,!1),dp=(i,e)=>sr(i,t=>{let n=t.head,{state:r}=i,s=r.doc.lineAt(n),o=r.charCategorizer(n);for(let l=null;;){if(n==(e?s.to:s.from)){n==t.head&&s.number!=(e?r.doc.lines:1)&&(n+=e?1:-1);break}let a=ae(s.text,n-s.from,e)+s.from,O=s.text.slice(Math.min(n,a)-s.from,Math.max(n,a)-s.from),h=o(O);if(l!=null&&h!=l)break;(O!=" "||n!=t.head)&&(l=h),n=a}return n}),pp=i=>dp(i,!1),x1=i=>dp(i,!0);var w1=i=>sr(i,e=>{let t=i.lineBlockAt(e.head).to;return e.headsr(i,e=>{let t=i.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),X1=i=>sr(i,e=>{let t=i.moveToLineBoundary(e,!0).head;return e.head{if(i.readOnly)return!1;let t=i.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:j.of(["",""])},range:P.cursor(n.from)}));return e(i.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},T1=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=i.changeByRange(n=>{if(!n.empty||n.from==0||n.from==i.doc.length)return{range:n};let r=n.from,s=i.doc.lineAt(r),o=r==s.from?r-1:ae(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:ae(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:i.doc.slice(r,l).append(i.doc.slice(o,r))},range:P.cursor(l)}});return t.changes.empty?!1:(e(i.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Fs(i){let e=[],t=-1;for(let n of i.selection.ranges){let r=i.doc.lineAt(n.from),s=i.doc.lineAt(n.to);if(!n.empty&&n.to==s.from&&(s=i.doc.lineAt(n.to-1)),t>=r.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(n)}else e.push({from:r.from,to:s.to,ranges:[n]});t=s.number+1}return e}function mp(i,e,t){if(i.readOnly)return!1;let n=[],r=[];for(let s of Fs(i)){if(t?s.to==i.doc.length:s.from==0)continue;let o=i.doc.lineAt(t?s.to+1:s.from-1),l=o.length+1;if(t){n.push({from:s.to,to:o.to},{from:s.from,insert:o.text+i.lineBreak});for(let a of s.ranges)r.push(P.range(Math.min(i.doc.length,a.anchor+l),Math.min(i.doc.length,a.head+l)))}else{n.push({from:o.from,to:s.from},{from:s.to,insert:i.lineBreak+o.text});for(let a of s.ranges)r.push(P.range(a.anchor-l,a.head-l))}}return n.length?(e(i.update({changes:n,scrollIntoView:!0,selection:P.create(r,i.selection.mainIndex),userEvent:"move.line"})),!0):!1}var R1=({state:i,dispatch:e})=>mp(i,e,!1),Z1=({state:i,dispatch:e})=>mp(i,e,!0);function gp(i,e,t){if(i.readOnly)return!1;let n=[];for(let s of Fs(i))t?n.push({from:s.from,insert:i.doc.slice(s.from,s.to)+i.lineBreak}):n.push({from:s.to,insert:i.lineBreak+i.doc.slice(s.from,s.to)});let r=i.changes(n);return e(i.update({changes:r,selection:i.selection.map(r,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}var W1=({state:i,dispatch:e})=>gp(i,e,!1),q1=({state:i,dispatch:e})=>gp(i,e,!0),z1=i=>{if(i.state.readOnly)return!1;let{state:e}=i,t=e.changes(Fs(e).map(({from:r,to:s})=>(r>0?r--:s{let s;if(i.lineWrapping){let o=i.lineBlockAt(r.head),l=i.coordsAtPos(r.head,r.assoc||1);l&&(s=o.bottom+i.documentTop-l.bottom+i.defaultLineHeight/2)}return i.moveVertically(r,!0,s)}).map(t);return i.dispatch({changes:t,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function C1(i,e){if(/\(\)|\[\]|\{\}/.test(i.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=V(i).resolveInner(e),n=t.childBefore(e),r=t.childAfter(e),s;return n&&r&&n.to<=e&&r.from>=e&&(s=n.type.prop(q.closedBy))&&s.indexOf(r.name)>-1&&i.doc.lineAt(n.to).from==i.doc.lineAt(r.from).from&&!/\S/.test(i.sliceDoc(n.to,r.from))?{from:n.to,to:r.from}:null}var Ad=Qp(!1),_1=Qp(!0);function Qp(i){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{let{from:s,to:o}=r,l=e.doc.lineAt(s),a=!i&&s==o&&C1(e,s);i&&(s=o=(o<=l.to?l:e.doc.lineAt(o)).to);let O=new vi(e,{simulateBreak:s,simulateDoubleBreak:!!a}),h=Ms(O,s);for(h==null&&(h=ve(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));ol.from&&s{let r=[];for(let o=n.from;o<=n.to;){let l=i.doc.lineAt(o);l.number>t&&(n.empty||n.to>l.from)&&(e(l,r,n),t=l.number),o=l.to+1}let s=i.changes(r);return{changes:r,range:P.range(s.mapPos(n.anchor,1),s.mapPos(n.head,1))}})}var Y1=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=Object.create(null),n=new vi(i,{overrideIndentation:s=>{let o=t[s];return o??-1}}),r=hO(i,(s,o,l)=>{let a=Ms(n,s.from);if(a==null)return;/\S/.test(s.text)||(a=0);let O=/^\s*/.exec(s.text)[0],h=an(i,a);(O!=h||l.fromi.readOnly?!1:(e(i.update(hO(i,(t,n)=>{n.push({from:t.from,insert:i.facet(ni)})}),{userEvent:"input.indent"})),!0),A1=({state:i,dispatch:e})=>i.readOnly?!1:(e(i.update(hO(i,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let s=ve(r,i.tabSize),o=0,l=an(i,Math.max(0,s-ii(i)));for(;o(i.setTabFocusMode(),!0);var E1=[{key:"Ctrl-b",run:Nd,shift:rp,preventDefault:!0},{key:"Ctrl-f",run:Fd,shift:sp},{key:"Ctrl-p",run:Jd,shift:ap},{key:"Ctrl-n",run:ep,shift:Op},{key:"Ctrl-a",run:r1,shift:m1},{key:"Ctrl-e",run:s1,shift:g1},{key:"Ctrl-d",run:up},{key:"Ctrl-h",run:lO},{key:"Ctrl-k",run:w1},{key:"Ctrl-Alt-h",run:pp},{key:"Ctrl-o",run:v1},{key:"Ctrl-t",run:T1},{key:"Ctrl-v",run:oO}],M1=[{key:"ArrowLeft",run:Nd,shift:rp,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:N$,shift:a1,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:i1,shift:d1,preventDefault:!0},{key:"ArrowRight",run:Fd,shift:sp,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:F$,shift:O1,preventDefault:!0},{mac:"Cmd-ArrowRight",run:n1,shift:p1,preventDefault:!0},{key:"ArrowUp",run:Jd,shift:ap,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Cd,shift:Yd},{mac:"Ctrl-ArrowUp",run:Wd,shift:qd},{key:"ArrowDown",run:ep,shift:Op,preventDefault:!0},{mac:"Cmd-ArrowDown",run:_d,shift:Vd},{mac:"Ctrl-ArrowDown",run:oO,shift:zd},{key:"PageUp",run:Wd,shift:qd},{key:"PageDown",run:oO,shift:zd},{key:"Home",run:t1,shift:u1,preventDefault:!0},{key:"Mod-Home",run:Cd,shift:Yd},{key:"End",run:e1,shift:f1,preventDefault:!0},{key:"Mod-End",run:_d,shift:Vd},{key:"Enter",run:Ad,shift:Ad},{key:"Mod-a",run:Q1},{key:"Backspace",run:lO,shift:lO,preventDefault:!0},{key:"Delete",run:up,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:pp,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:x1,preventDefault:!0},{mac:"Mod-Backspace",run:k1,preventDefault:!0},{mac:"Mod-Delete",run:X1,preventDefault:!0}].concat(E1.map(i=>({mac:i.key,run:i.run,shift:i.shift}))),Sp=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:K$,shift:h1},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:J$,shift:c1},{key:"Alt-ArrowUp",run:R1},{key:"Shift-Alt-ArrowUp",run:W1},{key:"Alt-ArrowDown",run:Z1},{key:"Shift-Alt-ArrowDown",run:q1},{key:"Mod-Alt-ArrowUp",run:$1},{key:"Mod-Alt-ArrowDown",run:b1},{key:"Escape",run:y1},{key:"Mod-Enter",run:_1},{key:"Alt-l",mac:"Ctrl-l",run:S1},{key:"Mod-i",run:P1,preventDefault:!0},{key:"Mod-[",run:A1},{key:"Mod-]",run:V1},{key:"Mod-Alt-\\",run:Y1},{key:"Shift-Mod-k",run:z1},{key:"Shift-Mod-\\",run:l1},{key:"Mod-/",run:W$},{key:"Alt-A",run:z$},{key:"Ctrl-m",mac:"Shift-Alt-m",run:j1}].concat(M1);var Pp=typeof String.prototype.normalize=="function"?i=>i.normalize("NFKD"):i=>i,oi=class{constructor(e,t,n=0,r=e.length,s,o){this.test=o,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=s?l=>s(Pp(l)):Pp,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 Se(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=Xn(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Me(e);let r=this.normalize(t);if(r.length)for(let s=0,o=n,l=!0;;s++){let a=r.charCodeAt(s),O=this.match(a,o,l,this.bufferPos+this.bufferStart,s==r.length-1);if(O)return this.value=O,this;if(s==r.length-1)break;l&&sthis.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=io(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.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=n||r.to<=t){let l=new i(t,e.sliceString(t,n));return cO.set(e,l),l}if(r.from==t&&r.to==n)return r;let{text:s,from:o}=r;return o>t&&(s=e.sliceString(t,o)+s,o=t),r.to=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 n=this.flat.from+t.index,r=n+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this.matchPos=io(this.text,r+(n==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=eo.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<"u"&&(Js.prototype[Symbol.iterator]=to.prototype[Symbol.iterator]=function(){return this});function U1(i){try{return new RegExp(i,mO),!0}catch{return!1}}function io(i,e){if(e>=i.length)return e;let t=i.lineAt(e),n;for(;e=56320&&n<57344;)e++;return e}var G1=i=>{let{state:e}=i,t=String(e.doc.lineAt(i.state.selection.main.head).number),{close:n,result:r}=_u(i,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:t},focus:!0,submitLabel:e.phrase("go")});return r.then(s=>{let o=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!o){i.dispatch({effects:n});return}let l=e.doc.lineAt(e.selection.main.head),[,a,O,h,c]=o,f=h?+h.slice(1):0,u=O?+O:l.number;if(O&&c){let g=u/100;a&&(g=g*(a=="-"?-1:1)+l.number/e.doc.lines),u=Math.round(e.doc.lines*g)}else O&&a&&(u=u*(a=="-"?-1:1)+l.number);let p=e.doc.line(Math.max(1,Math.min(e.doc.lines,u))),m=P.cursor(p.from+Math.max(0,Math.min(f,p.length)));i.dispatch({effects:[n,y.scrollIntoView(m.from,{y:"center"})],selection:m})}),!0},L1={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},xp=v.define({combine(i){return ye(i,L1,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function wp(i){let e=[F1,N1];return i&&e.push(xp.of(i)),e}var D1=Z.mark({class:"cm-selectionMatch"}),I1=Z.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function $p(i,e,t,n){return(t==0||i(e.sliceDoc(t-1,t))!=H.Word)&&(n==e.doc.length||i(e.sliceDoc(n,n+1))!=H.Word)}function B1(i,e,t,n){return i(e.sliceDoc(t,t+1))==H.Word&&i(e.sliceDoc(n-1,n))==H.Word}var N1=ie.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.selectionSet||i.docChanged||i.viewportChanged)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=i.state.facet(xp),{state:t}=i,n=t.selection;if(n.ranges.length>1)return Z.none;let r=n.main,s,o=null;if(r.empty){if(!e.highlightWordAroundCursor)return Z.none;let a=t.wordAt(r.head);if(!a)return Z.none;o=t.charCategorizer(r.head),s=t.sliceDoc(a.from,a.to)}else{let a=r.to-r.from;if(a200)return Z.none;if(e.wholeWords){if(s=t.sliceDoc(r.from,r.to),o=t.charCategorizer(r.head),!($p(o,t,r.from,r.to)&&B1(o,t,r.from,r.to)))return Z.none}else if(s=t.sliceDoc(r.from,r.to),!s)return Z.none}let l=[];for(let a of i.visibleRanges){let O=new oi(t.doc,s,a.from,a.to);for(;!O.next().done;){let{from:h,to:c}=O.value;if((!o||$p(o,t,h,c))&&(r.empty&&h<=r.from&&c>=r.to?l.push(I1.range(h,c)):(h>=r.to||c<=r.from)&&l.push(D1.range(h,c)),l.length>e.maxMatches))return Z.none}}return Z.set(l)}},{decorations:i=>i.decorations}),F1=y.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),H1=({state:i,dispatch:e})=>{let{selection:t}=i,n=P.create(t.ranges.map(r=>i.wordAt(r.head)||P.cursor(r.head)),t.mainIndex);return n.eq(t)?!1:(e(i.update({selection:n})),!0)};function K1(i,e){let{main:t,ranges:n}=i.selection,r=i.wordAt(t.head),s=r&&r.from==t.from&&r.to==t.to;for(let o=!1,l=new oi(i.doc,e,n[n.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new oi(i.doc,e,0,Math.max(0,n[n.length-1].from-1)),o=!0}else{if(o&&n.some(a=>a.from==l.value.from))continue;if(s){let a=i.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}var J1=({state:i,dispatch:e})=>{let{ranges:t}=i.selection;if(t.some(s=>s.from===s.to))return H1({state:i,dispatch:e});let n=i.sliceDoc(t[0].from,t[0].to);if(i.selection.ranges.some(s=>i.sliceDoc(s.from,s.to)!=n))return!1;let r=K1(i,n);return r?(e(i.update({selection:i.selection.addRange(P.range(r.from,r.to),!1),effects:y.scrollIntoView(r.to)})),!0):!1},fn=v.define({combine(i){return ye(i,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new pO(e),scrollToMatch:e=>y.scrollIntoView(e)})}});var no=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||U1(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,(t,n)=>n=="n"?` +`:n=="r"?"\r":n=="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 uO(this):new fO(this)}getCursor(e,t=0,n){let r=e.doc?e:G.create({doc:e});return n==null&&(n=r.doc.length),this.regexp?cn(this,r,t,n):hn(this,r,t,n)}},ro=class{constructor(e){this.spec=e}};function eb(i,e,t){return(n,r,s,o)=>{if(t&&!t(n,r,s,o))return!1;let l=n>=o&&r<=o+s.length?s.slice(n-o,r-o):e.doc.sliceString(n,r);return i(l,e,n,r)}}function hn(i,e,t,n){let r;return i.wholeWord&&(r=tb(e.doc,e.charCategorizer(e.selection.main.head))),i.test&&(r=eb(i.test,e,r)),new oi(e.doc,i.unquoted,t,n,i.caseSensitive?void 0:s=>s.toLowerCase(),r)}function tb(i,e){return(t,n,r,s)=>((s>t||s+r.length=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let s=hn(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}};function ib(i,e,t){return(n,r,s)=>(!t||t(n,r,s))&&i(s[0],e,n,r)}function cn(i,e,t,n){let r;return i.wholeWord&&(r=nb(e.charCategorizer(e.selection.main.head))),i.test&&(r=ib(i.test,e,r)),new Js(e.doc,i.search,{ignoreCase:!i.caseSensitive,test:r},t,n)}function so(i,e){return i.slice(ae(i,e,!1),e)}function oo(i,e){return i.slice(e,ae(i,e))}function nb(i){return(e,t,n)=>!n[0].length||(i(so(n.input,n.index))!=H.Word||i(oo(n.input,n.index))!=H.Word)&&(i(oo(n.input,n.index+n[0].length))!=H.Word||i(so(n.input,n.index+n[0].length))!=H.Word)}var uO=class extends ro{nextMatch(e,t,n){let r=cn(this.spec,e,n,e.doc.length).next();return r.done&&(r=cn(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let s=Math.max(t,n-r*1e4),o=cn(this.spec,e,s,n),l=null;for(;!o.next().done;)l=o.value;if(l&&(s==t||l.from>s+10))return l;if(s==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 r=n.length;r>0;r--){let s=+n.slice(0,r);if(s>0&&s=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let s=cn(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}},lr=z.define(),gO=z.define(),si=se.define({create(i){return new or(dO(i).create(),null)},update(i,e){for(let t of e.effects)t.is(lr)?i=new or(t.value.create(),i.panel):t.is(gO)&&(i=new or(i.query,t.value?QO:null));return i},provide:i=>yi.from(i,e=>e.panel)});var or=class{constructor(e,t){this.query=e,this.panel=t}},rb=Z.mark({class:"cm-searchMatch"}),sb=Z.mark({class:"cm-searchMatch cm-searchMatch-selected"}),ob=ie.fromClass(class{constructor(i){this.view=i,this.decorations=this.highlight(i.state.field(si))}update(i){let e=i.state.field(si);(e!=i.startState.field(si)||i.docChanged||i.selectionSet||i.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:i,panel:e}){if(!e||!i.spec.valid)return Z.none;let{view:t}=this,n=new Ee;for(let r=0,s=t.visibleRanges,o=s.length;rs[r+1].from-500;)a=s[++r].to;i.highlight(t.state,l,a,(O,h)=>{let c=t.state.selection.ranges.some(f=>f.from==O&&f.to==h);n.add(O,h,c?sb:rb)})}return n.finish()}},{decorations:i=>i.decorations});function ar(i){return e=>{let t=e.state.field(si,!1);return t&&t.query.spec.valid?i(e,t):vp(e)}}var lo=ar((i,{query:e})=>{let{to:t}=i.state.selection.main,n=e.nextMatch(i.state,t,t);if(!n)return!1;let r=P.single(n.from,n.to),s=i.state.facet(fn);return i.dispatch({selection:r,effects:[SO(i,n),s.scrollToMatch(r.main,i)],userEvent:"select.search"}),Xp(i),!0}),ao=ar((i,{query:e})=>{let{state:t}=i,{from:n}=t.selection.main,r=e.prevMatch(t,n,n);if(!r)return!1;let s=P.single(r.from,r.to),o=i.state.facet(fn);return i.dispatch({selection:s,effects:[SO(i,r),o.scrollToMatch(s.main,i)],userEvent:"select.search"}),Xp(i),!0}),lb=ar((i,{query:e})=>{let t=e.matchAll(i.state,1e3);return!t||!t.length?!1:(i.dispatch({selection:P.create(t.map(n=>P.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),ab=({state:i,dispatch:e})=>{let t=i.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:n,to:r}=t.main,s=[],o=0;for(let l=new oi(i.doc,i.sliceDoc(n,r));!l.next().done;){if(s.length>1e3)return!1;l.value.from==n&&(o=s.length),s.push(P.range(l.value.from,l.value.to))}return e(i.update({selection:P.create(s,o),userEvent:"select.search.matches"})),!0},bp=ar((i,{query:e})=>{let{state:t}=i,{from:n,to:r}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,n,n);if(!s)return!1;let o=s,l=[],a,O,h=[];o.precise?o.from==n&&o.to==r&&(O=t.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:O}),o=e.nextMatch(t,o.from,o.to),h.push(y.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(n).number)+"."))):o=e.nextMatch(t,o.from,o.to);let c=i.state.changes(l);return o&&(a=P.single(o.from,o.to).map(c),h.push(SO(i,o)),h.push(t.facet(fn).scrollToMatch(a.main,i))),i.dispatch({changes:c,selection:a,effects:h,userEvent:"input.replace"}),!0}),Ob=ar((i,{query:e})=>{if(i.state.readOnly)return!1;let t=[];for(let r of e.matchAll(i.state,1e9)){let{from:s,to:o,precise:l}=r;l&&t.push({from:s,to:o,insert:e.getReplacement(r)})}if(!t.length)return!1;let n=i.state.phrase("replaced $ matches",t.length)+".";return i.dispatch({changes:t,effects:y.announce.of(n),userEvent:"input.replace.all"}),!0});function QO(i){return i.state.facet(fn).createPanel(i)}function dO(i,e){var t,n,r,s,o;let l=i.selection.main,a=l.empty||l.to>l.from+100?"":i.sliceDoc(l.from,l.to);if(e&&!a)return e;let O=i.facet(fn);return new no({search:((t=e?.literal)!==null&&t!==void 0?t:O.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(n=e?.caseSensitive)!==null&&n!==void 0?n:O.caseSensitive,literal:(r=e?.literal)!==null&&r!==void 0?r:O.literal,regexp:(s=e?.regexp)!==null&&s!==void 0?s:O.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:O.wholeWord})}function kp(i){let e=Dn(i,QO);return e&&e.dom.querySelector("[main-field]")}function Xp(i){let e=kp(i);e&&e==i.root.activeElement&&e.select()}var vp=i=>{let e=i.state.field(si,!1);if(e&&e.panel){let t=kp(i);if(t&&t!=i.root.activeElement){let n=dO(i.state,e.query.spec);n.valid&&i.dispatch({effects:lr.of(n)}),t.focus(),t.select()}}else i.dispatch({effects:[gO.of(!0),e?lr.of(dO(i.state,e.query.spec)):z.appendConfig.of(cb)]});return!0},Tp=i=>{let e=i.state.field(si,!1);if(!e||!e.panel)return!1;let t=Dn(i,QO);return t&&t.dom.contains(i.root.activeElement)&&i.focus(),i.dispatch({effects:gO.of(!1)}),!0},Rp=[{key:"Mod-f",run:vp,scope:"editor search-panel"},{key:"F3",run:lo,shift:ao,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:lo,shift:ao,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Tp,scope:"editor search-panel"},{key:"Mod-Shift-l",run:ab},{key:"Mod-Alt-g",run:G1},{key:"Mod-d",run:J1,preventDefault:!0}],pO=class{constructor(e){this.view=e;let t=this.query=e.state.field(si).query.spec;this.commit=this.commit.bind(this),this.searchField=I("input",{value:t.search,placeholder:De(e,"Find"),"aria-label":De(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=I("input",{value:t.replace,placeholder:De(e,"Replace"),"aria-label":De(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=I("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=I("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=I("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function n(r,s,o){return I("button",{class:"cm-button",name:r,onclick:s,type:"button"},o)}this.dom=I("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,n("next",()=>lo(e),[De(e,"next")]),n("prev",()=>ao(e),[De(e,"previous")]),n("select",()=>lb(e),[De(e,"all")]),I("label",null,[this.caseField,De(e,"match case")]),I("label",null,[this.reField,De(e,"regexp")]),I("label",null,[this.wordField,De(e,"by word")]),...e.state.readOnly?[]:[I("br"),this.replaceField,n("replace",()=>bp(e),[De(e,"replace")]),n("replaceAll",()=>Ob(e),[De(e,"replace all")])],I("button",{name:"close",onclick:()=>Tp(e),"aria-label":De(e,"close"),type:"button"},["\xD7"])])}commit(){let e=new no({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:lr.of(e)}))}keydown(e){Pu(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?ao:lo)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),bp(this.view))}update(e){for(let t of e.transactions)for(let n of t.effects)n.is(lr)&&!n.value.eq(this.query)&&this.setQuery(n.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(fn).top}};function De(i,e){return i.state.phrase(e)}var Hs=30,Ks=/[\s\.,:;?!]/;function SO(i,{from:e,to:t}){let n=i.state.doc.lineAt(e),r=i.state.doc.lineAt(t).to,s=Math.max(n.from,e-Hs),o=Math.min(r,t+Hs),l=i.state.sliceDoc(s,o);if(s!=n.from){for(let a=0;al.length-Hs;a--)if(!Ks.test(l[a-1])&&Ks.test(l[a])){l=l.slice(0,a);break}}return y.announce.of(`${i.state.phrase("current match")}. ${l} ${i.state.phrase("on line")} ${n.number}.`)}var hb=y.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"}}),cb=[si,ze.low(ob),hb];var un=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=V(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),s=r.search(Ap(e,!1));return s<0?null:{from:n+s,to:this.pos,text:r.slice(s)}}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 Zp(i){let e=Object.keys(i).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function fb(i){let e=Object.create(null),t=Object.create(null);for(let{label:r}of i){e[r[0]]=!0;for(let s=1;stypeof r=="string"?{label:r}:r),[t,n]=e.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:fb(e);return r=>{let s=r.matchBefore(n);return s||r.explicit?{from:s?s.from:r.pos,options:e,validFor:t}:null}}function uo(i,e){return t=>{for(let n=V(t.state).resolveInner(t.pos,-1);n;n=n.parent){if(i.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return e(t)}}var ho=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function Wi(i){return i.selection.main.from}function Ap(i,e){var t;let{source:n}=i,r=e&&n[0]!="^",s=n[n.length-1]!="$";return!r&&!s?i:new RegExp(`${r?"^":""}(?:${n})${s?"$":""}`,(t=i.flags)!==null&&t!==void 0?t:i.ignoreCase?"i":"")}var WO=qe.define();function ub(i,e,t,n){let{main:r}=i.selection,s=t-r.from,o=n-r.from;return{...i.changeByRange(l=>{if(l!=r&&t!=n&&i.sliceDoc(l.from+s,l.from+o)!=i.sliceDoc(t,n))return{range:l};let a=i.toText(e);return{changes:{from:l.from+s,to:n==r.from?l.to:l.from+o,insert:a},range:P.cursor(l.from+s+a.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}var Wp=new WeakMap;function db(i){if(!Array.isArray(i))return i;let e=Wp.get(i);return e||Wp.set(i,e=fr(i)),e}var co=z.define(),Or=z.define(),yO=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=48&&b<=57||b>=97&&b<=122?2:b>=65&&b<=90?1:0:(w=Xn(b))!=w.toLowerCase()?1:w!=w.toUpperCase()?2:0;(!S||k==1&&g||X==0&&k!=0)&&(t[c]==b||n[c]==b&&(f=!0)?o[c++]=S:o.length&&(Q=!1)),X=k,S+=Me(b)}return c==a&&o[0]==0&&Q?this.result(-100+(f?-200:0),o,e):u==a&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):u==a?this.ret(-900-e.length,[p,m]):c==a?this.result(-100+(f?-200:0)+-700+(Q?0:-1100),o,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],s=0;for(let o of t){let l=o+(this.astral?Me(Se(n,o)):1);s&&r[s-1]==o?r[s-1]=l:(r[s++]=o,r[s++]=l)}return this.ret(e-n.length,r)}},xO=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:pb,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=>qp(e(n),t(n)),optionClass:(e,t)=>n=>qp(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function qp(i,e){return i?e?i+" "+e:i:e}function pb(i,e,t,n,r,s){let o=i.textDirection==N.RTL,l=o,a=!1,O="top",h,c,f=e.left-r.left,u=r.right-e.right,p=n.right-n.left,m=n.bottom-n.top;if(l&&f=m||S>e.top?h=t.bottom-e.top:(O="bottom",h=e.bottom-t.top)}let g=(e.bottom-e.top)/s.offsetHeight,Q=(e.right-e.left)/s.offsetWidth;return{style:`${O}: ${h/g}px; max-width: ${c/Q}px`,class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}var qO=z.define();function mb(i){let e=i.addToOptions.slice();return i.icons&&e.push({render(t){let n=document.createElement("div");return n.classList.add("cm-completionIcon"),t.type&&n.classList.add(...t.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),n.setAttribute("aria-hidden","true"),n},position:20}),e.push({render(t,n,r,s){let o=document.createElement("span");o.className="cm-completionLabel";let l=t.displayLabel||t.label,a=0;for(let O=0;Oa&&o.appendChild(document.createTextNode(l.slice(a,h)));let f=o.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(l.slice(h,c))),f.className="cm-completionMatchedText",a=c}return at.position-n.position).map(t=>t.render)}function PO(i,e,t){if(i<=t)return{from:0,to:i};if(e<0&&(e=0),e<=i>>1){let r=Math.floor(e/t);return{from:r*t,to:(r+1)*t}}let n=Math.ceil((i-e)/t);return{from:i-n*t,to:i-(n-1)*t}}var wO=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:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let r=e.state.field(t),{options:s,selected:o}=r.open,l=e.state.facet(ge);this.optionContent=mb(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=PO(s.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:O}=e.state.field(t).open;for(let h=a.target,c;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(c=/-(\d+)$/.exec(h.id))&&+c[1]this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;h!=null&&(e.dispatch({effects:qO.of(h)}),a.preventDefault())}}),this.dom.addEventListener("focusout",a=>{let O=e.state.field(this.stateField,!1);O&&O.tooltip&&e.state.facet(ge).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:Or.of(null)})}),this.showOptions(s,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){var t;let n=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=r){let{options:s,selected:o,disabled:l}=n.open;(!r.open||r.open.options!=s)&&(this.range=PO(s.length,o,e.state.facet(ge).maxRenderedOptions),this.showOptions(s,n.id)),this.updateSel(),l!=((t=r.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let n of this.currentClass.split(" "))n&&this.dom.classList.remove(n);for(let n of t.split(" "))n&&this.dom.classList.add(n);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.to)&&(this.range=PO(t.options.length,t.selected,this.view.state.facet(ge).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:s}=r;if(!s)return;let o=typeof s=="string"?document.createTextNode(s):s(r);if(!o)return;"then"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,r)}).catch(l=>Pe(this.view.state,l,"completion info")):(this.addInfoPane(o,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:r,destroy:s}=e;n.appendChild(r),this.infoDestroy=s||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&&Qb(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(),s=this.space;if(!s){let o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return r.top>Math.min(s.bottom,t.bottom)-10||r.bottom{o.target==r&&o.preventDefault()});let s=null;for(let o=n.from;on.from||n.from==0))if(s=f,typeof O!="string"&&O.header)r.appendChild(O.header(O));else{let u=r.appendChild(document.createElement("completion-section"));u.textContent=f}}let h=r.appendChild(document.createElement("li"));h.id=t+"-"+o,h.setAttribute("role","option");let c=this.optionClass(l);c&&(h.className=c);for(let f of this.optionContent){let u=f(l,this.view.state,this.view,a);u&&h.appendChild(u)}}return n.from&&r.classList.add("cm-completionListIncompleteTop"),n.tonew wO(t,i,e)}function Qb(i,e){let t=i.getBoundingClientRect(),n=e.getBoundingClientRect(),r=t.height/i.offsetHeight;n.topt.bottom&&(i.scrollTop+=(n.bottom-t.bottom)/r)}function zp(i){return(i.boost||0)*100+(i.apply?10:0)+(i.info?5:0)+(i.type?1:0)}function Sb(i,e){let t=[],n=null,r=null,s=h=>{t.push(h);let{section:c}=h.completion;if(c){n||(n=[]);let f=typeof c=="string"?c:c.name;n.some(u=>u.name==f)||n.push(typeof c=="string"?{name:f}:c)}},o=e.facet(ge);for(let h of i)if(h.hasResult()){let c=h.result.getMatch;if(h.result.filter===!1)for(let f of h.result.options)s(new ho(f,h.source,c?c(f):[],1e9-t.length));else{let f=e.sliceDoc(h.from,h.to),u,p=o.filterStrict?new xO(f):new yO(f);for(let m of h.result.options)if(u=p.match(m.label)){let g=m.displayLabel?c?c(m,u.matched):[]:u.matched,Q=u.score+(m.boost||0);if(s(new ho(m,h.source,g,Q)),typeof m.section=="object"&&m.section.rank==="dynamic"){let{name:S}=m.section;r||(r=Object.create(null)),r[S]=Math.max(Q,r[S]||-1e9)}}}}if(n){let h=Object.create(null),c=0,f=(u,p)=>(u.rank==="dynamic"&&p.rank==="dynamic"?r[p.name]-r[u.name]:0)||(typeof u.rank=="number"?u.rank:1e9)-(typeof p.rank=="number"?p.rank:1e9)||(u.namef.score-c.score||O(c.completion,f.completion))){let c=h.completion;!a||a.label!=c.label||a.detail!=c.detail||a.type!=null&&c.type!=null&&a.type!=c.type||a.apply!=c.apply||a.boost!=c.boost?l.push(h):zp(h.completion)>zp(a)&&(l[l.length-1]=h),a=h.completion}return l}var kO=class i{constructor(e,t,n,r,s,o){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=s,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new i(this.options,Cp(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,r,s,o){if(r&&!o&&e.some(O=>O.isPending))return r.setDisabled();let l=Sb(e,t);if(!l.length)return r&&e.some(O=>O.isPending)?r.setDisabled():null;let a=t.facet(ge).selectOnOpen?0:-1;if(r&&r.selected!=a&&r.selected!=-1){let O=r.options[r.selected].completion;for(let h=0;hh.hasResult()?Math.min(O,h.from):O,1e8),create:wb,above:s.aboveCursor},r?r.timestamp:Date.now(),a,!1)}map(e){return new i(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new i(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},XO=class i{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new i(yb,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,n=t.facet(ge),s=(n.override||t.languageDataAt("autocomplete",Wi(t)).map(db)).map(a=>(this.active.find(h=>h.source==a)||new Ct(a,this.active.some(h=>h.state!=0)?1:0)).update(e,n));s.length==this.active.length&&s.every((a,O)=>a==this.active[O])&&(s=this.active);let o=this.open,l=e.effects.some(a=>a.is(zO));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||s.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!Pb(s,this.active)||l?o=kO.build(s,t,this.id,o,n,l):o&&o.disabled&&!s.some(a=>a.isPending)&&(o=null),!o&&s.every(a=>!a.isPending)&&s.some(a=>a.hasResult())&&(s=s.map(a=>a.hasResult()?new Ct(a.source,0):a));for(let a of e.effects)a.is(qO)&&(o=o&&o.setSelected(a.value,this.id));return s==this.active&&o==this.open?this:new i(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?$b:bb}};function Pb(i,e){if(i==e)return!0;for(let t=0,n=0;;){for(;t-1&&(t["aria-activedescendant"]=i+"-"+e),t}var yb=[];function jp(i,e){if(i.isUserEvent("input.complete")){let n=i.annotation(WO);if(n&&e.activateOnCompletion(n))return 12}let t=i.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:i.isUserEvent("delete.backward")?2:i.selection?8:i.docChanged?16:0}var Ct=class i{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let n=jp(e,t),r=this;(n&8||n&16&&this.touches(e))&&(r=new i(r.source,0)),n&4&&r.state==0&&(r=new i(this.source,1)),r=r.updateFor(e,n);for(let s of e.effects)if(s.is(co))r=new i(r.source,1,s.value);else if(s.is(Or))r=new i(r.source,0);else if(s.is(zO))for(let o of s.value)o.source==r.source&&(r=o);return r}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Wi(e.state))}},fo=class i extends Ct{constructor(e,t,n,r,s,o){super(e,3,t),this.limit=n,this.result=r,this.from=s,this.to=o}hasResult(){return!0}updateFor(e,t){var n;if(!(t&3))return this.map(e.changes);let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let s=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=Wi(e.state);if(l>o||!r||t&2&&(Wi(e.startState)==this.from||lt.map(e))}}),Ve=se.define({create(){return XO.start()},update(i,e){return i.update(e)},provide:i=>[Ln.from(i,e=>e.tooltip),y.contentAttributes.from(i,e=>e.attrs)]});function CO(i,e){let t=e.completion.apply||e.completion.label,n=i.state.field(Ve).active.find(r=>r.source==e.source);return n instanceof fo?(typeof t=="string"?i.dispatch({...ub(i.state,t,n.from,n.to),annotations:WO.of(e.completion)}):t(i,e.completion,n.from,n.to),!0):!1}var wb=gb(Ve,CO);function Oo(i,e="option"){return t=>{let n=t.state.field(Ve,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp-1?n.open.selected+r*(i?1:-1):i?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:qO.of(l)}),!0}}var kb=i=>{let e=i.state.field(Ve,!1);return i.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampi.state.field(Ve,!1)?(i.dispatch({effects:co.of(!0)}),!0):!1,Xb=i=>{let e=i.state.field(Ve,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(i.dispatch({effects:Or.of(null)}),!0)},vO=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},vb=50,Tb=1e3,Rb=ie.fromClass(class{constructor(i){this.view=i,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of i.state.field(Ve).active)e.isPending&&this.startQuery(e)}update(i){let e=i.state.field(Ve),t=i.state.facet(ge);if(!i.selectionSet&&!i.docChanged&&i.startState.field(Ve)==e)return;let n=i.transactions.some(s=>{let o=jp(s,t);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;svb&&Date.now()-o.time>Tb){for(let l of o.context.abortListeners)try{l()}catch(a){Pe(this.view.state,a)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...i.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),i.transactions.some(s=>s.effects.some(o=>o.is(co)))&&(this.pendingStart=!0);let r=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.isPending&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let s of i.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:i}=this.view,e=i.field(Ve);for(let t of e.active)t.isPending&&!this.running.some(n=>n.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ge).updateSyncTime))}startQuery(i){let{state:e}=this.view,t=Wi(e),n=new un(e,t,i.explicit,this.view),r=new vO(i,n);this.running.push(r),Promise.resolve(i.source(n)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:Or.of(null)}),Pe(this.view.state,s)})}scheduleAccept(){this.running.every(i=>i.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ge).updateSyncTime))}accept(){var i;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(ge),n=this.view.state.field(Ve);for(let r=0;rl.source==s.active.source);if(o&&o.isPending)if(s.done==null){let l=new Ct(s.active.source,0);for(let a of s.updates)l=l.update(a,t);l.isPending||e.push(l)}else this.startQuery(o)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:zO.of(e)})}},{eventHandlers:{blur(i){let e=this.view.state.field(Ve,!1);if(e&&e.tooltip&&this.view.state.facet(ge).closeOnBlur){let t=e.open&&xa(this.view,e.open.tooltip);(!t||!t.dom.contains(i.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Or.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:co.of(!1)}),20),this.composing=0}}}),Zb=typeof navigator=="object"&&/Win/.test(navigator.platform),Wb=ze.highest(y.domEventHandlers({keydown(i,e){let t=e.state.field(Ve,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||i.key.length>1||i.ctrlKey&&!(Zb&&i.altKey)||i.metaKey)return!1;let n=t.open.options[t.open.selected],r=t.active.find(o=>o.source==n.source),s=n.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(i.key)>-1&&CO(e,n),!1}})),Ep=y.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:'"\xB7\xB7\xB7"',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:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),TO=class{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}},RO=class i{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,pe.TrackDel),n=e.mapPos(this.to,1,pe.TrackDel);return t==null||n==null?null:new i(this.field,t,n)}},ZO=class i{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],r=[t],s=e.doc.lineAt(t),o=/^\s*/.exec(s.text)[0];for(let a of this.lines){if(n.length){let O=o,h=/^\t*/.exec(a)[0].length;for(let c=0;cnew RO(a.field,r[a.line]+a.from,r[a.line]+a.to));return{text:n,ranges:l}}static parse(e){let t=[],n=[],r=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let l=s[1]?+s[1]:null,a=s[2]||s[3]||"",O=-1;l===0&&(l=1e9);let h=a.replace(/\\[{}]/g,c=>c[1]);for(let c=0;c=O&&f.field++}for(let c of r)if(c.line==n.length&&c.from>s.index){let f=s[2]?3+(s[1]||"").length:2;c.from-=f,c.to-=f}r.push(new TO(O,n.length,s.index,s.index+h.length)),o=o.slice(0,s.index)+a+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(l,a,O)=>{for(let h of r)h.line==n.length&&h.from>O&&(h.from--,h.to--);return a}),n.push(o)}return new i(n,r)}},qb=Z.widget({widget:new class extends Re{toDOM(){let i=document.createElement("span");return i.className="cm-snippetFieldPosition",i}ignoreEvent(){return!1}}}),zb=Z.mark({class:"cm-snippetField"}),dn=class i{constructor(e,t){this.ranges=e,this.active=t,this.deco=Z.set(e.map(n=>(n.from==n.to?qb:zb).range(n.from,n.to)),!0)}map(e){let t=[];for(let n of this.ranges){let r=n.map(e);if(!r)return null;t.push(r)}return new i(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(n=>n.field==this.active&&n.from<=t.from&&n.to>=t.to))}},ur=z.define({map(i,e){return i&&i.map(e)}}),Cb=z.define(),hr=se.define({create(){return null},update(i,e){for(let t of e.effects){if(t.is(ur))return t.value;if(t.is(Cb)&&i)return new dn(i.ranges,t.value)}return i&&e.docChanged&&(i=i.map(e.changes)),i&&e.selection&&!i.selectionInsideField(e.selection)&&(i=null),i},provide:i=>y.decorations.from(i,e=>e?e.deco:Z.none)});function _O(i,e){return P.create(i.filter(t=>t.field==e).map(t=>P.range(t.from,t.to)))}function _b(i){let e=ZO.parse(i);return(t,n,r,s)=>{let{text:o,ranges:l}=e.instantiate(t.state,r),{main:a}=t.state.selection,O={changes:{from:r,to:s==a.from?a.to:s,insert:j.of(o)},scrollIntoView:!0,annotations:n?[WO.of(n),he.userEvent.of("input.complete")]:void 0};if(l.length&&(O.selection=_O(l,0)),l.some(h=>h.field>0)){let h=new dn(l,0),c=O.effects=[ur.of(h)];t.state.field(hr,!1)===void 0&&c.push(z.appendConfig.of([hr,Eb,Mb,Ep]))}t.dispatch(t.state.update(O))}}function Mp(i){return({state:e,dispatch:t})=>{let n=e.field(hr,!1);if(!n||i<0&&n.active==0)return!1;let r=n.active+i,s=i>0&&!n.ranges.some(o=>o.field==r+i);return t(e.update({selection:_O(n.ranges,r),effects:ur.of(s?null:new dn(n.ranges,r)),scrollIntoView:!0})),!0}}var Yb=({state:i,dispatch:e})=>i.field(hr,!1)?(e(i.update({effects:ur.of(null)})),!0):!1,Vb=Mp(1),Ab=Mp(-1);var jb=[{key:"Tab",run:Vb,shift:Ab},{key:"Escape",run:Yb}],_p=v.define({combine(i){return i.length?i[0]:jb}}),Eb=ze.highest(Nt.compute([_p],i=>i.facet(_p)));function ne(i,e){return{...e,apply:_b(i)}}var Mb=y.domEventHandlers({mousedown(i,e){let t=e.state.field(hr,!1),n;if(!t||(n=e.posAtCoords({x:i.clientX,y:i.clientY}))==null)return!1;let r=t.ranges.find(s=>s.from<=n&&s.to>=n);return!r||r.field==t.active?!1:(e.dispatch({selection:_O(t.ranges,r.field),effects:ur.of(t.ranges.some(s=>s.field>r.field)?new dn(t.ranges,r.field):null),scrollIntoView:!0}),!0)}});var cr={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Zi=z.define({map(i,e){let t=e.mapPos(i,-1,pe.TrackAfter);return t??void 0}}),YO=new class extends Ke{};YO.startSide=1;YO.endSide=-1;var Up=se.define({create(){return L.empty},update(i,e){if(i=i.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);i=i.update({filter:n=>n>=t.from&&n<=t.to})}for(let t of e.effects)t.is(Zi)&&(i=i.update({add:[YO.range(t.value,t.value+1)]}));return i}});function Gp(){return[Gb,Up]}var bO="()[]{}<>\xAB\xBB\xBB\xAB\uFF3B\uFF3D\uFF5B\uFF5D";function Lp(i){for(let e=0;e{if((Ub?i.composing:i.compositionStarted)||i.state.readOnly)return!1;let r=i.state.selection.main;if(n.length>2||n.length==2&&Me(Se(n,0))==1||e!=r.from||t!=r.to)return!1;let s=Db(i.state,n);return s?(i.dispatch(s),!0):!1}),Lb=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let n=Dp(i,i.selection.main.head).brackets||cr.brackets,r=null,s=i.changeByRange(o=>{if(o.empty){let l=Ib(i.doc,o.head);for(let a of n)if(a==l&&po(i.doc,o.head)==Lp(Se(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:P.cursor(o.head-a.length)}}return{range:r=o}});return r||e(i.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},Ip=[{key:"Backspace",run:Lb}];function Db(i,e){let t=Dp(i,i.selection.main.head),n=t.brackets||cr.brackets;for(let r of n){let s=Lp(Se(r,0));if(e==r)return s==r?Fb(i,r,n.indexOf(r+r+r)>-1,t):Bb(i,r,s,t.before||cr.before);if(e==s&&Bp(i,i.selection.main.from))return Nb(i,r,s)}return null}function Bp(i,e){let t=!1;return i.field(Up).between(0,i.doc.length,n=>{n==e&&(t=!0)}),t}function po(i,e){let t=i.sliceString(e,e+2);return t.slice(0,Me(Se(t,0)))}function Ib(i,e){let t=i.sliceString(e-2,e);return Me(Se(t,0))==t.length?t:t.slice(1)}function Bb(i,e,t,n){let r=null,s=i.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:Zi.of(o.to+e.length),range:P.range(o.anchor+e.length,o.head+e.length)};let l=po(i.doc,o.head);return!l||/\s/.test(l)||n.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:Zi.of(o.head+e.length),range:P.cursor(o.head+e.length)}:{range:r=o}});return r?null:i.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Nb(i,e,t){let n=null,r=i.changeByRange(s=>s.empty&&po(i.doc,s.head)==t?{changes:{from:s.head,to:s.head+t.length,insert:t},range:P.cursor(s.head+t.length)}:n={range:s});return n?null:i.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function Fb(i,e,t,n){let r=n.stringPrefixes||cr.stringPrefixes,s=null,o=i.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:Zi.of(l.to+e.length),range:P.range(l.anchor+e.length,l.head+e.length)};let a=l.head,O=po(i.doc,a),h;if(O==e){if(Yp(i,a))return{changes:{insert:e+e,from:a},effects:Zi.of(a+e.length),range:P.cursor(a+e.length)};if(Bp(i,a)){let f=t&&i.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+f.length,insert:f},range:P.cursor(a+f.length)}}}else{if(t&&i.sliceDoc(a-2*e.length,a)==e+e&&(h=Vp(i,a-2*e.length,r))>-1&&Yp(i,h))return{changes:{insert:e+e+e+e,from:a},effects:Zi.of(a+e.length),range:P.cursor(a+e.length)};if(i.charCategorizer(a)(O)!=H.Word&&Vp(i,a,r)>-1&&!Hb(i,a,e,r))return{changes:{insert:e+e,from:a},effects:Zi.of(a+e.length),range:P.cursor(a+e.length)}}return{range:s=l}});return s?null:i.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Yp(i,e){let t=V(i).resolveInner(e+1);return t.parent&&t.from==e}function Hb(i,e,t,n){let r=V(i).resolveInner(e,-1),s=n.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=i.sliceDoc(r.from,Math.min(r.to,r.from+t.length+s)),a=l.indexOf(t);if(!a||a>-1&&n.indexOf(l.slice(0,a))>-1){let h=r.firstChild;for(;h&&h.from==r.from&&h.to-h.from>t.length+a;){if(i.sliceDoc(h.to-t.length,h.to)==t)return!1;h=h.firstChild}return!0}let O=r.to==e&&r.parent;if(!O)break;r=O}return!1}function Vp(i,e,t){let n=i.charCategorizer(e);if(n(i.sliceDoc(e-1,e))!=H.Word)return e;for(let r of t){let s=e-r.length;if(i.sliceDoc(s,e)==r&&n(i.sliceDoc(s-1,s))!=H.Word)return s}return-1}function Np(i={}){return[Wb,Ve,ge.of(i),Rb,Kb,Ep]}var VO=[{key:"Ctrl-Space",run:$O},{mac:"Alt-`",run:$O},{mac:"Alt-i",run:$O},{key:"Escape",run:Xb},{key:"ArrowDown",run:Oo(!0)},{key:"ArrowUp",run:Oo(!1)},{key:"PageDown",run:Oo(!0,"page")},{key:"PageUp",run:Oo(!1,"page")},{key:"Enter",run:kb}],Kb=ze.highest(Nt.computeN([ge],i=>i.facet(ge).defaultKeymap?[VO]:[]));var go=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},qi=class i{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let r=n.facet(dr).markerFilter;r&&(e=r(e,n));let s=e.slice().sort((u,p)=>u.from-p.from||u.to-p.to),o=new Ee,l=[],a=0,O=n.doc.iter(),h=0,c=n.doc.length;for(let u=0;;){let p=u==s.length?null:s[u];if(!p&&!l.length)break;let m,g;if(l.length)m=a,g=l.reduce(($,X)=>Math.min($,X.to),p&&p.from>m?p.from:1e8);else{if(m=p.from,m>c)break;g=p.to,l.push(p),u++}for(;u$.from||$.to==m))l.push($),u++,g=Math.min($.to,g);else{g=Math.min($.from,g);break}}g=Math.min(g,c);let Q=!1;if(l.some($=>$.from==m&&($.to==g||g==c))&&(Q=m==g,!Q&&g-m<10)){let $=m-(h+O.value.length);$>0&&(O.next($),h=m);for(let X=m;;){if(X>=g){Q=!0;break}if(!O.lineBreak&&h+O.value.length>X)break;X=h+O.value.length,h+=O.value.length,O.next()}}let S=Oy(l);if(Q)o.add(m,m,Z.widget({widget:new AO(S),diagnostics:l.slice()}));else{let $=l.reduce((X,b)=>b.markClass?X+" "+b.markClass:X,"");o.add(m,g,Z.mark({class:"cm-lintRange cm-lintRange-"+S+$,diagnostics:l.slice(),inclusiveEnd:l.some(X=>X.to>g)}))}if(a=g,a==c)break;for(let $=0;${if(!(e&&o.diagnostics.indexOf(e)<0))if(!n)n=new go(r,s,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new go(n.from,s,n.diagnostic)}}),n}function Jb(i,e){let t=e.pos,n=e.end||t,r=i.state.facet(dr).hideOn(i,t,n);if(r!=null)return r;let s=i.startState.doc.lineAt(e.pos);return!!(i.effects.some(o=>o.is(Kp))||i.changes.touchesRange(s.from,Math.max(s.to,n)))}function ey(i,e){return i.field(Ie,!1)?e:e.concat(z.appendConfig.of(hy))}var Kp=z.define(),jO=z.define(),Jp=z.define(),Ie=se.define({create(){return new qi(Z.none,null,null)},update(i,e){if(e.docChanged&&i.diagnostics.size){let t=i.diagnostics.map(e.changes),n=null,r=i.panel;if(i.selected){let s=e.changes.mapPos(i.selected.from,1);n=li(t,i.selected.diagnostic,s)||li(t,null,s)}!t.size&&r&&e.state.facet(dr).autoPanel&&(r=null),i=new qi(t,r,n)}for(let t of e.effects)if(t.is(Kp)){let n=e.state.facet(dr).autoPanel?t.value.length?pr.open:null:i.panel;i=qi.init(t.value,n,e.state)}else t.is(jO)?i=new qi(i.diagnostics,t.value?pr.open:null,i.selected):t.is(Jp)&&(i=new qi(i.diagnostics,i.panel,t.value));return i},provide:i=>[yi.from(i,e=>e.panel),y.decorations.from(i,e=>e.diagnostics)]});var ty=Z.mark({class:"cm-lintRange cm-lintRange-active"});function iy(i,e,t){let{diagnostics:n}=i.state.field(Ie),r,s=-1,o=-1;n.between(e-(t<0?1:0),e+(t>0?1:0),(a,O,{spec:h})=>{if(e>=a&&e<=O&&(a==O||(e>a||t>0)&&(eim(i,t,!1)))}var ry=i=>{let e=i.state.field(Ie,!1);(!e||!e.panel)&&i.dispatch({effects:ey(i.state,[jO.of(!0)])});let t=Dn(i,pr.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},Fp=i=>{let e=i.state.field(Ie,!1);return!e||!e.panel?!1:(i.dispatch({effects:jO.of(!1)}),!0)},sy=i=>{let e=i.state.field(Ie,!1);if(!e)return!1;let t=i.state.selection.main,n=li(e.diagnostics,null,t.to+1);return!n&&(n=li(e.diagnostics,null,0),!n||n.from==t.from&&n.to==t.to)?!1:(i.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),zu(i,n.from,1,{tooltip:nm,until:r=>r.docChanged||r.newSelection.main.headn.to}),!0)};var em=[{key:"Mod-Shift-m",run:ry,preventDefault:!0},{key:"F8",run:sy}];var dr=v.define({combine(i){return{sources:i.map(e=>e.source).filter(e=>e!=null),...ye(i.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Hp,tooltipFilter:Hp,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,s)=>e(n,r,s)||t(n,r,s):e:t,autoPanel:(e,t)=>e||t})}}});function Hp(i,e){return i?e?(t,n)=>e(i(t,n),n):i:e}function tm(i){let e=[];if(i)e:for(let{name:t}of i){for(let n=0;ns.toLowerCase()==r.toLowerCase())){e.push(r);continue e}}e.push("")}return e}function im(i,e,t){var n;let r=t?tm(e.actions):[];return I("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},I("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(i):e.message),(n=e.actions)===null||n===void 0?void 0:n.map((s,o)=>{let l=!1,a=u=>{if(u.preventDefault(),l)return;l=!0;let p=li(i.state.field(Ie).diagnostics,e);p&&s.apply(i,p.from,p.to)},{name:O}=s,h=r[o]?O.indexOf(r[o]):-1,c=h<0?O:[O.slice(0,h),I("u",O.slice(h,h+1)),O.slice(h+1)],f=s.markClass?" "+s.markClass:"";return I("button",{type:"button",class:"cm-diagnosticAction"+f,onclick:a,onmousedown:a,"aria-label":` Action: ${O}${h<0?"":` (access key "${r[o]})"`}.`},c)}),e.source&&I("div",{class:"cm-diagnosticSource"},e.source))}var AO=class extends Re{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return I("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}},Qo=class{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=im(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}},pr=class i{constructor(e){this.view=e,this.items=[];let t=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)Fp(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=tm(s.actions);for(let l=0;l{for(let s=0;sFp(this.view)},"\xD7")),this.update()}get selectedIndex(){let e=this.view.state.field(Ie).selected;if(!e)return-1;for(let t=0;t{for(let h of O.diagnostics){if(o.has(h))continue;o.add(h);let c=-1,f;for(let u=n;un&&(this.items.splice(n,c-n),r=!0)),t&&f.diagnostic==t.diagnostic?f.dom.hasAttribute("aria-selected")||(f.dom.setAttribute("aria-selected","true"),s=f):f.dom.hasAttribute("aria-selected")&&f.dom.removeAttribute("aria-selected"),n++}});n({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:a})=>{let O=a.height/this.list.offsetHeight;l.topa.bottom&&(this.list.scrollTop+=(l.bottom-a.bottom)/O)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let n=e;e=n.nextSibling,n.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=this.view.state.field(Ie),n=li(t.diagnostics,this.items[e].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:Jp.of(n)})}static open(e){return new i(e)}};function oy(i,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(i)}')`}function mo(i){return oy(``,'width="6" height="3"')}var ly=y.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:mo("#f11")},".cm-lintRange-warning":{backgroundImage:mo("orange")},".cm-lintRange-info":{backgroundImage:mo("#999")},".cm-lintRange-hint":{backgroundImage:mo("#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 ay(i){return i=="error"?4:i=="warning"?3:i=="info"?2:1}function Oy(i){let e="hint",t=1;for(let n of i){let r=ay(n.severity);r>t&&(t=r,e=n.severity)}return e}var nm=qu(iy,{hideOn:Jb}),hy=[Ie,y.decorations.compute([Ie],i=>{let{selected:e,panel:t}=i.field(Ie);return!e||!t||e.from==e.to?Z.none:Z.set([ty.range(e.from,e.to)])}),nm,ly];var rm=[Xs(),ju(),vu(),Ud(),$d(),xu(),Xu(),G.allowMultipleSelections.of(!0),ud(),Gs(yd,{fallback:!0}),Xd(),Gp(),Np(),Ru(),Zu(),Tu(),wp(),Nt.of([...Ip,...Sp,...Rp,...Id,...Qd,...VO,...em])];var UO=class i{constructor(e,t,n,r,s,o,l,a,O,h=0,c){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=O,this.lookAhead=h,this.parent=c}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let r=e.parser.context;return new i(e,[],t,n,n,0,[],0,r?new So(r,r.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){var t;let n=e>>19,r=e&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(O==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(r,O)}storeNode(e,t,n,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(t==n)return;if(this.buffer[o-2]>=t){this.buffer[o-2]=n;return}}}if(!s||this.pos==n)this.buffer.push(e,t,n,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>n;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=n,this.buffer[o+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>n||t<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=o.maxNode&&this.buffer.push(t,n,r,4)}else this.pos=r,this.shiftContext(t,n),t<=this.p.parser.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 e=this,t=e.buffer.length;for(t&&e.buffer[t-4]==0&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new i(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}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 GO(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)==0)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 r=[];for(let s=0,o;sa&1&&l==o)||r.push(t[s],o)}t=r}let n=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-n*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}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,s)=>{if(!t.includes(r))return t.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let a=o&65535,O=this.stack.length-l*3;if(O>=0&&e.getGoto(this.stack[O],a,!1)>=0)return l<<19|65536|a}}else{let l=n(o,s+1);if(l!=null)return l}})};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;t0&&this.emitLookAhead()}},So=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},GO=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}},LO=class i{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new i(e,t,t-e.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 i(this.stack,this.pos,this.index)}};function mr(i,e=Uint16Array){if(typeof i!="string")return i;let t=null;for(let n=0,r=0;n=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),s+=a,l)break;s*=46}t?t[r++]=s:t=new e(s)}return t}var pn=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},sm=new pn,DO=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=sm,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,s=this.pos+e;for(;sn.to:s>=n.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-n.to,n=o}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t=this.chunk2Pos&&nl.to&&(this.chunk2=this.chunk2.slice(0,l.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.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=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=sm,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&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}},ai=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;hm(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};ai.prototype.contextual=ai.prototype.fallback=ai.prototype.extend=!1;var Oi=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e=="string"?mr(e):e}token(e,t){let n=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(hm(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};Oi.prototype.contextual=ai.prototype.fallback=ai.prototype.extend=!1;var U=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function hm(i,e,t,n,r,s){let o=0,l=1<0){let p=i[u];if(a.allows(p)&&(e.token.value==-1||e.token.value==p||fy(p,e.token.value,r,s))){e.acceptToken(p);break}}let h=e.next,c=0,f=i[o+2];if(e.next<0&&f>c&&i[O+f*3-3]==65535){o=i[O+f*3-1];continue e}for(;c>1,p=O+u+(u<<1),m=i[p],g=i[p+1]||65536;if(h=g)c=u+1;else{o=i[p+2],e.advance();continue e}}break}}function om(i,e,t){for(let n=e,r;(r=i[n])!=65535;n++)if(r==t)return n-e;return-1}function fy(i,e,t,n){let r=om(t,n,e);return r<0||om(t,n,i)e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(i.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:i.length}}var IO=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?lm(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?lm(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(ee)return this.nextStart=o,null;if(s instanceof Y){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+s.length}}},BO=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new pn)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let O=0;Oc.end+25&&(a=Math.max(c.lookAhead,a)),c.value!=0)){let f=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!h.extend&&(n=c,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!n&&e.pos==this.stream.end&&(n=new pn,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 pn,{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:s}=n.p;for(let o=0;o=0&&n.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let s=0;se.bufferLength*4?new IO(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;ot)n.push(l);else{if(this.advanceStack(l,n,e))continue;{r||(r=[],s=[]),r.push(l);let a=this.tokens.getMainToken(l);s.push(a.value,a.end)}}break}}if(!n.length){let o=r&&uy(r);if(o)return Be&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Be&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,n);if(o)return Be&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((l,a)=>a.score-l.score);n.length>o;)n.pop();n.some(l=>l.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let o=0;o500&&O.buffer.length>500)if((l.score-O.score||l.buffer.length-O.buffer.length)>0)n.splice(a--,1);else{n.splice(o--,1);continue e}}}n.length>12&&(n.sort((o,l)=>l.score-o.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let O=e.curContext&&e.curContext.tracker.strict,h=O?e.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let f=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(e.state,c.type.id):-1;if(f>-1&&c.length&&(!O||(c.prop(q.contextHash)||0)==h))return e.useNode(c,f),Be&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof Y)||c.children.length==0||c.positions[0]>0)break;let u=c.children[0];if(u instanceof Y&&c.positions[0]==0)c=u;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),Be&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let O=0;Or?t.push(p):n.push(p)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return am(e,t),!0}}runRecovery(e,t,n){let r=null,s=!1;for(let o=0;o ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Be&&console.log(h+this.stackID(l)+" (restarted)"),this.advanceFully(l,n))))continue;let c=l.split(),f=h;for(let u=0;u<10&&c.forceReduce()&&(Be&&console.log(f+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,n));u++)Be&&(f=this.stackID(c)+" -> ");for(let u of l.recoverByInsert(a))Be&&console.log(h+this.stackID(u)+" (via recover-insert)"),this.advanceFully(u,n);this.stream.end>l.pos?(O==l.pos&&(O++,a=0),l.recoverByDelete(a,O),Be&&console.log(h+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),am(l,n)):(!r||r.scorei,lt=class{constructor(e){this.start=e.start,this.shift=e.shift||MO,this.reduce=e.reduce||MO,this.reuse=e.reuse||MO,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},de=class i extends Wt{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;le.topRules[l][1]),r=[];for(let l=0;l=0)s(h,a,l[O++]);else{let c=l[O+-h];for(let f=-h;f>0;f--)s(l[O++],a,c);O++}}}this.nodeSet=new Rt(t.map((l,a)=>oe.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:r[a],top:n.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=mr(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new ai(o,l):l),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 NO(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let o=r[s++],l=o&1,a=r[s++];if(l&&n)return a;for(let O=s+(o>>1);s0}validAction(e,t){return!!this.allActions(e,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=_t(this.data,s+2);else break;r=t(_t(this.data,s+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=_t(this.data,n+2);else break;if((this.data[n+2]&1)==0){let r=this.data[n+1];t.some((s,o)=>o&1&&s==r)||t.push(this.data[n],r)}}return t}configure(e){let t=Object.assign(Object.create(i.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(n=>{let r=e.tokenizers.find(s=>s.from==n);return r?r.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,r)=>{let s=e.specializers.find(l=>l.from==n.external);if(!s)return n;let o=Object.assign(Object.assign({},n),{external:s.to});return t.specializers[r]=Om(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}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 s of e.split(" ")){let o=t.indexOf(s);o>=0&&(n[o]=!0)}let r=null;for(let s=0;sn)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scorei.external(t,n)<<1|e}return i.get}var dy=148,cm=1,py=149,my=150,um=2,gy=151,Qy=3,Sy=4,dm=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Py=58,$y=40,pm=95,by=91,Po=45,yy=46,xy=35,wy=37,ky=38,Xy=92,vy=10,Ty=42;function gr(i){return i>=65&&i<=90||i>=97&&i<=122||i>=161}function HO(i){return i>=48&&i<=57}function fm(i){return HO(i)||i>=97&&i<=102||i>=65&&i<=70}var mm=(i,e,t)=>(n,r)=>{for(let s=!1,o=0,l=0;;l++){let{next:a}=n;if(gr(a)||a==Po||a==pm||s&&HO(a))!s&&(a!=Po||l>0)&&(s=!0),o===l&&a==Po&&o++,n.advance();else if(a==Xy&&n.peek(1)!=vy){if(n.advance(),fm(n.next)){do n.advance();while(fm(n.next));n.next==32&&n.advance()}else n.next>-1&&n.advance();s=!0}else{s&&n.acceptToken(o==2&&r.canShift(um)?e:a==$y?t:i);break}}},Ry=new U(mm(py,um,my),{contextual:!0}),Zy=new U(mm(gy,Qy,Sy),{contextual:!0}),Wy=new U(i=>{if(dm.includes(i.peek(-1))){let{next:e}=i;(gr(e)||e==pm||e==xy||e==yy||e==Ty||e==by||e==Py&&gr(i.peek(1))||e==Po||e==ky)&&i.acceptToken(dy)}}),qy=new U(i=>{if(!dm.includes(i.peek(-1))){let{next:e}=i;if(e==wy&&(i.advance(),i.acceptToken(cm)),gr(e)){do i.advance();while(gr(i.next)||HO(i.next));i.acceptToken(cm)}}}),zy=le({"AtKeyword import charset namespace keyframes media supports font-feature-values":d.definitionKeyword,"from to selector scope MatchFlag":d.keyword,NamespaceName:d.namespace,KeyframeName:d.labelName,KeyframeRangeName:d.operatorKeyword,TagName:d.tagName,ClassName:d.className,PseudoClassName:d.constant(d.className),IdName:d.labelName,"FeatureName PropertyName":d.propertyName,AttributeName:d.attributeName,NumberLiteral:d.number,KeywordQuery:d.keyword,UnaryQueryOp:d.operatorKeyword,"CallTag ValueName FontName":d.atom,VariableName:d.variableName,Callee:d.operatorKeyword,Unit:d.unit,"UniversalSelector NestingSelector":d.definitionOperator,"MatchOp CompareOp":d.compareOperator,"ChildOp SiblingOp, LogicOp":d.logicOperator,BinOp:d.arithmeticOperator,Important:d.modifier,Comment:d.blockComment,ColorLiteral:d.color,"ParenthesizedContent StringLiteral":d.string,":":d.punctuation,"PseudoOp #":d.derefOperator,"; , |":d.separator,"( )":d.paren,"[ ]":d.squareBracket,"{ }":d.brace}),Cy={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:158,"url-prefix":158,domain:158,regexp:158},_y={__proto__:null,or:104,and:104,not:112,only:112,layer:212},Yy={__proto__:null,selector:118,style:124,layer:208},Vy={__proto__:null,"@import":204,"@media":216,"@charset":220,"@namespace":224,"@keyframes":230,"@supports":242,"@scope":246,"@font-feature-values":252},Ay={__proto__:null,to:249},gm=de.deserialize({version:14,states:"MrQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FqO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#ERO'dQdO'#ETO'oQdO'#E[O'oQdO'#E_OOQP'#Fq'#FqO)RQhO'#FQOOQS'#Fp'#FpOOQS'#FT'#FTQYQdOOO)YQdO'#EeO*iQhO'#EkO)YQdO'#EmO*pQdO'#EoO*{QdO'#ErO)}QhO'#ExO+TQdO'#EzO+`QdO'#E}O+eQaO'#CfO+lQ`O'#EbO+qQ`O'#F}O+|QdO'#F}QOQ`OOP,WO&jO'#CaPOOO)CA`)CA`OOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,cQdO,59YO'_QdO,5:mO'dQdO,5:oO'oQdO,5:vO'oQdO,5:xO'oQdO,5:yO'oQdO'#F[O,nQ`O,58}O,vQdO'#EaOOQS,58},58}OOQP'#Cq'#CqOOQO'#EP'#EPOOQP,59Y,59YO,}Q`O,59YO-SQ`O,59YOOQP'#ES'#ESOOQP,5:m,5:mO-XQpO'#EUO-dQdO'#EVO-iQ`O'#EVO-nQpO,5:oO.XQaO,5:vO.oQaO,5:yOOQW'#D^'#D^O/nQhO'#DgO0RQhO,5;lO)}QhO'#DeO0`Q`O'#DnO0eQhO'#D{OOQW'#Fw'#FwOOQS,5;l,5;lO0jQ`O'#DhO0oQ`O'#DkOOQS-E9R-E9ROOQ['#Cv'#CvO0tQdO'#CwO1[QdO'#C}O1rQdO'#DQO2YQ!pO'#DSO4fQ!jO,5;POOQO'#DX'#DXO-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,get:i=>Yy[i]||-1},{term:28,get:i=>Vy[i]||-1},{term:149,get:i=>Ay[i]||-1}],tokenPrec:2444});var KO=null;function JO(){if(!KO&&typeof document=="object"&&document.body){let{style:i}=document.body,e=[],t=new Set;for(let n in i)n!="cssText"&&n!="cssFloat"&&typeof i[n]=="string"&&(/[A-Z]/.test(n)&&(n=n.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(n)||(e.push(n),t.add(n)));KO=e.sort().map(n=>({type:"property",label:n,apply:n+": "}))}return KO||[]}var Qm=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(i=>({type:"class",label:i})),Sm=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(i=>({type:"keyword",label:i})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(i=>({type:"constant",label:i}))),jy=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(i=>({type:"type",label:i})),Ey=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(i=>({type:"keyword",label:i})),Yt=/^(\w[\w-]*|-\w[\w-]*|)$/,My=/^-(-[\w-]*)?$/;function Uy(i,e){var t;if((i.name=="("||i.type.isError)&&(i=i.parent||i),i.name!="ArgList")return!1;let n=(t=i.parent)===null||t===void 0?void 0:t.firstChild;return n?.name!="Callee"?!1:e.sliceString(n.from,n.to)=="var"}var Pm=new Kt,Gy=["Declaration"];function Ly(i){for(let e=i;;){if(e.type.isTop)return e;if(!(e=e.parent))return i}}function $m(i,e,t){if(e.to-e.from>4096){let n=Pm.get(e);if(n)return n;let r=[],s=new Set,o=e.cursor(E.IncludeAnonymous);if(o.firstChild())do for(let l of $m(i,o.node,t))s.has(l.label)||(s.add(l.label),r.push(l));while(o.nextSibling());return Pm.set(e,r),r}else{let n=[],r=new Set;return e.cursor().iterate(s=>{var o;if(t(s)&&s.matchContext(Gy)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let l=i.sliceString(s.from,s.to);r.has(l)||(r.add(l),n.push({label:l,type:"variable"}))}}),n}}var Dy=i=>e=>{let{state:t,pos:n}=e,r=V(t).resolveInner(n,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:JO(),validFor:Yt};if(r.name=="ValueName")return{from:r.from,options:Sm,validFor:Yt};if(r.name=="PseudoClassName")return{from:r.from,options:Qm,validFor:Yt};if(i(r)||(e.explicit||s)&&Uy(r,t.doc))return{from:i(r)||s?r.from:n,options:$m(t.doc,Ly(r),i),validFor:My};if(r.name=="TagName"){for(let{parent:a}=r;a;a=a.parent)if(a.name=="Block")return{from:r.from,options:JO(),validFor:Yt};return{from:r.from,options:jy,validFor:Yt}}if(r.name=="AtKeyword")return{from:r.from,options:Ey,validFor:Yt};if(!e.explicit)return null;let o=r.resolve(n),l=o.childBefore(n);return l&&l.name==":"&&o.name=="PseudoClassSelector"?{from:n,options:Qm,validFor:Yt}:l&&l.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:n,options:Sm,validFor:Yt}:o.name=="Block"||o.name=="Styles"?{from:n,options:JO(),validFor:Yt}:null},Iy=Dy(i=>i.name=="VariableName"),Qr=me.define({name:"css",parser:gm.configure({props:[fe.add({Declaration:nt()}),ue.add({"Block KeyframeList":rt})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function $o(){return new Oe(Qr,Qr.data.of({autocomplete:Iy}))}var By=55,Ny=1,Fy=56,Hy=2,Ky=57,Jy=3,bm=4,ex=5,rh=6,Rm=7,Zm=8,Wm=9,qm=10,tx=11,ix=12,nx=13,eh=58,rx=14,sx=15,ym=59,zm=21,ox=23,Cm=24,lx=25,ih=27,_m=28,ax=29,Ox=32,hx=35,cx=37,fx=38,ux=0,dx=1,px={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},mx={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},xm={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function gx(i){return i==45||i==46||i==58||i>=65&&i<=90||i==95||i>=97&&i<=122||i>=161}var wm=null,km=null,Xm=0;function nh(i,e){let t=i.pos+e;if(Xm==t&&km==i)return wm;let n=i.peek(e),r="";for(;gx(n);)r+=String.fromCharCode(n),n=i.peek(++e);return km=i,Xm=t,wm=r?r.toLowerCase():n==Qx||n==Sx?void 0:null}var Ym=60,bo=62,sh=47,Qx=63,Sx=33,Px=45;function vm(i,e){this.name=i,this.parent=e}var $x=[rh,qm,Rm,Zm,Wm],bx=new lt({start:null,shift(i,e,t,n){return $x.indexOf(e)>-1?new vm(nh(n,1)||"",i):i},reduce(i,e){return e==zm&&i?i.parent:i},reuse(i,e,t,n){let r=e.type.id;return r==rh||r==cx?new vm(nh(n,1)||"",i):i},strict:!1}),yx=new U((i,e)=>{if(i.next!=Ym){i.next<0&&e.context&&i.acceptToken(eh);return}i.advance();let t=i.next==sh;t&&i.advance();let n=nh(i,0);if(n===void 0)return;if(!n)return i.acceptToken(t?sx:rx);let r=e.context?e.context.name:null;if(t){if(n==r)return i.acceptToken(tx);if(r&&mx[r])return i.acceptToken(eh,-2);if(e.dialectEnabled(ux))return i.acceptToken(ix);for(let s=e.context;s;s=s.parent)if(s.name==n)return;i.acceptToken(nx)}else{if(n=="script")return i.acceptToken(Rm);if(n=="style")return i.acceptToken(Zm);if(n=="textarea")return i.acceptToken(Wm);if(px.hasOwnProperty(n))return i.acceptToken(qm);r&&xm[r]&&xm[r][n]?i.acceptToken(eh,-1):i.acceptToken(rh)}},{contextual:!0}),xx=new U(i=>{for(let e=0,t=0;;t++){if(i.next<0){t&&i.acceptToken(ym);break}if(i.next==Px)e++;else if(i.next==bo&&e>=2){t>=3&&i.acceptToken(ym,-2);break}else e=0;i.advance()}});function wx(i){for(;i;i=i.parent)if(i.name=="svg"||i.name=="math")return!0;return!1}var kx=new U((i,e)=>{if(i.next==sh&&i.peek(1)==bo){let t=e.dialectEnabled(dx)||wx(e.context);i.acceptToken(t?ex:bm,2)}else i.next==bo&&i.acceptToken(bm,1)});function oh(i,e,t){let n=2+i.length;return new U(r=>{for(let s=0,o=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(e);break}if(s==0&&r.next==Ym||s==1&&r.next==sh||s>=2&&so?r.acceptToken(e,-o):r.acceptToken(t,-(o-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(e,1);break}else s=o=0;r.advance()}})}var Xx=oh("script",By,Ny),vx=oh("style",Fy,Hy),Tx=oh("textarea",Ky,Jy),Rx=le({"Text RawText IncompleteTag IncompleteCloseTag":d.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":d.angleBracket,TagName:d.tagName,"MismatchedCloseTag/TagName":[d.tagName,d.invalid],AttributeName:d.attributeName,"AttributeValue UnquotedAttributeValue":d.attributeValue,Is:d.definitionOperator,"EntityReference CharacterReference":d.character,Comment:d.blockComment,ProcessingInst:d.processingInstruction,DoctypeDecl:d.documentMeta}),Vm=de.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#t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OXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"\u26A0 StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:bx,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[Rx],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?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);if(O==zm&&s.length){let h=l.node,c=h.firstChild,f=c&&Tm(c,a),u;if(f){for(let p of s)if(p.tag==f&&(!p.attrs||p.attrs(u||(u=Am(c,a))))){let m=h.lastChild,g=m.type.id==fx?m.from:h.to;if(g>c.to)return{parser:p.parser,overlay:[{from:c.to,to:g}]}}}}if(o&&O==Cm){let h=l.node,c;if(c=h.firstChild){let f=o[a.read(c.from,c.to)];if(f)for(let u of f){if(u.tagName&&u.tagName!=Tm(h.parent,a))continue;let p=h.lastChild;if(p.type.id==ih){let m=p.from+1,g=p.lastChild,Q=p.to-(g&&g.isError?0:1);if(Q>m)return{parser:u.parser,overlay:[{from:m,to:Q}],bracketed:!0}}else if(p.type.id==_m)return{parser:u.parser,overlay:[{from:p.from,to:p.to}]}}}}return null})}var Zx=316,Wx=317,jm=1,qx=2,zx=3,Cx=4,_x=318,Yx=320,Vx=321,Ax=5,jx=6,Ex=0,Oh=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Em=125,Mx=59,hh=47,Ux=42,Gx=43,Lx=45,Dx=60,Ix=44,Bx=63,Nx=46,Fx=91,Hx=new lt({start:!1,shift(i,e){return e==Ax||e==jx||e==Yx?i:e==Vx},strict:!1}),Kx=new U((i,e)=>{let{next:t}=i;(t==Em||t==-1||e.context)&&i.acceptToken(_x)},{contextual:!0,fallback:!0}),Jx=new U((i,e)=>{let{next:t}=i,n;Oh.indexOf(t)>-1||t==hh&&((n=i.peek(1))==hh||n==Ux)||t!=Em&&t!=Mx&&t!=-1&&!e.context&&i.acceptToken(Zx)},{contextual:!0}),ew=new U((i,e)=>{i.next==Fx&&!e.context&&i.acceptToken(Wx)},{contextual:!0}),tw=new U((i,e)=>{let{next:t}=i;if(t==Gx||t==Lx){if(i.advance(),t==i.next){i.advance();let n=!e.context&&e.canShift(jm);i.acceptToken(n?jm:qx)}}else t==Bx&&i.peek(1)==Nx&&(i.advance(),i.advance(),(i.next<48||i.next>57)&&i.acceptToken(zx))},{contextual:!0});function ah(i,e){return i>=65&&i<=90||i>=97&&i<=122||i==95||i>=192||!e&&i>=48&&i<=57}var iw=new U((i,e)=>{if(i.next!=Dx||!e.dialectEnabled(Ex)||(i.advance(),i.next==hh))return;let t=0;for(;Oh.indexOf(i.next)>-1;)i.advance(),t++;if(ah(i.next,!0)){for(i.advance(),t++;ah(i.next,!1);)i.advance(),t++;for(;Oh.indexOf(i.next)>-1;)i.advance(),t++;if(i.next==Ix)return;for(let n=0;;n++){if(n==7){if(!ah(i.next,!0))return;break}if(i.next!="extends".charCodeAt(n))break;i.advance(),t++}}i.acceptToken(Cx,-t)}),nw=le({"get set async static":d.modifier,"for while do if else switch try catch finally return throw break continue default case defer":d.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":d.operatorKeyword,"let var const using function class extends":d.definitionKeyword,"import export from":d.moduleKeyword,"with debugger new":d.keyword,TemplateString:d.special(d.string),super:d.atom,BooleanLiteral:d.bool,this:d.self,null:d.null,Star:d.modifier,VariableName:d.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":d.function(d.variableName),VariableDefinition:d.definition(d.variableName),Label:d.labelName,PropertyName:d.propertyName,PrivatePropertyName:d.special(d.propertyName),"CallExpression/MemberExpression/PropertyName":d.function(d.propertyName),"FunctionDeclaration/VariableDefinition":d.function(d.definition(d.variableName)),"ClassDeclaration/VariableDefinition":d.definition(d.className),"NewExpression/VariableName":d.className,PropertyDefinition:d.definition(d.propertyName),PrivatePropertyDefinition:d.definition(d.special(d.propertyName)),UpdateOp:d.updateOperator,"LineComment Hashbang":d.lineComment,BlockComment:d.blockComment,Number:d.number,String:d.string,Escape:d.escape,ArithOp:d.arithmeticOperator,LogicOp:d.logicOperator,BitOp:d.bitwiseOperator,CompareOp:d.compareOperator,RegExp:d.regexp,Equals:d.definitionOperator,Arrow:d.function(d.punctuation),": Spread":d.punctuation,"( )":d.paren,"[ ]":d.squareBracket,"{ }":d.brace,"InterpolationStart InterpolationEnd":d.special(d.brace),".":d.derefOperator,", ;":d.separator,"@":d.meta,TypeName:d.typeName,TypeDefinition:d.definition(d.typeName),"type enum interface implements namespace module declare":d.definitionKeyword,"abstract global Privacy readonly override":d.modifier,"is keyof unique infer asserts":d.operatorKeyword,JSXAttributeValue:d.attributeValue,JSXText:d.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":d.angleBracket,"JSXIdentifier JSXNameSpacedName":d.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":d.attributeName,"JSXBuiltin/JSXIdentifier":d.standard(d.tagName)}),rw={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},sw={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},ow={__proto__:null,"<":193},Mm=de.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q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m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:Hx,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[nw],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_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term:95,get:i=>ow[i]||-1}],tokenPrec:15201});var Dm=[ne("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),ne("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),ne("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),ne("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),ne("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),ne(`try { + \${} +} catch (\${error}) { + \${} +}`,{label:"try",detail:"/ catch block",type:"keyword"}),ne("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),ne(`if (\${}) { + \${} +} else { + \${} +}`,{label:"if",detail:"/ else block",type:"keyword"}),ne(`class \${name} { + constructor(\${params}) { + \${} + } +}`,{label:"class",detail:"definition",type:"keyword"}),ne('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),ne('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],lw=Dm.concat([ne("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),ne("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),ne("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Um=new Kt,Im=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Sr(i){return(e,t)=>{let n=e.node.getChild("VariableDefinition");return n&&t(n,i),!0}}var aw=["FunctionDeclaration"],Ow={FunctionDeclaration:Sr("function"),ClassDeclaration:Sr("class"),ClassExpression:()=>!0,EnumDeclaration:Sr("constant"),TypeAliasDeclaration:Sr("type"),NamespaceDeclaration:Sr("namespace"),VariableDefinition(i,e){i.matchContext(aw)||e(i,"variable")},TypeDefinition(i,e){e(i,"type")},__proto__:null};function Bm(i,e){let t=Um.get(e);if(t)return t;let n=[],r=!0;function s(o,l){let a=i.sliceString(o.from,o.to);n.push({label:a,type:l})}return e.cursor(E.IncludeAnonymous).iterate(o=>{if(r)r=!1;else if(o.name){let l=Ow[o.name];if(l&&l(o,s)||Im.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of Bm(i,o.node))n.push(l);return!1}}),Um.set(e,n),n}var Gm=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Nm=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function hw(i){let e=V(i.state).resolveInner(i.pos,-1);if(Nm.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&Gm.test(i.state.sliceDoc(e.from,e.to));if(!t&&!i.explicit)return null;let n=[];for(let r=e;r;r=r.parent)Im.has(r.name)&&(n=n.concat(Bm(i.state.doc,r)));return{options:n,from:t?e.from:i.pos,validFor:Gm}}var mt=me.define({name:"javascript",parser:Mm.configure({props:[fe.add({IfStatement:nt({except:/^\s*({|else\b)/}),TryStatement:nt({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:fd,SwitchBody:i=>{let e=i.textAfter,t=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return i.baseIndent+(t?0:n?1:2)*i.unit},Block:zt({closing:"}"}),ArrowFunction:i=>i.baseIndent+i.unit,"TemplateString BlockComment":()=>null,"Statement Property":nt({except:/^\s*{/}),JSXElement(i){let e=/^\s*<\//.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},JSXEscape(i){let e=/\s*\}/.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},"JSXOpenTag JSXSelfClosingTag"(i){return i.column(i.node.from)+i.unit}}),ue.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":rt,BlockComment(i){return{from:i.from+2,to:i.to-2}},JSXElement(i){let e=i.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let t=i.lastChild;return{from:e.to,to:t.type.isError?i.to:t.from}},"JSXSelfClosingTag JSXOpenTag"(i){var e;let t=(e=i.firstChild)===null||e===void 0?void 0:e.nextSibling,n=i.lastChild;return!t||t.type.isError?null:{from:t.to,to:n.type.isError?i.to:n.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Fm={test:i=>/^JSX/.test(i.name),facet:ln({commentTokens:{block:{open:"{/*",close:"*/}"}}})},ch=mt.configure({dialect:"ts"},"typescript"),fh=mt.configure({dialect:"jsx",props:[Es.add(i=>i.isTop?[Fm]:void 0)]}),uh=mt.configure({dialect:"jsx ts",props:[Es.add(i=>i.isTop?[Fm]:void 0)]},"typescript"),Hm=i=>({label:i,type:"keyword"}),Km="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(Hm),cw=Km.concat(["declare","implements","private","protected","public"].map(Hm));function Pr(i={}){let e=i.jsx?i.typescript?uh:fh:i.typescript?ch:mt,t=i.typescript?lw.concat(cw):Dm.concat(Km);return new Oe(e,[mt.data.of({autocomplete:uo(Nm,fr(t))}),mt.data.of({autocomplete:hw}),i.jsx?dw:[]])}function fw(i){for(;;){if(i.name=="JSXOpenTag"||i.name=="JSXSelfClosingTag"||i.name=="JSXFragmentTag")return i;if(i.name=="JSXEscape"||!i.parent)return null;i=i.parent}}function Lm(i,e,t=i.length){for(let n=e?.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return i.sliceString(n.from,Math.min(n.to,t));return""}var uw=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),dw=y.inputHandler.of((i,e,t,n,r)=>{if((uw?i.composing:i.compositionStarted)||i.state.readOnly||e!=t||n!=">"&&n!="/"||!mt.isActiveAt(i.state,e,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(a=>{var O;let{head:h}=a,c=V(o).resolveInner(h-1,-1),f;if(c.name=="JSXStartTag"&&(c=c.parent),!(o.doc.sliceString(h-1,h)!=n||c.name=="JSXAttributeValue"&&c.to>h)){if(n==">"&&c.name=="JSXFragmentTag")return{range:a,changes:{from:h,insert:""}};if(n=="/"&&c.name=="JSXStartCloseTag"){let u=c.parent,p=u.parent;if(p&&u.from==h-2&&((f=Lm(o.doc,p.firstChild,h))||((O=p.firstChild)===null||O===void 0?void 0:O.name)=="JSXFragmentTag")){let m=`${f}>`;return{range:P.cursor(h+m.length,-1),changes:{from:h,insert:m}}}}else if(n==">"){let u=fw(c);if(u&&u.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(h,h+2))&&(f=Lm(o.doc,u,h)))return{range:a,changes:{from:h,insert:``}}}}return{range:a}});return l.changes.empty?!1:(i.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});var $r=["_blank","_self","_top","_parent"],dh=["ascii","utf-8","utf-16","latin1","latin1"],ph=["get","post","put","delete"],mh=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Ne=["true","false"],W={},pw={a:{attrs:{href:null,ping:null,type:null,media:null,target:$r,hreflang:null}},abbr:W,address:W,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:W,aside:W,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:W,base:{attrs:{href:null,target:$r}},bdi:W,bdo:W,blockquote:{attrs:{cite:null}},body:W,br:W,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:mh,formmethod:ph,formnovalidate:["novalidate"],formtarget:$r,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:W,center:W,cite:W,code:W,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:W,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:W,div:W,dl:W,dt:W,em:W,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:W,figure:W,footer:W,form:{attrs:{action:null,name:null,"accept-charset":dh,autocomplete:["on","off"],enctype:mh,method:ph,novalidate:["novalidate"],target:$r}},h1:W,h2:W,h3:W,h4:W,h5:W,h6:W,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:W,hgroup:W,hr:W,html:{attrs:{manifest:null}},i:W,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:mh,formmethod:ph,formnovalidate:["novalidate"],formtarget:$r,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:W,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:W,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:W,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:dh,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:W,noscript:W,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:W,param:{attrs:{name:null,value:null}},pre:W,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:W,rt:W,ruby:W,samp:W,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:dh}},section:W,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:W,source:{attrs:{src:null,type:null,media:null}},span:W,strong:W,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:W,summary:W,sup:W,table:W,tbody:W,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:W,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:W,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:W,time:{attrs:{datetime:null}},title:W,tr:W,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:W,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:W},ig={accesskey:null,class:null,contenteditable:Ne,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Ne,autocorrect:Ne,autocapitalize:Ne,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Ne,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Ne,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Ne,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Ne,"aria-hidden":Ne,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Ne,"aria-multiselectable":Ne,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Ne,"aria-relevant":null,"aria-required":Ne,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},ng="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(i=>"on"+i);for(let i of ng)ig[i]=null;var zi=class{constructor(e,t){this.tags={...pw,...e},this.globalAttrs={...ig,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};zi.default=new zi;function mn(i,e,t=i.length){if(!e)return"";let n=e.firstChild,r=n&&n.getChild("TagName");return r?i.sliceString(r.from,Math.min(r.to,t)):""}function gn(i,e=!1){for(;i;i=i.parent)if(i.name=="Element")if(e)e=!1;else return i;return null}function rg(i,e,t){let n=t.tags[mn(i,gn(e))];return n?.children||t.allTags}function gh(i,e){let t=[];for(let n=gn(e);n&&!n.type.isTop;n=gn(n.parent)){let r=mn(i,n);if(r&&n.lastChild.name=="CloseTag")break;r&&t.indexOf(r)<0&&(e.name=="EndTag"||e.from>=n.firstChild.to)&&t.push(r)}return t}var sg=/^[:\-\.\w\u00b7-\uffff]*$/;function Jm(i,e,t,n,r){let s=/\s*>/.test(i.sliceDoc(r,r+5))?"":">",o=gn(t,t.name=="StartTag"||t.name=="TagName");return{from:n,to:r,options:rg(i.doc,o,e).map(l=>({label:l,type:"type"})).concat(gh(i.doc,t).map((l,a)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-a}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function eg(i,e,t,n){let r=/\s*>/.test(i.sliceDoc(n,n+5))?"":">";return{from:t,to:n,options:gh(i.doc,e).map((s,o)=>({label:s,apply:s+r,type:"type",boost:99-o})),validFor:sg}}function mw(i,e,t,n){let r=[],s=0;for(let o of rg(i.doc,t,e))r.push({label:"<"+o,type:"type"});for(let o of gh(i.doc,t))r.push({label:"",type:"type",boost:99-s++});return{from:n,to:n,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function gw(i,e,t,n,r){let s=gn(t),o=s?e.tags[mn(i.doc,s)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],a=o&&o.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:n,to:r,options:a.map(O=>({label:O,type:"property"})),validFor:sg}}function Qw(i,e,t,n,r){var s;let o=(s=t.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],a;if(o){let O=i.sliceDoc(o.from,o.to),h=e.globalAttrs[O];if(!h){let c=gn(t),f=c?e.tags[mn(i.doc,c)]:null;h=f?.attrs&&f.attrs[O]}if(h){let c=i.sliceDoc(n,r).toLowerCase(),f='"',u='"';/^['"]/.test(c)?(a=c[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",u=i.sliceDoc(r,r+1)==c[0]?"":c[0],c=c.slice(1),n++):a=/^[^\s<>='"]*$/;for(let p of h)l.push({label:p,apply:f+p+u,type:"constant"})}}return{from:n,to:r,options:l,validFor:a}}function og(i,e){let{state:t,pos:n}=e,r=V(t).resolveInner(n,-1),s=r.resolve(n);for(let o=n,l;s==r&&(l=r.childBefore(o));){let a=l.lastChild;if(!a||!a.type.isError||a.fromog(n,r)}var Pw=mt.parser.configure({top:"SingleExpression"}),ag=[{tag:"script",attrs:i=>i.type=="text/typescript"||i.lang=="ts",parser:ch.parser},{tag:"script",attrs:i=>i.type=="text/babel"||i.type=="text/jsx",parser:fh.parser},{tag:"script",attrs:i=>i.type=="text/typescript-jsx",parser:uh.parser},{tag:"script",attrs(i){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(i.type)},parser:Pw},{tag:"script",attrs(i){return!i.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(i.type)},parser:mt.parser},{tag:"style",attrs(i){return(!i.lang||i.lang=="css")&&(!i.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(i.type))},parser:Qr.parser}],Og=[{name:"style",parser:Qr.parser.configure({top:"Styles"})}].concat(ng.map(i=>({name:i,parser:mt.parser}))),hg=me.define({name:"html",parser:Vm.configure({props:[fe.add({Element(i){let e=/^(\s*)(<\/)?/.exec(i.textAfter);return i.node.to<=i.pos+e[0].length?i.continue():i.lineIndent(i.node.from)+(e[2]?0:i.unit)},"OpenTag CloseTag SelfClosingTag"(i){return i.column(i.node.from)+i.unit},Document(i){if(i.pos+/\s*/.exec(i.textAfter)[0].lengthi.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),yo=hg.configure({wrap:lh(ag,Og)});function xo(i={}){let e="",t;i.matchClosingTags===!1&&(e="noMatch"),i.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(i.nestedLanguages&&i.nestedLanguages.length||i.nestedAttributes&&i.nestedAttributes.length)&&(t=lh((i.nestedLanguages||[]).concat(ag),(i.nestedAttributes||[]).concat(Og)));let n=t?hg.configure({wrap:t,dialect:e}):e?yo.configure({dialect:e}):yo;return new Oe(n,[yo.data.of({autocomplete:Sw(i)}),i.autoCloseTags!==!1?$w:[],Pr().support,$o().support])}var tg=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),$w=y.inputHandler.of((i,e,t,n,r)=>{if(i.composing||i.state.readOnly||e!=t||n!=">"&&n!="/"||!yo.isActiveAt(i.state,e,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(a=>{var O,h,c;let f=o.doc.sliceString(a.from-1,a.to)==n,{head:u}=a,p=V(o).resolveInner(u,-1),m;if(f&&n==">"&&p.name=="EndTag"){let g=p.parent;if(((h=(O=g.parent)===null||O===void 0?void 0:O.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(m=mn(o.doc,g.parent,u))&&!tg.has(m)){let Q=u+(o.doc.sliceString(u,u+1)===">"?1:0),S=``;return{range:a,changes:{from:u,to:Q,insert:S}}}}else if(f&&n=="/"&&p.name=="IncompleteCloseTag"){let g=p.parent;if(p.from==u-2&&((c=g.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(m=mn(o.doc,g,u))&&!tg.has(m)){let Q=u+(o.doc.sliceString(u,u+1)===">"?1:0),S=`${m}>`;return{range:P.cursor(u+S.length,-1),changes:{from:u,to:Q,insert:S}}}}return{range:a}});return l.changes.empty?!1:(i.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});var bw=le({String:d.string,Number:d.number,"True False":d.bool,PropertyName:d.propertyName,Null:d.null,", :":d.separator,"[ ]":d.squareBracket,"{ }":d.brace}),cg=de.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:"\u26A0 JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[bw],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});var yw=me.define({name:"json",parser:cg.configure({props:[fe.add({Object:nt({except:/^\s*\}/}),Array:nt({except:/^\s*\]/})}),ue.add({"Object Array":rt})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function fg(){return new Oe(yw)}var Xo=class i{static create(e,t,n,r,s){let o=r+(r<<8)+e+(t<<4)|0;return new i(e,t,n,o,s,[],[])}constructor(e,t,n,r,s,o,l){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=s,this.children=o,this.positions=l,this.hashProp=[[q.contextHash,r]]}addChild(e,t){e.prop(q.contextHash)!=this.hash&&(e=new Y(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new Y(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(r,s,o)=>new Y(oe.none,r,s,o,this.hashProp)})}},x;(function(i){i[i.Document=1]="Document",i[i.CodeBlock=2]="CodeBlock",i[i.FencedCode=3]="FencedCode",i[i.Blockquote=4]="Blockquote",i[i.HorizontalRule=5]="HorizontalRule",i[i.BulletList=6]="BulletList",i[i.OrderedList=7]="OrderedList",i[i.ListItem=8]="ListItem",i[i.ATXHeading1=9]="ATXHeading1",i[i.ATXHeading2=10]="ATXHeading2",i[i.ATXHeading3=11]="ATXHeading3",i[i.ATXHeading4=12]="ATXHeading4",i[i.ATXHeading5=13]="ATXHeading5",i[i.ATXHeading6=14]="ATXHeading6",i[i.SetextHeading1=15]="SetextHeading1",i[i.SetextHeading2=16]="SetextHeading2",i[i.HTMLBlock=17]="HTMLBlock",i[i.LinkReference=18]="LinkReference",i[i.Paragraph=19]="Paragraph",i[i.CommentBlock=20]="CommentBlock",i[i.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",i[i.Escape=22]="Escape",i[i.Entity=23]="Entity",i[i.HardBreak=24]="HardBreak",i[i.Emphasis=25]="Emphasis",i[i.StrongEmphasis=26]="StrongEmphasis",i[i.Link=27]="Link",i[i.Image=28]="Image",i[i.InlineCode=29]="InlineCode",i[i.HTMLTag=30]="HTMLTag",i[i.Comment=31]="Comment",i[i.ProcessingInstruction=32]="ProcessingInstruction",i[i.Autolink=33]="Autolink",i[i.HeaderMark=34]="HeaderMark",i[i.QuoteMark=35]="QuoteMark",i[i.ListMark=36]="ListMark",i[i.LinkMark=37]="LinkMark",i[i.EmphasisMark=38]="EmphasisMark",i[i.CodeMark=39]="CodeMark",i[i.CodeText=40]="CodeText",i[i.CodeInfo=41]="CodeInfo",i[i.LinkTitle=42]="LinkTitle",i[i.LinkLabel=43]="LinkLabel",i[i.URL=44]="URL"})(x||(x={}));var Ph=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},$h=class{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return yr(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r=e.stack[t.depth+1].value+t.baseIndent)return!0;if(t.indent>=t.baseIndent+4)return!1;let n=(i.type==x.OrderedList?qh:Wh)(t,e,!1);return n>0&&(i.type!=x.BulletList||Zh(t,e,!1)<0)&&t.text.charCodeAt(t.pos+n-1)==i.value}var xg={[x.Blockquote](i,e,t){return t.next!=62?!1:(t.markers.push(D(x.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1)),t.moveBase(t.pos+(at(t.text.charCodeAt(t.pos+1))?2:1)),i.end=e.lineStart+t.text.length,!0)},[x.ListItem](i,e,t){return t.indent-1?!1:(t.moveBaseColumn(t.baseIndent+i.value),!0)},[x.OrderedList]:ug,[x.BulletList]:ug,[x.Document](){return!0}};function at(i){return i==32||i==9||i==10||i==13}function yr(i,e=0){for(;et&&at(i.charCodeAt(e-1));)e--;return e}function wg(i){if(i.next!=96&&i.next!=126)return-1;let e=i.pos+1;for(;e-1&&i.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(qg.SetextHeading)>-1||n<3?-1:1}function Xg(i,e){for(let t=i.stack.length-1;t>=0;t--)if(i.stack[t].type==e)return!0;return!1}function Wh(i,e,t){return(i.next==45||i.next==43||i.next==42)&&(i.pos==i.text.length-1||at(i.text.charCodeAt(i.pos+1)))&&(!t||Xg(e,x.BulletList)||i.skipSpace(i.pos+2)=48&&r<=57;){n++;if(n==i.text.length)return-1;r=i.text.charCodeAt(n)}return n==i.pos||n>i.pos+9||r!=46&&r!=41||ni.pos+1||i.next!=49)?-1:n+1-i.pos}function vg(i){if(i.next!=35)return-1;let e=i.pos+1;for(;e6?-1:t}function Tg(i){if(i.next!=45&&i.next!=61||i.indent>=i.baseIndent+4)return-1;let e=i.pos+1;for(;e/,Zg=/\?>/,yh=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(n);if(s)return i.append(D(x.Comment,t,t+1+s[0].length));let o=/^\?[^]*?\?>/.exec(n);if(o)return i.append(D(x.ProcessingInstruction,t,t+1+o[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(n);return l?i.append(D(x.HTMLTag,t,t+1+l[0].length)):-1},Emphasis(i,e,t){if(e!=95&&e!=42)return-1;let n=t+1;for(;i.char(n)==e;)n++;let r=i.slice(t-1,t),s=i.slice(n,n+1),o=kr.test(r),l=kr.test(s),a=/\s|^$/.test(r),O=/\s|^$/.test(s),h=!O&&(!l||a||o),c=!a&&(!o||O||l),f=h&&(e==42||!c||o),u=c&&(e==42||!h||l);return i.append(new We(e==95?_g:Yg,t,n,(f?1:0)|(u?2:0)))},HardBreak(i,e,t){if(e==92&&i.char(t+1)==10)return i.append(D(x.HardBreak,t,t+2));if(e==32){let n=t+1;for(;i.char(n)==32;)n++;if(i.char(n)==10&&n>=t+2)return i.append(D(x.HardBreak,t,n+1))}return-1},Link(i,e,t){return e==91?i.append(new We(Ci,t,t+1,1)):-1},Image(i,e,t){return e==33&&i.char(t+1)==91?i.append(new We(Ro,t,t+2,1)):-1},LinkEnd(i,e,t){if(e!=93)return-1;for(let n=i.parts.length-1;n>=0;n--){let r=i.parts[n];if(r instanceof We&&(r.type==Ci||r.type==Ro)){if(!r.side||i.skipSpace(r.to)==t&&!/[(\[]/.test(i.slice(t+1,t+2)))return i.parts[n]=null,-1;let s=i.takeContent(n),o=i.parts[n]=kw(i,s,r.type==Ci?x.Link:x.Image,r.from,t+1);if(r.type==Ci)for(let l=0;le?D(x.URL,e+t,s+t):s==i.length?null:!1}}function Ag(i,e,t){let n=i.charCodeAt(e);if(n!=39&&n!=34&&n!=40)return!1;let r=n==40?41:n;for(let s=e+1,o=!1;s=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,s){return this.append(new We(e,t,n,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof We&&(t.type==Ci||t.type==Ro))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let n=e;n=e;a--){let m=this.parts[a];if(m instanceof We&&m.side&1&&m.type==r.type&&!(s&&(r.side&1||m.side&2)&&(m.to-m.from+o)%3==0&&((m.to-m.from)%3||o%3))){l=m;break}}if(!l)continue;let O=r.type.resolve,h=[],c=l.from,f=r.to;if(s){let m=Math.min(2,l.to-l.from,o);c=l.to-m,f=r.from+m,O=m==1?"Emphasis":"StrongEmphasis"}l.type.mark&&h.push(this.elt(l.type.mark,c,l.to));for(let m=a+1;m=0;t--){let n=this.parts[t];if(n instanceof We&&n.type==e&&n.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof We?t:null}skipSpace(e){return yr(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e=="string"?D(this.parser.getNodeType(e),t,n,r):new To(e,t)}};Xr.linkStart=Ci;Xr.imageStart=Ro;function vh(i,e){if(!e.length)return i;if(!i.length)return e;let t=i.slice(),n=0;for(let r of e){for(;n(e?e-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=` +`;)s--;this.fragmentEnd=s?s-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(q.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,l=e.block.children.length,a=o,O=l;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let h=Eg(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,h);else{let c=new Y(e.parser.nodeSet.types[x.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(c,t.tree),e.addNode(c,h)}if(t.type.is("Block")&&(Xw.indexOf(t.type.id)<0?(o=t.to-n,l=e.block.children.length):(o=a,l=O),a=t.to-n,O=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>l;)e.block.children.pop(),e.block.positions.pop();return o-s}};function Eg(i,e){let t=i;for(let n=1;nwo[i]),Object.keys(wo).map(i=>qg[i]),Object.keys(wo),xw,xg,Object.keys(Sh).map(i=>Sh[i]),Object.keys(Sh),[]);function Tw(i,e,t){let n=[];for(let r=i.firstChild,s=e;;r=r.nextSibling){let o=r?r.from:t;if(o>s&&n.push({from:s,to:o}),!r)break;s=r.to}return n}function Ug(i){let{codeParser:e,htmlParser:t}=i;return{wrap:Bn((r,s)=>{let o=r.type.id;if(e&&(o==x.CodeBlock||o==x.FencedCode)){let l="";if(o==x.FencedCode){let O=r.node.getChild(x.CodeInfo);O&&(l=s.read(O.from,O.to))}let a=e(l);if(a)return{parser:a,overlay:O=>O.type.id==x.CodeText,bracketed:o==x.FencedCode}}else if(t&&(o==x.HTMLBlock||o==x.HTMLTag||o==x.CommentBlock))return{parser:t,overlay:Tw(r.node,r.from,r.to)};return null})}}var Rw={resolve:"Strikethrough",mark:"StrikethroughMark"},Zw={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":d.strikethrough}},{name:"StrikethroughMark",style:d.processingInstruction}],parseInline:[{name:"Strikethrough",parse(i,e,t){if(e!=126||i.char(t+1)!=126||i.char(t+2)==126)return-1;let n=i.slice(t-1,t),r=i.slice(t+2,t+3),s=/\s|^$/.test(n),o=/\s|^$/.test(r),l=kr.test(n),a=kr.test(r);return i.addDelimiter(Rw,t,t+2,!o&&(!a||s||l),!s&&(!l||o||a))},after:"Emphasis"}]};function xr(i,e,t=0,n,r=0){let s=0,o=!0,l=-1,a=-1,O=!1,h=()=>{n.push(i.elt("TableCell",r+l,r+a,i.parser.parseInline(e.slice(l,a),r+l)))};for(let c=t;c-1)&&s++,o=!1,n&&(l>-1&&h(),n.push(i.elt("TableDelimiter",c+r,c+r+1))),l=a=-1):(O||f!=32&&f!=9)&&(l<0&&(l=c),a=c+1),O=!O&&f==92}return l>-1&&(s++,n&&h()),s}function gg(i,e){for(let t=e;t\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,Zo=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&Gg.test(r=t.text.slice(t.pos))){let s=[];xr(e,n.content,0,s,n.start)==xr(e,r,0)&&(this.rows=[e.elt("TableHeader",n.start,n.start+n.content.length,s),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let r=[];xr(e,t.text,t.pos,r,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+t.pos,e.lineStart+t.text.length,r))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt("Table",t.start,t.start+t.content.length,this.rows)),!0):!1}},Ww={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":d.heading}},"TableRow",{name:"TableCell",style:d.content},{name:"TableDelimiter",style:d.processingInstruction}],parseBlock:[{name:"Table",leaf(i,e){return gg(e.content,0)?new Zo:null},endLeaf(i,e,t){if(t.parsers.some(r=>r instanceof Zo)||!gg(e.text,e.basePos))return!1;let n=i.peekLine();return Gg.test(n)&&xr(i,e.text,e.basePos)==xr(i,n,e.basePos)},before:"SetextHeading"}]},Rh=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},qw={defineNodes:[{name:"Task",block:!0,style:d.list},{name:"TaskMarker",style:d.atom}],parseBlock:[{name:"TaskList",leaf(i,e){return/^\[[ xX]\][ \t]/.test(e.content)&&i.parentType().name=="ListItem"?new Rh:null},after:"SetextHeading"}]},Qg=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,Sg=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,zw=/[\w-]+\.[\w-]+($|[/:])/,Pg=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,$g=/\/[a-zA-Z\d@.]+/gy;function bg(i,e,t,n){let r=0;for(let s=e;s-1)return-1;let n=e+t[0].length;for(;;){let r=i[n-1],s;if(/[?!.,:*_~]/.test(r)||r==")"&&bg(i,e,n,")")>bg(i,e,n,"("))n--;else if(r==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(i.slice(e,n))))n=e+s.index;else break}return n}function yg(i,e){Pg.lastIndex=e;let t=Pg.exec(i);if(!t)return-1;let n=t[0][t[0].length-1];return n=="_"||n=="-"?-1:e+t[0].length-(n=="."?1:0)}var _w={parseInline:[{name:"Autolink",parse(i,e,t){let n=t-i.offset;if(n&&/\w/.test(i.text[n-1]))return-1;Qg.lastIndex=n;let r=Qg.exec(i.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=Cw(i.text,n+r[0].length),s>-1&&i.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(i.text.slice(n,s));s=n+o[0].length}}else r[3]?s=yg(i.text,n):(s=yg(i.text,n+r[0].length),s>-1&&r[0]=="xmpp:"&&($g.lastIndex=s,r=$g.exec(i.text),r&&(s=r.index+r[0].length)));return s<0?-1:(i.addElement(i.elt("URL",t,s+i.offset)),s+i.offset)}}]},Lg=[Ww,qw,Zw,_w];function Dg(i,e,t){return(n,r,s)=>{if(r!=i||n.char(s+1)==i)return-1;let o=[n.elt(t,s,s+1)];for(let l=s+1;l"}}}),Jg=new q,eQ=Mg.configure({props:[ue.add(i=>!i.is("Block")||i.is("Document")||_h(i)!=null||Yw(i)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),Jg.add(_h),fe.add({Document:()=>null}),qt.add({Document:Kg})]});function _h(i){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(i.name);return e?+e[1]:void 0}function Yw(i){return i.name=="OrderedList"||i.name=="BulletList"}function Vw(i,e){let t=i;for(;;){let n=t.nextSibling,r;if(!n||(r=_h(n.type))!=null&&r<=e)break;t=n}return t.to}var Aw=Ja.of((i,e,t)=>{for(let n=V(i).resolveInner(t,-1);n&&!(n.fromt)return{from:t,to:s}}return null});function Yh(i){return new xe(Kg,i,[],"markdown")}var jw=Yh(eQ),Ew=eQ.configure([Lg,Bg,Ig,Ng,{props:[ue.add({Table:(i,e)=>({from:e.doc.lineAt(i.from).to,to:i.to})})]}]),Wo=Yh(Ew);function Mw(i,e){return t=>{if(t&&i){let n=null;if(t=/\S*/.exec(t)[0],typeof i=="function"?n=i(t):n=Jn.matchLanguageName(i,t,!0),n instanceof Jn)return n.support?n.support.language.parser:Xi.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}var vr=class{constructor(e,t,n,r,s,o,l){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=s,this.type=o,this.item=l}blank(e,t=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;n.length0;r--)n+=" ";return n+(t?this.spaceAfter:"")}}marker(e,t){let n=this.node.name=="OrderedList"?String(+iQ(this.item,e)[2]+t):"";return this.spaceBefore+n+this.type+this.spaceAfter}};function tQ(i,e){let t=[],n=[];for(let r=i;r;r=r.parent){if(r.name=="FencedCode")return n;(r.name=="ListItem"||r.name=="Blockquote")&&t.push(r)}for(let r=t.length-1;r>=0;r--){let s=t[r],o,l=e.lineAt(s.from),a=s.from-l.from;if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(l.text.slice(a))))n.push(new vr(s,a,a+o[0].length,"",o[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(l.text.slice(a)))){let O=o[3],h=o[0].length;O.length>=4&&(O=O.slice(0,O.length-4),h-=4),n.push(new vr(s.parent,a,a+h,o[1],O,o[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(a)))){let O=o[4],h=o[0].length;O.length>4&&(O=O.slice(0,O.length-4),h-=4);let c=o[2];o[3]&&(c+=o[3].replace(/[xX]/," ")),n.push(new vr(s.parent,a,a+h,o[1],O,c,s))}}return n}function iQ(i,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(i.from,i.from+10))}function zh(i,e,t,n=0){for(let r=-1,s=i;;){if(s.name=="ListItem"){let l=iQ(s,e),a=+l[2];if(r>=0){if(a!=r+1)return;t.push({from:s.from+l[1].length,to:s.from+l[0].length,insert:String(r+2+n)})}r=a}let o=s.nextSibling;if(!o)break;s=o}}function Vh(i,e){let t=/^[ \t]*/.exec(i)[0].length;if(!t||e.facet(ni)!=" ")return i;let n=ve(i,4,t),r="";for(let s=n;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+i.slice(t)}var Uw=(i={})=>({state:e,dispatch:t})=>{let n=V(e),{doc:r}=e,s=null,o=e.changeByRange(l=>{if(!l.empty||!Wo.isActiveAt(e,l.from,-1)&&!Wo.isActiveAt(e,l.from,1))return s={range:l};let a=l.from,O=r.lineAt(a),h=tQ(n.resolveInner(a,-1),r);for(;h.length&&h[h.length-1].from>a-O.from;)h.pop();if(!h.length)return s={range:l};let c=h[h.length-1];if(c.to-c.spaceAfter.length>a-O.from)return s={range:l};let f=a>=c.to-c.spaceAfter.length&&!/\S/.test(O.text.slice(c.to));if(c.item&&f){let Q=c.node.firstChild,S=c.node.getChild("ListItem","ListItem");if(Q.to>=a||S&&S.to0&&!/[^\s>]/.test(r.lineAt(O.from-1).text)||i.nonTightLists===!1){let $=h.length>1?h[h.length-2]:null,X,b="";$&&$.item?(X=O.from+$.from,b=$.marker(r,1)):X=O.from+($?$.to:0);let w=[{from:X,to:a,insert:b}];return c.node.name=="OrderedList"&&zh(c.item,r,w,-2),$&&$.node.name=="OrderedList"&&zh($.item,r,w),{range:P.cursor(X+b.length),changes:w}}else{let $=Hg(h,e,O);return{range:P.cursor(a+$.length+1),changes:{from:O.from,insert:$+e.lineBreak}}}}if(c.node.name=="Blockquote"&&f&&O.from){let Q=r.lineAt(O.from-1),S=/>\s*$/.exec(Q.text);if(S&&S.index==c.from){let $=e.changes([{from:Q.from+S.index,to:Q.to},{from:O.from+c.from,to:O.to}]);return{range:l.map($),changes:$}}}let u=[];c.node.name=="OrderedList"&&zh(c.item,r,u);let p=c.item&&c.item.from]*/.exec(O.text)[0].length>=c.to)for(let Q=0,S=h.length-1;Q<=S;Q++)m+=Q==S&&!p?h[Q].marker(r,1):h[Q].blank(QO.from&&/\s/.test(O.text.charAt(g-O.from-1));)g--;return m=Vh(m,e),Lw(c.node,e.doc)&&(m=Hg(h,e,O)+e.lineBreak+m),u.push({from:g,to:a,insert:e.lineBreak+m}),{range:P.cursor(g+m.length+1),changes:u}});return s?!1:(t(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},Gw=Uw();function Fg(i){return i.name=="QuoteMark"||i.name=="ListMark"}function Lw(i,e){if(i.name!="OrderedList"&&i.name!="BulletList")return!1;let t=i.firstChild,n=i.getChild("ListItem","ListItem");if(!n)return!1;let r=e.lineAt(t.to),s=e.lineAt(n.from),o=/^[\s>]*$/.test(r.text);return r.number+(o?0:1){let t=V(i),n=null,r=i.changeByRange(s=>{let o=s.from,{doc:l}=i;if(s.empty&&Wo.isActiveAt(i,s.from)){let a=l.lineAt(o),O=tQ(Dw(t,o),l);if(O.length){let h=O[O.length-1],c=h.to-h.spaceAfter.length+(h.spaceAfter?1:0);if(o-a.from>c&&!/\S/.test(a.text.slice(c,o-a.from)))return{range:P.cursor(a.from+c),changes:{from:a.from+c,to:o}};if(o-a.from==c&&(h.item&&a.from<=h.item.from||/^[\s>]*$/.test(a.text.slice(0,h.to)))){let f=a.from+h.from;if(h.item&&h.node.from{var t;let{main:n}=e.state.selection;if(n.empty)return!1;let r=(t=i.clipboardData)===null||t===void 0?void 0:t.getData("text/plain");if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r="https://"+r),!Wo.isActiveAt(e.state,n.from,1)))return!1;let s=V(e.state),o=!1;return s.iterate({from:n.from,to:n.to,enter:l=>{(l.from>n.from||Hw.test(l.name))&&(o=!0)},leave:l=>{l.to=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102}var Kk=new U((i,e)=>{let t;if(i.next<0)i.acceptToken(ik);else if(e.context.flags&qo)Ah(i.next)&&i.acceptToken(tk,1);else if(((t=i.peek(-1))<0||Ah(t))&&e.canShift(sQ)){let n=0;for(;i.next==Mh||i.next==Co;)i.advance(),n++;(i.next==Yi||i.next==Tr||i.next==Uh)&&i.acceptToken(sQ,-n)}else Ah(i.next)&&i.acceptToken(ek,1)},{contextual:!0}),Jk=new U((i,e)=>{let t=e.context;if(t.flags)return;let n=i.peek(-1);if(n==Yi||n==Tr){let r=0,s=0;for(;;){if(i.next==Mh)r++;else if(i.next==Co)r+=8-r%8;else break;i.advance(),s++}r!=t.indent&&i.next!=Yi&&i.next!=Tr&&i.next!=Uh&&(r[i,e|mQ])),iX=new lt({start:eX,reduce(i,e,t,n){return i.flags&qo&&Hk.has(e)||(e==Sk||e==uQ)&&i.flags&mQ?i.parent:i},shift(i,e,t,n){return e==hQ?new zo(i,tX(n.read(n.pos,t.pos)),0):e==cQ?i.parent:e==sk||e==Ok||e==fk||e==fQ?new zo(i,0,qo):OQ.has(e)?new zo(i,0,OQ.get(e)|i.flags&qo):i},hash(i){return i.hash}}),nX=new U(i=>{for(let e=0;e<5;e++){if(i.next!="print".charCodeAt(e))return;i.advance()}if(!/\w/.test(String.fromCharCode(i.next)))for(let e=0;;e++){let t=i.peek(e);if(!(t==Mh||t==Co)){t!=Gk&&t!=Lk&&t!=Yi&&t!=Tr&&t!=Uh&&i.acceptToken(Jw);return}}}),rX=new U((i,e)=>{let{flags:t}=e.context,n=t&Vt?pQ:dQ,r=(t&At)>0,s=!(t&jt),o=(t&Et)>0,l=i.pos;for(;!(i.next<0);)if(o&&i.next==Eh)if(i.peek(1)==Eh)i.advance(2);else{if(i.pos==l){i.acceptToken(fQ,1);return}break}else if(s&&i.next==aQ){if(i.pos==l){i.advance();let a=i.next;a>=0&&(i.advance(),sX(i,a)),i.acceptToken(rk);return}break}else if(i.next==aQ&&!s&&i.peek(1)>-1)i.advance(2);else if(i.next==n&&(!r||i.peek(1)==n&&i.peek(2)==n)){if(i.pos==l){i.acceptToken(oQ,r?3:1);return}break}else if(i.next==Yi){if(r)i.advance();else if(i.pos==l){i.acceptToken(oQ);return}break}else i.advance();i.pos>l&&i.acceptToken(nk)});function sX(i,e){if(e==Dk)for(let t=0;t<2&&i.next>=48&&i.next<=55;t++)i.advance();else if(e==Ik)for(let t=0;t<2&&jh(i.next);t++)i.advance();else if(e==Nk)for(let t=0;t<4&&jh(i.next);t++)i.advance();else if(e==Fk)for(let t=0;t<8&&jh(i.next);t++)i.advance();else if(e==Bk&&i.next==Eh){for(i.advance();i.next>=0&&i.next!=lQ&&i.next!=dQ&&i.next!=pQ&&i.next!=Yi;)i.advance();i.next==lQ&&i.advance()}}var oX=le({'async "*" "**" FormatConversion FormatSpec':d.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":d.controlKeyword,"in not and or is del":d.operatorKeyword,"from def class global nonlocal lambda":d.definitionKeyword,import:d.moduleKeyword,"with as print":d.keyword,Boolean:d.bool,None:d.null,VariableName:d.variableName,"CallExpression/VariableName":d.function(d.variableName),"FunctionDefinition/VariableName":d.function(d.definition(d.variableName)),"ClassDefinition/VariableName":d.definition(d.className),PropertyName:d.propertyName,"CallExpression/MemberExpression/PropertyName":d.function(d.propertyName),Comment:d.lineComment,Number:d.number,String:d.string,FormatString:d.special(d.string),Escape:d.escape,UpdateOp:d.updateOperator,"ArithOp!":d.arithmeticOperator,BitOp:d.bitwiseOperator,CompareOp:d.compareOperator,AssignOp:d.definitionOperator,Ellipsis:d.punctuation,At:d.meta,"( )":d.paren,"[ ]":d.squareBracket,"{ }":d.brace,".":d.derefOperator,", ;":d.separator}),lX={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},gQ=de.deserialize({version:14,states:"##jQ`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E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&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[nX,Jk,Kk,rX,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:i=>lX[i]||-1}],tokenPrec:7668});var QQ=new Kt,PQ=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function _o(i){return(e,t,n)=>{if(n)return!1;let r=e.node.getChild("VariableName");return r&&t(r,i),!0}}var aX={FunctionDefinition:_o("function"),ClassDefinition:_o("class"),ForStatement(i,e,t){if(t){for(let n=i.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")e(n,"variable");else if(n.name=="in")break}},ImportStatement(i,e){var t,n;let{node:r}=i,s=((t=r.firstChild)===null||t===void 0?void 0:t.name)=="from";for(let o=r.getChild("import");o;o=o.nextSibling)o.name=="VariableName"&&((n=o.nextSibling)===null||n===void 0?void 0:n.name)!="as"&&e(o,s?"variable":"namespace")},AssignStatement(i,e){for(let t=i.node.firstChild;t;t=t.nextSibling)if(t.name=="VariableName")e(t,"variable");else if(t.name==":"||t.name=="AssignOp")break},ParamList(i,e){for(let t=null,n=i.node.firstChild;n;n=n.nextSibling)n.name=="VariableName"&&(!t||!/\*|AssignOp/.test(t.name))&&e(n,"variable"),t=n},CapturePattern:_o("variable"),AsPattern:_o("variable"),__proto__:null};function $Q(i,e){let t=QQ.get(e);if(t)return t;let n=[],r=!0;function s(o,l){let a=i.sliceString(o.from,o.to);n.push({label:a,type:l})}return e.cursor(E.IncludeAnonymous).iterate(o=>{if(o.name){let l=aX[o.name];if(l&&l(o,s,r)||!r&&PQ.has(o.name))return!1;r=!1}else if(o.to-o.from>8192){for(let l of $Q(i,o.node))n.push(l);return!1}}),QQ.set(e,n),n}var SQ=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,bQ=["String","FormatString","Comment","PropertyName"];function OX(i){let e=V(i.state).resolveInner(i.pos,-1);if(bQ.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&SQ.test(i.state.sliceDoc(e.from,e.to));if(!t&&!i.explicit)return null;let n=[];for(let r=e;r;r=r.parent)PQ.has(r.name)&&(n=n.concat($Q(i.state.doc,r)));return{options:n,from:t?e.from:i.pos,validFor:SQ}}var hX=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(i=>({label:i,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(i=>({label:i,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(i=>({label:i,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(i=>({label:i,type:"function"}))),cX=[ne("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),ne("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),ne("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),ne("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),ne(`if \${}: + +`,{label:"if",detail:"block",type:"keyword"}),ne("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),ne("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),ne("import ${module}",{label:"import",detail:"statement",type:"keyword"}),ne("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],fX=uo(bQ,fr(hX.concat(cX)));function Gh(i){let{node:e,pos:t}=i,n=i.lineIndent(t,-1),r=null;for(;;){let s=e.childBefore(t);if(s)if(s.name=="Comment")t=s.from;else if(s.name=="Body"||s.name=="MatchBody")i.baseIndentFor(s)+i.unit<=n&&(r=s),e=s;else if(s.name=="MatchClause")e=s;else if(s.type.is("Statement"))e=s;else break;else break}return r}function Lh(i,e){let t=i.baseIndentFor(e),n=i.lineAt(i.pos,-1),r=n.from+n.text.length;return/^\s*($|#)/.test(n.text)&&i.node.tot?null:t+i.unit}var Dh=me.define({name:"python",parser:gQ.configure({props:[fe.add({Body:i=>{var e;let t=/^\s*(#|$)/.test(i.textAfter)&&Gh(i)||i.node;return(e=Lh(i,t))!==null&&e!==void 0?e:i.continue()},MatchBody:i=>{var e;let t=Gh(i);return(e=Lh(i,t||i.node))!==null&&e!==void 0?e:i.continue()},IfStatement:i=>/^\s*(else:|elif )/.test(i.textAfter)?i.baseIndent:i.continue(),"ForStatement WhileStatement":i=>/^\s*else:/.test(i.textAfter)?i.baseIndent:i.continue(),TryStatement:i=>/^\s*(except[ :]|finally:|else:)/.test(i.textAfter)?i.baseIndent:i.continue(),MatchStatement:i=>/^\s*case /.test(i.textAfter)?i.baseIndent+i.unit:i.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":zt({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":zt({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":zt({closing:"]"}),MemberExpression:i=>i.baseIndent+i.unit,"String FormatString":()=>null,Script:i=>{var e;let t=Gh(i);return(e=t&&Lh(i,t))!==null&&e!==void 0?e:i.continue()}}),ue.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":rt,Body:(i,e)=>({from:i.from+1,to:i.to-(i.to==e.doc.length?0:1)}),"String FormatString":(i,e)=>({from:e.doc.lineAt(i.from).to,to:i.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function yQ(){return new Oe(Dh,[Dh.data.of({autocomplete:OX}),Dh.data.of({autocomplete:fX})])}var uX=1,dX=2,pX=3,mX=4,gX=5,xQ=98,QX=101,SX=102,wQ=114,PX=69,Yo=48,kQ=46,$X=43,bX=45,XQ=35,vQ=34,yX=124,xX=60,wX=62;function Ih(i){return i>=48&&i<=57}function Vo(i){return Ih(i)||i==95}var kX=new U((i,e)=>{if(Ih(i.next)){let t=!1;do i.advance();while(Vo(i.next));if(i.next==kQ){if(t=!0,i.advance(),Ih(i.next))do i.advance();while(Vo(i.next));else if(i.next==kQ||i.next>127||/\w/.test(String.fromCharCode(i.next)))return}if(i.next==QX||i.next==PX){if(t=!0,i.advance(),(i.next==$X||i.next==bX)&&i.advance(),!Vo(i.next))return;do i.advance();while(Vo(i.next))}if(i.next==SX){let n=i.peek(1);if(n==Yo+3&&i.peek(2)==Yo+2||n==Yo+6&&i.peek(2)==Yo+4)i.advance(3),t=!0;else return}t&&i.acceptToken(gX)}else if(i.next==xQ||i.next==wQ){if(i.next==xQ&&i.advance(),i.next!=wQ)return;i.advance();let t=0;for(;i.next==XQ;)t++,i.advance();if(i.next!=vQ)return;i.advance();e:for(;;){if(i.next<0)return;let n=i.next==vQ;if(i.advance(),n){for(let r=0;r{i.next==yX&&i.acceptToken(uX,1)}),vX=new U(i=>{i.next==xX?i.acceptToken(dX,1):i.next==wX&&i.acceptToken(pX,1)}),TX=le({"const macro_rules struct union enum type fn impl trait let static":d.definitionKeyword,"mod use crate":d.moduleKeyword,"pub unsafe async mut extern default move":d.modifier,"for if else loop while match continue break return await":d.controlKeyword,"as in ref":d.operatorKeyword,"where _ crate super dyn":d.keyword,self:d.self,String:d.string,Char:d.character,RawString:d.special(d.string),Boolean:d.bool,Identifier:d.variableName,"CallExpression/Identifier":d.function(d.variableName),BoundIdentifier:d.definition(d.variableName),"FunctionItem/BoundIdentifier":d.function(d.definition(d.variableName)),LoopLabel:d.labelName,FieldIdentifier:d.propertyName,"CallExpression/FieldExpression/FieldIdentifier":d.function(d.propertyName),Lifetime:d.special(d.variableName),ScopeIdentifier:d.namespace,TypeIdentifier:d.typeName,"MacroInvocation/Identifier MacroInvocation/ScopedIdentifier/Identifier":d.macroName,"MacroInvocation/TypeIdentifier MacroInvocation/ScopedIdentifier/TypeIdentifier":d.macroName,'"!"':d.macroName,UpdateOp:d.updateOperator,LineComment:d.lineComment,BlockComment:d.blockComment,Integer:d.integer,Float:d.float,ArithOp:d.arithmeticOperator,LogicOp:d.logicOperator,BitOp:d.bitwiseOperator,CompareOp:d.compareOperator,"=":d.definitionOperator,".. ... => ->":d.punctuation,"( )":d.paren,"[ ]":d.squareBracket,"{ }":d.brace,". DerefOp":d.derefOperator,"&":d.operator,", ; ::":d.separator,"Attribute/...":d.meta}),RX={__proto__:null,self:28,super:32,crate:34,impl:46,true:72,false:72,pub:88,in:92,const:96,unsafe:104,async:108,move:110,if:114,let:118,ref:142,mut:144,_:198,else:200,match:204,as:248,return:252,await:262,break:270,continue:276,while:312,loop:316,for:320,macro_rules:327,mod:334,extern:342,struct:346,where:364,union:379,enum:382,type:390,default:395,fn:396,trait:412,use:420,static:438,dyn:476},TQ=de.deserialize({version:14,states:"$2xQ]Q_OOP$wOWOOO&sQWO'#CnO)WQWO'#I`OOQP'#I`'#I`OOQQ'#Ie'#IeO)hO`O'#C}OOQR'#Ih'#IhO)sQWO'#IuOOQO'#Hk'#HkO)xQWO'#DpOOQR'#Iw'#IwO)xQWO'#DpO*ZQWO'#DpOOQO'#Iv'#IvO,SQWO'#J`O,ZQWO'#EiOOQV'#Hp'#HpO,cQYO'#F{OOQV'#El'#ElOOQV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y6p6v6x7c7r8gR0k+ZR0j+ZQ'R!qQ)c%XQ+w&|R4y1PX'Q!q%X&|1PR+y&|R+x&|T/S*S4TT/R*S4TR.o)sR.n)sR){%p",nodeNames:"\u26A0 | < > RawString Float LineComment BlockComment SourceFile ] InnerAttribute ! [ MetaItem self Metavariable super crate Identifier ScopedIdentifier :: QualifiedScope AbstractType impl SelfType MetaType TypeIdentifier ScopedTypeIdentifier ScopeIdentifier TypeArgList TypeBinding = Lifetime String Escape Char Boolean Integer } { Block ; ConstItem Vis pub ( in ) const BoundIdentifier : UnsafeBlock unsafe AsyncBlock async move IfExpression if LetDeclaration let LiteralPattern ArithOp MetaPattern SelfPattern ScopedIdentifier TuplePattern ScopedTypeIdentifier , StructPattern FieldPatternList FieldPattern ref mut FieldIdentifier .. RefPattern SlicePattern CapturedPattern ReferencePattern & MutPattern RangePattern ... OrPattern MacroPattern ParenthesizedTokens TokenBinding Identifier TokenRepetition ArithOp BitOp LogicOp UpdateOp CompareOp -> => ArithOp BracketedTokens BracedTokens _ else MatchExpression match MatchBlock MatchArm Attribute Guard UnaryExpression ArithOp DerefOp LogicOp ReferenceExpression TryExpression BinaryExpression ArithOp ArithOp BitOp BitOp BitOp BitOp LogicOp LogicOp AssignmentExpression TypeCastExpression as ReturnExpression return RangeExpression CallExpression ArgList AwaitExpression await FieldExpression GenericFunction BreakExpression break LoopLabel ContinueExpression continue IndexExpression ArrayExpression TupleExpression MacroInvocation UnitExpression ClosureExpression ParamList Parameter Parameter ParenthesizedExpression StructExpression FieldInitializerList ShorthandFieldInitializer FieldInitializer BaseFieldInitializer MatchArm WhileExpression while LoopExpression loop ForExpression for MacroInvocation MacroDefinition macro_rules MacroRule EmptyStatement ModItem mod DeclarationList AttributeItem ForeignModItem extern StructItem struct TypeParamList ConstrainedTypeParameter TraitBounds HigherRankedTraitBound RemovedTraitBound OptionalTypeParameter ConstParameter WhereClause where LifetimeClause TypeBoundClause FieldDeclarationList FieldDeclaration OrderedFieldDeclarationList UnionItem union EnumItem enum EnumVariantList EnumVariant TypeItem type FunctionItem default fn ParamList Parameter SelfParameter VariadicParameter VariadicParameter ImplItem TraitItem trait AssociatedType LetDeclaration UseDeclaration use ScopedIdentifier UseAsClause ScopedIdentifier UseList ScopedUseList UseWildcard ExternCrateDeclaration StaticItem static ExpressionStatement ExpressionStatement GenericType FunctionType ForLifetimes ParamList VariadicParameter Parameter VariadicParameter Parameter ReferenceType PointerType TupleType UnitType ArrayType MacroInvocation EmptyType DynamicType dyn BoundedType",maxTerm:359,nodeProps:[["isolate",-4,4,6,7,33,""],["group",-42,4,5,14,15,16,17,18,19,33,35,36,37,40,51,53,56,101,107,111,112,113,122,123,125,127,128,130,132,133,134,137,139,140,141,142,143,144,148,149,155,157,159,"Expression",-16,22,24,25,26,27,222,223,230,231,232,233,234,235,236,237,239,"Type",-20,42,161,162,165,166,169,170,172,188,190,194,196,204,205,207,208,209,217,218,220,"Statement",-17,49,60,62,63,64,65,68,74,75,76,77,78,80,81,83,84,99,"Pattern"],["openedBy",9,"[",38,"{",47,"("],["closedBy",12,"]",39,"}",45,")"]],propSources:[TX],skippedNodes:[0,6,7,240],repeatNodeCount:32,tokenData:"$%h_R!XOX$nXY5gYZ6iZ]$n]^5g^p$npq5gqr7Xrs9cst:Rtu;Tuv>vvwAQwxCbxy!+Tyz!,Vz{!-X{|!/_|}!0g}!O!1i!O!P!3v!P!Q!8[!Q!R!Bw!R![!Dr![!]#+q!]!^#-{!^!_#.}!_!`#1b!`!a#3o!a!b#6S!b!c#7U!c!}#8W!}#O#:T#O#P#;V#P#Q#Cb#Q#R#Dd#R#S#8W#S#T$n#T#U#8W#U#V#El#V#f#8W#f#g#Ic#g#o#8W#o#p$ S#p#q$!U#q#r$$f#r${$n${$|#8W$|4w$n4w5b#8W5b5i$n5i6S#8W6S;'S$n;'S;=`4s<%lO$nU$u]'_Q'OSOY$nYZ%nZr$nrs&[sz$nz{+O{!P$n!P!Q,z!Q#O$n#O#P&[#P;'S$n;'S;=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.define({name:"rust",parser:TQ.configure({props:[fe.add({IfExpression:nt({except:/^\s*({|else\b)/}),"String BlockComment":()=>null,AttributeItem:i=>i.continue(),"Statement MatchArm":nt()}),ue.add(i=>{if(/(Block|edTokens|List)$/.test(i.name))return rt;if(i.name=="BlockComment")return e=>({from:e.from+2,to:e.to-2})})]}),languageData:{commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:\{|\})$/,closeBrackets:{stringPrefixes:["b","r","br"]}}});function RQ(){return new Oe(ZX)}var Bh=1,WX=2,qX=3,zX=4,CX=5,_X=36,YX=37,VX=38,AX=11,jX=13;function EX(i){return i==45||i==46||i==58||i>=65&&i<=90||i==95||i>=97&&i<=122||i>=161}function MX(i){return i==9||i==10||i==13||i==32}var ZQ=null,WQ=null,qQ=0;function Nh(i,e){let t=i.pos+e;if(WQ==i&&qQ==t)return ZQ;for(;MX(i.peek(e));)e++;let n="";for(;;){let r=i.peek(e);if(!EX(r))break;n+=String.fromCharCode(r),e++}return WQ=i,qQ=t,ZQ=n||null}function zQ(i,e){this.name=i,this.parent=e}var UX=new lt({start:null,shift(i,e,t,n){return e==Bh?new zQ(Nh(n,1)||"",i):i},reduce(i,e){return e==AX&&i?i.parent:i},reuse(i,e,t,n){let r=e.type.id;return r==Bh||r==jX?new zQ(Nh(n,1)||"",i):i},strict:!1}),GX=new U((i,e)=>{if(i.next==60){if(i.advance(),i.next==47){i.advance();let t=Nh(i,0);if(!t)return i.acceptToken(CX);if(e.context&&t==e.context.name)return i.acceptToken(WX);for(let n=e.context;n;n=n.parent)if(n.name==t)return i.acceptToken(qX,-2);i.acceptToken(zX)}else if(i.next!=33&&i.next!=63)return i.acceptToken(Bh)}},{contextual:!0});function Fh(i,e){return new U(t=>{let n=0,r=e.charCodeAt(0);e:for(;!(t.next<0);t.advance(),n++)if(t.next==r){for(let s=1;s"),DX=Fh(YX,"?>"),IX=Fh(VX,"]]>"),BX=le({Text:d.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":d.angleBracket,TagName:d.tagName,"MismatchedCloseTag/TagName":[d.tagName,d.invalid],AttributeName:d.attributeName,AttributeValue:d.attributeValue,Is:d.definitionOperator,"EntityReference CharacterReference":d.character,Comment:d.blockComment,ProcessingInst:d.processingInstruction,DoctypeDecl:d.documentMeta,Cdata:d.special(d.string)}),CQ=de.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<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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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:[GX,LX,DX,IX,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function Ao(i,e){let t=e&&e.getChild("TagName");return t?i.sliceString(t.from,t.to):""}function Hh(i,e){let t=e&&e.firstChild;return!t||t.name!="OpenTag"?"":Ao(i,t)}function NX(i,e,t){let n=e&&e.getChildren("Attribute").find(s=>s.from<=t&&s.to>=t),r=n&&n.getChild("AttributeName");return r?i.sliceString(r.from,r.to):""}function Kh(i){for(let e=i&&i.parent;e;e=e.parent)if(e.name=="Element")return e;return null}function FX(i,e){var t;let n=V(i).resolveInner(e,-1),r=null;for(let s=n;!r&&s.parent;s=s.parent)(s.name=="OpenTag"||s.name=="CloseTag"||s.name=="SelfClosingTag"||s.name=="MismatchedCloseTag")&&(r=s);if(r&&(r.to>e||r.lastChild.type.isError)){let s=r.parent;if(n.name=="TagName")return r.name=="CloseTag"||r.name=="MismatchedCloseTag"?{type:"closeTag",from:n.from,context:s}:{type:"openTag",from:n.from,context:Kh(s)};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 o=n==r||n.name=="Attribute"?n.childBefore(e):n;return o?.name=="StartTag"?{type:"openTag",from:e,context:Kh(s)}:o?.name=="StartCloseTag"&&o.to<=e?{type:"closeTag",from:e,context:s}:o?.name=="Is"?{type:"attrValue",from:e,context:r}:o?{type:"attrName",from:e,context:r}:null}else if(n.name=="StartCloseTag")return{type:"closeTag",from:e,context:n.parent};for(;n.parent&&n.to==e&&!(!((t=n.lastChild)===null||t===void 0)&&t.type.isError);)n=n.parent;return n.name=="Element"||n.name=="Text"||n.name=="Document"?{type:"tag",from:e,context:n.name=="Element"?n:Kh(n)}:null}var ec=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:"",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=e.textContent?e.textContent.map(r=>({label:r,type:"text"})):[]}},Jh=/^[:\-\.\w\u00b7-\uffff]*$/;function _Q(i){return Object.assign(Object.assign({type:"property"},i.completion||{}),{label:i.name})}function YQ(i){return typeof i=="string"?{label:`"${i}"`,type:"constant"}:/^"/.test(i.label)?i:Object.assign(Object.assign({},i),{label:`"${i.label}"`})}function HX(i,e){let t=[],n=[],r=Object.create(null);for(let a of e){let O=_Q(a);t.push(O),a.global&&n.push(O),a.values&&(r[a.name]=a.values.map(YQ))}let s=[],o=[],l=Object.create(null);for(let a of i){let O=n,h=r;a.attributes&&(O=O.concat(a.attributes.map(f=>typeof f=="string"?t.find(u=>u.label==f)||{label:f,type:"property"}:(f.values&&(h==r&&(h=Object.create(h)),h[f.name]=f.values.map(YQ)),_Q(f)))));let c=new ec(a,O,h);l[c.name]=c,s.push(c),a.top&&o.push(c)}o.length||(o=s);for(let a=0;a{var O;let{doc:h}=a.state,c=FX(a.state,a.pos);if(!c||c.type=="tag"&&!a.explicit)return null;let{type:f,from:u,context:p}=c;if(f=="openTag"){let m=o,g=Hh(h,p);if(g){let Q=l[g];m=Q?.children||s}return{from:u,options:m.map(Q=>Q.completion),validFor:Jh}}else if(f=="closeTag"){let m=Hh(h,p);return m?{from:u,to:a.pos+(h.sliceString(a.pos,a.pos+1)==">"?1:0),options:[((O=l[m])===null||O===void 0?void 0:O.closeNameCompletion)||{label:m+">",type:"type"}],validFor:Jh}:null}else if(f=="attrName"){let m=l[Ao(h,p)];return{from:u,options:m?.attrs||n,validFor:Jh}}else if(f=="attrValue"){let m=NX(h,p,u);if(!m)return null;let g=l[Ao(h,p)],Q=(g?.attrValues||r)[m];return!Q||!Q.length?null:{from:u,to:a.pos+(h.sliceString(a.pos,a.pos+1)=='"'?1:0),options:Q,validFor:/^"[^"]*"?$/}}else if(f=="tag"){let m=Hh(h,p),g=l[m],Q=[],S=p&&p.lastChild;m&&(!S||S.name!="CloseTag"||Ao(h,S)!=m)&&Q.push(g?g.closeCompletion:{label:"",type:"type",boost:2});let $=Q.concat((g?.children||(p?s:o)).map(X=>X.openCompletion));if(p&&g?.text.length){let X=p.firstChild;X.to>a.pos-20&&!/\S/.test(a.state.sliceDoc(X.to,a.pos))&&($=$.concat(g.text))}return{from:u,options:$,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}var tc=me.define({name:"xml",parser:CQ.configure({props:[fe.add({Element(i){let e=/^\s*<\//.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},"OpenTag CloseTag SelfClosingTag"(i){return i.column(i.node.from)+i.unit}}),ue.add({Element(i){let e=i.firstChild,t=i.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:t.name=="CloseTag"?t.from:i.to}}}),nr.add({"OpenTag CloseTag":i=>i.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/$/}});function AQ(i={}){let e=[tc.data.of({autocomplete:HX(i.elements||[],i.attributes||[])})];return i.autoCloseTags!==!1&&e.push(KX),new Oe(tc,e)}function VQ(i,e,t=i.length){if(!e)return"";let n=e.firstChild,r=n&&n.getChild("TagName");return r?i.sliceString(r.from,Math.min(r.to,t)):""}var KX=y.inputHandler.of((i,e,t,n,r)=>{if(i.composing||i.state.readOnly||e!=t||n!=">"&&n!="/"||!tc.isActiveAt(i.state,e,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(a=>{var O,h,c;let{head:f}=a,u=o.doc.sliceString(f-1,f)==n,p=V(o).resolveInner(f,-1),m;if(u&&n==">"&&p.name=="EndTag"){let g=p.parent;if(((h=(O=g.parent)===null||O===void 0?void 0:O.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(m=VQ(o.doc,g.parent,f))){let Q=f+(o.doc.sliceString(f,f+1)===">"?1:0),S=``;return{range:a,changes:{from:f,to:Q,insert:S}}}}else if(u&&n=="/"&&p.name=="StartCloseTag"){let g=p.parent;if(p.from==f-2&&((c=g.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(m=VQ(o.doc,g,f))){let Q=f+(o.doc.sliceString(f,f+1)===">"?1:0),S=`${m}>`;return{range:P.cursor(f+S.length,-1),changes:{from:f,to:Q,insert:S}}}}return{range:a}});return l.changes.empty?!1:(i.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});var Sn=63,jQ=64,JX=1,ev=2,UQ=3,tv=4,GQ=5,iv=6,nv=7,LQ=65,rv=66,sv=8,ov=9,lv=10,av=11,Ov=12,DQ=13,hv=19,cv=20,fv=29,uv=33,dv=34,pv=47,mv=0,lc=1,nc=2,Zr=3,rc=4,Mt=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}};Mt.top=new Mt(null,-1,mv);function Rr(i,e){for(let t=0,n=e-i.pos-1;;n--,t++){let r=i.peek(n);if(Ut(r)||r==-1)return t}}function sc(i){return i==32||i==9}function Ut(i){return i==10||i==13}function IQ(i){return sc(i)||Ut(i)}function Vi(i){return i<0||IQ(i)}var gv=new lt({start:Mt.top,reduce(i,e){return i.type==Zr&&(e==cv||e==dv)?i.parent:i},shift(i,e,t,n){if(e==UQ)return new Mt(i,Rr(n,n.pos),lc);if(e==LQ||e==GQ)return new Mt(i,Rr(n,n.pos),nc);if(e==Sn)return i.parent;if(e==hv||e==uv)return new Mt(i,0,Zr);if(e==DQ&&i.type==rc)return i.parent;if(e==pv){let r=/[1-9]/.exec(n.read(n.pos,t.pos));if(r)return new Mt(i,i.depth+ +r[0],rc)}return i},hash(i){return i.hash}});function Pn(i,e,t=0){return i.peek(t)==e&&i.peek(t+1)==e&&i.peek(t+2)==e&&Vi(i.peek(t+3))}var Qv=new U((i,e)=>{if(i.next==-1&&e.canShift(jQ))return i.acceptToken(jQ);let t=i.peek(-1);if((Ut(t)||t<0)&&e.context.type!=Zr){if(Pn(i,45))if(e.canShift(Sn))i.acceptToken(Sn);else return i.acceptToken(JX,3);if(Pn(i,46))if(e.canShift(Sn))i.acceptToken(Sn);else return i.acceptToken(ev,3);let n=0;for(;i.next==32;)n++,i.advance();(n{if(e.context.type==Zr){i.next==63&&(i.advance(),Vi(i.next)&&i.acceptToken(nv));return}if(i.next==45)i.advance(),Vi(i.next)&&i.acceptToken(e.context.type==lc&&e.context.depth==Rr(i,i.pos-1)?tv:UQ);else if(i.next==63)i.advance(),Vi(i.next)&&i.acceptToken(e.context.type==nc&&e.context.depth==Rr(i,i.pos-1)?iv:GQ);else{let t=i.pos;for(;;)if(sc(i.next)){if(i.pos==t)return;i.advance()}else if(i.next==33)BQ(i);else if(i.next==38)oc(i);else if(i.next==42){oc(i);break}else if(i.next==39||i.next==34){if(ac(i,!0))break;return}else if(i.next==91||i.next==123){if(!$v(i))return;break}else{NQ(i,!0,!1,0);break}for(;sc(i.next);)i.advance();if(i.next==58){if(i.pos==t&&e.canShift(fv))return;let n=i.peek(1);Vi(n)&&i.acceptTokenTo(e.context.type==nc&&e.context.depth==Rr(i,t)?rv:LQ,t)}}},{contextual:!0});function Pv(i){return i>32&&i<127&&i!=34&&i!=37&&i!=44&&i!=60&&i!=62&&i!=92&&i!=94&&i!=96&&i!=123&&i!=124&&i!=125}function EQ(i){return i>=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70}function MQ(i,e){return i.next==37?(i.advance(),EQ(i.next)&&i.advance(),EQ(i.next)&&i.advance(),!0):Pv(i.next)||e&&i.next==44?(i.advance(),!0):!1}function BQ(i){if(i.advance(),i.next==60){for(i.advance();;)if(!MQ(i,!0)){i.next==62&&i.advance();break}}else for(;MQ(i,!1););}function oc(i){for(i.advance();!Vi(i.next)&&jo(i.next)!="f";)i.advance()}function ac(i,e){let t=i.next,n=!1,r=i.pos;for(i.advance();;){let s=i.next;if(s<0)break;if(i.advance(),s==t)if(s==39)if(i.next==39)i.advance();else break;else break;else if(s==92&&t==34)i.next>=0&&i.advance();else if(Ut(s)){if(e)return!1;n=!0}else if(e&&i.pos>=r+1024)return!1}return!n}function $v(i){for(let e=[],t=i.pos+1024;;)if(i.next==91||i.next==123)e.push(i.next),i.advance();else if(i.next==39||i.next==34){if(!ac(i,!0))return!1}else if(i.next==93||i.next==125){if(e[e.length-1]!=i.next-2)return!1;if(e.pop(),i.advance(),!e.length)return!0}else{if(i.next<0||i.pos>t||Ut(i.next))return!1;i.advance()}}var bv="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function jo(i){return i<33?"u":i>125?"s":bv[i-33]}function ic(i,e){let t=jo(i);return t!="u"&&!(e&&t=="f")}function NQ(i,e,t,n){if(jo(i.next)=="s"||(i.next==63||i.next==58||i.next==45)&&ic(i.peek(1),t))i.advance();else return!1;let r=i.pos;for(;;){let s=i.next,o=0,l=n+1;for(;IQ(s);){if(Ut(s)){if(e)return!1;l=0}else l++;s=i.peek(++o)}if(!(s>=0&&(s==58?ic(i.peek(o+1),t):s==35?i.peek(o-1)!=32:ic(s,t)))||!t&&l<=n||l==0&&!t&&(Pn(i,45,o)||Pn(i,46,o)))break;if(e&&jo(s)=="f")return!1;for(let O=o;O>=0;O--)i.advance();if(e&&i.pos>r+1024)return!1}return!0}var yv=new U((i,e)=>{if(i.next==33)BQ(i),i.acceptToken(Ov);else if(i.next==38||i.next==42){let t=i.next==38?lv:av;oc(i),i.acceptToken(t)}else i.next==39||i.next==34?(ac(i,!1),i.acceptToken(ov)):NQ(i,!1,e.context.type==Zr,e.context.depth)&&i.acceptToken(sv)}),xv=new U((i,e)=>{let t=e.context.type==rc?e.context.depth:-1,n=i.pos;e:for(;;){let r=0,s=i.next;for(;s==32;)s=i.peek(++r);if(!r&&(Pn(i,45,r)||Pn(i,46,r))||!Ut(s)&&(t<0&&(t=Math.max(e.context.depth+1,r)),rYAN>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~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owSequence 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:gv,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[wv],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:[Qv,Sv,yv,xv,0,1],topRules:{Stream:[0,15]},tokenPrec:0});var kv=de.deserialize({version:14,states:"!vOQOPOOO]OPO'#C_OhOPO'#C^OOOO'#Cc'#CcOpOPO'#CaQOOOOOO{OPOOOOOO'#Cb'#CbO!WOPO'#C`O!`OPO,58xOOOO-E6a-E6aOOOO-E6`-E6`OOOO'#C_'#C_OOOO1G.d1G.d",stateData:"!h~OXPOYROWTP~OWVXXRXYRX~OYVOXSP~OXROYROWTX~OXROYROWTP~OYVOXSX~OX[O~OXY~",goto:"vWPPX[beioRUOQQOR]XRXQTTOUQWQRZWSSOURYS",nodeNames:"\u26A0 Document Frontmatter DashLine FrontmatterContent Body",maxTerm:10,skippedNodes:[0],repeatNodeCount:2,tokenData:"$z~RXOYnYZ!^Z]n]^!^^}n}!O!i!O;'Sn;'S;=`!c<%lOn~qXOYnYZ!^Z]n]^!^^;'Sn;'S;=`!c<%l~n~On~~!^~!cOY~~!fP;=`<%ln~!lZOYnYZ!^Z]n]^!^^}n}!O#_!O;'Sn;'S;=`!c<%l~n~On~~!^~#bZOYnYZ!^Z]n]^!^^}n}!O$T!O;'Sn;'S;=`!c<%l~n~On~~!^~$WXOYnYZ$sZ]n]^$s^;'Sn;'S;=`!c<%l~n~On~~$s~$zOX~Y~",tokenizers:[0],topRules:{Document:[0,1]},tokenPrec:67}),Xv=me.define({name:"yaml",parser:FQ.configure({props:[fe.add({Stream:i=>{for(let e=i.node.resolve(i.pos,-1);e&&e.to>=i.pos;e=e.parent){if(e.name=="BlockLiteralContent"&&e.fromi.pos)return null}}return null},FlowMapping:zt({closing:"}"}),FlowSequence:zt({closing:"]"})}),ue.add({"FlowMapping FlowSequence":rt,"Item Pair BlockLiteral":(i,e)=>({from:e.doc.lineAt(i.from).to,to:i.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function HQ(){return new Oe(Xv)}var kZ=me.define({name:"yaml-frontmatter",parser:kv.configure({props:[le({DashLine:d.meta})]})});var Oc={};function hc(i,e){for(var t=0;t1&&i.eat("$");var t=i.next();return/['"({]/.test(t)?(e.tokens[0]=Eo(t,t=="("?"quote":t=="{"?"def":"string"),$n(i,e)):(/\d/.test(t)||i.eatWhile(/\w/),e.tokens.shift(),"def")};function Rv(i){return function(e,t){return e.sol()&&e.string==i&&t.tokens.shift(),e.skipToEnd(),"string.special"}}function $n(i,e){return(e.tokens[0]||vv)(i,e)}var iS={name:"shell",startState:function(){return{tokens:[]}},token:function(i,e){return $n(i,e)},languageData:{autocomplete:KQ.concat(JQ,eS),closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"#"}}};var nS={name:"toml",startState:function(){return{inString:!1,stringType:"",lhs:!0,inArray:0}},token:function(i,e){let t;if(!e.inString&&(t=i.match(/^('''|"""|'|")/))&&(e.stringType=t[0],e.inString=!0),i.sol()&&!e.inString&&e.inArray===0&&(e.lhs=!0),e.inString){for(;e.inString;)if(i.match(e.stringType))e.inString=!1;else if(i.peek()==="\\")i.next(),i.next();else{if(i.eol())break;i.match(/^.[^\\\"\']*/)}return e.lhs?"property":"string"}else{if(e.inArray&&i.peek()==="]")return i.next(),e.inArray--,"bracket";if(e.lhs&&i.peek()==="["&&i.skipTo("]"))return i.next(),i.peek()==="]"&&i.next(),"atom";if(i.peek()==="#")return i.skipToEnd(),"comment";if(i.eatSpace())return null;if(e.lhs&&i.eatWhile(function(n){return n!="="&&n!=" "}))return"property";if(e.lhs&&i.peek()==="=")return i.next(),e.lhs=!1,null;if(!e.lhs&&i.match(/^\d\d\d\d[\d\-\:\.T]*Z/))return"atom";if(!e.lhs&&(i.match("true")||i.match("false")))return"atom";if(!e.lhs&&i.peek()==="[")return e.inArray++,i.next(),"bracket";if(!e.lhs&&i.match(/^\-?\d+(?:\.\d+)?/))return"number";i.eatSpace()||i.next()}return null},languageData:{commentTokens:{line:"#"}}};var Zv=new Map([["ts","typescript"],["tsx","typescript"],["js","javascript"],["jsx","javascript"],["json","json"],["html","html"],["htm","html"],["xml","xml"],["css","css"],["md","markdown"],["mdx","markdown"],["markdown","markdown"],["py","python"],["rs","rust"],["sh","shell"],["bash","shell"],["zsh","shell"],["yaml","yaml"],["yml","yaml"],["toml","toml"]]);function rS(i){let e=i.split("/").pop();if(e==="Dockerfile"||e==="Makefile")return"shell";let t=e?.split(".").pop()?.toLowerCase();return Zv.get(t)??"plain"}function sS(i){return{text:i,originalText:i,dirty:!1}}function cc(i,e){return{...i,text:e,dirty:e!==i.originalText}}function fc(i,e){return{...i,text:e,originalText:e,dirty:!1}}function oS(i,e,t){let n=cc(fc(i,e),t);return{buffer:n,canContinue:!n.dirty}}function lS(i,e){return i===e}function aS(){let i=0;return{next(){return i+=1,i},isCurrent(e){return e===i}}}function OS(i){let e=new Map;return{get(t){if(!e.has(t))return;let n=e.get(t);return e.delete(t),e.set(t,n),n},set(t,n){for(e.delete(t),e.set(t,n);e.size>i;)e.delete(e.keys().next().value)},deleteWhere(t){for(let n of e.keys())t(n)&&e.delete(n)},clear(){e.clear()}}}function Wv(i){switch(i){case"javascript":case"jsx":return Pr({jsx:!0});case"typescript":case"tsx":return Pr({typescript:!0,jsx:!0});case"json":return fg();case"html":return xo();case"xml":return AQ();case"css":return $o();case"markdown":return rQ();case"python":return yQ();case"rust":return RQ();case"yaml":return HQ();case"shell":return er.define(iS);case"toml":return er.define(nS);default:return[]}}var qv=on.define([{tag:d.keyword,color:"#cbb8ff"},{tag:[d.name,d.variableName,d.propertyName],color:"#f5f2fb"},{tag:d.function(d.variableName),color:"#8bd5ff"},{tag:[d.typeName,d.className],color:"#d6b4ff"},{tag:[d.string,d.character,d.attributeValue],color:"#8fe3b0"},{tag:[d.number,d.bool,d.null],color:"#f5c978"},{tag:[d.comment,d.lineComment,d.blockComment],color:"#8f899f"},{tag:[d.operator,d.punctuation,d.bracket],color:"#c8c2d8"}],{themeType:"dark"}),zv=y.theme({"&":{height:"100%",backgroundColor:"var(--surface-solid)",color:"var(--text-soft)"},"&.cm-focused":{outline:"none"},".cm-content":{caretColor:"var(--accent)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--accent)"},".cm-activeLine":{backgroundColor:"var(--accent-soft)"},".cm-activeLineGutter":{backgroundColor:"var(--accent-soft)",color:"var(--text-soft)"},".cm-selectionBackground, &.cm-focused .cm-selectionBackground":{backgroundColor:"var(--accent-line) !important"},".cm-gutters":{backgroundColor:"var(--surface-1)",color:"var(--muted)",borderRight:"1px solid var(--border)"}},{dark:!0});function Cv(i,e){function t(n){return Number.isFinite(n)?Math.max(0,Math.min(e,Math.trunc(n))):0}return{anchor:t(i?.anchor),head:t(i?.head)}}function cS(i){let e=i.selection.main,t=e.head,n=i.doc.lineAt(t);return{anchor:e.anchor,head:e.head,line:n.number,column:t-n.from+1}}function uc({text:i="",languageId:e="plain",readOnly:t=!1,cspNonce:n="",selection:r,onChange:s,onSelectionChange:o}){let l=typeof s=="function"?s:()=>{},a=typeof o=="function"?o:()=>{};return G.create({doc:i,selection:Cv(r,i.length),extensions:[rm,Gs(qv),zv,Wv(e),y.editable.of(!t),G.readOnly.of(t),y.cspNonce.of(n),y.contentAttributes.of({"aria-label":"File editor"}),y.updateListener.of(O=>{O.docChanged&&l(O.state.doc.toString()),(O.selectionSet||O.docChanged)&&a(cS(O.state))})]})}function _v({parent:i,onChange:e,onSelectionChange:t}){let n=typeof e=="function"?e:()=>{},r=typeof t=="function"?t:()=>{},s=document.getElementById("codemirror-nonce-source").nonce,o=new y({parent:i,state:uc({cspNonce:s,onChange:n,onSelectionChange:r})});function l({text:c="",languageId:f="plain",readOnly:u=!1,selection:p}){o.setState(uc({text:c,languageId:f,readOnly:u,cspNonce:s,selection:p,onChange:n,onSelectionChange:r})),r(cS(o.state))}function a(){return o.state.doc.toString()}function O(){o.focus()}function h(){o.destroy()}return{setDocument:l,getText:a,focus:O,destroy:h}}var Yv=y.theme({"&":{height:"100%",backgroundColor:"var(--surface-solid)",color:"var(--text-soft)"},"&.cm-focused":{outline:"none"},".cm-gutters":{backgroundColor:"var(--surface-1)",color:"var(--muted)",borderRight:"1px solid var(--border)"},".cm-diff-hunk":{backgroundColor:"var(--accent-soft)",color:"var(--accent)"},".cm-diff-meta":{color:"var(--muted)"},".cm-diff-add":{backgroundColor:"rgba(80, 200, 140, 0.09)",color:"var(--ok)"},".cm-diff-delete":{backgroundColor:"rgba(255, 110, 120, 0.09)",color:"var(--error)"}},{dark:!0});function fS(i){return i.startsWith("@@")?"cm-diff-hunk":/^(?:diff |index |---|\+\+\+)/.test(i)?"cm-diff-meta":i.startsWith("+")?"cm-diff-add":i.startsWith("-")?"cm-diff-delete":""}function hS(i){let e=[],t=new Set;for(let n of i.visibleRanges){let r=i.state.doc.lineAt(n.from);for(;r.from<=n.to;){if(!t.has(r.from)){t.add(r.from);let s=fS(r.text);s&&e.push(Z.line({class:s}).range(r.from))}if(r.to===i.state.doc.length)break;r=i.state.doc.lineAt(r.to+1)}}return Z.set(e,!0)}var Vv=ie.fromClass(class{constructor(i){this.decorations=hS(i)}update(i){(i.docChanged||i.viewportChanged)&&(this.decorations=hS(i.view))}},{decorations:i=>i.decorations});function dc({text:i="",cspNonce:e=""}={}){return G.create({doc:i,extensions:[Xs(),Yv,Vv,y.editable.of(!1),G.readOnly.of(!0),y.cspNonce.of(e),y.contentAttributes.of({"aria-label":"Unified diff viewer","aria-readonly":"true",tabindex:"0"})]})}function Av({parent:i}){let e=document.getElementById("codemirror-nonce-source").nonce,t=new y({parent:i,state:dc({cspNonce:e})});function n({text:o=""}={}){t.setState(dc({text:o,cspNonce:e}))}function r(){n({text:""})}function s(){t.destroy()}return{setDiff:n,clear:r,destroy:s}}return QS(jv);})(); diff --git a/native/macos/psyche-build-tauri/web/index.html b/native/macos/psyche-build-tauri/web/index.html index b840c87e..33760ed2 100644 --- a/native/macos/psyche-build-tauri/web/index.html +++ b/native/macos/psyche-build-tauri/web/index.html @@ -75,6 +75,10 @@ Browser — web⌘⌥B + diff --git a/native/macos/psyche-build-tauri/web/main.js b/native/macos/psyche-build-tauri/web/main.js index 517aeb84..2b479db0 100644 --- a/native/macos/psyche-build-tauri/web/main.js +++ b/native/macos/psyche-build-tauri/web/main.js @@ -86,7 +86,10 @@ var COVEN_POLL_MS = 5000; var paneCounter = 0; var visiblePaneFitFrame = 0; - var PANE_MINIMUMS = { width: 320, height: 120, separator: 6 }; + // Matches --pane-min-w / --pane-min-h: the tree's arithmetic and the pane's + // own CSS floor have to agree, or a layout the tree calls valid renders + // overflowing. 200x110 is the density the redesign tiles at. + var PANE_MINIMUMS = { width: 200, height: 110, separator: 6 }; function handleVisibilityChange() { if (document.visibilityState === "hidden") { @@ -147,6 +150,52 @@ var project = activeProject(); return project ? paneLayoutFor(project.id, activeWorkspaceRoot(project)) : null; } + function activePaneLayoutKey() { + var project = activeProject(); + return project ? paneLayoutKey(project.id, activeWorkspaceRoot(project)) : null; + } + + // -------- Focus sets -------- + // A set is a named, colour-coded subset of the panes on one canvas. It scopes + // what the canvas draws; it never changes the tiling underneath, and it never + // gains or loses a pane except when the user says so. + // + // Sets are keyed by pane layout (project + worktree) for the same reason the + // tiling is: a set that spanned two worktrees would have no single canvas to + // scope. They live for the session — restoring them is a follow-up. + var focusSets = []; + var setPicking = null; + var SET_COLOR_COUNT = 4; + + function setsForKey(key) { + return focusSets.filter(function (set) { return set.key === key; }); + } + + /** The sets a pane belongs to, for its row's membership swatches. */ + function setsForThread(thread) { + if (!thread) return []; + var key = paneLayoutKey(thread.projectId, thread.worktreePath); + return focusSets.filter(function (set) { + return set.key === key && set.threadIds.indexOf(thread.id) !== -1; + }); + } + + function findFocusSet(id) { + for (var i = 0; i < focusSets.length; i++) { + if (focusSets[i].id === id) return focusSets[i]; + } + return null; + } + + /** The set scoping the active canvas, if it still has members. */ + function activeFocusSet() { + var layout = activePaneLayout(); + if (!layout || !layout.activeSetId) return null; + var set = findFocusSet(layout.activeSetId); + if (set && set.threadIds.length) return set; + layout.activeSetId = null; + return null; + } function activatePaneLayoutFocus(project, worktreePath) { project.selectedWorktreePath = worktreePath; var layout = paneLayoutFor(project.id, worktreePath); @@ -1268,6 +1317,10 @@ ((thread.kind || "shell") === "shell" ? "is-term" : "is-agent"); glyph.textContent = paneGlyphFor(thread.kind); glyph.setAttribute("aria-hidden", "true"); + // Title and meta share one grid track so they ellipsize against each other + // instead of against the buttons. + var label = document.createElement("span"); + label.className = "terminal-pane-label"; var title = document.createElement("span"); title.className = "terminal-pane-title"; title.id = "terminal-pane-title-" + thread.id; @@ -1275,11 +1328,25 @@ pane.setAttribute("aria-labelledby", title.id); var meta = document.createElement("span"); meta.className = "terminal-pane-meta"; - var spacer = document.createElement("span"); - spacer.className = "terminal-pane-spacer"; + label.appendChild(title); + label.appendChild(meta); var status = document.createElement("span"); status.className = "terminal-pane-status"; applyPaneStatus(status, thread.status); + var span = document.createElement("button"); + span.type = "button"; + span.className = "terminal-pane-span"; + span.addEventListener("click", function (event) { + event.stopPropagation(); + cyclePaneSpan(thread); + }); + var maximize = document.createElement("button"); + maximize.type = "button"; + maximize.className = "terminal-pane-max"; + maximize.addEventListener("click", function (event) { + event.stopPropagation(); + togglePaneMaximize(thread); + }); var close = document.createElement("button"); close.type = "button"; close.className = "terminal-pane-close"; @@ -1298,11 +1365,18 @@ startPaneReposition(thread, event); }); header.appendChild(glyph); - header.appendChild(title); - header.appendChild(meta); - header.appendChild(spacer); + header.appendChild(label); header.appendChild(status); + header.appendChild(span); + header.appendChild(maximize); header.appendChild(close); + // Double-clicking the header is the mouse route into focus mode, mirroring + // the maximise button so the gesture and the control agree. + header.addEventListener("dblclick", function (event) { + if (event.target && event.target.closest && event.target.closest("button")) return; + event.preventDefault(); + togglePaneMaximize(thread); + }); // Retry lost its header button, so the pane's own context menu carries it. // The sidebar row cannot: PR #54 hides exited rows, and exited is exactly // the state you retry from. @@ -1336,6 +1410,8 @@ thread.paneTitle = title; thread.paneMeta = meta; thread.paneStatus = status; + thread.paneSpan = span; + thread.paneMax = maximize; thread.paneClose = close; syncThreadPaneMetadata(thread); renderPaneWorkspace(); @@ -1403,9 +1479,10 @@ thread.fit = fit; } - // "running" is the steady state of nearly every pane, so spelling it out in - // every header is noise. Running panes get a live dot instead; the states you - // actually need to read - starting, exited, failed - keep their word. + // Status never travels as colour alone: starting, exited and failed are + // worded chips. Running is the one exception, and only because it is the + // steady state of nearly every pane — it gets a static green dot, and the + // word stays in the title and aria-label so nothing is lost without colour. function applyPaneStatus(element, status) { if (!element) return; var label = status || ""; @@ -1418,6 +1495,11 @@ function handlePanePointerDown(thread, body, close, event) { var target = event.target; if ((body && body.contains(target)) || (close && close.contains(target))) return; + // Every header button re-renders the canvas, and renderPaneWorkspace + // detaches and re-appends the panes — a target that leaves the document + // between pointerdown and pointerup never gets its click. Focusing here + // would therefore swallow the first press of span, maximise and close. + if (target && target.closest && target.closest("button")) return; if (state.activeThreadId !== thread.id) focusThread(thread.id); } @@ -1656,14 +1738,285 @@ if (!Number.isFinite(ratio)) return false; var layout = activePaneLayout(); if (!layout || !layout.root || (expectedLayout && layout !== expectedLayout)) return false; - var nextRoot = PsychePanes.resizeSplit(layout.root, splitId, ratio); - if (nextRoot === layout.root) return false; - layout.root = nextRoot; + // While spanning, the dividers on screen belong to the derived tree — the + // drag has to land there or it would resize a split nobody can see. + var spanning = Boolean(layout.spanMode) && Boolean(layout.spanRoot) && + !layout.maximizedLeafId && layout.spanRoot !== layout.root; + var current = spanning ? layout.spanRoot : layout.root; + var nextRoot = PsychePanes.resizeSplit(current, splitId, ratio); + if (nextRoot === current) return false; + if (spanning) layout.spanRoot = nextRoot; + else layout.root = nextRoot; renderPaneWorkspace(); if (restoreFocus) focusPaneDivider(splitId); return true; } + // Span cycle: ▦ tiled → ▥ the pane takes a full column, the others stack to + // its side → ▤ it takes a full row, the others line up below → tiled again. + // The mode is named for what the spanned pane gets; the top-level split runs + // along the other axis, which is what SPAN_ORIENTATION translates. + var SPAN_ORIENTATION = { column: "row", row: "column" }; + + function spanSignature(layout, base) { + return layout.spanMode + "|" + layout.focusedLeafId + "|" + + PsychePanes.leafIds(base).join(","); + } + + /** + * The tiled tree narrowed to the set scoping this canvas, or the tiled tree + * itself. A set whose panes have all gone stops scoping rather than leaving + * an empty canvas behind. + */ + function scopedPaneRoot(layout) { + if (!layout.activeSetId) return layout.root; + var set = findFocusSet(layout.activeSetId); + if (!set || !set.threadIds.length) { + layout.activeSetId = null; + return layout.root; + } + var scoped = PsychePanes.retainThreads(layout.root, set.threadIds); + if (!scoped) { + layout.activeSetId = null; + return layout.root; + } + return scoped; + } + + /** + * The tree the canvas actually draws. Maximise and span are presentation + * modes, so neither one edits the tiled tree — leaving them restores exactly + * the layout you had, and a pane opened or closed mid-mode still lands in the + * tiling underneath. The derived tree is cached against a signature so that + * dragging its dividers keeps the ratios instead of rebuilding them away. + */ + function effectivePaneRoot(layout) { + if (!layout || !layout.root) return null; + // Focus mode is one pane by definition, so it outranks both other modes. + if (layout.maximizedLeafId) { + var maximized = PsychePanes.findLeafById(layout.root, layout.maximizedLeafId); + if (maximized) return maximized; + layout.maximizedLeafId = null; + } + // Scope first, then span: spanning re-tiles whatever the canvas is showing, + // which inside a set is the set. + var base = scopedPaneRoot(layout); + if (!layout.spanMode) return base; + var signature = spanSignature(layout, base); + if (!layout.spanRoot || layout.spanSignature !== signature) { + layout.spanRoot = PsychePanes.spanLayout( + base, + layout.focusedLeafId, + SPAN_ORIENTATION[layout.spanMode], + "span" + ); + layout.spanSignature = signature; + } + return layout.spanRoot; + } + + function paneLayoutForThread(thread) { + return thread ? paneLayoutFor(thread.projectId, thread.worktreePath) : null; + } + + // -------- Focus-set interactions -------- + + /** Enter multi-select. The set is only created when the user confirms. */ + function beginSetPicking() { + var key = activePaneLayoutKey(); + var layout = activePaneLayout(); + if (!key || !layout || !layout.root) { + toast("Open some panes first — a focus set is a subset of them"); + return false; + } + setPicking = { key: key, picked: [] }; + refreshSidebar(); + return true; + } + + function cancelSetPicking() { + if (!setPicking) return false; + setPicking = null; + refreshSidebar(); + return true; + } + + function isPicked(threadId) { + return Boolean(setPicking) && setPicking.picked.indexOf(threadId) !== -1; + } + + function toggleSetPick(threadId) { + if (!setPicking) return; + var at = setPicking.picked.indexOf(threadId); + if (at === -1) setPicking.picked.push(threadId); + else setPicking.picked.splice(at, 1); + refreshSidebar(); + } + + function createFocusSet() { + if (!setPicking || !setPicking.picked.length) return null; + var key = setPicking.key; + // Colours cycle through the four set swatches; a fifth set on one canvas + // reuses the first colour rather than inventing an unnamed one. + var index = (setsForKey(key).length % SET_COLOR_COUNT) + 1; + var set = { + id: nextPaneId("set"), + index: index, + name: "Set " + (setsForKey(key).length + 1), + key: key, + threadIds: setPicking.picked.slice(), + }; + focusSets.push(set); + setPicking = null; + activateFocusSet(set.id); + toast(set.name + " — " + set.threadIds.length + " panes"); + return set; + } + + function activateFocusSet(setId) { + var layout = activePaneLayout(); + if (!layout) return false; + var set = findFocusSet(setId); + if (!set || !set.threadIds.length) return false; + layout.activeSetId = setId; + // A set is a different canvas; the modes that framed the old one do not + // carry over. + layout.maximizedLeafId = null; + layout.spanRoot = null; + layout.spanSignature = null; + refreshSidebar(); + return true; + } + + function clearFocusSet() { + var layout = activePaneLayout(); + if (!layout || !layout.activeSetId) return false; + layout.activeSetId = null; + layout.spanRoot = null; + layout.spanSignature = null; + refreshSidebar(); + return true; + } + + /** + * Board 8's rule: clicking a member scopes the canvas to its set, and + * clicking anything that is not in a set returns to all panes. Selection + * flows through the rows themselves rather than a standing chip bar. + */ + function applySetScopeForThread(thread) { + var sets = setsForThread(thread); + if (!sets.length) return clearFocusSet(); + var layout = paneLayoutForThread(thread); + if (layout && layout.activeSetId === sets[0].id) return false; + return activateFocusSet(sets[0].id); + } + + function removeFromFocusSet(setId, threadId) { + var set = findFocusSet(setId); + if (!set) return false; + var at = set.threadIds.indexOf(threadId); + if (at === -1) return false; + set.threadIds.splice(at, 1); + var layout = activePaneLayout(); + if (!set.threadIds.length && layout && layout.activeSetId === setId) { + layout.activeSetId = null; + toast(set.name + " is empty — showing all panes"); + } + if (layout) { layout.spanRoot = null; layout.spanSignature = null; } + refreshSidebar(); + return true; + } + + /** Drop a closed pane out of every set, so no set points at a dead thread. */ + function forgetThreadInSets(threadId) { + focusSets.forEach(function (set) { + var at = set.threadIds.indexOf(threadId); + if (at !== -1) set.threadIds.splice(at, 1); + }); + focusSets = focusSets.filter(function (set) { return set.threadIds.length > 0; }); + } + + function cyclePaneSpan(thread) { + var layout = paneLayoutForThread(thread); + if (!layout || !layout.root) return; + var leaf = PsychePanes.findLeafByThreadId(layout.root, thread.id); + if (!leaf) return; + // Spanning a different pane restarts the cycle rather than continuing the + // previous pane's position in it. + var continuing = layout.spanMode && layout.focusedLeafId === leaf.id; + layout.spanMode = !continuing + ? "column" + : layout.spanMode === "column" ? "row" : null; + layout.focusedLeafId = leaf.id; + layout.maximizedLeafId = null; + layout.spanRoot = null; + layout.spanSignature = null; + if (state.activeThreadId !== thread.id) { + focusThread(thread.id); + return; + } + renderPaneWorkspace(); + } + + function togglePaneMaximize(thread) { + var layout = paneLayoutForThread(thread); + if (!layout || !layout.root) return; + var leaf = PsychePanes.findLeafByThreadId(layout.root, thread.id); + if (!leaf) return; + layout.maximizedLeafId = layout.maximizedLeafId === leaf.id ? null : leaf.id; + layout.focusedLeafId = leaf.id; + if (state.activeThreadId !== thread.id) { + focusThread(thread.id); + return; + } + renderPaneWorkspace(); + } + + /** Leave focus mode; reports whether there was one to leave (esc cascade). */ + function exitPaneMaximize() { + var layout = activePaneLayout(); + if (!layout || !layout.maximizedLeafId) return false; + layout.maximizedLeafId = null; + renderPaneWorkspace(); + return true; + } + + var SPAN_GLYPHS = { column: "▥", row: "▤" }; + var SPAN_TITLES = { + tiled: "Span this pane — full column (⇥ full row, ⇥ tiled)", + column: "Spanning a full column — click for a full row", + row: "Spanning a full row — click to return to tiled", + }; + + function syncPaneSpanControl(thread, layout, leaf) { + if (!thread.paneSpan) return; + var spanned = Boolean(leaf) && layout.spanMode && layout.focusedLeafId === leaf.id; + var mode = spanned ? layout.spanMode : "tiled"; + thread.paneSpan.textContent = spanned ? SPAN_GLYPHS[layout.spanMode] : "▦"; + thread.paneSpan.title = SPAN_TITLES[mode]; + thread.paneSpan.setAttribute("aria-label", SPAN_TITLES[mode]); + thread.paneSpan.setAttribute("aria-pressed", spanned ? "true" : "false"); + } + + var MAX_ICON = + ''; + var RESTORE_ICON = + ''; + + function syncPaneMaxControl(thread, layout, leaf) { + if (!thread.paneMax) return; + var maxed = Boolean(leaf) && layout.maximizedLeafId === leaf.id; + var label = maxed ? "Restore the tiling (esc)" : "Focus this pane"; + thread.paneMax.innerHTML = maxed ? RESTORE_ICON : MAX_ICON; + thread.paneMax.title = label; + thread.paneMax.setAttribute("aria-label", label); + thread.paneMax.setAttribute("aria-pressed", maxed ? "true" : "false"); + } + function renderPaneNode(node, splitRatios) { if (node.type === "leaf") { var thread = findThread(node.threadId); @@ -1696,8 +2049,9 @@ renderTerminalEmptyState(); return; } + var root = effectivePaneRoot(layout); var projected = PsychePanes.layoutRects( - layout.root, + root, measuredTerminalHost(), PANE_MINIMUMS ); @@ -1705,16 +2059,166 @@ projected.splits.forEach(function (split) { splitRatios.set(split.splitId, split.ratio); }); - terminalHost.appendChild(renderPaneNode(layout.root, splitRatios)); - projected.leaves.forEach(function (leaf) { - var thread = findThread(leaf.threadId); + terminalHost.appendChild(renderPaneNode(root, splitRatios)); + // Span and maximise change what every *other* pane's controls should say, + // so the whole tiled tree is synced, not just the panes on screen. + PsychePanes.leafIds(layout.root).forEach(function (leafId) { + var leaf = PsychePanes.findLeafById(layout.root, leafId); + var thread = leaf && findThread(leaf.threadId); if (!thread || !thread.pane) return; thread.pane.classList.toggle("focused", thread.id === state.activeThreadId); + syncPanePicking(thread); syncThreadPaneMetadata(thread); }); + renderSetPickBar(); + renderPaneMinimap(layout); scheduleVisiblePaneFit(); } + /** + * While picking, a tile is a checkbox. The overlay takes the click so the + * gesture never reaches the terminal underneath — a stray keystroke into a + * live shell is not an acceptable cost for selecting a pane. + */ + function syncPanePicking(thread) { + var pane = thread.pane; + var picking = Boolean(setPicking); + pane.classList.toggle("is-picking", picking); + pane.classList.toggle("is-picked", picking && isPicked(thread.id)); + var overlay = pane.querySelector(".pane-pick-overlay"); + if (!picking) { + if (overlay) overlay.remove(); + return; + } + if (!overlay) { + overlay = document.createElement("button"); + overlay.type = "button"; + overlay.className = "pane-pick-overlay"; + overlay.addEventListener("click", function (event) { + event.stopPropagation(); + toggleSetPick(thread.id); + }); + pane.appendChild(overlay); + } + var picked = isPicked(thread.id); + overlay.textContent = picked ? "✓" : ""; + overlay.title = (picked ? "Remove " : "Include ") + thread.name + " in the set"; + overlay.setAttribute("aria-label", overlay.title); + overlay.setAttribute("aria-pressed", picked ? "true" : "false"); + } + + /** + * The pick bar is the only chrome a focus set ever gets, and it only exists + * while you are picking — Board 10's "zero standing chrome". Built here + * rather than in index.html for the same reason. + */ + function renderSetPickBar() { + if (!terminalArea) return; + var bar = terminalArea.querySelector(".set-pick-bar"); + if (!setPicking) { + if (bar) bar.remove(); + return; + } + if (!bar) { + bar = document.createElement("div"); + bar.className = "set-pick-bar"; + bar.setAttribute("role", "toolbar"); + bar.setAttribute("aria-label", "Focus set selection"); + terminalArea.insertBefore(bar, terminalHost); + } + var count = setPicking.picked.length; + bar.replaceChildren(); + + var hint = document.createElement("span"); + hint.className = "set-pick-hint"; + hint.title = "Click tiles or sidebar rows to include them — the set shows only what you pick"; + var dot = document.createElement("span"); + dot.className = "set-pick-dot"; + hint.appendChild(dot); + hint.appendChild(document.createTextNode("Pick panes")); + + var create = document.createElement("button"); + create.type = "button"; + create.className = "set-pick-create"; + create.textContent = "Create · " + count; + create.disabled = count === 0; + create.title = count + ? "Create the set — the canvas will show only these panes" + : "Pick at least one pane"; + create.addEventListener("click", function () { createFocusSet(); }); + + var cancel = document.createElement("button"); + cancel.type = "button"; + cancel.className = "set-pick-cancel"; + cancel.textContent = "×"; + cancel.title = "Cancel (esc)"; + cancel.setAttribute("aria-label", "Cancel picking"); + cancel.addEventListener("click", function () { cancelSetPicking(); }); + + bar.appendChild(hint); + bar.appendChild(create); + bar.appendChild(cancel); + } + + /** + * Focus mode hides every pane but one, so the minimap is how the others stay + * reachable — a carousel of the panes the canvas is no longer drawing. + */ + function renderPaneMinimap(layout) { + if (!terminalArea) return; + var rail = terminalArea.querySelector(".pane-minimap"); + if (!layout || !layout.maximizedLeafId) { + if (rail) rail.remove(); + return; + } + if (!rail) { + rail = document.createElement("aside"); + rail.className = "pane-minimap"; + rail.setAttribute("aria-label", "Pane minimap"); + terminalArea.appendChild(rail); + } + rail.replaceChildren(); + var scopedIds = PsychePanes.leafIds(scopedPaneRoot(layout)); + scopedIds.forEach(function (leafId) { + var leaf = PsychePanes.findLeafById(layout.root, leafId); + var thread = leaf && findThread(leaf.threadId); + if (!thread) return; + var entry = document.createElement("button"); + entry.type = "button"; + entry.className = "minimap-pane" + + (layout.maximizedLeafId === leafId ? " is-current" : ""); + entry.title = thread.name + " — " + (thread.status || "") + + " · click to focus this pane"; + entry.setAttribute("aria-label", entry.title); + + var head = document.createElement("span"); + head.className = "minimap-head"; + var glyph = document.createElement("span"); + glyph.className = "minimap-glyph"; + glyph.textContent = paneGlyphFor(thread.kind); + var dot = document.createElement("span"); + dot.className = "minimap-dot " + sessionStatusClass(thread); + head.appendChild(glyph); + head.appendChild(dot); + + var body = document.createElement("span"); + body.className = "minimap-body"; + var name = document.createElement("span"); + name.className = "minimap-name"; + name.textContent = thread.name; + + entry.appendChild(head); + entry.appendChild(body); + entry.appendChild(name); + entry.addEventListener("click", function () { + layout.maximizedLeafId = leafId; + layout.focusedLeafId = leafId; + focusThread(thread.id); + }); + rail.appendChild(entry); + }); + } + async function focusThread(id) { var thread = findThread(id); if (!thread) return false; @@ -1756,11 +2260,19 @@ if (thread.paneTitle) thread.paneTitle.textContent = thread.name; if (thread.paneMeta) { thread.paneMeta.textContent = (thread.kind || "shell") + " · " + - shortenRoot(thread.worktreePath || ""); + threadLaneLabel(thread); } if (thread.paneStatus) { applyPaneStatus(thread.paneStatus, thread.status); } + var layout = paneLayoutForThread(thread); + var leaf = layout && layout.root + ? PsychePanes.findLeafByThreadId(layout.root, thread.id) + : null; + if (layout) { + syncPaneSpanControl(thread, layout, leaf); + syncPaneMaxControl(thread, layout, leaf); + } if (thread.paneClose) { thread.paneClose.setAttribute("aria-label", "Stop and close " + thread.name); } @@ -1793,6 +2305,9 @@ thread.closeStarted = true; thread.closing = true; pendingDataBuffers.delete(id); + // A set must never point at a thread that no longer exists, or scoping the + // canvas to it would silently show fewer panes than it claims. + forgetThreadInSets(id); var nextThreadId = detachThreadPane(thread); if (!thread.startInFlight) stopThreadPty(thread); if (thread.term && thread.term.dispose) { @@ -1939,7 +2454,7 @@ var layout = activePaneLayout(); if (!layout || !layout.root) return; var projected = PsychePanes.layoutRects( - layout.root, + effectivePaneRoot(layout), measuredTerminalHost(), PANE_MINIMUMS ); @@ -2114,6 +2629,102 @@ return "✳"; } + /** + * The row's leading glyph. It reports the lane's git state rather than the + * pane's kind, because "has this lane got uncommitted work in it" is the + * question the sidebar gets scanned for — the kind is one line below. + * Colour is never the only carrier: the glyph shape and the tooltip both + * say the same thing. + */ + function sessionGitState(worktree) { + if (worktree && worktree.dirty) { + return { glyph: "±", className: "git-dirty", tip: "Uncommitted changes" }; + } + return { glyph: "⎇", className: "git-clean", tip: "Clean working tree" }; + } + + /** Meta line's second half: the branch if there is one, else the path. */ + function sessionLaneLabel(worktree) { + if (!worktree) return ""; + return worktree.branch || shortenRoot(worktree.path); + } + + /** + * The same lane label from a thread, so a pane header and its sidebar row + * never disagree about which lane the pane is in. + */ + function threadLaneLabel(thread) { + var path = (thread && thread.worktreePath) || ""; + var project = thread && findProject(thread.projectId); + var worktrees = (project && project.worktrees) || []; + for (var i = 0; i < worktrees.length; i++) { + if (worktrees[i].path === path) return sessionLaneLabel(worktrees[i]); + } + return shortenRoot(path); + } + + /** + * Focus-set membership swatches. Squares, in the set's colour, so they can't + * be read as a status light. A pane in no set renders nothing. + */ + function sessionSetSwatches(thread) { + var sets = setsForThread(thread); + if (!sets.length) return ""; + return '' + sets.map(function (set) { + var index = Math.min(4, Math.max(1, Number(set.index) || 1)); + var name = "In " + (set.name || "a focus set"); + return ''; + }).join("") + ""; + } + + var SESSION_CLOSE_SECONDS = 3; + /** The armed row's teardown, so a second row disarms the first. */ + var armedSessionClose = null; + + function disarmSessionClose() { + if (!armedSessionClose) return; + var armed = armedSessionClose; + armedSessionClose = null; + clearInterval(armed.timer); + armed.confirm.remove(); + if (armed.close.isConnected) armed.close.hidden = false; + } + + /** + * Closing a pane stops a process, so it never happens on a single click. The + * × swaps for a countdown pill that has to be clicked again, and that cancels + * itself when the timer runs out — the guard costs nothing if you meant it + * and everything if you didn't. + */ + function armSessionClose(wrapper, close, thread) { + disarmSessionClose(); + var left = SESSION_CLOSE_SECONDS; + var confirm = document.createElement("button"); + confirm.type = "button"; + confirm.className = "session-close-confirm"; + confirm.title = "Click to confirm — auto-cancels when the timer runs out"; + function paint() { + confirm.textContent = "Close · " + left; + confirm.setAttribute("aria-label", "Confirm closing " + thread.name); + } + paint(); + confirm.addEventListener("click", function (event) { + event.stopPropagation(); + disarmSessionClose(); + closeThread(thread.id); + }); + close.hidden = true; + wrapper.appendChild(confirm); + var timer = setInterval(function () { + left -= 1; + if (left <= 0) { disarmSessionClose(); return; } + paint(); + }, 1000); + armedSessionClose = { timer: timer, confirm: confirm, close: close }; + confirm.focus(); + } + function sessionStatusClass(thread) { if (thread.spawning || thread.status === "starting") return "starting"; if (thread.status === "running") return "running"; @@ -2262,6 +2873,9 @@ function renderSessionList() { if (!sessionListEl) return; if (editingContext && editingContext.surface === "sidebar") return; + // A re-render would strand an armed confirm on a row that no longer exists, + // and an armed confirm is a question the user has not answered — drop it. + disarmSessionClose(); sessionListEl.innerHTML = ""; var currentSearchQuery = sessionFilter; @@ -2320,7 +2934,12 @@ projectBadge.setAttribute("aria-label", projectAttention + " sessions need attention"); head.appendChild(projectBadge); } - head.addEventListener("click", function () { setActiveProject(project.id); }); + // The project header is the "show me everything again" affordance: it is + // the one row that is above any set. + head.addEventListener("click", function () { + clearFocusSet(); + setActiveProject(project.id); + }); group.appendChild(head); visibleWorktrees.forEach(function (entry) { @@ -2438,22 +3057,30 @@ var row = document.createElement("button"); row.type = "button"; var kind = thread.kind || "shell"; + var picking = Boolean(setPicking); + var picked = picking && isPicked(thread.id); row.className = "session-row " + sessionStatusClass(thread) + " kind-" + (kind === "shell" ? "shell" : "agent") + - (state.activeThreadId === thread.id ? " active" : ""); + (state.activeThreadId === thread.id ? " active" : "") + + (picking ? " is-picking" : "") + (picked ? " is-picked" : ""); row.dataset.threadId = thread.id; if (state.activeThreadId === thread.id) row.setAttribute("aria-current", "true"); - row.title = thread.name + " — " + worktree.path + - (onCanvas ? " · on the canvas" : " · click to put it back on the canvas") + - " · double-click to rename"; + if (picking) row.setAttribute("aria-pressed", picked ? "true" : "false"); + row.title = picking + ? (picked ? "Remove " : "Include ") + thread.name + " in the set" + : thread.name + " — " + worktree.path + + (onCanvas ? " · on the canvas" : " · click to put it back on the canvas") + + " · double-click to rename"; var chipMarkup = ""; if (thread.status === "exited") { chipMarkup = 'exited'; } else if (thread.spawning || thread.status === "starting") { chipMarkup = 'starting'; } + var git = sessionGitState(worktree); row.innerHTML = - '' + escapeHtml(paneGlyphFor(kind)) + "" + + '' + escapeHtml(git.glyph) + "" + '' + '' + '' + escapeHtml(thread.name) + "" + @@ -2463,15 +3090,20 @@ '' + '' : "") + + sessionSetSwatches(thread) + "" + '' + - escapeHtml(kind + " · " + shortenRoot(worktree.path)) + + escapeHtml(kind + " · " + sessionLaneLabel(worktree)) + "" + "" + '' + chipMarkup + ""; row.addEventListener("click", async function () { + // While picking, a row is a checkbox — it must not also focus the + // pane, or selecting would keep yanking the canvas around. + if (setPicking) { toggleSetPick(thread.id); return; } if (project.id !== state.activeProjectId && !(await setActiveProject(project.id))) return; + applySetScopeForThread(thread); await focusThread(thread.id); }); var titleEl = row.querySelector(".session-title"); @@ -2502,8 +3134,19 @@ beginSessionRename(e); }); row.addEventListener("contextmenu", function (event) { + var memberships = setsForThread(thread); openSessionContextMenu(event, [ { label: "Focus", run: function () { focusThread(thread.id); } }, + memberships.length + ? { label: "Show only " + memberships[0].name, run: function () { + activateFocusSet(memberships[0].id); + } } + : null, + memberships.length + ? { label: "Remove from " + memberships[0].name, run: function () { + removeFromFocusSet(memberships[0].id, thread.id); + } } + : null, { label: "Rename…", run: function () { beginSessionRename({ stopPropagation: function () {} }); } }, @@ -2514,23 +3157,38 @@ ? { label: "Interrupt", run: function () { sendToThread(thread, "\x03"); } } : null, { label: "Hide", run: function () { hideThread(thread.id); } }, - { label: "Stop and close", danger: true, run: function () { closeThread(thread.id); } }, + // Stopping a session kills a process, so it never lands on one + // click: the row arms a countdown that has to be confirmed and + // cancels itself if it isn't. + { label: "Stop and close", danger: true, run: function () { + armSessionClose(wrapper, close, thread); + } }, ]); }); var close = document.createElement("button"); close.type = "button"; close.className = "session-close"; - // × detaches the pane's leaf from the tree and hides the row. The - // PTY keeps running — the worktree menu reopens hidden sessions. - close.title = onCanvas - ? "Hide the pane — the session keeps running" - : "Hide session"; + // Inside a set, × means "not part of this set" — the narrower, more + // likely intent when the canvas is already scoped. Outside one it + // detaches the pane's leaf from the tree and hides the row; the PTY + // keeps running and the worktree menu reopens it. Both are reversible + // and frequent, so both stay a single click. The timed confirm guards + // "Stop and close", which is neither. + var scopingSet = activeFocusSet(); + var inScopingSet = Boolean(scopingSet) && + scopingSet.threadIds.indexOf(thread.id) !== -1; + close.title = inScopingSet + ? "Remove from " + scopingSet.name + " — the pane stays open" + : onCanvas + ? "Hide the pane — the session keeps running" + : "Hide session"; close.setAttribute("aria-label", close.title); close.textContent = "×"; close.addEventListener("click", function (e) { e.stopPropagation(); - hideThread(thread.id); + if (inScopingSet) removeFromFocusSet(scopingSet.id, thread.id); + else hideThread(thread.id); }); wrapper.appendChild(row); wrapper.appendChild(close); @@ -4507,6 +5165,7 @@ openBlankBrowserTab(); toast("Browser opened in the tools dock"); }); + onMenuClick("new-pane-set", function () { beginSetPicking(); }); onMenuClick("new-pane-project", function () { openProjectPicker(); }); document.addEventListener("pointerdown", function (event) { @@ -4566,10 +5225,19 @@ var tag = (event.target && event.target.tagName ? event.target.tagName : "").toLowerCase(); var typing = tag === "input" || tag === "textarea" || tag === "select" || (event.target && event.target.isContentEditable); + // Esc cascade — one key, most-transient layer first, so it never skips + // past something the user is looking at to undo something they aren't: + // help → menus → set picking → armed confirm → focus mode. if (event.key === "Escape") { if (helpOverlayEl && !helpOverlayEl.hidden) { setHelpOpen(false); return; } + var menuWasOpen = (newPaneMenuEl && !newPaneMenuEl.hidden) || + (scopeMenuEl && !scopeMenuEl.hidden); closeNewPaneMenu(); closeScopeMenu(); + if (menuWasOpen) return; + if (cancelSetPicking()) return; + if (armedSessionClose) { disarmSessionClose(); return; } + if (!typing && exitPaneMaximize()) return; return; } if (typing || event.metaKey || event.ctrlKey || event.altKey) return; diff --git a/native/macos/psyche-build-tauri/web/panes.bundle.js b/native/macos/psyche-build-tauri/web/panes.bundle.js index 5ed93d0f..ab66a1aa 100644 --- a/native/macos/psyche-build-tauri/web/panes.bundle.js +++ b/native/macos/psyche-build-tauri/web/panes.bundle.js @@ -1 +1 @@ -"use strict";var PsychePanes=(()=>{var L=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var G=Object.prototype.hasOwnProperty;var J=(e,n)=>{for(var t in n)L(e,t,{get:n[t],enumerable:!0})},K=(e,n,t,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of D(n))!G.call(e,r)&&r!==t&&L(e,r,{get:()=>n[r],enumerable:!(i=k(n,r))||i.enumerable});return e};var Q=e=>K(L({},"__esModule",{value:!0}),e);var X={};J(X,{canFit:()=>I,createLeaf:()=>C,findLeafById:()=>h,findLeafByThreadId:()=>v,insertBelow:()=>E,insertRelative:()=>p,layoutRects:()=>P,leafIds:()=>d,moveLeaf:()=>H,removeLeaf:()=>q,resizeSplit:()=>W,splitOrientation:()=>F});var O="column";var T={above:{orientation:O,before:!0},below:{orientation:O,before:!1},left:{orientation:"row",before:!0},right:{orientation:"row",before:!1}};function F(e){return e&&e.orientation==="row"?"row":O}function C(e,n){return{type:"leaf",id:e,threadId:n}}function d(e){return e?e.type==="leaf"?[e.id]:[...d(e.first),...d(e.second)]:[]}function h(e,n){return e?e.type==="leaf"?e.id===n?e:null:h(e.first,n)||h(e.second,n):null}function v(e,n){return e?e.type==="leaf"?e.threadId===n?e:null:v(e.first,n)||v(e.second,n):null}function p(e,n,t,i,r){let f=T[r];if(!f)return e;if(!e)return t;if(e.type==="leaf")return e.id!==n?e:{type:"split",id:i,orientation:f.orientation,ratio:.5,first:f.before?t:e,second:f.before?e:t};let s=p(e.first,n,t,i,r);if(s!==e.first)return{...e,first:s};let c=p(e.second,n,t,i,r);return c===e.second?e:{...e,second:c}}function E(e,n,t,i){return p(e,n,t,i,"below")}function m(e,n){if(e.type==="leaf")return e.id===n?null:e;let t=m(e.first,n);if(!t)return e.second;if(t!==e.first)return{...e,first:t};let i=m(e.second,n);return i?i===e.second?e:{...e,second:i}:e.first}function q(e,n){if(!e)return{root:null,nextLeafId:null};let t=d(e),i=t.indexOf(n);if(i===-1)return{root:e,nextLeafId:t[0]||null};let r=m(e,n),f=d(r);return{root:r,nextLeafId:f[i]||f[i-1]||null}}function H(e,n,t,i,r){if(!e||n===t||!T[i])return e;let f=h(e,n);if(!f||!h(e,t))return e;let s=m(e,n);return!s||!h(s,t)?e:p(s,t,{...f},r,i)}function M(e){return Number.isFinite(e)?Math.max(0,e):0}function V(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):.5}function x(e,n,t){if(!e)return 0;if(e.type==="leaf")return M(t==="width"?n.width:n.height);let i=x(e.first,n,t),r=x(e.second,n,t);return(F(e)==="row"?"width":"height")===t?i+M(n.separator)+r:Math.max(i,r)}function I(e,n,t){return!e||n.width>=x(e,t,"width")&&n.height>=x(e,t,"height")}function W(e,n,t){if(!e||e.type==="leaf")return e;if(e.id===n)return{...e,ratio:Math.min(1,Math.max(0,t))};let i=W(e.first,n,t);if(i!==e.first)return{...e,first:i};let r=W(e.second,n,t);return r===e.second?e:{...e,second:r}}function P(e,n,t){let i=[],r=[];function f(s,c,l,U,j){let w=M(U),R=M(j);if(s.type==="leaf"){i.push({leafId:s.id,threadId:s.threadId,x:c,y:l,width:w,height:R});return}let u=F(s)==="row",g=u?"width":"height",z=u?w:R,b=Math.min(z,M(t.separator)),y=z-b,B=x(s.first,t,g),N=y-x(s.second,t,g),S=Math.round(y*V(s.ratio)),a=N>=B?Math.min(N,Math.max(B,S)):S,A=y-a;r.push({splitId:s.id,orientation:u?"row":O,x:u?c+a:c,y:u?l:l+a,width:u?b:w,height:u?R:b,ratio:y>0?a/y:0}),u?(f(s.first,c,l,a,R),f(s.second,c+a+b,l,A,R)):(f(s.first,c,l,w,a),f(s.second,c,l+a+b,w,A))}return e&&f(e,n.x,n.y,n.width,n.height),{leaves:i,splits:r}}return Q(X);})(); +"use strict";var PsychePanes=(()=>{var B=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var Q=(e,n)=>{for(var t in n)B(e,t,{get:n[t],enumerable:!0})},V=(e,n,t,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of J(n))!K.call(e,r)&&r!==t&&B(e,r,{get:()=>n[r],enumerable:!(i=G(n,r))||i.enumerable});return e};var X=e=>V(B({},"__esModule",{value:!0}),e);var Z={};Q(Z,{canFit:()=>j,createLeaf:()=>k,findLeafById:()=>l,findLeafByThreadId:()=>M,insertBelow:()=>q,insertRelative:()=>R,layoutRects:()=>D,leafIds:()=>x,moveLeaf:()=>P,removeLeaf:()=>H,resizeSplit:()=>F,retainThreads:()=>L,spanLayout:()=>U,splitOrientation:()=>S});var y="column";var E={above:{orientation:y,before:!0},below:{orientation:y,before:!1},left:{orientation:"row",before:!0},right:{orientation:"row",before:!1}};function S(e){return e&&e.orientation==="row"?"row":y}function k(e,n){return{type:"leaf",id:e,threadId:n}}function x(e){return e?e.type==="leaf"?[e.id]:[...x(e.first),...x(e.second)]:[]}function l(e,n){return e?e.type==="leaf"?e.id===n?e:null:l(e.first,n)||l(e.second,n):null}function M(e,n){return e?e.type==="leaf"?e.threadId===n?e:null:M(e.first,n)||M(e.second,n):null}function R(e,n,t,i,r){let s=E[r];if(!s)return e;if(!e)return t;if(e.type==="leaf")return e.id!==n?e:{type:"split",id:i,orientation:s.orientation,ratio:.5,first:s.before?t:e,second:s.before?e:t};let f=R(e.first,n,t,i,r);if(f!==e.first)return{...e,first:f};let c=R(e.second,n,t,i,r);return c===e.second?e:{...e,second:c}}function q(e,n,t,i){return R(e,n,t,i,"below")}function v(e,n){if(e.type==="leaf")return e.id===n?null:e;let t=v(e.first,n);if(!t)return e.second;if(t!==e.first)return{...e,first:t};let i=v(e.second,n);return i?i===e.second?e:{...e,second:i}:e.first}function H(e,n){if(!e)return{root:null,nextLeafId:null};let t=x(e),i=t.indexOf(n);if(i===-1)return{root:e,nextLeafId:t[0]||null};let r=v(e,n),s=x(r);return{root:r,nextLeafId:s[i]||s[i-1]||null}}function P(e,n,t,i,r){if(!e||n===t||!E[i])return e;let s=l(e,n);if(!s||!l(e,t))return e;let f=v(e,n);return!f||!l(f,t)?e:R(f,t,{...s},r,i)}function L(e,n){if(!e)return null;let t=n instanceof Set?n:new Set(n||[]);if(e.type==="leaf")return t.has(e.threadId)?e:null;let i=L(e.first,t),r=L(e.second,t);return i?r?i===e.first&&r===e.second?e:{...e,first:i,second:r}:i:r}function U(e,n,t,i){if(!e)return e;let r=l(e,n);if(!r)return e;let s=x(e).filter(u=>u!==n).map(u=>l(e,u)).filter(Boolean);if(!s.length)return e;let f=t==="row"?"row":y,c=f==="row"?y:"row",a=i||"span",w={...s[s.length-1]};for(let u=s.length-2;u>=0;u-=1){let p=s.length-u;w={type:"split",id:`${a}-${u}`,orientation:c,ratio:1/p,first:{...s[u]},second:w}}return{type:"split",id:`${a}-main`,orientation:f,ratio:.5,first:{...r},second:w}}function g(e){return Number.isFinite(e)?Math.max(0,e):0}function Y(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):.5}function O(e,n,t){if(!e)return 0;if(e.type==="leaf")return g(t==="width"?n.width:n.height);let i=O(e.first,n,t),r=O(e.second,n,t);return(S(e)==="row"?"width":"height")===t?i+g(n.separator)+r:Math.max(i,r)}function j(e,n,t){return!e||n.width>=O(e,t,"width")&&n.height>=O(e,t,"height")}function F(e,n,t){if(!e||e.type==="leaf")return e;if(e.id===n)return{...e,ratio:Math.min(1,Math.max(0,t))};let i=F(e.first,n,t);if(i!==e.first)return{...e,first:i};let r=F(e.second,n,t);return r===e.second?e:{...e,second:r}}function D(e,n,t){let i=[],r=[];function s(f,c,a,w,u){let p=g(w),m=g(u);if(f.type==="leaf"){i.push({leafId:f.id,threadId:f.threadId,x:c,y:a,width:p,height:m});return}let h=S(f)==="row",z=h?"width":"height",N=h?p:m,W=Math.min(N,g(t.separator)),b=N-W,A=O(f.first,t,z),T=b-O(f.second,t,z),$=Math.round(b*Y(f.ratio)),d=T>=A?Math.min(T,Math.max(A,$)):$,C=b-d;r.push({splitId:f.id,orientation:h?"row":y,x:h?c+d:c,y:h?a:a+d,width:h?W:p,height:h?m:W,ratio:b>0?d/b:0}),h?(s(f.first,c,a,d,m),s(f.second,c+d+W,a,C,m)):(s(f.first,c,a,p,d),s(f.second,c,a+d+W,p,C))}return e&&s(e,n.x,n.y,n.width,n.height),{leaves:i,splits:r}}return X(Z);})(); diff --git a/native/macos/psyche-build-tauri/web/panes/pane-entry.js b/native/macos/psyche-build-tauri/web/panes/pane-entry.js index 746245ce..eb4712e1 100644 --- a/native/macos/psyche-build-tauri/web/panes/pane-entry.js +++ b/native/macos/psyche-build-tauri/web/panes/pane-entry.js @@ -10,5 +10,7 @@ export { moveLeaf, removeLeaf, resizeSplit, + retainThreads, + spanLayout, splitOrientation, } from "./pane-tree.mjs"; diff --git a/native/macos/psyche-build-tauri/web/panes/pane-tree.mjs b/native/macos/psyche-build-tauri/web/panes/pane-tree.mjs index 48e17a4e..c598903f 100644 --- a/native/macos/psyche-build-tauri/web/panes/pane-tree.mjs +++ b/native/macos/psyche-build-tauri/web/panes/pane-tree.mjs @@ -122,6 +122,83 @@ export function moveLeaf(root, leafId, targetLeafId, position, splitId) { return insertRelative(pruned, targetLeafId, { ...moving }, splitId, position); } +/** + * Keep only the leaves whose threadId is in `threadIds`, collapsing any split + * left holding a single child. Used to scope the canvas to a focus set without + * touching the tiled tree — the panes that drop out are still in the layout, + * they are simply not drawn. + * + * Returns null when nothing survives, so the caller can tell "this set is + * empty" from "this set is everything". + */ +export function retainThreads(root, threadIds) { + if (!root) return null; + const keep = threadIds instanceof Set ? threadIds : new Set(threadIds || []); + if (root.type === "leaf") return keep.has(root.threadId) ? root : null; + + const first = retainThreads(root.first, keep); + const second = retainThreads(root.second, keep); + if (!first) return second; + if (!second) return first; + if (first === root.first && second === root.second) return root; + return { ...root, first, second }; +} + +/** + * Re-tile the whole canvas around one pane. `orientation` is the axis of the + * top-level split, so ROW gives the pane a full column with the others stacked + * beside it, and COLUMN gives it a full row with the others lined up below. + * + * The result is a *derived* tree — the caller keeps its tiled root untouched + * and rebuilds this one whenever the membership or the spanned pane changes. + * That is why the split ids are deterministic (`-0`, `-1`, …): a + * rebuild has to land on the same ids or every divider would lose its ratio. + * + * Returns the original root when there is nothing to span — no pane, an + * unknown pane, or a canvas of one. + */ +export function spanLayout(root, leafId, orientation, idPrefix) { + if (!root) return root; + const target = findLeafById(root, leafId); + if (!target) return root; + + const others = leafIds(root) + .filter((id) => id !== leafId) + .map((id) => findLeafById(root, id)) + .filter(Boolean); + if (!others.length) return root; + + const primaryAxis = orientation === ROW ? ROW : COLUMN; + // The others stack along the opposite axis: a pane holding a full column + // leaves a column beside it, which is filled top to bottom. + const crossAxis = primaryAxis === ROW ? COLUMN : ROW; + const prefix = idPrefix || "span"; + + // Right-leaning chain with descending ratios, so n panes end up n equal + // shares rather than halving away to nothing. + let rest = { ...others[others.length - 1] }; + for (let index = others.length - 2; index >= 0; index -= 1) { + const remaining = others.length - index; + rest = { + type: "split", + id: `${prefix}-${index}`, + orientation: crossAxis, + ratio: 1 / remaining, + first: { ...others[index] }, + second: rest, + }; + } + + return { + type: "split", + id: `${prefix}-main`, + orientation: primaryAxis, + ratio: 0.5, + first: { ...target }, + second: rest, + }; +} + function nonNegativeFinite(value) { return Number.isFinite(value) ? Math.max(0, value) : 0; } diff --git a/native/macos/psyche-build-tauri/web/styles.css b/native/macos/psyche-build-tauri/web/styles.css index ebd1ddf0..439b817e 100644 --- a/native/macos/psyche-build-tauri/web/styles.css +++ b/native/macos/psyche-build-tauri/web/styles.css @@ -44,28 +44,43 @@ --border: rgba(255, 255, 255, 0.07); --border-strong: rgba(255, 255, 255, 0.14); - /* Text */ - --text: #f5f2fb; - --text-soft: #c8c2d8; - --muted: #8a8499; - - /* Semantic */ - --ok: #7be3b3; + /* Text — contrast measured on bg/1. --faint is decorative only; nothing a + user has to read is allowed to land on it. */ + --text: #ededf0; /* ~15.2:1 — titles, values */ + --text-soft: #b6b6bf; /* ~8.7:1 — body, transcript */ + --muted: #8b8b96; /* ~5.2:1 — meta, >= 10.5px */ + --faint: #6e6e79; /* ~3.4:1 — decorative hints */ + + /* Semantic — operational truth. Always paired with a word, count or shape, + never colour alone. */ + --ok: #34d399; --warn: #fbbf24; --error: #f87171; + /* Focus-set membership. Squares, never dots, so a set swatch can't be + mistaken for a round status light. */ + --set-1: #5eead4; + --set-2: #f0abfc; + --set-3: #93c5fd; + --set-4: #bef264; + /* Geometry */ --titlebar-h: 40px; --titlebar-pad-l: 78px; /* leaves room for traffic lights */ --rail-w: 44px; --sidebar-w: 276px; + --sidebar-min: 220px; + --sidebar-max: 420px; --mini-rail-w: 46px; --tab-h: 30px; --command-h: 46px; --composer-h: 54px; --dock-tabs-h: 40px; + --session-row-h: 44px; --pane-head-h: 32px; --pane-gap: 2px; + --pane-min-w: 200px; + --pane-min-h: 110px; --browser-bar-h: 38px; --browser-tab-h: 22px; --splitter-w: 10px; @@ -384,10 +399,10 @@ kbd { .session-coven-row { display: flex; align-items: center; - gap: 8px; + gap: 9px; width: 100%; padding: 6px 8px; - border-radius: 8px; + border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--text-soft); @@ -395,6 +410,9 @@ kbd { position: relative; transition: background var(--transition-fast), color var(--transition-fast); } +/* Border-box 44px: the row is a fixed rhythm the eye can scan down, and the + two-line text column is what sets it. */ +.session-row { min-height: var(--session-row-h); } .session-row:hover { background: var(--surface-2); color: var(--text); } .session-row-wrap { position: relative; @@ -411,9 +429,14 @@ kbd { transform: translateY(-50%); } .session-row-wrap:hover .session-row:not(.active) { background: var(--surface-2); color: var(--text); } + +/* Selection is deliberately colourless — a neutral raised fill (bg/3). The + violet is a separate signal layered on top: the 2px bar means "this row is + the pane the keyboard is talking to", which is why it can coexist with the + fill instead of replacing it. */ .session-row.active { - background: var(--accent-soft); - border-color: var(--accent-line); + background: var(--surface-3); + border-color: transparent; color: var(--text); } .session-row.active::before { @@ -423,45 +446,49 @@ kbd { top: 50%; transform: translateY(-50%); width: 2px; - height: 18px; + height: 22px; border-radius: 999px; - background: linear-gradient(180deg, var(--accent), var(--accent-strong)); + background: var(--accent); box-shadow: 0 0 6px var(--accent-glow); } -.session-row:focus-visible { outline: none; border-color: var(--accent-line); } +.session-row:focus-visible { outline: none; box-shadow: var(--focus-ring); } .session-dot { - width: 6px; - height: 6px; - flex: 0 0 6px; + width: 7px; + height: 7px; + flex: 0 0 7px; border-radius: 999px; background: var(--muted); transition: background var(--transition-fast), box-shadow var(--transition-fast); } .session-row.running .dot, -.session-row.running .session-dot { background: var(--ok); box-shadow: 0 0 6px rgba(123, 227, 179, 0.5); } +.session-row.running .session-dot { background: var(--ok); box-shadow: 0 0 6px rgba(52, 211, 153, 0.5); } .session-row.exited .session-dot { background: var(--error); } .session-row.starting .session-dot { background: var(--warn); animation: session-dot-pulse 1.1s ease-in-out infinite; } @keyframes session-dot-pulse { 50% { opacity: 0.35; } } +/* No gap: the two line-heights plus the row's padding come to just under 44px, + so min-height lands the row on exactly the designed 44 instead of 45. */ .session-text { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; - gap: 1px; + gap: 0; } .session-title { display: block; - font-size: 13.5px; - line-height: 1.35; + font-size: 12.5px; + font-weight: 550; + line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .session-sub { display: block; - font-size: 11.5px; + font-family: var(--font-mono); + font-size: 10.5px; line-height: 1.3; color: var(--muted); white-space: nowrap; @@ -858,7 +885,8 @@ body.split-resizing[data-axis="y"] { cursor: row-resize; } .terminal-area { display: grid; - grid-template-rows: auto minmax(0, 1fr); + grid-template-rows: auto auto minmax(0, 1fr); + grid-template-columns: minmax(0, 1fr) auto; min-width: 0; min-height: 0; background: rgba(var(--rgb-term), calc(var(--bg-opacity) * 0.55)); @@ -1022,8 +1050,8 @@ body.split-resizing[data-axis="y"] { cursor: row-resize; } .terminal-pane { display: grid; grid-template-rows: 24px minmax(0, 1fr); - min-width: 320px; - min-height: 120px; + min-width: var(--pane-min-w); + min-height: var(--pane-min-h); height: 100%; overflow: hidden; border: 1px solid var(--border); @@ -1100,9 +1128,27 @@ body.split-resizing[data-axis="y"] { cursor: row-resize; } grid-template-rows: var(--pane-head-h) minmax(0, 1fr); border-radius: 4px; background: rgba(var(--rgb-s1), calc(var(--bg-opacity) * 0.86)); + /* Panes degrade on their own width, not the window's: a pane can be narrow + in a wide window and wide in a narrow one, and it is the pane's width that + decides whether its meta line still fits. */ + container-type: inline-size; + container-name: pane; } -.terminal-pane.focused { border-color: var(--accent-line); } + +/* The focused pane is the one place violet fills anything. Ring plus header + tint, matched by the 2px bar on its sidebar row. */ +.terminal-pane.focused { + border-color: rgba(var(--rgb-accent), 0.55); + box-shadow: 0 0 0 1px rgba(var(--rgb-accent), 0.22); +} + +/* Six tracks: glyph · label · status · span · maximise · close. The label is + the only flexible one, so the buttons keep their footprint at any width + instead of being squeezed out of the row. */ .terminal-pane-header { + display: grid; + grid-template-columns: auto minmax(0, 1fr) auto auto auto auto; + align-items: center; gap: 8px; padding: 0 6px 0 8px; background: rgba(255, 255, 255, 0.025); @@ -1110,6 +1156,16 @@ body.split-resizing[data-axis="y"] { cursor: row-resize; } user-select: none; } .terminal-pane.focused .terminal-pane-header { background: rgba(var(--rgb-accent), 0.07); } + +/* Title and meta share one track and ellipsize independently: the title gives + up space last (flex 0 1) and the meta first (flex 0 4). */ +.terminal-pane-label { + display: flex; + align-items: baseline; + gap: 8px; + min-width: 0; + overflow: hidden; +} .terminal-pane-glyph { flex: none; width: 19px; @@ -1127,6 +1183,11 @@ body.split-resizing[data-axis="y"] { cursor: row-resize; } .terminal-pane-glyph.is-term { font-size: 8px; } .terminal-pane-title { flex: 0 1 auto; + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + color: var(--text); font-size: 12.5px; font-weight: 600; } @@ -1140,49 +1201,84 @@ body.split-resizing[data-axis="y"] { cursor: row-resize; } font-size: 10.5px; color: var(--muted); } -.terminal-pane-spacer { flex: 1 1 auto; } + +/* Status is a worded chip, never a bare colour. Running is the exception and + only because it is the steady state of nearly every pane: a static green dot + carries it, and the word stays in the aria-label. */ .terminal-pane-status { + justify-self: end; + padding: 1px 8px; + border-radius: 999px; + background: rgba(255, 255, 255, 0.07); + color: var(--muted); font-size: 10px; - font-weight: 600; - color: var(--ok); + font-weight: 700; + white-space: nowrap; +} +.terminal-pane-status:empty { display: none; } +.terminal-pane-status.starting { + background: rgba(251, 191, 36, 0.14); + color: var(--warn); +} +.terminal-pane-status.failed { + background: rgba(248, 113, 113, 0.14); + color: var(--error); +} +.terminal-pane-status.exited { + background: rgba(255, 255, 255, 0.07); + color: var(--muted); } -.terminal-pane-status.starting { color: var(--warn); } -.terminal-pane-status.exited { color: var(--muted); } - -/* Running panes carry a dot instead of the word: it reads as "alive" at a - glance and costs a fraction of the header width. The element keeps its - aria-label, so nothing is lost to a screen reader. */ .terminal-pane-status.running { - width: 6px; - height: 6px; + display: block; + width: 7px; + height: 7px; + padding: 0; border-radius: 50%; background: var(--ok); - box-shadow: 0 0 0 3px rgba(var(--rgb-accent), 0.10); + box-shadow: 0 0 6px rgba(52, 211, 153, 0.5); align-self: center; - animation: pane-status-pulse 2.4s ease-in-out infinite; -} - -@keyframes pane-status-pulse { - 0%, 100% { opacity: 1; } - 50% { opacity: 0.45; } -} - -@media (prefers-reduced-motion: reduce) { - .terminal-pane-status.running { animation: none; } } +/* Header controls: span cycle, maximise, close. Identical footprint so the + three read as one group and the row never reflows as states change. */ +.terminal-pane-span, +.terminal-pane-max, .terminal-pane-close { + flex: none; width: 22px; height: 20px; + border: 0; border-radius: 5px; + background: transparent; + color: var(--muted); display: inline-flex; align-items: center; justify-content: center; - font-size: 13px; + font-size: 11px; line-height: 1; transition: background var(--transition-fast), color var(--transition-fast); } +.terminal-pane-close { font-size: 13px; } +.terminal-pane-span:hover, +.terminal-pane-max:hover, .terminal-pane-close:hover { background: var(--surface-3); color: var(--text); } +.terminal-pane-span:focus-visible, +.terminal-pane-max:focus-visible, +.terminal-pane-close:focus-visible { outline: none; box-shadow: var(--focus-ring); } +/* An engaged span or maximise is a mode you are currently in, and violet is + how this app says "here". */ +.terminal-pane-span[aria-pressed="true"], +.terminal-pane-max[aria-pressed="true"] { color: var(--accent); } + +/* Pane tiers. Information drops in reverse order of usefulness: the meta line + is repeated in the sidebar, the status word is not. */ +@container pane (max-width: 460px) { + .terminal-pane-meta { display: none; } +} +@container pane (max-width: 300px) { + .terminal-pane-status:not(.running) { display: none; } + .terminal-pane-header { gap: 4px; padding: 0 4px 0 6px; } +} .terminal-pane-divider { background: transparent; border-color: transparent; @@ -1237,6 +1333,167 @@ body.is-pane-dragging .terminal-pane { transition: opacity var(--transition-fast .pane-drop-indicator { transition: none; } } +/* -------- Focus sets -------- + A set is a colour-coded subset of the panes on one canvas. Membership shows + as a square swatch on the row; the only chrome a set ever gets is the pick + bar, and that exists only while you are picking. */ + +.set-pick-bar { + display: flex; + align-items: center; + gap: 6px; + padding: 6px 8px 4px; + animation: menu-rise 140ms ease-out; +} +.set-pick-hint { + display: inline-flex; + align-items: center; + gap: 6px; + font-size: 11px; + font-weight: 650; + color: #d6c8ff; +} +.set-pick-dot { + width: 6px; + height: 6px; + border-radius: 999px; + background: var(--accent); + animation: session-dot-pulse 1.4s ease-in-out infinite; +} +.set-pick-create { + border: 1px solid var(--accent-line); + border-radius: 7px; + background: var(--accent-soft); + color: #d6c8ff; + font-size: 11px; + font-weight: 650; + padding: 3px 11px; + transition: background var(--transition-fast); +} +.set-pick-create:hover:not(:disabled) { background: rgba(var(--rgb-accent), 0.26); } +/* Disabled rather than hidden: the count is the feedback that picking works. */ +.set-pick-create:disabled { opacity: 0.35; } +.set-pick-cancel { + display: inline-flex; + align-items: center; + justify-content: center; + width: 22px; + height: 22px; + border: 1px solid var(--border-strong); + border-radius: 6px; + background: transparent; + color: var(--muted); + font-size: 12px; +} +.set-pick-cancel:hover { color: var(--text); } +.set-pick-create:focus-visible, +.set-pick-cancel:focus-visible { outline: none; box-shadow: var(--focus-ring); } + +/* Picking dims the canvas and rings the picks. The overlay is a real button so + the click never reaches the terminal underneath. */ +.terminal-pane { position: relative; } +.terminal-pane.is-picking { opacity: 0.55; } +.terminal-pane.is-picked { + opacity: 1; + border-color: rgba(var(--rgb-accent), 0.7); +} +.pane-pick-overlay { + position: absolute; + inset: 0; + z-index: 5; + display: flex; + align-items: flex-start; + justify-content: flex-end; + padding: 6px; + border: 0; + border-radius: 4px; + background: transparent; + color: var(--accent); + font-size: 14px; + font-weight: 700; + cursor: pointer; +} +.terminal-pane.is-picked .pane-pick-overlay { background: rgba(var(--rgb-accent), 0.10); } +.pane-pick-overlay:focus-visible { outline: none; box-shadow: inset var(--focus-ring); } + +.session-row.is-picking { opacity: 0.7; } +.session-row.is-picked { + opacity: 1; + background: var(--accent-soft); + box-shadow: inset 0 0 0 1px var(--accent-line); +} + +@media (prefers-reduced-motion: reduce) { + .set-pick-bar { animation: none; } + .set-pick-dot { animation: none; } +} + +/* -------- Pane minimap -------- + Focus mode draws one pane, so the minimap is how the rest stay reachable. */ + +.pane-minimap { + width: 78px; + min-height: 0; + display: flex; + flex-direction: column; + gap: 6px; + overflow-y: auto; + padding: 8px 6px 4px 0; + scrollbar-width: none; +} +.pane-minimap::-webkit-scrollbar { display: none; } +.minimap-pane { + flex: none; + display: flex; + flex-direction: column; + gap: 3px; + padding: 5px; + border: 1px solid var(--border); + border-radius: 5px; + background: rgba(var(--rgb-s1), calc(var(--bg-opacity) * 0.8)); + opacity: 0.75; + transition: opacity var(--transition-fast), border-color var(--transition-fast); +} +.minimap-pane:hover { opacity: 1; border-color: var(--accent-line); } +.minimap-pane.is-current { + opacity: 1; + border-color: rgba(var(--rgb-accent), 0.55); + background: rgba(var(--rgb-accent), 0.08); +} +.minimap-pane:focus-visible { outline: none; box-shadow: var(--focus-ring); } +.minimap-head { display: flex; align-items: center; gap: 4px; width: 100%; } +.minimap-glyph { + font-family: var(--font-mono); + font-size: 8px; + color: var(--muted); +} +.minimap-dot { + margin-left: auto; + width: 5px; + height: 5px; + border-radius: 999px; + background: var(--muted); +} +.minimap-dot.running { background: var(--ok); } +.minimap-dot.starting { background: var(--warn); } +.minimap-dot.exited { background: var(--error); } +/* A blank slab, not a live preview: it reads as "a pane is here" at 66px wide + without paying to render a second terminal. */ +.minimap-body { + height: 26px; + border-radius: 3px; + background: rgba(var(--rgb-term), calc(var(--bg-opacity) * 0.9)); +} +.minimap-name { + width: 100%; + font-size: 9px; + color: var(--text-soft); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + text-align: left; +} + /* -------- Empty canvas -------- */ .canvas-empty { @@ -1710,9 +1967,14 @@ body.is-pane-dragging .terminal-pane { transition: opacity var(--transition-fast terminal's grid row. An author `display` beats the hidden attribute's UA rule, so [hidden] has to be restored explicitly. */ -.tab-strip { grid-row: 1; } -.terminal-host { grid-row: 2; } -.file-view { grid-row: 2; } +/* Row 2 and column 2 are the transient ones: the focus-set pick bar and the + focus-mode minimap. Both tracks are `auto`, so an absent element costs + nothing rather than reserving a gap. */ +.tab-strip { grid-row: 1; grid-column: 1 / -1; } +.set-pick-bar { grid-row: 2; grid-column: 1 / -1; } +.terminal-host { grid-row: 3; grid-column: 1; } +.file-view { grid-row: 3; grid-column: 1 / -1; } +.pane-minimap { grid-row: 3; grid-column: 2; } .file-view[hidden] { display: none; } .file-view { @@ -2866,7 +3128,12 @@ body.is-pane-dragging .terminal-pane { transition: opacity var(--transition-fast } .new-pane-sep { height: 1px; background: var(--border); margin: 4px 6px; } -/* Session rows gain a kind glyph, an on-canvas marker, and a state chip. */ +/* Session row anatomy, left to right: git-state glyph · name (+ on-canvas mark, + + set swatches) over meta · status dot + worded chip · slide-out close. */ + +/* The leading glyph reports the worktree's git state, not the pane's kind — + the kind is already in the meta line, and "does this lane have work in it" + is the question you actually scan the sidebar for. */ .session-glyph { flex: none; width: 20px; @@ -2878,11 +3145,27 @@ body.is-pane-dragging .terminal-pane { transition: opacity var(--transition-fast background: rgba(255, 255, 255, 0.05); color: var(--muted); font-family: var(--font-mono); - font-size: 10px; + font-size: 11px; } -.session-row.kind-agent .session-glyph { color: var(--accent); } +.session-glyph.git-dirty { color: var(--warn); } +.session-glyph.git-staged { color: var(--ok); } +.session-glyph.git-clean { color: var(--muted); } .session-title-row { display: flex; align-items: center; gap: 6px; min-width: 0; } .session-oncanvas { flex: none; color: var(--accent); display: inline-flex; } + +/* Set membership is a square in the set's colour. Square vs. round is the + whole distinction from a status dot, so it must never be rounded past 2px. */ +.session-sets { flex: none; display: inline-flex; align-items: center; gap: 3px; } +.session-set-swatch { + width: 7px; + height: 7px; + border-radius: 2px; + background: var(--set-1); +} +.session-set-swatch[data-set="2"] { background: var(--set-2); } +.session-set-swatch[data-set="3"] { background: var(--set-3); } +.session-set-swatch[data-set="4"] { background: var(--set-4); } + .session-state { flex: none; display: flex; @@ -2902,6 +3185,39 @@ body.is-pane-dragging .terminal-pane { transition: opacity var(--transition-fast } .session-chip.muted { background: rgba(255, 255, 255, 0.07); color: var(--muted); } +/* Closing a pane kills a process, so one click can't do it. The × swaps for a + countdown pill that cancels itself — the fast path stays one gesture, but + the destructive half needs a second, deliberate one. */ +.session-close-confirm { + position: absolute; + right: 6px; + top: 50%; + transform: translateY(-50%); + display: inline-flex; + align-items: center; + gap: 5px; + padding: 3px 9px; + border: 1px solid rgba(248, 113, 113, 0.5); + border-radius: 6px; + background: rgba(40, 18, 20, 0.98); + color: #f4a6a6; + font-size: 10.5px; + font-weight: 700; + line-height: 1; + white-space: nowrap; + box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); + animation: close-confirm-slide 170ms ease-out; +} +.session-close-confirm:hover { background: rgba(248, 113, 113, 0.2); color: #ffd7d7; } +.session-close-confirm:focus-visible { outline: none; box-shadow: var(--focus-ring); } +@keyframes close-confirm-slide { + from { opacity: 0; transform: translateY(-50%) translateX(12px); } + to { opacity: 1; transform: translateY(-50%) translateX(0); } +} +@media (prefers-reduced-motion: reduce) { + .session-close-confirm { animation: none; } +} + /* -------- Toast -------- */ .toast {